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

Unified Diff: gpu/config/gpu_info.h

Issue 21682002: Expose GPU information to Telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactored more code into WebSocketBrowserConnection on nduca's request. Created 7 years, 4 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
Index: gpu/config/gpu_info.h
diff --git a/gpu/config/gpu_info.h b/gpu/config/gpu_info.h
index 98ab80ca300f0e44a0ae83fa1d1a413946fe9e8f..456f4e9d03bbc5dc8ac5ac696a35cab658715505 100644
--- a/gpu/config/gpu_info.h
+++ b/gpu/config/gpu_info.h
@@ -140,6 +140,41 @@ struct GPU_EXPORT GPUInfo {
// The information returned by the DirectX Diagnostics Tool.
DxDiagNode dx_diagnostics;
#endif
+ // Note: when adding new members, please remember to update EnumerateFields
+ // in gpu_info.cc.
+
+ // 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:
+ // The following methods apply to the "current" object. Initially this
+ // is the root object, but calls to BeginGPUDevice/EndGPUDevice and
+ // BeginAuxAttributes/EndAuxAttributes change the object to which these
+ // calls should apply.
+ virtual void AddInt64(const char* name, int64 value) = 0;
+ virtual void AddInt(const char* name, int value) = 0;
+ virtual void AddString(const char* name, const std::string& value) = 0;
+ virtual void AddBool(const char* name, bool value) = 0;
+ virtual void AddTimeDeltaInSecondsF(const char* name,
+ const base::TimeDelta& value) = 0;
+
+ // Markers indicating that a GPUDevice is being described.
+ virtual void BeginGPUDevice() = 0;
+ virtual void EndGPUDevice() = 0;
+
+ // Markers indicating that "auxiliary" attributes of the GPUInfo
+ // (according to the DevTools protocol) are being described.
+ virtual void BeginAuxAttributes() = 0;
+ virtual void EndAuxAttributes() = 0;
+
+ protected:
+ virtual ~Enumerator() {}
+ };
+
+ // Outputs the fields in this structure to the provided enumerator.
+ void EnumerateFields(Enumerator* enumerator) const;
};
} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698