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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp

Issue 1373773003: Implement 'window.isSecureContext'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: document. 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
Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
index 764ecded23c1187da7b7ca157e67ac9961ad151d..905e92871e3e0ff3e4ac30c67eacdd59db176263 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
@@ -208,7 +208,7 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(ScriptState* scriptS
RefPtr<SecurityOrigin> documentOrigin = executionContext->securityOrigin();
String errorMessage;
// Restrict to secure origins: https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileged
- if (!executionContext->isPrivilegedContext(errorMessage)) {
+ if (!executionContext->isSecureContext(errorMessage)) {
resolver->reject(DOMException::create(NotSupportedError, errorMessage));
return promise;
}
@@ -276,7 +276,7 @@ ScriptPromise ServiceWorkerContainer::getRegistration(ScriptState* scriptState,
RefPtr<SecurityOrigin> documentOrigin = executionContext->securityOrigin();
String errorMessage;
- if (!executionContext->isPrivilegedContext(errorMessage)) {
+ if (!executionContext->isSecureContext(errorMessage)) {
resolver->reject(DOMException::create(NotSupportedError, errorMessage));
return promise;
}
@@ -312,7 +312,7 @@ ScriptPromise ServiceWorkerContainer::getRegistrations(ScriptState* scriptState)
ExecutionContext* executionContext = scriptState->executionContext();
RefPtr<SecurityOrigin> documentOrigin = executionContext->securityOrigin();
String errorMessage;
- if (!executionContext->isPrivilegedContext(errorMessage)) {
+ if (!executionContext->isSecureContext(errorMessage)) {
resolver->reject(DOMException::create(NotSupportedError, errorMessage));
return promise;
}
« no previous file with comments | « third_party/WebKit/Source/modules/quota/StorageManager.cpp ('k') | third_party/WebKit/Source/web/WebDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698