| 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 904a284651a5220be85d53d13c6958292ac8756c..5fe8767263d41b14e068827d163a39eb32e1d5d1 100644
|
| --- a/content/browser/indexed_db/indexed_db_transaction.cc
|
| +++ b/content/browser/indexed_db/indexed_db_transaction.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/location.h"
|
| #include "base/logging.h"
|
| #include "base/memory/ptr_util.h"
|
| +#include "base/metrics/histogram_macros.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/stl_util.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| @@ -36,6 +37,41 @@ void CommitUnused(base::WeakPtr<IndexedDBTransaction> transaction) {
|
| DCHECK(status.ok());
|
| }
|
|
|
| +// Used for UMA metrics - do not change values.
|
| +enum UmaIDBException {
|
| + UmaIDBExceptionUnknownError = 0,
|
| + UmaIDBExceptionConstraintError = 1,
|
| + UmaIDBExceptionDataError = 2,
|
| + UmaIDBExceptionVersionError = 3,
|
| + UmaIDBExceptionAbortError = 4,
|
| + UmaIDBExceptionQuotaError = 5,
|
| + UmaIDBExceptionTimeoutError = 6,
|
| + UmaIDBExceptionExclusiveMaxValue = 7
|
| +};
|
| +
|
| +// Used for UMA metrics - do not change mappings.
|
| +UmaIDBException ExceptionCodeToUmaEnum(uint16_t code) {
|
| + switch (code) {
|
| + case blink::kWebIDBDatabaseExceptionUnknownError:
|
| + return UmaIDBExceptionUnknownError;
|
| + case blink::kWebIDBDatabaseExceptionConstraintError:
|
| + return UmaIDBExceptionConstraintError;
|
| + case blink::kWebIDBDatabaseExceptionDataError:
|
| + return UmaIDBExceptionDataError;
|
| + case blink::kWebIDBDatabaseExceptionVersionError:
|
| + return UmaIDBExceptionVersionError;
|
| + case blink::kWebIDBDatabaseExceptionAbortError:
|
| + return UmaIDBExceptionAbortError;
|
| + case blink::kWebIDBDatabaseExceptionQuotaError:
|
| + return UmaIDBExceptionQuotaError;
|
| + case blink::kWebIDBDatabaseExceptionTimeoutError:
|
| + return UmaIDBExceptionTimeoutError;
|
| + default:
|
| + NOTREACHED();
|
| + }
|
| + return UmaIDBExceptionUnknownError;
|
| +}
|
| +
|
| } // namespace
|
|
|
| IndexedDBTransaction::TaskQueue::TaskQueue() {}
|
| @@ -152,6 +188,10 @@ void IndexedDBTransaction::Abort(const IndexedDBDatabaseError& error) {
|
| if (state_ == FINISHED)
|
| return;
|
|
|
| + UMA_HISTOGRAM_ENUMERATION("WebCore.IndexedDB.TransactionAbortReason",
|
| + ExceptionCodeToUmaEnum(error.code()),
|
| + UmaIDBExceptionExclusiveMaxValue);
|
| +
|
| timeout_timer_.Stop();
|
|
|
| state_ = FINISHED;
|
|
|