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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp

Issue 2678433003: media: Require SecureContext for EME APIs (Closed)
Patch Set: Created 3 years, 10 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: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
index 7f0f6e7b1bf1a52df98f99dbb24308068ca00c24..46e5831978dba27964109f109c350dc3f8b32e80 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
@@ -349,21 +349,8 @@ ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
"The supportedConfigurations parameter is empty."));
}
- // Note: This method should only be exposed to secure contexts as indicated
- // by the [SecureContext] IDL attribute. Since that will break some existing
- // sites, we simply keep track of sites that aren't secure and output a
- // deprecation message.
- ExecutionContext* executionContext = scriptState->getExecutionContext();
- if (executionContext->isSecureContext()) {
- UseCounter::count(executionContext, UseCounter::EncryptedMediaSecureOrigin);
- } else {
- Deprecation::countDeprecation(executionContext,
- UseCounter::EncryptedMediaInsecureOrigin);
- // TODO(ddorwin): Implement the following:
- // Reject promise with a new DOMException whose name is NotSupportedError.
- }
-
// 3. Let document be the calling context's Document.
+ ExecutionContext* executionContext = scriptState->getExecutionContext();
Document* document = toDocument(executionContext);
if (!document->page()) {
return ScriptPromise::rejectWithDOMException(

Powered by Google App Engine
This is Rietveld 408576698