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

Unified Diff: cc/layers/layer.cc

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/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 5a7796c829869f6d373ba23274435bfb4b675c9c..192e9d7751c38cdacf4930096ec4ea5ddd46c641 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -22,6 +22,7 @@
#include "cc/animation/mutable_properties.h"
#include "cc/base/simple_enclosed_region.h"
#include "cc/debug/frame_viewer_instrumentation.h"
+#include "cc/debug/layer_debug_info.h"
#include "cc/input/main_thread_scrolling_reason.h"
#include "cc/layers/layer_client.h"
#include "cc/layers/layer_impl.h"
@@ -1228,10 +1229,12 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
: bounds_);
#if defined(NDEBUG)
- if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots())
- layer->SetDebugInfo(TakeDebugInfo());
+ if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots()) {
+ layer->SetDebugInfo(
+ make_scoped_refptr(new LayerDebugInfo(TakeDebugInfo())));
+ }
#else
- layer->SetDebugInfo(TakeDebugInfo());
+ layer->SetDebugInfo(make_scoped_refptr(new LayerDebugInfo(TakeDebugInfo())));
#endif
layer->SetTransformTreeIndex(transform_tree_index());
@@ -1750,8 +1753,7 @@ bool Layer::IsSuitableForGpuRasterization() const {
return true;
}
-scoped_refptr<base::trace_event::ConvertableToTraceFormat>
-Layer::TakeDebugInfo() {
+scoped_ptr<base::trace_event::ConvertableToTraceFormat> Layer::TakeDebugInfo() {
if (client_)
return client_->TakeDebugInfo(this);
else
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_client.h » ('j') | cc/layers/layer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698