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_controllee_request_handl
er.h" | 5 #include "content/browser/service_worker/service_worker_controllee_request_handl
er.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "content/browser/service_worker/service_worker_context_core.h" | 8 #include "content/browser/service_worker/service_worker_context_core.h" |
9 #include "content/browser/service_worker/service_worker_metrics.h" | 9 #include "content/browser/service_worker/service_worker_metrics.h" |
10 #include "content/browser/service_worker/service_worker_provider_host.h" | 10 #include "content/browser/service_worker/service_worker_provider_host.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const GURL& url) { | 107 const GURL& url) { |
108 DCHECK(job_.get()); | 108 DCHECK(job_.get()); |
109 DCHECK(context_); | 109 DCHECK(context_); |
110 TRACE_EVENT_ASYNC_BEGIN1( | 110 TRACE_EVENT_ASYNC_BEGIN1( |
111 "ServiceWorker", | 111 "ServiceWorker", |
112 "ServiceWorkerControlleeRequestHandler::PrepareForMainResource", | 112 "ServiceWorkerControlleeRequestHandler::PrepareForMainResource", |
113 job_.get(), | 113 job_.get(), |
114 "URL", url.spec()); | 114 "URL", url.spec()); |
115 // The corresponding provider_host may already have associated a registration | 115 // The corresponding provider_host may already have associated a registration |
116 // in redirect case, unassociate it now. | 116 // in redirect case, unassociate it now. |
117 provider_host_->UnassociateRegistration(); | 117 provider_host_->DisassociateRegistration(); |
118 | 118 |
119 GURL stripped_url = net::SimplifyUrlForRequest(url); | 119 GURL stripped_url = net::SimplifyUrlForRequest(url); |
120 provider_host_->SetDocumentUrl(stripped_url); | 120 provider_host_->SetDocumentUrl(stripped_url); |
121 context_->storage()->FindRegistrationForDocument( | 121 context_->storage()->FindRegistrationForDocument( |
122 stripped_url, | 122 stripped_url, |
123 base::Bind(&self::DidLookupRegistrationForMainResource, | 123 base::Bind(&self::DidLookupRegistrationForMainResource, |
124 weak_factory_.GetWeakPtr())); | 124 weak_factory_.GetWeakPtr())); |
125 } | 125 } |
126 | 126 |
127 void | 127 void |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 207 } |
208 | 208 |
209 void ServiceWorkerControlleeRequestHandler::PrepareForSubResource() { | 209 void ServiceWorkerControlleeRequestHandler::PrepareForSubResource() { |
210 DCHECK(job_.get()); | 210 DCHECK(job_.get()); |
211 DCHECK(context_); | 211 DCHECK(context_); |
212 DCHECK(provider_host_->active_version()); | 212 DCHECK(provider_host_->active_version()); |
213 job_->ForwardToServiceWorker(); | 213 job_->ForwardToServiceWorker(); |
214 } | 214 } |
215 | 215 |
216 } // namespace content | 216 } // namespace content |
OLD | NEW |