Index: content/public/browser/service_worker_context.h |
diff --git a/content/public/browser/service_worker_context.h b/content/public/browser/service_worker_context.h |
index 22c989b4ce8254ddfd423421af59aec9cec2f69c..fa6bcad3f4c9afac4ad422f3bfea71fca9cf6e8a 100644 |
--- a/content/public/browser/service_worker_context.h |
+++ b/content/public/browser/service_worker_context.h |
@@ -29,6 +29,10 @@ class ServiceWorkerContext { |
typedef base::Callback<void(bool success)> ResultCallback; |
+ typedef base::Callback<void(const std::string& data, |
+ bool success, |
+ bool not_found)> GetUserDataCallback; |
+ |
typedef base::Callback<void(const std::vector<ServiceWorkerUsageInfo>& |
usage_info)> GetUsageInfoCallback; |
@@ -71,6 +75,22 @@ class ServiceWorkerContext { |
virtual void UnregisterServiceWorker(const Scope& pattern, |
const ResultCallback& callback) = 0; |
+ // Provide a storage mechanism to read/write arbitrary data associated with |
+ // a registration. Each registration has its own key namespace. Stored data |
+ // is deleted when the associated registraton is deleted. Must all be called |
+ // from the IO thread. |
+ virtual void GetUserData(int64 registration_id, |
+ const std::string& key, |
+ const GetUserDataCallback& callback) = 0; |
+ virtual void StoreUserData(int64 registration_id, |
+ const GURL& origin, |
+ const std::string& key, |
+ const std::string& data, |
+ const ResultCallback& callback) = 0; |
+ virtual void ClearUserData(int64 registration_id, |
+ const std::string& key, |
+ const ResultCallback& callback) = 0; |
+ |
// TODO(jyasskin): Provide a way to SendMessage to a Scope. |
// Determines if a request for 'url' can be satisfied while offline. |