Removed unregisterTerminationObserver from DatabaseContext::contextDestroyed

Method DatabaseContext::contextDestroyed always calls from ExecutionContext destructor. In the case when the context is WorkerGlobalScope - from WorkerGlobalScope destructor. This unregister call does nothing in this situation.
And it looks dangerous when we try to use the methods of the object in destructor. E.g. if we make the method ExecutionContext::isWorkerGlobalScope virtual the program will crash in DatabaseContext::contextDestroyed.

R=tkent@chromium.org,vsevik@chromium.org

Review URL: https://codereview.chromium.org/551373003

git-svn-id: svn://svn.chromium.org/blink/trunk@181711 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 90f43894
...@@ -203,13 +203,6 @@ void WorkerGlobalScope::registerTerminationObserver(TerminationObserver* observe ...@@ -203,13 +203,6 @@ void WorkerGlobalScope::registerTerminationObserver(TerminationObserver* observe
m_terminationObserver = observer; m_terminationObserver = observer;
} }
void WorkerGlobalScope::unregisterTerminationObserver(TerminationObserver* observer)
{
ASSERT(observer);
ASSERT(m_terminationObserver == observer);
m_terminationObserver = 0;
}
void WorkerGlobalScope::wasRequestedToTerminate() void WorkerGlobalScope::wasRequestedToTerminate()
{ {
if (m_terminationObserver) if (m_terminationObserver)
......
...@@ -94,7 +94,6 @@ public: ...@@ -94,7 +94,6 @@ public:
virtual void wasRequestedToTerminate() = 0; virtual void wasRequestedToTerminate() = 0;
}; };
void registerTerminationObserver(TerminationObserver*); void registerTerminationObserver(TerminationObserver*);
void unregisterTerminationObserver(TerminationObserver*);
void wasRequestedToTerminate(); void wasRequestedToTerminate();
void dispose(); void dispose();
......
...@@ -133,8 +133,6 @@ void DatabaseContext::contextDestroyed() ...@@ -133,8 +133,6 @@ void DatabaseContext::contextDestroyed()
{ {
RefPtrWillBeRawPtr<DatabaseContext> protector(this); RefPtrWillBeRawPtr<DatabaseContext> protector(this);
stopDatabases(); stopDatabases();
if (executionContext()->isWorkerGlobalScope())
toWorkerGlobalScope(executionContext())->unregisterTerminationObserver(this);
DatabaseManager::manager().unregisterDatabaseContext(this); DatabaseManager::manager().unregisterDatabaseContext(this);
ActiveDOMObject::contextDestroyed(); ActiveDOMObject::contextDestroyed();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment