| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 274 |
| 274 void ScheduleStopWorker(); | 275 void ScheduleStopWorker(); |
| 275 void DoomInternal(); | 276 void DoomInternal(); |
| 276 | 277 |
| 277 const int64 version_id_; | 278 const int64 version_id_; |
| 278 int64 registration_id_; | 279 int64 registration_id_; |
| 279 GURL script_url_; | 280 GURL script_url_; |
| 280 GURL scope_; | 281 GURL scope_; |
| 281 Status status_; | 282 Status status_; |
| 282 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; | 283 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; |
| 284 scoped_ptr<ServiceWorkerCacheListener> cache_listener_; |
| 283 std::vector<StatusCallback> start_callbacks_; | 285 std::vector<StatusCallback> start_callbacks_; |
| 284 std::vector<StatusCallback> stop_callbacks_; | 286 std::vector<StatusCallback> stop_callbacks_; |
| 285 std::vector<base::Closure> status_change_callbacks_; | 287 std::vector<base::Closure> status_change_callbacks_; |
| 286 | 288 |
| 287 // Message callbacks. | 289 // Message callbacks. |
| 288 IDMap<StatusCallback, IDMapOwnPointer> activate_callbacks_; | 290 IDMap<StatusCallback, IDMapOwnPointer> activate_callbacks_; |
| 289 IDMap<StatusCallback, IDMapOwnPointer> install_callbacks_; | 291 IDMap<StatusCallback, IDMapOwnPointer> install_callbacks_; |
| 290 IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_; | 292 IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_; |
| 291 IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_; | 293 IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_; |
| 292 IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_; | 294 IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_; |
| 293 | 295 |
| 294 ControlleeMap controllee_map_; | 296 ControlleeMap controllee_map_; |
| 295 ControlleeByIDMap controllee_by_id_; | 297 ControlleeByIDMap controllee_by_id_; |
| 296 base::WeakPtr<ServiceWorkerContextCore> context_; | 298 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 297 ObserverList<Listener> listeners_; | 299 ObserverList<Listener> listeners_; |
| 298 ServiceWorkerScriptCacheMap script_cache_map_; | 300 ServiceWorkerScriptCacheMap script_cache_map_; |
| 299 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; | 301 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; |
| 300 base::OneShotTimer<ServiceWorkerVersion> update_timer_; | 302 base::OneShotTimer<ServiceWorkerVersion> update_timer_; |
| 301 bool is_doomed_; | 303 bool is_doomed_; |
| 302 | 304 |
| 303 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 305 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 304 | 306 |
| 305 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 307 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 306 }; | 308 }; |
| 307 | 309 |
| 308 } // namespace content | 310 } // namespace content |
| 309 | 311 |
| 310 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 312 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |