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

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

Issue 1336633002: Revert "Removal of getUserMedia() on insecure origins" (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2490
Patch Set: Created 5 years, 3 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 | « Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediastream/NavigatorMediaStream.cpp
diff --git a/Source/modules/mediastream/NavigatorMediaStream.cpp b/Source/modules/mediastream/NavigatorMediaStream.cpp
index 40e2450b304ad2ef1f208d0b136a263f17de11a5..610ba396bc40ee07775557fb4f41629fd929ea6b 100644
--- a/Source/modules/mediastream/NavigatorMediaStream.cpp
+++ b/Source/modules/mediastream/NavigatorMediaStream.cpp
@@ -62,19 +62,21 @@ void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const MediaS
return;
}
- UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->document(), userMedia, options, successCallback, errorCallback, exceptionState);
- if (!request) {
- ASSERT(exceptionState.hadException());
- return;
- }
-
String errorMessage;
if (navigator.frame()->document()->isPrivilegedContext(errorMessage)) {
UseCounter::count(navigator.frame(), UseCounter::GetUserMediaSecureOrigin);
} else {
UseCounter::countDeprecation(navigator.frame(), UseCounter::GetUserMediaInsecureOrigin);
OriginsUsingFeatures::countAnyWorld(*navigator.frame()->document(), OriginsUsingFeatures::Feature::GetUserMediaInsecureOrigin);
- request->failPermissionDenied(errorMessage);
+ if (navigator.frame()->settings()->strictPowerfulFeatureRestrictions()) {
+ exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("webkitGetUserMedia", "Navigator", errorMessage));
+ return;
+ }
+ }
+
+ UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->document(), userMedia, options, successCallback, errorCallback, exceptionState);
+ if (!request) {
+ ASSERT(exceptionState.hadException());
return;
}
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698