OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // An extremely simple implementation of DataSource that downloads the entire | 5 // An extremely simple implementation of DataSource that downloads the entire |
6 // media resource into memory before signaling that initialization has finished. | 6 // media resource into memory before signaling that initialization has finished. |
7 // Primarily used to test <audio> and <video> with buffering/caching removed | 7 // Primarily used to test <audio> and <video> with buffering/caching removed |
8 // from the equation. | 8 // from the equation. |
9 | 9 |
10 #ifndef WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_ | 10 #ifndef WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_ |
(...skipping 16 matching lines...) Expand all Loading... |
27 class WebMediaPlayerDelegateImpl; | 27 class WebMediaPlayerDelegateImpl; |
28 | 28 |
29 namespace webkit_glue { | 29 namespace webkit_glue { |
30 | 30 |
31 class SimpleDataSource : public WebDataSource, | 31 class SimpleDataSource : public WebDataSource, |
32 public WebKit::WebURLLoaderClient { | 32 public WebKit::WebURLLoaderClient { |
33 public: | 33 public: |
34 SimpleDataSource(MessageLoop* render_loop, WebKit::WebFrame* frame); | 34 SimpleDataSource(MessageLoop* render_loop, WebKit::WebFrame* frame); |
35 virtual ~SimpleDataSource(); | 35 virtual ~SimpleDataSource(); |
36 | 36 |
37 // MediaFilter implementation. | 37 // media::Filter implementation. |
38 virtual void Stop(media::FilterCallback* callback); | 38 virtual void Stop(media::FilterCallback* callback); |
39 | 39 |
40 // DataSource implementation. | 40 // media::DataSource implementation. |
41 virtual void Initialize(const std::string& url, | 41 virtual void Initialize(const std::string& url, |
42 media::FilterCallback* callback); | 42 media::FilterCallback* callback); |
43 virtual const media::MediaFormat& media_format(); | 43 virtual const media::MediaFormat& media_format(); |
44 virtual void Read(int64 position, size_t size, | 44 virtual void Read(int64 position, size_t size, |
45 uint8* data, ReadCallback* read_callback); | 45 uint8* data, ReadCallback* read_callback); |
46 virtual bool GetSize(int64* size_out); | 46 virtual bool GetSize(int64* size_out); |
47 virtual bool IsStreaming(); | 47 virtual bool IsStreaming(); |
48 | 48 |
49 // Used to inject a mock used for unittests. | 49 // Used to inject a mock used for unittests. |
50 virtual void SetURLLoaderForTest(WebKit::WebURLLoader* mock_loader); | 50 virtual void SetURLLoaderForTest(WebKit::WebURLLoader* mock_loader); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 // Used to ensure mocks for unittests are used instead of reset in Start(). | 128 // Used to ensure mocks for unittests are used instead of reset in Start(). |
129 bool keep_test_loader_; | 129 bool keep_test_loader_; |
130 | 130 |
131 DISALLOW_COPY_AND_ASSIGN(SimpleDataSource); | 131 DISALLOW_COPY_AND_ASSIGN(SimpleDataSource); |
132 }; | 132 }; |
133 | 133 |
134 } // namespace webkit_glue | 134 } // namespace webkit_glue |
135 | 135 |
136 #endif // WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_ | 136 #endif // WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_ |
OLD | NEW |