Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Unified Diff: content/browser/service_worker/service_worker_context_wrapper.h

Issue 1079923002: ServiceWorker: Stop exposing ServiceWorkerContextCore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_context_wrapper.h
diff --git a/content/browser/service_worker/service_worker_context_wrapper.h b/content/browser/service_worker/service_worker_context_wrapper.h
index f77b07cf9967351e9b22ad16eaf6dccfb1bce6b0..eca4a36fdcd1b1520485f8a0cdaeffa24e028215 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.h
+++ b/content/browser/service_worker/service_worker_context_wrapper.h
@@ -40,7 +40,15 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
: NON_EXPORTED_BASE(public ServiceWorkerContext),
public base::RefCountedThreadSafe<ServiceWorkerContextWrapper> {
public:
- typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback;
+ using StatusCallback = base::Callback<void(ServiceWorkerStatusCode)>;
+ using FindRegistrationCallback =
+ ServiceWorkerStorage::FindRegistrationCallback;
+ using GetRegistrationsInfosCallback =
+ ServiceWorkerStorage::GetRegistrationsInfosCallback;
+ using GetUserDataCallback = ServiceWorkerStorage::GetUserDataCallback;
+ using GetUserDataForAllRegistrationsCallback =
+ ServiceWorkerStorage::GetUserDataForAllRegistrationsCallback;
+
ServiceWorkerContextWrapper(BrowserContext* browser_context);
// Init and Shutdown are for use on the UI thread when the profile,
@@ -55,11 +63,6 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
// called on the IO thread.
void DeleteAndStartOver();
- // The core context is only for use on the IO thread.
- // Can be null before/during init, during/after shutdown, and after
- // DeleteAndStartOver fails.
- ServiceWorkerContextCore* context();
-
// The StoragePartition should only be used on the UI thread.
// Can be null before/during init and during/after shutdown.
StoragePartitionImpl* storage_partition() const;
@@ -88,6 +91,32 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
const GURL& other_url,
const CheckHasServiceWorkerCallback& callback) override;
+ ServiceWorkerRegistration* GetLiveRegistration(int64_t registration_id);
+ ServiceWorkerVersion* GetLiveVersion(int64_t version_id);
+ std::vector<ServiceWorkerRegistrationInfo> GetAllLiveRegistrationInfo();
+ std::vector<ServiceWorkerVersionInfo> GetAllLiveVersionInfo();
+
+ void FindRegistrationForDocument(const GURL& document_url,
+ const FindRegistrationCallback& callback);
+ void FindRegistrationForId(int64_t registration_id,
+ const GURL& origin,
+ const FindRegistrationCallback& callback);
+ void GetAllRegistrations(const GetRegistrationsInfosCallback& callback);
+ void GetRegistrationUserData(int64_t registration_id,
+ const std::string& key,
+ const GetUserDataCallback& callback);
+ void StoreRegistrationUserData(int64_t registration_id,
+ const GURL& origin,
+ const std::string& key,
+ const std::string& data,
+ const StatusCallback& callback);
+ void ClearRegistrationUserData(int64_t registration_id,
+ const std::string& key,
+ const StatusCallback& callback);
+ void GetUserDataForAllRegistrations(
+ const std::string& key,
+ const GetUserDataForAllRegistrationsCallback& callback);
+
// DeleteForOrigin with completion callback. Does not exit early, and returns
// false if one or more of the deletions fail.
virtual void DeleteForOrigin(const GURL& origin_url,
@@ -104,7 +133,12 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
friend class BackgroundSyncManagerTest;
friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>;
friend class EmbeddedWorkerTestHelper;
+ friend class EmbeddedWorkerBrowserTest;
+ friend class ServiceWorkerDispatcherHost;
+ friend class ServiceWorkerInternalsUI;
friend class ServiceWorkerProcessManager;
+ friend class ServiceWorkerRequestHandler;
+ friend class ServiceWorkerVersionBrowserTest;
friend class MockServiceWorkerContextWrapper;
~ServiceWorkerContextWrapper() override;
@@ -133,6 +167,11 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
ServiceWorkerStatusCode status,
const scoped_refptr<content::ServiceWorkerRegistration>& registration);
+ // The core context is only for use on the IO thread.
+ // Can be null before/during init, during/after shutdown, and after
+ // DeleteAndStartOver fails.
+ ServiceWorkerContextCore* context();
+
const scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> >
observer_list_;
const scoped_ptr<ServiceWorkerProcessManager> process_manager_;

Powered by Google App Engine
This is Rietveld 408576698