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

Unified Diff: components/policy/core/common/remote_commands/test_remote_command_job.cc

Issue 1902633006: Convert //components/policy from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and use namespace alias 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
Index: components/policy/core/common/remote_commands/test_remote_command_job.cc
diff --git a/components/policy/core/common/remote_commands/test_remote_command_job.cc b/components/policy/core/common/remote_commands/test_remote_command_job.cc
index eccb6d1eb22993e5f841b650f4215d5f13385a23..ccb2c039202bc5989b8175e2133f8cf762556b35 100644
--- a/components/policy/core/common/remote_commands/test_remote_command_job.cc
+++ b/components/policy/core/common/remote_commands/test_remote_command_job.cc
@@ -4,12 +4,14 @@
#include "components/policy/core/common/remote_commands/test_remote_command_job.h"
+#include <memory>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
@@ -28,7 +30,7 @@ class TestRemoteCommandJob::EchoPayload
explicit EchoPayload(const std::string& payload) : payload_(payload) {}
// RemoteCommandJob::ResultPayload:
- scoped_ptr<std::string> Serialize() override;
+ std::unique_ptr<std::string> Serialize() override;
private:
const std::string payload_;
@@ -36,8 +38,8 @@ class TestRemoteCommandJob::EchoPayload
DISALLOW_COPY_AND_ASSIGN(EchoPayload);
};
-scoped_ptr<std::string> TestRemoteCommandJob::EchoPayload::Serialize() {
- return make_scoped_ptr(new std::string(payload_));
+std::unique_ptr<std::string> TestRemoteCommandJob::EchoPayload::Serialize() {
+ return base::WrapUnique(new std::string(payload_));
}
TestRemoteCommandJob::TestRemoteCommandJob(bool succeed,
@@ -66,7 +68,8 @@ bool TestRemoteCommandJob::IsExpired(base::TimeTicks now) {
void TestRemoteCommandJob::RunImpl(const CallbackWithResult& succeed_callback,
const CallbackWithResult& failed_callback) {
- scoped_ptr<ResultPayload> echo_payload(new EchoPayload(command_payload_));
+ std::unique_ptr<ResultPayload> echo_payload(
+ new EchoPayload(command_payload_));
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::Bind(succeed_ ? succeed_callback : failed_callback,
base::Passed(&echo_payload)),

Powered by Google App Engine
This is Rietveld 408576698