namespace content {
class MediaStreamManager;
+class ResourceContext;
// MediaStreamDispatcherHost is a delegate for Media Stream API messages used by
-// MediaStreamImpl. It's the complement of MediaStreamDispatcher
-// (owned by RenderView).
+// MediaStreamImpl. There is one MediaStreamDispatcherHost per
+// RenderProcessHost, the former owned by the latter.
class CONTENT_EXPORT MediaStreamDispatcherHost : public BrowserMessageFilter,
public MediaStreamRequester {
public:
MediaStreamManager* media_stream_manager);
// MediaStreamRequester implementation.
- virtual void StreamGenerated(
- int render_view_id,
+ void StreamGenerated(int render_frame_id,
+ int page_request_id,
+ const std::string& label,
+ const StreamDeviceInfoArray& audio_devices,
+ const StreamDeviceInfoArray& video_devices) override;
+ void StreamGenerationFailed(
+ int render_frame_id,
int page_request_id,
- const std::string& label,
- const StreamDeviceInfoArray& audio_devices,
- const StreamDeviceInfoArray& video_devices) OVERRIDE;
- virtual void StreamGenerationFailed(int render_view_id,
- int page_request_id) OVERRIDE;
- virtual void DeviceStopped(int render_view_id,
- const std::string& label,
- const StreamDeviceInfo& device) OVERRIDE;
- virtual void DevicesEnumerated(int render_view_id,
- int page_request_id,
- const std::string& label,
- const StreamDeviceInfoArray& devices) OVERRIDE;
- virtual void DeviceOpened(int render_view_id,
- int page_request_id,
- const std::string& label,
- const StreamDeviceInfo& video_device) OVERRIDE;
+ content::MediaStreamRequestResult result) override;
+ void DeviceStopped(int render_frame_id,
+ const std::string& label,
+ const StreamDeviceInfo& device) override;
+ void DevicesEnumerated(int render_frame_id,
+ int page_request_id,
+ const std::string& label,
+ const StreamDeviceInfoArray& devices) override;
+ void DeviceOpened(int render_frame_id,
+ int page_request_id,
+ const std::string& label,
+ const StreamDeviceInfo& video_device) override;
// BrowserMessageFilter implementation.
- virtual bool OnMessageReceived(const IPC::Message& message,
- bool* message_was_ok) OVERRIDE;
- virtual void OnChannelClosing() OVERRIDE;
+ bool OnMessageReceived(const IPC::Message& message) override;
+ void OnChannelClosing() override;
protected:
- virtual ~MediaStreamDispatcherHost();
+ ~MediaStreamDispatcherHost() override;
private:
friend class MockMediaStreamDispatcherHost;
- void OnGenerateStream(int render_view_id,
+ void OnGenerateStream(int render_frame_id,
int page_request_id,
const StreamOptions& components,
- const GURL& security_origin);
- void OnCancelGenerateStream(int render_view_id,
+ const GURL& security_origin,
+ bool user_gesture);
+ void OnCancelGenerateStream(int render_frame_id,
int page_request_id);
- void OnStopStreamDevice(int render_view_id,
+ void OnStopStreamDevice(int render_frame_id,
const std::string& device_id);
- void OnEnumerateDevices(int render_view_id,
+ void OnEnumerateDevices(int render_frame_id,
int page_request_id,
MediaStreamType type,
const GURL& security_origin);
- void OnCancelEnumerateDevices(int render_view_id,
+ void OnCancelEnumerateDevices(int render_frame_id,
int page_request_id);
- void OnOpenDevice(int render_view_id,
+ void OnOpenDevice(int render_frame_id,
int page_request_id,
const std::string& device_id,
MediaStreamType type,
const GURL& security_origin);
- void OnCloseDevice(int render_view_id,
+ void OnCloseDevice(int render_frame_id,
const std::string& label);
- void StoreRequest(int render_view_id,
+ void StoreRequest(int render_frame_id,
int page_request_id,
- const std::string& label);;
+ const std::string& label);
+
+ bool IsURLAllowed(const GURL& url);
int render_process_id_;
ResourceContext::SaltCallback salt_callback_;