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 23 matching lines...) Expand all Loading... |
34 #endif | 34 #endif |
35 | 35 |
36 namespace IPC { | 36 namespace IPC { |
37 class Message; | 37 class Message; |
38 } | 38 } |
39 | 39 |
40 namespace content { | 40 namespace content { |
41 | 41 |
42 class EmbeddedWorkerRegistry; | 42 class EmbeddedWorkerRegistry; |
43 struct EmbeddedWorkerStartParams; | 43 struct EmbeddedWorkerStartParams; |
44 class MessagePortMessageFilter; | |
45 class ServiceWorkerContextCore; | 44 class ServiceWorkerContextCore; |
46 | 45 |
47 // This gives an interface to control one EmbeddedWorker instance, which | 46 // This gives an interface to control one EmbeddedWorker instance, which |
48 // may be 'in-waiting' or running in one of the child processes added by | 47 // may be 'in-waiting' or running in one of the child processes added by |
49 // AddProcessReference(). | 48 // AddProcessReference(). |
50 class CONTENT_EXPORT EmbeddedWorkerInstance { | 49 class CONTENT_EXPORT EmbeddedWorkerInstance { |
51 public: | 50 public: |
52 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; | 51 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; |
53 | 52 |
54 // This enum is used in UMA histograms. Append-only. | 53 // This enum is used in UMA histograms. Append-only. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 DCHECK_EQ(EmbeddedWorkerStatus::STARTING, status()); | 134 DCHECK_EQ(EmbeddedWorkerStatus::STARTING, status()); |
136 return starting_phase_; | 135 return starting_phase_; |
137 } | 136 } |
138 int restart_count() const { return restart_count_; } | 137 int restart_count() const { return restart_count_; } |
139 int process_id() const; | 138 int process_id() const; |
140 int thread_id() const { return thread_id_; } | 139 int thread_id() const { return thread_id_; } |
141 // 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, |
142 // that is, when |process_id()| returns a valid process id. | 141 // that is, when |process_id()| returns a valid process id. |
143 bool is_new_process() const; | 142 bool is_new_process() const; |
144 int worker_devtools_agent_route_id() const; | 143 int worker_devtools_agent_route_id() const; |
145 MessagePortMessageFilter* message_port_message_filter() const; | |
146 | 144 |
147 void AddListener(Listener* listener); | 145 void AddListener(Listener* listener); |
148 void RemoveListener(Listener* listener); | 146 void RemoveListener(Listener* listener); |
149 | 147 |
150 void set_devtools_attached(bool attached) { devtools_attached_ = attached; } | 148 void set_devtools_attached(bool attached) { devtools_attached_ = attached; } |
151 bool devtools_attached() const { return devtools_attached_; } | 149 bool devtools_attached() const { return devtools_attached_; } |
152 | 150 |
153 bool network_accessed_for_script() const { | 151 bool network_accessed_for_script() const { |
154 return network_accessed_for_script_; | 152 return network_accessed_for_script_; |
155 } | 153 } |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 base::TimeTicks step_time_; | 327 base::TimeTicks step_time_; |
330 | 328 |
331 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; | 329 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; |
332 | 330 |
333 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); | 331 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); |
334 }; | 332 }; |
335 | 333 |
336 } // namespace content | 334 } // namespace content |
337 | 335 |
338 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 336 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
OLD | NEW |