Chromium Code Reviews| 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 #include "media/base/message_loop_factory.h" | 5 #include "media/base/message_loop_factory.h" |
| 6 | 6 |
| 7 #include "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
| 8 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 | 27 |
| 28 base::Thread* MessageLoopFactory::GetThread(Type type) { | 28 base::Thread* MessageLoopFactory::GetThread(Type type) { |
| 29 base::AutoLock auto_lock(lock_); | 29 base::AutoLock auto_lock(lock_); |
| 30 for (ThreadList::iterator it = threads_.begin(); it != threads_.end(); ++it) { | 30 for (ThreadList::iterator it = threads_.begin(); it != threads_.end(); ++it) { |
| 31 if (it->first == type) | 31 if (it->first == type) |
| 32 return it->second; | 32 return it->second; |
| 33 } | 33 } |
| 34 | 34 |
| 35 const char* name = NULL; | 35 const char* name = NULL; |
| 36 switch (type) { | 36 switch (type) { |
| 37 case kAudioDecoder: | 37 case kDecoder: |
| 38 name = "AudioDecoderThread"; | 38 name = "DecoderThread"; |
|
Ami GONE FROM CHROMIUM
2012/09/06 08:39:40
optional: s/Decoder/MediaDecoder/ ?
(no need for "
scherkus (not reviewing)
2012/09/06 09:02:41
Done + for pipeline as well
| |
| 39 break; | |
| 40 case kVideoDecoder: | |
| 41 name = "VideoDecoderThread"; | |
| 42 break; | 39 break; |
| 43 case kPipeline: | 40 case kPipeline: |
| 44 name = "PipelineThread"; | 41 name = "PipelineThread"; |
| 45 break; | 42 break; |
| 46 } | 43 } |
| 47 | 44 |
| 48 base::Thread* thread = new base::Thread(name); | 45 base::Thread* thread = new base::Thread(name); |
| 49 CHECK(thread->Start()) << "Failed to start thread: " << name; | 46 CHECK(thread->Start()) << "Failed to start thread: " << name; |
| 50 threads_.push_back(std::make_pair(type, thread)); | 47 threads_.push_back(std::make_pair(type, thread)); |
| 51 return thread; | 48 return thread; |
| 52 } | 49 } |
| 53 | 50 |
| 54 } // namespace media | 51 } // namespace media |
| OLD | NEW |