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

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

Issue 8661002: Fire CanPlayThrough immediately for local and streaming media files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix media/event-attributes.html Created 9 years 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
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 WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ 5 #ifndef WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_
6 #define WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ 6 #define WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Called from demuxer thread. 46 // Called from demuxer thread.
47 virtual void Read( 47 virtual void Read(
48 int64 position, 48 int64 position,
49 size_t size, 49 size_t size,
50 uint8* data, 50 uint8* data,
51 const media::DataSource::ReadCallback& read_callback) OVERRIDE; 51 const media::DataSource::ReadCallback& read_callback) OVERRIDE;
52 virtual bool GetSize(int64* size_out) OVERRIDE; 52 virtual bool GetSize(int64* size_out) OVERRIDE;
53 virtual bool IsStreaming() OVERRIDE; 53 virtual bool IsStreaming() OVERRIDE;
54 virtual void SetPreload(media::Preload preload) OVERRIDE; 54 virtual void SetPreload(media::Preload preload) OVERRIDE;
55 virtual void SetBitrate(int bitrate) OVERRIDE; 55 virtual void SetBitrate(int bitrate) OVERRIDE;
56 virtual bool IsLocalSource() OVERRIDE;
56 57
57 // webkit_glue::WebDataSource implementation. 58 // webkit_glue::WebDataSource implementation.
58 virtual void Initialize(const std::string& url, 59 virtual void Initialize(const std::string& url,
59 const media::PipelineStatusCB& callback) OVERRIDE; 60 const media::PipelineStatusCB& callback) OVERRIDE;
60 virtual void CancelInitialize() OVERRIDE; 61 virtual void CancelInitialize() OVERRIDE;
61 virtual bool HasSingleOrigin() OVERRIDE; 62 virtual bool HasSingleOrigin() OVERRIDE;
62 virtual void Abort() OVERRIDE; 63 virtual void Abort() OVERRIDE;
63 64
64 protected: 65 protected:
65 // A factory method to create a BufferedResourceLoader based on the read 66 // A factory method to create a BufferedResourceLoader based on the read
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // URL of the resource requested. 141 // URL of the resource requested.
141 GURL url_; 142 GURL url_;
142 143
143 // Members for total bytes of the requested object. It is written once on 144 // Members for total bytes of the requested object. It is written once on
144 // render thread but may be read from any thread. However reading of this 145 // render thread but may be read from any thread. However reading of this
145 // member is guaranteed to happen after it is first written, so we don't 146 // member is guaranteed to happen after it is first written, so we don't
146 // need to protect it. 147 // need to protect it.
147 int64 total_bytes_; 148 int64 total_bytes_;
148 int64 buffered_bytes_; 149 int64 buffered_bytes_;
149 150
150 // True if this data source is considered loaded. 151 // True if this data source is from a local file.
151 bool loaded_; 152 bool local_source_;
152 153
153 // This value will be true if this data source can only support streaming. 154 // This value will be true if this data source can only support streaming.
154 // i.e. range request is not supported. 155 // i.e. range request is not supported.
155 bool streaming_; 156 bool streaming_;
156 157
157 // A webframe for loading. 158 // A webframe for loading.
158 WebKit::WebFrame* frame_; 159 WebKit::WebFrame* frame_;
159 160
160 // A resource loader for the media resource. 161 // A resource loader for the media resource.
161 scoped_refptr<BufferedResourceLoader> loader_; 162 scoped_refptr<BufferedResourceLoader> loader_;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 float playback_rate_; 227 float playback_rate_;
227 228
228 scoped_refptr<media::MediaLog> media_log_; 229 scoped_refptr<media::MediaLog> media_log_;
229 230
230 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); 231 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource);
231 }; 232 };
232 233
233 } // namespace webkit_media 234 } // namespace webkit_media
234 235
235 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ 236 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698