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

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

Issue 2912593003: [ServiceWorker] Fix bugs of wpt tests for Client.navigate (Closed)
Patch Set: Fix other tests influnced by changes of testharness.js Created 3 years, 7 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/ServiceWorkerWindowClient.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
index ec1a10d0dbd163bb6e2a3449296f45f78500ec8b..4d20092d0e5ebd287671ad304c7ea7671a900dd8 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
@@ -10,6 +10,7 @@
#include "core/dom/DOMException.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
+#include "core/loader/MixedContentChecker.h"
#include "core/page/PageVisibilityState.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerLocation.h"
@@ -76,6 +77,13 @@ ScriptPromise ServiceWorkerWindowClient::navigate(ScriptState* script_state,
script_state->GetIsolate(), "'" + url + "' is not a valid URL."));
return promise;
}
+ if (MixedContentChecker::IsMixedContent(context->GetSecurityOrigin(),
+ parsed_url)) {
falken 2017/05/29 01:07:04 Can you point me to the test that this fixes? I as
Mike West 2017/05/29 08:02:44 I don't have a strong opinion about what the test
leonhsl(Using Gerrit) 2017/05/29 13:09:54 Sorry now I realized that I've done a hurry&incorr
falken 2017/05/29 14:29:35 Thanks for the investigation and links. Yes it see
leonhsl(Using Gerrit) 2017/06/10 02:57:44 Done.
+ resolver->Reject(V8ThrowException::CreateTypeError(
+ script_state->GetIsolate(),
+ "'" + url + "' navigation would create a mixed-content violation."));
+ return promise;
+ }
if (!context->GetSecurityOrigin()->CanDisplay(parsed_url)) {
resolver->Reject(V8ThrowException::CreateTypeError(
script_state->GetIsolate(),

Powered by Google App Engine
This is Rietveld 408576698