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

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

Issue 10735016: Collapse HTTP and non-HTTP codepaths into single methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on tot Created 8 years, 5 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_unittest.cc ('k') | no next file » | 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 13 matching lines...) Expand all
24 } 24 }
25 25
26 namespace webkit_media { 26 namespace webkit_media {
27 27
28 const int64 kPositionNotSpecified = -1; 28 const int64 kPositionNotSpecified = -1;
29 29
30 const char kHttpScheme[] = "http"; 30 const char kHttpScheme[] = "http";
31 const char kHttpsScheme[] = "https"; 31 const char kHttpsScheme[] = "https";
32 const char kDataScheme[] = "data"; 32 const char kDataScheme[] = "data";
33 33
34 // Wraps a WebURLLoader to maintain an in-memory buffer of downloaded 34 // BufferedResourceLoader is single threaded and must be accessed on the
35 // data according to the current defer strategy. 35 // render thread. It wraps a WebURLLoader and does in-memory buffering,
36 // pausing resource loading when the in-memory buffer is full and resuming
37 // resource loading when there is available capacity.
36 class BufferedResourceLoader : public WebKit::WebURLLoaderClient { 38 class BufferedResourceLoader : public WebKit::WebURLLoaderClient {
37 public: 39 public:
38 // kNeverDefer - Aggresively buffer; never defer loading while paused. 40 // kNeverDefer - Aggresively buffer; never defer loading while paused.
39 // kReadThenDefer - Request only enough data to fulfill read requests. 41 // kReadThenDefer - Request only enough data to fulfill read requests.
40 // kCapacityDefer - Try to keep amount of buffered data at capacity. 42 // kCapacityDefer - Try to keep amount of buffered data at capacity.
41 enum DeferStrategy { 43 enum DeferStrategy {
42 kNeverDefer, 44 kNeverDefer,
43 kReadThenDefer, 45 kReadThenDefer,
44 kCapacityDefer, 46 kCapacityDefer,
45 }; 47 };
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 float playback_rate_; 330 float playback_rate_;
329 331
330 scoped_refptr<media::MediaLog> media_log_; 332 scoped_refptr<media::MediaLog> media_log_;
331 333
332 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); 334 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader);
333 }; 335 };
334 336
335 } // namespace webkit_media 337 } // namespace webkit_media
336 338
337 #endif // WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ 339 #endif // WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_
OLDNEW
« no previous file with comments | « webkit/media/buffered_data_source_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698