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 CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
10 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
12 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 13 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 class CONTENT_EXPORT TrackObserver { | 17 class CONTENT_EXPORT TrackObserver { |
17 public: | 18 public: |
18 typedef base::Callback<void(webrtc::MediaStreamTrackInterface::TrackState)> | 19 typedef base::Callback<void(webrtc::MediaStreamTrackInterface::TrackState)> |
19 OnChangedCallback; | 20 OnChangedCallback; |
20 | 21 |
21 TrackObserver(const scoped_refptr<base::SingleThreadTaskRunner>& main_thread, | 22 TrackObserver(const scoped_refptr<base::SingleThreadTaskRunner>& main_thread, |
22 const scoped_refptr<webrtc::MediaStreamTrackInterface>& track); | 23 const scoped_refptr<webrtc::MediaStreamTrackInterface>& track); |
23 ~TrackObserver(); | 24 ~TrackObserver(); |
24 | 25 |
25 void SetCallback(const OnChangedCallback& callback); | 26 void SetCallback(const OnChangedCallback& callback); |
26 | 27 |
27 const scoped_refptr<webrtc::MediaStreamTrackInterface>& track() const; | 28 const scoped_refptr<webrtc::MediaStreamTrackInterface>& track() const; |
28 | 29 |
29 private: | 30 private: |
30 class TrackObserverImpl; | 31 class TrackObserverImpl; |
31 const scoped_refptr<TrackObserverImpl> observer_; | 32 const scoped_refptr<TrackObserverImpl> observer_; |
32 DISALLOW_COPY_AND_ASSIGN(TrackObserver); | 33 DISALLOW_COPY_AND_ASSIGN(TrackObserver); |
33 }; | 34 }; |
34 | 35 |
35 } // namespace content | 36 } // namespace content |
36 | 37 |
37 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_ | 38 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_ |
OLD | NEW |