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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // processes are used to run an in-renderer embedded worker. | 180 // processes are used to run an in-renderer embedded worker. |
181 void AddProcessToWorker(int process_id); | 181 void AddProcessToWorker(int process_id); |
182 void RemoveProcessFromWorker(int process_id); | 182 void RemoveProcessFromWorker(int process_id); |
183 | 183 |
184 // Returns true if this has at least one process to run. | 184 // Returns true if this has at least one process to run. |
185 bool HasProcessToRun() const; | 185 bool HasProcessToRun() const; |
186 | 186 |
187 // Adds and removes |provider_host| as a controllee of this ServiceWorker. | 187 // Adds and removes |provider_host| as a controllee of this ServiceWorker. |
188 void AddControllee(ServiceWorkerProviderHost* provider_host); | 188 void AddControllee(ServiceWorkerProviderHost* provider_host); |
189 void RemoveControllee(ServiceWorkerProviderHost* provider_host); | 189 void RemoveControllee(ServiceWorkerProviderHost* provider_host); |
190 void AddPendingControllee(ServiceWorkerProviderHost* provider_host); | 190 void AddWaitingControllee(ServiceWorkerProviderHost* provider_host); |
191 void RemovePendingControllee(ServiceWorkerProviderHost* provider_host); | 191 void RemoveWaitingControllee(ServiceWorkerProviderHost* provider_host); |
192 | 192 |
193 // Returns if it has controllee. | 193 // Returns if it has controllee. |
194 bool HasControllee() const { return !controllee_map_.empty(); } | 194 bool HasControllee() const { return !controllee_map_.empty(); } |
195 | 195 |
196 // Adds and removes Listeners. | 196 // Adds and removes Listeners. |
197 void AddListener(Listener* listener); | 197 void AddListener(Listener* listener); |
198 void RemoveListener(Listener* listener); | 198 void RemoveListener(Listener* listener); |
199 | 199 |
200 ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; } | 200 ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; } |
201 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); } | 201 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; | 268 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; |
269 | 269 |
270 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 270 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
271 | 271 |
272 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 272 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
273 }; | 273 }; |
274 | 274 |
275 } // namespace content | 275 } // namespace content |
276 | 276 |
277 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 277 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |