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

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

Issue 901663005: Revert r189385 "Remove LifecycleContext" and r189391, r189530, r189456 that block it (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/DocumentLifecycleNotifier.h » ('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 0115291f90d0d9a9a7b2601adcf3a5225351e601..8e3a75aaac353ec29d77bf72ed342f51b431477b 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -66,6 +66,7 @@
#include "core/dom/ContextFeatures.h"
#include "core/dom/DOMImplementation.h"
#include "core/dom/DocumentFragment.h"
+#include "core/dom/DocumentLifecycleNotifier.h"
#include "core/dom/DocumentLifecycleObserver.h"
#include "core/dom/DocumentMarkerController.h"
#include "core/dom/DocumentType.h"
@@ -402,7 +403,6 @@ void DocumentVisibilityObserver::setObservedDocument(Document& document)
Document::Document(const DocumentInit& initializer, DocumentClassFlags documentClasses)
: ContainerNode(0, CreateDocument)
, TreeScope(*this)
- , DocumentLifecycleNotifier(this)
, m_hasNodesWithPlaceholderStyle(false)
, m_evaluateMediaQueriesOnStyleRecalc(false)
, m_pendingSheetLayout(NoLayoutWithPendingSheets)
@@ -642,7 +642,7 @@ void Document::dispose()
accessSVGExtensions().pauseAnimations();
m_lifecycle.advanceTo(DocumentLifecycle::Disposed);
- DocumentLifecycleNotifier::notifyDocumentWasDisposed();
+ lifecycleNotifier().notifyDocumentWasDisposed();
}
#endif
@@ -2182,7 +2182,7 @@ void Document::detach(const AttachContext& context)
if (m_mediaQueryMatcher)
m_mediaQueryMatcher->documentDetached();
- DocumentLifecycleNotifier::notifyDocumentWasDetached();
+ lifecycleNotifier().notifyDocumentWasDetached();
m_lifecycle.advanceTo(DocumentLifecycle::Stopped);
// FIXME: Currently we call notifyContextDestroyed() only in
@@ -2191,7 +2191,7 @@ void Document::detach(const AttachContext& context)
// If such a document has any observer, the observer won't get
// a contextDestroyed() notification. This can happen for a document
// created by DOMImplementation::createDocument().
- DocumentLifecycleNotifier::notifyContextDestroyed();
+ LifecycleContext<Document>::notifyContextDestroyed();
ExecutionContext::notifyContextDestroyed();
}
@@ -5458,6 +5458,16 @@ float Document::devicePixelRatio() const
return m_frame ? m_frame->devicePixelRatio() : 1.0;
}
+PassOwnPtr<LifecycleNotifier<Document>> Document::createLifecycleNotifier()
+{
+ return DocumentLifecycleNotifier::create(this);
+}
+
+DocumentLifecycleNotifier& Document::lifecycleNotifier()
+{
+ return static_cast<DocumentLifecycleNotifier&>(LifecycleContext<Document>::lifecycleNotifier());
+}
+
void Document::removedStyleSheet(StyleSheet* sheet, StyleResolverUpdateMode updateMode)
{
// If we're in document teardown, then we don't need this notification of our sheet's removal.
@@ -5754,7 +5764,7 @@ void Document::trace(Visitor* visitor)
TreeScope::trace(visitor);
ContainerNode::trace(visitor);
ExecutionContext::trace(visitor);
- DocumentLifecycleNotifier::trace(visitor);
+ LifecycleContext<Document>::trace(visitor);
}
} // namespace blink
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentLifecycleNotifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698