| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_LOOP_H_ | 5 #ifndef CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_LOOP_H_ |
| 6 #define CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_LOOP_H_ | 6 #define CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_LOOP_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class MessageLoopProxy; | 13 class MessageLoopProxy; |
| 14 class SingleThreadTaskRunner; |
| 14 class Thread; | 15 class Thread; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace chromecast { | 18 namespace chromecast { |
| 18 namespace media { | 19 namespace media { |
| 19 | 20 |
| 20 class CmaMessageLoop { | 21 class CmaMessageLoop { |
| 21 public: | 22 public: |
| 23 // TODO(gunsch): clean up references to deprecated Message*Loop*Proxy. |
| 22 static scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxy(); | 24 static scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxy(); |
| 25 static scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(); |
| 23 | 26 |
| 24 private: | 27 private: |
| 25 friend struct DefaultSingletonTraits<CmaMessageLoop>; | 28 friend struct DefaultSingletonTraits<CmaMessageLoop>; |
| 26 friend class Singleton<CmaMessageLoop>; | 29 friend class Singleton<CmaMessageLoop>; |
| 27 | 30 |
| 28 static CmaMessageLoop* GetInstance(); | 31 static CmaMessageLoop* GetInstance(); |
| 29 | 32 |
| 30 CmaMessageLoop(); | 33 CmaMessageLoop(); |
| 31 ~CmaMessageLoop(); | 34 ~CmaMessageLoop(); |
| 32 | 35 |
| 33 scoped_ptr<base::Thread> thread_; | 36 scoped_ptr<base::Thread> thread_; |
| 34 | 37 |
| 35 DISALLOW_COPY_AND_ASSIGN(CmaMessageLoop); | 38 DISALLOW_COPY_AND_ASSIGN(CmaMessageLoop); |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 } // namespace media | 41 } // namespace media |
| 39 } // namespace chromecast | 42 } // namespace chromecast |
| 40 | 43 |
| 41 #endif // CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_LOOP_H_ | 44 #endif // CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_LOOP_H_ |
| OLD | NEW |