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

Side by Side Diff: components/scheduler/child/web_scheduler_impl.cc

Issue 1153763005: scheduler: Allow timer task to be nested (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/scheduler/child/web_scheduler_impl.h" 5 #include "components/scheduler/child/web_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "components/scheduler/child/worker_scheduler.h" 9 #include "components/scheduler/child/worker_scheduler.h"
10 #include "third_party/WebKit/public/platform/WebTraceLocation.h" 10 #include "third_party/WebKit/public/platform/WebTraceLocation.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 void WebSchedulerImpl::postTimerTask( 96 void WebSchedulerImpl::postTimerTask(
97 const blink::WebTraceLocation& web_location, 97 const blink::WebTraceLocation& web_location,
98 blink::WebThread::Task* task, 98 blink::WebThread::Task* task,
99 long long delayMs) { 99 long long delayMs) {
100 DCHECK(timer_task_runner_); 100 DCHECK(timer_task_runner_);
101 scoped_ptr<blink::WebThread::Task> scoped_task(task); 101 scoped_ptr<blink::WebThread::Task> scoped_task(task);
102 tracked_objects::Location location(web_location.functionName(), 102 tracked_objects::Location location(web_location.functionName(),
103 web_location.fileName(), -1, nullptr); 103 web_location.fileName(), -1, nullptr);
104 // Timer tasks should not run in a nested messageloop. 104 timer_task_runner_->PostDelayedTask(
105 timer_task_runner_->PostNonNestableDelayedTask(
106 location, 105 location,
107 base::Bind(&WebSchedulerImpl::runTask, base::Passed(&scoped_task)), 106 base::Bind(&WebSchedulerImpl::runTask, base::Passed(&scoped_task)),
108 base::TimeDelta::FromMilliseconds(delayMs)); 107 base::TimeDelta::FromMilliseconds(delayMs));
109 } 108 }
110 109
111 } // namespace scheduler 110 } // namespace scheduler
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698