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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp

Issue 1652983005: Remove Enumeration Histograms from the Blink Platform API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_blink_histograms_5a
Patch Set: Fix misplaced bracket on android Created 4 years, 11 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: third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp
index 631f1daae1c5073877f7d4e907b4f325650a80b6..d6aa866adca465cdbd3cd41f23c161a1304d4a78 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp
@@ -36,13 +36,12 @@
#include "core/inspector/ScriptCallStack.h"
#include "modules/indexeddb/IDBAny.h"
#include "modules/indexeddb/IDBEventDispatcher.h"
-#include "modules/indexeddb/IDBHistograms.h"
#include "modules/indexeddb/IDBIndex.h"
#include "modules/indexeddb/IDBKeyPath.h"
#include "modules/indexeddb/IDBTracing.h"
#include "modules/indexeddb/IDBVersionChangeEvent.h"
#include "modules/indexeddb/WebIDBDatabaseCallbacksImpl.h"
-#include "public/platform/Platform.h"
+#include "platform/Histogram.h"
#include "public/platform/modules/indexeddb/WebIDBKeyPath.h"
#include "public/platform/modules/indexeddb/WebIDBTypes.h"
#include "wtf/Atomics.h"
@@ -181,7 +180,8 @@ void IDBDatabase::version(UnsignedLongLongOrString& result) const
IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyPath& keyPath, bool autoIncrement, ExceptionState& exceptionState)
{
IDB_TRACE("IDBDatabase::createObjectStore");
- Platform::current()->histogramEnumeration("WebCore.IndexedDB.FrontEndAPICalls", IDBCreateObjectStoreCall, IDBMethodsMax);
+ recordApiCallsHistogram(IDBCreateObjectStoreCall);
+
if (!m_versionChangeTransaction) {
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::notVersionChangeTransactionErrorMessage);
return nullptr;
@@ -230,7 +230,7 @@ IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyP
void IDBDatabase::deleteObjectStore(const String& name, ExceptionState& exceptionState)
{
IDB_TRACE("IDBDatabase::deleteObjectStore");
- Platform::current()->histogramEnumeration("WebCore.IndexedDB.FrontEndAPICalls", IDBDeleteObjectStoreCall, IDBMethodsMax);
+ recordApiCallsHistogram(IDBDeleteObjectStoreCall);
if (!m_versionChangeTransaction) {
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::notVersionChangeTransactionErrorMessage);
return;
@@ -263,7 +263,7 @@ void IDBDatabase::deleteObjectStore(const String& name, ExceptionState& exceptio
IDBTransaction* IDBDatabase::transaction(ScriptState* scriptState, const StringOrStringSequenceOrDOMStringList& storeNames, const String& modeString, ExceptionState& exceptionState)
{
IDB_TRACE("IDBDatabase::transaction");
- Platform::current()->histogramEnumeration("WebCore.IndexedDB.FrontEndAPICalls", IDBTransactionCall, IDBMethodsMax);
+ recordApiCallsHistogram(IDBTransactionCall);
HashSet<String> scope;
if (storeNames.isString()) {
@@ -454,4 +454,10 @@ ExecutionContext* IDBDatabase::executionContext() const
return ActiveDOMObject::executionContext();
}
+void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method)
+{
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, apiCallsHistogram, new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", IDBMethodsMax));
+ apiCallsHistogram.count(method);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698