Replace brillo::make_unique_ptr with base::MakeUnique/base::WrapUnique.
base::MakeUnique mimics std::make_unique and is preferred over
brillo::make_unique_ptr (which is identical to base::WrapUnique).
brillo::make_unique_ptr will eventually be deprecated and removed as its
functionality is well covered by base::MakeUnique and base::WrapUnique.
BUG=chromium:704644
TEST=Run unit tests.
Change-Id: I771b312d04643a1c74dd843947ed30bda510eed2
Reviewed-on: https://chromium-review.googlesource.com/458562
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Alex Deymo <deymo@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/boot_control_android.cc b/boot_control_android.cc
index e3ea66d..8c1603b 100644
--- a/boot_control_android.cc
+++ b/boot_control_android.cc
@@ -20,7 +20,6 @@
#include <base/files/file_util.h>
#include <base/logging.h>
#include <base/strings/string_util.h>
-#include <brillo/make_unique_ptr.h>
#include <brillo/message_loops/message_loop.h>
#include "update_engine/common/utils.h"
diff --git a/boot_control_chromeos.cc b/boot_control_chromeos.cc
index e9ad698..aa94d3c 100644
--- a/boot_control_chromeos.cc
+++ b/boot_control_chromeos.cc
@@ -22,7 +22,6 @@
#include <base/files/file_path.h>
#include <base/files/file_util.h>
#include <base/strings/string_util.h>
-#include <brillo/make_unique_ptr.h>
#include <rootdev/rootdev.h>
extern "C" {
diff --git a/boot_control_recovery.cc b/boot_control_recovery.cc
index 39b5ff1..b74f4aa 100644
--- a/boot_control_recovery.cc
+++ b/boot_control_recovery.cc
@@ -20,7 +20,6 @@
#include <base/files/file_util.h>
#include <base/logging.h>
#include <base/strings/string_util.h>
-#include <brillo/make_unique_ptr.h>
#include <brillo/message_loops/message_loop.h>
#include "update_engine/common/utils.h"
diff --git a/connection_manager_unittest.cc b/connection_manager_unittest.cc
index f814667..547539b 100644
--- a/connection_manager_unittest.cc
+++ b/connection_manager_unittest.cc
@@ -21,7 +21,6 @@
#include <base/logging.h>
#include <brillo/any.h>
-#include <brillo/make_unique_ptr.h>
#include <brillo/message_loops/fake_message_loop.h>
#include <brillo/variant_dictionary.h>
#include <gmock/gmock.h>
diff --git a/hardware_android.cc b/hardware_android.cc
index d4a6838..1793e48 100644
--- a/hardware_android.cc
+++ b/hardware_android.cc
@@ -25,8 +25,8 @@
#include <bootloader.h>
#include <base/files/file_util.h>
+#include <base/memory/ptr_util.h>
#include <base/strings/stringprintf.h>
-#include <brillo/make_unique_ptr.h>
#include <cutils/properties.h>
#include "update_engine/common/hardware.h"
@@ -95,7 +95,7 @@
// Factory defined in hardware.h.
std::unique_ptr<HardwareInterface> CreateHardware() {
- return brillo::make_unique_ptr(new HardwareAndroid());
+ return base::MakeUnique<HardwareAndroid>();
}
} // namespace hardware
diff --git a/hardware_chromeos.cc b/hardware_chromeos.cc
index 47beea8..8c19aa7 100644
--- a/hardware_chromeos.cc
+++ b/hardware_chromeos.cc
@@ -22,7 +22,6 @@
#include <base/strings/string_number_conversions.h>
#include <base/strings/string_util.h>
#include <brillo/key_value_store.h>
-#include <brillo/make_unique_ptr.h>
#include <debugd/dbus-constants.h>
#include <vboot/crossystem.h>
diff --git a/network_selector_android.cc b/network_selector_android.cc
index 6879b69..5edfe40 100644
--- a/network_selector_android.cc
+++ b/network_selector_android.cc
@@ -18,7 +18,7 @@
#include <android/multinetwork.h>
#include <base/logging.h>
-#include <brillo/make_unique_ptr.h>
+#include <base/memory/ptr_util.h>
namespace chromeos_update_engine {
@@ -26,7 +26,7 @@
// Factory defined in network_selector.h.
std::unique_ptr<NetworkSelectorInterface> CreateNetworkSelector() {
- return brillo::make_unique_ptr(new NetworkSelectorAndroid());
+ return base::MakeUnique<NetworkSelectorAndroid>();
}
} // namespace network
diff --git a/network_selector_stub.cc b/network_selector_stub.cc
index 218d454..e9569a2 100644
--- a/network_selector_stub.cc
+++ b/network_selector_stub.cc
@@ -17,7 +17,7 @@
#include "update_engine/network_selector_stub.h"
#include <base/logging.h>
-#include <brillo/make_unique_ptr.h>
+#include <base/memory/ptr_util.h>
namespace chromeos_update_engine {
@@ -25,7 +25,7 @@
// Factory defined in network_selector.h.
std::unique_ptr<NetworkSelectorInterface> CreateNetworkSelector() {
- return brillo::make_unique_ptr(new NetworkSelectorStub());
+ return base::MakeUnique<NetworkSelectorStub>();
}
} // namespace network
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index 8c92d00..c7ef0c7 100644
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -24,12 +24,12 @@
#include <base/bind.h>
#include <base/files/file_util.h>
#include <base/files/scoped_temp_dir.h>
+#include <base/memory/ptr_util.h>
#include <base/strings/string_number_conversions.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <base/time/time.h>
#include <brillo/bind_lambda.h>
-#include <brillo/make_unique_ptr.h>
#include <brillo/message_loops/fake_message_loop.h>
#include <brillo/message_loops/message_loop.h>
#include <brillo/message_loops/message_loop_utils.h>
@@ -321,7 +321,7 @@
fake_system_state_.set_request_params(request_params);
OmahaRequestAction action(&fake_system_state_,
nullptr,
- brillo::make_unique_ptr(fetcher),
+ base::WrapUnique(fetcher),
ping_only);
OmahaRequestActionTestProcessorDelegate delegate;
delegate.expected_code_ = expected_code;
@@ -380,7 +380,7 @@
fake_system_state.set_request_params(¶ms);
OmahaRequestAction action(&fake_system_state,
event,
- brillo::make_unique_ptr(fetcher),
+ base::WrapUnique(fetcher),
false);
OmahaRequestActionTestProcessorDelegate delegate;
ActionProcessor processor;
@@ -471,8 +471,8 @@
MockHttpFetcher* fetcher =
new MockHttpFetcher(http_response.data(), http_response.size(), nullptr);
- OmahaRequestAction action(
- &fake_system_state_, nullptr, brillo::make_unique_ptr(fetcher), false);
+ OmahaRequestAction action(&fake_system_state_, nullptr,
+ base::WrapUnique(fetcher), false);
ActionProcessor processor;
processor.EnqueueAction(&action);
@@ -1100,12 +1100,13 @@
OmahaRequestParams params = request_params_;
fake_system_state_.set_request_params(¶ms);
- OmahaRequestAction action(&fake_system_state_, nullptr,
- brillo::make_unique_ptr(
- new MockHttpFetcher(http_response.data(),
- http_response.size(),
- nullptr)),
- false);
+ OmahaRequestAction action(
+ &fake_system_state_,
+ nullptr,
+ base::MakeUnique<MockHttpFetcher>(http_response.data(),
+ http_response.size(),
+ nullptr),
+ false);
OmahaRequestActionTestProcessorDelegate delegate;
ActionProcessor processor;
processor.set_delegate(&delegate);
@@ -1272,12 +1273,13 @@
loop.SetAsCurrent();
string http_response("doesn't matter");
- OmahaRequestAction action(&fake_system_state_, nullptr,
- brillo::make_unique_ptr(
- new MockHttpFetcher(http_response.data(),
- http_response.size(),
- nullptr)),
- false);
+ OmahaRequestAction action(
+ &fake_system_state_,
+ nullptr,
+ base::MakeUnique<MockHttpFetcher>(http_response.data(),
+ http_response.size(),
+ nullptr),
+ false);
TerminateEarlyTestProcessorDelegate delegate;
ActionProcessor processor;
processor.set_delegate(&delegate);
@@ -1487,10 +1489,9 @@
OmahaRequestAction update_check_action(
&fake_system_state_,
nullptr,
- brillo::make_unique_ptr(
- new MockHttpFetcher(http_response.data(),
- http_response.size(),
- nullptr)),
+ base::MakeUnique<MockHttpFetcher>(http_response.data(),
+ http_response.size(),
+ nullptr),
false);
EXPECT_FALSE(update_check_action.IsEvent());
@@ -1499,10 +1500,9 @@
OmahaRequestAction event_action(
&fake_system_state_,
new OmahaEvent(OmahaEvent::kTypeUpdateComplete),
- brillo::make_unique_ptr(
- new MockHttpFetcher(http_response.data(),
- http_response.size(),
- nullptr)),
+ base::MakeUnique<MockHttpFetcher>(http_response.data(),
+ http_response.size(),
+ nullptr),
false);
EXPECT_TRUE(event_action.IsEvent());
}
diff --git a/payload_consumer/bzip_extent_writer_unittest.cc b/payload_consumer/bzip_extent_writer_unittest.cc
index 8ac3e59..6b5e1c0 100644
--- a/payload_consumer/bzip_extent_writer_unittest.cc
+++ b/payload_consumer/bzip_extent_writer_unittest.cc
@@ -22,7 +22,7 @@
#include <string>
#include <vector>
-#include <brillo/make_unique_ptr.h>
+#include <base/memory/ptr_util.h>
#include <gtest/gtest.h>
#include "update_engine/common/test_utils.h"
@@ -70,8 +70,7 @@
0x22, 0x9c, 0x28, 0x48, 0x66, 0x61, 0xb8, 0xea, 0x00,
};
- BzipExtentWriter bzip_writer(
- brillo::make_unique_ptr(new DirectExtentWriter()));
+ BzipExtentWriter bzip_writer(base::MakeUnique<DirectExtentWriter>());
EXPECT_TRUE(bzip_writer.Init(fd_, extents, kBlockSize));
EXPECT_TRUE(bzip_writer.Write(test, sizeof(test)));
EXPECT_TRUE(bzip_writer.End());
@@ -108,8 +107,7 @@
extent.set_num_blocks((kDecompressedLength + kBlockSize - 1) / kBlockSize);
extents.push_back(extent);
- BzipExtentWriter bzip_writer(
- brillo::make_unique_ptr(new DirectExtentWriter()));
+ BzipExtentWriter bzip_writer(base::MakeUnique<DirectExtentWriter>());
EXPECT_TRUE(bzip_writer.Init(fd_, extents, kBlockSize));
brillo::Blob original_compressed_data = compressed_data;
diff --git a/payload_consumer/delta_performer.cc b/payload_consumer/delta_performer.cc
index b7906f6..9b7eea3 100644
--- a/payload_consumer/delta_performer.cc
+++ b/payload_consumer/delta_performer.cc
@@ -28,11 +28,11 @@
#include <base/files/file_util.h>
#include <base/format_macros.h>
+#include <base/memory/ptr_util.h>
#include <base/strings/string_number_conversions.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <brillo/data_encoding.h>
-#include <brillo/make_unique_ptr.h>
#include <bsdiff/bspatch.h>
#include <google/protobuf/repeated_field.h>
@@ -910,9 +910,8 @@
}
// Setup the ExtentWriter stack based on the operation type.
- std::unique_ptr<ExtentWriter> writer =
- brillo::make_unique_ptr(new ZeroPadExtentWriter(
- brillo::make_unique_ptr(new DirectExtentWriter())));
+ std::unique_ptr<ExtentWriter> writer = base::MakeUnique<ZeroPadExtentWriter>(
+ base::MakeUnique<DirectExtentWriter>());
if (operation.type() == InstallOperation::REPLACE_BZ) {
writer.reset(new BzipExtentWriter(std::move(writer)));
diff --git a/payload_consumer/extent_writer_unittest.cc b/payload_consumer/extent_writer_unittest.cc
index 24d238e..f9304a3 100644
--- a/payload_consumer/extent_writer_unittest.cc
+++ b/payload_consumer/extent_writer_unittest.cc
@@ -22,7 +22,7 @@
#include <string>
#include <vector>
-#include <brillo/make_unique_ptr.h>
+#include <base/memory/ptr_util.h>
#include <brillo/secure_blob.h>
#include <gtest/gtest.h>
@@ -184,8 +184,7 @@
brillo::Blob data(kBlockSize * 2);
test_utils::FillWithData(&data);
- ZeroPadExtentWriter zero_pad_writer(
- brillo::make_unique_ptr(new DirectExtentWriter()));
+ ZeroPadExtentWriter zero_pad_writer(base::MakeUnique<DirectExtentWriter>());
EXPECT_TRUE(zero_pad_writer.Init(fd_, extents, kBlockSize));
size_t bytes_to_write = data.size();
diff --git a/payload_consumer/xz_extent_writer_unittest.cc b/payload_consumer/xz_extent_writer_unittest.cc
index fb8bb40..47c0a58 100644
--- a/payload_consumer/xz_extent_writer_unittest.cc
+++ b/payload_consumer/xz_extent_writer_unittest.cc
@@ -25,7 +25,7 @@
#include <string>
#include <vector>
-#include <brillo/make_unique_ptr.h>
+#include <base/memory/ptr_util.h>
#include <gtest/gtest.h>
#include "update_engine/common/test_utils.h"
@@ -88,8 +88,7 @@
protected:
void SetUp() override {
fake_extent_writer_ = new FakeExtentWriter();
- xz_writer_.reset(
- new XzExtentWriter(brillo::make_unique_ptr(fake_extent_writer_)));
+ xz_writer_.reset(new XzExtentWriter(base::WrapUnique(fake_extent_writer_)));
}
void WriteAll(const brillo::Blob& compressed) {
diff --git a/payload_generator/mapfile_filesystem.cc b/payload_generator/mapfile_filesystem.cc
index f4f0804..5264a9c 100644
--- a/payload_generator/mapfile_filesystem.cc
+++ b/payload_generator/mapfile_filesystem.cc
@@ -21,9 +21,9 @@
#include <base/files/file_util.h>
#include <base/logging.h>
+#include <base/memory/ptr_util.h>
#include <base/strings/string_number_conversions.h>
#include <base/strings/string_split.h>
-#include <brillo/make_unique_ptr.h>
#include "update_engine/common/utils.h"
#include "update_engine/payload_generator/extent_ranges.h"
@@ -61,8 +61,7 @@
return nullptr;
}
- return brillo::make_unique_ptr(
- new MapfileFilesystem(mapfile_filename, num_blocks));
+ return base::WrapUnique(new MapfileFilesystem(mapfile_filename, num_blocks));
}
MapfileFilesystem::MapfileFilesystem(const string& mapfile_filename,
diff --git a/payload_generator/zip_unittest.cc b/payload_generator/zip_unittest.cc
index 54adfcb..4459f40 100644
--- a/payload_generator/zip_unittest.cc
+++ b/payload_generator/zip_unittest.cc
@@ -20,7 +20,7 @@
#include <string>
#include <vector>
-#include <brillo/make_unique_ptr.h>
+#include <base/memory/ptr_util.h>
#include <gtest/gtest.h>
#include "update_engine/common/test_utils.h"
@@ -70,7 +70,7 @@
template <typename W>
bool DecompressWithWriter(const brillo::Blob& in, brillo::Blob* out) {
std::unique_ptr<ExtentWriter> writer(
- new W(brillo::make_unique_ptr(new MemoryExtentWriter(out))));
+ new W(base::MakeUnique<MemoryExtentWriter>(out)));
// Init() parameters are ignored by the testing MemoryExtentWriter.
bool ok = writer->Init(nullptr, {}, 1);
ok = writer->Write(in.data(), in.size()) && ok;
diff --git a/real_system_state.cc b/real_system_state.cc
index 5cbf723..1beb541 100644
--- a/real_system_state.cc
+++ b/real_system_state.cc
@@ -21,8 +21,8 @@
#include <base/bind.h>
#include <base/files/file_util.h>
#include <base/location.h>
+#include <base/memory/ptr_util.h>
#include <base/time/time.h>
-#include <brillo/make_unique_ptr.h>
#include <brillo/message_loops/message_loop.h>
#if USE_LIBCROS
#include <chromeos/dbus/service_constants.h>
@@ -56,7 +56,7 @@
if (!boot_control_) {
LOG(WARNING) << "Unable to create BootControl instance, using stub "
<< "instead. All update attempts will fail.";
- boot_control_ = brillo::make_unique_ptr(new BootControlStub());
+ boot_control_ = base::MakeUnique<BootControlStub>();
}
hardware_ = hardware::CreateHardware();
diff --git a/sideload_main.cc b/sideload_main.cc
index 574d062..614d553 100644
--- a/sideload_main.cc
+++ b/sideload_main.cc
@@ -25,7 +25,6 @@
#include <base/strings/stringprintf.h>
#include <brillo/asynchronous_signal_handler.h>
#include <brillo/flag_helper.h>
-#include <brillo/make_unique_ptr.h>
#include <brillo/message_loops/base_message_loop.h>
#include <brillo/streams/file_stream.h>
#include <brillo/streams/stream.h>
diff --git a/update_attempter.cc b/update_attempter.cc
index 6b07ff9..4400cdf 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -28,12 +28,12 @@
#include <base/bind.h>
#include <base/files/file_util.h>
#include <base/logging.h>
+#include <base/memory/ptr_util.h>
#include <base/rand_util.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <brillo/bind_lambda.h>
#include <brillo/errors/error_codes.h>
-#include <brillo/make_unique_ptr.h>
#include <brillo/message_loops/message_loop.h>
#include <policy/device_policy.h>
#include <policy/libpolicy.h>
@@ -607,13 +607,12 @@
new OmahaResponseHandlerAction(system_state_));
shared_ptr<OmahaRequestAction> download_started_action(
- new OmahaRequestAction(system_state_,
- new OmahaEvent(
- OmahaEvent::kTypeUpdateDownloadStarted),
- brillo::make_unique_ptr(new LibcurlHttpFetcher(
- GetProxyResolver(),
- system_state_->hardware())),
- false));
+ new OmahaRequestAction(
+ system_state_,
+ new OmahaEvent(OmahaEvent::kTypeUpdateDownloadStarted),
+ base::MakeUnique<LibcurlHttpFetcher>(GetProxyResolver(),
+ system_state_->hardware()),
+ false));
LibcurlHttpFetcher* download_fetcher =
new LibcurlHttpFetcher(GetProxyResolver(), system_state_->hardware());
@@ -628,9 +627,8 @@
new OmahaRequestAction(
system_state_,
new OmahaEvent(OmahaEvent::kTypeUpdateDownloadFinished),
- brillo::make_unique_ptr(
- new LibcurlHttpFetcher(GetProxyResolver(),
- system_state_->hardware())),
+ base::MakeUnique<LibcurlHttpFetcher>(GetProxyResolver(),
+ system_state_->hardware()),
false));
shared_ptr<FilesystemVerifierAction> filesystem_verifier_action(
new FilesystemVerifierAction());
@@ -638,9 +636,8 @@
new OmahaRequestAction(
system_state_,
new OmahaEvent(OmahaEvent::kTypeUpdateComplete),
- brillo::make_unique_ptr(
- new LibcurlHttpFetcher(GetProxyResolver(),
- system_state_->hardware())),
+ base::MakeUnique<LibcurlHttpFetcher>(GetProxyResolver(),
+ system_state_->hardware()),
false));
download_action->set_delegate(this);
@@ -1281,12 +1278,12 @@
// Send it to Omaha.
LOG(INFO) << "Reporting the error event";
shared_ptr<OmahaRequestAction> error_event_action(
- new OmahaRequestAction(system_state_,
- error_event_.release(), // Pass ownership.
- brillo::make_unique_ptr(new LibcurlHttpFetcher(
- GetProxyResolver(),
- system_state_->hardware())),
- false));
+ new OmahaRequestAction(
+ system_state_,
+ error_event_.release(), // Pass ownership.
+ base::MakeUnique<LibcurlHttpFetcher>(GetProxyResolver(),
+ system_state_->hardware()),
+ false));
actions_.push_back(shared_ptr<AbstractAction>(error_event_action));
processor_->EnqueueAction(error_event_action.get());
SetStatusAndNotify(UpdateStatus::REPORTING_ERROR_EVENT);
@@ -1355,9 +1352,8 @@
shared_ptr<OmahaRequestAction> ping_action(new OmahaRequestAction(
system_state_,
nullptr,
- brillo::make_unique_ptr(new LibcurlHttpFetcher(
- GetProxyResolver(),
- system_state_->hardware())),
+ base::MakeUnique<LibcurlHttpFetcher>(GetProxyResolver(),
+ system_state_->hardware()),
true));
actions_.push_back(shared_ptr<OmahaRequestAction>(ping_action));
processor_->set_delegate(nullptr);
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index 93bcc5c..1e81e9d 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -23,7 +23,6 @@
#include <base/files/file_util.h>
#include <base/message_loop/message_loop.h>
#include <brillo/bind_lambda.h>
-#include <brillo/make_unique_ptr.h>
#include <brillo/message_loops/base_message_loop.h>
#include <brillo/message_loops/message_loop.h>
#include <brillo/message_loops/message_loop_utils.h>
diff --git a/update_manager/real_device_policy_provider_unittest.cc b/update_manager/real_device_policy_provider_unittest.cc
index 71c95bb..167cbd9 100644
--- a/update_manager/real_device_policy_provider_unittest.cc
+++ b/update_manager/real_device_policy_provider_unittest.cc
@@ -18,7 +18,7 @@
#include <memory>
-#include <brillo/make_unique_ptr.h>
+#include <base/memory/ptr_util.h>
#include <brillo/message_loops/fake_message_loop.h>
#include <brillo/message_loops/message_loop.h>
#include <brillo/message_loops/message_loop_utils.h>
@@ -63,8 +63,7 @@
auto session_manager_proxy_mock =
new org::chromium::SessionManagerInterfaceProxyMock();
provider_.reset(new RealDevicePolicyProvider(
- brillo::make_unique_ptr(session_manager_proxy_mock),
- &mock_policy_provider_));
+ base::WrapUnique(session_manager_proxy_mock), &mock_policy_provider_));
#else
provider_.reset(new RealDevicePolicyProvider(&mock_policy_provider_));
#endif // USE_DBUS
diff --git a/update_manager/real_shill_provider_unittest.cc b/update_manager/real_shill_provider_unittest.cc
index e821dc7..af674d0 100644
--- a/update_manager/real_shill_provider_unittest.cc
+++ b/update_manager/real_shill_provider_unittest.cc
@@ -18,8 +18,8 @@
#include <memory>
#include <utility>
+#include <base/memory/ptr_util.h>
#include <base/time/time.h>
-#include <brillo/make_unique_ptr.h>
#include <brillo/message_loops/fake_message_loop.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -261,9 +261,9 @@
EXPECT_CALL(*service_proxy_mock, GetProperties(_, _, _))
.WillOnce(DoAll(SetArgPointee<0>(reply_dict), Return(true)));
- fake_shill_proxy_->SetServiceForPath(
- dbus::ObjectPath(service_path),
- brillo::make_unique_ptr(service_proxy_mock));
+ fake_shill_proxy_->SetServiceForPath(dbus::ObjectPath(service_path),
+ base::WrapUnique(service_proxy_mock));
+
return service_proxy_mock;
}
diff --git a/update_manager/real_system_provider_unittest.cc b/update_manager/real_system_provider_unittest.cc
index 821a6cc..ea5a3f6 100644
--- a/update_manager/real_system_provider_unittest.cc
+++ b/update_manager/real_system_provider_unittest.cc
@@ -19,7 +19,6 @@
#include <memory>
#include <base/time/time.h>
-#include <brillo/make_unique_ptr.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/update_manager/state_factory.cc b/update_manager/state_factory.cc
index 70fc80b..731a0cf 100644
--- a/update_manager/state_factory.cc
+++ b/update_manager/state_factory.cc
@@ -19,7 +19,7 @@
#include <memory>
#include <base/logging.h>
-#include <brillo/make_unique_ptr.h>
+#include <base/memory/ptr_util.h>
#if USE_DBUS
#include <session_manager/dbus-proxies.h>
#endif // USE_DBUS
@@ -57,8 +57,7 @@
chromeos_update_engine::DBusConnection::Get()->GetDBus();
unique_ptr<RealDevicePolicyProvider> device_policy_provider(
new RealDevicePolicyProvider(
- brillo::make_unique_ptr(
- new org::chromium::SessionManagerInterfaceProxy(bus)),
+ base::MakeUnique<org::chromium::SessionManagerInterfaceProxy>(bus),
policy_provider));
#else
unique_ptr<RealDevicePolicyProvider> device_policy_provider(