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

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

Issue 2245063003: ServiceWorker: Call SyncMatchingRegistration when document_url is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comments Created 4 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
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_request_handler.h" 5 #include "content/browser/service_worker/service_worker_request_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 FetchRedirectMode redirect_mode, 64 FetchRedirectMode redirect_mode,
65 ResourceType resource_type, 65 ResourceType resource_type,
66 RequestContextType request_context_type, 66 RequestContextType request_context_type,
67 RequestContextFrameType frame_type, 67 RequestContextFrameType frame_type,
68 scoped_refptr<ResourceRequestBodyImpl> body) { 68 scoped_refptr<ResourceRequestBodyImpl> body) {
69 if (skip_service_worker) { 69 if (skip_service_worker) {
70 // TODO(horo): Does this work properly for PlzNavigate? 70 // TODO(horo): Does this work properly for PlzNavigate?
71 if (ServiceWorkerUtils::IsMainResourceType(resource_type)) { 71 if (ServiceWorkerUtils::IsMainResourceType(resource_type)) {
72 provider_host->SetDocumentUrl(net::SimplifyUrlForRequest(request->url())); 72 provider_host->SetDocumentUrl(net::SimplifyUrlForRequest(request->url()));
73 provider_host->SetTopmostFrameUrl(request->first_party_for_cookies()); 73 provider_host->SetTopmostFrameUrl(request->first_party_for_cookies());
74 // A page load with skip_service_worker should be triggered by
75 // shift-reload, so retain all live matching registrations.
76 provider_host->AddAllMatchingRegistrations();
77 } 74 }
78 return; 75 return;
79 } 76 }
80 77
81 std::unique_ptr<ServiceWorkerRequestHandler> handler( 78 std::unique_ptr<ServiceWorkerRequestHandler> handler(
82 provider_host->CreateRequestHandler( 79 provider_host->CreateRequestHandler(
83 request_mode, credentials_mode, redirect_mode, resource_type, 80 request_mode, credentials_mode, redirect_mode, resource_type,
84 request_context_type, frame_type, blob_storage_context->AsWeakPtr(), 81 request_context_type, frame_type, blob_storage_context->AsWeakPtr(),
85 body)); 82 body));
86 if (!handler) 83 if (!handler)
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 ResourceType resource_type) 203 ResourceType resource_type)
207 : context_(context), 204 : context_(context),
208 provider_host_(provider_host), 205 provider_host_(provider_host),
209 blob_storage_context_(blob_storage_context), 206 blob_storage_context_(blob_storage_context),
210 resource_type_(resource_type), 207 resource_type_(resource_type),
211 old_process_id_(0), 208 old_process_id_(0),
212 old_provider_id_(kInvalidServiceWorkerProviderId) { 209 old_provider_id_(kInvalidServiceWorkerProviderId) {
213 } 210 }
214 211
215 } // namespace content 212 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698