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 <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // Add or remove |process_id| to the internal process set where this | 81 // Add or remove |process_id| to the internal process set where this |
82 // worker can be started. | 82 // worker can be started. |
83 void AddProcessReference(int process_id); | 83 void AddProcessReference(int process_id); |
84 void ReleaseProcessReference(int process_id); | 84 void ReleaseProcessReference(int process_id); |
85 bool HasProcessToRun() const { return !process_refs_.empty(); } | 85 bool HasProcessToRun() const { return !process_refs_.empty(); } |
86 | 86 |
87 int embedded_worker_id() const { return embedded_worker_id_; } | 87 int embedded_worker_id() const { return embedded_worker_id_; } |
88 Status status() const { return status_; } | 88 Status status() const { return status_; } |
89 int process_id() const { return process_id_; } | 89 int process_id() const { return process_id_; } |
90 int thread_id() const { return thread_id_; } | 90 int thread_id() const { return thread_id_; } |
| 91 int worker_devtools_agent_route_id() const { |
| 92 return worker_devtools_agent_route_id_; |
| 93 } |
91 | 94 |
92 void AddListener(Listener* listener); | 95 void AddListener(Listener* listener); |
93 void RemoveListener(Listener* listener); | 96 void RemoveListener(Listener* listener); |
94 | 97 |
95 private: | 98 private: |
96 typedef ObserverList<Listener> ListenerList; | 99 typedef ObserverList<Listener> ListenerList; |
97 | 100 |
98 friend class EmbeddedWorkerRegistry; | 101 friend class EmbeddedWorkerRegistry; |
99 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerInstanceTest, StartAndStop); | 102 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerInstanceTest, StartAndStop); |
100 | 103 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // Returns false when no process is available. | 142 // Returns false when no process is available. |
140 bool ChooseProcess(); | 143 bool ChooseProcess(); |
141 | 144 |
142 scoped_refptr<EmbeddedWorkerRegistry> registry_; | 145 scoped_refptr<EmbeddedWorkerRegistry> registry_; |
143 const int embedded_worker_id_; | 146 const int embedded_worker_id_; |
144 Status status_; | 147 Status status_; |
145 | 148 |
146 // Current running information. -1 indicates the worker is not running. | 149 // Current running information. -1 indicates the worker is not running. |
147 int process_id_; | 150 int process_id_; |
148 int thread_id_; | 151 int thread_id_; |
| 152 int worker_devtools_agent_route_id_; |
149 | 153 |
150 ProcessRefMap process_refs_; | 154 ProcessRefMap process_refs_; |
151 ListenerList listener_list_; | 155 ListenerList listener_list_; |
152 | 156 |
153 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); | 157 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); |
154 }; | 158 }; |
155 | 159 |
156 } // namespace content | 160 } // namespace content |
157 | 161 |
158 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 162 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
OLD | NEW |