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

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

Issue 1284193003: Removal of getUserMedia() on insecure origins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Dedupped secure scheme registry. 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 | « 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 54fd5c0f5693162c8c2e5cbf9af0eaae1314155a..f3081cfc64af62a2396823a8209dc04ae00fbffa 100644
--- a/Source/modules/mediastream/NavigatorMediaStream.cpp
+++ b/Source/modules/mediastream/NavigatorMediaStream.cpp
@@ -61,21 +61,19 @@ void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const Dictio
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);
- 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());
+ request->failPermissionDenied(errorMessage);
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