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

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

Issue 2746783002: [ServiceWorker] Mojofy InstallEvent of Service Worker (Closed)
Patch Set: Rebase and address falken, leon and mek's comments Created 3 years, 8 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_VERSION_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <functional> 10 #include <functional>
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // Informs ServiceWorkerVersion that an event has finished being dispatched. 265 // Informs ServiceWorkerVersion that an event has finished being dispatched.
266 // Returns false if no pending requests with the provided id exist, for 266 // Returns false if no pending requests with the provided id exist, for
267 // example if the request has already timed out. 267 // example if the request has already timed out.
268 // Pass the result of the event to |was_handled|, which is used to record 268 // Pass the result of the event to |was_handled|, which is used to record
269 // statistics based on the event status. 269 // statistics based on the event status.
270 // TODO(mek): Use something other than a bool for event status. 270 // TODO(mek): Use something other than a bool for event status.
271 bool FinishRequest(int request_id, 271 bool FinishRequest(int request_id,
272 bool was_handled, 272 bool was_handled,
273 base::Time dispatch_event_time); 273 base::Time dispatch_event_time);
274 274
275 void RegisterForeignFetchScopes(const std::vector<GURL>& sub_scopes,
shimazu 2017/04/05 05:01:27 Could you move this after RegisterRequestCallback
xiaofengzhang 2017/04/18 06:46:17 Nice, thanks. But this function(RegisterForeignFet
276 const std::vector<url::Origin>& origins);
277
275 // Finishes an external request that was started by StartExternalRequest(). 278 // Finishes an external request that was started by StartExternalRequest().
276 // Returns false if there was an error finishing the request: e.g. the request 279 // Returns false if there was an error finishing the request: e.g. the request
277 // was not found or the worker already terminated. 280 // was not found or the worker already terminated.
278 bool FinishExternalRequest(const std::string& request_uuid); 281 bool FinishExternalRequest(const std::string& request_uuid);
279 282
280 // Creates a callback that is to be used for marking simple events dispatched 283 // Creates a callback that is to be used for marking simple events dispatched
281 // through the ServiceWorkerEventDispatcher as finished for the |request_id|. 284 // through the ServiceWorkerEventDispatcher as finished for the |request_id|.
282 SimpleEventCallback CreateSimpleEventCallback(int request_id); 285 SimpleEventCallback CreateSimpleEventCallback(int request_id);
283 286
284 // This must be called when the worker is running. 287 // This must be called when the worker is running.
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 void OnNavigateClientFinished(int request_id, 683 void OnNavigateClientFinished(int request_id,
681 ServiceWorkerStatusCode status, 684 ServiceWorkerStatusCode status,
682 const ServiceWorkerClientInfo& client_info); 685 const ServiceWorkerClientInfo& client_info);
683 void OnSkipWaiting(int request_id); 686 void OnSkipWaiting(int request_id);
684 void OnClaimClients(int request_id); 687 void OnClaimClients(int request_id);
685 void OnPongFromWorker(); 688 void OnPongFromWorker();
686 689
687 void OnFocusClientFinished(int request_id, 690 void OnFocusClientFinished(int request_id,
688 const ServiceWorkerClientInfo& client_info); 691 const ServiceWorkerClientInfo& client_info);
689 692
690 void OnRegisterForeignFetchScopes(const std::vector<GURL>& sub_scopes,
691 const std::vector<url::Origin>& origins);
692
693 void DidEnsureLiveRegistrationForStartWorker( 693 void DidEnsureLiveRegistrationForStartWorker(
694 ServiceWorkerMetrics::EventType purpose, 694 ServiceWorkerMetrics::EventType purpose,
695 Status prestart_status, 695 Status prestart_status,
696 bool is_browser_startup_complete, 696 bool is_browser_startup_complete,
697 const StatusCallback& callback, 697 const StatusCallback& callback,
698 ServiceWorkerStatusCode status, 698 ServiceWorkerStatusCode status,
699 scoped_refptr<ServiceWorkerRegistration> registration); 699 scoped_refptr<ServiceWorkerRegistration> registration);
700 void StartWorkerInternal(); 700 void StartWorkerInternal();
701 701
702 void DidSkipWaiting(int request_id); 702 void DidSkipWaiting(int request_id);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 920
921 // At this point |this| can have been deleted, so don't do anything other 921 // At this point |this| can have been deleted, so don't do anything other
922 // than returning. 922 // than returning.
923 923
924 return true; 924 return true;
925 } 925 }
926 926
927 } // namespace content 927 } // namespace content
928 928
929 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 929 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698