| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/id_map.h" | 15 #include "base/id_map.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/timer/timer.h" | 19 #include "base/timer/timer.h" |
| 20 #include "content/browser/service_worker/embedded_worker_instance.h" | 20 #include "content/browser/service_worker/embedded_worker_instance.h" |
| 21 #include "content/browser/service_worker/service_worker_cache_listener.h" |
| 21 #include "content/browser/service_worker/service_worker_script_cache_map.h" | 22 #include "content/browser/service_worker/service_worker_script_cache_map.h" |
| 22 #include "content/common/content_export.h" | 23 #include "content/common/content_export.h" |
| 23 #include "content/common/service_worker/service_worker_status_code.h" | 24 #include "content/common/service_worker/service_worker_status_code.h" |
| 24 #include "content/common/service_worker/service_worker_types.h" | 25 #include "content/common/service_worker/service_worker_types.h" |
| 25 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" | 26 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" |
| 26 | 27 |
| 27 class GURL; | 28 class GURL; |
| 28 | 29 |
| 29 namespace content { | 30 namespace content { |
| 30 | 31 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 278 |
| 278 void ScheduleStopWorker(); | 279 void ScheduleStopWorker(); |
| 279 void DoomInternal(); | 280 void DoomInternal(); |
| 280 | 281 |
| 281 const int64 version_id_; | 282 const int64 version_id_; |
| 282 int64 registration_id_; | 283 int64 registration_id_; |
| 283 GURL script_url_; | 284 GURL script_url_; |
| 284 GURL scope_; | 285 GURL scope_; |
| 285 Status status_; | 286 Status status_; |
| 286 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; | 287 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; |
| 288 scoped_ptr<ServiceWorkerStoresListener> stores_listener_; |
| 287 std::vector<StatusCallback> start_callbacks_; | 289 std::vector<StatusCallback> start_callbacks_; |
| 288 std::vector<StatusCallback> stop_callbacks_; | 290 std::vector<StatusCallback> stop_callbacks_; |
| 289 std::vector<base::Closure> status_change_callbacks_; | 291 std::vector<base::Closure> status_change_callbacks_; |
| 290 | 292 |
| 291 // Message callbacks. | 293 // Message callbacks. |
| 292 IDMap<StatusCallback, IDMapOwnPointer> activate_callbacks_; | 294 IDMap<StatusCallback, IDMapOwnPointer> activate_callbacks_; |
| 293 IDMap<StatusCallback, IDMapOwnPointer> install_callbacks_; | 295 IDMap<StatusCallback, IDMapOwnPointer> install_callbacks_; |
| 294 IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_; | 296 IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_; |
| 295 IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_; | 297 IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_; |
| 296 IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_; | 298 IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_; |
| 297 | 299 |
| 298 ControlleeMap controllee_map_; | 300 ControlleeMap controllee_map_; |
| 299 ControlleeByIDMap controllee_by_id_; | 301 ControlleeByIDMap controllee_by_id_; |
| 300 base::WeakPtr<ServiceWorkerContextCore> context_; | 302 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 301 ObserverList<Listener> listeners_; | 303 ObserverList<Listener> listeners_; |
| 302 ServiceWorkerScriptCacheMap script_cache_map_; | 304 ServiceWorkerScriptCacheMap script_cache_map_; |
| 303 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; | 305 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; |
| 304 base::OneShotTimer<ServiceWorkerVersion> update_timer_; | 306 base::OneShotTimer<ServiceWorkerVersion> update_timer_; |
| 305 bool is_doomed_; | 307 bool is_doomed_; |
| 306 | 308 |
| 307 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 309 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 308 | 310 |
| 309 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 311 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 310 }; | 312 }; |
| 311 | 313 |
| 312 } // namespace content | 314 } // namespace content |
| 313 | 315 |
| 314 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 316 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |