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; |
} |