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

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

Issue 1808533003: Revert of Reduce ActiveDOMObjects from core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 73e9c8b9a03446f30338714f84593b8c050ac8f4..c4daec4dc6a4d9f71d8c3e1cf639adc1cb616c2f 100644
--- a/third_party/WebKit/Source/core/html/PublicURLManager.cpp
+++ b/third_party/WebKit/Source/core/html/PublicURLManager.cpp
@@ -36,17 +36,20 @@
PassOwnPtrWillBeRawPtr<PublicURLManager> PublicURLManager::create(ExecutionContext* context)
{
- return adoptPtrWillBeNoop(new PublicURLManager(context));
+ OwnPtrWillBeRawPtr<PublicURLManager> publicURLManager = adoptPtrWillBeNoop(new PublicURLManager(context));
+ publicURLManager->suspendIfNeeded();
+ return publicURLManager.release();
}
PublicURLManager::PublicURLManager(ExecutionContext* context)
- : ContextLifecycleObserver(context)
+ : ActiveDOMObject(context)
+ , m_isStopped(false)
{
}
void PublicURLManager::registerURL(SecurityOrigin* origin, const KURL& url, URLRegistrable* registrable, const String& uuid)
{
- if (!executionContext())
+ if (m_isStopped)
return;
RegistryURLMap::ValueType* found = m_registryToURL.add(&registrable->registry(), URLMap()).storedValue;
@@ -86,11 +89,12 @@
}
}
-void PublicURLManager::contextDestroyed()
+void PublicURLManager::stop()
{
- if (!executionContext())
+ if (m_isStopped)
return;
+ m_isStopped = true;
for (auto& registryUrl : m_registryToURL) {
for (auto& url : registryUrl.value)
registryUrl.key->unregisterURL(KURL(ParsedURLString, url.key));
@@ -101,7 +105,7 @@
DEFINE_TRACE(PublicURLManager)
{
- ContextLifecycleObserver::trace(visitor);
+ ActiveDOMObject::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