summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorvangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 03:20:09 +0000
committervangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 03:20:09 +0000
commit557d0b9fc260031413aa035d7bf923aa54d97352 (patch)
tree425dddfb8a8b6fa353a2d49c477eba30972ea4ff /content
parent33aea5c515a1164063b155309d3704aa1310d705 (diff)
downloadchromium_src-557d0b9fc260031413aa035d7bf923aa54d97352.zip
chromium_src-557d0b9fc260031413aa035d7bf923aa54d97352.tar.gz
chromium_src-557d0b9fc260031413aa035d7bf923aa54d97352.tar.bz2
Add a histogram at GPU process exit time to record the number of surfaces the
GPU process was rendering to. It should correspond to the number of tabs with accelereted content. BUG=158469 Review URL: https://chromiumcodereview.appspot.com/11415108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/gpu/gpu_process_host.cc3
-rw-r--r--content/browser/gpu/gpu_surface_tracker.cc5
-rw-r--r--content/browser/gpu/gpu_surface_tracker.h3
3 files changed, 11 insertions, 0 deletions
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 7420656..3bf54d2 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -408,6 +408,9 @@ GpuProcessHost::~GpuProcessHost() {
status,
base::TERMINATION_STATUS_MAX_ENUM);
+ UMA_HISTOGRAM_COUNTS_100("GPU.SurfaceCountAtExit",
+ GpuSurfaceTracker::Get()->GetSurfaceCount());
+
if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION ||
status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) {
UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessExitCode",
diff --git a/content/browser/gpu/gpu_surface_tracker.cc b/content/browser/gpu/gpu_surface_tracker.cc
index dd451ef..59992d5 100644
--- a/content/browser/gpu/gpu_surface_tracker.cc
+++ b/content/browser/gpu/gpu_surface_tracker.cc
@@ -115,4 +115,9 @@ void GpuSurfaceTracker::SetNativeWidget(
it->second.native_widget = widget;
}
+std::size_t GpuSurfaceTracker::GetSurfaceCount() {
+ base::AutoLock lock(lock_);
+ return surface_map_.size();
+}
+
} // namespace content
diff --git a/content/browser/gpu/gpu_surface_tracker.h b/content/browser/gpu/gpu_surface_tracker.h
index cf36b72..cc5ac39 100644
--- a/content/browser/gpu/gpu_surface_tracker.h
+++ b/content/browser/gpu/gpu_surface_tracker.h
@@ -72,6 +72,9 @@ class GpuSurfaceTracker : public GpuSurfaceLookup {
// does not exist. This is an O(log N) lookup.
gfx::PluginWindowHandle GetSurfaceWindowHandle(int surface_id);
+ // Returns the number of surfaces currently registered with the tracker.
+ std::size_t GetSurfaceCount();
+
// Gets the global instance of the surface tracker. Identical to Get(), but
// named that way for the implementation of Singleton.
static GpuSurfaceTracker* GetInstance();