New issue
Advanced search Search tips

Issue 697651 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ScriptStreamer can notify its of completion client twice

Project Member Reported by jbroman@chromium.org, Mar 1 2017

Issue description

ScriptStreamer has a comment claiming that it won't notify its client twice of completion.

Unfortunately, this can happen with the following sequence of events:

- parsing completes on background thread (e.g. due to parse error)
- task is posted to main thread
- loading completes on main thread
- loading and parse are both complete, so work is finished -> client notified
- posted task runs
- loading and parse are both complete, so work is finished -> client notified

I think a reasonable fix is not to set the parsing complete thing until the task arrives. After I do that, all of the variables guarded by ScriptStreamer::m_mutex are accessed on the main thread only, so the mutex can also be removed.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 3 2017

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

commit 84609d29dbdaffc45415fc4b7ef6443096473d8b
Author: jbroman <jbroman@chromium.org>
Date: Fri Mar 03 12:52:14 2017

ScriptStreamer: make state variables main-thread-only.

After this CL, |m_parsingFinished| is not set to true until the task posted
back to the main thread runs. After that, all access to the boolean variables
commented as protected by |ScriptStreamer::m_mutex| seems to be on the main
thread, so the mutex is also removed.

BUG= 697651 

Review-Url: https://codereview.chromium.org/2724153002
Cr-Commit-Position: refs/heads/master@{#454568}

[modify] https://crrev.com/84609d29dbdaffc45415fc4b7ef6443096473d8b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
[modify] https://crrev.com/84609d29dbdaffc45415fc4b7ef6443096473d8b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h

Status: Fixed (was: Started)

Sign in to add a comment