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

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

Issue 1479923002: Enumerate the return value of dispatchEvent so it is clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_passive_uma_add
Patch Set: Fix typo Created 4 years, 10 months 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 ad24e92427c36faaf472b84d7172b97c3c1842a7..7c51ae712c1031a3eee5acf5fbd38b9687509b8d 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
@@ -410,11 +410,11 @@ ExecutionContext* IDBRequest::executionContext() const
return ActiveDOMObject::executionContext();
}
-bool IDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
+DispatchEventResult IDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
{
IDB_TRACE("IDBRequest::dispatchEvent");
if (m_contextStopped || !executionContext())
- return false;
+ return DispatchEventResult::CanceledBeforeDispatch;
ASSERT(m_readyState == PENDING);
ASSERT(m_hasPendingActivity);
ASSERT(m_enqueuedEvents.size());
@@ -457,7 +457,7 @@ bool IDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
if (setTransactionActive)
m_transaction->setActive(true);
- bool dontPreventDefault = IDBEventDispatcher::dispatch(event.get(), targets);
+ DispatchEventResult dispatchResult = IDBEventDispatcher::dispatch(event.get(), targets);
if (m_transaction) {
if (m_readyState == DONE)
@@ -465,7 +465,7 @@ bool IDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
// Possibly abort the transaction. This must occur after unregistering (so this request
// doesn't receive a second error) and before deactivating (which might trigger commit).
- if (event->type() == EventTypeNames::error && dontPreventDefault && !m_requestAborted) {
+ if (event->type() == EventTypeNames::error && dispatchResult == DispatchEventResult::NotCanceled && !m_requestAborted) {
m_transaction->setError(m_error);
m_transaction->abort(IGNORE_EXCEPTION);
}
@@ -483,7 +483,7 @@ bool IDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
if (m_readyState == DONE && event->type() != EventTypeNames::upgradeneeded)
m_hasPendingActivity = false;
- return dontPreventDefault;
+ return dispatchResult;
}
void IDBRequest::uncaughtExceptionInEventHandler()
« 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