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

Unified Diff: Source/core/frame/DOMWindow.cpp

Issue 292503006: Oilpan: add [WillBeGarbageCollected] for Node. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: DOMWindow dtor fixes 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/frame/DOMWindow.h ('k') | Source/core/loader/SinkDocument.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/DOMWindow.cpp
diff --git a/Source/core/frame/DOMWindow.cpp b/Source/core/frame/DOMWindow.cpp
index b9c97b3316aaff6568f0a4ea352bb8318fa83a78..a06b148d30808fc6f6e30e49db3bb8f04dd949e1 100644
--- a/Source/core/frame/DOMWindow.cpp
+++ b/Source/core/frame/DOMWindow.cpp
@@ -363,9 +363,9 @@ void DOMWindow::clearEventQueue()
m_eventQueue.clear();
}
-PassRefPtr<Document> DOMWindow::createDocument(const String& mimeType, const DocumentInit& init, bool forceXHTML)
+PassRefPtrWillBeRawPtr<Document> DOMWindow::createDocument(const String& mimeType, const DocumentInit& init, bool forceXHTML)
{
- RefPtr<Document> document;
+ RefPtrWillBeRawPtr<Document> document;
haraken 2014/05/23 08:32:14 = nullptr
if (forceXHTML) {
// This is a hack for XSLTProcessor. See XSLTProcessor::createDocumentFromSource().
document = Document::create(init);
@@ -378,7 +378,7 @@ PassRefPtr<Document> DOMWindow::createDocument(const String& mimeType, const Doc
return document.release();
}
-PassRefPtr<Document> DOMWindow::installNewDocument(const String& mimeType, const DocumentInit& init, bool forceXHTML)
+PassRefPtrWillBeRawPtr<Document> DOMWindow::installNewDocument(const String& mimeType, const DocumentInit& init, bool forceXHTML)
{
ASSERT(init.frame() == m_frame);
@@ -486,15 +486,20 @@ DOMWindow::~DOMWindow()
ASSERT(m_hasBeenReset);
reset();
+#if ENABLE(OILPAN)
+ // Stub out early to prevent Document access in removeAllEventListeners().
+ m_document = nullptr;
+#endif
+
removeAllEventListeners();
#if ENABLE(OILPAN)
- ASSERT(m_document->isDisposed());
+ // FIXME: This should be part of ActiveDOM Object shutdown
+ clearEventQueue();
haraken 2014/05/23 08:32:14 I guess you need to call Document::clearDOMWindow,
sof 2014/05/23 08:56:33 Hmm, Document needs to clear out its weak back ref
sof 2014/05/23 10:53:03 Now arranged for in the other direction by having
#else
ASSERT(m_document->isStopped());
-#endif
-
clearDocument();
+#endif
}
const AtomicString& DOMWindow::interfaceName() const
@@ -1872,6 +1877,7 @@ PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier()
void DOMWindow::trace(Visitor* visitor)
{
+ visitor->trace(m_document);
visitor->trace(m_screen);
visitor->trace(m_history);
visitor->trace(m_locationbar);
« no previous file with comments | « Source/core/frame/DOMWindow.h ('k') | Source/core/loader/SinkDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698