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" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 friend class base::RefCountedThreadSafe<ServiceWorkerContextWatcher>; | 43 friend class base::RefCountedThreadSafe<ServiceWorkerContextWatcher>; |
44 ~ServiceWorkerContextWatcher() override; | 44 ~ServiceWorkerContextWatcher() override; |
45 | 45 |
46 void GetStoredRegistrationsOnIOThread(); | 46 void GetStoredRegistrationsOnIOThread(); |
47 void OnStoredRegistrationsOnIOThread( | 47 void OnStoredRegistrationsOnIOThread( |
48 const std::vector<ServiceWorkerRegistrationInfo>& stored_registrations); | 48 const std::vector<ServiceWorkerRegistrationInfo>& stored_registrations); |
49 void StopOnIOThread(); | 49 void StopOnIOThread(); |
50 | 50 |
51 void StoreRegistrationInfo( | 51 void StoreRegistrationInfo( |
52 const ServiceWorkerRegistrationInfo& registration, | 52 const ServiceWorkerRegistrationInfo& registration, |
53 base::ScopedPtrHashMap<int64, ServiceWorkerRegistrationInfo>* info_map); | 53 base::ScopedPtrHashMap<int64, scoped_ptr<ServiceWorkerRegistrationInfo>>* |
| 54 info_map); |
54 void StoreVersionInfo(const ServiceWorkerVersionInfo& version); | 55 void StoreVersionInfo(const ServiceWorkerVersionInfo& version); |
55 | 56 |
56 void SendRegistrationInfo( | 57 void SendRegistrationInfo( |
57 int64 registration_id, | 58 int64 registration_id, |
58 const GURL& pattern, | 59 const GURL& pattern, |
59 ServiceWorkerRegistrationInfo::DeleteFlag delete_flag); | 60 ServiceWorkerRegistrationInfo::DeleteFlag delete_flag); |
60 void SendVersionInfo(const ServiceWorkerVersionInfo& version); | 61 void SendVersionInfo(const ServiceWorkerVersionInfo& version); |
61 | 62 |
62 // ServiceWorkerContextObserver implements | 63 // ServiceWorkerContextObserver implements |
63 void OnNewLiveRegistration(int64 registration_id, | 64 void OnNewLiveRegistration(int64 registration_id, |
(...skipping 17 matching lines...) Expand all Loading... |
81 const ErrorInfo& info) override; | 82 const ErrorInfo& info) override; |
82 void OnReportConsoleMessage(int64 version_id, | 83 void OnReportConsoleMessage(int64 version_id, |
83 int process_id, | 84 int process_id, |
84 int thread_id, | 85 int thread_id, |
85 const ConsoleMessage& message) override; | 86 const ConsoleMessage& message) override; |
86 void OnRegistrationStored(int64 registration_id, | 87 void OnRegistrationStored(int64 registration_id, |
87 const GURL& pattern) override; | 88 const GURL& pattern) override; |
88 void OnRegistrationDeleted(int64 registration_id, | 89 void OnRegistrationDeleted(int64 registration_id, |
89 const GURL& pattern) override; | 90 const GURL& pattern) override; |
90 | 91 |
91 base::ScopedPtrHashMap<int64, ServiceWorkerVersionInfo> version_info_map_; | 92 base::ScopedPtrHashMap<int64, scoped_ptr<ServiceWorkerVersionInfo>> |
| 93 version_info_map_; |
92 scoped_refptr<ServiceWorkerContextWrapper> context_; | 94 scoped_refptr<ServiceWorkerContextWrapper> context_; |
93 WorkerRegistrationUpdatedCallback registration_callback_; | 95 WorkerRegistrationUpdatedCallback registration_callback_; |
94 WorkerVersionUpdatedCallback version_callback_; | 96 WorkerVersionUpdatedCallback version_callback_; |
95 WorkerErrorReportedCallback error_callback_; | 97 WorkerErrorReportedCallback error_callback_; |
96 }; | 98 }; |
97 | 99 |
98 } // namespace content | 100 } // namespace content |
99 | 101 |
100 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WATCHER_H_ | 102 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WATCHER_H_ |
OLD | NEW |