Index: services/gfx/compositor/graph/scene_label.h |
diff --git a/services/gfx/compositor/graph/scene_label.h b/services/gfx/compositor/graph/scene_label.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bc474c5d977443bfb04fbd05ac025011c9e4987a |
--- /dev/null |
+++ b/services/gfx/compositor/graph/scene_label.h |
@@ -0,0 +1,37 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_LABEL_H_ |
+#define SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_LABEL_H_ |
+ |
+#include <string> |
+ |
+namespace compositor { |
+ |
+// Convenience class for formatting descriptive labels for diagnostics. |
+class SceneLabel { |
+ public: |
+ SceneLabel(uint32_t token, const std::string& label); |
+ SceneLabel(const SceneLabel& other); |
+ ~SceneLabel(); |
+ |
+ // Gets the scene token. |
+ uint32_t token() const { return token_; } |
+ |
+ // Gets the user-supplied label of the scene. |
+ const std::string& label() const { return label_; } |
+ |
+ // Gets a descriptive label including optional version and node information. |
+ std::string FormattedLabel() const; |
+ std::string FormattedLabelForVersion(uint32_t version) const; |
+ std::string FormattedLabelForNode(uint32_t version, uint32_t node_id) const; |
+ |
+ private: |
+ uint32_t const token_; |
+ std::string const label_; |
+}; |
+ |
+} // namespace compositor |
+ |
+#endif // SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_LABEL_H_ |