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

Unified Diff: ui/compositor/layer.cc

Issue 135493002: Plumb debug name via debug info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « ui/compositor/layer.h ('k') | webkit/renderer/compositor_bindings/web_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 7f6f6838d56301c68f64c27dd750d9716b4268dc..2a466984bdbd00831a359339e1ce5c4f3825975d 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -662,13 +662,20 @@ void Layer::SetForceRenderSurface(bool force) {
cc_layer_->SetForceRenderSurface(force_render_surface_);
}
-std::string Layer::DebugName() {
- return name_;
-}
+class LayerDebugInfo : public base::debug::ConvertableToTraceFormat {
+ public:
+ explicit LayerDebugInfo(std::string name) : name_(name) { }
+ virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
+ out->append("{'layer_name', '" + name_ + "'}");
+ }
+
+ private:
+ virtual ~LayerDebugInfo() { }
+ std::string name_;
+};
scoped_refptr<base::debug::ConvertableToTraceFormat> Layer::TakeDebugInfo() {
- // TODO: return something useful here.
- return NULL;
+ return new LayerDebugInfo(name_);
}
void Layer::OnAnimationStarted(const cc::AnimationEvent& event) {
« no previous file with comments | « ui/compositor/layer.h ('k') | webkit/renderer/compositor_bindings/web_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698