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

Issue 262093006: Oilpan: Make the Node hierarchy RefCountedGarbageCollected instead of TreeShared. (Closed)

Created:
6 years, 7 months ago by Mads Ager (chromium)
Modified:
6 years, 7 months ago
CC:
blink-reviews, shans, webcomponents-bugzilla_chromium.org, eae+blinkwatch, fs, apavlov+blink_chromium.org, Steve Block, rune+blink, dino_apple.com, alancutter (OOO until 2018), Mike Lawther (Google), blink-reviews-css, blink-reviews-html_chromium.org, dglazkov+blink, blink-reviews-dom_chromium.org, Timothy Loh, pdr., rwlbuis, Eric Willigers, rjwright, sof, krit, gyuyoung.kim_webkit.org, darktears, dstockwell, chromiumbugtracker_adobe.com, kouhei+svg_chromium.org, blink-reviews-events_chromium.org, ed+blinkwatch_opera.com, f(malita), Stephen Chennney, kouhei+heap_chromium.org
Visibility:
Public.

Description

Oilpan: Make the Node hierarchy RefCountedGarbageCollected instead of TreeShared. The entire tree structure is now traced. If one node in the tree is alive the entire tree is kept alive. This makes the Node hierarchy independent of reference counts and it is therefore possible to use Members instead of RefPtrs to Nodes. This change is very likely to introduce new Oilpan leaks because any RefPtr from a Node to another Node in the same tree will leak the entire tree. Once this change lands we should eliminate RefPtrs to Nodes to avoid these leaks. BUG=357163 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173378

Patch Set 1 #

Total comments: 1

Patch Set 2 : Minor cleanup. #

Total comments: 21

Patch Set 3 : Address first round of comments. #

Patch Set 4 : Address more comments. #

Total comments: 70

Patch Set 5 : Address comments. #

Total comments: 2

Patch Set 6 : Address more comments. #

Patch Set 7 : Rebased #

Patch Set 8 : Fix non-oilpan build. #

Patch Set 9 : Another build fix. #

Total comments: 56
Unified diffs Side-by-side diffs Delta from patch set Stats (+433 lines, -265 lines) Patch
M LayoutTests/OilpanExpectations View 1 2 3 4 2 chunks +8 lines, -1 line 0 comments Download
M LayoutTests/fast/dom/document-softleak-mouse-navigation.html View 1 chunk +5 lines, -6 lines 0 comments Download
M LayoutTests/resources/leak-check.js View 2 chunks +25 lines, -23 lines 0 comments Download
M Source/core/css/resolver/ElementResolveContext.h View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/css/resolver/MatchRequest.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Attr.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/ContainerNode.h View 1 2 3 4 4 chunks +9 lines, -4 lines 0 comments Download
M Source/core/dom/ContainerNode.cpp View 1 2 3 4 8 chunks +21 lines, -6 lines 2 comments Download
M Source/core/dom/ContainerNodeAlgorithms.h View 1 2 3 4 5 chunks +2 lines, -27 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 11 chunks +19 lines, -18 lines 4 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 11 chunks +42 lines, -7 lines 2 comments Download
M Source/core/dom/DocumentStyleSheetCollector.h View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/DocumentStyleSheetCollector.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M Source/core/dom/ElementRareData.h View 1 chunk +10 lines, -0 lines 0 comments Download
M Source/core/dom/FullscreenElementStack.h View 2 chunks +5 lines, -5 lines 0 comments Download
M Source/core/dom/FullscreenElementStack.cpp View 4 chunks +14 lines, -6 lines 0 comments Download
M Source/core/dom/IdTargetObserver.h View 1 chunk +1 line, -0 lines 2 comments Download
M Source/core/dom/IdTargetObserver.cpp View 1 chunk +9 lines, -0 lines 0 comments Download
M Source/core/dom/Node.h View 4 chunks +10 lines, -8 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 5 chunks +5 lines, -11 lines 2 comments Download
M Source/core/dom/NodeRenderingTraversal.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/StyleEngine.h View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M Source/core/dom/StyleEngine.cpp View 1 2 3 4 5 6 7 8 19 chunks +32 lines, -33 lines 6 comments Download
M Source/core/dom/TreeScope.h View 1 2 3 4 3 chunks +7 lines, -4 lines 6 comments Download
M Source/core/dom/TreeScope.cpp View 1 2 3 4 7 chunks +11 lines, -7 lines 0 comments Download
M Source/core/dom/TreeShared.h View 3 chunks +0 lines, -38 lines 0 comments Download
M Source/core/dom/UserActionElementSet.h View 1 2 3 4 4 chunks +9 lines, -4 lines 0 comments Download
M Source/core/dom/UserActionElementSet.cpp View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M Source/core/dom/shadow/ElementShadow.h View 1 2 2 chunks +3 lines, -1 line 2 comments Download
M Source/core/dom/shadow/ElementShadow.cpp View 1 2 3 4 2 chunks +10 lines, -0 lines 2 comments Download
M Source/core/dom/shadow/ShadowRoot.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/shadow/ShadowRoot.cpp View 4 chunks +8 lines, -6 lines 0 comments Download
M Source/core/frame/DOMWindow.cpp View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/html/FormAssociatedElement.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/FormAssociatedElement.cpp View 4 chunks +12 lines, -5 lines 2 comments Download
M Source/core/html/HTMLFormControlElement.cpp View 1 2 3 4 2 chunks +2 lines, -0 lines 4 comments Download
M Source/core/html/HTMLInputElement.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 2 3 4 5 6 2 chunks +10 lines, -3 lines 0 comments Download
M Source/core/html/forms/TextFieldInputType.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/html/forms/ValidationMessage.cpp View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/imports/HTMLImportsController.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/page/EventHandler.cpp View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M Source/core/page/Page.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/plugins/PluginOcclusionSupport.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGAnimateElement.cpp View 1 2 3 4 5 6 4 chunks +8 lines, -0 lines 3 comments Download
M Source/core/svg/SVGAnimateMotionElement.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/svg/SVGElementInstance.h View 1 2 3 4 5 6 3 chunks +10 lines, -10 lines 8 comments Download
M Source/core/svg/SVGElementInstance.cpp View 1 2 3 4 5 6 4 chunks +22 lines, -8 lines 6 comments Download
M Source/core/svg/animation/SVGSMILElement.h View 2 chunks +3 lines, -1 line 0 comments Download
M Source/core/svg/animation/SVGSMILElement.cpp View 1 2 3 4 5 6 3 chunks +9 lines, -1 line 3 comments Download
M Source/core/svg/properties/SVGAnimatedProperty.cpp View 1 chunk +2 lines, -0 lines 2 comments Download
M Source/core/testing/LayerRect.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/platform/heap/Handle.h View 1 2 3 4 5 6 4 chunks +20 lines, -0 lines 0 comments Download
M Source/wtf/PassRefPtr.h View 1 2 3 4 5 6 7 2 chunks +20 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
Mads Ager (chromium)
This change is passing tests and I would like to get this landed ASAP and ...
6 years, 7 months ago (2014-05-05 10:18:35 UTC) #1
Mads Ager (chromium)
https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNodeAlgorithms.h File Source/core/dom/ContainerNodeAlgorithms.h (left): https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNodeAlgorithms.h#oldcode79 Source/core/dom/ContainerNodeAlgorithms.h:79: inline void removeDetachedChildrenInContainer(GenericNodeContainer& container) I had to move this ...
6 years, 7 months ago (2014-05-05 10:47:41 UTC) #2
zerny-chromium
lgtm with some minor comments/questions. https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNodeAlgorithms.h File Source/core/dom/ContainerNodeAlgorithms.h (right): https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNodeAlgorithms.h#newcode144 Source/core/dom/ContainerNodeAlgorithms.h:144: // Helper functions for ...
6 years, 7 months ago (2014-05-05 11:07:52 UTC) #3
sof
https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/shadow/ElementShadow.cpp File Source/core/dom/shadow/ElementShadow.cpp (right): https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/shadow/ElementShadow.cpp#newcode357 Source/core/dom/shadow/ElementShadow.cpp:357: visitor->mark(m_shadowRoots.head()); nit: you prefer to use mark() on raw ...
6 years, 7 months ago (2014-05-05 11:27:47 UTC) #4
Erik Corry
https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNode.cpp File Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNode.cpp#newcode83 Source/core/dom/ContainerNode.cpp:83: removeDetachedChildrenInContainer<Node, ContainerNode>(*this); This doesn't need to be called in ...
6 years, 7 months ago (2014-05-05 11:35:47 UTC) #5
Mads Ager (chromium)
https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNodeAlgorithms.h File Source/core/dom/ContainerNodeAlgorithms.h (right): https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNodeAlgorithms.h#newcode144 Source/core/dom/ContainerNodeAlgorithms.h:144: // Helper functions for TreeShared-derived classes, which have a ...
6 years, 7 months ago (2014-05-05 11:35:53 UTC) #6
Mads Ager (chromium)
https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNode.cpp File Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/262093006/diff/20001/Source/core/dom/ContainerNode.cpp#newcode83 Source/core/dom/ContainerNode.cpp:83: removeDetachedChildrenInContainer<Node, ContainerNode>(*this); On 2014/05/05 11:35:48, Erik Corry wrote: > ...
6 years, 7 months ago (2014-05-05 11:49:16 UTC) #7
sof
lgtm to try
6 years, 7 months ago (2014-05-05 12:11:49 UTC) #8
Erik Corry
https://codereview.chromium.org/262093006/diff/60001/Source/core/dom/StyleEngine.h File Source/core/dom/StyleEngine.h (right): https://codereview.chromium.org/262093006/diff/60001/Source/core/dom/StyleEngine.h#newcode215 Source/core/dom/StyleEngine.h:215: Document& m_document; This doesn't keep the document alive?
6 years, 7 months ago (2014-05-05 12:47:00 UTC) #9
Mads Ager (chromium)
https://codereview.chromium.org/262093006/diff/60001/Source/core/dom/StyleEngine.h File Source/core/dom/StyleEngine.h (right): https://codereview.chromium.org/262093006/diff/60001/Source/core/dom/StyleEngine.h#newcode215 Source/core/dom/StyleEngine.h:215: Document& m_document; On 2014/05/05 12:47:01, Erik Corry wrote: > ...
6 years, 7 months ago (2014-05-05 12:52:38 UTC) #10
Mads Ager (chromium)
On 2014/05/05 12:52:38, Mads Ager (chromium) wrote: > https://codereview.chromium.org/262093006/diff/60001/Source/core/dom/StyleEngine.h > File Source/core/dom/StyleEngine.h (right): > > ...
6 years, 7 months ago (2014-05-05 12:54:55 UTC) #11
Mads Ager (chromium)
https://codereview.chromium.org/262093006/diff/60001/Source/core/dom/StyleEngine.cpp File Source/core/dom/StyleEngine.cpp (right): https://codereview.chromium.org/262093006/diff/60001/Source/core/dom/StyleEngine.cpp#newcode93 Source/core/dom/StyleEngine.cpp:93: m_fontSelector->clearDocument(); Erik points out that removing this is probably ...
6 years, 7 months ago (2014-05-05 13:06:39 UTC) #12
haraken
Let me take a close look tomorrow morning.
6 years, 7 months ago (2014-05-05 16:57:22 UTC) #13
haraken
I'm sorry for a lot of clarifying questions -- I'd be happy if you could ...
6 years, 7 months ago (2014-05-06 04:20:15 UTC) #14
Mads Ager (chromium)
Thanks for your comments Haraken. Please do have another look and give more comments. I ...
6 years, 7 months ago (2014-05-06 08:25:59 UTC) #15
Erik Corry
https://codereview.chromium.org/262093006/diff/60001/Source/core/dom/StyleEngine.cpp File Source/core/dom/StyleEngine.cpp (right): https://codereview.chromium.org/262093006/diff/60001/Source/core/dom/StyleEngine.cpp#newcode93 Source/core/dom/StyleEngine.cpp:93: m_fontSelector->clearDocument(); As discussed offline this is still needed somehow. ...
6 years, 7 months ago (2014-05-06 08:29:39 UTC) #16
Erik Corry
LGTM, let's land this https://codereview.chromium.org/262093006/diff/70001/Source/core/page/EventHandler.cpp File Source/core/page/EventHandler.cpp (right): https://codereview.chromium.org/262093006/diff/70001/Source/core/page/EventHandler.cpp#newcode2356 Source/core/page/EventHandler.cpp:2356: #if !ENABLE(OILPAN) Maybe just remove ...
6 years, 7 months ago (2014-05-06 09:02:24 UTC) #17
haraken
> Please do have another look and give more comments. I am going to go ...
6 years, 7 months ago (2014-05-06 09:02:30 UTC) #18
Mads Ager (chromium)
https://codereview.chromium.org/262093006/diff/60001/Source/core/html/forms/TextFieldInputType.cpp File Source/core/html/forms/TextFieldInputType.cpp (right): https://codereview.chromium.org/262093006/diff/60001/Source/core/html/forms/TextFieldInputType.cpp#newcode120 Source/core/html/forms/TextFieldInputType.cpp:120: spinButton->removeSpinButtonOwner(); On 2014/05/06 08:29:40, Erik Corry wrote: > m_spinButtonOwner ...
6 years, 7 months ago (2014-05-06 09:16:50 UTC) #19
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 7 months ago (2014-05-06 09:27:48 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/262093006/110001
6 years, 7 months ago (2014-05-06 09:28:09 UTC) #21
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 7 months ago (2014-05-06 10:03:23 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/262093006/130001
6 years, 7 months ago (2014-05-06 10:03:43 UTC) #23
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 7 months ago (2014-05-06 10:27:12 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/262093006/150001
6 years, 7 months ago (2014-05-06 10:27:24 UTC) #25
commit-bot: I haz the power
Change committed as 173378
6 years, 7 months ago (2014-05-06 11:37:55 UTC) #26
haraken
LGTM with comments. Most of the below comments are minor and the CL looks fine ...
6 years, 7 months ago (2014-05-06 15:59:40 UTC) #27
Mads Ager (chromium)
On 2014/05/06 15:59:40, haraken wrote: > LGTM with comments. Most of the below comments are ...
6 years, 7 months ago (2014-05-06 17:07:27 UTC) #28
tkent
https://codereview.chromium.org/262093006/diff/150001/Source/core/dom/ContainerNode.cpp File Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/262093006/diff/150001/Source/core/dom/ContainerNode.cpp#newcode489 Source/core/dom/ContainerNode.cpp:489: if (m_firstChild == &oldChild) We should add operator==(const Member<Node>, ...
6 years, 7 months ago (2014-05-07 00:41:18 UTC) #29
kouhei (in TOK)
svg/ reviewed. https://codereview.chromium.org/262093006/diff/150001/Source/core/svg/SVGAnimateElement.cpp File Source/core/svg/SVGAnimateElement.cpp (right): https://codereview.chromium.org/262093006/diff/150001/Source/core/svg/SVGAnimateElement.cpp#newcode54 Source/core/svg/SVGAnimateElement.cpp:54: clearAnimatedType(targetElement()); On 2014/05/06 15:59:42, haraken wrote: > ...
6 years, 7 months ago (2014-05-07 01:43:12 UTC) #30
kouhei (in TOK)
https://codereview.chromium.org/262093006/diff/150001/Source/core/svg/properties/SVGAnimatedProperty.cpp File Source/core/svg/properties/SVGAnimatedProperty.cpp (right): https://codereview.chromium.org/262093006/diff/150001/Source/core/svg/properties/SVGAnimatedProperty.cpp#newcode55 Source/core/svg/properties/SVGAnimatedProperty.cpp:55: ASSERT(!isAnimating()); isAnimating() check only touches SVGAnimatedPropertyBase, so this should ...
6 years, 7 months ago (2014-05-07 04:11:50 UTC) #31
Mads Ager (chromium)
Thanks for your comments guys. I have uploaded a code review which addresses most of ...
6 years, 7 months ago (2014-05-07 12:13:15 UTC) #32
tkent
6 years, 7 months ago (2014-05-07 13:56:53 UTC) #33
Message was sent while issue was closed.
https://codereview.chromium.org/262093006/diff/150001/Source/core/html/HTMLFo...
File Source/core/html/HTMLFormControlElement.cpp (right):

https://codereview.chromium.org/262093006/diff/150001/Source/core/html/HTMLFo...
Source/core/html/HTMLFormControlElement.cpp:68: hideVisibleValidationMessage();
On 2014/05/07 12:13:16, Mads Ager (chromium) wrote:
> On 2014/05/07 00:41:19, tkent wrote:
> > On 2014/05/06 15:59:42, haraken wrote:
> > > 
> > > tkent-san: Would you confirm that this change is OK (as well as the
> > > corresponding change in ValidationMessage)?
> > 
> > This line is unnecessary.  One in removedFrom is enough because detached
> > elements can't have validation message.
> 
> The question is what happens if the entire document dies without this element
> being detached. So this element is still in the document and the entire
document
> structure is dead. However, it looks like documentDetached is called on the
> client via the Page if the document is detached in that case and that clears
any
> validation messages. Does that sound right to you Kent?
> 
> Remove the call.

Yeah, it's right.

Powered by Google App Engine
This is Rietveld 408576698