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

Unified Diff: content/common/gpu/gpu_rendering_stats.h

Issue 11027009: Use WebRenderingStats::Enumerate to populate benchmarking extension renderingStats() fields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « no previous file | content/renderer/gpu/gpu_benchmarking_extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_rendering_stats.h
diff --git a/content/common/gpu/gpu_rendering_stats.h b/content/common/gpu/gpu_rendering_stats.h
index e7cad9160439626ba8d05f71e964d1be06cf4539..c2b919155b19dbb70566128a64df6de862d6c4af 100644
--- a/content/common/gpu/gpu_rendering_stats.h
+++ b/content/common/gpu/gpu_rendering_stats.h
@@ -20,6 +20,30 @@ struct CONTENT_EXPORT GpuRenderingStats {
base::TimeDelta total_texture_upload_time;
base::TimeDelta global_total_processing_commands_time;
base::TimeDelta total_processing_commands_time;
+
+ // In conjunction with enumerateFields, this allows the embedder to
+ // enumerate the values in this structure without
+ // having to embed references to its specific member variables. This
+ // simplifies the addition of new fields to this type.
+ class Enumerator {
+ public:
+ virtual void addInt(const char* name, int value) = 0;
+ virtual void addTimeDelta(const char* name, base::TimeDelta value) = 0;
+ protected:
+ virtual ~Enumerator() { }
+ };
+
+ // Outputs the fields in this structure to the provided enumerator.
+ void enumerateFields(Enumerator* enumerator) const {
+ enumerator->addInt("globalTextureUploadCount", global_texture_upload_count);
+ enumerator->addTimeDelta("totalTextureUploadTime",
+ total_texture_upload_time);
+ enumerator->addInt("textureUploadCount", texture_upload_count);
+ enumerator->addTimeDelta("globalTotalProcessingCommandsTime",
+ global_total_processing_commands_time);
+ enumerator->addTimeDelta("totalProcessingCommandsTime",
+ total_processing_commands_time);
+ }
};
} // namespace content
« no previous file with comments | « no previous file | content/renderer/gpu/gpu_benchmarking_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698