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

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: 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void StyleEngine::detachFromDocument() 81 void StyleEngine::detachFromDocument()
82 { 82 {
83 #if !ENABLE(OILPAN)
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 #if !ENABLE(OILPAN)
87 for (unsigned i = 0; i < m_injectedAuthorStyleSheets.size(); ++i) 88 for (unsigned i = 0; i < m_injectedAuthorStyleSheets.size(); ++i)
88 m_injectedAuthorStyleSheets[i]->clearOwnerNode(); 89 m_injectedAuthorStyleSheets[i]->clearOwnerNode();
89 for (unsigned i = 0; i < m_authorStyleSheets.size(); ++i) 90 for (unsigned i = 0; i < m_authorStyleSheets.size(); ++i)
90 m_authorStyleSheets[i]->clearOwnerNode(); 91 m_authorStyleSheets[i]->clearOwnerNode();
91 #endif 92 #endif
92 93
93 if (m_fontSelector) { 94 if (m_fontSelector) {
94 m_fontSelector->clearDocument(); 95 m_fontSelector->clearDocument();
95 #if !ENABLE(OILPAN)
96 if (m_resolver) 96 if (m_resolver)
97 m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get()) ; 97 m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get()) ;
98 #endif
99 } 98 }
100 99
101 // Decrement reference counts for things we could be keeping alive. 100 // Decrement reference counts for things we could be keeping alive.
102 m_fontSelector.clear(); 101 m_fontSelector.clear();
103 m_resolver.clear(); 102 m_resolver.clear();
104 m_styleSheetCollectionMap.clear(); 103 m_styleSheetCollectionMap.clear();
104 #endif
105 } 105 }
106 106
107 inline Document* StyleEngine::master() 107 inline Document* StyleEngine::master()
108 { 108 {
109 if (isMaster()) 109 if (isMaster())
110 return &m_document; 110 return &m_document;
111 HTMLImportsController* import = m_document.importsController(); 111 HTMLImportsController* import = m_document.importsController();
112 if (!import) // Document::import() can return null while executing its destr uctor. 112 if (!import) // Document::import() can return null while executing its destr uctor.
113 return 0; 113 return 0;
114 return import->master(); 114 return import->master();
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 visitor->trace(m_authorStyleSheets); 637 visitor->trace(m_authorStyleSheets);
638 visitor->trace(m_documentStyleSheetCollection); 638 visitor->trace(m_documentStyleSheetCollection);
639 visitor->trace(m_styleSheetCollectionMap); 639 visitor->trace(m_styleSheetCollectionMap);
640 visitor->trace(m_resolver); 640 visitor->trace(m_resolver);
641 visitor->trace(m_fontSelector); 641 visitor->trace(m_fontSelector);
642 visitor->trace(m_textToSheetCache); 642 visitor->trace(m_textToSheetCache);
643 visitor->trace(m_sheetToTextCache); 643 visitor->trace(m_sheetToTextCache);
644 } 644 }
645 645
646 } 646 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698