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_MESSAGE_LOOP_FACTORY_IMPL_H_ | 5 #ifndef MEDIA_BASE_MESSAGE_LOOP_FACTORY_IMPL_H_ |
6 #define MEDIA_BASE_MESSAGE_LOOP_FACTORY_IMPL_H_ | 6 #define MEDIA_BASE_MESSAGE_LOOP_FACTORY_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
12 #include "media/base/message_loop_factory.h" | 12 #include "media/base/message_loop_factory.h" |
13 | 13 |
14 namespace media { | 14 namespace media { |
15 | 15 |
16 class MEDIA_EXPORT MessageLoopFactoryImpl : public MessageLoopFactory { | 16 class MessageLoopFactoryImpl : public MessageLoopFactory { |
17 public: | 17 public: |
18 MessageLoopFactoryImpl(); | 18 MessageLoopFactoryImpl(); |
19 | 19 |
20 // MessageLoopFactory methods. | 20 // MessageLoopFactory methods. |
21 virtual MessageLoop* GetMessageLoop(const std::string& name); | 21 virtual MessageLoop* GetMessageLoop(const std::string& name); |
22 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxy( | 22 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxy( |
23 const std::string& name); | 23 const std::string& name); |
24 | 24 |
25 protected: | 25 protected: |
26 virtual ~MessageLoopFactoryImpl(); | 26 virtual ~MessageLoopFactoryImpl(); |
27 | 27 |
28 private: | 28 private: |
29 // Lock used to serialize access for the following data members. | 29 // Lock used to serialize access for the following data members. |
30 base::Lock lock_; | 30 base::Lock lock_; |
31 | 31 |
32 typedef std::map<std::string, base::Thread*> ThreadMap; | 32 typedef std::map<std::string, base::Thread*> ThreadMap; |
33 ThreadMap thread_map_; | 33 ThreadMap thread_map_; |
34 | 34 |
35 DISALLOW_COPY_AND_ASSIGN(MessageLoopFactoryImpl); | 35 DISALLOW_COPY_AND_ASSIGN(MessageLoopFactoryImpl); |
36 }; | 36 }; |
37 | 37 |
38 } // namespace media | 38 } // namespace media |
39 | 39 |
40 #endif // MEDIA_BASE_MESSAGE_LOOP_FACTORY_IMPL_H_ | 40 #endif // MEDIA_BASE_MESSAGE_LOOP_FACTORY_IMPL_H_ |
OLD | NEW |