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

Unified Diff: extensions/browser/extension_function_dispatcher.cc

Issue 234523002: Record extension function call histograms for synchronous functions too. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « extensions/browser/extension_function.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_function_dispatcher.cc
diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc
index d6420e32c425a596150a953c8c240da9222e4076..dd5f30a8f436c11ca87165b68fa10a1f0887acb9 100644
--- a/extensions/browser/extension_function_dispatcher.cc
+++ b/extensions/browser/extension_function_dispatcher.cc
@@ -9,6 +9,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/process/process.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -271,6 +272,8 @@ void ExtensionFunctionDispatcher::DispatchOnIOThread(
params.name,
args.Pass(),
static_cast<content::BrowserContext*>(profile_id));
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls",
+ function->histogram_value());
function->Run();
} else {
function->OnQuotaExceeded(violation_error);
@@ -377,6 +380,8 @@ void ExtensionFunctionDispatcher::DispatchWithCallbackInternal(
NotifyApiFunctionCalled(
extension->id(), params.name, args.Pass(), browser_context_);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls",
+ function->histogram_value());
function->Run();
} else {
function->OnQuotaExceeded(violation_error);
« no previous file with comments | « extensions/browser/extension_function.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698