Upstream version 8.36.155.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / xwalk_runner_tizen.cc
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "xwalk/runtime/browser/xwalk_runner_tizen.h"
6
7 #include "content/public/browser/browser_thread.h"
8 #include "crypto/nss_util.h"
9 #include "xwalk/runtime/browser/sysapps_component.h"
10 #include "xwalk/runtime/browser/xwalk_component.h"
11 #include "xwalk/runtime/common/xwalk_runtime_features.h"
12
13 namespace xwalk {
14
15 XWalkRunnerTizen::XWalkRunnerTizen() {}
16
17 XWalkRunnerTizen::~XWalkRunnerTizen() {}
18
19 // static
20 XWalkRunnerTizen* XWalkRunnerTizen::GetInstance() {
21   return static_cast<XWalkRunnerTizen*>(XWalkRunner::GetInstance());
22 }
23
24 void XWalkRunnerTizen::PreMainMessageLoopRun() {
25   XWalkRunner::PreMainMessageLoopRun();
26
27   // NSSInitSingleton is a costly operation (up to 100ms on VTC-1010),
28   // resulting in postponing the parsing and composition steps of the render
29   // process at cold start. Therefore, move the initialization logic here.
30   if (XWalkRunner::is_running_as_service()) {
31     content::BrowserThread::PostTask(
32         content::BrowserThread::IO,
33         FROM_HERE,
34         base::Bind(&crypto::EnsureNSSInit));
35   }
36 }
37
38 std::string XWalkRunnerTizen::GetLocale() const {
39   return tizen_locale_listener_.GetLocale();
40 }
41
42 }  // namespace xwalk