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

Side by Side Diff: webkit/media/buffered_resource_loader.h

Issue 10387200: Suppress pause-and-buffer behavior when the HTTP response won't satisfy future requests via cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: %zu is win-unfriendly; use %PRIuS instead. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « webkit/media/buffered_data_source.cc ('k') | webkit/media/buffered_resource_loader.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ 5 #ifndef WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_
6 #define WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ 6 #define WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 WebKit::WebURLLoader* loader, 162 WebKit::WebURLLoader* loader,
163 double finishTime); 163 double finishTime);
164 virtual void didFail( 164 virtual void didFail(
165 WebKit::WebURLLoader* loader, 165 WebKit::WebURLLoader* loader,
166 const WebKit::WebURLError&); 166 const WebKit::WebURLError&);
167 167
168 // Returns true if the media resource has a single origin, false otherwise. 168 // Returns true if the media resource has a single origin, false otherwise.
169 // Only valid to call after Start() has completed. 169 // Only valid to call after Start() has completed.
170 bool HasSingleOrigin() const; 170 bool HasSingleOrigin() const;
171 171
172 // Sets the defer strategy to the given value. 172 // Sets the defer strategy to the given value unless it seems unwise.
173 // Specifically downgrade kNeverDefer to kThresholdDefer if we know the
174 // current response will not be used to satisfy future requests (the cache
175 // won't help us).
173 void UpdateDeferStrategy(DeferStrategy strategy); 176 void UpdateDeferStrategy(DeferStrategy strategy);
174 177
175 // Sets the playback rate to the given value and updates buffer window 178 // Sets the playback rate to the given value and updates buffer window
176 // accordingly. 179 // accordingly.
177 void SetPlaybackRate(float playback_rate); 180 void SetPlaybackRate(float playback_rate);
178 181
179 // Sets the bitrate to the given value and updates buffer window 182 // Sets the bitrate to the given value and updates buffer window
180 // accordingly. 183 // accordingly.
181 void SetBitrate(int bitrate); 184 void SetBitrate(int bitrate);
182 185
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // Keeps track of an active WebURLLoader and associated state. 263 // Keeps track of an active WebURLLoader and associated state.
261 scoped_ptr<ActiveLoader> active_loader_; 264 scoped_ptr<ActiveLoader> active_loader_;
262 265
263 // Tracks if |active_loader_| failed. If so, then all calls to Read() will 266 // Tracks if |active_loader_| failed. If so, then all calls to Read() will
264 // fail. 267 // fail.
265 bool loader_failed_; 268 bool loader_failed_;
266 269
267 // Current buffering algorithm in place for resource loading. 270 // Current buffering algorithm in place for resource loading.
268 DeferStrategy defer_strategy_; 271 DeferStrategy defer_strategy_;
269 272
273 // True if the currently-reading response might be used to satisfy a future
274 // request from the cache.
275 bool might_be_reused_from_cache_in_future_;
276
270 // True if Range header is supported. 277 // True if Range header is supported.
271 bool range_supported_; 278 bool range_supported_;
272 279
273 // Forward capacity to reset to after an extension. 280 // Forward capacity to reset to after an extension.
274 size_t saved_forward_capacity_; 281 size_t saved_forward_capacity_;
275 282
276 GURL url_; 283 GURL url_;
277 int64 first_byte_position_; 284 int64 first_byte_position_;
278 int64 last_byte_position_; 285 int64 last_byte_position_;
279 bool single_origin_; 286 bool single_origin_;
(...skipping 29 matching lines...) Expand all
309 float playback_rate_; 316 float playback_rate_;
310 317
311 scoped_refptr<media::MediaLog> media_log_; 318 scoped_refptr<media::MediaLog> media_log_;
312 319
313 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); 320 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader);
314 }; 321 };
315 322
316 } // namespace webkit_media 323 } // namespace webkit_media
317 324
318 #endif // WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ 325 #endif // WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_
OLDNEW
« no previous file with comments | « webkit/media/buffered_data_source.cc ('k') | webkit/media/buffered_resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698