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

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

Issue 292503006: Oilpan: add [WillBeGarbageCollected] for Node. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add now-required tracing of m_domWindow (oops) 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
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentFragment.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index d15908211b4b57fcda2a9368ec2579faf56e2dfc..b69cf2e04871d5bcbfef8fe95af8bd0c5ba78658 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -925,13 +925,13 @@ bool Document::importContainerNodeChildren(ContainerNode* oldContainerNode, Pass
return true;
}
-PassRefPtr<Node> Document::importNode(Node* importedNode, ExceptionState& ec)
+PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, ExceptionState& ec)
{
UseCounter::countDeprecation(this, UseCounter::DocumentImportNodeOptionalArgument);
return importNode(importedNode, true, ec);
}
-PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionState& exceptionState)
{
if (!importedNode) {
exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::argumentNullOrIncorrectType(1, "Node"));
@@ -2251,6 +2251,16 @@ void Document::detach(const AttachContext& context)
// really shouldn't clear anything at this point. It should just
// die with the document when the document is no longer reachable.
dispose();
+
+ // This mirrors the clearing of the document object's touch
+ // handlers that happens when the DOMWindow is destructed in a
+ // non-Oilpan setting (DOMWindow::removeAllEventListeners()),
+ // except that it is now done during detach instead.
+ didClearTouchEventHandlers(this);
+
+ // Done with the window, explicitly clear to hasten its
+ // destruction.
+ clearDOMWindow();
#endif
}
@@ -5771,6 +5781,7 @@ void Document::trace(Visitor* visitor)
visitor->trace(m_nodeIterators);
visitor->trace(m_styleEngine);
visitor->trace(m_formController);
+ visitor->trace(m_domWindow);
visitor->trace(m_fetcher);
visitor->trace(m_parser);
visitor->trace(m_contextFeatures);
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentFragment.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698