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(®istrable->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 |