| OLD | NEW |
| 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 Loading... |
| 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 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 Loading... |
| 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_ |
| OLD | NEW |