OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ | 5 #ifndef MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ |
6 #define MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ | 6 #define MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // behavior. | 101 // behavior. |
102 void MediaPlaybackRateChanged(float playback_rate); | 102 void MediaPlaybackRateChanged(float playback_rate); |
103 void MediaIsPlaying(); | 103 void MediaIsPlaying(); |
104 void MediaIsPaused(); | 104 void MediaIsPaused(); |
105 | 105 |
106 // Returns true if the resource is local. | 106 // Returns true if the resource is local. |
107 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); } | 107 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); } |
108 | 108 |
109 // DataSource implementation. | 109 // DataSource implementation. |
110 // Called from demuxer thread. | 110 // Called from demuxer thread. |
111 virtual void Stop() OVERRIDE; | 111 virtual void Stop() override; |
112 | 112 |
113 virtual void Read(int64 position, int size, uint8* data, | 113 virtual void Read(int64 position, int size, uint8* data, |
114 const DataSource::ReadCB& read_cb) OVERRIDE; | 114 const DataSource::ReadCB& read_cb) override; |
115 virtual bool GetSize(int64* size_out) OVERRIDE; | 115 virtual bool GetSize(int64* size_out) override; |
116 virtual bool IsStreaming() OVERRIDE; | 116 virtual bool IsStreaming() override; |
117 virtual void SetBitrate(int bitrate) OVERRIDE; | 117 virtual void SetBitrate(int bitrate) override; |
118 | 118 |
119 protected: | 119 protected: |
120 // A factory method to create a BufferedResourceLoader based on the read | 120 // A factory method to create a BufferedResourceLoader based on the read |
121 // parameters. We can override this file to object a mock | 121 // parameters. We can override this file to object a mock |
122 // BufferedResourceLoader for testing. | 122 // BufferedResourceLoader for testing. |
123 virtual BufferedResourceLoader* CreateResourceLoader( | 123 virtual BufferedResourceLoader* CreateResourceLoader( |
124 int64 first_byte_position, int64 last_byte_position); | 124 int64 first_byte_position, int64 last_byte_position); |
125 | 125 |
126 private: | 126 private: |
127 friend class BufferedDataSourceTest; | 127 friend class BufferedDataSourceTest; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 231 |
232 // NOTE: Weak pointers must be invalidated before all other member variables. | 232 // NOTE: Weak pointers must be invalidated before all other member variables. |
233 base::WeakPtrFactory<BufferedDataSource> weak_factory_; | 233 base::WeakPtrFactory<BufferedDataSource> weak_factory_; |
234 | 234 |
235 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 235 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
236 }; | 236 }; |
237 | 237 |
238 } // namespace media | 238 } // namespace media |
239 | 239 |
240 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ | 240 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ |
OLD | NEW |