| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MEDIA_CAST_CAST_ENVIRONMENT_H_ | 5 #ifndef MEDIA_CAST_CAST_ENVIRONMENT_H_ |
| 6 #define MEDIA_CAST_CAST_ENVIRONMENT_H_ | 6 #define MEDIA_CAST_CAST_ENVIRONMENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 base::TickClock* Clock() const { return clock_.get(); } | 57 base::TickClock* Clock() const { return clock_.get(); } |
| 58 | 58 |
| 59 // Logging is not thread safe. Its methods should always be called from the | 59 // Logging is not thread safe. Its methods should always be called from the |
| 60 // main thread. | 60 // main thread. |
| 61 // TODO(hubbe): Logging should be a thread-safe interface. | 61 // TODO(hubbe): Logging should be a thread-safe interface. |
| 62 LoggingImpl* Logging() const { return logging_.get(); } | 62 LoggingImpl* Logging() const { return logging_.get(); } |
| 63 | 63 |
| 64 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner( | 64 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner( |
| 65 ThreadId identifier) const; | 65 ThreadId identifier) const; |
| 66 | 66 |
| 67 bool HasAudioThread() { | 67 bool HasAudioThread() { return audio_thread_proxy_.get() ? true : false; } |
| 68 return audio_thread_proxy_ ? true : false; | |
| 69 } | |
| 70 | 68 |
| 71 bool HasVideoThread() { | 69 bool HasVideoThread() { return video_thread_proxy_.get() ? true : false; } |
| 72 return video_thread_proxy_ ? true : false; | |
| 73 } | |
| 74 | 70 |
| 75 protected: | 71 protected: |
| 76 virtual ~CastEnvironment(); | 72 virtual ~CastEnvironment(); |
| 77 | 73 |
| 78 // Subclasses may override these. | 74 // Subclasses may override these. |
| 79 scoped_refptr<base::SingleThreadTaskRunner> main_thread_proxy_; | 75 scoped_refptr<base::SingleThreadTaskRunner> main_thread_proxy_; |
| 80 scoped_refptr<base::SingleThreadTaskRunner> audio_thread_proxy_; | 76 scoped_refptr<base::SingleThreadTaskRunner> audio_thread_proxy_; |
| 81 scoped_refptr<base::SingleThreadTaskRunner> video_thread_proxy_; | 77 scoped_refptr<base::SingleThreadTaskRunner> video_thread_proxy_; |
| 82 scoped_ptr<base::TickClock> clock_; | 78 scoped_ptr<base::TickClock> clock_; |
| 83 scoped_ptr<LoggingImpl> logging_; | 79 scoped_ptr<LoggingImpl> logging_; |
| 84 | 80 |
| 85 private: | 81 private: |
| 86 friend class base::RefCountedThreadSafe<CastEnvironment>; | 82 friend class base::RefCountedThreadSafe<CastEnvironment>; |
| 87 | 83 |
| 88 DISALLOW_COPY_AND_ASSIGN(CastEnvironment); | 84 DISALLOW_COPY_AND_ASSIGN(CastEnvironment); |
| 89 }; | 85 }; |
| 90 | 86 |
| 91 } // namespace cast | 87 } // namespace cast |
| 92 } // namespace media | 88 } // namespace media |
| 93 | 89 |
| 94 #endif // MEDIA_CAST_CAST_ENVIRONMENT_H_ | 90 #endif // MEDIA_CAST_CAST_ENVIRONMENT_H_ |
| OLD | NEW |