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

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: Add SyncMatchingRegistration and update tests Created 4 years, 4 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 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 void SendServiceWorkerStateChangedMessage( 239 void SendServiceWorkerStateChangedMessage(
240 int worker_handle_id, 240 int worker_handle_id,
241 blink::WebServiceWorkerState state); 241 blink::WebServiceWorkerState state);
242 242
243 // Sets the worker thread id and flushes queued events. 243 // Sets the worker thread id and flushes queued events.
244 void SetReadyToSendMessagesToWorker(int render_thread_id); 244 void SetReadyToSendMessagesToWorker(int render_thread_id);
245 245
246 void AddMatchingRegistration(ServiceWorkerRegistration* registration); 246 void AddMatchingRegistration(ServiceWorkerRegistration* registration);
247 void RemoveMatchingRegistration(ServiceWorkerRegistration* registration); 247 void RemoveMatchingRegistration(ServiceWorkerRegistration* registration);
248 248
249 // Add matched registrations for document generated by shift-reload.
250 void AddAllMatchingRegistrations();
251
252 // An optimized implementation of [[Match Service Worker Registration]] 249 // An optimized implementation of [[Match Service Worker Registration]]
253 // for current document. 250 // for current document.
254 ServiceWorkerRegistration* MatchRegistration() const; 251 ServiceWorkerRegistration* MatchRegistration() const;
255 252
256 // Called when our controller has been terminated and doomed due to an 253 // 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 254 // exceptional condition like it could no longer be read from the script
258 // cache. 255 // cache.
259 void NotifyControllerLost(); 256 void NotifyControllerLost();
260 257
261 private: 258 private:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 void OnSkippedWaiting(ServiceWorkerRegistration* registration) override; 301 void OnSkippedWaiting(ServiceWorkerRegistration* registration) override;
305 302
306 // Sets the controller version field to |version| or if |version| is NULL, 303 // Sets the controller version field to |version| or if |version| is NULL,
307 // clears the field. If |notify_controllerchange| is true, instructs the 304 // clears the field. If |notify_controllerchange| is true, instructs the
308 // renderer to dispatch a 'controller' change event. 305 // renderer to dispatch a 'controller' change event.
309 void SetControllerVersionAttribute(ServiceWorkerVersion* version, 306 void SetControllerVersionAttribute(ServiceWorkerVersion* version,
310 bool notify_controllerchange); 307 bool notify_controllerchange);
311 308
312 void SendAssociateRegistrationMessage(); 309 void SendAssociateRegistrationMessage();
313 310
311 // Sync all live and matching registrations up with the context core
312 void SyncMatchingRegistrations();
313
314 // Increase/decrease this host's process reference for |pattern|. 314 // Increase/decrease this host's process reference for |pattern|.
315 void IncreaseProcessReference(const GURL& pattern); 315 void IncreaseProcessReference(const GURL& pattern);
316 void DecreaseProcessReference(const GURL& pattern); 316 void DecreaseProcessReference(const GURL& pattern);
317 317
318 void ReturnRegistrationForReadyIfNeeded(); 318 void ReturnRegistrationForReadyIfNeeded();
319 319
320 bool IsReadyToSendMessages() const; 320 bool IsReadyToSendMessages() const;
321 void Send(IPC::Message* message) const; 321 void Send(IPC::Message* message) const;
322 322
323 // Finalizes cross-site transfers and navigation-initalized hosts. 323 // Finalizes cross-site transfers and navigation-initalized hosts.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 bool allow_association_; 364 bool allow_association_;
365 365
366 std::vector<base::Closure> queued_events_; 366 std::vector<base::Closure> queued_events_;
367 367
368 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); 368 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost);
369 }; 369 };
370 370
371 } // namespace content 371 } // namespace content
372 372
373 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 373 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698