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

Side by Side Diff: media/base/download_rate_monitor.h

Issue 9113023: Fire canplaythrough as soon as download defers to fix autoplay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/download_rate_monitor.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BASE_DOWNLOAD_RATE_MONITOR_H_ 5 #ifndef MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_
6 #define MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_ 6 #define MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // without needing to pause to buffer. 119 // without needing to pause to buffer.
120 base::Closure canplaythrough_cb_; 120 base::Closure canplaythrough_cb_;
121 121
122 // Indicates whether the monitor has run the |canplaythrough_cb_|. 122 // Indicates whether the monitor has run the |canplaythrough_cb_|.
123 bool has_notified_can_play_through_; 123 bool has_notified_can_play_through_;
124 124
125 // Measurements used to approximate download speed. 125 // Measurements used to approximate download speed.
126 Sample current_sample_; 126 Sample current_sample_;
127 std::deque<Sample> sample_window_; 127 std::deque<Sample> sample_window_;
128 128
129 // True if actively downloading bytes, false otherwise.
130 bool is_downloading_data_;
131
132 // Total number of bytes in the media file, 0 if unknown or undefined. 129 // Total number of bytes in the media file, 0 if unknown or undefined.
133 int64 total_bytes_; 130 int64 total_bytes_;
134 131
135 // Amount of bytes buffered. 132 // Amount of bytes buffered.
136 int64 buffered_bytes_; 133 int64 buffered_bytes_;
137 134
138 // True if the media file is from a local source, e.g. file:// protocol or a 135 // True if the media file is from a local source, e.g. file:// protocol or a
139 // webcam stream. 136 // webcam stream.
140 bool local_source_; 137 bool local_source_;
141 138
142 // Bitrate of the media file, 0 if unknown. 139 // Bitrate of the media file, 0 if unknown.
143 int bitrate_; 140 int bitrate_;
144 141
145 // True if the monitor has not yet started or has been stopped, false 142 // True if the monitor has not yet started or has been stopped, false
146 // otherwise. 143 // otherwise.
147 bool stopped_; 144 bool stopped_;
148 145
149 // True if the data source is a streaming source, false otherwise. 146 // True if the data source is a streaming source, false otherwise.
150 bool streaming_; 147 bool streaming_;
151 148
149 // True if downloading has been deferred at least once, false otherwise.
150 bool has_deferred_;
151
152 DISALLOW_COPY_AND_ASSIGN(DownloadRateMonitor); 152 DISALLOW_COPY_AND_ASSIGN(DownloadRateMonitor);
153 }; 153 };
154 154
155 } // namespace media 155 } // namespace media
156 156
157 #endif // MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_ 157 #endif // MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/download_rate_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698