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

Side by Side Diff: Source/core/dom/StyleEngine.cpp

Issue 262093006: Oilpan: Make the Node hierarchy RefCountedGarbageCollected instead of TreeShared. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address more comments. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // We don't need to create CSSFontSelector for imported document or 71 // We don't need to create CSSFontSelector for imported document or
72 // HTMLTemplateElement's document, because those documents have no frame. 72 // HTMLTemplateElement's document, because those documents have no frame.
73 , m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : nul lptr) 73 , m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : nul lptr)
74 { 74 {
75 } 75 }
76 76
77 StyleEngine::~StyleEngine() 77 StyleEngine::~StyleEngine()
78 { 78 {
79 } 79 }
80 80
81 #if !ENABLE(OILPAN)
81 void StyleEngine::detachFromDocument() 82 void StyleEngine::detachFromDocument()
82 { 83 {
83 // Cleanup is performed eagerly when the StyleEngine is removed from the 84 // Cleanup is performed eagerly when the StyleEngine is removed from the
84 // document. The StyleEngine is unreachable after this, since only the 85 // document. The StyleEngine is unreachable after this, since only the
85 // document has a reference to it. 86 // document has a reference to it.
86 #if !ENABLE(OILPAN)
87 for (unsigned i = 0; i < m_injectedAuthorStyleSheets.size(); ++i) 87 for (unsigned i = 0; i < m_injectedAuthorStyleSheets.size(); ++i)
88 m_injectedAuthorStyleSheets[i]->clearOwnerNode(); 88 m_injectedAuthorStyleSheets[i]->clearOwnerNode();
89 for (unsigned i = 0; i < m_authorStyleSheets.size(); ++i) 89 for (unsigned i = 0; i < m_authorStyleSheets.size(); ++i)
90 m_authorStyleSheets[i]->clearOwnerNode(); 90 m_authorStyleSheets[i]->clearOwnerNode();
91 #endif
92 91
93 if (m_fontSelector) { 92 if (m_fontSelector) {
94 m_fontSelector->clearDocument(); 93 m_fontSelector->clearDocument();
Mads Ager (chromium) 2014/05/05 13:06:40 Erik points out that removing this is probably uns
haraken 2014/05/06 04:20:16 Yeah, this looks unsafe. Want to look at the chang
Erik Corry 2014/05/06 08:29:40 As discussed offline this is still needed somehow.
95 #if !ENABLE(OILPAN)
96 if (m_resolver) 94 if (m_resolver)
97 m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get()) ; 95 m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get()) ;
98 #endif
99 } 96 }
100 97
101 // Decrement reference counts for things we could be keeping alive. 98 // Decrement reference counts for things we could be keeping alive.
102 m_fontSelector.clear(); 99 m_fontSelector.clear();
103 m_resolver.clear(); 100 m_resolver.clear();
104 m_styleSheetCollectionMap.clear(); 101 m_styleSheetCollectionMap.clear();
haraken 2014/05/06 04:20:16 Just to confirm: The line 99 - 101 was not needed
Mads Ager (chromium) 2014/05/06 08:26:00 I think that is right. In any case Gustav has a ch
105 } 102 }
103 #endif
106 104
107 inline Document* StyleEngine::master() 105 inline Document* StyleEngine::master()
108 { 106 {
109 if (isMaster()) 107 if (isMaster())
110 return &m_document; 108 return &m_document;
111 HTMLImportsController* import = m_document.importsController(); 109 HTMLImportsController* import = m_document.importsController();
112 if (!import) // Document::import() can return null while executing its destr uctor. 110 if (!import) // Document::import() can return null while executing its destr uctor.
113 return 0; 111 return 0;
114 return import->master(); 112 return import->master();
115 } 113 }
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 visitor->trace(m_authorStyleSheets); 635 visitor->trace(m_authorStyleSheets);
638 visitor->trace(m_documentStyleSheetCollection); 636 visitor->trace(m_documentStyleSheetCollection);
639 visitor->trace(m_styleSheetCollectionMap); 637 visitor->trace(m_styleSheetCollectionMap);
640 visitor->trace(m_resolver); 638 visitor->trace(m_resolver);
641 visitor->trace(m_fontSelector); 639 visitor->trace(m_fontSelector);
642 visitor->trace(m_textToSheetCache); 640 visitor->trace(m_textToSheetCache);
643 visitor->trace(m_sheetToTextCache); 641 visitor->trace(m_sheetToTextCache);
644 } 642 }
645 643
646 } 644 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698