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

Unified Diff: third_party/WebKit/Source/core/html/PublicURLManager.cpp

Issue 1750453002: Reduce ActiveDOMObjects from core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/html/PublicURLManager.cpp
diff --git a/third_party/WebKit/Source/core/html/PublicURLManager.cpp b/third_party/WebKit/Source/core/html/PublicURLManager.cpp
index c4daec4dc6a4d9f71d8c3e1cf639adc1cb616c2f..73e9c8b9a03446f30338714f84593b8c050ac8f4 100644
--- a/third_party/WebKit/Source/core/html/PublicURLManager.cpp
+++ b/third_party/WebKit/Source/core/html/PublicURLManager.cpp
@@ -36,20 +36,17 @@ namespace blink {
PassOwnPtrWillBeRawPtr<PublicURLManager> PublicURLManager::create(ExecutionContext* context)
{
- OwnPtrWillBeRawPtr<PublicURLManager> publicURLManager = adoptPtrWillBeNoop(new PublicURLManager(context));
- publicURLManager->suspendIfNeeded();
- return publicURLManager.release();
+ return adoptPtrWillBeNoop(new PublicURLManager(context));
}
PublicURLManager::PublicURLManager(ExecutionContext* context)
- : ActiveDOMObject(context)
- , m_isStopped(false)
+ : ContextLifecycleObserver(context)
{
}
void PublicURLManager::registerURL(SecurityOrigin* origin, const KURL& url, URLRegistrable* registrable, const String& uuid)
{
- if (m_isStopped)
+ if (!executionContext())
haraken 2016/03/03 15:31:35 Sigbjorn: Should we revert this CL for the same re
sof 2016/03/03 15:43:53 Reinstating m_isStopped for PublicURLManager as a
return;
RegistryURLMap::ValueType* found = m_registryToURL.add(&registrable->registry(), URLMap()).storedValue;
@@ -89,12 +86,11 @@ void PublicURLManager::revoke(const String& uuid)
}
}
-void PublicURLManager::stop()
+void PublicURLManager::contextDestroyed()
{
- if (m_isStopped)
+ if (!executionContext())
return;
- m_isStopped = true;
for (auto& registryUrl : m_registryToURL) {
for (auto& url : registryUrl.value)
registryUrl.key->unregisterURL(KURL(ParsedURLString, url.key));
@@ -105,7 +101,7 @@ void PublicURLManager::stop()
DEFINE_TRACE(PublicURLManager)
{
- ActiveDOMObject::trace(visitor);
+ ContextLifecycleObserver::trace(visitor);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/html/PublicURLManager.h ('k') | third_party/WebKit/Source/core/page/EventSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698