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

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

Issue 10698139: Write file:// tests for BufferedDataSource and fix some bugs as a result. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: remove buffered_bytes_ 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
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_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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 BufferedResourceLoader::LoadingState state); 147 BufferedResourceLoader::LoadingState state);
148 void HttpProgressCallback(int64 position); 148 void HttpProgressCallback(int64 position);
149 149
150 void UpdateHostState_Locked(); 150 void UpdateHostState_Locked();
151 151
152 // URL of the resource requested. 152 // URL of the resource requested.
153 GURL url_; 153 GURL url_;
154 // crossorigin attribute on the corresponding HTML media element, if any. 154 // crossorigin attribute on the corresponding HTML media element, if any.
155 BufferedResourceLoader::CORSMode cors_mode_; 155 BufferedResourceLoader::CORSMode cors_mode_;
156 156
157 // Members for total bytes of the requested object. It is written once on 157 // The total size of the resource. Set during StartCallback() if the size is
158 // render thread but may be read from any thread. However reading of this 158 // known, otherwise it will remain kPositionNotSpecified until the size is
159 // member is guaranteed to happen after it is first written, so we don't 159 // determined by reaching EOF.
160 // need to protect it.
161 int64 total_bytes_; 160 int64 total_bytes_;
162 int64 buffered_bytes_; 161
162 // Some resources are assumed to be fully buffered (i.e., file://) so we don't
163 // need to report the what |loader_| has buffered.
164 bool assume_fully_buffered_;
163 165
164 // This value will be true if this data source can only support streaming. 166 // This value will be true if this data source can only support streaming.
165 // i.e. range request is not supported. 167 // i.e. range request is not supported.
166 bool streaming_; 168 bool streaming_;
167 169
168 // A webframe for loading. 170 // A webframe for loading.
169 WebKit::WebFrame* frame_; 171 WebKit::WebFrame* frame_;
170 172
171 // A resource loader for the media resource. 173 // A resource loader for the media resource.
172 scoped_ptr<BufferedResourceLoader> loader_; 174 scoped_ptr<BufferedResourceLoader> loader_;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 scoped_refptr<media::MediaLog> media_log_; 231 scoped_refptr<media::MediaLog> media_log_;
230 232
231 DownloadingCB downloading_cb_; 233 DownloadingCB downloading_cb_;
232 234
233 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); 235 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource);
234 }; 236 };
235 237
236 } // namespace webkit_media 238 } // namespace webkit_media
237 239
238 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ 240 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | webkit/media/buffered_data_source.cc » ('j') | webkit/media/buffered_data_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698