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

Unified Diff: cc/layers/layer_impl.cc

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/output/begin_frame_args.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index aa34a8d3a715f9adaddfe1d26ed702515f60423a..4066816bf06243183aa894d4e1dc6de08fa74877 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -94,6 +94,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
current_draw_mode_(DRAW_MODE_NONE),
element_id_(0),
mutable_properties_(MutableProperty::kNone),
+ debug_info_(nullptr),
force_render_surface_(false),
frame_timing_requests_dirty_(false),
visited_(false),
@@ -203,8 +204,9 @@ void LayerImpl::SetScrollParent(LayerImpl* parent) {
}
void LayerImpl::SetDebugInfo(
- scoped_refptr<base::trace_event::ConvertableToTraceFormat> other) {
- debug_info_ = other;
+ scoped_ptr<base::trace_event::ConvertableToTraceFormat> debug_info) {
+ owned_debug_info_ = std::move(debug_info);
+ debug_info_ = owned_debug_info_.get();
SetNeedsPushProperties();
}
@@ -609,7 +611,8 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
update_rect_.Union(layer->update_rect());
layer->SetUpdateRect(update_rect_);
- layer->SetDebugInfo(debug_info_);
+ if (owned_debug_info_)
danakj 2016/02/29 18:19:18 For my own understand, was it failing without this
Primiano Tucci (use gerrit) 2016/02/29 18:32:38 Yes precisely. It was not crashing but failing the
danakj 2016/02/29 19:19:07 There's only A & B. But I guess it means that we S
+ layer->SetDebugInfo(std::move(owned_debug_info_));
if (frame_timing_requests_dirty_) {
layer->SetFrameTimingRequests(frame_timing_requests_);
@@ -1644,7 +1647,7 @@ void LayerImpl::AsValueInto(base::trace_event::TracedValue* state) const {
if (LayerUtils::GetAnimationBounds(*this, &box))
MathUtil::AddToTracedValue("animation_bounds", box, state);
- if (debug_info_.get()) {
+ if (debug_info_) {
std::string str;
debug_info_->AppendAsTraceFormat(&str);
base::JSONReader json_reader;
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/output/begin_frame_args.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698