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

Unified Diff: content/browser/indexed_db/indexed_db_transaction.cc

Issue 932143003: IndexedDB: Report QuotaExceededError when commit fails due to disk full (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move IndexedDBDatabaseError impl to cc file Created 5 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: content/browser/indexed_db/indexed_db_transaction.cc
diff --git a/content/browser/indexed_db/indexed_db_transaction.cc b/content/browser/indexed_db/indexed_db_transaction.cc
index 6609e02499b5da961c7d6e7c319aa0cf334df68f..88491dee201bfeb8158b9502dd1a74119754b9c8 100644
--- a/content/browser/indexed_db/indexed_db_transaction.cc
+++ b/content/browser/indexed_db/indexed_db_transaction.cc
@@ -15,6 +15,7 @@
#include "content/browser/indexed_db/indexed_db_tracing.h"
#include "content/browser/indexed_db/indexed_db_transaction_coordinator.h"
#include "third_party/WebKit/public/platform/WebIDBDatabaseException.h"
+#include "third_party/leveldatabase/env_chromium.h"
namespace content {
@@ -318,10 +319,17 @@ leveldb::Status IndexedDBTransaction::CommitPhaseTwo() {
while (!abort_task_stack_.empty())
abort_task_stack_.pop().Run(NULL);
- callbacks_->OnAbort(
- id_,
- IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError,
- "Internal error committing transaction."));
+ IndexedDBDatabaseError error;
+ if (leveldb_env::IndicatesDiskFull(s)) {
+ error = IndexedDBDatabaseError(
+ blink::WebIDBDatabaseExceptionQuotaError,
+ "Encountered disk full while committing transaction.");
+ } else {
+ error = IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError,
+ "Internal error committing transaction.");
+ }
+ callbacks_->OnAbort(id_, error);
+
database_->TransactionFinished(this, false);
database_->TransactionCommitFailed(s);
}

Powered by Google App Engine
This is Rietveld 408576698