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

Unified Diff: content/renderer/renderer_main.cc

Issue 583043005: Pending tasks in a message loop should be deleted before shutting down Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_main.cc
diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc
index e82712cf7e03d7a05c865e03966788b3bed95b8d..5ef677ae1eebd852377223ef28236aef2a34d366 100644
--- a/content/renderer/renderer_main.cc
+++ b/content/renderer/renderer_main.cc
@@ -148,12 +148,13 @@ int RendererMain(const MainFunctionParams& parameters) {
// needs to be backed by a Foundation-level loop to process NSTimers. See
// http://crbug.com/306348#c24 for details.
scoped_ptr<base::MessagePump> pump(new base::MessagePumpNSRunLoop());
- base::MessageLoop main_message_loop(pump.Pass());
+ scoped_ptr<base::MessageLoop> main_message_loop(
+ new base::MessageLoop(pump.Pass()));
#else
// The main message loop of the renderer services doesn't have IO or UI tasks.
- base::MessageLoop main_message_loop;
+ scoped_ptr<base::MessageLoop> main_message_loop(new base::MessageLoop());
#endif
- main_message_loop.AddTaskObserver(&task_observer);
+ main_message_loop->AddTaskObserver(&task_observer);
base::PlatformThread::SetName("CrRendererMain");
@@ -202,7 +203,7 @@ int RendererMain(const MainFunctionParams& parameters) {
// TODO(markus): Check if it is OK to unconditionally move this
// instruction down.
RenderProcessImpl render_process;
- new RenderThreadImpl();
+ new RenderThreadImpl(main_message_loop.Pass());
#endif
bool run_loop = true;
if (!no_sandbox) {
@@ -218,7 +219,7 @@ int RendererMain(const MainFunctionParams& parameters) {
}
#if defined(OS_POSIX) && !defined(OS_MACOSX)
RenderProcessImpl render_process;
- new RenderThreadImpl();
+ new RenderThreadImpl(main_message_loop.Pass());
#endif
base::HighResolutionTimerManager hi_res_timer_manager;
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698