|
|
Chromium Code Reviews|
Created:
4 years, 8 months ago by horo Modified:
4 years, 8 months ago Reviewers:
falken CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, nhiroki, darin-cc_chromium.org, horo+watch_chromium.org, kinuko+watch, blink-worker-reviews_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionDon't stop ServiceWorker when DevTools is attached even if JS execution is failed.
BUG=601263
Committed: https://crrev.com/a99df79c37fd3e0ccaf2aa992acb44d3cd1a7c27
Cr-Commit-Position: refs/heads/master@{#388469}
Patch Set 1 : #
Total comments: 2
Patch Set 2 : add DCHECK_EQ #Patch Set 3 : add running_status check #
Messages
Total messages: 22 (10 generated)
Patchset #1 (id:1) has been deleted
Description was changed from ========== Don't stop ServiceWorker when DevTools is attached even if JS execution is failed. BUG= ========== to ========== Don't stop ServiceWorker when DevTools is attached even if JS execution is failed. BUG=601263 ==========
horo@chromium.org changed reviewers: + falken@chromium.org
falken@ Could you please review?
I think this is fine but it seems we can rely on the normal StopWorkerIfIdle mechanism to stop the worker once it's no longer used, instead of introducing stop_when_devtools_detached. WDYT?
On 2016/04/20 06:13:58, falken wrote: > I think this is fine but it seems we can rely on the normal StopWorkerIfIdle > mechanism to stop the worker once it's no longer used, instead of introducing > stop_when_devtools_detached. WDYT? Are you saying that we should call StopWorkerIfIdle() when SetDevToolsAttached(false) is called? If we do so, worker stoops when the developer close the DevTools. I think this behavior confuses the developer.
On 2016/04/20 06:42:27, horo wrote:
> On 2016/04/20 06:13:58, falken wrote:
> > I think this is fine but it seems we can rely on the normal StopWorkerIfIdle
> > mechanism to stop the worker once it's no longer used, instead of
introducing
> > stop_when_devtools_detached. WDYT?
>
> Are you saying that we should call StopWorkerIfIdle() when
> SetDevToolsAttached(false) is called?
>
> If we do so, worker stoops when the developer close the DevTools.
> I think this behavior confuses the developer.
No, I mean don't change SetDevToolsAttached in this patch. And the code in
Doom() is just:
if (running_status() == STARTING || running_status() == RUNNING) {
if (!embedded_worker()->devtools_attached())
embedded_worker_->Stop();
}
In case devtools is attached at that point, the worker will still eventually get
stopped by the timeout timer which calls StopWorkerIfIdle() periodically, like
all service workers are. So I think we don't need special handling to close it
immediately once devtools is detached.
On 2016/04/20 06:53:45, falken wrote:
> On 2016/04/20 06:42:27, horo wrote:
> > On 2016/04/20 06:13:58, falken wrote:
> > > I think this is fine but it seems we can rely on the normal
StopWorkerIfIdle
> > > mechanism to stop the worker once it's no longer used, instead of
> introducing
> > > stop_when_devtools_detached. WDYT?
> >
> > Are you saying that we should call StopWorkerIfIdle() when
> > SetDevToolsAttached(false) is called?
> >
> > If we do so, worker stoops when the developer close the DevTools.
> > I think this behavior confuses the developer.
>
> No, I mean don't change SetDevToolsAttached in this patch. And the code in
> Doom() is just:
>
> if (running_status() == STARTING || running_status() == RUNNING) {
> if (!embedded_worker()->devtools_attached())
> embedded_worker_->Stop();
> }
>
> In case devtools is attached at that point, the worker will still eventually
get
> stopped by the timeout timer which calls StopWorkerIfIdle() periodically, like
> all service workers are. So I think we don't need special handling to close it
> immediately once devtools is detached.
I think the worker should stop as soon as possible from the viewpoint of
resource consumption.
So don't want to relay on the timer mechanism.
lgtm https://codereview.chromium.org/1901363002/diff/20001/content/browser/service... File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1901363002/diff/20001/content/browser/service... content/browser/service_worker/service_worker_version.cc:632: if (stop_when_devtools_detached_ && !attached) { DCHECK that it's REDUNDANT so we know we don't have to care about resetting stop_when_devtools_detached
https://codereview.chromium.org/1901363002/diff/20001/content/browser/service... File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1901363002/diff/20001/content/browser/service... content/browser/service_worker/service_worker_version.cc:632: if (stop_when_devtools_detached_ && !attached) { On 2016/04/20 07:24:56, falken wrote: > DCHECK that it's REDUNDANT so we know we don't have to care about resetting > stop_when_devtools_detached Done.
The CQ bit was checked by horo@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from falken@chromium.org Link to the patchset: https://codereview.chromium.org/1901363002/#ps40001 (title: "add DCHECK_EQ")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1901363002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1901363002/40001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by horo@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from falken@chromium.org Link to the patchset: https://codereview.chromium.org/1901363002/#ps60001 (title: "add running_status check")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1901363002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1901363002/60001
Message was sent while issue was closed.
Description was changed from ========== Don't stop ServiceWorker when DevTools is attached even if JS execution is failed. BUG=601263 ========== to ========== Don't stop ServiceWorker when DevTools is attached even if JS execution is failed. BUG=601263 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:60001)
Message was sent while issue was closed.
Description was changed from ========== Don't stop ServiceWorker when DevTools is attached even if JS execution is failed. BUG=601263 ========== to ========== Don't stop ServiceWorker when DevTools is attached even if JS execution is failed. BUG=601263 Committed: https://crrev.com/a99df79c37fd3e0ccaf2aa992acb44d3cd1a7c27 Cr-Commit-Position: refs/heads/master@{#388469} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/a99df79c37fd3e0ccaf2aa992acb44d3cd1a7c27 Cr-Commit-Position: refs/heads/master@{#388469} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
