OLD | NEW |
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/guid.h" | 7 #include "base/guid.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 316 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
317 scoped_refptr<ResourceRequestBody> body) { | 317 scoped_refptr<ResourceRequestBody> body) { |
318 if (IsHostToRunningServiceWorker()) { | 318 if (IsHostToRunningServiceWorker()) { |
319 return scoped_ptr<ServiceWorkerRequestHandler>( | 319 return scoped_ptr<ServiceWorkerRequestHandler>( |
320 new ServiceWorkerContextRequestHandler( | 320 new ServiceWorkerContextRequestHandler( |
321 context_, AsWeakPtr(), blob_storage_context, resource_type)); | 321 context_, AsWeakPtr(), blob_storage_context, resource_type)); |
322 } | 322 } |
323 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || | 323 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || |
324 controlling_version()) { | 324 controlling_version()) { |
325 return scoped_ptr<ServiceWorkerRequestHandler>( | 325 return scoped_ptr<ServiceWorkerRequestHandler>( |
326 new ServiceWorkerControlleeRequestHandler(context_, | 326 new ServiceWorkerControlleeRequestHandler( |
327 AsWeakPtr(), | 327 context_, AsWeakPtr(), blob_storage_context, request_mode, |
328 blob_storage_context, | 328 credentials_mode, resource_type, request_context_type, frame_type, |
329 request_mode, | 329 GetWindowClientInfoOnUI(render_process_id_, render_frame_id_), |
330 credentials_mode, | 330 body)); |
331 resource_type, | |
332 request_context_type, | |
333 frame_type, | |
334 body)); | |
335 } | 331 } |
336 return scoped_ptr<ServiceWorkerRequestHandler>(); | 332 return scoped_ptr<ServiceWorkerRequestHandler>(); |
337 } | 333 } |
338 | 334 |
339 ServiceWorkerObjectInfo | 335 ServiceWorkerObjectInfo |
340 ServiceWorkerProviderHost::GetOrCreateServiceWorkerHandle( | 336 ServiceWorkerProviderHost::GetOrCreateServiceWorkerHandle( |
341 ServiceWorkerVersion* version) { | 337 ServiceWorkerVersion* version) { |
342 DCHECK(dispatcher_host_); | 338 DCHECK(dispatcher_host_); |
343 if (!context_ || !version) | 339 if (!context_ || !version) |
344 return ServiceWorkerObjectInfo(); | 340 return ServiceWorkerObjectInfo(); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 return context_ != NULL; | 646 return context_ != NULL; |
651 } | 647 } |
652 | 648 |
653 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { | 649 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { |
654 DCHECK(dispatcher_host_); | 650 DCHECK(dispatcher_host_); |
655 DCHECK(IsReadyToSendMessages()); | 651 DCHECK(IsReadyToSendMessages()); |
656 dispatcher_host_->Send(message); | 652 dispatcher_host_->Send(message); |
657 } | 653 } |
658 | 654 |
659 } // namespace content | 655 } // namespace content |
OLD | NEW |