OLD | NEW |
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_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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 // Sets the bitrate to the given value and updates buffer window | 167 // Sets the bitrate to the given value and updates buffer window |
168 // accordingly. | 168 // accordingly. |
169 void SetBitrate(int bitrate); | 169 void SetBitrate(int bitrate); |
170 | 170 |
171 protected: | 171 protected: |
172 friend class base::RefCountedThreadSafe<BufferedResourceLoader>; | 172 friend class base::RefCountedThreadSafe<BufferedResourceLoader>; |
173 virtual ~BufferedResourceLoader(); | 173 virtual ~BufferedResourceLoader(); |
174 | 174 |
175 private: | 175 private: |
176 friend class BufferedDataSourceTest2; | 176 friend class BufferedDataSourceTest; |
177 friend class BufferedResourceLoaderTest; | 177 friend class BufferedResourceLoaderTest; |
178 | 178 |
179 // Updates the |buffer_|'s forward and backward capacities. | 179 // Updates the |buffer_|'s forward and backward capacities. |
180 void UpdateBufferWindow(); | 180 void UpdateBufferWindow(); |
181 | 181 |
182 // Returns true if we should defer resource loading, based | 182 // Returns true if we should defer resource loading, based |
183 // on current buffering scheme. | 183 // on current buffering scheme. |
184 bool ShouldEnableDefer(); | 184 bool ShouldEnableDefer(); |
185 | 185 |
186 // Returns true if we should enable resource loading, based | 186 // Returns true if we should enable resource loading, based |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 float playback_rate_; | 295 float playback_rate_; |
296 | 296 |
297 scoped_refptr<media::MediaLog> media_log_; | 297 scoped_refptr<media::MediaLog> media_log_; |
298 | 298 |
299 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); | 299 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); |
300 }; | 300 }; |
301 | 301 |
302 } // namespace webkit_media | 302 } // namespace webkit_media |
303 | 303 |
304 #endif // WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 304 #endif // WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
OLD | NEW |