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

Unified Diff: media/base/message_loop_factory_for_test.h

Issue 9632024: Create video and audio decoder threads on demand. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
Index: media/base/message_loop_factory_for_test.h
diff --git a/media/base/message_loop_factory_for_test.h b/media/base/message_loop_factory_for_test.h
new file mode 100644
index 0000000000000000000000000000000000000000..7b0a0e9a3eee4bfa3b8f99c108e5b0c360050c48
--- /dev/null
+++ b/media/base/message_loop_factory_for_test.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2012 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_FOR_TEST_H_
+#define MEDIA_BASE_MESSAGE_LOOP_FACTORY_FOR_TEST_H_
+
+#include "base/compiler_specific.h"
+#include "media/base/message_loop_factory.h"
+
+namespace media {
+
+// A very basic implementation of MessageLoopFactory that supports only a single
+// loop. Useful for tests that want to run video/audio decoders on the same
+// thread as the test runs on.
+class MessageLoopFactoryForTest : public MessageLoopFactory {
+ public:
+ explicit MessageLoopFactoryForTest(MessageLoop* the_only_loop);
+ virtual ~MessageLoopFactoryForTest();
+
+ virtual MessageLoop* GetMessageLoop(const std::string& name) OVERRIDE;
+
+ private:
+ MessageLoop* the_only_loop_;
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_MESSAGE_LOOP_FACTORY_FOR_TEST_H_

Powered by Google App Engine
This is Rietveld 408576698