Chromium Code Reviews| 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_provider_host_registry.h " | |
| 10 #include "content/browser/service_worker/service_worker_registration.h" | 11 #include "content/browser/service_worker/service_worker_registration.h" |
| 11 #include "content/browser/service_worker/service_worker_url_request_job.h" | 12 #include "content/browser/service_worker/service_worker_url_request_job.h" |
| 12 #include "content/browser/service_worker/service_worker_utils.h" | 13 #include "content/browser/service_worker/service_worker_utils.h" |
| 13 #include "content/common/service_worker/service_worker_types.h" | 14 #include "content/common/service_worker/service_worker_types.h" |
| 14 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
| 15 #include "net/url_request/url_request_interceptor.h" | 16 #include "net/url_request/url_request_interceptor.h" |
| 16 #include "webkit/browser/blob/blob_storage_context.h" | 17 #include "webkit/browser/blob/blob_storage_context.h" |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 | 20 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 !IsSchemeAndMethodSupported(request)) { | 63 !IsSchemeAndMethodSupported(request)) { |
| 63 return; | 64 return; |
| 64 } | 65 } |
| 65 | 66 |
| 66 if (!context_wrapper || !context_wrapper->context() || | 67 if (!context_wrapper || !context_wrapper->context() || |
| 67 provider_id == kInvalidServiceWorkerProviderId) { | 68 provider_id == kInvalidServiceWorkerProviderId) { |
| 68 return; | 69 return; |
| 69 } | 70 } |
| 70 | 71 |
| 71 ServiceWorkerProviderHost* provider_host = | 72 ServiceWorkerProviderHost* provider_host = |
| 72 context_wrapper->context()->GetProviderHost(process_id, provider_id); | 73 context_wrapper->provider_registry()->GetProviderHost( |
| 74 process_id, provider_id); | |
| 73 if (!provider_host) | 75 if (!provider_host) |
|
michaeln
2014/06/11 22:02:17
also return early if !provider_host->IsAlive() ?
nhiroki
2014/06/17 08:56:15
Done.
| |
| 74 return; | 76 return; |
| 75 | 77 |
| 76 scoped_ptr<ServiceWorkerRequestHandler> handler( | 78 scoped_ptr<ServiceWorkerRequestHandler> handler( |
| 77 provider_host->CreateRequestHandler(resource_type, | 79 provider_host->CreateRequestHandler(resource_type, |
| 78 blob_storage_context->AsWeakPtr())); | 80 blob_storage_context->AsWeakPtr())); |
| 79 if (!handler) | 81 if (!handler) |
| 80 return; | 82 return; |
| 81 | 83 |
| 82 request->SetUserData(&kUserDataKey, handler.release()); | 84 request->SetUserData(&kUserDataKey, handler.release()); |
| 83 } | 85 } |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 102 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 104 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 103 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, | 105 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, |
| 104 ResourceType::Type resource_type) | 106 ResourceType::Type resource_type) |
| 105 : context_(context), | 107 : context_(context), |
| 106 provider_host_(provider_host), | 108 provider_host_(provider_host), |
| 107 blob_storage_context_(blob_storage_context), | 109 blob_storage_context_(blob_storage_context), |
| 108 resource_type_(resource_type) { | 110 resource_type_(resource_type) { |
| 109 } | 111 } |
| 110 | 112 |
| 111 } // namespace content | 113 } // namespace content |
| OLD | NEW |