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

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

Issue 38143002: Have LifecycleContext::lifecycleNotifier() return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 2 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/ExecutionContext.h ('k') | Source/core/frame/DOMWindow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ExecutionContext.cpp
diff --git a/Source/core/dom/ExecutionContext.cpp b/Source/core/dom/ExecutionContext.cpp
index 1b62c436538b1b7f037b479e67b3ff7cd975606f..98a349f917cb50e8f780e1911fafab2dd2955456 100644
--- a/Source/core/dom/ExecutionContext.cpp
+++ b/Source/core/dom/ExecutionContext.cpp
@@ -137,7 +137,7 @@ void ExecutionContext::destroyedMessagePort(MessagePort* port)
bool ExecutionContext::hasPendingActivity()
{
- if (lifecycleNotifier()->hasPendingActivity())
+ if (lifecycleNotifier().hasPendingActivity())
return true;
HashSet<MessagePort*>::const_iterator messagePortsEnd = m_messagePorts.end();
@@ -151,27 +151,27 @@ bool ExecutionContext::hasPendingActivity()
void ExecutionContext::suspendActiveDOMObjects()
{
- lifecycleNotifier()->notifySuspendingActiveDOMObjects();
+ lifecycleNotifier().notifySuspendingActiveDOMObjects();
m_activeDOMObjectsAreSuspended = true;
}
void ExecutionContext::resumeActiveDOMObjects()
{
m_activeDOMObjectsAreSuspended = false;
- lifecycleNotifier()->notifyResumingActiveDOMObjects();
+ lifecycleNotifier().notifyResumingActiveDOMObjects();
}
void ExecutionContext::stopActiveDOMObjects()
{
m_activeDOMObjectsAreStopped = true;
- lifecycleNotifier()->notifyStoppingActiveDOMObjects();
+ lifecycleNotifier().notifyStoppingActiveDOMObjects();
// Also close MessagePorts. If they were ActiveDOMObjects (they could be) then they could be stopped instead.
closeMessagePorts();
}
void ExecutionContext::suspendActiveDOMObjectIfNeeded(ActiveDOMObject* object)
{
- ASSERT(lifecycleNotifier()->contains(object));
+ ASSERT(lifecycleNotifier().contains(object));
// Ensure all ActiveDOMObjects are suspended also newly created ones.
if (m_activeDOMObjectsAreSuspended)
object->suspend();
@@ -380,9 +380,9 @@ PassOwnPtr<LifecycleNotifier<ExecutionContext> > ExecutionContext::createLifecyc
return m_client->createLifecycleNotifier();
}
-ContextLifecycleNotifier* ExecutionContext::lifecycleNotifier()
+ContextLifecycleNotifier& ExecutionContext::lifecycleNotifier()
{
- return static_cast<ContextLifecycleNotifier*>(LifecycleContext<ExecutionContext>::lifecycleNotifier());
+ return static_cast<ContextLifecycleNotifier&>(LifecycleContext<ExecutionContext>::lifecycleNotifier());
}
bool ExecutionContext::isIteratingOverObservers() const
« no previous file with comments | « Source/core/dom/ExecutionContext.h ('k') | Source/core/frame/DOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698