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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp

Issue 2473203002: IndexedDB: Remove m_contextStopped from ActiveDOMObjecs (Closed)
Patch Set: Created 4 years, 1 month 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/modules/indexeddb/IDBRequest.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
index 0d1c932d7007260a7d7f2f97e77793ae90bdff20..e51de04d0b88241bda7c88b59d608418114f8340 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
@@ -98,7 +98,7 @@ ScriptValue IDBRequest::result(ScriptState* scriptState,
InvalidStateError, IDBDatabase::requestNotFinishedErrorMessage);
return ScriptValue();
}
- if (m_contextStopped || !getExecutionContext()) {
+ if (!getExecutionContext()) {
exceptionState.throwDOMException(InvalidStateError,
IDBDatabase::databaseClosedErrorMessage);
return ScriptValue();
@@ -118,7 +118,7 @@ DOMException* IDBRequest::error(ExceptionState& exceptionState) const {
}
ScriptValue IDBRequest::source(ScriptState* scriptState) const {
- if (m_contextStopped || !getExecutionContext())
+ if (!getExecutionContext())
return ScriptValue();
return ScriptValue::from(scriptState, m_source);
@@ -148,7 +148,7 @@ void IDBRequest::webCallbacksDestroyed() {
void IDBRequest::abort() {
DCHECK(!m_requestAborted);
- if (m_contextStopped || !getExecutionContext())
+ if (!getExecutionContext())
return;
DCHECK(m_readyState == PENDING || m_readyState == DONE);
if (m_readyState == DONE)
@@ -229,7 +229,7 @@ void IDBRequest::ackReceivedBlobs(const Vector<RefPtr<IDBValue>>& values) {
}
bool IDBRequest::shouldEnqueueEvent() const {
- if (m_contextStopped || !getExecutionContext())
+ if (!getExecutionContext())
return false;
DCHECK(m_readyState == PENDING || m_readyState == DONE);
if (m_requestAborted)
@@ -359,7 +359,7 @@ void IDBRequest::onSuccess() {
}
void IDBRequest::onSuccessInternal(IDBAny* result) {
- DCHECK(!m_contextStopped);
+ DCHECK(getExecutionContext());
DCHECK(!m_pendingCursor);
setResult(result);
enqueueEvent(Event::create(EventTypeNames::success));
@@ -385,15 +385,10 @@ 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 && !m_contextStopped;
+ return m_hasPendingActivity && getExecutionContext();
}
void IDBRequest::contextDestroyed() {
- if (m_contextStopped)
- return;
-
- m_contextStopped = true;
-
if (m_readyState == PENDING) {
m_readyState = EarlyDeath;
if (m_transaction) {
@@ -425,7 +420,7 @@ ExecutionContext* IDBRequest::getExecutionContext() const {
DispatchEventResult IDBRequest::dispatchEventInternal(Event* event) {
IDB_TRACE("IDBRequest::dispatchEvent");
- if (m_contextStopped || !getExecutionContext())
+ if (!getExecutionContext())
return DispatchEventResult::CanceledBeforeDispatch;
DCHECK_EQ(m_readyState, PENDING);
DCHECK(m_hasPendingActivity);
@@ -529,7 +524,7 @@ void IDBRequest::transactionDidFinishAndDispatch() {
DCHECK(getExecutionContext());
m_transaction.clear();
- if (m_contextStopped)
+ if (!getExecutionContext())
return;
m_readyState = PENDING;
@@ -538,7 +533,7 @@ void IDBRequest::transactionDidFinishAndDispatch() {
void IDBRequest::enqueueEvent(Event* event) {
DCHECK(m_readyState == PENDING || m_readyState == DONE);
- if (m_contextStopped || !getExecutionContext())
+ if (!getExecutionContext())
return;
DCHECK(m_readyState == PENDING || m_didFireUpgradeNeededEvent)
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBRequest.h ('k') | third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698