| 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
|
|
|