| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CONTEXT_WATCHER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WATCHER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WATCHER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WATCHER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/containers/scoped_ptr_hash_map.h" | 11 #include "base/containers/scoped_ptr_hash_map.h" |
| 12 #include "base/time/time.h" |
| 12 #include "content/browser/service_worker/service_worker_context_observer.h" | 13 #include "content/browser/service_worker/service_worker_context_observer.h" |
| 13 #include "content/browser/service_worker/service_worker_info.h" | 14 #include "content/browser/service_worker/service_worker_info.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 class ServiceWorkerContextWrapper; | 18 class ServiceWorkerContextWrapper; |
| 18 | 19 |
| 19 // Used to monitor the status change of the ServiceWorker registrations and | 20 // Used to monitor the status change of the ServiceWorker registrations and |
| 20 // versions in the ServiceWorkerContext from UI thread. | 21 // versions in the ServiceWorkerContext from UI thread. |
| 21 class ServiceWorkerContextWatcher | 22 class ServiceWorkerContextWatcher |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const GURL& pattern) override; | 60 const GURL& pattern) override; |
| 60 void OnNewLiveVersion(int64 version_id, | 61 void OnNewLiveVersion(int64 version_id, |
| 61 int64 registration_id, | 62 int64 registration_id, |
| 62 const GURL& script_url) override; | 63 const GURL& script_url) override; |
| 63 void OnRunningStateChanged( | 64 void OnRunningStateChanged( |
| 64 int64 version_id, | 65 int64 version_id, |
| 65 content::ServiceWorkerVersion::RunningStatus running_status) override; | 66 content::ServiceWorkerVersion::RunningStatus running_status) override; |
| 66 void OnVersionStateChanged( | 67 void OnVersionStateChanged( |
| 67 int64 version_id, | 68 int64 version_id, |
| 68 content::ServiceWorkerVersion::Status status) override; | 69 content::ServiceWorkerVersion::Status status) override; |
| 70 void OnVersionUpdateTimeSet(int64 version_id, |
| 71 base::Time update_time) override; |
| 69 void OnRegistrationStored(int64 registration_id, | 72 void OnRegistrationStored(int64 registration_id, |
| 70 const GURL& pattern) override; | 73 const GURL& pattern) override; |
| 71 void OnRegistrationDeleted(int64 registration_id, | 74 void OnRegistrationDeleted(int64 registration_id, |
| 72 const GURL& pattern) override; | 75 const GURL& pattern) override; |
| 73 | 76 |
| 74 base::ScopedPtrHashMap<int64, ServiceWorkerVersionInfo> version_info_map_; | 77 base::ScopedPtrHashMap<int64, ServiceWorkerVersionInfo> version_info_map_; |
| 75 scoped_refptr<ServiceWorkerContextWrapper> context_; | 78 scoped_refptr<ServiceWorkerContextWrapper> context_; |
| 76 WorkerRegistrationUpdatedCallback registration_callback_; | 79 WorkerRegistrationUpdatedCallback registration_callback_; |
| 77 WorkerVersionUpdatedCallback version_callback_; | 80 WorkerVersionUpdatedCallback version_callback_; |
| 78 }; | 81 }; |
| 79 | 82 |
| 80 } // namespace content | 83 } // namespace content |
| 81 | 84 |
| 82 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WATCHER_H_ | 85 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WATCHER_H_ |
| OLD | NEW |