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

Side by Side Diff: content/browser/service_worker/service_worker_provider_host.cc

Issue 600303002: [ServiceWorker] Don't send fetch event to the ServiceWorker if the page is not controled by it yet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/service_worker/service_worker_provider_host.h" 5 #include "content/browser/service_worker/service_worker_provider_host.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "content/browser/message_port_message_filter.h" 8 #include "content/browser/message_port_message_filter.h"
9 #include "content/browser/service_worker/service_worker_context_core.h" 9 #include "content/browser/service_worker/service_worker_context_core.h"
10 #include "content/browser/service_worker/service_worker_context_request_handler. h" 10 #include "content/browser/service_worker/service_worker_context_request_handler. h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 ServiceWorkerProviderHost::CreateRequestHandler( 147 ServiceWorkerProviderHost::CreateRequestHandler(
148 ResourceType resource_type, 148 ResourceType resource_type,
149 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, 149 base::WeakPtr<storage::BlobStorageContext> blob_storage_context,
150 scoped_refptr<ResourceRequestBody> body) { 150 scoped_refptr<ResourceRequestBody> body) {
151 if (IsHostToRunningServiceWorker()) { 151 if (IsHostToRunningServiceWorker()) {
152 return scoped_ptr<ServiceWorkerRequestHandler>( 152 return scoped_ptr<ServiceWorkerRequestHandler>(
153 new ServiceWorkerContextRequestHandler( 153 new ServiceWorkerContextRequestHandler(
154 context_, AsWeakPtr(), blob_storage_context, resource_type)); 154 context_, AsWeakPtr(), blob_storage_context, resource_type));
155 } 155 }
156 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || 156 if (ServiceWorkerUtils::IsMainResourceType(resource_type) ||
157 active_version()) { 157 controlling_version()) {
158 return scoped_ptr<ServiceWorkerRequestHandler>( 158 return scoped_ptr<ServiceWorkerRequestHandler>(
159 new ServiceWorkerControlleeRequestHandler( 159 new ServiceWorkerControlleeRequestHandler(
160 context_, AsWeakPtr(), blob_storage_context, resource_type, body)); 160 context_, AsWeakPtr(), blob_storage_context, resource_type, body));
161 } 161 }
162 return scoped_ptr<ServiceWorkerRequestHandler>(); 162 return scoped_ptr<ServiceWorkerRequestHandler>();
163 } 163 }
164 164
165 bool ServiceWorkerProviderHost::CanAssociateRegistration( 165 bool ServiceWorkerProviderHost::CanAssociateRegistration(
166 ServiceWorkerRegistration* registration) { 166 ServiceWorkerRegistration* registration) {
167 if (!context_) 167 if (!context_)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 context_->process_manager()->RemoveProcessReferenceFromPattern( 228 context_->process_manager()->RemoveProcessReferenceFromPattern(
229 pattern, process_id_); 229 pattern, process_id_);
230 } 230 }
231 } 231 }
232 232
233 bool ServiceWorkerProviderHost::IsContextAlive() { 233 bool ServiceWorkerProviderHost::IsContextAlive() {
234 return context_ != NULL; 234 return context_ != NULL;
235 } 235 }
236 236
237 } // namespace content 237 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698