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

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

Issue 1081673003: Oilpan: Prepare to move AXObjectCache to the heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
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 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 Document& Document::axObjectCacheOwner() const 2197 Document& Document::axObjectCacheOwner() const
2198 { 2198 {
2199 Document& top = topDocument(); 2199 Document& top = topDocument();
2200 if (top.frame() && top.frame()->pagePopupOwner()) { 2200 if (top.frame() && top.frame()->pagePopupOwner()) {
2201 ASSERT(!top.m_axObjectCache); 2201 ASSERT(!top.m_axObjectCache);
2202 return top.frame()->pagePopupOwner()->document().axObjectCacheOwner(); 2202 return top.frame()->pagePopupOwner()->document().axObjectCacheOwner();
2203 } 2203 }
2204 return top; 2204 return top;
2205 } 2205 }
2206 2206
2207 void Document::clearAXObjectCache() 2207 void Document::clearAXObjectCache()
haraken 2015/04/28 10:45:21 It is unsafe to land this CL at the moment since D
2208 { 2208 {
2209 ASSERT(&axObjectCacheOwner() == this); 2209 ASSERT(&axObjectCacheOwner() == this);
2210 // Clear the cache member variable before calling delete because attempts 2210 // Clear the cache member variable before calling discard because attempts
haraken 2015/04/28 10:45:21 What is discard?
keishi 2015/05/28 06:49:15 My mistake. I got confused. Reverted.
2211 // are made to access it during destruction. 2211 // are made to access it during discard.
2212 m_axObjectCache.clear(); 2212 OwnPtrWillBeRawPtr<AXObjectCache> cache = m_axObjectCache.release();
2213 if (cache)
2214 cache->dispose();
haraken 2015/04/28 10:45:21 Nit: if (m_axObjectCache) m_axObjectCache->disp
keishi 2015/05/28 06:49:15 Done.
2213 } 2215 }
2214 2216
2215 AXObjectCache* Document::existingAXObjectCache() const 2217 AXObjectCache* Document::existingAXObjectCache() const
2216 { 2218 {
2217 // If the renderer is gone then we are in the process of destruction. 2219 // If the renderer is gone then we are in the process of destruction.
2218 // This method will be called before m_frame = nullptr. 2220 // This method will be called before m_frame = nullptr.
2219 if (!axObjectCacheOwner().layoutView()) 2221 if (!axObjectCacheOwner().layoutView())
2220 return 0; 2222 return 0;
2221 2223
2222 return axObjectCacheOwner().m_axObjectCache.get(); 2224 return axObjectCacheOwner().m_axObjectCache.get();
(...skipping 3475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5698 #if ENABLE(OILPAN) 5700 #if ENABLE(OILPAN)
5699 visitor->trace(m_importsController); 5701 visitor->trace(m_importsController);
5700 visitor->trace(m_docType); 5702 visitor->trace(m_docType);
5701 visitor->trace(m_implementation); 5703 visitor->trace(m_implementation);
5702 visitor->trace(m_autofocusElement); 5704 visitor->trace(m_autofocusElement);
5703 visitor->trace(m_focusedElement); 5705 visitor->trace(m_focusedElement);
5704 visitor->trace(m_hoverNode); 5706 visitor->trace(m_hoverNode);
5705 visitor->trace(m_activeHoverElement); 5707 visitor->trace(m_activeHoverElement);
5706 visitor->trace(m_documentElement); 5708 visitor->trace(m_documentElement);
5707 visitor->trace(m_titleElement); 5709 visitor->trace(m_titleElement);
5710 visitor->trace(m_axObjectCache);
5708 visitor->trace(m_markers); 5711 visitor->trace(m_markers);
5709 visitor->trace(m_cssTarget); 5712 visitor->trace(m_cssTarget);
5710 visitor->trace(m_currentScriptStack); 5713 visitor->trace(m_currentScriptStack);
5711 visitor->trace(m_scriptRunner); 5714 visitor->trace(m_scriptRunner);
5712 visitor->trace(m_listsInvalidatedAtDocument); 5715 visitor->trace(m_listsInvalidatedAtDocument);
5713 for (int i = 0; i < numNodeListInvalidationTypes; ++i) 5716 for (int i = 0; i < numNodeListInvalidationTypes; ++i)
5714 visitor->trace(m_nodeLists[i]); 5717 visitor->trace(m_nodeLists[i]);
5715 visitor->trace(m_cssCanvasElements); 5718 visitor->trace(m_cssCanvasElements);
5716 visitor->trace(m_topLayerElements); 5719 visitor->trace(m_topLayerElements);
5717 visitor->trace(m_elemSheet); 5720 visitor->trace(m_elemSheet);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
5760 #ifndef NDEBUG 5763 #ifndef NDEBUG
5761 using namespace blink; 5764 using namespace blink;
5762 void showLiveDocumentInstances() 5765 void showLiveDocumentInstances()
5763 { 5766 {
5764 WeakDocumentSet& set = liveDocumentSet(); 5767 WeakDocumentSet& set = liveDocumentSet();
5765 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5768 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5766 for (Document* document : set) 5769 for (Document* document : set)
5767 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5770 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5768 } 5771 }
5769 #endif 5772 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698