• Yury Semikhatsky's avatar
    Reland "[DevTools] Properly notify devtools agent host when service worker is destroyed" · 7c3ffd97
    Yury Semikhatsky authored
    This reverts commit c6d15649.
    
    Reason for revert: the problem with gmail offline service workers mentioned in the bug has been fixed by http://crrev.com/c/2213550 and http://crrev.com/c/2213783.
    
    Bug: 1085150
    
    Original change's description:
    > Revert "[DevTools] Properly notify devtools agent host when service worker is destroyed"
    > 
    > This reverts commit 1537d629.
    > 
    > Reason for revert: potentially breaks gmail reloading when disabling offline mode with DevTools open.
    > 
    > Bug: 1085150
    > 
    > Original change's description:
    > > [DevTools] Properly notify devtools agent host when service worker is destroyed
    > > 
    > > ServiceWorkerDevToolsAgentHost now stores thread-safe reference to
    > > ServiceWorkerContextWrapper instead of ServiceWorkerContextCore that
    > > could be deleted asynchronously on the service worker core thread.
    > > 
    > > WorkerDestroyed notification is now sent to the observers of
    > > ServiceWorkerDevToolsManager iff the worker version is both stopped
    > > and doomed. Each worker can be terminated (and restarted) multiple times
    > > and will result in a sequence of targetCrashed/targetReloadedAfterCrash
    > > events in the protocol but the instance of its
    > > ServiceWorkerDevToolsAgentHost will survive restarts and all connected
    > > sessions will be preserved.
    > > 
    > > It fixes the events generated in the protocol for service workers from
    > > targetCreated, (detachedFromTarget, attachedToTarget, targetReloadedAfterCrash)* to
    > > targetCreated, (targetCrashed/targetReloadedAfterCrash)*, targetDestroyed
    > > and avoids inadvertent session terminations when workers are stopped and
    > > also spurious targetReloadedAfterCrash events.
    > > 
    > > Bug: none
    > > Change-Id: I1125604d08b7842f7f8d74751091193b9af2cb59
    > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2099590
    > > Commit-Queue: Yury Semikhatsky <yurys@chromium.org>
    > > Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
    > > Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
    > > Cr-Commit-Position: refs/heads/master@{#750975}
    > 
    > TBR=dgozman@chromium.org,horo@chromium.org,caseq@chromium.org,yurys@chromium.org,einbinder@chromium.org
    > 
    > # Not skipping CQ checks because original CL landed > 1 day ago.
    > 
    > Bug: none
    > Change-Id: Ibba7ce840b8c8b73c32086d141005306591e21cc
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213448
    > Reviewed-by: Yury Semikhatsky <yurys@chromium.org>
    > Commit-Queue: Yury Semikhatsky <yurys@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#771365}
    
    TBR=dgozman@chromium.org,horo@chromium.org,caseq@chromium.org,yurys@chromium.org,einbinder@chromium.org
    
    # Not skipping CQ checks because original CL landed > 1 day ago.
    
    Bug: 1085150, none
    Change-Id: I7afbb1f53a4940f931ad0722b52da3b307223663
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213817Reviewed-by: default avatarYury Semikhatsky <yurys@chromium.org>
    Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
    Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
    Commit-Queue: Yury Semikhatsky <yurys@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#771849}
    7c3ffd97
target_auto_attacher.cc 13.6 KB