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

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

Issue 304323010: Oilpan: have DocumentInit use transition types throughout. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add WeakPtrWillBeMember transition type 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.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index ae3bf69eddc38dd82d10f8bc33dd9e4ad868f798..298c602884fe7b76f02d5a09127feda70e1e4d00 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -462,7 +462,9 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
, m_isMobileDocument(false)
, m_isTransitionDocument(false)
, m_renderView(0)
+#if !ENABLE(OILPAN)
, m_weakFactory(this)
+#endif
, m_contextDocument(initializer.contextDocument())
, m_hasFullscreenElementStack(false)
, m_loadEventDelayCount(0)
@@ -4517,13 +4519,18 @@ Document& Document::topDocument() const
return *doc;
}
-WeakPtr<Document> Document::contextDocument()
+WeakPtrWillBeRawPtr<Document> Document::contextDocument()
{
if (m_contextDocument)
return m_contextDocument;
- if (m_frame)
+ if (m_frame) {
+#if ENABLE(OILPAN)
+ return this;
+#else
return m_weakFactory.createWeakPtr();
- return WeakPtr<Document>(nullptr);
+#endif
+ }
+ return WeakPtrWillBeRawPtr<Document>(nullptr);
}
PassRefPtrWillBeRawPtr<Attr> Document::createAttribute(const AtomicString& name, ExceptionState& exceptionState)
@@ -5814,6 +5821,7 @@ void Document::trace(Visitor* visitor)
visitor->trace(m_svgExtensions);
visitor->trace(m_timeline);
visitor->trace(m_compositorPendingAnimations);
+ visitor->trace(m_contextDocument);
visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
DocumentSupplementable::trace(visitor);
TreeScope::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698