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

Unified Diff: Source/WebCore/platform/leveldb/LevelDBDatabase.cpp

Issue 12779020: Merge 145824 "IndexedDB: Histogram leveldb open errors." (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/leveldb/LevelDBDatabase.cpp
===================================================================
--- Source/WebCore/platform/leveldb/LevelDBDatabase.cpp (revision 146075)
+++ Source/WebCore/platform/leveldb/LevelDBDatabase.cpp (working copy)
@@ -28,6 +28,7 @@
#if USE(LEVELDB)
+#include "HistogramSupport.h"
#include "LevelDBComparator.h"
#include "LevelDBIterator.h"
#include "LevelDBSlice.h"
@@ -156,6 +157,22 @@
const leveldb::Status s = openDB(comparatorAdapter.get(), leveldb::IDBEnv(), fileName, &db);
if (!s.ok()) {
+ enum {
+ LevelDBNotFound,
+ LevelDBCorruption,
+ LevelDBIOError,
+ LevelDBOther,
+ LevelDBMaxError
+ };
+ int levelDBError = LevelDBOther;
+ if (s.IsNotFound())
+ levelDBError = LevelDBNotFound;
+ else if (s.IsCorruption())
+ levelDBError = LevelDBCorruption;
+ else if (s.IsIOError())
+ levelDBError = LevelDBIOError;
+ HistogramSupport::histogramEnumeration("WebCore.IndexedDB.LevelDBOpenErrors", levelDBError, LevelDBMaxError);
+
LOG_ERROR("Failed to open LevelDB database from %s: %s", fileName.ascii().data(), s.ToString().c_str());
return nullptr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698