Make USB permissions work in the new permission message system
[chromium-blink-merge.git] / content / renderer / media / webrtc / track_observer.h
blob0a39805ba03e6d9bed02698f774b2f9d30d85a61
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/single_thread_task_runner.h"
11 #include "content/common/content_export.h"
12 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
14 namespace content {
16 class CONTENT_EXPORT TrackObserver {
17 public:
18 typedef base::Callback<void(webrtc::MediaStreamTrackInterface::TrackState)>
19 OnChangedCallback;
21 TrackObserver(const scoped_refptr<base::SingleThreadTaskRunner>& main_thread,
22 const scoped_refptr<webrtc::MediaStreamTrackInterface>& track);
23 ~TrackObserver();
25 void SetCallback(const OnChangedCallback& callback);
27 const scoped_refptr<webrtc::MediaStreamTrackInterface>& track() const;
29 private:
30 class TrackObserverImpl;
31 const scoped_refptr<TrackObserverImpl> observer_;
32 DISALLOW_COPY_AND_ASSIGN(TrackObserver);
35 } // namespace content
37 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_