| 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_CONTEXT_WRAPPER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 const GURL& first_party, | 85 const GURL& first_party, |
| 86 const net::CompletionCallback& callback) override; | 86 const net::CompletionCallback& callback) override; |
| 87 void GetAllOriginsInfo(const GetUsageInfoCallback& callback) override; | 87 void GetAllOriginsInfo(const GetUsageInfoCallback& callback) override; |
| 88 void DeleteForOrigin(const GURL& origin) override; | 88 void DeleteForOrigin(const GURL& origin) override; |
| 89 void CheckHasServiceWorker( | 89 void CheckHasServiceWorker( |
| 90 const GURL& url, | 90 const GURL& url, |
| 91 const GURL& other_url, | 91 const GURL& other_url, |
| 92 const CheckHasServiceWorkerCallback& callback) override; | 92 const CheckHasServiceWorkerCallback& callback) override; |
| 93 | 93 |
| 94 ServiceWorkerRegistration* GetLiveRegistration(int64_t registration_id); | 94 ServiceWorkerRegistration* GetLiveRegistration(int64_t registration_id); |
| 95 ServiceWorkerVersion* GetLiveVersion(int64_t version_id); | 95 ServiceWorkerVersion* GetLiveVersion(std::string version_uuid); |
| 96 std::vector<ServiceWorkerRegistrationInfo> GetAllLiveRegistrationInfo(); | 96 std::vector<ServiceWorkerRegistrationInfo> GetAllLiveRegistrationInfo(); |
| 97 std::vector<ServiceWorkerVersionInfo> GetAllLiveVersionInfo(); | 97 std::vector<ServiceWorkerVersionInfo> GetAllLiveVersionInfo(); |
| 98 | 98 |
| 99 void FindRegistrationForDocument(const GURL& document_url, | 99 void FindRegistrationForDocument(const GURL& document_url, |
| 100 const FindRegistrationCallback& callback); | 100 const FindRegistrationCallback& callback); |
| 101 void FindRegistrationForId(int64_t registration_id, | 101 void FindRegistrationForId(int64_t registration_id, |
| 102 const GURL& origin, | 102 const GURL& origin, |
| 103 const FindRegistrationCallback& callback); | 103 const FindRegistrationCallback& callback); |
| 104 void GetAllRegistrations(const GetRegistrationsInfosCallback& callback); | 104 void GetAllRegistrations(const GetRegistrationsInfosCallback& callback); |
| 105 void GetRegistrationUserData(int64_t registration_id, | 105 void GetRegistrationUserData(int64_t registration_id, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 116 void GetUserDataForAllRegistrations( | 116 void GetUserDataForAllRegistrations( |
| 117 const std::string& key, | 117 const std::string& key, |
| 118 const GetUserDataForAllRegistrationsCallback& callback); | 118 const GetUserDataForAllRegistrationsCallback& callback); |
| 119 | 119 |
| 120 // DeleteForOrigin with completion callback. Does not exit early, and returns | 120 // DeleteForOrigin with completion callback. Does not exit early, and returns |
| 121 // false if one or more of the deletions fail. | 121 // false if one or more of the deletions fail. |
| 122 virtual void DeleteForOrigin(const GURL& origin, const ResultCallback& done); | 122 virtual void DeleteForOrigin(const GURL& origin, const ResultCallback& done); |
| 123 | 123 |
| 124 void StartServiceWorker(const GURL& pattern, const StatusCallback& callback); | 124 void StartServiceWorker(const GURL& pattern, const StatusCallback& callback); |
| 125 void UpdateRegistration(const GURL& pattern); | 125 void UpdateRegistration(const GURL& pattern); |
| 126 void SimulateSkipWaiting(int64_t version_id); | 126 void SimulateSkipWaiting(std::string version_uuid); |
| 127 void AddObserver(ServiceWorkerContextObserver* observer); | 127 void AddObserver(ServiceWorkerContextObserver* observer); |
| 128 void RemoveObserver(ServiceWorkerContextObserver* observer); | 128 void RemoveObserver(ServiceWorkerContextObserver* observer); |
| 129 | 129 |
| 130 bool is_incognito() const { return is_incognito_; } | 130 bool is_incognito() const { return is_incognito_; } |
| 131 | 131 |
| 132 private: | 132 private: |
| 133 friend class BackgroundSyncManagerTest; | 133 friend class BackgroundSyncManagerTest; |
| 134 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; | 134 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; |
| 135 friend class EmbeddedWorkerTestHelper; | 135 friend class EmbeddedWorkerTestHelper; |
| 136 friend class EmbeddedWorkerBrowserTest; | 136 friend class EmbeddedWorkerBrowserTest; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // Initialized in Init(); true if the user data directory is empty. | 181 // Initialized in Init(); true if the user data directory is empty. |
| 182 bool is_incognito_; | 182 bool is_incognito_; |
| 183 | 183 |
| 184 // Raw pointer to the StoragePartitionImpl owning |this|. | 184 // Raw pointer to the StoragePartitionImpl owning |this|. |
| 185 StoragePartitionImpl* storage_partition_; | 185 StoragePartitionImpl* storage_partition_; |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 } // namespace content | 188 } // namespace content |
| 189 | 189 |
| 190 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 190 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| OLD | NEW |