Index: cc/rendering_stats.h |
diff --git a/cc/rendering_stats.h b/cc/rendering_stats.h |
index d26cc805256efcc64f781dd27e5ab9e0f4f80e2b..61112504e3756094aba2a9054fe589949247c34c 100644 |
--- a/cc/rendering_stats.h |
+++ b/cc/rendering_stats.h |
@@ -6,6 +6,7 @@ |
#define CC_RENDERING_STATS_H_ |
#include "base/basictypes.h" |
+#include "base/time.h" |
#include "cc/cc_export.h" |
namespace cc { |
@@ -24,8 +25,29 @@ struct CC_EXPORT RenderingStats { |
int64 numImplThreadScrolls; |
int64 numMainThreadScrolls; |
int64 numLayersDrawn; |
+ // Note: when adding new members, please remember to update enumerateFields |
+ // in rendering_stats.cc. |
RenderingStats(); |
+ |
+ // 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 AddInt64(const char* name, int64 value) = 0; |
+ virtual void AddDouble(const char* name, double value) = 0; |
+ virtual void AddInt(const char* name, int value) = 0; |
+ virtual void AddTimeDeltaInSecondsF(const char* name, |
+ const base::TimeDelta& value) = 0; |
+ |
+ protected: |
+ virtual ~Enumerator() { } |
+ }; |
+ |
+ // Outputs the fields in this structure to the provided enumerator. |
+ void EnumerateFields(Enumerator* enumerator) const; |
}; |
} // namespace cc |