summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/dom_storage/session_storage_database.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/webkit/dom_storage/session_storage_database.cc b/webkit/dom_storage/session_storage_database.cc
index b22ea30..d3613d4 100644
--- a/webkit/dom_storage/session_storage_database.cc
+++ b/webkit/dom_storage/session_storage_database.cc
@@ -6,6 +6,7 @@
#include "base/file_util.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
#include "base/stringprintf.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
@@ -16,6 +17,19 @@
#include "third_party/leveldatabase/src/include/leveldb/options.h"
#include "third_party/leveldatabase/src/include/leveldb/write_batch.h"
+#define SESSION_STORAGE_UMA_NAME "SessionStorageDatabase.Open"
+
+namespace {
+
+enum SessionStorageUMA {
+ SESSION_STORAGE_UMA_SUCCESS,
+ SESSION_STORAGE_UMA_RECREATED,
+ SESSION_STORAGE_UMA_FAIL,
+ SESSION_STORAGE_UMA_MAX
+};
+
+} // namespace
+
// Layout of the database:
// | key | value |
// -----------------------------------------------------------------------
@@ -286,10 +300,20 @@ bool SessionStorageDatabase::LazyOpen(bool create_if_needed) {
if (!s.ok()) {
LOG(WARNING) << "Failed to open leveldb in " << file_path_.value()
<< ", error: " << s.ToString();
+ UMA_HISTOGRAM_ENUMERATION(SESSION_STORAGE_UMA_NAME,
+ SESSION_STORAGE_UMA_FAIL,
+ SESSION_STORAGE_UMA_MAX);
DCHECK(db == NULL);
db_error_ = true;
return false;
}
+ UMA_HISTOGRAM_ENUMERATION(SESSION_STORAGE_UMA_NAME,
+ SESSION_STORAGE_UMA_RECREATED,
+ SESSION_STORAGE_UMA_MAX);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION(SESSION_STORAGE_UMA_NAME,
+ SESSION_STORAGE_UMA_SUCCESS,
+ SESSION_STORAGE_UMA_MAX);
}
db_.reset(db);
return true;