Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | |
| 11 | 12 |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/weak_ptr.h" | |
| 13 #include "content/browser/renderer_host/media/media_stream_manager.h" | 15 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 14 #include "content/browser/renderer_host/media/media_stream_requester.h" | 16 #include "content/browser/renderer_host/media/media_stream_requester.h" |
| 15 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 16 #include "content/common/media/media_stream_options.h" | 18 #include "content/common/media/media_stream_options.h" |
| 17 #include "content/public/browser/browser_message_filter.h" | 19 #include "content/public/browser/browser_message_filter.h" |
| 18 #include "content/public/browser/resource_context.h" | 20 #include "content/public/browser/resource_context.h" |
| 19 | 21 |
| 20 namespace content { | 22 namespace content { |
| 21 | 23 |
| 22 class MediaStreamManager; | 24 class MediaStreamManager; |
| 25 class MediaStreamUIProxy; | |
| 23 class ResourceContext; | 26 class ResourceContext; |
| 24 | 27 |
| 25 // MediaStreamDispatcherHost is a delegate for Media Stream API messages used by | 28 // MediaStreamDispatcherHost is a delegate for Media Stream API messages used by |
| 26 // MediaStreamImpl. There is one MediaStreamDispatcherHost per | 29 // MediaStreamImpl. There is one MediaStreamDispatcherHost per |
| 27 // RenderProcessHost, the former owned by the latter. | 30 // RenderProcessHost, the former owned by the latter. |
| 28 class CONTENT_EXPORT MediaStreamDispatcherHost : public BrowserMessageFilter, | 31 class CONTENT_EXPORT MediaStreamDispatcherHost : public BrowserMessageFilter, |
| 29 public MediaStreamRequester { | 32 public MediaStreamRequester { |
| 30 public: | 33 public: |
| 31 MediaStreamDispatcherHost( | 34 MediaStreamDispatcherHost(int render_process_id, |
| 32 int render_process_id, | 35 const ResourceContext::SaltCallback& salt_callback, |
| 33 const ResourceContext::SaltCallback& salt_callback, | 36 MediaStreamManager* media_stream_manager, |
| 34 MediaStreamManager* media_stream_manager); | 37 bool use_fake_ui = false); |
| 35 | 38 |
| 36 // MediaStreamRequester implementation. | 39 // MediaStreamRequester implementation. |
| 37 void StreamGenerated(int render_frame_id, | 40 void StreamGenerated(int render_frame_id, |
| 38 int page_request_id, | 41 int page_request_id, |
| 39 const std::string& label, | 42 const std::string& label, |
| 40 const StreamDeviceInfoArray& audio_devices, | 43 const StreamDeviceInfoArray& audio_devices, |
| 41 const StreamDeviceInfoArray& video_devices) override; | 44 const StreamDeviceInfoArray& video_devices) override; |
| 42 void StreamGenerationFailed( | 45 void StreamGenerationFailed( |
| 43 int render_frame_id, | 46 int render_frame_id, |
| 44 int page_request_id, | 47 int page_request_id, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 | 89 |
| 87 void OnOpenDevice(int render_frame_id, | 90 void OnOpenDevice(int render_frame_id, |
| 88 int page_request_id, | 91 int page_request_id, |
| 89 const std::string& device_id, | 92 const std::string& device_id, |
| 90 MediaStreamType type, | 93 MediaStreamType type, |
| 91 const GURL& security_origin); | 94 const GURL& security_origin); |
| 92 | 95 |
| 93 void OnCloseDevice(int render_frame_id, | 96 void OnCloseDevice(int render_frame_id, |
| 94 const std::string& label); | 97 const std::string& label); |
| 95 | 98 |
| 99 void OnSubscribeToDeviceChangeNotifications(int render_frame_id, | |
| 100 const GURL& security_origin); | |
| 101 | |
| 102 void OnCancelDeviceChangeNotifications(int render_frame_id); | |
| 103 | |
| 96 void StoreRequest(int render_frame_id, | 104 void StoreRequest(int render_frame_id, |
| 97 int page_request_id, | 105 int page_request_id, |
| 98 const std::string& label); | 106 const std::string& label); |
| 99 | 107 |
| 100 bool IsURLAllowed(const GURL& url); | 108 bool IsURLAllowed(const GURL& url); |
| 101 | 109 |
| 110 std::unique_ptr<MediaStreamUIProxy> CreateMediaStreamUIProxy(); | |
| 111 void HandleCheckAccessResponse(std::unique_ptr<MediaStreamUIProxy> ui_proxy, | |
| 112 int render_frame_id, | |
| 113 bool have_access); | |
| 114 | |
| 102 int render_process_id_; | 115 int render_process_id_; |
| 103 ResourceContext::SaltCallback salt_callback_; | 116 ResourceContext::SaltCallback salt_callback_; |
| 104 MediaStreamManager* media_stream_manager_; | 117 MediaStreamManager* media_stream_manager_; |
| 105 | 118 |
| 119 struct DeviceChangeSubscriberInfo { | |
| 120 int render_frame_id; | |
| 121 GURL security_origin; | |
|
palmer
2016/04/26 23:25:02
Here, too.
Guido Urdaneta
2016/05/01 11:08:39
Done.
| |
| 122 }; | |
| 123 std::vector<DeviceChangeSubscriberInfo> device_change_subscribers_; | |
| 124 bool use_fake_ui_; | |
| 125 | |
| 126 base::WeakPtrFactory<MediaStreamDispatcherHost> weak_factory_; | |
| 127 | |
| 106 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); | 128 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); |
| 107 }; | 129 }; |
| 108 | 130 |
| 109 } // namespace content | 131 } // namespace content |
| 110 | 132 |
| 111 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 133 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
| OLD | NEW |