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_GLUE_MEDIA_BUFFERED_DATA_SOURCE_FACTORY_H_ | 5 #ifndef WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_FACTORY_H_ |
6 #define WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_FACTORY_H_ | 6 #define WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_FACTORY_H_ |
7 | 7 |
| 8 #include "base/memory/ref_counted.h" |
8 #include "media/base/async_filter_factory_base.h" | 9 #include "media/base/async_filter_factory_base.h" |
9 #include "webkit/glue/media/web_data_source.h" | 10 #include "webkit/glue/media/web_data_source.h" |
10 | 11 |
11 class MessageLoop; | 12 class MessageLoop; |
12 | 13 |
| 14 namespace media { |
| 15 class MediaLog; |
| 16 } |
| 17 |
13 namespace WebKit { | 18 namespace WebKit { |
14 class WebFrame; | 19 class WebFrame; |
15 } | 20 } |
16 | 21 |
17 namespace webkit_glue { | 22 namespace webkit_glue { |
18 | 23 |
19 class WebDataSourceFactory : public media::AsyncDataSourceFactoryBase { | 24 class WebDataSourceFactory : public media::AsyncDataSourceFactoryBase { |
20 public: | 25 public: |
21 typedef WebDataSource* (*FactoryFunction)(MessageLoop* render_loop, | 26 typedef WebDataSource* (*FactoryFunction)(MessageLoop* render_loop, |
22 WebKit::WebFrame* frame); | 27 WebKit::WebFrame* frame, |
| 28 media::MediaLog* media_log); |
23 | 29 |
24 WebDataSourceFactory(MessageLoop* render_loop, WebKit::WebFrame* frame, | 30 WebDataSourceFactory(MessageLoop* render_loop, WebKit::WebFrame* frame, |
| 31 media::MediaLog* media_log, |
25 FactoryFunction factory_function, | 32 FactoryFunction factory_function, |
26 WebDataSourceBuildObserverHack* build_observer); | 33 WebDataSourceBuildObserverHack* build_observer); |
27 virtual ~WebDataSourceFactory(); | 34 virtual ~WebDataSourceFactory(); |
28 | 35 |
29 // DataSourceFactory method. | 36 // DataSourceFactory method. |
30 virtual media::DataSourceFactory* Clone() const; | 37 virtual media::DataSourceFactory* Clone() const; |
31 | 38 |
32 protected: | 39 protected: |
33 // AsyncDataSourceFactoryBase methods. | 40 // AsyncDataSourceFactoryBase methods. |
34 virtual bool AllowRequests() const; | 41 virtual bool AllowRequests() const; |
35 virtual AsyncDataSourceFactoryBase::BuildRequest* CreateRequest( | 42 virtual AsyncDataSourceFactoryBase::BuildRequest* CreateRequest( |
36 const std::string& url, BuildCallback* callback); | 43 const std::string& url, BuildCallback* callback); |
37 | 44 |
38 private: | 45 private: |
39 class BuildRequest; | 46 class BuildRequest; |
40 | 47 |
41 MessageLoop* render_loop_; | 48 MessageLoop* render_loop_; |
42 WebKit::WebFrame* frame_; | 49 WebKit::WebFrame* frame_; |
| 50 scoped_refptr<media::MediaLog> media_log_; |
43 FactoryFunction factory_function_; | 51 FactoryFunction factory_function_; |
44 WebDataSourceBuildObserverHack* build_observer_; | 52 WebDataSourceBuildObserverHack* build_observer_; |
45 | 53 |
46 DISALLOW_COPY_AND_ASSIGN(WebDataSourceFactory); | 54 DISALLOW_COPY_AND_ASSIGN(WebDataSourceFactory); |
47 }; | 55 }; |
48 | 56 |
49 } // namespace webkit_glue | 57 } // namespace webkit_glue |
50 | 58 |
51 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_FACTORY_H_ | 59 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_FACTORY_H_ |
OLD | NEW |