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

Unified Diff: gpu/command_buffer/service/gpu_state_tracer.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
Index: gpu/command_buffer/service/gpu_state_tracer.cc
diff --git a/gpu/command_buffer/service/gpu_state_tracer.cc b/gpu/command_buffer/service/gpu_state_tracer.cc
index 7acc346547469d5755021e3c2a14bbf7be27f213..add3bf3acefd249605ef0d771f5204042ff3d4a1 100644
--- a/gpu/command_buffer/service/gpu_state_tracer.cc
+++ b/gpu/command_buffer/service/gpu_state_tracer.cc
@@ -19,7 +19,9 @@ const int kBytesPerPixel = 4;
class Snapshot : public base::trace_event::ConvertableToTraceFormat {
public:
- static scoped_refptr<Snapshot> Create(const ContextState* state);
+ static scoped_ptr<Snapshot> Create(const ContextState* state);
+
+ ~Snapshot() override {}
// Save a screenshot of the currently bound framebuffer.
bool SaveScreenshot(const gfx::Size& size);
@@ -29,7 +31,6 @@ class Snapshot : public base::trace_event::ConvertableToTraceFormat {
private:
explicit Snapshot(const ContextState* state);
- ~Snapshot() override {}
const ContextState* state_;
@@ -43,8 +44,8 @@ class Snapshot : public base::trace_event::ConvertableToTraceFormat {
Snapshot::Snapshot(const ContextState* state) : state_(state) {}
-scoped_refptr<Snapshot> Snapshot::Create(const ContextState* state) {
- return scoped_refptr<Snapshot>(new Snapshot(state));
+scoped_ptr<Snapshot> Snapshot::Create(const ContextState* state) {
+ return make_scoped_ptr(new Snapshot(state));
}
bool Snapshot::SaveScreenshot(const gfx::Size& size) {
@@ -116,17 +117,15 @@ void GPUStateTracer::TakeSnapshotWithCurrentFramebuffer(const gfx::Size& size) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
"GPUStateTracer::TakeSnapshotWithCurrentFramebuffer");
- scoped_refptr<Snapshot> snapshot(Snapshot::Create(state_));
+ scoped_ptr<Snapshot> snapshot(Snapshot::Create(state_));
// Only save a screenshot for now.
if (!snapshot->SaveScreenshot(size))
return;
- TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
- TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
- "gpu::State",
- state_,
- scoped_refptr<base::trace_event::ConvertableToTraceFormat>(snapshot));
+ TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
+ "gpu::State", state_,
+ std::move(snapshot));
}
} // namespace gles2

Powered by Google App Engine
This is Rietveld 408576698