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

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

Issue 1406823002: Start of foreign fetch implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove blank line Created 5 years, 2 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 <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 StaleUpdate_DoNotDeferTimer); 353 StaleUpdate_DoNotDeferTimer);
354 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerWaitForeverInFetchTest, RequestTimeout); 354 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerWaitForeverInFetchTest, RequestTimeout);
355 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerFailToStartTest, Timeout); 355 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerFailToStartTest, Timeout);
356 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest, 356 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest,
357 TimeoutStartingWorker); 357 TimeoutStartingWorker);
358 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest, 358 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest,
359 TimeoutWorkerInEvent); 359 TimeoutWorkerInEvent);
360 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, StayAliveAfterPush); 360 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, StayAliveAfterPush);
361 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerStallInStoppingTest, DetachThenStart); 361 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerStallInStoppingTest, DetachThenStart);
362 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerStallInStoppingTest, DetachThenRestart); 362 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerStallInStoppingTest, DetachThenRestart);
363 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest,
364 RegisterForeignFetchScopes);
363 365
364 class Metrics; 366 class Metrics;
365 class PingController; 367 class PingController;
366 368
367 typedef ServiceWorkerVersion self; 369 typedef ServiceWorkerVersion self;
368 using ServiceWorkerClients = std::vector<ServiceWorkerClientInfo>; 370 using ServiceWorkerClients = std::vector<ServiceWorkerClientInfo>;
369 371
370 // Used for UMA; add new entries to the end, before NUM_REQUEST_TYPES. 372 // Used for UMA; add new entries to the end, before NUM_REQUEST_TYPES.
371 enum RequestType { 373 enum RequestType {
372 REQUEST_ACTIVATE, 374 REQUEST_ACTIVATE,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 const std::string& client_uuid, 490 const std::string& client_uuid,
489 const ServiceWorkerClientInfo& client); 491 const ServiceWorkerClientInfo& client);
490 void OnSkipWaiting(int request_id); 492 void OnSkipWaiting(int request_id);
491 void OnClaimClients(int request_id); 493 void OnClaimClients(int request_id);
492 void OnPongFromWorker(); 494 void OnPongFromWorker();
493 495
494 void OnFocusClientFinished(int request_id, 496 void OnFocusClientFinished(int request_id,
495 const std::string& client_uuid, 497 const std::string& client_uuid,
496 const ServiceWorkerClientInfo& client); 498 const ServiceWorkerClientInfo& client);
497 499
500 void OnRegisterForeignFetchScopes(const std::vector<GURL>& sub_scopes);
501
498 void DidEnsureLiveRegistrationForStartWorker( 502 void DidEnsureLiveRegistrationForStartWorker(
499 const StatusCallback& callback, 503 const StatusCallback& callback,
500 ServiceWorkerStatusCode status, 504 ServiceWorkerStatusCode status,
501 const scoped_refptr<ServiceWorkerRegistration>& protect); 505 const scoped_refptr<ServiceWorkerRegistration>& protect);
502 void StartWorkerInternal(); 506 void StartWorkerInternal();
503 507
504 void DidSkipWaiting(int request_id); 508 void DidSkipWaiting(int request_id);
505 509
506 void GetWindowClients(int request_id, 510 void GetWindowClients(int request_id,
507 const ServiceWorkerClientQueryOptions& options); 511 const ServiceWorkerClientQueryOptions& options);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 574
571 // Called at the beginning of each Dispatch*Event function: records 575 // Called at the beginning of each Dispatch*Event function: records
572 // the time elapsed since idle (generally the time since the previous 576 // the time elapsed since idle (generally the time since the previous
573 // event ended). 577 // event ended).
574 void OnBeginEvent(); 578 void OnBeginEvent();
575 579
576 const int64 version_id_; 580 const int64 version_id_;
577 const int64 registration_id_; 581 const int64 registration_id_;
578 const GURL script_url_; 582 const GURL script_url_;
579 const GURL scope_; 583 const GURL scope_;
584 std::vector<GURL> foreign_fetch_scopes_;
580 585
581 Status status_ = NEW; 586 Status status_ = NEW;
582 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; 587 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_;
583 std::vector<StatusCallback> start_callbacks_; 588 std::vector<StatusCallback> start_callbacks_;
584 std::vector<StatusCallback> stop_callbacks_; 589 std::vector<StatusCallback> stop_callbacks_;
585 std::vector<base::Closure> status_change_callbacks_; 590 std::vector<base::Closure> status_change_callbacks_;
586 591
587 // Message callbacks. (Update HasInflightRequests() too when you update this 592 // Message callbacks. (Update HasInflightRequests() too when you update this
588 // list.) 593 // list.)
589 IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> activate_requests_; 594 IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> activate_requests_;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 const bool should_exclude_from_uma_ = false; 654 const bool should_exclude_from_uma_ = false;
650 655
651 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 656 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
652 657
653 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 658 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
654 }; 659 };
655 660
656 } // namespace content 661 } // namespace content
657 662
658 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 663 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698