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

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

Issue 1441073006: Move throttling of background timers into the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Last few changes Sami requested Created 5 years 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
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/web_task_runner_impl.h" 9 #include "components/scheduler/child/web_task_runner_impl.h"
10 #include "components/scheduler/child/worker_scheduler.h" 10 #include "components/scheduler/child/worker_scheduler.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 blink::WebTaskRunner* WebSchedulerImpl::loadingTaskRunner() { 82 blink::WebTaskRunner* WebSchedulerImpl::loadingTaskRunner() {
83 return loading_web_task_runner_.get(); 83 return loading_web_task_runner_.get();
84 } 84 }
85 85
86 blink::WebTaskRunner* WebSchedulerImpl::timerTaskRunner() { 86 blink::WebTaskRunner* WebSchedulerImpl::timerTaskRunner() {
87 return timer_web_task_runner_.get(); 87 return timer_web_task_runner_.get();
88 } 88 }
89 89
90 void WebSchedulerImpl::postTimerTaskAt(
91 const blink::WebTraceLocation& web_location,
92 blink::WebTaskRunner::Task* task,
93 double monotonicTime) {
94 DCHECK(timer_task_runner_);
95 tracked_objects::Location location(web_location.functionName(),
96 web_location.fileName(), -1, nullptr);
97 timer_task_runner_->PostDelayedTaskAt(
98 location,
99 base::Bind(&WebTaskRunnerImpl::runTask,
100 base::Passed(scoped_ptr<blink::WebTaskRunner::Task>(task))),
101 base::TimeTicks() + base::TimeDelta::FromSecondsD(monotonicTime));
102 }
103
104 blink::WebPassOwnPtr<blink::WebViewScheduler> 90 blink::WebPassOwnPtr<blink::WebViewScheduler>
105 WebSchedulerImpl::createWebViewScheduler(blink::WebView*) { 91 WebSchedulerImpl::createWebViewScheduler(blink::WebView*) {
106 NOTREACHED(); 92 NOTREACHED();
107 return nullptr; 93 return nullptr;
108 } 94 }
109 95
110 } // namespace scheduler 96 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/child/web_scheduler_impl.h ('k') | components/scheduler/renderer/renderer_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698