Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 ServiceWorkerVersionInfo GetInfo(); | 142 ServiceWorkerVersionInfo GetInfo(); |
| 143 Status status() const { return status_; } | 143 Status status() const { return status_; } |
| 144 | 144 |
| 145 const std::vector<GURL>& foreign_fetch_scopes() const { | 145 const std::vector<GURL>& foreign_fetch_scopes() const { |
| 146 return foreign_fetch_scopes_; | 146 return foreign_fetch_scopes_; |
| 147 } | 147 } |
| 148 void set_foreign_fetch_scopes(const std::vector<GURL>& scopes) { | 148 void set_foreign_fetch_scopes(const std::vector<GURL>& scopes) { |
| 149 foreign_fetch_scopes_ = scopes; | 149 foreign_fetch_scopes_ = scopes; |
| 150 } | 150 } |
| 151 | 151 |
| 152 const std::vector<GURL>& foreign_fetch_origins() const { | |
|
michaeln
2016/02/03 21:27:21
drive by: would it make sense to / is it possible
Marijn Kruisselbrink
2016/02/04 19:30:07
I'm not sure if it would make sense. It would cert
Marijn Kruisselbrink
2016/02/04 20:00:45
Actually, the blink issues don't exist. I was look
| |
| 153 return foreign_fetch_origins_; | |
| 154 } | |
| 155 void set_foreign_fetch_origins(const std::vector<GURL>& origins) { | |
| 156 foreign_fetch_origins_ = origins; | |
| 157 } | |
| 158 | |
| 152 // This sets the new status and also run status change callbacks | 159 // This sets the new status and also run status change callbacks |
| 153 // if there're any (see RegisterStatusChangeCallback). | 160 // if there're any (see RegisterStatusChangeCallback). |
| 154 void SetStatus(Status status); | 161 void SetStatus(Status status); |
| 155 | 162 |
| 156 // Registers status change callback. (This is for one-off observation, | 163 // Registers status change callback. (This is for one-off observation, |
| 157 // the consumer needs to re-register if it wants to continue observing | 164 // the consumer needs to re-register if it wants to continue observing |
| 158 // status changes) | 165 // status changes) |
| 159 void RegisterStatusChangeCallback(const base::Closure& callback); | 166 void RegisterStatusChangeCallback(const base::Closure& callback); |
| 160 | 167 |
| 161 // Starts an embedded worker for this version. | 168 // Starts an embedded worker for this version. |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 570 const std::string& client_uuid, | 577 const std::string& client_uuid, |
| 571 const ServiceWorkerClientInfo& client); | 578 const ServiceWorkerClientInfo& client); |
| 572 void OnSkipWaiting(int request_id); | 579 void OnSkipWaiting(int request_id); |
| 573 void OnClaimClients(int request_id); | 580 void OnClaimClients(int request_id); |
| 574 void OnPongFromWorker(); | 581 void OnPongFromWorker(); |
| 575 | 582 |
| 576 void OnFocusClientFinished(int request_id, | 583 void OnFocusClientFinished(int request_id, |
| 577 const std::string& client_uuid, | 584 const std::string& client_uuid, |
| 578 const ServiceWorkerClientInfo& client); | 585 const ServiceWorkerClientInfo& client); |
| 579 | 586 |
| 580 void OnRegisterForeignFetchScopes(const std::vector<GURL>& sub_scopes); | 587 void OnRegisterForeignFetchScopes(const std::vector<GURL>& sub_scopes, |
| 588 const std::vector<GURL>& origins); | |
| 581 | 589 |
| 582 void DidEnsureLiveRegistrationForStartWorker( | 590 void DidEnsureLiveRegistrationForStartWorker( |
| 583 const StatusCallback& callback, | 591 const StatusCallback& callback, |
| 584 ServiceWorkerStatusCode status, | 592 ServiceWorkerStatusCode status, |
| 585 const scoped_refptr<ServiceWorkerRegistration>& registration); | 593 const scoped_refptr<ServiceWorkerRegistration>& registration); |
| 586 void StartWorkerInternal(); | 594 void StartWorkerInternal(); |
| 587 | 595 |
| 588 void DidSkipWaiting(int request_id); | 596 void DidSkipWaiting(int request_id); |
| 589 | 597 |
| 590 void OnGetClientsFinished(int request_id, ServiceWorkerClients* clients); | 598 void OnGetClientsFinished(int request_id, ServiceWorkerClients* clients); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 653 // Called at the beginning of each Dispatch*Event function: records | 661 // Called at the beginning of each Dispatch*Event function: records |
| 654 // the time elapsed since idle (generally the time since the previous | 662 // the time elapsed since idle (generally the time since the previous |
| 655 // event ended). | 663 // event ended). |
| 656 void OnBeginEvent(); | 664 void OnBeginEvent(); |
| 657 | 665 |
| 658 const int64_t version_id_; | 666 const int64_t version_id_; |
| 659 const int64_t registration_id_; | 667 const int64_t registration_id_; |
| 660 const GURL script_url_; | 668 const GURL script_url_; |
| 661 const GURL scope_; | 669 const GURL scope_; |
| 662 std::vector<GURL> foreign_fetch_scopes_; | 670 std::vector<GURL> foreign_fetch_scopes_; |
| 671 std::vector<GURL> foreign_fetch_origins_; | |
| 663 | 672 |
| 664 Status status_ = NEW; | 673 Status status_ = NEW; |
| 665 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; | 674 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; |
| 666 std::vector<StatusCallback> start_callbacks_; | 675 std::vector<StatusCallback> start_callbacks_; |
| 667 std::vector<StatusCallback> stop_callbacks_; | 676 std::vector<StatusCallback> stop_callbacks_; |
| 668 std::vector<base::Closure> status_change_callbacks_; | 677 std::vector<base::Closure> status_change_callbacks_; |
| 669 | 678 |
| 670 // Message callbacks. (Update HasInflightRequests() too when you update this | 679 // Message callbacks. (Update HasInflightRequests() too when you update this |
| 671 // list.) | 680 // list.) |
| 672 IDMap<PendingRequest<FetchCallback>, IDMapOwnPointer> fetch_requests_; | 681 IDMap<PendingRequest<FetchCallback>, IDMapOwnPointer> fetch_requests_; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 808 | 817 |
| 809 // At this point |this| can have been deleted, so don't do anything other | 818 // At this point |this| can have been deleted, so don't do anything other |
| 810 // than returning. | 819 // than returning. |
| 811 | 820 |
| 812 return true; | 821 return true; |
| 813 } | 822 } |
| 814 | 823 |
| 815 } // namespace content | 824 } // namespace content |
| 816 | 825 |
| 817 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 826 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |