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

Unified Diff: chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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: chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc b/chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc
index 05a2c4b31fa12936b475d467c3ced7b7a0aa4f9d..3aa9228a8892a43c64c60e4dd4b48277d399b415 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc
+++ b/chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc
@@ -10,6 +10,7 @@
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/sequenced_task_runner.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -209,7 +210,8 @@ void DeviceCloudPolicyInitializer::OnStoreError(CloudPolicyStore* store) {
void DeviceCloudPolicyInitializer::EnrollmentCompleted(
const EnrollmentCallback& enrollment_callback,
EnrollmentStatus status) {
- scoped_ptr<CloudPolicyClient> client = enrollment_handler_->ReleaseClient();
+ std::unique_ptr<CloudPolicyClient> client =
+ enrollment_handler_->ReleaseClient();
enrollment_handler_.reset();
if (status.status() == EnrollmentStatus::STATUS_SUCCESS) {
@@ -224,18 +226,16 @@ void DeviceCloudPolicyInitializer::EnrollmentCompleted(
enrollment_callback.Run(status);
}
-scoped_ptr<CloudPolicyClient> DeviceCloudPolicyInitializer::CreateClient(
+std::unique_ptr<CloudPolicyClient> DeviceCloudPolicyInitializer::CreateClient(
DeviceManagementService* device_management_service) {
scoped_refptr<net::URLRequestContextGetter> request_context =
new SystemPolicyRequestContext(
g_browser_process->system_request_context(), GetUserAgent());
- return make_scoped_ptr(
- new CloudPolicyClient(DeviceCloudPolicyManagerChromeOS::GetMachineID(),
- DeviceCloudPolicyManagerChromeOS::GetMachineModel(),
- kPolicyVerificationKeyHash,
- device_management_service,
- request_context));
+ return base::WrapUnique(new CloudPolicyClient(
+ DeviceCloudPolicyManagerChromeOS::GetMachineID(),
+ DeviceCloudPolicyManagerChromeOS::GetMachineModel(),
+ kPolicyVerificationKeyHash, device_management_service, request_context));
}
void DeviceCloudPolicyInitializer::TryToCreateClient() {
@@ -260,7 +260,7 @@ void DeviceCloudPolicyInitializer::TryToCreateClient() {
}
void DeviceCloudPolicyInitializer::StartConnection(
- scoped_ptr<CloudPolicyClient> client) {
+ std::unique_ptr<CloudPolicyClient> client) {
if (!manager_->core()->service())
manager_->StartConnection(std::move(client), install_attributes_);
}

Powered by Google App Engine
This is Rietveld 408576698