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

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

Issue 1535983002: ServiceWorker: Factor out functions to collect client information from ServiceWorkerVersion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 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 <map> 10 #include <map>
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 const StatusCallback& callback); 279 const StatusCallback& callback);
280 280
281 // Adds and removes |provider_host| as a controllee of this ServiceWorker. 281 // Adds and removes |provider_host| as a controllee of this ServiceWorker.
282 // A potential controllee is a host having the version as its .installing 282 // A potential controllee is a host having the version as its .installing
283 // or .waiting version. 283 // or .waiting version.
284 void AddControllee(ServiceWorkerProviderHost* provider_host); 284 void AddControllee(ServiceWorkerProviderHost* provider_host);
285 void RemoveControllee(ServiceWorkerProviderHost* provider_host); 285 void RemoveControllee(ServiceWorkerProviderHost* provider_host);
286 286
287 // Returns if it has controllee. 287 // Returns if it has controllee.
288 bool HasControllee() const { return !controllee_map_.empty(); } 288 bool HasControllee() const { return !controllee_map_.empty(); }
289 std::map<std::string, ServiceWorkerProviderHost*> controllee_map() {
290 return controllee_map_;
291 }
292
293 base::WeakPtr<ServiceWorkerContextCore> context() const { return context_; }
289 294
290 // Adds and removes |request_job| as a dependent job not to stop the 295 // Adds and removes |request_job| as a dependent job not to stop the
291 // ServiceWorker while |request_job| is reading the stream of the fetch event 296 // ServiceWorker while |request_job| is reading the stream of the fetch event
292 // response from the ServiceWorker. 297 // response from the ServiceWorker.
293 void AddStreamingURLRequestJob(const ServiceWorkerURLRequestJob* request_job); 298 void AddStreamingURLRequestJob(const ServiceWorkerURLRequestJob* request_job);
294 void RemoveStreamingURLRequestJob( 299 void RemoveStreamingURLRequestJob(
295 const ServiceWorkerURLRequestJob* request_job); 300 const ServiceWorkerURLRequestJob* request_job);
296 301
297 // Adds and removes Listeners. 302 // Adds and removes Listeners.
298 void AddListener(Listener* listener); 303 void AddListener(Listener* listener);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 void OnRegisterForeignFetchScopes(const std::vector<GURL>& sub_scopes); 519 void OnRegisterForeignFetchScopes(const std::vector<GURL>& sub_scopes);
515 520
516 void DidEnsureLiveRegistrationForStartWorker( 521 void DidEnsureLiveRegistrationForStartWorker(
517 const StatusCallback& callback, 522 const StatusCallback& callback,
518 ServiceWorkerStatusCode status, 523 ServiceWorkerStatusCode status,
519 const scoped_refptr<ServiceWorkerRegistration>& registration); 524 const scoped_refptr<ServiceWorkerRegistration>& registration);
520 void StartWorkerInternal(); 525 void StartWorkerInternal();
521 526
522 void DidSkipWaiting(int request_id); 527 void DidSkipWaiting(int request_id);
523 528
524 void GetWindowClients(int request_id,
525 const ServiceWorkerClientQueryOptions& options);
526 void DidGetWindowClients(int request_id,
527 const ServiceWorkerClientQueryOptions& options,
528 scoped_ptr<ServiceWorkerClients> clients);
529 void GetNonWindowClients(int request_id,
530 const ServiceWorkerClientQueryOptions& options,
531 ServiceWorkerClients* clients);
532 void OnGetClientsFinished(int request_id, ServiceWorkerClients* clients); 529 void OnGetClientsFinished(int request_id, ServiceWorkerClients* clients);
533 530
534 // The timeout timer periodically calls OnTimeoutTimer, which stops the worker 531 // The timeout timer periodically calls OnTimeoutTimer, which stops the worker
535 // if it is excessively idle or unresponsive to ping. 532 // if it is excessively idle or unresponsive to ping.
536 void StartTimeoutTimer(); 533 void StartTimeoutTimer();
537 void StopTimeoutTimer(); 534 void StopTimeoutTimer();
538 void OnTimeoutTimer(); 535 void OnTimeoutTimer();
539 void SetTimeoutTimerInterval(base::TimeDelta interval); 536 void SetTimeoutTimerInterval(base::TimeDelta interval);
540 537
541 // Called by PingController for ping protocol. 538 // Called by PingController for ping protocol.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 const bool should_exclude_from_uma_ = false; 673 const bool should_exclude_from_uma_ = false;
677 674
678 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 675 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
679 676
680 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 677 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
681 }; 678 };
682 679
683 } // namespace content 680 } // namespace content
684 681
685 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 682 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698