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

Side by Side Diff: content/renderer/renderer_main.cc

Issue 9297022: Change ChildProcess::set_main_thread registration to occur inside the RenderThreadImpl::Init method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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
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/debug/debugger.h" 7 #include "base/debug/debugger.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 209
210 // Load pepper plugins before engaging the sandbox. 210 // Load pepper plugins before engaging the sandbox.
211 PepperPluginRegistry::GetInstance(); 211 PepperPluginRegistry::GetInstance();
212 212
213 { 213 {
214 #if defined(OS_WIN) || defined(OS_MACOSX) 214 #if defined(OS_WIN) || defined(OS_MACOSX)
215 // TODO(markus): Check if it is OK to unconditionally move this 215 // TODO(markus): Check if it is OK to unconditionally move this
216 // instruction down. 216 // instruction down.
217 RenderProcessImpl render_process; 217 RenderProcessImpl render_process;
218 render_process.set_main_thread(new RenderThreadImpl()); 218 // The RenderThreadImpl will register itself as the main thread for the
219 // current process.
220 new RenderThreadImpl();
219 #endif 221 #endif
220 bool run_loop = true; 222 bool run_loop = true;
221 if (!no_sandbox) { 223 if (!no_sandbox) {
222 run_loop = platform.EnableSandbox(); 224 run_loop = platform.EnableSandbox();
223 } else { 225 } else {
224 LOG(ERROR) << "Running without renderer sandbox"; 226 LOG(ERROR) << "Running without renderer sandbox";
225 } 227 }
226 #if defined(OS_POSIX) && !defined(OS_MACOSX) 228 #if defined(OS_POSIX) && !defined(OS_MACOSX)
227 RenderProcessImpl render_process; 229 RenderProcessImpl render_process;
228 render_process.set_main_thread(new RenderThreadImpl()); 230 // The RenderThreadImpl will register itself as the main thread for the
231 // current process.
232 new RenderThreadImpl();
229 #endif 233 #endif
230 234
231 platform.RunSandboxTests(); 235 platform.RunSandboxTests();
232 236
233 startup_timer.Stop(); // End of Startup Time Measurement. 237 startup_timer.Stop(); // End of Startup Time Measurement.
234 238
235 if (run_loop) { 239 if (run_loop) {
236 #if defined(OS_MACOSX) 240 #if defined(OS_MACOSX)
237 if (pool) 241 if (pool)
238 pool->Recycle(); 242 pool->Recycle();
239 #endif 243 #endif
240 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); 244 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0);
241 MessageLoop::current()->Run(); 245 MessageLoop::current()->Run();
242 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); 246 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0);
243 } 247 }
244 } 248 }
245 platform.PlatformUninitialize(); 249 platform.PlatformUninitialize();
246 TRACE_EVENT_END_ETW("RendererMain", 0, ""); 250 TRACE_EVENT_END_ETW("RendererMain", 0, "");
247 return 0; 251 return 0;
248 } 252 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698