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