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

Unified Diff: cc/debug/layer_debug_info.h

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Petrcermak + oysteine review + LayerDebugInfo refptr wrapper Created 4 years, 10 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: cc/debug/layer_debug_info.h
diff --git a/cc/debug/layer_debug_info.h b/cc/debug/layer_debug_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..19aadbe06e4b1c30ef495fdafcda3d1d069638ce
--- /dev/null
+++ b/cc/debug/layer_debug_info.h
@@ -0,0 +1,39 @@
+// 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 CC_DEBUG_LAYER_DEBUG_INFO_H_
+#define CC_DEBUG_LAYER_DEBUG_INFO_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+namespace trace_event {
+class ConvertableToTraceFormat;
+}
+}
+
+namespace cc {
+
+// A wrapper around ConvertableToTraceFormat which allows shared (refcounted)
+// memory ownership of the Layer's DebugInfo.
+class LayerDebugInfo : public base::RefCounted<LayerDebugInfo> {
+ public:
+ explicit LayerDebugInfo(
+ scoped_ptr<base::trace_event::ConvertableToTraceFormat> raw);
+
+ void AppendAsTraceFormat(std::string* out) const;
+
+ private:
+ friend class base::RefCounted<LayerDebugInfo>;
+ virtual ~LayerDebugInfo();
+
+ scoped_ptr<base::trace_event::ConvertableToTraceFormat> raw_;
+
+ DISALLOW_COPY_AND_ASSIGN(LayerDebugInfo);
+};
+
+} // namespace cc
+
+#endif // CC_DEBUG_LAYER_DEBUG_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698