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

Side by Side Diff: content/child/service_worker/web_service_worker_provider_impl.cc

Issue 1259213002: Move Service Worker %2f path validation logic from browser into Blink (1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/service_worker/web_service_worker_provider_impl.h" 5 #include "content/child/service_worker/web_service_worker_provider_impl.h"
6 6
7 #include "content/child/service_worker/service_worker_dispatcher.h" 7 #include "content/child/service_worker/service_worker_dispatcher.h"
8 #include "content/child/service_worker/service_worker_handle_reference.h" 8 #include "content/child/service_worker/service_worker_handle_reference.h"
9 #include "content/child/service_worker/service_worker_provider_context.h" 9 #include "content/child/service_worker/service_worker_provider_context.h"
10 #include "content/child/service_worker/web_service_worker_impl.h" 10 #include "content/child/service_worker/web_service_worker_impl.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 WebServiceWorkerGetRegistrationsCallbacks* callbacks) { 69 WebServiceWorkerGetRegistrationsCallbacks* callbacks) {
70 GetDispatcher()->GetRegistrations( 70 GetDispatcher()->GetRegistrations(
71 context_->provider_id(), callbacks); 71 context_->provider_id(), callbacks);
72 } 72 }
73 73
74 void WebServiceWorkerProviderImpl::getRegistrationForReady( 74 void WebServiceWorkerProviderImpl::getRegistrationForReady(
75 WebServiceWorkerGetRegistrationForReadyCallbacks* callbacks) { 75 WebServiceWorkerGetRegistrationForReadyCallbacks* callbacks) {
76 GetDispatcher()->GetRegistrationForReady(context_->provider_id(), callbacks); 76 GetDispatcher()->GetRegistrationForReady(context_->provider_id(), callbacks);
77 } 77 }
78 78
79 bool WebServiceWorkerProviderImpl::areScopeAndScriptURLValid(
80 const blink::WebURL& scope,
81 const blink::WebURL& script_url,
82 WTF::String* error_message) {
83 return !ServiceWorkerUtils::ContainsDisallowedCharacter(
nhiroki 2015/07/28 09:16:03 This is a module dependency violation. We cannot i
84 pattern->GURL(), script_url->GURL(), error_message);
85 }
86
79 int WebServiceWorkerProviderImpl::provider_id() const { 87 int WebServiceWorkerProviderImpl::provider_id() const {
80 return context_->provider_id(); 88 return context_->provider_id();
81 } 89 }
82 90
83 void WebServiceWorkerProviderImpl::RemoveProviderClient() { 91 void WebServiceWorkerProviderImpl::RemoveProviderClient() {
84 // Remove the provider client, but only if the dispatcher is still there. 92 // Remove the provider client, but only if the dispatcher is still there.
85 // (For cleanup path we don't need to bother creating a new dispatcher) 93 // (For cleanup path we don't need to bother creating a new dispatcher)
86 ServiceWorkerDispatcher* dispatcher = 94 ServiceWorkerDispatcher* dispatcher =
87 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 95 ServiceWorkerDispatcher::GetThreadSpecificInstance();
88 if (dispatcher) 96 if (dispatcher)
89 dispatcher->RemoveProviderClient(context_->provider_id()); 97 dispatcher->RemoveProviderClient(context_->provider_id());
90 } 98 }
91 99
92 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { 100 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() {
93 return ServiceWorkerDispatcher::GetThreadSpecificInstance(); 101 return ServiceWorkerDispatcher::GetThreadSpecificInstance();
94 } 102 }
95 103
96 } // namespace content 104 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698