Chromium Code Reviews
DescriptionRevise ServiceWorker DevTools protocols.
After I landed https://codereview.chromium.org/985663002/ I noticed that there is some problems in ServiceWorker DevTools protocol.
1. ServiceWorkerHandler::ContextObserver can't get the state of ServiceWorkerVersion correctly.
ServiceWorkerHandler::ContextObserver is using GetLiveVersion in OnVersionUpdated().
But when OnVersionUpdated() is called the live versions may already be deleted.
This is because OnVersionUpdated() is called via ObserverListThreadSafe<ServiceWorkerContextObserver> in ServiceWorkerContextCore.
So I change ServiceWorkerContextObserver::OnRunningStateChanged() and ServiceWorkerContextObserver::OnVersionStateChanged() to pass the new state and introduce OnNewLiveRegistration() and OnNewLiveVersion().
2. We have to distinguish the ServiceWorkerRegistrations which are deleted from the storage.
We shuold show the registrations which are already deleted from the storage but are still exist in the memory.
This could happen when ServiceWorkerRegistration.unregister() has been called but there are still some controlled pages.
So I will add isDeleted flag to ServiceWorkerRegistration DevTool's protocol. (https://codereview.chromium.org/996363002/)
And we can stop using workerRegistrationDeleted event.
3. Stop using {active/waiting/installing}_version properties of ServiceWorkerRegistration in DevTools protocols.
We send the all ServiceWorkerVersion infromation with workerVersionUpdated event and it has "state" properties.
So we don't need {active/waiting/installing}_version properties of ServiceWorkerRegistration.
This change depends on https://codereview.chromium.org/996363002/.
BUG=466871
Committed: https://crrev.com/a6bb251916eec43cb0c7c6709c57aa6b4209be11
Cr-Commit-Position: refs/heads/master@{#321277}
Patch Set 1 : #
Total comments: 6
Patch Set 2 : incorporated ksakamoto's comment #Patch Set 3 : #
Total comments: 2
Patch Set 4 : ServiceWorkerDevToolsContextObserver #Patch Set 5 : ServiceWorkerContextWatcher #
Total comments: 14
Patch Set 6 : incorporated kinuko's comment #
Total comments: 2
Patch Set 7 : CAPITAL_NAME #Patch Set 8 : Call RunUntilIdle after creating ServiceWorkerRegistration in GeofencingManagerTest #Patch Set 9 : rebase #Patch Set 10 : #Patch Set 11 : rebase #Patch Set 12 : use DCHECK_CURRENTLY_ON #Messages
Total messages: 36 (15 generated)
|