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

Unified Diff: Source/core/dom/Document.h

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Pre-emptively GC a long runnning test 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Document.h
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 1b5f305efa212b5b5854e584ccbffc84110154a7..c7a5c9fe78a08459d83b0c897cadb2f7615c3a1e 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -346,7 +346,7 @@ public:
* @param bottomPadding How much to expand the bottom of the rectangle
* @param leftPadding How much to expand the left of the rectangle
*/
- PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY,
+ PassRefPtrWillBeRawPtr<NodeList> nodesFromRect(int centerX, int centerY,
unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding,
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent) const;
Element* elementFromPoint(int x, int y) const;
@@ -393,18 +393,18 @@ public:
PassRefPtr<Node> adoptNode(PassRefPtr<Node> source, ExceptionState&);
- PassRefPtr<HTMLCollection> images();
- PassRefPtr<HTMLCollection> embeds();
- PassRefPtr<HTMLCollection> applets();
- PassRefPtr<HTMLCollection> links();
- PassRefPtr<HTMLCollection> forms();
- PassRefPtr<HTMLCollection> anchors();
- PassRefPtr<HTMLCollection> scripts();
- PassRefPtr<HTMLAllCollection> allForBinding();
- PassRefPtr<HTMLAllCollection> all();
+ PassRefPtrWillBeRawPtr<HTMLCollection> images();
+ PassRefPtrWillBeRawPtr<HTMLCollection> embeds();
+ PassRefPtrWillBeRawPtr<HTMLCollection> applets();
+ PassRefPtrWillBeRawPtr<HTMLCollection> links();
+ PassRefPtrWillBeRawPtr<HTMLCollection> forms();
+ PassRefPtrWillBeRawPtr<HTMLCollection> anchors();
+ PassRefPtrWillBeRawPtr<HTMLCollection> scripts();
+ PassRefPtrWillBeRawPtr<HTMLAllCollection> allForBinding();
+ PassRefPtrWillBeRawPtr<HTMLAllCollection> all();
- PassRefPtr<HTMLCollection> windowNamedItems(const AtomicString& name);
- PassRefPtr<HTMLCollection> documentNamedItems(const AtomicString& name);
+ PassRefPtrWillBeRawPtr<HTMLCollection> windowNamedItems(const AtomicString& name);
+ PassRefPtrWillBeRawPtr<HTMLCollection> documentNamedItems(const AtomicString& name);
bool isHTMLDocument() const { return m_documentClasses & HTMLDocumentClass; }
bool isXHTMLDocument() const { return m_documentClasses & XHTMLDocumentClass; }
@@ -663,8 +663,13 @@ public:
void registerNodeList(LiveNodeListBase*);
void unregisterNodeList(LiveNodeListBase*);
+#if ENABLE(OILPAN)
+ void incrementNodeListWithIdNameCacheCount(const LiveNodeListBase*);
+ void decrementNodeListWithIdNameCacheCount(const LiveNodeListBase*);
+#else
void incrementNodeListWithIdNameCacheCount();
Erik Corry 2014/05/15 12:34:52 Consider having the same API and ignoring the list
sof 2014/05/15 22:15:57 ok, i resisted the temptation initially as the non
void decrementNodeListWithIdNameCacheCount();
+#endif
bool shouldInvalidateNodeListCaches(const QualifiedName* attrName = 0) const;
void invalidateNodeListCaches(const QualifiedName* attrName);
@@ -1152,14 +1157,14 @@ private:
void executeScriptsWaitingForResourcesIfNeeded();
- PassRefPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult&) const;
+ PassRefPtrWillBeRawPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult&) const;
void loadEventDelayTimerFired(Timer<Document>*);
void pluginLoadingTimerFired(Timer<Document>*);
PageVisibilityState pageVisibilityState() const;
- PassRefPtr<HTMLCollection> ensureCachedCollection(CollectionType);
+ PassRefPtrWillBeRawPtr<HTMLCollection> ensureCachedCollection(CollectionType);
// Note that dispatching a window load event may cause the DOMWindow to be detached from
// the LocalFrame, so callers should take a reference to the DOMWindow (which owns us) to
@@ -1304,8 +1309,16 @@ private:
InheritedBool m_designMode;
- HashSet<LiveNodeListBase*> m_listsInvalidatedAtDocument;
+ WillBeHeapHashSet<RawPtrWillBeWeakMember<LiveNodeListBase> > m_listsInvalidatedAtDocument;
+#if ENABLE(OILPAN)
+ // Oilpan keeps track of all registered NodeLists.
+ //
+ // FIXME: Oilpan: improve - only need to know if a NodeList is
+ // is currently alive or not for the different types.
haraken 2014/05/12 12:04:13 is is => is
sof 2014/05/15 22:15:57 Done.
+ HeapHashSet<WeakMember<LiveNodeListBase> > m_nodeLists[numNodeListInvalidationTypes];
+#else
unsigned m_nodeListCounts[numNodeListInvalidationTypes];
+#endif
OwnPtr<SVGDocumentExtensions> m_svgExtensions;
@@ -1414,6 +1427,7 @@ inline bool Document::shouldOverrideLegacyDescription(ViewportDescription::Type
return origin >= m_legacyViewportDescription.type;
}
+#if !ENABLE(OILPAN)
inline void Document::incrementNodeListWithIdNameCacheCount()
{
m_nodeListCounts[InvalidateOnIdNameAttrChange]++;
@@ -1424,6 +1438,7 @@ inline void Document::decrementNodeListWithIdNameCacheCount()
ASSERT(m_nodeListCounts[InvalidateOnIdNameAttrChange] > 0);
m_nodeListCounts[InvalidateOnIdNameAttrChange]--;
}
+#endif
inline void Document::scheduleRenderTreeUpdateIfNeeded()
{

Powered by Google App Engine
This is Rietveld 408576698