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

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

Issue 2808763007: IndexedDB: Clean up boilerplate when throwing TransactionInactiveError (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
index 3b290565d2e0e5a27684653c0313505b677d60ce..42a78671de8fa52ce90c7de31c11d6b623c4d6ba 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
@@ -485,6 +485,22 @@ ExecutionContext* IDBTransaction::GetExecutionContext() const {
return ContextLifecycleObserver::GetExecutionContext();
}
+const char* IDBTransaction::InactiveErrorMessage() const {
+ switch (state_) {
+ case kActive:
+ // Callers should check !IsActive() before calling.
+ NOTREACHED();
+ return nullptr;
+ case kInactive:
+ return IDBDatabase::kTransactionInactiveErrorMessage;
+ case kFinishing:
+ case kFinished:
+ return IDBDatabase::kTransactionFinishedErrorMessage;
+ }
+ NOTREACHED();
+ return nullptr;
+}
+
DispatchEventResult IDBTransaction::DispatchEventInternal(Event* event) {
IDB_TRACE("IDBTransaction::dispatchEvent");
if (!GetExecutionContext()) {
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698