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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void ReadInternal(); | 116 void ReadInternal(); |
117 | 117 |
118 // Calls |read_cb_| and reset all read parameters. Non-negative |bytes_read| | 118 // Calls |read_cb_| and reset all read parameters. Non-negative |bytes_read| |
119 // values represent successful reads, otherwise |bytes_read| should be | 119 // values represent successful reads, otherwise |bytes_read| should be |
120 // kReadError. | 120 // kReadError. |
121 void DoneRead_Locked(int bytes_read); | 121 void DoneRead_Locked(int bytes_read); |
122 | 122 |
123 // Calls |initialize_cb_| and reset it. | 123 // Calls |initialize_cb_| and reset it. |
124 void DoneInitialization_Locked(media::PipelineStatus status); | 124 void DoneInitialization_Locked(media::PipelineStatus status); |
125 | 125 |
126 // Callback method for |loader_| if URL for the resource requested is using | 126 // BufferedResourceLoader::Start() callback for initial load. |
127 // HTTP protocol. This method is called when response for initial request is | 127 void StartCallback(BufferedResourceLoader::Status status); |
128 // received. | |
129 void HttpInitialStartCallback(BufferedResourceLoader::Status status); | |
130 | 128 |
131 // Callback method for |loader_| if URL for the resource requested is using | 129 // BufferedResourceLoader::Start() callback for subsequent loads (i.e., |
132 // a non-HTTP protocol, e.g. local files. This method is called when response | 130 // when accessing ranges that are outside initial buffered region). |
133 // for initial request is received. | |
134 void NonHttpInitialStartCallback(BufferedResourceLoader::Status status); | |
135 | |
136 // Callback method to be passed to BufferedResourceLoader during range | |
137 // request. Once a resource request has started, this method will be called | |
138 // with the error code. This method will be executed on the thread | |
139 // BufferedResourceLoader lives, i.e. render thread. | |
140 void PartialReadStartCallback(BufferedResourceLoader::Status status); | 131 void PartialReadStartCallback(BufferedResourceLoader::Status status); |
141 | 132 |
142 // Read callback for BufferedResourceLoader. | 133 // BufferedResourceLoader callbacks. |
143 void ReadCallback(BufferedResourceLoader::Status status, int bytes_read); | 134 void ReadCallback(BufferedResourceLoader::Status status, int bytes_read); |
144 | 135 void LoadingStateChangedCallback(BufferedResourceLoader::LoadingState state); |
145 // Loading and progress callbacks for HTTP resources. | 136 void ProgressCallback(int64 position); |
146 void HttpLoadingStateChangedCallback( | |
147 BufferedResourceLoader::LoadingState state); | |
148 void HttpProgressCallback(int64 position); | |
149 | 137 |
150 void UpdateHostState_Locked(); | 138 void UpdateHostState_Locked(); |
151 | 139 |
152 // URL of the resource requested. | 140 // URL of the resource requested. |
153 GURL url_; | 141 GURL url_; |
154 // crossorigin attribute on the corresponding HTML media element, if any. | 142 // crossorigin attribute on the corresponding HTML media element, if any. |
155 BufferedResourceLoader::CORSMode cors_mode_; | 143 BufferedResourceLoader::CORSMode cors_mode_; |
156 | 144 |
157 // The total size of the resource. Set during StartCallback() if the size is | 145 // The total size of the resource. Set during StartCallback() if the size is |
158 // known, otherwise it will remain kPositionNotSpecified until the size is | 146 // known, otherwise it will remain kPositionNotSpecified until the size is |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 scoped_refptr<media::MediaLog> media_log_; | 219 scoped_refptr<media::MediaLog> media_log_; |
232 | 220 |
233 DownloadingCB downloading_cb_; | 221 DownloadingCB downloading_cb_; |
234 | 222 |
235 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 223 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
236 }; | 224 }; |
237 | 225 |
238 } // namespace webkit_media | 226 } // namespace webkit_media |
239 | 227 |
240 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ | 228 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ |
OLD | NEW |