| 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 MEDIA_BASE_COMPOSITE_DATA_SOURCE_FACTORY_H_ | 5 #ifndef MEDIA_BASE_COMPOSITE_DATA_SOURCE_FACTORY_H_ |
| 6 #define MEDIA_BASE_COMPOSITE_DATA_SOURCE_FACTORY_H_ | 6 #define MEDIA_BASE_COMPOSITE_DATA_SOURCE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "media/base/async_filter_factory_base.h" | 12 #include "media/base/async_filter_factory_base.h" |
| 13 | 13 |
| 14 namespace media { | 14 namespace media { |
| 15 | 15 |
| 16 class MEDIA_EXPORT CompositeDataSourceFactory | 16 class MEDIA_EXPORT CompositeDataSourceFactory |
| 17 : public AsyncDataSourceFactoryBase { | 17 : public AsyncDataSourceFactoryBase { |
| 18 public: | 18 public: |
| 19 CompositeDataSourceFactory(); | 19 CompositeDataSourceFactory(); |
| 20 virtual ~CompositeDataSourceFactory(); | 20 virtual ~CompositeDataSourceFactory(); |
| 21 | 21 |
| 22 // Add factory to this composite. Ownership is transferred here. | 22 // Add factory to this composite. |
| 23 void AddFactory(DataSourceFactory* factory); | 23 void AddFactory(scoped_ptr<DataSourceFactory> factory); |
| 24 | 24 |
| 25 // DataSourceFactory method. | 25 // DataSourceFactory method. |
| 26 virtual DataSourceFactory* Clone() const OVERRIDE; | 26 virtual scoped_ptr<DataSourceFactory> Clone() const OVERRIDE; |
| 27 | 27 |
| 28 protected: | 28 protected: |
| 29 // AsyncDataSourceFactoryBase methods. | 29 // AsyncDataSourceFactoryBase methods. |
| 30 virtual bool AllowRequests() const OVERRIDE; | 30 virtual bool AllowRequests() const OVERRIDE; |
| 31 virtual AsyncDataSourceFactoryBase::BuildRequest* CreateRequest( | 31 virtual AsyncDataSourceFactoryBase::BuildRequest* CreateRequest( |
| 32 const std::string& url, const BuildCallback& callback) OVERRIDE; | 32 const std::string& url, const BuildCallback& callback) OVERRIDE; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 class BuildRequest; | 35 class BuildRequest; |
| 36 | 36 |
| 37 typedef std::list<DataSourceFactory*> FactoryList; | 37 typedef std::list<DataSourceFactory*> FactoryList; |
| 38 FactoryList factories_; | 38 FactoryList factories_; |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(CompositeDataSourceFactory); | 40 DISALLOW_COPY_AND_ASSIGN(CompositeDataSourceFactory); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace media | 43 } // namespace media |
| 44 | 44 |
| 45 #endif // MEDIA_BASE_COMPOSITE_DATA_SOURCE_FACTORY_H_ | 45 #endif // MEDIA_BASE_COMPOSITE_DATA_SOURCE_FACTORY_H_ |
| OLD | NEW |