Chromium Code Reviews| Index: media/base/message_loop_factory.h |
| diff --git a/media/base/message_loop_factory.h b/media/base/message_loop_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..02f255c81b7ff9e8b13d409007db2ef1fe8e4893 |
| --- /dev/null |
| +++ b/media/base/message_loop_factory.h |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_BASE_MESSAGE_LOOP_FACTORY_H |
| +#define MEDIA_BASE_MESSAGE_LOOP_FACTORY_H |
| + |
| +#include "base/ref_counted.h" |
| + |
| +class MessageLoop; |
| + |
| +namespace media { |
| + |
| +// Factory object that manages named MessageLoops. |
| +class MessageLoopFactory : |
| + public base::RefCountedThreadSafe<MessageLoopFactory> { |
|
scherkus (not reviewing)
2011/01/13 06:28:13
does this actually have to be ref-counted?
lookin
acolwell GONE FROM CHROMIUM
2011/01/13 23:15:00
I'll remove it for now since there isn't a need ye
|
| + public: |
| + // Get the message loop associated with |name|. A new MessageLoop |
| + // is created if the factory doesn't have one associated with |name|. |
| + // Null is returned if |name| is null, |name| is an empty string, or a new |
| + // MessageLoop needs to be created and a failure occurs during the |
| + // creation process. |
| + virtual MessageLoop* GetMessageLoop(const char* name) = 0; |
| + |
| + protected: |
| + // Only allow scoped_refptr<> to delete filters. |
| + friend class base::RefCountedThreadSafe<MessageLoopFactory>; |
| + virtual ~MessageLoopFactory(); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_BASE_MESSAGE_LOOP_FACTORY_H |