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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void OnRunningStateChanged( | 69 void OnRunningStateChanged( |
69 int64 version_id, | 70 int64 version_id, |
70 content::ServiceWorkerVersion::RunningStatus running_status) override; | 71 content::ServiceWorkerVersion::RunningStatus running_status) override; |
71 void OnVersionStateChanged( | 72 void OnVersionStateChanged( |
72 int64 version_id, | 73 int64 version_id, |
73 content::ServiceWorkerVersion::Status status) override; | 74 content::ServiceWorkerVersion::Status status) override; |
74 void OnErrorReported(int64 version_id, | 75 void OnErrorReported(int64 version_id, |
75 int process_id, | 76 int process_id, |
76 int thread_id, | 77 int thread_id, |
77 const ErrorInfo& info) override; | 78 const ErrorInfo& info) override; |
| 79 void OnVersionUpdateTimeSet(int64 version_id, |
| 80 base::Time update_time) override; |
78 void OnRegistrationStored(int64 registration_id, | 81 void OnRegistrationStored(int64 registration_id, |
79 const GURL& pattern) override; | 82 const GURL& pattern) override; |
80 void OnRegistrationDeleted(int64 registration_id, | 83 void OnRegistrationDeleted(int64 registration_id, |
81 const GURL& pattern) override; | 84 const GURL& pattern) override; |
82 | 85 |
83 base::ScopedPtrHashMap<int64, ServiceWorkerVersionInfo> version_info_map_; | 86 base::ScopedPtrHashMap<int64, ServiceWorkerVersionInfo> version_info_map_; |
84 scoped_refptr<ServiceWorkerContextWrapper> context_; | 87 scoped_refptr<ServiceWorkerContextWrapper> context_; |
85 WorkerRegistrationUpdatedCallback registration_callback_; | 88 WorkerRegistrationUpdatedCallback registration_callback_; |
86 WorkerVersionUpdatedCallback version_callback_; | 89 WorkerVersionUpdatedCallback version_callback_; |
87 WorkerErrorReportedCallback error_callback_; | 90 WorkerErrorReportedCallback error_callback_; |
88 }; | 91 }; |
89 | 92 |
90 } // namespace content | 93 } // namespace content |
91 | 94 |
92 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WATCHER_H_ | 95 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WATCHER_H_ |
OLD | NEW |