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

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc

Issue 2383473002: [scheduler] Teach scheduler about audio state (Closed)
Patch Set: WebFrames! Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc
index 1fd96aeb5b86f08773944a9cbdf750ac3db5f5cd..3d979621f04cd30e13ce8f5977cd1609de4b2562 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc
@@ -27,7 +27,8 @@ WebFrameSchedulerImpl::WebFrameSchedulerImpl(
blame_context_(blame_context),
frame_visible_(true),
page_visible_(true),
- cross_origin_(false) {}
+ cross_origin_(false),
+ is_audio_playing_(false) {}
WebFrameSchedulerImpl::~WebFrameSchedulerImpl() {
if (loading_task_queue_) {
@@ -140,6 +141,16 @@ void WebFrameSchedulerImpl::setPageVisible(bool page_visible) {
UpdateTimerThrottling(was_throttled);
}
+void WebFrameSchedulerImpl::audioStateChanged(bool is_audio_playing) {
+ is_audio_playing_ = is_audio_playing;
+ if (parent_web_view_scheduler_)
+ parent_web_view_scheduler_->OnAudioStateChangedInFrame();
+}
+
+bool WebFrameSchedulerImpl::IsAudioPlaying() const {
+ return is_audio_playing_;
+}
+
bool WebFrameSchedulerImpl::ShouldThrottleTimers() const {
if (!page_visible_)
return true;

Powered by Google App Engine
This is Rietveld 408576698