Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Issue 272243004: HTML Imports: Fix race conditions on HTMLImportsChild (Closed)

Created:
6 years, 7 months ago by Hajime Morrita
Modified:
6 years, 7 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, webcomponents-bugzilla_chromium.org, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, rwlbuis
Visibility:
Public.

Description

HTML Imports: Fix race conditions on HTMLImportsChild There are two race conditions in HTMLImportChild. 1. ensureLoader() is called in stateDidChange(), which is triggered via a timer. That means there is a timing in which m_customElementMicrotaskStep isn't created but accompanying <link rel=import> is in tree. This allows some microtask can slip away from the blocking import. 2. HTMLImport::isDone() can return true when m_customElementMicrotaskStep is YET to be created, that can happen the call on ensureLoader(). This change covers these two cases. It also fixes a trivial flakiness in import-custom-element-dup-resolve.html TEST=import-custom-element-dup-resolve.html R=dglazkov@chromium.org, dominicc@chromium.org BUG=371654 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173794

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -3 lines) Patch
M LayoutTests/fast/html/imports/import-custom-element-dup-resolve.html View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/custom/CustomElementMicrotaskImportStep.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/custom/CustomElementMicrotaskImportStep.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/dom/custom/CustomElementMicrotaskQueue.h View 1 chunk +1 line, -0 lines 1 comment Download
M Source/core/dom/custom/CustomElementMicrotaskQueue.cpp View 1 chunk +10 lines, -0 lines 1 comment Download
M Source/core/dom/custom/CustomElementMicrotaskResolutionStep.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/custom/CustomElementMicrotaskResolutionStep.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/dom/custom/CustomElementMicrotaskStep.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/imports/HTMLImportChild.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Hajime Morrita
Dimitri, could you rubberstamp this? I want to have this before branch :-/
6 years, 7 months ago (2014-05-09 21:30:33 UTC) #1
dglazkov
rslgtm.
6 years, 7 months ago (2014-05-09 21:51:26 UTC) #2
Hajime Morrita
The CQ bit was checked by morrita@chromium.org
6 years, 7 months ago (2014-05-09 21:59:43 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/morrita@chromium.org/272243004/1
6 years, 7 months ago (2014-05-09 22:00:37 UTC) #4
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-09 22:48:01 UTC) #5
commit-bot: I haz the power
Change committed as 173794
6 years, 7 months ago (2014-05-10 00:14:00 UTC) #6
dominicc (has gone to gerrit)
https://codereview.chromium.org/272243004/diff/1/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp File Source/core/dom/custom/CustomElementMicrotaskQueue.cpp (right): https://codereview.chromium.org/272243004/diff/1/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp#newcode106 Source/core/dom/custom/CustomElementMicrotaskQueue.cpp:106: bool CustomElementMicrotaskQueue::needsProcessOrStop() const I think the complexity of Imports ...
6 years, 7 months ago (2014-05-12 00:42:18 UTC) #7
Hajime Morrita
6 years, 7 months ago (2014-05-14 00:24:55 UTC) #8
Message was sent while issue was closed.
On 2014/05/12 00:42:18, dominicc wrote:
>
https://codereview.chromium.org/272243004/diff/1/Source/core/dom/custom/Custo...
> File Source/core/dom/custom/CustomElementMicrotaskQueue.cpp (right):
> 
>
https://codereview.chromium.org/272243004/diff/1/Source/core/dom/custom/Custo...
> Source/core/dom/custom/CustomElementMicrotaskQueue.cpp:106: bool
> CustomElementMicrotaskQueue::needsProcessOrStop() const
> I think the complexity of Imports has degraded this a bit... I think you
should
> try moving this back to imports (it resembles a lot of Imports code and is
only
> triggered by imports) and slay the complexity dragon there.
> 
>
https://codereview.chromium.org/272243004/diff/1/Source/core/dom/custom/Custo...
> File Source/core/dom/custom/CustomElementMicrotaskQueue.h (right):
> 
>
https://codereview.chromium.org/272243004/diff/1/Source/core/dom/custom/Custo...
> Source/core/dom/custom/CustomElementMicrotaskQueue.h:55: bool
> needsProcessOrStop() const;
> What is this? Why do imports leak into this abstraction?

This is fair point. I tried to keep the responsibility inside imports side but
failed is this first cut.
Let me think more.

Powered by Google App Engine
This is Rietveld 408576698