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 <string> | 7 #include <string> |
8 | 8 |
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_wrapper.h" | 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 provider_id == kInvalidServiceWorkerProviderId) { | 75 provider_id == kInvalidServiceWorkerProviderId) { |
76 return; | 76 return; |
77 } | 77 } |
78 | 78 |
79 ServiceWorkerProviderHost* provider_host = | 79 ServiceWorkerProviderHost* provider_host = |
80 context_wrapper->context()->GetProviderHost(process_id, provider_id); | 80 context_wrapper->context()->GetProviderHost(process_id, provider_id); |
81 if (!provider_host || !provider_host->IsContextAlive()) | 81 if (!provider_host || !provider_host->IsContextAlive()) |
82 return; | 82 return; |
83 | 83 |
84 if (skip_service_worker) { | 84 if (skip_service_worker) { |
85 if (ServiceWorkerUtils::IsMainResourceType(resource_type)) | 85 if (ServiceWorkerUtils::IsMainResourceType(resource_type)) { |
86 provider_host->SetDocumentUrl(net::SimplifyUrlForRequest(request->url())); | 86 provider_host->SetDocumentUrl(net::SimplifyUrlForRequest(request->url())); |
| 87 provider_host->SetTopmostFrameUrl(request->first_party_for_cookies()); |
| 88 } |
87 return; | 89 return; |
88 } | 90 } |
89 | 91 |
90 scoped_ptr<ServiceWorkerRequestHandler> handler( | 92 scoped_ptr<ServiceWorkerRequestHandler> handler( |
91 provider_host->CreateRequestHandler(request_mode, | 93 provider_host->CreateRequestHandler(request_mode, |
92 credentials_mode, | 94 credentials_mode, |
93 resource_type, | 95 resource_type, |
94 request_context_type, | 96 request_context_type, |
95 frame_type, | 97 frame_type, |
96 blob_storage_context->AsWeakPtr(), | 98 blob_storage_context->AsWeakPtr(), |
(...skipping 24 matching lines...) Expand all Loading... |
121 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 123 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
122 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 124 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
123 ResourceType resource_type) | 125 ResourceType resource_type) |
124 : context_(context), | 126 : context_(context), |
125 provider_host_(provider_host), | 127 provider_host_(provider_host), |
126 blob_storage_context_(blob_storage_context), | 128 blob_storage_context_(blob_storage_context), |
127 resource_type_(resource_type) { | 129 resource_type_(resource_type) { |
128 } | 130 } |
129 | 131 |
130 } // namespace content | 132 } // namespace content |
OLD | NEW |