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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc

Issue 2876513002: Use WTF::TimeDelta to specify delays on WebTaskRunner (Closed)
Patch Set: mac fix Created 3 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
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 "platform/scheduler/renderer/web_view_scheduler_impl.h" 5 #include "platform/scheduler/renderer/web_view_scheduler_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "platform/RuntimeEnabledFeatures.h" 9 #include "platform/RuntimeEnabledFeatures.h"
10 #include "platform/WebFrameScheduler.h" 10 #include "platform/WebFrameScheduler.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 ApplyVirtualTimePolicyForLoading(); 261 ApplyVirtualTimePolicyForLoading();
262 break; 262 break;
263 } 263 }
264 } 264 }
265 265
266 void WebViewSchedulerImpl::GrantVirtualTimeBudget( 266 void WebViewSchedulerImpl::GrantVirtualTimeBudget(
267 base::TimeDelta budget, 267 base::TimeDelta budget,
268 std::unique_ptr<WTF::Closure> budget_exhausted_callback) { 268 std::unique_ptr<WTF::Closure> budget_exhausted_callback) {
269 virtual_time_budget_expired_task_handle_ = 269 virtual_time_budget_expired_task_handle_ =
270 virtual_time_control_task_queue_->PostDelayedCancellableTask( 270 virtual_time_control_task_queue_->PostDelayedCancellableTask(
271 BLINK_FROM_HERE, std::move(budget_exhausted_callback), 271 BLINK_FROM_HERE, std::move(budget_exhausted_callback), budget);
272 budget.InMilliseconds());
273 } 272 }
274 273
275 void WebViewSchedulerImpl::AudioStateChanged(bool is_audio_playing) { 274 void WebViewSchedulerImpl::AudioStateChanged(bool is_audio_playing) {
276 is_audio_playing_ = is_audio_playing; 275 is_audio_playing_ = is_audio_playing;
277 renderer_scheduler_->OnAudioStateChanged(); 276 renderer_scheduler_->OnAudioStateChanged();
278 } 277 }
279 278
280 bool WebViewSchedulerImpl::HasActiveConnectionForTest() const { 279 bool WebViewSchedulerImpl::HasActiveConnectionForTest() const {
281 return has_active_connection_; 280 return has_active_connection_;
282 } 281 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 case VirtualTimePolicy::DETERMINISTIC_LOADING: 439 case VirtualTimePolicy::DETERMINISTIC_LOADING:
441 return "DETERMINISTIC_LOADING"; 440 return "DETERMINISTIC_LOADING";
442 default: 441 default:
443 NOTREACHED(); 442 NOTREACHED();
444 return nullptr; 443 return nullptr;
445 } 444 }
446 } 445 }
447 446
448 } // namespace scheduler 447 } // namespace scheduler
449 } // namespace blink 448 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698