Commit 206cbbe6 authored by cmumford@chromium.org's avatar cmumford@chromium.org

Protecting against other possible uses of invalid V8 execution context.

Speculative fix for a user reported crash when a worker with an active IndexedDB
transaction was terminated. This stack is very similar to the one for 345354. I
do not have a reproduction for this bug was unable to verify that it fixes the
problem, but checking for a stopped context is still a good idea.

BUG=356146, 356171

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

git-svn-id: svn://svn.chromium.org/blink/trunk@170107 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 1be05412
...@@ -379,6 +379,8 @@ void IDBDatabase::enqueueEvent(PassRefPtr<Event> event) ...@@ -379,6 +379,8 @@ void IDBDatabase::enqueueEvent(PassRefPtr<Event> event)
bool IDBDatabase::dispatchEvent(PassRefPtr<Event> event) bool IDBDatabase::dispatchEvent(PassRefPtr<Event> event)
{ {
IDB_TRACE("IDBDatabase::dispatchEvent"); IDB_TRACE("IDBDatabase::dispatchEvent");
if (m_contextStopped || !executionContext())
return false;
ASSERT(event->type() == EventTypeNames::versionchange || event->type() == EventTypeNames::close); ASSERT(event->type() == EventTypeNames::versionchange || event->type() == EventTypeNames::close);
for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
if (m_enqueuedEvents[i].get() == event.get()) if (m_enqueuedEvents[i].get() == event.get())
......
...@@ -341,6 +341,10 @@ ExecutionContext* IDBTransaction::executionContext() const ...@@ -341,6 +341,10 @@ ExecutionContext* IDBTransaction::executionContext() const
bool IDBTransaction::dispatchEvent(PassRefPtr<Event> event) bool IDBTransaction::dispatchEvent(PassRefPtr<Event> event)
{ {
IDB_TRACE("IDBTransaction::dispatchEvent"); IDB_TRACE("IDBTransaction::dispatchEvent");
if (m_contextStopped || !executionContext()) {
m_state = Finished;
return false;
}
ASSERT(m_state != Finished); ASSERT(m_state != Finished);
ASSERT(m_hasPendingActivity); ASSERT(m_hasPendingActivity);
ASSERT(executionContext()); ASSERT(executionContext());
......
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