diff options
author | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-15 07:09:27 +0000 |
---|---|---|
committer | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-15 07:09:27 +0000 |
commit | f78d1dfc8d92a6667a355e90da7f2f100c89b832 (patch) | |
tree | bcba6d266d612b0df072cf32241c83d1ba6b897a /media/base/message_loop_factory.h | |
parent | 4e425be43fae960cad4dc81be0181bf99f2f7080 (diff) | |
download | chromium_src-f78d1dfc8d92a6667a355e90da7f2f100c89b832.zip chromium_src-f78d1dfc8d92a6667a355e90da7f2f100c89b832.tar.gz chromium_src-f78d1dfc8d92a6667a355e90da7f2f100c89b832.tar.bz2 |
Remove MessageLoop methods from Filter interface to
separate Filter management from MessageLoop management.
This sets the stage for filters to share threads in the
future which will reduce resource consumption when
multiple <video> tags are on the same page.
BUG=69451
TEST=None
Review URL: http://codereview.chromium.org/6171009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/message_loop_factory.h')
-rw-r--r-- | media/base/message_loop_factory.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/media/base/message_loop_factory.h b/media/base/message_loop_factory.h new file mode 100644 index 0000000..dacfab2 --- /dev/null +++ b/media/base/message_loop_factory.h @@ -0,0 +1,34 @@ +// 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 <string> + +#include "base/scoped_ptr.h" + +class MessageLoop; + +namespace media { + +// Factory object that manages named MessageLoops. +class MessageLoopFactory { + 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 an empty string, or a new + // MessageLoop needs to be created and a failure occurs during the + // creation process. + virtual MessageLoop* GetMessageLoop(const std::string& name) = 0; + + protected: + // Only allow scoped_ptr<> to delete factory. + friend class scoped_ptr<MessageLoopFactory>; + virtual ~MessageLoopFactory(); +}; + +} // namespace media + +#endif // MEDIA_BASE_MESSAGE_LOOP_FACTORY_H_ |