Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: content/browser/service_worker/service_worker_controllee_request_handler.cc

Issue 477593007: ServiceWorker: Make '.ready' return a promise to be resolved with ServiceWorkerRegistration (2/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_provider_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_provider_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698