Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: media/base/message_loop_factory.h

Issue 10855051: Use enum instead of string in MessageLoopFactory::GetMessageLoop* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | media/base/message_loop_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/message_loop_factory.h
diff --git a/media/base/message_loop_factory.h b/media/base/message_loop_factory.h
index f5ecda2c75af1fe991adfaf56094b53a32525a3a..1112b3403f942ee75520898ada79b97971da8b83 100644
--- a/media/base/message_loop_factory.h
+++ b/media/base/message_loop_factory.h
@@ -27,35 +27,32 @@ namespace media {
// TODO(scherkus): replace this with something simpler http://crbug.com/116873
class MEDIA_EXPORT MessageLoopFactory {
public:
- MessageLoopFactory();
+ enum Type {
+ kAudioDecoder,
+ kVideoDecoder,
+ kPipeline
+ };
- // Get the message loop associated with |name|. A new MessageLoop
- // is created if the factory doesn't have one associated with |name|.
- //
- // |name| must not be an empty string.
- MessageLoop* GetMessageLoop(const std::string& name);
+ MessageLoopFactory();
- // Get the message loop proxy associated with |name|. A new MessageLoopProxy
- // is created if the factory doesn't have one associated with |name|.
- //
- // |name| must not be an empty string.
- scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxy(
- const std::string& name);
+ // Get the message loop proxy associated with |type|. A new MessageLoopProxy
+ // is created if the factory doesn't have one associated with |type|.
+ scoped_refptr<base::MessageLoopProxy> GetMessageLoop(Type type);
private:
// Only allow scoped_ptr<> to delete factory.
friend class scoped_ptr<MessageLoopFactory>;
~MessageLoopFactory();
- // Returns the thread associated with |name| creating a new thread if needed.
- base::Thread* GetThread(const std::string& name);
+ // Returns the thread associated with |type| creating a new thread if needed.
+ base::Thread* GetThread(Type type);
// Lock used to serialize access for the following data members.
base::Lock lock_;
- // List of pairs of created threads and their names. We use a list to ensure
+ // List of pairs of created threads and their types. We use a list to ensure
// threads are stopped & deleted in reverse order of creation.
- typedef std::list<std::pair<std::string, base::Thread*> > ThreadList;
+ typedef std::list<std::pair<Type, base::Thread*> > ThreadList;
ThreadList threads_;
DISALLOW_COPY_AND_ASSIGN(MessageLoopFactory);
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | media/base/message_loop_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698