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

Issue 1035803002: Remove ResourceFetcher's access to a real FetchContext at frame detach time (Closed)

Created:
5 years, 9 months ago by Nate Chapin
Modified:
5 years, 8 months ago
Reviewers:
haraken, falken, sof, Mike West
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, dglazkov+blink, eae+blinkwatch, gavinp+loader_chromium.org, oilpan-reviews, rwlbuis, tyoshino+watch_chromium.org, webcomponents-bugzilla_chromium.org, dcheng
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Remove ResourceFetcher's access to a real FetchContext at frame detach time This allows us to remove a whole bunch of frame() null-checks in FrameFetchContext. BUG=458222 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193208

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address coments #

Total comments: 6

Patch Set 3 : Fix crash #

Patch Set 4 : Moved ASSERT(!m_importsController) to #if !ENABLE(OILPAN) block #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -108 lines) Patch
M Source/core/dom/Document.cpp View 1 2 3 7 chunks +22 lines, -17 lines 0 comments Download
M Source/core/fetch/FetchContext.h View 1 chunk +3 lines, -4 lines 0 comments Download
M Source/core/fetch/FetchContext.cpp View 1 chunk +6 lines, -0 lines 0 comments Download
M Source/core/fetch/ImageResourceTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/ResourceFetcher.h View 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/fetch/ResourceFetcherTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/imports/HTMLImportLoader.cpp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/html/imports/LinkImport.cpp View 1 1 chunk +1 line, -3 lines 0 comments Download
M Source/core/loader/DocumentLoader.cpp View 2 chunks +1 line, -1 line 0 comments Download
M Source/core/loader/FrameFetchContext.h View 1 1 chunk +8 lines, -3 lines 0 comments Download
M Source/core/loader/FrameFetchContext.cpp View 1 22 chunks +18 lines, -71 lines 0 comments Download
M Source/core/loader/FrameFetchContextTest.cpp View 4 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 31 (5 generated)
Nate Chapin
This is yet another attempt to land https://codereview.chromium.org/1024263002/ The differences from https://codereview.chromium.org/1024263002/ are in Document::detach ...
5 years, 9 months ago (2015-03-25 19:32:19 UTC) #2
Mike West
https://codereview.chromium.org/1035803002/diff/1/Source/core/html/imports/LinkImport.cpp File Source/core/html/imports/LinkImport.cpp (right): https://codereview.chromium.org/1035803002/diff/1/Source/core/html/imports/LinkImport.cpp#newcode131 Source/core/html/imports/LinkImport.cpp:131: return m_owner && m_child && m_child->isDone() && !m_child->loader()->hasError(); Why ...
5 years, 9 months ago (2015-03-26 04:43:14 UTC) #3
sof
https://codereview.chromium.org/1035803002/diff/1/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1035803002/diff/1/Source/core/dom/Document.cpp#newcode618 Source/core/dom/Document.cpp:618: if (m_importsController) The lack of this sync removal (and ...
5 years, 9 months ago (2015-03-26 08:23:30 UTC) #4
sof
On 2015/03/26 08:23:30, sof wrote: > https://codereview.chromium.org/1035803002/diff/1/Source/core/dom/Document.cpp > File Source/core/dom/Document.cpp (right): > > https://codereview.chromium.org/1035803002/diff/1/Source/core/dom/Document.cpp#newcode618 > ...
5 years, 9 months ago (2015-03-26 09:27:38 UTC) #5
Nate Chapin
On 2015/03/26 04:43:14, Mike West wrote: > https://codereview.chromium.org/1035803002/diff/1/Source/core/html/imports/LinkImport.cpp > File Source/core/html/imports/LinkImport.cpp (right): > > https://codereview.chromium.org/1035803002/diff/1/Source/core/html/imports/LinkImport.cpp#newcode131 ...
5 years, 9 months ago (2015-03-26 22:14:03 UTC) #6
Nate Chapin
On 2015/03/26 09:27:38, sof wrote: > On 2015/03/26 08:23:30, sof wrote: > > https://codereview.chromium.org/1035803002/diff/1/Source/core/dom/Document.cpp > ...
5 years, 9 months ago (2015-03-26 22:14:27 UTC) #7
sof
On 2015/03/26 22:14:27, Nate Chapin wrote: > On 2015/03/26 09:27:38, sof wrote: > > On ...
5 years, 9 months ago (2015-03-26 22:26:05 UTC) #8
haraken
https://codereview.chromium.org/1035803002/diff/1/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1035803002/diff/1/Source/core/dom/Document.cpp#newcode2147 Source/core/dom/Document.cpp:2147: else if (m_importsController) Why is this 'else if', not ...
5 years, 9 months ago (2015-03-27 11:01:33 UTC) #10
Mike West
On 2015/03/26 at 22:14:03, japhet wrote: > On 2015/03/26 04:43:14, Mike West wrote: > > ...
5 years, 9 months ago (2015-03-27 11:14:44 UTC) #11
sof
On 2015/03/27 11:14:44, Mike West wrote: > On 2015/03/26 at 22:14:03, japhet wrote: > > ...
5 years, 9 months ago (2015-03-27 13:21:11 UTC) #12
Nate Chapin
On 2015/03/27 13:21:11, sof wrote: > On 2015/03/27 11:14:44, Mike West wrote: > > On ...
5 years, 8 months ago (2015-04-01 19:37:21 UTC) #13
sof
On 2015/04/01 19:37:21, Nate Chapin wrote: > On 2015/03/27 13:21:11, sof wrote: > > On ...
5 years, 8 months ago (2015-04-01 20:30:34 UTC) #14
Nate Chapin
How's this look, Sigbjorn? https://codereview.chromium.org/1035803002/diff/1/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1035803002/diff/1/Source/core/dom/Document.cpp#newcode2147 Source/core/dom/Document.cpp:2147: else if (m_importsController) On 2015/03/27 ...
5 years, 8 months ago (2015-04-02 20:22:06 UTC) #15
sof
https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Document.cpp#newcode532 Source/core/dom/Document.cpp:532: ASSERT(!m_importsController); Could you move this into the !ENABLE(OILPAN) section? ...
5 years, 8 months ago (2015-04-03 14:24:02 UTC) #16
Nate Chapin
https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Document.cpp#newcode532 Source/core/dom/Document.cpp:532: ASSERT(!m_importsController); On 2015/04/03 14:24:01, sof wrote: > Could you ...
5 years, 8 months ago (2015-04-03 23:01:09 UTC) #17
sof
https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Document.cpp#newcode532 Source/core/dom/Document.cpp:532: ASSERT(!m_importsController); On 2015/04/03 23:01:09, Nate Chapin wrote: > On ...
5 years, 8 months ago (2015-04-04 06:42:15 UTC) #18
Nate Chapin
On 2015/04/04 06:42:15, sof wrote: > https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Document.cpp > File Source/core/dom/Document.cpp (right): > > https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Document.cpp#newcode532 > ...
5 years, 8 months ago (2015-04-06 17:39:19 UTC) #19
sof
lgtm
5 years, 8 months ago (2015-04-06 17:49:59 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1035803002/60001
5 years, 8 months ago (2015-04-06 18:11:12 UTC) #23
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://src.chromium.org/viewvc/blink?view=rev&revision=193208
5 years, 8 months ago (2015-04-06 19:39:54 UTC) #24
dcheng
On 2015/04/06 at 17:39:19, japhet wrote: > On 2015/04/04 06:42:15, sof wrote: > > https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Document.cpp ...
5 years, 8 months ago (2015-04-06 22:14:26 UTC) #25
falken
I think this might be causing assert failures on imported/web-platform-tests/custom-elements/creating-and-passing-registries/share-registry-import-document.html http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=imported%2Fweb-platform-tests%2Fcustom-elements%2Fcreating-and-passing-registries%2Fshare-registry-import-document.html
5 years, 8 months ago (2015-04-07 00:45:59 UTC) #27
falken
A revert of this CL (patchset #4 id:60001) has been created in https://codereview.chromium.org/1063913002/ by falken@chromium.org. ...
5 years, 8 months ago (2015-04-07 01:03:20 UTC) #28
sof
On 2015/04/06 22:14:26, dcheng wrote: > On 2015/04/06 at 17:39:19, japhet wrote: > > On ...
5 years, 8 months ago (2015-04-07 07:11:19 UTC) #29
sof
On 2015/04/07 07:11:19, sof wrote: > On 2015/04/06 22:14:26, dcheng wrote: > > On 2015/04/06 ...
5 years, 8 months ago (2015-04-07 13:11:42 UTC) #30
sof
5 years, 8 months ago (2015-04-07 19:06:39 UTC) #31
Message was sent while issue was closed.
On 2015/04/07 13:11:42, sof wrote:
> On 2015/04/07 07:11:19, sof wrote:
> > On 2015/04/06 22:14:26, dcheng wrote:
> > > On 2015/04/06 at 17:39:19, japhet wrote:
> > > > On 2015/04/04 06:42:15, sof wrote:
> > > > >
> > >
> >
>
https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Documen...
> > > > > File Source/core/dom/Document.cpp (right):
> > > > > 
> > > > >
> > >
> >
>
https://codereview.chromium.org/1035803002/diff/20001/Source/core/dom/Documen...
> > > > > Source/core/dom/Document.cpp:532: ASSERT(!m_importsController);
> > > > > On 2015/04/03 23:01:09, Nate Chapin wrote:
> > > > > > On 2015/04/03 14:24:01, sof wrote:
> > > > > > > Could you move this into the !ENABLE(OILPAN) section? We cannot
> > > guarantee
> > > > > that
> > > > > > > it has been cleared with oilpan.
> > > > > > 
> > > > > > Doesn't HTMLImportsController::removeFrom() call
> > > > > > Document::setImportsController(nullptr)?
> > > > > > 
> > > > > 
> > > > > It does. But as stated previously, we cannot assume that
> > Document::detach()
> > > has
> > > > > run with Oilpan.
> > > > 
> > > > Aaaah, sorry. I had realized that dispose() wasn't guaranteed to be
called
> > > with Oilpan, but I had apparently missed that detach() also wasn't
> guaranteed.
> > > Updated with assert in #if !ENABLE(OILPAN) block.
> > > 
> > > What is the case where Document::detach() won't get called with Oilpan?
> > 
> > That was the assumption when moving frames to the Oilpan heap, that it
> wouldn't
> > be, but be implicitly cleared on the next GC (as the frame references were
> weak)
> > or the objects would die at the same time (=> no detach was run.)
> > 
> > However, we've moved away from that arrangement since then, making Oilpan vs
> not
> > lifetimes be equal wrt frame handling/lifecycles, where possible. So, let me
> > recheck status.
> 
> Frame detach will happen with & without Oilpan --
> 
>   - ~HTMLFrameOwnerElement assumes that its frame has been cleared.
>   - ~LocalFrame asserts that detach has happened (by checking that the
FrameView
> has been cleared).
> 
> By clearing the FrameView, Document::prepareForDestruction() will most likely
be
> invoked (if not, there are other code paths achieving same during frame
detach.)
> Hence, Document::detach() will be called with and without Oilpan.
> 
> So, my assumption that detach() isn't guaranteed with Oilpan doesn't hold,
hence
> the placement of the assert in this CL was correct as it was in ps#3. Sorry
> about the extra iteration that brought about..but good thing to have this
detail
> clarified. Thanks for the raising the question.

For those preferring experimental data,
https://codereview.chromium.org/1063013002/

Powered by Google App Engine
This is Rietveld 408576698