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

Issue 998173002: Revise ServiceWorker DevTools protocols. (Closed)

Created:
5 years, 9 months ago by horo
Modified:
5 years, 9 months ago
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, serviceworker-reviews, tzik, horo+watch_chromium.org, jam, yurys, darin-cc_chromium.org, nhiroki, devtools-reviews_chromium.org, kinuko+serviceworker, kinuko+watch, aandrey+blink_chromium.org, pfeldman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Revise 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+401 lines, -212 lines) Patch
M content/browser/devtools/protocol/service_worker_handler.h View 1 2 3 4 5 6 7 8 3 chunks +2 lines, -4 lines 0 comments Download
M content/browser/devtools/protocol/service_worker_handler.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +39 lines, -189 lines 0 comments Download
M content/browser/geofencing/geofencing_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_context_core.cc View 1 2 3 4 5 6 7 8 4 chunks +13 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_context_observer.h View 2 chunks +11 lines, -2 lines 0 comments Download
A content/browser/service_worker/service_worker_context_watcher.h View 1 2 3 4 5 1 chunk +82 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_context_watcher.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +210 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_info.h View 1 2 3 4 5 6 3 chunks +8 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_info.cc View 1 2 3 4 5 6 1 chunk +13 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_internals_ui.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_registration.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_registration.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/service_worker/service_worker_storage.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_storage.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (15 generated)
horo
ksakamoto@ Could you please review this?
5 years, 9 months ago (2015-03-12 05:26:27 UTC) #5
Kunihiko Sakamoto
https://codereview.chromium.org/998173002/diff/60001/content/browser/devtools/protocol/service_worker_handler.cc File content/browser/devtools/protocol/service_worker_handler.cc (right): https://codereview.chromium.org/998173002/diff/60001/content/browser/devtools/protocol/service_worker_handler.cc#newcode137 content/browser/devtools/protocol/service_worker_handler.cc:137: base::ScopedPtrHashMap<int64, ServiceWorkerVersionInfo> version_info_map_; It seems items entered in these ...
5 years, 9 months ago (2015-03-12 08:08:46 UTC) #6
horo
https://codereview.chromium.org/998173002/diff/60001/content/browser/devtools/protocol/service_worker_handler.cc File content/browser/devtools/protocol/service_worker_handler.cc (right): https://codereview.chromium.org/998173002/diff/60001/content/browser/devtools/protocol/service_worker_handler.cc#newcode137 content/browser/devtools/protocol/service_worker_handler.cc:137: base::ScopedPtrHashMap<int64, ServiceWorkerVersionInfo> version_info_map_; On 2015/03/12 08:08:46, Kunihiko Sakamoto wrote: ...
5 years, 9 months ago (2015-03-12 09:12:59 UTC) #7
Kunihiko Sakamoto
lgtm
5 years, 9 months ago (2015-03-12 10:06:58 UTC) #8
horo
pfeldman@ Could you please review content/browser/devtools/protocol/service_worker_handler.*?
5 years, 9 months ago (2015-03-12 11:19:59 UTC) #10
pfeldman
https://codereview.chromium.org/998173002/diff/100001/content/browser/devtools/protocol/service_worker_handler.cc File content/browser/devtools/protocol/service_worker_handler.cc (right): https://codereview.chromium.org/998173002/diff/100001/content/browser/devtools/protocol/service_worker_handler.cc#newcode103 content/browser/devtools/protocol/service_worker_handler.cc:103: class ServiceWorkerHandler::ContextObserver Is this time to kick it out ...
5 years, 9 months ago (2015-03-12 12:23:23 UTC) #11
horo
https://codereview.chromium.org/998173002/diff/100001/content/browser/devtools/protocol/service_worker_handler.cc File content/browser/devtools/protocol/service_worker_handler.cc (right): https://codereview.chromium.org/998173002/diff/100001/content/browser/devtools/protocol/service_worker_handler.cc#newcode103 content/browser/devtools/protocol/service_worker_handler.cc:103: class ServiceWorkerHandler::ContextObserver On 2015/03/12 12:23:23, pfeldman wrote: > Is ...
5 years, 9 months ago (2015-03-12 13:54:15 UTC) #13
pfeldman
devtools lgtm, but you might want to run the new watcher by other sw owners ...
5 years, 9 months ago (2015-03-12 14:00:46 UTC) #14
horo
pfeldman@ Thank you. kinuko@ Could you please review this?
5 years, 9 months ago (2015-03-12 14:24:13 UTC) #16
kinuko
looking good https://codereview.chromium.org/998173002/diff/160001/content/browser/devtools/protocol/service_worker_handler.cc File content/browser/devtools/protocol/service_worker_handler.cc (left): https://codereview.chromium.org/998173002/diff/160001/content/browser/devtools/protocol/service_worker_handler.cc#oldcode99 content/browser/devtools/protocol/service_worker_handler.cc:99: registration->set_installing_version( Ok so we assume version.state info ...
5 years, 9 months ago (2015-03-13 09:09:21 UTC) #17
horo
https://codereview.chromium.org/998173002/diff/160001/content/browser/devtools/protocol/service_worker_handler.cc File content/browser/devtools/protocol/service_worker_handler.cc (left): https://codereview.chromium.org/998173002/diff/160001/content/browser/devtools/protocol/service_worker_handler.cc#oldcode99 content/browser/devtools/protocol/service_worker_handler.cc:99: registration->set_installing_version( On 2015/03/13 09:09:21, kinuko wrote: > Ok so ...
5 years, 9 months ago (2015-03-13 10:03:50 UTC) #19
kinuko
lgtm https://codereview.chromium.org/998173002/diff/190001/content/browser/service_worker/service_worker_info.h File content/browser/service_worker/service_worker_info.h (right): https://codereview.chromium.org/998173002/diff/190001/content/browser/service_worker/service_worker_info.h#newcode41 content/browser/service_worker/service_worker_info.h:41: enum DeleteFlag { IsNotDeleted, IsDeleted }; enum name ...
5 years, 9 months ago (2015-03-13 12:17:24 UTC) #20
horo
https://codereview.chromium.org/998173002/diff/190001/content/browser/service_worker/service_worker_info.h File content/browser/service_worker/service_worker_info.h (right): https://codereview.chromium.org/998173002/diff/190001/content/browser/service_worker/service_worker_info.h#newcode41 content/browser/service_worker/service_worker_info.h:41: enum DeleteFlag { IsNotDeleted, IsDeleted }; On 2015/03/13 12:17:24, ...
5 years, 9 months ago (2015-03-13 16:03:30 UTC) #21
horo
mek@chromium.org: Please review changes in geofencing_manager_unittest.cc.
5 years, 9 months ago (2015-03-14 03:22:06 UTC) #24
horo
mek@chromium.org: Ping? > Please review changes in geofencing_manager_unittest.cc.
5 years, 9 months ago (2015-03-18 01:15:37 UTC) #25
Marijn Kruisselbrink
On 2015/03/18 01:15:37, horo wrote: > mailto:mek@chromium.org: > Ping? > > Please review changes in ...
5 years, 9 months ago (2015-03-18 16:10:16 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/998173002/290001
5 years, 9 months ago (2015-03-18 23:09:23 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/6735)
5 years, 9 months ago (2015-03-18 23:17:51 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/998173002/330001
5 years, 9 months ago (2015-03-19 01:37:23 UTC) #34
commit-bot: I haz the power
Committed patchset #12 (id:330001)
5 years, 9 months ago (2015-03-19 02:49:03 UTC) #35
commit-bot: I haz the power
5 years, 9 months ago (2015-03-19 02:49:40 UTC) #36
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/a6bb251916eec43cb0c7c6709c57aa6b4209be11
Cr-Commit-Position: refs/heads/master@{#321277}

Powered by Google App Engine
This is Rietveld 408576698