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

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: Add back the EventDispatchResult enum 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..6832c9ea834aa8ccf813b98d9cdf3396c07bd6d6 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)
+EventTarget::DispatchEventResult IDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
{
IDB_TRACE("IDBRequest::dispatchEvent");
if (m_contextStopped || !executionContext())
- return false;
+ return EventTarget::DispatchEventResult::HandledSuppressed;
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);
+ EventTarget::DispatchEventResult eventResult = 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 && eventResult == EventTarget::DispatchEventResult::NotHandled && !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 eventResult;
}
void IDBRequest::uncaughtExceptionInEventHandler()

Powered by Google App Engine
This is Rietveld 408576698