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

Side by Side Diff: content/browser/service_worker/service_worker_provider_host.h

Issue 2245063003: ServiceWorker: Call SyncMatchingRegistration when document_url is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate with the review 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_provider_host.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 ServiceWorkerRegistration* associated_registration() const { 130 ServiceWorkerRegistration* associated_registration() const {
131 return associated_registration_.get(); 131 return associated_registration_.get();
132 } 132 }
133 133
134 // The running version, if any, that this provider is providing resource 134 // The running version, if any, that this provider is providing resource
135 // loads for. 135 // loads for.
136 ServiceWorkerVersion* running_hosted_version() const { 136 ServiceWorkerVersion* running_hosted_version() const {
137 return running_hosted_version_.get(); 137 return running_hosted_version_.get();
138 } 138 }
139 139
140 // SetDocumentUrl sets the |document_url_|. When this object is for a client,
nhiroki 2016/08/22 12:41:37 "SetDocumentUrl" looks redundant. "Sets the |docum
shimazu 2016/08/23 01:53:52 Done.
141 // |matching_registrations_| gets also updated to ensure that |document_url_|
142 // is in scope of all |matching_registrations_|.
140 void SetDocumentUrl(const GURL& url); 143 void SetDocumentUrl(const GURL& url);
141 const GURL& document_url() const { return document_url_; } 144 const GURL& document_url() const { return document_url_; }
142 145
143 void SetTopmostFrameUrl(const GURL& url); 146 void SetTopmostFrameUrl(const GURL& url);
144 const GURL& topmost_frame_url() const { return topmost_frame_url_; } 147 const GURL& topmost_frame_url() const { return topmost_frame_url_; }
145 148
146 ServiceWorkerProviderType provider_type() const { return provider_type_; } 149 ServiceWorkerProviderType provider_type() const { return provider_type_; }
147 bool IsProviderForClient() const; 150 bool IsProviderForClient() const;
148 blink::WebServiceWorkerClientType client_type() const; 151 blink::WebServiceWorkerClientType client_type() const;
149 152
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 void SendServiceWorkerStateChangedMessage( 242 void SendServiceWorkerStateChangedMessage(
240 int worker_handle_id, 243 int worker_handle_id,
241 blink::WebServiceWorkerState state); 244 blink::WebServiceWorkerState state);
242 245
243 // Sets the worker thread id and flushes queued events. 246 // Sets the worker thread id and flushes queued events.
244 void SetReadyToSendMessagesToWorker(int render_thread_id); 247 void SetReadyToSendMessagesToWorker(int render_thread_id);
245 248
246 void AddMatchingRegistration(ServiceWorkerRegistration* registration); 249 void AddMatchingRegistration(ServiceWorkerRegistration* registration);
247 void RemoveMatchingRegistration(ServiceWorkerRegistration* registration); 250 void RemoveMatchingRegistration(ServiceWorkerRegistration* registration);
248 251
249 // Add matched registrations for document generated by shift-reload.
250 void AddAllMatchingRegistrations();
251
252 // An optimized implementation of [[Match Service Worker Registration]] 252 // An optimized implementation of [[Match Service Worker Registration]]
253 // for current document. 253 // for current document.
254 ServiceWorkerRegistration* MatchRegistration() const; 254 ServiceWorkerRegistration* MatchRegistration() const;
255 255
256 // Called when our controller has been terminated and doomed due to an 256 // Called when our controller has been terminated and doomed due to an
257 // exceptional condition like it could no longer be read from the script 257 // exceptional condition like it could no longer be read from the script
258 // cache. 258 // cache.
259 void NotifyControllerLost(); 259 void NotifyControllerLost();
260 260
261 private: 261 private:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 void OnSkippedWaiting(ServiceWorkerRegistration* registration) override; 304 void OnSkippedWaiting(ServiceWorkerRegistration* registration) override;
305 305
306 // Sets the controller version field to |version| or if |version| is NULL, 306 // Sets the controller version field to |version| or if |version| is NULL,
307 // clears the field. If |notify_controllerchange| is true, instructs the 307 // clears the field. If |notify_controllerchange| is true, instructs the
308 // renderer to dispatch a 'controller' change event. 308 // renderer to dispatch a 'controller' change event.
309 void SetControllerVersionAttribute(ServiceWorkerVersion* version, 309 void SetControllerVersionAttribute(ServiceWorkerVersion* version,
310 bool notify_controllerchange); 310 bool notify_controllerchange);
311 311
312 void SendAssociateRegistrationMessage(); 312 void SendAssociateRegistrationMessage();
313 313
314 // Syncs matching registrations with live registrations
nhiroki 2016/08/22 12:41:37 Missing trailing dot.
shimazu 2016/08/23 01:53:52 Done.
315 void SyncMatchingRegistrations();
316
317 // Discards all references to matching registrations
nhiroki 2016/08/22 12:41:37 ditto.
shimazu 2016/08/23 01:53:52 Done.
318 void RemoveAllMatchingRegistrations();
319
314 // Increase/decrease this host's process reference for |pattern|. 320 // Increase/decrease this host's process reference for |pattern|.
315 void IncreaseProcessReference(const GURL& pattern); 321 void IncreaseProcessReference(const GURL& pattern);
316 void DecreaseProcessReference(const GURL& pattern); 322 void DecreaseProcessReference(const GURL& pattern);
317 323
318 void ReturnRegistrationForReadyIfNeeded(); 324 void ReturnRegistrationForReadyIfNeeded();
319 325
320 bool IsReadyToSendMessages() const; 326 bool IsReadyToSendMessages() const;
321 void Send(IPC::Message* message) const; 327 void Send(IPC::Message* message) const;
322 328
323 // Finalizes cross-site transfers and navigation-initalized hosts. 329 // Finalizes cross-site transfers and navigation-initalized hosts.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 bool allow_association_; 370 bool allow_association_;
365 371
366 std::vector<base::Closure> queued_events_; 372 std::vector<base::Closure> queued_events_;
367 373
368 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); 374 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost);
369 }; 375 };
370 376
371 } // namespace content 377 } // namespace content
372 378
373 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 379 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_provider_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698