Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: content/browser/renderer_host/media/media_stream_ui_proxy.cc

Issue 180633008: Add different error codes for getUserMedia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/media_stream_ui_proxy.cc
diff --git a/content/browser/renderer_host/media/media_stream_ui_proxy.cc b/content/browser/renderer_host/media/media_stream_ui_proxy.cc
index b91ccb12095d293374e743d74f8bdfabb7c2f9f8..65986a1289e85d3795ea0f41c8bbec5d5ea22b91 100644
--- a/content/browser/renderer_host/media/media_stream_ui_proxy.cc
+++ b/content/browser/renderer_host/media/media_stream_ui_proxy.cc
@@ -22,6 +22,7 @@ class MediaStreamUIProxy::Core {
private:
void ProcessAccessRequestResponse(const MediaStreamDevices& devices,
+ content::MediaStreamRequestResult result,
scoped_ptr<MediaStreamUI> stream_ui);
void ProcessStopRequestFromUI();
@@ -63,7 +64,9 @@ void MediaStreamUIProxy::Core::RequestAccess(
// Tab may have gone away.
if (!host || !host->GetDelegate()) {
ProcessAccessRequestResponse(
- MediaStreamDevices(), scoped_ptr<MediaStreamUI>());
+ MediaStreamDevices(),
+ MEDIA_DEVICE_INVALID_STATE,
+ scoped_ptr<MediaStreamUI>());
return;
}
@@ -85,6 +88,7 @@ void MediaStreamUIProxy::Core::OnStarted() {
void MediaStreamUIProxy::Core::ProcessAccessRequestResponse(
const MediaStreamDevices& devices,
+ content::MediaStreamRequestResult result,
scoped_ptr<MediaStreamUI> stream_ui) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -92,7 +96,7 @@ void MediaStreamUIProxy::Core::ProcessAccessRequestResponse(
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&MediaStreamUIProxy::ProcessAccessRequestResponse,
- proxy_, devices));
+ proxy_, devices, result));
}
void MediaStreamUIProxy::Core::ProcessStopRequestFromUI() {
@@ -148,13 +152,14 @@ void MediaStreamUIProxy::OnStarted(const base::Closure& stop_callback) {
}
void MediaStreamUIProxy::ProcessAccessRequestResponse(
- const MediaStreamDevices& devices) {
+ const MediaStreamDevices& devices,
+ content::MediaStreamRequestResult result) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(!response_callback_.is_null());
ResponseCallback cb = response_callback_;
response_callback_.Reset();
- cb.Run(devices);
+ cb.Run(devices, result);
}
void MediaStreamUIProxy::ProcessStopRequestFromUI() {
@@ -211,7 +216,11 @@ void FakeMediaStreamUIProxy::RequestAccess(
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&MediaStreamUIProxy::ProcessAccessRequestResponse,
- weak_factory_.GetWeakPtr(), devices_to_use));
+ weak_factory_.GetWeakPtr(),
+ devices_to_use,
+ devices_to_use.empty() ?
+ MEDIA_DEVICE_NO_HARDWARE :
+ MEDIA_DEVICE_OK));
}
void FakeMediaStreamUIProxy::OnStarted(const base::Closure& stop_callback) {

Powered by Google App Engine
This is Rietveld 408576698