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

Unified Diff: components/policy/core/common/remote_commands/remote_commands_service.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/remote_commands_service.cc
diff --git a/components/policy/core/common/remote_commands/remote_commands_service.cc b/components/policy/core/common/remote_commands/remote_commands_service.cc
index da7c79a2554622133949cdd8caddf1200e90ff79..c547f8e1155450b845e104b79660228f555538ca 100644
--- a/components/policy/core/common/remote_commands/remote_commands_service.cc
+++ b/components/policy/core/common/remote_commands/remote_commands_service.cc
@@ -20,7 +20,7 @@ namespace policy {
namespace em = enterprise_management;
RemoteCommandsService::RemoteCommandsService(
- scoped_ptr<RemoteCommandsFactory> factory,
+ std::unique_ptr<RemoteCommandsFactory> factory,
CloudPolicyClient* client)
: factory_(std::move(factory)), client_(client), weak_factory_(this) {
DCHECK(client_);
@@ -46,7 +46,7 @@ bool RemoteCommandsService::FetchRemoteCommands() {
std::vector<em::RemoteCommandResult> previous_results;
unsent_results_.swap(previous_results);
- scoped_ptr<RemoteCommandJob::UniqueIDType> id_to_acknowledge;
+ std::unique_ptr<RemoteCommandJob::UniqueIDType> id_to_acknowledge;
if (has_finished_command_) {
// Acknowledges |lastest_finished_command_id_|, and removes it and every
@@ -71,7 +71,7 @@ bool RemoteCommandsService::FetchRemoteCommands() {
}
void RemoteCommandsService::SetClockForTesting(
- scoped_ptr<base::TickClock> clock) {
+ std::unique_ptr<base::TickClock> clock) {
queue_.SetClockForTesting(std::move(clock));
}
@@ -90,7 +90,8 @@ void RemoteCommandsService::EnqueueCommand(
fetched_command_ids_.push_back(command.unique_id());
- scoped_ptr<RemoteCommandJob> job = factory_->BuildJobForType(command.type());
+ std::unique_ptr<RemoteCommandJob> job =
+ factory_->BuildJobForType(command.type());
if (!job || !job->Init(queue_.GetNowTicks(), command)) {
em::RemoteCommandResult ignored_result;
@@ -126,7 +127,8 @@ void RemoteCommandsService::OnJobFinished(RemoteCommandJob* command) {
result.set_result(em::RemoteCommandResult_ResultType_RESULT_SUCCESS);
else
result.set_result(em::RemoteCommandResult_ResultType_RESULT_FAILURE);
- const scoped_ptr<std::string> result_payload = command->GetResultPayload();
+ const std::unique_ptr<std::string> result_payload =
+ command->GetResultPayload();
if (result_payload)
result.set_payload(*result_payload);
} else if (command->status() == RemoteCommandJob::EXPIRED ||

Powered by Google App Engine
This is Rietveld 408576698