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.
5 #include "xwalk/runtime/browser/xwalk_runner_tizen.h"
7 #include "base/command_line.h"
8 #include "content/public/browser/browser_thread.h"
9 #include "crypto/nss_util.h"
10 #include "xwalk/application/browser/application_service.h"
11 #include "xwalk/application/browser/application_system.h"
12 #include "xwalk/application/common/id_util.h"
13 #include "xwalk/runtime/browser/sysapps_component.h"
14 #include "xwalk/runtime/browser/xwalk_component.h"
15 #include "xwalk/runtime/common/xwalk_runtime_features.h"
16 #include "xwalk/runtime/common/xwalk_switches.h"
20 XWalkRunnerTizen::XWalkRunnerTizen() {
21 CommandLine* cmd_line = CommandLine::ForCurrentProcess();
22 shared_process_mode_enabled_ =
23 !(cmd_line->HasSwitch(switches::kXWalkDisableSharedProcessMode));
26 XWalkRunnerTizen::~XWalkRunnerTizen() {}
29 XWalkRunnerTizen* XWalkRunnerTizen::GetInstance() {
30 return static_cast<XWalkRunnerTizen*>(XWalkRunner::GetInstance());
33 void XWalkRunnerTizen::PreMainMessageLoopRun() {
34 XWalkRunner::PreMainMessageLoopRun();
36 // NSSInitSingleton is a costly operation (up to 100ms on VTC-1010),
37 // resulting in postponing the parsing and composition steps of the render
38 // process at cold start. Therefore, move the initialization logic here.
39 if (shared_process_mode_enabled()) {
40 content::BrowserThread::PostTask(
41 content::BrowserThread::IO,
43 base::Bind(&crypto::EnsureNSSInit));