Index: chromecast/browser/media/cma_message_loop.cc |
diff --git a/chromecast/browser/media/cma_message_loop.cc b/chromecast/browser/media/cma_message_loop.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..98b2d9580ce25dc23b926441ff9700df3d23bca8 |
--- /dev/null |
+++ b/chromecast/browser/media/cma_message_loop.cc |
@@ -0,0 +1,32 @@ |
+// Copyright 2014 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. |
+ |
+#include "chromecast/browser/media/cma_message_loop.h" |
+ |
+#include "base/threading/thread.h" |
+ |
+namespace chromecast { |
+namespace media { |
+ |
+// static |
+scoped_refptr<base::MessageLoopProxy> CmaMessageLoop::GetMessageLoopProxy() { |
+ return GetInstance()->thread_->message_loop_proxy(); |
+} |
+ |
+// static |
+CmaMessageLoop* CmaMessageLoop::GetInstance() { |
+ return Singleton<CmaMessageLoop>::get(); |
+} |
+ |
+CmaMessageLoop::CmaMessageLoop() |
+ : thread_(new base::Thread("CmaThread")) { |
+ thread_->Start(); |
+} |
+ |
+CmaMessageLoop::~CmaMessageLoop() { |
+ // This will automatically shutdown the thread. |
+} |
+ |
+} // namespace media |
+} // namespace chromecast |