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

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc

Issue 2546423002: [Try # 3] Scheduler refactoring to virtually eliminate redundant DoWorks (Closed)
Patch Set: Add an extra dcheck Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
index 130d539b4ef053726821e1968e10753b6c00ba7e..9b27402ed8a279e8503bf3d01246f439f58f7c1f 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
@@ -247,11 +247,16 @@ void RendererSchedulerImpl::Shutdown() {
MainThreadOnly().background_main_thread_load_tracker.RecordIdle(now);
MainThreadOnly().foreground_main_thread_load_tracker.RecordIdle(now);
- task_queue_throttler_.reset();
helper_.Shutdown();
idle_helper_.Shutdown();
MainThreadOnly().was_shutdown = true;
MainThreadOnly().rail_mode_observer = nullptr;
+
+ // Note this must be done after shutting down |helper_| because otherwise
+ // there's a window where another thread posting a task to a throttled queue
+ // during shutdown might try to access the deleted TimeDomain owned by
+ // |task_queue_throttler_|.
+ task_queue_throttler_.reset();
}
std::unique_ptr<blink::WebThread> RendererSchedulerImpl::CreateMainThread() {

Powered by Google App Engine
This is Rietveld 408576698