| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // Add or remove |process_id| to the internal process set where this | 90 // Add or remove |process_id| to the internal process set where this |
| 91 // worker can be started. | 91 // worker can be started. |
| 92 void AddProcessReference(int process_id); | 92 void AddProcessReference(int process_id); |
| 93 void ReleaseProcessReference(int process_id); | 93 void ReleaseProcessReference(int process_id); |
| 94 bool HasProcessToRun() const { return !process_refs_.empty(); } | 94 bool HasProcessToRun() const { return !process_refs_.empty(); } |
| 95 | 95 |
| 96 int embedded_worker_id() const { return embedded_worker_id_; } | 96 int embedded_worker_id() const { return embedded_worker_id_; } |
| 97 Status status() const { return status_; } | 97 Status status() const { return status_; } |
| 98 int process_id() const { return process_id_; } | 98 int process_id() const { return process_id_; } |
| 99 int thread_id() const { return thread_id_; } | 99 int thread_id() const { return thread_id_; } |
| 100 int worker_devtools_agent_route_id() const { |
| 101 return worker_devtools_agent_route_id_; |
| 102 } |
| 100 | 103 |
| 101 void AddListener(Listener* listener); | 104 void AddListener(Listener* listener); |
| 102 void RemoveListener(Listener* listener); | 105 void RemoveListener(Listener* listener); |
| 103 | 106 |
| 104 private: | 107 private: |
| 105 typedef ObserverList<Listener> ListenerList; | 108 typedef ObserverList<Listener> ListenerList; |
| 106 | 109 |
| 107 friend class EmbeddedWorkerRegistry; | 110 friend class EmbeddedWorkerRegistry; |
| 108 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerInstanceTest, StartAndStop); | 111 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerInstanceTest, StartAndStop); |
| 109 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerInstanceTest, SortProcesses); | 112 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerInstanceTest, SortProcesses); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 ListenerList listener_list_; | 195 ListenerList listener_list_; |
| 193 | 196 |
| 194 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; | 197 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; |
| 195 | 198 |
| 196 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); | 199 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); |
| 197 }; | 200 }; |
| 198 | 201 |
| 199 } // namespace content | 202 } // namespace content |
| 200 | 203 |
| 201 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 204 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
| OLD | NEW |