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

Side by Side Diff: media/blink/watch_time_reporter.h

Issue 2822543006: Start reporting watch time if ABR adapts above 200p. (Closed)
Patch Set: Simplify Created 3 years, 8 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
« no previous file with comments | « no previous file | media/blink/watch_time_reporter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef MEDIA_BLINK_WATCH_TIME_REPORTER_H_ 5 #ifndef MEDIA_BLINK_WATCH_TIME_REPORTER_H_
6 #define MEDIA_BLINK_WATCH_TIME_REPORTER_H_ 6 #define MEDIA_BLINK_WATCH_TIME_REPORTER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/power_monitor/power_observer.h" 9 #include "base/power_monitor/power_observer.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // the video is shown or hidden respectively. OnHidden() will start background 96 // the video is shown or hidden respectively. OnHidden() will start background
97 // watch time reporting if the media is audio+video. 97 // watch time reporting if the media is audio+video.
98 // 98 //
99 // TODO(dalecurtis): At present, this is only called when the entire content 99 // TODO(dalecurtis): At present, this is only called when the entire content
100 // window goes into the foreground or background respectively; i.e. it does 100 // window goes into the foreground or background respectively; i.e. it does
101 // not catch cases where the video is in the foreground but out of the view 101 // not catch cases where the video is in the foreground but out of the view
102 // port. We need a method for rejecting out of view port videos. 102 // port. We need a method for rejecting out of view port videos.
103 void OnShown(); 103 void OnShown();
104 void OnHidden(); 104 void OnHidden();
105 105
106 // Returns true if the current size is large enough that watch time will be
107 // recorded for playback.
108 bool IsSizeLargeEnoughToReportWatchTime() const;
109
106 // Setup the reporting interval to be immediate to avoid spinning real time 110 // Setup the reporting interval to be immediate to avoid spinning real time
107 // within the unit test. 111 // within the unit test.
108 void set_reporting_interval_for_testing() { 112 void set_reporting_interval_for_testing() {
109 reporting_interval_ = base::TimeDelta(); 113 reporting_interval_ = base::TimeDelta();
110 } 114 }
111 115
112 void set_is_on_battery_power_for_testing(bool on_battery_power) { 116 void set_is_on_battery_power_for_testing(bool on_battery_power) {
113 is_on_battery_power_ = on_battery_power; 117 is_on_battery_power_ = on_battery_power;
114 } 118 }
115 119
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // Special case reporter for handling background video watch time. Configured 188 // Special case reporter for handling background video watch time. Configured
185 // as an audio only WatchTimeReporter with |is_background_| set to true. 189 // as an audio only WatchTimeReporter with |is_background_| set to true.
186 std::unique_ptr<WatchTimeReporter> background_reporter_; 190 std::unique_ptr<WatchTimeReporter> background_reporter_;
187 191
188 DISALLOW_COPY_AND_ASSIGN(WatchTimeReporter); 192 DISALLOW_COPY_AND_ASSIGN(WatchTimeReporter);
189 }; 193 };
190 194
191 } // namespace media 195 } // namespace media
192 196
193 #endif // MEDIA_BLINK_WATCH_TIME_REPORTER_H_ 197 #endif // MEDIA_BLINK_WATCH_TIME_REPORTER_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/watch_time_reporter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698