| Index: content/browser/indexed_db/indexed_db_backing_store.cc
|
| diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc
|
| index b6da42aebd8df604c5d4fa747f03e23f43f1504f..5733b6e1bb40fd957be544cf1a0b7e4125a09b7f 100644
|
| --- a/content/browser/indexed_db/indexed_db_backing_store.cc
|
| +++ b/content/browser/indexed_db/indexed_db_backing_store.cc
|
| @@ -396,48 +396,12 @@ enum IndexedDBBackingStoreOpenResult {
|
| INDEXED_DB_BACKING_STORE_OPEN_FAILED_UNKNOWN_ERR,
|
| INDEXED_DB_BACKING_STORE_OPEN_MEMORY_FAILED,
|
| INDEXED_DB_BACKING_STORE_OPEN_ATTEMPT_NON_ASCII,
|
| - INDEXED_DB_BACKING_STORE_OPEN_DISK_FULL,
|
| + INDEXED_DB_BACKING_STORE_OPEN_DISK_FULL_DEPRECATED,
|
| INDEXED_DB_BACKING_STORE_OPEN_ORIGIN_TOO_LONG,
|
| INDEXED_DB_BACKING_STORE_OPEN_NO_RECOVERY,
|
| INDEXED_DB_BACKING_STORE_OPEN_MAX,
|
| };
|
|
|
| -// TODO(dgrogan): Move to leveldb_env.
|
| -bool RecoveryCouldBeFruitful(leveldb::Status status) {
|
| - leveldb_env::MethodID method;
|
| - int error = -1;
|
| - leveldb_env::ErrorParsingResult result = leveldb_env::ParseMethodAndError(
|
| - status.ToString().c_str(), &method, &error);
|
| - switch (result) {
|
| - case leveldb_env::NONE:
|
| - return true;
|
| - case leveldb_env::METHOD_AND_PFE: {
|
| - base::PlatformFileError pfe = static_cast<base::PlatformFileError>(error);
|
| - switch (pfe) {
|
| - case base::PLATFORM_FILE_ERROR_TOO_MANY_OPENED:
|
| - case base::PLATFORM_FILE_ERROR_NO_MEMORY:
|
| - case base::PLATFORM_FILE_ERROR_NO_SPACE:
|
| - return false;
|
| - default:
|
| - return true;
|
| - }
|
| - }
|
| - case leveldb_env::METHOD_AND_ERRNO: {
|
| - switch (error) {
|
| - case EMFILE:
|
| - case ENOMEM:
|
| - case ENOSPC:
|
| - return false;
|
| - default:
|
| - return true;
|
| - }
|
| - }
|
| - default:
|
| - return true;
|
| - }
|
| - return true;
|
| -}
|
| -
|
| scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open(
|
| const std::string& origin_identifier,
|
| const base::FilePath& path_base,
|
| @@ -551,15 +515,11 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open(
|
|
|
| if (db) {
|
| HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_SUCCESS);
|
| - } else if (!RecoveryCouldBeFruitful(status)) {
|
| + } else if (leveldb_env::IsIOError(status)) {
|
| LOG(ERROR) << "Unable to open backing store, not trying to recover - "
|
| << status.ToString();
|
| HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_NO_RECOVERY);
|
| return scoped_refptr<IndexedDBBackingStore>();
|
| - } else if (*is_disk_full) {
|
| - LOG(ERROR) << "Unable to open backing store - disk is full.";
|
| - HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_DISK_FULL);
|
| - return scoped_refptr<IndexedDBBackingStore>();
|
| } else {
|
| LOG(ERROR) << "IndexedDB backing store open failed, attempting cleanup";
|
| *data_loss = WebKit::WebIDBCallbacks::DataLossTotal;
|
|
|