Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: content/worker/worker_main.cc

Issue 13814027: Linux: make current InitializeSandbox() private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove sandbox_init_linux.cc Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/utility/utility_main.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/base_switches.h" 5 #include "base/base_switches.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/hi_res_timer_manager.h" 7 #include "base/hi_res_timer_manager.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/power_monitor/power_monitor.h" 9 #include "base/power_monitor/power_monitor.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/threading/platform_thread.h" 11 #include "base/threading/platform_thread.h"
12 #include "content/common/child_process.h" 12 #include "content/common/child_process.h"
13 #include "content/common/sandbox_linux.h"
13 #include "content/public/common/main_function_params.h" 14 #include "content/public/common/main_function_params.h"
14 #include "content/public/common/sandbox_init.h" 15 #include "content/public/common/sandbox_init.h"
15 #include "content/worker/worker_thread.h" 16 #include "content/worker/worker_thread.h"
16 17
17 #if defined(OS_WIN) 18 #if defined(OS_WIN)
18 #include "sandbox/win/src/sandbox.h" 19 #include "sandbox/win/src/sandbox.h"
19 #endif 20 #endif
20 21
21 #if defined(OS_MACOSX) 22 #if defined(OS_MACOSX)
22 #include "content/common/sandbox_mac.h" 23 #include "content/common/sandbox_mac.h"
(...skipping 23 matching lines...) Expand all
46 ::GetUserDefaultLangID(); 47 ::GetUserDefaultLangID();
47 ::GetUserDefaultLCID(); 48 ::GetUserDefaultLCID();
48 49
49 target_services->LowerToken(); 50 target_services->LowerToken();
50 #elif defined(OS_MACOSX) 51 #elif defined(OS_MACOSX)
51 // Sandbox should already be activated at this point. 52 // Sandbox should already be activated at this point.
52 CHECK(Sandbox::SandboxIsCurrentlyActive()); 53 CHECK(Sandbox::SandboxIsCurrentlyActive());
53 #elif defined(OS_LINUX) 54 #elif defined(OS_LINUX)
54 // On Linux, the sandbox must be initialized early, before any thread is 55 // On Linux, the sandbox must be initialized early, before any thread is
55 // created. 56 // created.
56 InitializeSandbox(); 57 LinuxSandbox::InitializeSandbox();
57 #endif 58 #endif
58 59
59 ChildProcess worker_process; 60 ChildProcess worker_process;
60 worker_process.set_main_thread(new WorkerThread()); 61 worker_process.set_main_thread(new WorkerThread());
61 62
62 const CommandLine& parsed_command_line = parameters.command_line; 63 const CommandLine& parsed_command_line = parameters.command_line;
63 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { 64 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) {
64 ChildProcess::WaitForDebugger("Worker"); 65 ChildProcess::WaitForDebugger("Worker");
65 } 66 }
66 67
67 // Load the accelerator table from the browser executable and tell the 68 // Load the accelerator table from the browser executable and tell the
68 // message loop to use it when translating messages. 69 // message loop to use it when translating messages.
69 MessageLoop::current()->Run(); 70 MessageLoop::current()->Run();
70 71
71 return 0; 72 return 0;
72 } 73 }
73 74
74 } // namespace content 75 } // namespace content
OLDNEW
« no previous file with comments | « content/utility/utility_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698