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

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

Issue 623663002: [ServiceWorker] pipe RequestContext and FrameType to ServiceWorker. [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: request_info.cc 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
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 dispatcher_host_->Send(new ServiceWorkerMsg_DisassociateRegistration( 142 dispatcher_host_->Send(new ServiceWorkerMsg_DisassociateRegistration(
143 kDocumentMainThreadId, provider_id())); 143 kDocumentMainThreadId, provider_id()));
144 } 144 }
145 } 145 }
146 146
147 scoped_ptr<ServiceWorkerRequestHandler> 147 scoped_ptr<ServiceWorkerRequestHandler>
148 ServiceWorkerProviderHost::CreateRequestHandler( 148 ServiceWorkerProviderHost::CreateRequestHandler(
149 FetchRequestMode request_mode, 149 FetchRequestMode request_mode,
150 FetchCredentialsMode credentials_mode, 150 FetchCredentialsMode credentials_mode,
151 ResourceType resource_type, 151 ResourceType resource_type,
152 RequestContextType request_context_type,
153 RequestContextFrameType frame_type,
152 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, 154 base::WeakPtr<storage::BlobStorageContext> blob_storage_context,
153 scoped_refptr<ResourceRequestBody> body) { 155 scoped_refptr<ResourceRequestBody> body) {
154 if (IsHostToRunningServiceWorker()) { 156 if (IsHostToRunningServiceWorker()) {
155 return scoped_ptr<ServiceWorkerRequestHandler>( 157 return scoped_ptr<ServiceWorkerRequestHandler>(
156 new ServiceWorkerContextRequestHandler( 158 new ServiceWorkerContextRequestHandler(
157 context_, AsWeakPtr(), blob_storage_context, resource_type)); 159 context_, AsWeakPtr(), blob_storage_context, resource_type));
158 } 160 }
159 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || 161 if (ServiceWorkerUtils::IsMainResourceType(resource_type) ||
160 controlling_version()) { 162 controlling_version()) {
161 return scoped_ptr<ServiceWorkerRequestHandler>( 163 return scoped_ptr<ServiceWorkerRequestHandler>(
162 new ServiceWorkerControlleeRequestHandler(context_, 164 new ServiceWorkerControlleeRequestHandler(context_,
163 AsWeakPtr(), 165 AsWeakPtr(),
164 blob_storage_context, 166 blob_storage_context,
165 request_mode, 167 request_mode,
166 credentials_mode, 168 credentials_mode,
167 resource_type, 169 resource_type,
170 request_context_type,
171 frame_type,
168 body)); 172 body));
169 } 173 }
170 return scoped_ptr<ServiceWorkerRequestHandler>(); 174 return scoped_ptr<ServiceWorkerRequestHandler>();
171 } 175 }
172 176
173 bool ServiceWorkerProviderHost::CanAssociateRegistration( 177 bool ServiceWorkerProviderHost::CanAssociateRegistration(
174 ServiceWorkerRegistration* registration) { 178 ServiceWorkerRegistration* registration) {
175 if (!context_) 179 if (!context_)
176 return false; 180 return false;
177 if (running_hosted_version_.get()) 181 if (running_hosted_version_.get())
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 context_->process_manager()->RemoveProcessReferenceFromPattern( 240 context_->process_manager()->RemoveProcessReferenceFromPattern(
237 pattern, process_id_); 241 pattern, process_id_);
238 } 242 }
239 } 243 }
240 244
241 bool ServiceWorkerProviderHost::IsContextAlive() { 245 bool ServiceWorkerProviderHost::IsContextAlive() {
242 return context_ != NULL; 246 return context_ != NULL;
243 } 247 }
244 248
245 } // namespace content 249 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698