| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 parent_web_view_scheduler_->virtual_time_domain()); | 76 parent_web_view_scheduler_->virtual_time_domain()); |
| 77 } else if (!page_visible_) { | 77 } else if (!page_visible_) { |
| 78 renderer_scheduler_->throttling_helper()->IncreaseThrottleRefCount( | 78 renderer_scheduler_->throttling_helper()->IncreaseThrottleRefCount( |
| 79 timer_task_queue_.get()); | 79 timer_task_queue_.get()); |
| 80 } | 80 } |
| 81 timer_web_task_runner_.reset(new WebTaskRunnerImpl(timer_task_queue_)); | 81 timer_web_task_runner_.reset(new WebTaskRunnerImpl(timer_task_queue_)); |
| 82 } | 82 } |
| 83 return timer_web_task_runner_.get(); | 83 return timer_web_task_runner_.get(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 blink::WebViewScheduler* WebFrameSchedulerImpl::webViewScheduler() { |
| 87 return parent_web_view_scheduler_; |
| 88 } |
| 89 |
| 86 void WebFrameSchedulerImpl::setPageVisible(bool page_visible) { | 90 void WebFrameSchedulerImpl::setPageVisible(bool page_visible) { |
| 87 DCHECK(parent_web_view_scheduler_); | 91 DCHECK(parent_web_view_scheduler_); |
| 88 if (page_visible_ == page_visible) | 92 if (page_visible_ == page_visible) |
| 89 return; | 93 return; |
| 90 | 94 |
| 91 page_visible_ = page_visible; | 95 page_visible_ = page_visible; |
| 92 | 96 |
| 93 if (!timer_web_task_runner_ || | 97 if (!timer_web_task_runner_ || |
| 94 parent_web_view_scheduler_->virtual_time_domain()) { | 98 parent_web_view_scheduler_->virtual_time_domain()) { |
| 95 return; | 99 return; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 115 parent_web_view_scheduler_->virtual_time_domain()); | 119 parent_web_view_scheduler_->virtual_time_domain()); |
| 116 } | 120 } |
| 117 | 121 |
| 118 if (loading_task_queue_) { | 122 if (loading_task_queue_) { |
| 119 loading_task_queue_->SetTimeDomain( | 123 loading_task_queue_->SetTimeDomain( |
| 120 parent_web_view_scheduler_->virtual_time_domain()); | 124 parent_web_view_scheduler_->virtual_time_domain()); |
| 121 } | 125 } |
| 122 } | 126 } |
| 123 | 127 |
| 124 } // namespace scheduler | 128 } // namespace scheduler |
| OLD | NEW |