summaryrefslogtreecommitdiffstats
path: root/src/core/media_capture_devices_dispatcher.cpp
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@theqtcompany.com>2014-12-03 15:34:09 +0100
committerZeno Albisser <zeno.albisser@digia.com>2015-01-20 08:34:08 +0100
commit390a6fda73369e447569efb1e8a7622460307d22 (patch)
treee4a887e1aab1c04809c001578182add78df7c9b4 /src/core/media_capture_devices_dispatcher.cpp
parent91cc1c217bd370f27dc1f063f70dec3786a1f3bf (diff)
Update Chromium to version 40.0.2214.28 and ninja to 1.5.3.
* scoped_refptr operator for implicit conversion to pointer has been disabled upstream: https://codereview.chromium.org/510323002 * Group permission API as done upstream: https://codereview.chromium.org/622793002 * content_worker gyp target has been removed upstream. * GetPageThumbnailData moved to DevToolsManagerDelegate. * ui/ui_resources has been renamed to ui/resources * WebPreferences and ResourceType have moved inside content. * Merge ResourceBundle's InitSharedInstanceLocaleOnly with InitSharedInstanceWithLocale(): https://codereview.chromium.org/457103003 * Remove obsolete accessibility events. * AX_EVENT_SELECTED_TEXT_CHANGED has been renamed to AX_EVENT_TEXT_SELECTION_CHANGED * AX_ROLE_MATH_ELEMENT was removed upstream. https://codereview.chromium.org/695133002 * Screen::IsDIPEnabled has been removed upstream. https://codereview.chromium.org/672823002 * Update DevToolsHttpHandlerDelegateQt according to ShellDevToolsManagerDelegate. * Various functionality from DevToolsHttpHandler was moved to DevToolsManagerDelegate https://codereview.chromium.org/560323005 * DevToolsHttpHandler::Start expects a scoped_ptr now. * Make sure event_factory_evdev.h is not included when USE_OZONE is not defined * ErrorPageParams was moved into namespace error_page. * Media Access is now handled by ContentBrowserClient::CheckMediaAccessPermission * SpecialStoragePolicy moved to namespace storage * Add implementation for new pure virtual function BrowserContext::GetSSLHostStateDelegate. * RenderPass::Id was renamed to RenderPass::RenderPassId * Include view_messages.h for ViewHostMsg_TextInputState_Param * CERT_UNABLE_TO_CHECK_REVOCATION has been deprecated by Chromium: https://codereview.chromium.org/449743002 * MailboxManager::ConsumeTexture only takes the mailbox as an argument * Replace RWHVQt::TextInputStateChanged with RWHVQt::TextInputTypeChanged. * RenderWidgetHostView::ScrollOffsetChanged has been removed. * SkBitmap::Config was removed upstream. * CopyFromCompositingSurfaceCallback has become an own type. * AcceleratedSurfaceInitialized only takes route_id as an argument. * ServerBoundCertService has been renamed to ChannelIDService. Related API has been renamed accordingly. * TextureImageTransportSurface was removed upstream. * Update MediaCaptureDispatcher::OnMediaRequestStateChanged signature. * AudioStream related functions are gone upstream. https://codereview.chromium.org/569713002 * Add implementation for RenderWidgetHostViewQt::GetLastScrollOffset. * Include generic touch_device implementation. * switches::kDisableDesktopNotifications was removed upstream. https://codereview.chromium.org/607843002 * PageTransition moved to ui. * Messages headers are not guarded. Including them multiple times does hurt. * ScaleGestureDetector does not create a standalone GestureDetector anymore. https://codereview.chromium.org/501503003 * MotionEvent::Cancel and Clone are not virtual anymore. https://codereview.chromium.org/502993004 * Exclude os_exchange_data_provider_mac from build. * Remove argument from ScopedClipboardWriter ctor. https://codereview.chromium.org/558913003 * Remove ShowPopupMenu override from WebContentsQt. The function is not pure virtual anymore, and we never implemented any specifics. * Do not use clang on desktop linux. * Request functions in ContentBrowserClient were merged into RequestPermission. * ninja: use configure.py --bootstrap instead of bootstrap.py Change-Id: I3575612826db7845461a949b4e737264bb4e8d88 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
Diffstat (limited to 'src/core/media_capture_devices_dispatcher.cpp')
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp51
1 files changed, 28 insertions, 23 deletions
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index a8e964b4d..5d65a3391 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -254,14 +254,20 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::
return;
}
- // The extension name that the stream is registered with.
- std::string originalExtensionName;
- // Resolve DesktopMediaID for the specified device id.
- content::DesktopMediaID mediaId =
- getDesktopStreamsRegistry()->RequestMediaForStreamId(
- request.requested_video_device_id, request.render_process_id,
- request.render_view_id, request.security_origin,
- &originalExtensionName);
+ content::WebContents* const web_contents_for_stream = content::WebContents::FromRenderFrameHost(
+ content::RenderFrameHost::FromID(request.render_process_id, request.render_frame_id));
+ content::RenderFrameHost* const main_frame = web_contents_for_stream ? web_contents_for_stream->GetMainFrame() : NULL;
+
+ content::DesktopMediaID mediaId;
+ if (main_frame) {
+ // The extension name that the stream is registered with.
+ std::string originalExtensionName;
+ // Resolve DesktopMediaID for the specified device id.
+ mediaId = getDesktopStreamsRegistry()->RequestMediaForStreamId(
+ request.requested_video_device_id, main_frame->GetProcess()->GetID(),
+ main_frame->GetRoutingID(), request.security_origin,
+ &originalExtensionName);
+ }
// Received invalid device id.
if (mediaId.type == content::DesktopMediaID::TYPE_NONE) {
@@ -391,37 +397,36 @@ DesktopStreamsRegistry *MediaCaptureDevicesDispatcher::getDesktopStreamsRegistry
return m_desktopStreamsRegistry.get();
}
-void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(int renderProcessId, int renderViewId, int pageRequestId, const GURL& securityOrigin
- , const content::MediaStreamDevice &device, content::MediaRequestState state)
+void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(int render_process_id, int render_frame_id, int page_request_id, const GURL& security_origin, content::MediaStreamType stream_type, content::MediaRequestState state)
{
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(
&MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread,
- base::Unretained(this), renderProcessId, renderViewId,
- pageRequestId, device, state));
+ base::Unretained(this), render_process_id, render_frame_id,
+ page_request_id, security_origin, stream_type, state));
}
-void MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread(int renderProcessId, int renderViewId, int pageRequestId
- , const content::MediaStreamDevice &device, content::MediaRequestState state)
+void MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread(int render_process_id, int render_frame_id, int page_request_id
+ , const GURL& security_origin, content::MediaStreamType stream_type, content::MediaRequestState state)
{
// Track desktop capture sessions. Tracking is necessary to avoid unbalanced
// session counts since not all requests will reach MEDIA_REQUEST_STATE_DONE,
// but they will all reach MEDIA_REQUEST_STATE_CLOSING.
- if (device.type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) {
+ if (stream_type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) {
if (state == content::MEDIA_REQUEST_STATE_DONE) {
- DesktopCaptureSession session = { renderProcessId, renderViewId,
- pageRequestId };
+ DesktopCaptureSession session = { render_process_id, render_frame_id,
+ page_request_id };
m_desktopCaptureSessions.push_back(session);
} else if (state == content::MEDIA_REQUEST_STATE_CLOSING) {
for (DesktopCaptureSessions::iterator it =
m_desktopCaptureSessions.begin();
it != m_desktopCaptureSessions.end();
++it) {
- if (it->render_process_id == renderProcessId &&
- it->render_view_id == renderViewId &&
- it->page_request_id == pageRequestId) {
+ if (it->render_process_id == render_process_id &&
+ it->render_view_id == render_frame_id &&
+ it->page_request_id == page_request_id) {
m_desktopCaptureSessions.erase(it);
break;
}
@@ -437,9 +442,9 @@ void MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread(int render
RequestsQueue &queue = rqs_it->second;
for (RequestsQueue::iterator it = queue.begin();
it != queue.end(); ++it) {
- if (it->request.render_process_id == renderProcessId &&
- it->request.render_view_id == renderViewId &&
- it->request.page_request_id == pageRequestId) {
+ if (it->request.render_process_id == render_process_id &&
+ it->request.render_frame_id == render_frame_id &&
+ it->request.page_request_id == page_request_id) {
queue.erase(it);
found = true;
break;