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

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

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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/worker/websharedworkerclient_proxy.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"
(...skipping 10 matching lines...) Expand all
21 21
22 #if defined(OS_MACOSX) 22 #if defined(OS_MACOSX)
23 #include "content/common/sandbox_mac.h" 23 #include "content/common/sandbox_mac.h"
24 #endif 24 #endif
25 25
26 namespace content { 26 namespace content {
27 27
28 // Mainline routine for running as the worker process. 28 // Mainline routine for running as the worker process.
29 int WorkerMain(const MainFunctionParams& parameters) { 29 int WorkerMain(const MainFunctionParams& parameters) {
30 // The main message loop of the worker process. 30 // The main message loop of the worker process.
31 MessageLoop main_message_loop; 31 base::MessageLoop main_message_loop;
32 base::PlatformThread::SetName("CrWorkerMain"); 32 base::PlatformThread::SetName("CrWorkerMain");
33 33
34 base::PowerMonitor power_monitor; 34 base::PowerMonitor power_monitor;
35 HighResolutionTimerManager hi_res_timer_manager; 35 HighResolutionTimerManager hi_res_timer_manager;
36 36
37 #if defined(OS_WIN) 37 #if defined(OS_WIN)
38 sandbox::TargetServices* target_services = 38 sandbox::TargetServices* target_services =
39 parameters.sandbox_info->target_services; 39 parameters.sandbox_info->target_services;
40 if (!target_services) 40 if (!target_services)
41 return false; 41 return false;
(...skipping 18 matching lines...) Expand all
60 ChildProcess worker_process; 60 ChildProcess worker_process;
61 worker_process.set_main_thread(new WorkerThread()); 61 worker_process.set_main_thread(new WorkerThread());
62 62
63 const CommandLine& parsed_command_line = parameters.command_line; 63 const CommandLine& parsed_command_line = parameters.command_line;
64 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { 64 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) {
65 ChildProcess::WaitForDebugger("Worker"); 65 ChildProcess::WaitForDebugger("Worker");
66 } 66 }
67 67
68 // Load the accelerator table from the browser executable and tell the 68 // Load the accelerator table from the browser executable and tell the
69 // message loop to use it when translating messages. 69 // message loop to use it when translating messages.
70 MessageLoop::current()->Run(); 70 base::MessageLoop::current()->Run();
71 71
72 return 0; 72 return 0;
73 } 73 }
74 74
75 } // namespace content 75 } // namespace content
OLDNEW
« no previous file with comments | « content/worker/websharedworkerclient_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698