| 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 CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ | 6 #define CONTENT_RENDERER_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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // behavior. | 91 // behavior. |
| 92 void MediaPlaybackRateChanged(float playback_rate); | 92 void MediaPlaybackRateChanged(float playback_rate); |
| 93 void MediaIsPlaying(); | 93 void MediaIsPlaying(); |
| 94 void MediaIsPaused(); | 94 void MediaIsPaused(); |
| 95 | 95 |
| 96 // Returns true if the resource is local. | 96 // Returns true if the resource is local. |
| 97 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); } | 97 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); } |
| 98 | 98 |
| 99 // media::DataSource implementation. | 99 // media::DataSource implementation. |
| 100 // Called from demuxer thread. | 100 // Called from demuxer thread. |
| 101 virtual void Stop(const base::Closure& closure) OVERRIDE; | 101 virtual void Stop() OVERRIDE; |
| 102 | 102 |
| 103 virtual void Read(int64 position, int size, uint8* data, | 103 virtual void Read(int64 position, int size, uint8* data, |
| 104 const media::DataSource::ReadCB& read_cb) OVERRIDE; | 104 const media::DataSource::ReadCB& read_cb) OVERRIDE; |
| 105 virtual bool GetSize(int64* size_out) OVERRIDE; | 105 virtual bool GetSize(int64* size_out) OVERRIDE; |
| 106 virtual bool IsStreaming() OVERRIDE; | 106 virtual bool IsStreaming() OVERRIDE; |
| 107 virtual void SetBitrate(int bitrate) OVERRIDE; | 107 virtual void SetBitrate(int bitrate) OVERRIDE; |
| 108 | 108 |
| 109 protected: | 109 protected: |
| 110 // A factory method to create a BufferedResourceLoader based on the read | 110 // A factory method to create a BufferedResourceLoader based on the read |
| 111 // parameters. We can override this file to object a mock | 111 // parameters. We can override this file to object a mock |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 // NOTE: Weak pointers must be invalidated before all other member variables. | 223 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 224 base::WeakPtrFactory<BufferedDataSource> weak_factory_; | 224 base::WeakPtrFactory<BufferedDataSource> weak_factory_; |
| 225 | 225 |
| 226 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 226 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 } // namespace content | 229 } // namespace content |
| 230 | 230 |
| 231 #endif // CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ | 231 #endif // CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| OLD | NEW |