| Index: content/renderer/media/media_stream_source.h
 | 
| diff --git a/content/renderer/media/media_stream_source.h b/content/renderer/media/media_stream_source.h
 | 
| new file mode 100644
 | 
| index 0000000000000000000000000000000000000000..93989c3b1e024ddf594ed1a9369476a62abce793
 | 
| --- /dev/null
 | 
| +++ b/content/renderer/media/media_stream_source.h
 | 
| @@ -0,0 +1,70 @@
 | 
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
 | 
| +// Use of this source code is governed by a BSD-style license that can be
 | 
| +// found in the LICENSE file.
 | 
| +
 | 
| +#ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_
 | 
| +#define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_
 | 
| +
 | 
| +#include "base/callback.h"
 | 
| +#include "base/compiler_specific.h"
 | 
| +#include "content/common/content_export.h"
 | 
| +#include "content/common/media/media_stream_options.h"
 | 
| +#include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
 | 
| +
 | 
| +namespace blink {
 | 
| +class WebMediaStreamTrack;
 | 
| +}  // namespace blink
 | 
| +
 | 
| +namespace content {
 | 
| +
 | 
| +class CONTENT_EXPORT MediaStreamSource
 | 
| +    : NON_EXPORTED_BASE(public blink::WebMediaStreamSource::ExtraData) {
 | 
| + public:
 | 
| +  typedef base::Callback<void(const blink::WebMediaStreamSource& source)>
 | 
| +      SourceStopCallback;
 | 
| +
 | 
| +  typedef base::Callback<void(MediaStreamSource* source,
 | 
| +                              bool success)> ConstraintsCallback;
 | 
| +
 | 
| +  MediaStreamSource();
 | 
| +  virtual ~MediaStreamSource();
 | 
| +
 | 
| +  virtual void AddTrack(const blink::WebMediaStreamTrack& track) {};
 | 
| +  virtual void RemoveTrack(const blink::WebMediaStreamTrack& track) {};
 | 
| +  virtual void ApplyConstraints(const blink::WebMediaStreamTrack& track,
 | 
| +                                const blink::WebMediaConstraints& constraints,
 | 
| +                                const ConstraintsCallback& callback);
 | 
| +
 | 
| +  // Return device information about the camera or microphone.
 | 
| +  const StreamDeviceInfo& device_info() const {
 | 
| +    return device_info_;
 | 
| +  }
 | 
| +
 | 
| +  void OnLocalSourceStop();
 | 
| +
 | 
| + protected:
 | 
| +  // Called when OnLocalsSource is called.
 | 
| +  virtual void DoStopSource() = 0;
 | 
| +
 | 
| +  // Set device information about the camera or microphone.
 | 
| +  void SetDeviceInfo(const StreamDeviceInfo& device_info) {
 | 
| +    device_info_ = device_info;
 | 
| +  }
 | 
| +
 | 
| +  // Set a callback that is triggered when OnLocalSourceStop is called.
 | 
| +  void SetStopCallback(const SourceStopCallback& stop_callback) {
 | 
| +    DCHECK(stop_callback_.is_null());
 | 
| +    stop_callback_ = stop_callback;
 | 
| +  }
 | 
| +
 | 
| + private:
 | 
| +  StreamDeviceInfo device_info_;
 | 
| +
 | 
| +  SourceStopCallback stop_callback_;
 | 
| +
 | 
| +  DISALLOW_COPY_AND_ASSIGN(MediaStreamSource);
 | 
| +};
 | 
| +
 | 
| +}  // namespace content
 | 
| +
 | 
| +#endif  // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_H_
 | 
| 
 |