mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1425975 P9 Refactor MaybeCheckNavigationUpdate() to take a ClientInfo instead of a document. r=asuth
This commit is contained in:
parent
6bbdc69490
commit
3bd4435759
@ -5599,7 +5599,10 @@ nsDocument::DispatchContentLoadedEvents()
|
||||
using mozilla::dom::workers::ServiceWorkerManager;
|
||||
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
|
||||
if (swm) {
|
||||
swm->MaybeCheckNavigationUpdate(this);
|
||||
Maybe<ClientInfo> clientInfo = GetClientInfo();
|
||||
if (clientInfo.isSome()) {
|
||||
swm->MaybeCheckNavigationUpdate(clientInfo.ref());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2432,10 +2432,9 @@ ServiceWorkerManager::MaybeStopControlling(nsIDocument* aDoc)
|
||||
}
|
||||
|
||||
void
|
||||
ServiceWorkerManager::MaybeCheckNavigationUpdate(nsIDocument* aDoc)
|
||||
ServiceWorkerManager::MaybeCheckNavigationUpdate(const ClientInfo& aClientInfo)
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
MOZ_ASSERT(aDoc);
|
||||
// We perform these success path navigation update steps when the
|
||||
// document tells us its more or less done loading. This avoids
|
||||
// slowing down page load and also lets pages consistently get
|
||||
@ -2445,10 +2444,9 @@ ServiceWorkerManager::MaybeCheckNavigationUpdate(nsIDocument* aDoc)
|
||||
// 9.8.22 Else: (respondWith was entered and succeeded)
|
||||
// If request is a non-subresource request, then: Invoke Soft Update
|
||||
// algorithm.
|
||||
RefPtr<ServiceWorkerRegistrationInfo> registration;
|
||||
mControlledDocuments.Get(aDoc, getter_AddRefs(registration));
|
||||
if (registration) {
|
||||
registration->MaybeScheduleUpdate();
|
||||
ControlledClientData* data = mControlledClients.Get(aClientInfo.Id());
|
||||
if (data && data->mRegistrationInfo) {
|
||||
data->mRegistrationInfo->MaybeScheduleUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,7 +320,7 @@ public:
|
||||
ServiceWorkerRegistrationListener* aListener);
|
||||
|
||||
void
|
||||
MaybeCheckNavigationUpdate(nsIDocument* aDoc);
|
||||
MaybeCheckNavigationUpdate(const ClientInfo& aClientInfo);
|
||||
|
||||
nsresult
|
||||
SendPushEvent(const nsACString& aOriginAttributes,
|
||||
|
Loading…
Reference in New Issue
Block a user