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

Side by Side Diff: components/scheduler/renderer/web_frame_scheduler_impl.cc

Issue 2109843003: Adds enableVirtualTime and setVirtualTimePolicy To Emulation domain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove frame iteration Created 4 years, 5 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
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/renderer/web_frame_scheduler_impl.h" 5 #include "components/scheduler/renderer/web_frame_scheduler_impl.h"
6 6
7 #include "base/trace_event/blame_context.h" 7 #include "base/trace_event/blame_context.h"
8 #include "components/scheduler/base/real_time_domain.h" 8 #include "components/scheduler/base/real_time_domain.h"
9 #include "components/scheduler/base/virtual_time_domain.h" 9 #include "components/scheduler/base/virtual_time_domain.h"
10 #include "components/scheduler/child/web_task_runner_impl.h" 10 #include "components/scheduler/child/web_task_runner_impl.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (parent_web_view_scheduler_->virtual_time_domain()) { 97 if (parent_web_view_scheduler_->virtual_time_domain()) {
98 unthrottled_task_queue_->SetTimeDomain( 98 unthrottled_task_queue_->SetTimeDomain(
99 parent_web_view_scheduler_->virtual_time_domain()); 99 parent_web_view_scheduler_->virtual_time_domain());
100 } 100 }
101 unthrottled_web_task_runner_.reset( 101 unthrottled_web_task_runner_.reset(
102 new WebTaskRunnerImpl(unthrottled_task_queue_)); 102 new WebTaskRunnerImpl(unthrottled_task_queue_));
103 } 103 }
104 return unthrottled_web_task_runner_.get(); 104 return unthrottled_web_task_runner_.get();
105 } 105 }
106 106
107 blink::WebViewScheduler* WebFrameSchedulerImpl::webViewScheduler() {
108 return parent_web_view_scheduler_;
109 }
110
111 void WebFrameSchedulerImpl::incrementPendingResourceLoadCount() {
112 if (parent_web_view_scheduler_)
113 parent_web_view_scheduler_->incrementPendingResourceLoadCount();
114 }
115
116 void WebFrameSchedulerImpl::decrementPendingResourceLoadCount() {
117 if (parent_web_view_scheduler_)
118 parent_web_view_scheduler_->decrementPendingResourceLoadCount();
119 }
120
107 void WebFrameSchedulerImpl::setPageVisible(bool page_visible) { 121 void WebFrameSchedulerImpl::setPageVisible(bool page_visible) {
108 DCHECK(parent_web_view_scheduler_); 122 DCHECK(parent_web_view_scheduler_);
109 if (page_visible_ == page_visible) 123 if (page_visible_ == page_visible)
110 return; 124 return;
111 125
112 page_visible_ = page_visible; 126 page_visible_ = page_visible;
113 127
114 if (!timer_web_task_runner_ || 128 if (!timer_web_task_runner_ ||
115 parent_web_view_scheduler_->virtual_time_domain()) { 129 parent_web_view_scheduler_->virtual_time_domain()) {
116 return; 130 return;
(...skipping 19 matching lines...) Expand all
136 parent_web_view_scheduler_->virtual_time_domain()); 150 parent_web_view_scheduler_->virtual_time_domain());
137 } 151 }
138 152
139 if (loading_task_queue_) { 153 if (loading_task_queue_) {
140 loading_task_queue_->SetTimeDomain( 154 loading_task_queue_->SetTimeDomain(
141 parent_web_view_scheduler_->virtual_time_domain()); 155 parent_web_view_scheduler_->virtual_time_domain());
142 } 156 }
143 } 157 }
144 158
145 } // namespace scheduler 159 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/renderer/web_frame_scheduler_impl.h ('k') | components/scheduler/renderer/web_view_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698