| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef MEDIA_BASE_MESSAGE_LOOP_FACTORY_H_ |
| 6 #define MEDIA_BASE_MESSAGE_LOOP_FACTORY_H_ | 6 #define MEDIA_BASE_MESSAGE_LOOP_FACTORY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace media { | 23 namespace media { |
| 24 | 24 |
| 25 // Factory object that manages named MessageLoops. | 25 // Factory object that manages named MessageLoops. |
| 26 // | 26 // |
| 27 // TODO(scherkus): replace this with something simpler http://crbug.com/116873 | 27 // TODO(scherkus): replace this with something simpler http://crbug.com/116873 |
| 28 class MEDIA_EXPORT MessageLoopFactory { | 28 class MEDIA_EXPORT MessageLoopFactory { |
| 29 public: | 29 public: |
| 30 enum Type { | 30 enum Type { |
| 31 kAudioDecoder, | 31 kDecoder, |
| 32 kVideoDecoder, | |
| 33 kPipeline | 32 kPipeline |
| 34 }; | 33 }; |
| 35 | 34 |
| 36 MessageLoopFactory(); | 35 MessageLoopFactory(); |
| 37 | 36 |
| 38 // Get the message loop proxy associated with |type|. A new MessageLoopProxy | 37 // Get the message loop proxy associated with |type|. A new MessageLoopProxy |
| 39 // is created if the factory doesn't have one associated with |type|. | 38 // is created if the factory doesn't have one associated with |type|. |
| 40 scoped_refptr<base::MessageLoopProxy> GetMessageLoop(Type type); | 39 scoped_refptr<base::MessageLoopProxy> GetMessageLoop(Type type); |
| 41 | 40 |
| 42 private: | 41 private: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 54 // threads are stopped & deleted in reverse order of creation. | 53 // threads are stopped & deleted in reverse order of creation. |
| 55 typedef std::list<std::pair<Type, base::Thread*> > ThreadList; | 54 typedef std::list<std::pair<Type, base::Thread*> > ThreadList; |
| 56 ThreadList threads_; | 55 ThreadList threads_; |
| 57 | 56 |
| 58 DISALLOW_COPY_AND_ASSIGN(MessageLoopFactory); | 57 DISALLOW_COPY_AND_ASSIGN(MessageLoopFactory); |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 } // namespace media | 60 } // namespace media |
| 62 | 61 |
| 63 #endif // MEDIA_BASE_MESSAGE_LOOP_FACTORY_H_ | 62 #endif // MEDIA_BASE_MESSAGE_LOOP_FACTORY_H_ |
| OLD | NEW |