Index: content/browser/renderer_host/media/media_stream_manager.cc |
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc |
index 14c0d4dc4675bb96ae83d0b79c0eb23a82f6ca30..f48a1bb13424f6552137cfb0cee4cd3142cd1a34 100644 |
--- a/content/browser/renderer_host/media/media_stream_manager.cc |
+++ b/content/browser/renderer_host/media/media_stream_manager.cc |
@@ -1030,7 +1030,7 @@ void MediaStreamManager::SetupRequest(const std::string& label) { |
if (!request->security_origin.is_valid()) { |
LOG(ERROR) << "Invalid security origin. " |
<< request->security_origin; |
- FinalizeRequestFailed(label, request); |
+ FinalizeRequestFailed(label, request, content::INVALID_SECURITY_ORIGIN); |
return; |
} |
@@ -1044,14 +1044,14 @@ void MediaStreamManager::SetupRequest(const std::string& label) { |
audio_type == MEDIA_TAB_AUDIO_CAPTURE || |
video_type == MEDIA_TAB_VIDEO_CAPTURE; |
if (is_web_contents_capture && !SetupTabCaptureRequest(request)) { |
- FinalizeRequestFailed(label, request); |
+ FinalizeRequestFailed(label, request, content::TAB_CAPTURE_FAILURE); |
return; |
} |
bool is_screen_capture = |
video_type == MEDIA_DESKTOP_VIDEO_CAPTURE; |
if (is_screen_capture && !SetupScreenCaptureRequest(request)) { |
- FinalizeRequestFailed(label, request); |
+ FinalizeRequestFailed(label, request, content::SCREEN_CAPTURE_FAILURE); |
return; |
} |
@@ -1078,7 +1078,7 @@ void MediaStreamManager::SetupRequest(const std::string& label) { |
} |
if (!SetupDeviceCaptureRequest(request)) { |
- FinalizeRequestFailed(label, request); |
+ FinalizeRequestFailed(label, request, content::DEVICE_CAPTURE_FAILURE); |
return; |
} |
} |
@@ -1273,11 +1273,13 @@ void MediaStreamManager::FinalizeGenerateStream(const std::string& label, |
void MediaStreamManager::FinalizeRequestFailed( |
const std::string& label, |
- DeviceRequest* request) { |
+ DeviceRequest* request, |
+ content::MediaStreamRequestResult result) { |
if (request->requester) |
request->requester->StreamGenerationFailed( |
request->requesting_view_id, |
- request->page_request_id); |
+ request->page_request_id, |
+ result); |
if (request->request_type == MEDIA_DEVICE_ACCESS && |
!request->callback.is_null()) { |
@@ -1524,7 +1526,7 @@ void MediaStreamManager::DevicesEnumerated( |
break; |
} |
if (!SetupDeviceCaptureRequest(request)) |
- FinalizeRequestFailed(*it, request); |
+ FinalizeRequestFailed(*it, request, content::DEVICE_CAPTURE_FAILURE); |
else |
PostRequestToUI(*it, request); |
break; |
@@ -1590,7 +1592,8 @@ void MediaStreamManager::AddLogMessageOnUIThread( |
void MediaStreamManager::HandleAccessRequestResponse( |
const std::string& label, |
- const MediaStreamDevices& devices) { |
+ const MediaStreamDevices& devices, |
+ content::MediaStreamRequestResult result) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DVLOG(1) << "HandleAccessRequestResponse(" |
<< ", {label = " << label << "})"; |
@@ -1607,8 +1610,8 @@ void MediaStreamManager::HandleAccessRequestResponse( |
} |
// Handle the case when the request was denied. |
- if (devices.empty()) { |
- FinalizeRequestFailed(label, request); |
+ if (result != content::OK) { |
+ FinalizeRequestFailed(label, request, result); |
return; |
} |