Bug 1456995 - reduce access levels for member variables/methods in ServiceWorkerManager r=asuth

The changes are just cleanup for member variables/methods that should
be private to ServiceWorkerManager.

Depends on D48179

Differential Revision: https://phabricator.services.mozilla.com/D48181

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Perry Jiang 2019-10-04 15:28:35 +00:00
parent ec209ccb5c
commit c4528c3537

View File

@ -92,32 +92,6 @@ class ServiceWorkerManager final : public nsIServiceWorkerManager,
NS_DECL_NSISERVICEWORKERMANAGER
NS_DECL_NSIOBSERVER
struct RegistrationDataPerPrincipal;
nsClassHashtable<nsCStringHashKey, RegistrationDataPerPrincipal>
mRegistrationInfos;
struct ControlledClientData {
RefPtr<ClientHandle> mClientHandle;
RefPtr<ServiceWorkerRegistrationInfo> mRegistrationInfo;
ControlledClientData(ClientHandle* aClientHandle,
ServiceWorkerRegistrationInfo* aRegistrationInfo)
: mClientHandle(aClientHandle), mRegistrationInfo(aRegistrationInfo) {}
};
nsClassHashtable<nsIDHashKey, ControlledClientData> mControlledClients;
struct PendingReadyData {
RefPtr<ClientHandle> mClientHandle;
RefPtr<ServiceWorkerRegistrationPromise::Private> mPromise;
explicit PendingReadyData(ClientHandle* aClientHandle)
: mClientHandle(aClientHandle),
mPromise(new ServiceWorkerRegistrationPromise::Private(__func__)) {}
};
nsTArray<UniquePtr<PendingReadyData>> mPendingReadyList;
bool IsAvailable(nsIPrincipal* aPrincipal, nsIURI* aURI);
// Return true if the given content process could potentially be executing
@ -256,11 +230,6 @@ class ServiceWorkerManager final : public nsIServiceWorkerManager,
void LoadRegistrations(
const nsTArray<ServiceWorkerRegistrationData>& aRegistrations);
// Used by remove() and removeAll() when clearing history.
// MUST ONLY BE CALLED FROM UnregisterIfMatchesHost!
void ForceUnregister(RegistrationDataPerPrincipal* aRegistrationData,
ServiceWorkerRegistrationInfo* aRegistration);
void MaybeCheckNavigationUpdate(const ClientInfo& aClientInfo);
nsresult SendPushEvent(const nsACString& aOriginAttributes,
@ -288,6 +257,13 @@ class ServiceWorkerManager final : public nsIServiceWorkerManager,
ServiceWorkerRegistrationInfo** aRegistrationInfo);
private:
struct RegistrationDataPerPrincipal;
static bool FindScopeForPath(const nsACString& aScopeKey,
const nsACString& aPath,
RegistrationDataPerPrincipal** aData,
nsACString& aMatch);
ServiceWorkerManager();
~ServiceWorkerManager();
@ -342,11 +318,6 @@ class ServiceWorkerManager final : public nsIServiceWorkerManager,
static void AddScopeAndRegistration(
const nsACString& aScope, ServiceWorkerRegistrationInfo* aRegistation);
static bool FindScopeForPath(const nsACString& aScopeKey,
const nsACString& aPath,
RegistrationDataPerPrincipal** aData,
nsACString& aMatch);
static bool HasScope(nsIPrincipal* aPrincipal, const nsACString& aScope);
static void RemoveScopeAndRegistration(
@ -389,7 +360,37 @@ class ServiceWorkerManager final : public nsIServiceWorkerManager,
const nsAString& aData,
const nsAString& aBehavior);
// Used by remove() and removeAll() when clearing history.
// MUST ONLY BE CALLED FROM UnregisterIfMatchesHost!
void ForceUnregister(RegistrationDataPerPrincipal* aRegistrationData,
ServiceWorkerRegistrationInfo* aRegistration);
RefPtr<ServiceWorkerShutdownBlocker> mShutdownBlocker;
nsClassHashtable<nsCStringHashKey, RegistrationDataPerPrincipal>
mRegistrationInfos;
struct ControlledClientData {
RefPtr<ClientHandle> mClientHandle;
RefPtr<ServiceWorkerRegistrationInfo> mRegistrationInfo;
ControlledClientData(ClientHandle* aClientHandle,
ServiceWorkerRegistrationInfo* aRegistrationInfo)
: mClientHandle(aClientHandle), mRegistrationInfo(aRegistrationInfo) {}
};
nsClassHashtable<nsIDHashKey, ControlledClientData> mControlledClients;
struct PendingReadyData {
RefPtr<ClientHandle> mClientHandle;
RefPtr<ServiceWorkerRegistrationPromise::Private> mPromise;
explicit PendingReadyData(ClientHandle* aClientHandle)
: mClientHandle(aClientHandle),
mPromise(new ServiceWorkerRegistrationPromise::Private(__func__)) {}
};
nsTArray<UniquePtr<PendingReadyData>> mPendingReadyList;
};
} // namespace dom