| OLD | NEW |
| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void WebFrameSchedulerImpl::didStartLoading(unsigned long identifier) { | 111 void WebFrameSchedulerImpl::didStartLoading(unsigned long identifier) { |
| 112 if (parent_web_view_scheduler_) | 112 if (parent_web_view_scheduler_) |
| 113 parent_web_view_scheduler_->DidStartLoading(identifier); | 113 parent_web_view_scheduler_->DidStartLoading(identifier); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void WebFrameSchedulerImpl::didStopLoading(unsigned long identifier) { | 116 void WebFrameSchedulerImpl::didStopLoading(unsigned long identifier) { |
| 117 if (parent_web_view_scheduler_) | 117 if (parent_web_view_scheduler_) |
| 118 parent_web_view_scheduler_->DidStopLoading(identifier); | 118 parent_web_view_scheduler_->DidStopLoading(identifier); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void WebFrameSchedulerImpl::setDocumentParsingInBackground( |
| 122 bool background_parser_active) { |
| 123 if (background_parser_active) |
| 124 parent_web_view_scheduler_->IncrementBackgroundParserCount(); |
| 125 else |
| 126 parent_web_view_scheduler_->DecrementBackgroundParserCount(); |
| 127 } |
| 128 |
| 121 void WebFrameSchedulerImpl::setPageVisible(bool page_visible) { | 129 void WebFrameSchedulerImpl::setPageVisible(bool page_visible) { |
| 122 DCHECK(parent_web_view_scheduler_); | 130 DCHECK(parent_web_view_scheduler_); |
| 123 if (page_visible_ == page_visible) | 131 if (page_visible_ == page_visible) |
| 124 return; | 132 return; |
| 125 | 133 |
| 126 page_visible_ = page_visible; | 134 page_visible_ = page_visible; |
| 127 | 135 |
| 128 if (!timer_web_task_runner_ || | 136 if (!timer_web_task_runner_ || |
| 129 parent_web_view_scheduler_->virtual_time_domain()) { | 137 parent_web_view_scheduler_->virtual_time_domain()) { |
| 130 return; | 138 return; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 150 parent_web_view_scheduler_->virtual_time_domain()); | 158 parent_web_view_scheduler_->virtual_time_domain()); |
| 151 } | 159 } |
| 152 | 160 |
| 153 if (loading_task_queue_) { | 161 if (loading_task_queue_) { |
| 154 loading_task_queue_->SetTimeDomain( | 162 loading_task_queue_->SetTimeDomain( |
| 155 parent_web_view_scheduler_->virtual_time_domain()); | 163 parent_web_view_scheduler_->virtual_time_domain()); |
| 156 } | 164 } |
| 157 } | 165 } |
| 158 | 166 |
| 159 } // namespace scheduler | 167 } // namespace scheduler |
| OLD | NEW |