OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_request_handler.h" | 5 #include "content/browser/service_worker/service_worker_request_handler.h" |
6 | 6 |
7 #include "content/browser/service_worker/service_worker_context_core.h" | 7 #include "content/browser/service_worker/service_worker_context_core.h" |
8 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 8 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
9 #include "content/browser/service_worker/service_worker_provider_host.h" | 9 #include "content/browser/service_worker/service_worker_provider_host.h" |
10 #include "content/browser/service_worker/service_worker_registration.h" | 10 #include "content/browser/service_worker/service_worker_registration.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return; | 63 return; |
64 } | 64 } |
65 | 65 |
66 if (!context_wrapper || !context_wrapper->context() || | 66 if (!context_wrapper || !context_wrapper->context() || |
67 provider_id == kInvalidServiceWorkerProviderId) { | 67 provider_id == kInvalidServiceWorkerProviderId) { |
68 return; | 68 return; |
69 } | 69 } |
70 | 70 |
71 ServiceWorkerProviderHost* provider_host = | 71 ServiceWorkerProviderHost* provider_host = |
72 context_wrapper->context()->GetProviderHost(process_id, provider_id); | 72 context_wrapper->context()->GetProviderHost(process_id, provider_id); |
73 if (!provider_host) | 73 if (!provider_host || !provider_host->IsContextAlive()) |
74 return; | 74 return; |
75 | 75 |
76 scoped_ptr<ServiceWorkerRequestHandler> handler( | 76 scoped_ptr<ServiceWorkerRequestHandler> handler( |
77 provider_host->CreateRequestHandler(resource_type, | 77 provider_host->CreateRequestHandler(resource_type, |
78 blob_storage_context->AsWeakPtr())); | 78 blob_storage_context->AsWeakPtr())); |
79 if (!handler) | 79 if (!handler) |
80 return; | 80 return; |
81 | 81 |
82 request->SetUserData(&kUserDataKey, handler.release()); | 82 request->SetUserData(&kUserDataKey, handler.release()); |
83 } | 83 } |
(...skipping 18 matching lines...) Expand all Loading... |
102 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 102 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
103 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, | 103 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, |
104 ResourceType::Type resource_type) | 104 ResourceType::Type resource_type) |
105 : context_(context), | 105 : context_(context), |
106 provider_host_(provider_host), | 106 provider_host_(provider_host), |
107 blob_storage_context_(blob_storage_context), | 107 blob_storage_context_(blob_storage_context), |
108 resource_type_(resource_type) { | 108 resource_type_(resource_type) { |
109 } | 109 } |
110 | 110 |
111 } // namespace content | 111 } // namespace content |
OLD | NEW |