Fix crash on app list start page contents not existing.
[chromium-blink-merge.git] / content / renderer / media / media_stream_track.h
blob14b991aeb8845c51a49750d6e43f3e5ec61fecf4
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_MEDIA_STREAM_TRACK_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_H_
8 #include "base/callback.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/threading/thread_checker.h"
12 #include "content/common/content_export.h"
13 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
15 namespace webrtc {
16 class AudioTrackInterface;
17 class MediaStreamTrackInterface;
18 } // namespace webrtc
20 namespace content {
22 // MediaStreamTrack is a Chrome representation of blink::WebMediaStreamTrack.
23 // It is owned by blink::WebMediaStreamTrack as
24 // blink::WebMediaStreamTrack::ExtraData.
25 class CONTENT_EXPORT MediaStreamTrack
26 : NON_EXPORTED_BASE(public blink::WebMediaStreamTrack::ExtraData) {
27 public:
28 explicit MediaStreamTrack(bool is_local_track);
29 virtual ~MediaStreamTrack();
31 static MediaStreamTrack* GetTrack(
32 const blink::WebMediaStreamTrack& track);
34 virtual void SetEnabled(bool enabled) = 0;
36 virtual void Stop() = 0;
38 // TODO(tommi, xians): Remove this method.
39 virtual webrtc::AudioTrackInterface* GetAudioAdapter();
41 bool is_local_track() const { return is_local_track_; }
43 protected:
44 const bool is_local_track_;
46 base::ThreadChecker thread_checker_;
48 DISALLOW_COPY_AND_ASSIGN(MediaStreamTrack);
51 } // namespace content
53 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_H_