Reland "Introduce ScriptEvaluationResult"
This reverts commit 44541a20. Reason for revert: The bot failure should be fixed by fixing a DCHECK() in worker_or_worklet_script_controller.cc that contained side effects. (crbug.com/1132893) Original change's description: > Revert "Introduce ScriptEvaluationResult" > > This reverts commit 3a4677f6. > > Reason for revert: bot failures due to crash at blink::AnimationWorkletGlobalScopeTest::RunScriptAndGetBoolean() > see https://crbug.com/chromium/1132893 > > Original change's description: > > Introduce ScriptEvaluationResult > > > > This CL introduces ScriptEvaluationResult with clearer uniform > > semantics that covers both classic and module script evaluation. > > ScriptEvaluationResult has ResultType enum class, to explicitly > > distinguish cases where normal exceptions are thrown (kException) > > from cases where not (kNotRun and kAborted). > > > > This CL merges ClassicEvaluationResult and ModuleEvaluationResult > > into ScriptEvaluationResult. > > > > This maps: > > - ClassicEvaluationResult::IsEmpty() > > => ScriptEvaluationResult::GetResultType() != kSuccess > > - ModuleEvaluationResult::IsSuccess() / IsException() > > => ScriptEvaluationResult::GetResultType() == kSuccess / != kSuccess > > > > To keep the invariant of kSuccess <=> non-empty v8::Value, > > this CL makes ModuleRecord::Evaluate() to return > > ScriptEvaluationResult with a non-empty value > > on successful evaluation + top-level await is not enabled, > > while previously it returned ModuleEvaluationResult::Empty(). > > This value is not used, and thus this change doesn't change > > the behavior. > > > > Bug: 1111134, 1129743 > > Change-Id: I350860171a3c3b63517641dfb9555b8788386438 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2417789 > > Reviewed-by: Kouhei Ueno <kouhei@chromium.org> > > Reviewed-by: Kentaro Hara <haraken@chromium.org> > > Reviewed-by: Yuki Shiino <yukishiino@chromium.org> > > Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> > > Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org> > > Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> > > Cr-Commit-Position: refs/heads/master@{#811244} > > TBR=yukishiino@chromium.org,bashi@chromium.org,haraken@chromium.org,hiroshige@chromium.org,kouhei@chromium.org,nhiroki@chromium.org,cbruni@chromium.org,dom@chromium.org > > Change-Id: Iaaca1345213b1f3e4fc8ec703257217998ec0826 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 1111134 > Bug: 1129743 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435918 > Reviewed-by: Gayane Petrosyan <gayane@chromium.org> > Commit-Queue: Gayane Petrosyan <gayane@chromium.org> > Cr-Commit-Position: refs/heads/master@{#811258} TBR=yukishiino@chromium.org,bashi@chromium.org,haraken@chromium.org,hiroshige@chromium.org,kouhei@chromium.org,nhiroki@chromium.org,gayane@chromium.org,cbruni@chromium.org,dom@chromium.org # Not skipping CQ checks because this is a reland. Bug: 1111134 Bug: 1129743 Bug: 1132893 Change-Id: I494cf7b5c1d55b65d9bd4552f1ed2d9b05ffae1b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438073Reviewed-by:Yuki Shiino <yukishiino@chromium.org> Reviewed-by:
Kouhei Ueno <kouhei@chromium.org> Reviewed-by:
Kentaro Hara <haraken@chromium.org> Reviewed-by:
Hiroshige Hayashizaki <hiroshige@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#811690}
Showing
Please register or sign in to comment