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

Unified Diff: Source/modules/mediastream/MediaDevices.cpp

Issue 1311473003: Removal of mediaDevices.getUserMedia from insecure origins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
« no previous file with comments | « LayoutTests/http/tests/security/powerfulFeatureRestrictions/old-powerful-features-on-insecure-origin-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediastream/MediaDevices.cpp
diff --git a/Source/modules/mediastream/MediaDevices.cpp b/Source/modules/mediastream/MediaDevices.cpp
index 31510f1e29a291ae7d764d35590b3c261d0b1c94..9134a60650c23745560950275af62bb8920f331b 100644
--- a/Source/modules/mediastream/MediaDevices.cpp
+++ b/Source/modules/mediastream/MediaDevices.cpp
@@ -105,6 +105,11 @@ ScriptPromise MediaDevices::getUserMedia(ScriptState* scriptState, const MediaSt
return exceptionState.reject(scriptState);
}
+ String errorMessage;
+ if (!document->isPrivilegedContext(errorMessage)) {
+ return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError, errorMessage));
+ }
+
request->start();
return resolver->promise();
}
« no previous file with comments | « LayoutTests/http/tests/security/powerfulFeatureRestrictions/old-powerful-features-on-insecure-origin-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698