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