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