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

Unified Diff: content/browser/service_worker/service_worker_dispatcher_host.cc

Issue 906453002: ServiceWorker: Make browser-side check stricter for non-HTTP(s) schemes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_dispatcher_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_dispatcher_host.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
index e707151e9f77aab3a9fb2ec3028688b3e1abf7e3..b1c8b4d57f0ee302383bde3b56e1ce7b912cca29 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -34,8 +34,6 @@ namespace {
const char kNoDocumentURLErrorMessage[] =
"No URL is associated with the caller's document.";
-const char kDisallowedURLErrorMessage[] =
- "The URL is not supported.";
const char kShutdownErrorMessage[] =
"The Service Worker system has shutdown.";
const char kUserDeniedPermissionMessage[] =
@@ -301,12 +299,7 @@ void ServiceWorkerDispatcherHost::OnRegisterServiceWorker(
if (!CanRegisterServiceWorker(
provider_host->document_url(), pattern, script_url)) {
- // TODO(kinuko): Change this back to BadMessageReceived() once we start
- // to check these in the renderer too. (http://crbug.com/453982)
- Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError(
- thread_id, request_id, WebServiceWorkerError::ErrorTypeSecurity,
- base::ASCIIToUTF16(kServiceWorkerRegisterErrorPrefix) +
- base::ASCIIToUTF16(kDisallowedURLErrorMessage)));
+ BadMessageReceived();
return;
}
@@ -391,12 +384,7 @@ void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker(
}
if (!CanUnregisterServiceWorker(provider_host->document_url(), pattern)) {
- // TODO(kinuko): Change this back to BadMessageReceived() once we start
- // to check these in the renderer too. (http://crbug.com/453982)
- Send(new ServiceWorkerMsg_ServiceWorkerUnregistrationError(
- thread_id, request_id, WebServiceWorkerError::ErrorTypeSecurity,
- base::ASCIIToUTF16(kServiceWorkerUnregisterErrorPrefix) +
- base::ASCIIToUTF16(kDisallowedURLErrorMessage)));
+ BadMessageReceived();
return;
}
@@ -466,12 +454,7 @@ void ServiceWorkerDispatcherHost::OnGetRegistration(
}
if (!CanGetRegistration(provider_host->document_url(), document_url)) {
- // TODO(kinuko): Change this back to BadMessageReceived() once we start
- // to check these in the renderer too. (http://crbug.com/453982)
- Send(new ServiceWorkerMsg_ServiceWorkerGetRegistrationError(
- thread_id, request_id, WebServiceWorkerError::ErrorTypeSecurity,
- base::ASCIIToUTF16(kServiceWorkerGetRegistrationErrorPrefix) +
- base::ASCIIToUTF16(kDisallowedURLErrorMessage)));
+ BadMessageReceived();
return;
}
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698