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

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: Use arrow function and add a comment 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 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 void SetDocumentUrl(const GURL& url); 140 void SetDocumentUrl(const GURL& url);
nhiroki 2016/08/22 06:35:49 Can you add a comment that this also updates match
shimazu 2016/08/22 09:29:40 Done.
141 const GURL& document_url() const { return document_url_; } 141 const GURL& document_url() const { return document_url_; }
142 142
143 void SetTopmostFrameUrl(const GURL& url); 143 void SetTopmostFrameUrl(const GURL& url);
144 const GURL& topmost_frame_url() const { return topmost_frame_url_; } 144 const GURL& topmost_frame_url() const { return topmost_frame_url_; }
145 145
146 ServiceWorkerProviderType provider_type() const { return provider_type_; } 146 ServiceWorkerProviderType provider_type() const { return provider_type_; }
147 bool IsProviderForClient() const; 147 bool IsProviderForClient() const;
148 blink::WebServiceWorkerClientType client_type() const; 148 blink::WebServiceWorkerClientType client_type() const;
149 149
150 // Associates to |registration| to listen for its version change events and 150 // Associates to |registration| to listen for its version change events and
(...skipping 88 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
nhiroki 2016/08/22 06:35:49 This sounds a bit strange because matching registr
shimazu 2016/08/22 09:29:40 Done.
312 void SyncMatchingRegistrations();
nhiroki 2016/08/22 06:35:49 Can you add a blank line after this line?
shimazu 2016/08/22 09:29:40 Done.
313 // Discard all references to matching registrations
nhiroki 2016/08/22 06:35:49 s/Discard/Discard/ From the style guide: "These
shimazu 2016/08/22 09:29:40 Done.
314 void RemoveAllMatchingRegistration();
nhiroki 2016/08/22 06:35:49 RemoveAllMatchingRegistration"s"()
shimazu 2016/08/22 09:29:40 Done.
315
314 // Increase/decrease this host's process reference for |pattern|. 316 // Increase/decrease this host's process reference for |pattern|.
315 void IncreaseProcessReference(const GURL& pattern); 317 void IncreaseProcessReference(const GURL& pattern);
316 void DecreaseProcessReference(const GURL& pattern); 318 void DecreaseProcessReference(const GURL& pattern);
317 319
318 void ReturnRegistrationForReadyIfNeeded(); 320 void ReturnRegistrationForReadyIfNeeded();
319 321
320 bool IsReadyToSendMessages() const; 322 bool IsReadyToSendMessages() const;
321 void Send(IPC::Message* message) const; 323 void Send(IPC::Message* message) const;
322 324
323 // Finalizes cross-site transfers and navigation-initalized hosts. 325 // Finalizes cross-site transfers and navigation-initalized hosts.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 bool allow_association_; 366 bool allow_association_;
365 367
366 std::vector<base::Closure> queued_events_; 368 std::vector<base::Closure> queued_events_;
367 369
368 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); 370 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost);
369 }; 371 };
370 372
371 } // namespace content 373 } // namespace content
372 374
373 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 375 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698