New issue
Advanced search Search tips

Issue 820640 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

DevTools: Runtime.terminateExecution

Project Member Reported by kozy@chromium.org, Mar 9 2018

Issue description

Add protocol command which allows to terminate current JavaScript execution.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/df134e77e773c4c29929fea615ce838f3e96badc

commit df134e77e773c4c29929fea615ce838f3e96badc
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Tue Mar 13 04:39:36 2018

[bindings] removed V8PrivateProperty::GetOrEmpty

.. and prepared V8PrivateProperty::V8PrivateProperty for terminate
execution.

R=haraken@chromium.org

Bug:  chromium:820640 
Change-Id: I1d31466f2a4c8f7dcb4eaf225c082bededddb768
Reviewed-on: https://chromium-review.googlesource.com/959148
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542725}
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/V0CustomElementConstructorBuilder.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/V8EventListenerHelper.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/custom/V8ErrorEventCustom.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/modules/v8/custom/V8ExtendableMessageEventCustom.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/core/fetch/BodyStreamBuffer.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/platform/bindings/V8PrivateProperty.cpp
[modify] https://crrev.com/df134e77e773c4c29929fea615ce838f3e96badc/third_party/WebKit/Source/platform/bindings/V8PrivateProperty.h

Project Member

Comment 2 by bugdroid1@chromium.org, Mar 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/98dec8f24026df57dd1b3d42833cb84c79a8250e

commit 98dec8f24026df57dd1b3d42833cb84c79a8250e
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Tue Mar 13 19:28:01 2018

[inspector] added Runtime.terminateExecution

Runtime.terminateExecution terminates current or next JavaScript
call. Termination flag is automatically reset as soon as v8 call
or microtasks are completed.

R=pfeldman@chromium.org

Bug:  chromium:820640 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ie21c123be3a61fe25cf6e04c38a8b6c664622ed7
Reviewed-on: https://chromium-review.googlesource.com/957386
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51912}
[modify] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/src/inspector/injected-script.cc
[modify] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/src/inspector/inspector_protocol_config.json
[modify] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/src/inspector/js_protocol.json
[modify] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/src/inspector/js_protocol.pdl
[modify] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/src/inspector/v8-debugger.cc
[modify] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/src/inspector/v8-debugger.h
[modify] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/src/inspector/v8-inspector-session-impl.cc
[modify] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/src/inspector/v8-runtime-agent-impl.cc
[modify] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/src/inspector/v8-runtime-agent-impl.h
[add] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/test/inspector/runtime/terminate-execution-expected.txt
[add] https://crrev.com/98dec8f24026df57dd1b3d42833cb84c79a8250e/test/inspector/runtime/terminate-execution.js

Project Member

Comment 3 by bugdroid1@chromium.org, Mar 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/af667f934e228565b5f6268483bce64ba18fd37b

commit af667f934e228565b5f6268483bce64ba18fd37b
Author: Michael Achenbach <machenbach@chromium.org>
Date: Wed Mar 14 07:54:44 2018

Revert "[inspector] added Runtime.terminateExecution"

This reverts commit 98dec8f24026df57dd1b3d42833cb84c79a8250e.

Reason for revert: Speculative revert as win32/64 debug seems to
hang after this:
https://build.chromium.org/p/client.v8/builders/V8%20Win32%20-%20debug/builds/13691

Original change's description:
> [inspector] added Runtime.terminateExecution
> 
> Runtime.terminateExecution terminates current or next JavaScript
> call. Termination flag is automatically reset as soon as v8 call
> or microtasks are completed.
> 
> R=​pfeldman@chromium.org
> 
> Bug:  chromium:820640 
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: Ie21c123be3a61fe25cf6e04c38a8b6c664622ed7
> Reviewed-on: https://chromium-review.googlesource.com/957386
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#51912}

TBR=dgozman@chromium.org,pfeldman@chromium.org,kozyatinskiy@chromium.org

Change-Id: I25258ca5e9a2c2c514f0834da0ef0f5e75421d52
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  chromium:820640 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/962002
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51914}
[modify] https://crrev.com/af667f934e228565b5f6268483bce64ba18fd37b/src/inspector/injected-script.cc
[modify] https://crrev.com/af667f934e228565b5f6268483bce64ba18fd37b/src/inspector/inspector_protocol_config.json
[modify] https://crrev.com/af667f934e228565b5f6268483bce64ba18fd37b/src/inspector/js_protocol.json
[modify] https://crrev.com/af667f934e228565b5f6268483bce64ba18fd37b/src/inspector/js_protocol.pdl
[modify] https://crrev.com/af667f934e228565b5f6268483bce64ba18fd37b/src/inspector/v8-debugger.cc
[modify] https://crrev.com/af667f934e228565b5f6268483bce64ba18fd37b/src/inspector/v8-debugger.h
[modify] https://crrev.com/af667f934e228565b5f6268483bce64ba18fd37b/src/inspector/v8-inspector-session-impl.cc
[modify] https://crrev.com/af667f934e228565b5f6268483bce64ba18fd37b/src/inspector/v8-runtime-agent-impl.cc
[modify] https://crrev.com/af667f934e228565b5f6268483bce64ba18fd37b/src/inspector/v8-runtime-agent-impl.h
[delete] https://crrev.com/75d612e0b9e064b8dd2fd8aaa3c1eace7acb3b00/test/inspector/runtime/terminate-execution-expected.txt
[delete] https://crrev.com/75d612e0b9e064b8dd2fd8aaa3c1eace7acb3b00/test/inspector/runtime/terminate-execution.js

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/14824520fc58d17720672b15198718ffb83233d4

commit 14824520fc58d17720672b15198718ffb83233d4
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Sat Mar 17 02:34:38 2018

Reland "[inspector] added Runtime.terminateExecution"

This is a reland of 98dec8f24026df57dd1b3d42833cb84c79a8250e

Original change's description:
> [inspector] added Runtime.terminateExecution
> 
> Runtime.terminateExecution terminates current or next JavaScript
> call. Termination flag is automatically reset as soon as v8 call
> or microtasks are completed.
> 
> R=pfeldman@chromium.org
> 
> Bug:  chromium:820640 
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: Ie21c123be3a61fe25cf6e04c38a8b6c664622ed7
> Reviewed-on: https://chromium-review.googlesource.com/957386
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#51912}

Bug:  chromium:820640 
Change-Id: I8f270c2fdbe732f0c40bfb149d26a6e73d988253
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/966681
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52002}
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/inspector/injected-script.cc
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/inspector/inspector_protocol_config.json
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/inspector/js_protocol.json
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/inspector/js_protocol.pdl
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/inspector/v8-debugger.cc
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/inspector/v8-debugger.h
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/inspector/v8-inspector-session-impl.cc
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/inspector/v8-runtime-agent-impl.cc
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/inspector/v8-runtime-agent-impl.h
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/isolate-inl.h
[modify] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/src/isolate.cc
[add] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/test/inspector/runtime/terminate-execution-expected.txt
[add] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/test/inspector/runtime/terminate-execution.js

Project Member

Comment 5 by bugdroid1@chromium.org, Mar 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/7652bd270a3ff2d8c6d29cd294f0a24be426ad06

commit 7652bd270a3ff2d8c6d29cd294f0a24be426ad06
Author: Michael Achenbach <machenbach@chromium.org>
Date: Sat Mar 17 14:40:14 2018

Revert "Reland "[inspector] added Runtime.terminateExecution""

This reverts commit 14824520fc58d17720672b15198718ffb83233d4.

Reason for revert: Breaks chromium tsan in roll:
https://chromium-review.googlesource.com/c/chromium/src/+/967682

Original change's description:
> Reland "[inspector] added Runtime.terminateExecution"
> 
> This is a reland of 98dec8f24026df57dd1b3d42833cb84c79a8250e
> 
> Original change's description:
> > [inspector] added Runtime.terminateExecution
> > 
> > Runtime.terminateExecution terminates current or next JavaScript
> > call. Termination flag is automatically reset as soon as v8 call
> > or microtasks are completed.
> > 
> > R=pfeldman@chromium.org
> > 
> > Bug:  chromium:820640 
> > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> > Change-Id: Ie21c123be3a61fe25cf6e04c38a8b6c664622ed7
> > Reviewed-on: https://chromium-review.googlesource.com/957386
> > Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> > Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#51912}
> 
> Bug:  chromium:820640 
> Change-Id: I8f270c2fdbe732f0c40bfb149d26a6e73d988253
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Reviewed-on: https://chromium-review.googlesource.com/966681
> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52002}

TBR=dgozman@chromium.org,pfeldman@chromium.org,kozyatinskiy@chromium.org

Change-Id: I2f3d24b238f479082bfed349363240887b5ba751
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  chromium:820640 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/967781
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52003}
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/inspector/injected-script.cc
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/inspector/inspector_protocol_config.json
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/inspector/js_protocol.json
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/inspector/js_protocol.pdl
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/inspector/v8-debugger.cc
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/inspector/v8-debugger.h
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/inspector/v8-inspector-session-impl.cc
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/inspector/v8-runtime-agent-impl.cc
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/inspector/v8-runtime-agent-impl.h
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/isolate-inl.h
[modify] https://crrev.com/7652bd270a3ff2d8c6d29cd294f0a24be426ad06/src/isolate.cc
[delete] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/test/inspector/runtime/terminate-execution-expected.txt
[delete] https://crrev.com/14824520fc58d17720672b15198718ffb83233d4/test/inspector/runtime/terminate-execution.js

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/97fc20f381e1e291641dfe428afd0482593e8a55

commit 97fc20f381e1e291641dfe428afd0482593e8a55
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Mon Mar 19 02:14:52 2018

Reland "[inspector] added Runtime.terminateExecution"

This is a reland of 14824520fc58d17720672b15198718ffb83233d4

Original change's description:
> [inspector] added Runtime.terminateExecution
>
> Runtime.terminateExecution terminates current or next JavaScript
> call. Termination flag is automatically reset as soon as v8 call
> or microtasks are completed.
>
> R=pfeldman@chromium.org
>
> Bug:  chromium:820640 
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: Ie21c123be3a61fe25cf6e04c38a8b6c664622ed7
> Reviewed-on: https://chromium-review.googlesource.com/957386
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#51912}

Bug:  chromium:820640 
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I6dd30f65c06c2b7eefd1e7beb9a3cf50ea5bf8cd
Reviewed-on: https://chromium-review.googlesource.com/967323
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52004}
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/api.cc
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/debug/debug-interface.h
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/injected-script.cc
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/inspector_protocol_config.json
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/js_protocol.json
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/js_protocol.pdl
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/v8-debugger.cc
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/v8-debugger.h
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/v8-inspector-impl.cc
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/v8-inspector-session-impl.cc
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/v8-runtime-agent-impl.cc
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/inspector/v8-runtime-agent-impl.h
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/isolate-inl.h
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/isolate.cc
[modify] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/src/isolate.h
[add] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/test/inspector/runtime/terminate-execution-expected.txt
[add] https://crrev.com/97fc20f381e1e291641dfe428afd0482593e8a55/test/inspector/runtime/terminate-execution.js

Project Member

Comment 7 by bugdroid1@chromium.org, Mar 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3db89498ecd167ba5479c693c1f7c8eee5646ea9

commit 3db89498ecd167ba5479c693c1f7c8eee5646ea9
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Mon Mar 19 18:45:48 2018

[DevTools] process Runtime.terminateExecution using interuption

.. and Emulation.setScriptExecutionDisabled as well.

R=pfeldman@chromium.org

Bug:  chromium:820640 
Change-Id: I72d245cf78d80ad0444a036d29220562f787b585
Reviewed-on: https://chromium-review.googlesource.com/957820
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544084}
[modify] https://crrev.com/3db89498ecd167ba5479c693c1f7c8eee5646ea9/content/browser/devtools/devtools_session.cc
[add] https://crrev.com/3db89498ecd167ba5479c693c1f7c8eee5646ea9/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/terminate-execution-with-fetch-callbacks-expected.txt
[add] https://crrev.com/3db89498ecd167ba5479c693c1f7c8eee5646ea9/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/terminate-execution-with-fetch-callbacks.js
[add] https://crrev.com/3db89498ecd167ba5479c693c1f7c8eee5646ea9/third_party/WebKit/LayoutTests/inspector-protocol/page/terminate-execution-expected.txt
[add] https://crrev.com/3db89498ecd167ba5479c693c1f7c8eee5646ea9/third_party/WebKit/LayoutTests/inspector-protocol/page/terminate-execution.js
[modify] https://crrev.com/3db89498ecd167ba5479c693c1f7c8eee5646ea9/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp

Comment 8 by kozy@chromium.org, Mar 19 2018

Before marking this issue as fixed, I am going to test it better using Yang's fuzzing proposal from doc [1].

It should be possible to terminate any JavaScript execution using Runtime.terminateExecution DevTools protocol command. This method terminates only current JavaScript execution, e.g. in case of event listeners since each handler is separate V8 API call, terminate will kill only one listener and allow next one. If client prefers to stop all JavaScript in current page from running, it can use two commands: Emulation.setScriptExecutionDisabled and Runtime.terminateExecution. First command will prevent any following JavaScript execution.

[1] https://docs.google.com/document/d/1e4Y3PCXxnn_qtEP5jkF-I_Z6OoyR1OUaftJOSEFkgiw/edit#
Project Member

Comment 9 by bugdroid1@chromium.org, Apr 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/d3f6c6479f2fb2f174d224e4546128e07f081cf8

commit d3f6c6479f2fb2f174d224e4546128e07f081cf8
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Mon Apr 23 17:53:55 2018

[runtime] implemented SafeForInterruptsScope

This CL introduced SafeForInterruptsScope. This scope overrides
outer PostponeInterruptsScopes:
- reschedule postponed interrupts if needed,
- allow requesting new interrupts.
As soon as scope removed interrupts are posponed if needed.

This scope will be:
- used to allow inspector to interrupt and terminate
  DebugeEvaluate::Local,
- exposed with new flag on Isolate to implement SafeForTerminationScope
  in blink.

R=yangguo@chromium.org

Bug:  chromium:820640 
Change-Id: I15befc10c2cee393d1e3be48cecb31ee14dae638
Reviewed-on: https://chromium-review.googlesource.com/1022969
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52743}
[modify] https://crrev.com/d3f6c6479f2fb2f174d224e4546128e07f081cf8/src/execution.cc
[modify] https://crrev.com/d3f6c6479f2fb2f174d224e4546128e07f081cf8/src/execution.h
[modify] https://crrev.com/d3f6c6479f2fb2f174d224e4546128e07f081cf8/src/isolate.cc
[modify] https://crrev.com/d3f6c6479f2fb2f174d224e4546128e07f081cf8/src/isolate.h
[modify] https://crrev.com/d3f6c6479f2fb2f174d224e4546128e07f081cf8/test/cctest/test-thread-termination.cc

Project Member

Comment 10 by bugdroid1@chromium.org, Apr 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/e81b0db78744b8d3b8cd35af160280e82bb74d35

commit e81b0db78744b8d3b8cd35af160280e82bb74d35
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Wed Apr 25 18:11:58 2018

[runtime] added v8::Isolate::SafeForTerminationScope and isolate flag

When only_terminate_in_safe_scope flag is passed as CreateParams for
v8::Isolate, V8 does not trigger intrruption for termination if there
is no explicit SafeForTerminationeScope.
Scope enables termination only in direct v8 calls, any recursive calls
require explicit SafeForTerminationScope.

R=yangguo@chromium.org

Bug:  chromium:820640 
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Iac17e30a4b47aa84e70e9218ca0adca9d07f726e
Reviewed-on: https://chromium-review.googlesource.com/1025390
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52793}
[modify] https://crrev.com/e81b0db78744b8d3b8cd35af160280e82bb74d35/include/v8.h
[modify] https://crrev.com/e81b0db78744b8d3b8cd35af160280e82bb74d35/src/api.cc
[modify] https://crrev.com/e81b0db78744b8d3b8cd35af160280e82bb74d35/src/isolate.h
[modify] https://crrev.com/e81b0db78744b8d3b8cd35af160280e82bb74d35/test/cctest/test-thread-termination.cc

Project Member

Comment 11 by bugdroid1@chromium.org, May 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8d0f1f7aa1dd3f8cc4eb3bfe2c6a2deeb30fa2b1

commit 8d0f1f7aa1dd3f8cc4eb3bfe2c6a2deeb30fa2b1
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Tue May 01 18:04:15 2018

[DevTools] improve safety of Runtime.terminateExecution

Migrated blink to v8::Isolate::SafeForTerminationScope and add this
scope inside V8ScriptRunner methods since callsites should be ready
for termination.

This scope allows termination inside direct API calls and forbid it by
default inside any recursive call.

After this CL terminateExecution should be pretty safe and ready for
use.

Yang's original proposal: https://bit.ly/2K8KGgG

R=haraken@chromium.org,yangguo@chromium.org,jochen@chromium.org

Bug:  chromium:820640 
Change-Id: I28fa60cab05718194ff9377751188c66cf15e04b
Reviewed-on: https://chromium-review.googlesource.com/1026166
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555111}
[modify] https://crrev.com/8d0f1f7aa1dd3f8cc4eb3bfe2c6a2deeb30fa2b1/gin/isolate_holder.cc
[modify] https://crrev.com/8d0f1f7aa1dd3f8cc4eb3bfe2c6a2deeb30fa2b1/net/proxy_resolution/proxy_resolver_v8.cc
[modify] https://crrev.com/8d0f1f7aa1dd3f8cc4eb3bfe2c6a2deeb30fa2b1/third_party/blink/renderer/bindings/core/v8/v8_script_runner.cc
[modify] https://crrev.com/8d0f1f7aa1dd3f8cc4eb3bfe2c6a2deeb30fa2b1/third_party/blink/renderer/bindings/core/v8/v8_script_runner.h

Comment 12 by kozy@chromium.org, May 2 2018

Status: Fixed (was: Assigned)
Should be ready for use.

Sign in to add a comment