| 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_EMBEDDED_WORKER_INSTANCE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 int process_id() const; | 138 int process_id() const; |
| 139 int thread_id() const { return thread_id_; } | 139 int thread_id() const { return thread_id_; } |
| 140 // This should be called only when the worker instance has a valid process, | 140 // This should be called only when the worker instance has a valid process, |
| 141 // that is, when |process_id()| returns a valid process id. | 141 // that is, when |process_id()| returns a valid process id. |
| 142 bool is_new_process() const; | 142 bool is_new_process() const; |
| 143 int worker_devtools_agent_route_id() const; | 143 int worker_devtools_agent_route_id() const; |
| 144 | 144 |
| 145 void AddListener(Listener* listener); | 145 void AddListener(Listener* listener); |
| 146 void RemoveListener(Listener* listener); | 146 void RemoveListener(Listener* listener); |
| 147 | 147 |
| 148 void set_devtools_attached(bool attached) { devtools_attached_ = attached; } | 148 void SetDevToolsAttached(bool attached); |
| 149 bool devtools_attached() const { return devtools_attached_; } | 149 bool devtools_attached() const { return devtools_attached_; } |
| 150 | 150 |
| 151 bool network_accessed_for_script() const { | 151 bool network_accessed_for_script() const { |
| 152 return network_accessed_for_script_; | 152 return network_accessed_for_script_; |
| 153 } | 153 } |
| 154 | 154 |
| 155 ServiceWorkerMetrics::StartSituation start_situation() const { | 155 ServiceWorkerMetrics::StartSituation start_situation() const { |
| 156 DCHECK(status() == EmbeddedWorkerStatus::STARTING || | 156 DCHECK(status() == EmbeddedWorkerStatus::STARTING || |
| 157 status() == EmbeddedWorkerStatus::RUNNING); | 157 status() == EmbeddedWorkerStatus::RUNNING); |
| 158 return start_situation_; | 158 return start_situation_; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 base::TimeTicks step_time_; | 327 base::TimeTicks step_time_; |
| 328 | 328 |
| 329 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; | 329 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; |
| 330 | 330 |
| 331 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); | 331 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); |
| 332 }; | 332 }; |
| 333 | 333 |
| 334 } // namespace content | 334 } // namespace content |
| 335 | 335 |
| 336 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 336 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
| OLD | NEW |