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

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

Issue 2487343004: Make sure scheduler shutdown prevents idle tasks from running (Closed)
Patch Set: Added a test which fails without the patch. Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/child/idle_helper_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "platform/scheduler/renderer/renderer_scheduler_impl.h" 5 #include "platform/scheduler/renderer/renderer_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/stack_trace.h" 8 #include "base/debug/stack_trace.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 RendererSchedulerImpl::CompositorThreadOnly::~CompositorThreadOnly() {} 214 RendererSchedulerImpl::CompositorThreadOnly::~CompositorThreadOnly() {}
215 215
216 void RendererSchedulerImpl::Shutdown() { 216 void RendererSchedulerImpl::Shutdown() {
217 base::TimeTicks now = tick_clock()->NowTicks(); 217 base::TimeTicks now = tick_clock()->NowTicks();
218 MainThreadOnly().background_main_thread_load_tracker.RecordIdle(now); 218 MainThreadOnly().background_main_thread_load_tracker.RecordIdle(now);
219 MainThreadOnly().foreground_main_thread_load_tracker.RecordIdle(now); 219 MainThreadOnly().foreground_main_thread_load_tracker.RecordIdle(now);
220 220
221 task_queue_throttler_.reset(); 221 task_queue_throttler_.reset();
222 helper_.Shutdown(); 222 helper_.Shutdown();
223 idle_helper_.Shutdown();
223 MainThreadOnly().was_shutdown = true; 224 MainThreadOnly().was_shutdown = true;
224 MainThreadOnly().rail_mode_observer = nullptr; 225 MainThreadOnly().rail_mode_observer = nullptr;
225 } 226 }
226 227
227 std::unique_ptr<blink::WebThread> RendererSchedulerImpl::CreateMainThread() { 228 std::unique_ptr<blink::WebThread> RendererSchedulerImpl::CreateMainThread() {
228 return base::MakeUnique<WebThreadImplForRendererScheduler>(this); 229 return base::MakeUnique<WebThreadImplForRendererScheduler>(this);
229 } 230 }
230 231
231 scoped_refptr<TaskQueue> RendererSchedulerImpl::DefaultTaskRunner() { 232 scoped_refptr<TaskQueue> RendererSchedulerImpl::DefaultTaskRunner() {
232 return helper_.DefaultTaskRunner(); 233 return helper_.DefaultTaskRunner();
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1694 case v8::PERFORMANCE_LOAD: 1695 case v8::PERFORMANCE_LOAD:
1695 return "load"; 1696 return "load";
1696 default: 1697 default:
1697 NOTREACHED(); 1698 NOTREACHED();
1698 return nullptr; 1699 return nullptr;
1699 } 1700 }
1700 } 1701 }
1701 1702
1702 } // namespace scheduler 1703 } // namespace scheduler
1703 } // namespace blink 1704 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/child/idle_helper_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698