1 // Copyright (c) 2012 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. 4 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_EXTRA_DATA_H_ 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_EXTRA_DATA_H_ 7 8 #include "base/callback.h" 9 #include "base/compiler_specific.h" 10 #include "base/memory/ref_counted.h" 11 #include "content/common/content_export.h" 12 #include "third_party/WebKit/public/platform/WebMediaStream.h" 13 14 namespace webrtc { 15 class MediaStreamInterface; 16 } // namespace webrtc 17 18 namespace content { 19 20 class CONTENT_EXPORT MediaStreamExtraData NON_EXPORTED_BASE(public blink::WebMediaStream::ExtraData)21 : NON_EXPORTED_BASE(public blink::WebMediaStream::ExtraData) { 22 public: 23 typedef base::Callback<void(const std::string& label)> StreamStopCallback; 24 25 MediaStreamExtraData(webrtc::MediaStreamInterface* stream, bool is_local); 26 virtual ~MediaStreamExtraData(); 27 28 bool is_local() const { return is_local_; } 29 30 void SetLocalStreamStopCallback( 31 const StreamStopCallback& stop_callback); 32 void OnLocalStreamStop(); 33 34 const scoped_refptr<webrtc::MediaStreamInterface>& stream() const { 35 return stream_; 36 } 37 private: 38 StreamStopCallback stream_stop_callback_; 39 scoped_refptr<webrtc::MediaStreamInterface> stream_; 40 bool is_local_; 41 42 DISALLOW_COPY_AND_ASSIGN(MediaStreamExtraData); 43 }; 44 45 } // namespace content 46 47 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_EXTRA_DATA_H_ 48