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

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

Issue 12518022: Merge 143840 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « Source/WebCore/WebCore.exp.in ('k') | Source/WebCore/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Document.h
===================================================================
--- Source/WebCore/dom/Document.h (revision 145445)
+++ Source/WebCore/dom/Document.h (working copy)
@@ -228,29 +228,6 @@
using ContainerNode::ref;
using ContainerNode::deref;
- // Nodes belonging to this document hold guard references -
- // these are enough to keep the document from being destroyed, but
- // not enough to keep it from removing its children. This allows a
- // node that outlives its document to still have a valid document
- // pointer without introducing reference cycles.
- void guardRef()
- {
- ASSERT(!m_deletionHasBegun);
- ++m_guardRefCount;
- }
-
- void guardDeref()
- {
- ASSERT(!m_deletionHasBegun);
- --m_guardRefCount;
- if (!m_guardRefCount && !refCount()) {
-#ifndef NDEBUG
- m_deletionHasBegun = true;
-#endif
- delete this;
- }
- }
-
Element* getElementById(const AtomicString& id) const;
virtual bool canContainRangeEndPoint() const { return true; }
@@ -1217,8 +1194,8 @@
friend class Node;
friend class IgnoreDestructiveWriteCountIncrementer;
- void removedLastRef();
-
+ virtual void dispose() OVERRIDE;
+
void detachParser();
typedef void (*ArgumentsCallback)(const String& keyString, const String& valueString, Document*, void* data);
@@ -1286,8 +1263,6 @@
void addListenerType(ListenerType listenerType) { m_listenerTypes |= listenerType; }
void addMutationEventListenerTypeIfEnabled(ListenerType);
- int m_guardRefCount;
-
void styleResolverThrowawayTimerFired(Timer<Document>*);
Timer<Document> m_styleResolverThrowawayTimer;
double m_lastStyleResolverAccessTime;
@@ -1603,10 +1578,9 @@
, m_previous(0)
, m_next(0)
{
- if (document)
- document->guardRef();
- else
+ if (!m_treeScope)
m_treeScope = TreeScope::noDocumentInstance();
+ m_treeScope->guardRef();
#if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS)
trackForDebugging();
« no previous file with comments | « Source/WebCore/WebCore.exp.in ('k') | Source/WebCore/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698