Commit e77672d2 authored by Mugdha Lakhani's avatar Mugdha Lakhani Committed by Commit Bot

[Background Fetch] Add back ScriptState::Scope

to DispatchBackgroundFetchedEvent.

Creation of the scope modifies V8 state, and associates scriptstate with
v8::Context. This helps in the using script state when it's needed later.

TBR=haraken@chromium.org

Bug: 836787
Change-Id: I7d0c2cb445d74f85d918d0435e6dac2511365ee6
Reviewed-on: https://chromium-review.googlesource.com/1027836
Commit-Queue: Anita Woodruff <awdf@chromium.org>
Reviewed-by: default avatarAnita Woodruff <awdf@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553564}
parent 48d065f6
...@@ -212,6 +212,9 @@ void ServiceWorkerGlobalScopeProxy::DispatchBackgroundFetchedEvent( ...@@ -212,6 +212,9 @@ void ServiceWorkerGlobalScopeProxy::DispatchBackgroundFetchedEvent(
ScriptState* script_state = ScriptState* script_state =
WorkerGlobalScope()->ScriptController()->GetScriptState(); WorkerGlobalScope()->ScriptController()->GetScriptState();
// Do not remove this, it modifies V8 state.
ScriptState::Scope scope(script_state);
BackgroundFetchSettledEventInit init; BackgroundFetchSettledEventInit init;
init.setId(developer_id); init.setId(developer_id);
init.setFetches(BackgroundFetchSettledFetches::Create(script_state, fetches)); init.setFetches(BackgroundFetchSettledFetches::Create(script_state, fetches));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment