Skip to content

Commit

Permalink
Create ScriptState::Scope in SetCurrentTimeAsStartTime()
Browse files Browse the repository at this point in the history
Fixes crashes from ChromeOS LKGM and uprev:

2023-12-05T01:55:19.934369Z FATAL chrome[3861:1]: [v8_initializer.cc(784)] V8 error: Cannot create a handle without a HandleScope (v8::HandleScope::CreateHandle()).
#0 0x58368e9b9372 base::debug::CollectStackTrace()
#1 0x58368e99e243 base::debug::StackTrace::StackTrace()
#2 0x583687fa98c8 logging::LogMessage::~LogMessage()
#3 0x58369371ae51 blink::ReportV8FatalError()
#4 0x5836898c46b8 v8::Utils::ReportApiFailure()
#5 0x583697d32136 v8::internal::HandleScope::Extend()
#6 0x583697944118 v8::HandleScope::CreateHandle()
#7 0x5836946bd75c blink::SoftNavigationHeuristics::SetCurrentTimeAsStartTime()
#8 0x5836946be3d0 blink::SoftNavigationEventScope::~SoftNavigationEventScope()
#9 0x583697fb0441 blink::EventDispatcher::Dispatch()
#10 0x583693d5380c blink::MouseEvent::DispatchEvent()


Bug: 1507981
Change-Id: I4106e037bc08c81ede1f2d497b9f993991fb9e47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5087067
Reviewed-by: Yoav Weiss <[email protected]>
Commit-Queue: Yoav Weiss <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1233189}
Joel Hockey committed Dec 5, 2023
1 parent fd91981 commit 596e494
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
@@ -409,6 +409,7 @@ void SoftNavigationHeuristics::SetCurrentTimeAsStartTime(
data->user_interaction_timestamp = base::TimeTicks::Now();
}
if (soft_navigation_conditions_met_ && paint_conditions_met_) {
ScriptState::Scope scope(script_state);
LocalFrame* frame = ToLocalFrameIfNotDetached(script_state->GetContext());
if (frame && frame->IsOutermostMainFrame()) {
EmitSoftNavigationEntry(frame);

0 comments on commit 596e494

Please sign in to comment.