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

Side by Side Diff: components/exo/sub_surface.cc

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/exo/sub_surface.h" 5 #include "components/exo/sub_surface.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "base/trace_event/trace_event_argument.h" 9 #include "base/trace_event/trace_event_argument.h"
10 #include "components/exo/surface.h" 10 #include "components/exo/surface.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 parent_->PlaceSubSurfaceBelow(surface_, sibling); 73 parent_->PlaceSubSurfaceBelow(surface_, sibling);
74 } 74 }
75 75
76 void SubSurface::SetCommitBehavior(bool synchronized) { 76 void SubSurface::SetCommitBehavior(bool synchronized) {
77 TRACE_EVENT1("exo", "SubSurface::SetCommitBehavior", "synchronized", 77 TRACE_EVENT1("exo", "SubSurface::SetCommitBehavior", "synchronized",
78 synchronized); 78 synchronized);
79 79
80 is_synchronized_ = synchronized; 80 is_synchronized_ = synchronized;
81 } 81 }
82 82
83 scoped_refptr<base::trace_event::TracedValue> SubSurface::AsTracedValue() 83 scoped_ptr<base::trace_event::TracedValue> SubSurface::AsTracedValue() const {
84 const { 84 auto value = make_scoped_ptr(new base::trace_event::TracedValue);
85 scoped_refptr<base::trace_event::TracedValue> value =
86 new base::trace_event::TracedValue;
87 value->SetBoolean("is_synchronized", is_synchronized_); 85 value->SetBoolean("is_synchronized", is_synchronized_);
88 return value; 86 return value;
89 } 87 }
90 88
91 //////////////////////////////////////////////////////////////////////////////// 89 ////////////////////////////////////////////////////////////////////////////////
92 // SurfaceDelegate overrides: 90 // SurfaceDelegate overrides:
93 91
94 void SubSurface::OnSurfaceCommit() { 92 void SubSurface::OnSurfaceCommit() {
95 // Early out if commit should be synchronized with parent. 93 // Early out if commit should be synchronized with parent.
96 if (IsSurfaceSynchronized()) 94 if (IsSurfaceSynchronized())
(...skipping 20 matching lines...) Expand all
117 parent_ = nullptr; 115 parent_ = nullptr;
118 return; 116 return;
119 } 117 }
120 DCHECK(surface == surface_); 118 DCHECK(surface == surface_);
121 if (parent_) 119 if (parent_)
122 parent_->RemoveSubSurface(surface_); 120 parent_->RemoveSubSurface(surface_);
123 surface_ = nullptr; 121 surface_ = nullptr;
124 } 122 }
125 123
126 } // namespace exo 124 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698