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

Unified Diff: gpu/command_buffer/service/gpu_state_tracer.cc

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 4 years, 8 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 | « gpu/command_buffer/service/gpu_state_tracer.h ('k') | gpu/command_buffer/service/gpu_tracer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 add3bf3acefd249605ef0d771f5204042ff3d4a1..f26d3dfcc21ddbe93fb3d0789aab99e235c341b8 100644
--- a/gpu/command_buffer/service/gpu_state_tracer.cc
+++ b/gpu/command_buffer/service/gpu_state_tracer.cc
@@ -6,6 +6,7 @@
#include "base/base64.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#include "context_state.h"
#include "ui/gfx/codec/png_codec.h"
@@ -19,7 +20,7 @@ const int kBytesPerPixel = 4;
class Snapshot : public base::trace_event::ConvertableToTraceFormat {
public:
- static scoped_ptr<Snapshot> Create(const ContextState* state);
+ static std::unique_ptr<Snapshot> Create(const ContextState* state);
~Snapshot() override {}
@@ -44,8 +45,8 @@ class Snapshot : public base::trace_event::ConvertableToTraceFormat {
Snapshot::Snapshot(const ContextState* state) : state_(state) {}
-scoped_ptr<Snapshot> Snapshot::Create(const ContextState* state) {
- return make_scoped_ptr(new Snapshot(state));
+std::unique_ptr<Snapshot> Snapshot::Create(const ContextState* state) {
+ return base::WrapUnique(new Snapshot(state));
}
bool Snapshot::SaveScreenshot(const gfx::Size& size) {
@@ -99,8 +100,9 @@ void Snapshot::AppendAsTraceFormat(std::string* out) const {
*out += "}";
}
-scoped_ptr<GPUStateTracer> GPUStateTracer::Create(const ContextState* state) {
- return scoped_ptr<GPUStateTracer>(new GPUStateTracer(state));
+std::unique_ptr<GPUStateTracer> GPUStateTracer::Create(
+ const ContextState* state) {
+ return std::unique_ptr<GPUStateTracer>(new GPUStateTracer(state));
}
GPUStateTracer::GPUStateTracer(const ContextState* state) : state_(state) {
@@ -117,7 +119,7 @@ void GPUStateTracer::TakeSnapshotWithCurrentFramebuffer(const gfx::Size& size) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
"GPUStateTracer::TakeSnapshotWithCurrentFramebuffer");
- scoped_ptr<Snapshot> snapshot(Snapshot::Create(state_));
+ std::unique_ptr<Snapshot> snapshot(Snapshot::Create(state_));
// Only save a screenshot for now.
if (!snapshot->SaveScreenshot(size))
« no previous file with comments | « gpu/command_buffer/service/gpu_state_tracer.h ('k') | gpu/command_buffer/service/gpu_tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698