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