Commit 1a377faf authored by jsbell@chromium.org's avatar jsbell@chromium.org

IndexedDB: Ensure script wrappers can be collected after context is stopped

https://bugs.webkit.org/show_bug.cgi?id=112976

Reviewed by Adam Barth.

ActiveDOMObject::hasPendingActivity is called to see if script wrappers
can be disposed of. Once the script execution context has stopped they
should be free to go - include this in the checks.

No new tests - suggestions welcome.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::hasPendingActivity): Return false if stopped.
(WebCore::IDBDatabase::stop): Don't bother calling empty super impl.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::hasPendingActivity): Return false if stopped.
(WebCore::IDBRequest::stop): Don't bother calling empty super impl.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::hasPendingActivity): Return false if stopped.
(WebCore::IDBTransaction::stop): Don't bother calling empty super impl.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a4c83fcf
2013-03-21 Joshua Bell <jsbell@chromium.org>
IndexedDB: Ensure script wrappers can be collected after context is stopped
https://bugs.webkit.org/show_bug.cgi?id=112976
Reviewed by Adam Barth.
ActiveDOMObject::hasPendingActivity is called to see if script wrappers
can be disposed of. Once the script execution context has stopped they
should be free to go - include this in the checks.
No new tests - suggestions welcome.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::hasPendingActivity): Return false if stopped.
(WebCore::IDBDatabase::stop): Don't bother calling empty super impl.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::hasPendingActivity): Return false if stopped.
(WebCore::IDBRequest::stop): Don't bother calling empty super impl.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::hasPendingActivity): Return false if stopped.
(WebCore::IDBTransaction::stop): Don't bother calling empty super impl.
2013-03-21 Russell McClellan <russell.mcclellan@gmail.com>
Remove upcastPointer from ActiveDOMObject constructor
......@@ -352,12 +352,11 @@ bool IDBDatabase::hasPendingActivity() const
{
// The script wrapper must not be collected before the object is closed or
// we can't fire a "versionchange" event to let script manually close the connection.
return !m_closePending && !m_eventTargetData.eventListenerMap.isEmpty();
return !m_closePending && !m_eventTargetData.eventListenerMap.isEmpty() && !m_contextStopped;
}
void IDBDatabase::stop()
{
ActiveDOMObject::stop();
// Stop fires at a deterministic time, so we need to call close in it.
close();
......
......@@ -420,12 +420,11 @@ bool IDBRequest::hasPendingActivity() const
// FIXME: In an ideal world, we should return true as long as anyone has a or can
// get a handle to us and we have event listeners. This is order to handle
// user generated events properly.
return m_hasPendingActivity;
return m_hasPendingActivity && !m_contextStopped;
}
void IDBRequest::stop()
{
ActiveDOMObject::stop();
if (m_contextStopped)
return;
......
......@@ -333,7 +333,7 @@ bool IDBTransaction::hasPendingActivity() const
// FIXME: In an ideal world, we should return true as long as anyone has a or can
// get a handle to us or any child request object and any of those have
// event listeners. This is in order to handle user generated events properly.
return m_hasPendingActivity;
return m_hasPendingActivity && !m_contextStopped;
}
IndexedDB::TransactionMode IDBTransaction::stringToMode(const String& modeString, ScriptExecutionContext* context, ExceptionCode& ec)
......@@ -422,7 +422,6 @@ bool IDBTransaction::canSuspend() const
void IDBTransaction::stop()
{
ActiveDOMObject::stop();
m_contextStopped = true;
abort(IGNORE_EXCEPTION);
......
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