| 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 <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 int64 version_id() const { return version_id_; } | 136 int64 version_id() const { return version_id_; } |
| 137 int64 registration_id() const { return registration_id_; } | 137 int64 registration_id() const { return registration_id_; } |
| 138 const GURL& script_url() const { return script_url_; } | 138 const GURL& script_url() const { return script_url_; } |
| 139 const GURL& scope() const { return scope_; } | 139 const GURL& scope() const { return scope_; } |
| 140 RunningStatus running_status() const { | 140 RunningStatus running_status() const { |
| 141 return static_cast<RunningStatus>(embedded_worker_->status()); | 141 return static_cast<RunningStatus>(embedded_worker_->status()); |
| 142 } | 142 } |
| 143 ServiceWorkerVersionInfo GetInfo(); | 143 ServiceWorkerVersionInfo GetInfo(); |
| 144 Status status() const { return status_; } | 144 Status status() const { return status_; } |
| 145 | 145 |
| 146 const std::vector<GURL>& foreign_fetch_scopes() const { |
| 147 return foreign_fetch_scopes_; |
| 148 } |
| 149 void set_foreign_fetch_scopes(const std::vector<GURL>& scopes) { |
| 150 foreign_fetch_scopes_ = scopes; |
| 151 } |
| 152 |
| 146 // This sets the new status and also run status change callbacks | 153 // This sets the new status and also run status change callbacks |
| 147 // if there're any (see RegisterStatusChangeCallback). | 154 // if there're any (see RegisterStatusChangeCallback). |
| 148 void SetStatus(Status status); | 155 void SetStatus(Status status); |
| 149 | 156 |
| 150 // Registers status change callback. (This is for one-off observation, | 157 // Registers status change callback. (This is for one-off observation, |
| 151 // the consumer needs to re-register if it wants to continue observing | 158 // the consumer needs to re-register if it wants to continue observing |
| 152 // status changes) | 159 // status changes) |
| 153 void RegisterStatusChangeCallback(const base::Closure& callback); | 160 void RegisterStatusChangeCallback(const base::Closure& callback); |
| 154 | 161 |
| 155 // Starts an embedded worker for this version. | 162 // Starts an embedded worker for this version. |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 const bool should_exclude_from_uma_ = false; | 655 const bool should_exclude_from_uma_ = false; |
| 649 | 656 |
| 650 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 657 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 651 | 658 |
| 652 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 659 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 653 }; | 660 }; |
| 654 | 661 |
| 655 } // namespace content | 662 } // namespace content |
| 656 | 663 |
| 657 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 664 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |