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 // 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_ |
11 #define WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_ | 11 #define WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_ |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 #include "media/base/filter_factories.h" | 18 #include "media/base/filter_factories.h" |
19 #include "media/base/filters.h" | 19 #include "media/base/filters.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoader.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoader.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoaderClient.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoaderClient.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" |
25 #include "webkit/glue/media/web_data_source.h" | 25 #include "webkit/glue/media/web_data_source.h" |
26 | 26 |
27 class MessageLoop; | 27 class MessageLoop; |
28 class WebMediaPlayerDelegateImpl; | 28 class WebMediaPlayerDelegateImpl; |
29 | 29 |
| 30 namespace media { |
| 31 class MediaLog; |
| 32 } |
| 33 |
30 namespace webkit_glue { | 34 namespace webkit_glue { |
31 | 35 |
32 class SimpleDataSource | 36 class SimpleDataSource |
33 : public WebDataSource, | 37 : public WebDataSource, |
34 public WebKit::WebURLLoaderClient { | 38 public WebKit::WebURLLoaderClient { |
35 public: | 39 public: |
36 // Creates a DataSourceFactory for building SimpleDataSource objects. | 40 // Creates a DataSourceFactory for building SimpleDataSource objects. |
37 static media::DataSourceFactory* CreateFactory( | 41 static media::DataSourceFactory* CreateFactory( |
38 MessageLoop* render_loop, | 42 MessageLoop* render_loop, |
39 WebKit::WebFrame* frame, | 43 WebKit::WebFrame* frame, |
| 44 media::MediaLog* media_log, |
40 WebDataSourceBuildObserverHack* build_observer); | 45 WebDataSourceBuildObserverHack* build_observer); |
41 | 46 |
42 SimpleDataSource(MessageLoop* render_loop, WebKit::WebFrame* frame); | 47 SimpleDataSource(MessageLoop* render_loop, WebKit::WebFrame* frame); |
43 virtual ~SimpleDataSource(); | 48 virtual ~SimpleDataSource(); |
44 | 49 |
45 // media::Filter implementation. | 50 // media::Filter implementation. |
46 virtual void set_host(media::FilterHost* host); | 51 virtual void set_host(media::FilterHost* host); |
47 virtual void Stop(media::FilterCallback* callback); | 52 virtual void Stop(media::FilterCallback* callback); |
48 | 53 |
49 // media::DataSource implementation. | 54 // media::DataSource implementation. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 142 |
138 // Used to ensure mocks for unittests are used instead of reset in Start(). | 143 // Used to ensure mocks for unittests are used instead of reset in Start(). |
139 bool keep_test_loader_; | 144 bool keep_test_loader_; |
140 | 145 |
141 DISALLOW_COPY_AND_ASSIGN(SimpleDataSource); | 146 DISALLOW_COPY_AND_ASSIGN(SimpleDataSource); |
142 }; | 147 }; |
143 | 148 |
144 } // namespace webkit_glue | 149 } // namespace webkit_glue |
145 | 150 |
146 #endif // WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_ | 151 #endif // WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_ |
OLD | NEW |