| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 int64_t version_id() const { return version_id_; } | 131 int64_t version_id() const { return version_id_; } |
| 132 int64_t registration_id() const { return registration_id_; } | 132 int64_t registration_id() const { return registration_id_; } |
| 133 const GURL& script_url() const { return script_url_; } | 133 const GURL& script_url() const { return script_url_; } |
| 134 const GURL& scope() const { return scope_; } | 134 const GURL& scope() const { return scope_; } |
| 135 RunningStatus running_status() const { | 135 RunningStatus running_status() const { |
| 136 return static_cast<RunningStatus>(embedded_worker_->status()); | 136 return static_cast<RunningStatus>(embedded_worker_->status()); |
| 137 } | 137 } |
| 138 ServiceWorkerVersionInfo GetInfo(); | 138 ServiceWorkerVersionInfo GetInfo(); |
| 139 Status status() const { return status_; } | 139 Status status() const { return status_; } |
| 140 bool has_fetch_handler() const { return has_fetch_handler_; } |
| 141 void set_has_fetch_handler(bool has_fetch_handler) { |
| 142 has_fetch_handler_ = has_fetch_handler; |
| 143 } |
| 140 | 144 |
| 141 const std::vector<GURL>& foreign_fetch_scopes() const { | 145 const std::vector<GURL>& foreign_fetch_scopes() const { |
| 142 return foreign_fetch_scopes_; | 146 return foreign_fetch_scopes_; |
| 143 } | 147 } |
| 144 void set_foreign_fetch_scopes(const std::vector<GURL>& scopes) { | 148 void set_foreign_fetch_scopes(const std::vector<GURL>& scopes) { |
| 145 foreign_fetch_scopes_ = scopes; | 149 foreign_fetch_scopes_ = scopes; |
| 146 } | 150 } |
| 147 | 151 |
| 148 const std::vector<url::Origin>& foreign_fetch_origins() const { | 152 const std::vector<url::Origin>& foreign_fetch_origins() const { |
| 149 return foreign_fetch_origins_; | 153 return foreign_fetch_origins_; |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 // the time elapsed since idle (generally the time since the previous | 600 // the time elapsed since idle (generally the time since the previous |
| 597 // event ended). | 601 // event ended). |
| 598 void OnBeginEvent(); | 602 void OnBeginEvent(); |
| 599 | 603 |
| 600 const int64_t version_id_; | 604 const int64_t version_id_; |
| 601 const int64_t registration_id_; | 605 const int64_t registration_id_; |
| 602 const GURL script_url_; | 606 const GURL script_url_; |
| 603 const GURL scope_; | 607 const GURL scope_; |
| 604 std::vector<GURL> foreign_fetch_scopes_; | 608 std::vector<GURL> foreign_fetch_scopes_; |
| 605 std::vector<url::Origin> foreign_fetch_origins_; | 609 std::vector<url::Origin> foreign_fetch_origins_; |
| 610 bool has_fetch_handler_ = true; |
| 606 | 611 |
| 607 Status status_ = NEW; | 612 Status status_ = NEW; |
| 608 std::unique_ptr<EmbeddedWorkerInstance> embedded_worker_; | 613 std::unique_ptr<EmbeddedWorkerInstance> embedded_worker_; |
| 609 std::vector<StatusCallback> start_callbacks_; | 614 std::vector<StatusCallback> start_callbacks_; |
| 610 std::vector<StatusCallback> stop_callbacks_; | 615 std::vector<StatusCallback> stop_callbacks_; |
| 611 std::vector<base::Closure> status_change_callbacks_; | 616 std::vector<base::Closure> status_change_callbacks_; |
| 612 | 617 |
| 613 // Message callbacks. (Update HasInflightRequests() too when you update this | 618 // Message callbacks. (Update HasInflightRequests() too when you update this |
| 614 // list.) | 619 // list.) |
| 615 IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> custom_requests_; | 620 IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> custom_requests_; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 | 756 |
| 752 // At this point |this| can have been deleted, so don't do anything other | 757 // At this point |this| can have been deleted, so don't do anything other |
| 753 // than returning. | 758 // than returning. |
| 754 | 759 |
| 755 return true; | 760 return true; |
| 756 } | 761 } |
| 757 | 762 |
| 758 } // namespace content | 763 } // namespace content |
| 759 | 764 |
| 760 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 765 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |