summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-20 16:42:37 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-20 16:42:37 +0000
commit13d78357b67a1ff157bae80de237d1a9796424ff (patch)
tree1599c4fa57522375389c97e789d02c1dc0dd743a
parent19bdeb6127e16d6edb970b6892808de580fa935a (diff)
downloadchromium_src-13d78357b67a1ff157bae80de237d1a9796424ff.zip
chromium_src-13d78357b67a1ff157bae80de237d1a9796424ff.tar.gz
chromium_src-13d78357b67a1ff157bae80de237d1a9796424ff.tar.bz2
Add some histograms to help measure extension context menu performance
BUG=49560 TEST=none (no user-visible changes) Review URL: http://codereview.chromium.org/3022013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53051 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 05b22e7..62cffc8 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -11,9 +11,11 @@
#include "app/clipboard/scoped_clipboard_writer.h"
#include "app/l10n_util.h"
#include "base/command_line.h"
+#include "base/histogram.h"
#include "base/logging.h"
#include "base/stl_util-inl.h"
#include "base/string_util.h"
+#include "base/time.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
@@ -311,12 +313,19 @@ void RenderViewContextMenu::AppendAllExtensionItems() {
// TODO(asargent) - See if this works properly for i18n names (bug 32363).
std::sort(sorted_ids.begin(), sorted_ids.end());
+ if (sorted_ids.empty())
+ return;
+
int index = 0;
+ base::TimeTicks begin = base::TimeTicks::Now();
std::vector<std::pair<std::string, std::string> >::const_iterator i;
for (i = sorted_ids.begin();
i != sorted_ids.end(); ++i) {
AppendExtensionItems(i->second, &index);
}
+ UMA_HISTOGRAM_TIMES("Extensions.ContextMenus_BuildTime",
+ base::TimeTicks::Now() - begin);
+ UMA_HISTOGRAM_COUNTS("Extensions.ContextMenus_ItemCount", index);
}
void RenderViewContextMenu::InitMenu() {