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

Issue 669503003: Revert of Refactor Script(Loader|Runner): don't access Resources all over the place... (Closed)

Created:
6 years, 2 months ago by dstockwell
Modified:
6 years, 2 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, oilpan-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Revert of Refactor Script(Loader|Runner): don't access Resources all over the place... (patchset #5 id:80001 of https://codereview.chromium.org/656113002/) Reason for revert: Introduced leaks in the following tests: fast/dom/HTMLScriptElement/append-child-adopt-node-error-crash.html fast/dom/HTMLScriptElement/script-async-attr.html fast/dom/HTMLScriptElement/script-load-events.html fast/dom/URL-attribute-reflection.html fast/events/onerror-bubbling.html http/tests/cache/loaded-from-cache-after-reload.html http/tests/cache/subresource-expiration-2.html http/tests/cache/subresource-multiple-instances.html http/tests/htmlimports/import-script-block-crossorigin-dynamic.html http/tests/loading/script-priorities.html Original issue's description: > Refactor Script(Loader|Runner): don't access Resources all over the place... > > ... but use proper layering instead. > > PendingScript holds a Resource, and many places in the code are using both the > PendingScript and the underlying Resource. For example, ScriptRunner holds a > collection of PendingScripts, and ScriptLoaders then listen to the underlying > Resources. This is confusing and error prone. > > The Resource - ScriptLoader - PendingScript - Element love quadrangle is messy > in general. Both ScriptLoader and PendingScript refer to the Resource. The way > to get ScriptLoader from PendingScript is via Element which PendingScript also > holds. But there's no way to get PendingScript from ScriptLoader. > > This CL makes ScriptRunner access the ScriptLoaders directly and moves the > PendingScript to ScriptLoader. In addition, it makes ScriptRunner not access the > Resource of the ScriptLoader directly. > > This CL also cancels the hack from https://bugs.webkit.org/show_bug.cgi?id=92211 > (r139942) where it was speculated that a crash can be caused by ScriptLoader > getting the notifyFinished notification twice because it doesn't unsubscribe yet > when it gets the first one. The speculative fix was to made it nullify > ScriptLoader::m_resource and check for the nullity later. This is pretty > surprising, since the obvious solution would've been to just unsubscribe early > enough (which is done by this CL). > > Note a behavioral change: It's OK to call Resource::addClient even if the > Resource is finished, and in that case, the client will be notified > immediately. But PendingScript used to ASSERT that the Resource is not > finished. This CL removes that restriction (the underlying Resource already > handles adding clients to finished resources + made ScriptStreamer handle it > too). > > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183873 TBR=jochen@chromium.org,haraken@chromium.org,morrita@chromium.org,sigbjornf@opera.com,marja@chromium.org NOTREECHECKS=true NOTRY=true Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183952

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -50 lines) Patch
M Source/bindings/core/v8/ScriptStreamer.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/PendingScript.cpp View 1 chunk +4 lines, -3 lines 0 comments Download
M Source/core/dom/ScriptLoader.h View 5 chunks +2 lines, -6 lines 0 comments Download
M Source/core/dom/ScriptLoader.cpp View 5 chunks +27 lines, -20 lines 0 comments Download
M Source/core/dom/ScriptRunner.h View 3 chunks +8 lines, -5 lines 0 comments Download
M Source/core/dom/ScriptRunner.cpp View 5 chunks +22 lines, -15 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
dstockwell
Created Revert of Refactor Script(Loader|Runner): don't access Resources all over the place...
6 years, 2 months ago (2014-10-19 23:19:16 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/669503003/1
6 years, 2 months ago (2014-10-19 23:19:45 UTC) #2
commit-bot: I haz the power
Committed patchset #1 (id:1) as 183952
6 years, 2 months ago (2014-10-19 23:20:35 UTC) #3
haraken
6 years, 2 months ago (2014-10-19 23:32:14 UTC) #4
Message was sent while issue was closed.
LGTM

Powered by Google App Engine
This is Rietveld 408576698