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

Unified Diff: components/proximity_auth/remote_device_life_cycle_impl_unittest.cc

Issue 1912433002: Convert //components/proximity_auth from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits 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/proximity_auth/remote_device_life_cycle_impl_unittest.cc
diff --git a/components/proximity_auth/remote_device_life_cycle_impl_unittest.cc b/components/proximity_auth/remote_device_life_cycle_impl_unittest.cc
index 3af5f189fc140d1713fc63cef3d9907b284483d0..ae927815a2754b35c70a97f90737e908eeba5449 100644
--- a/components/proximity_auth/remote_device_life_cycle_impl_unittest.cc
+++ b/components/proximity_auth/remote_device_life_cycle_impl_unittest.cc
@@ -5,11 +5,12 @@
#include "components/proximity_auth/remote_device_life_cycle_impl.h"
#include <stddef.h>
+
+#include <memory>
#include <utility>
#include "base/callback.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/test/test_simple_task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "components/proximity_auth/authenticator.h"
@@ -66,7 +67,7 @@ class FakeConnectionFinder : public ConnectionFinder {
void OnConnectionFound() {
ASSERT_FALSE(connection_callback_.is_null());
- scoped_ptr<FakeConnection> scoped_connection_(
+ std::unique_ptr<FakeConnection> scoped_connection_(
new FakeConnection(remote_device_));
connection_ = scoped_connection_.get();
connection_callback_.Run(std::move(scoped_connection_));
@@ -103,7 +104,7 @@ class FakeAuthenticator : public Authenticator {
void OnAuthenticationResult(Authenticator::Result result) {
ASSERT_FALSE(callback_.is_null());
- scoped_ptr<SecureContext> secure_context;
+ std::unique_ptr<SecureContext> secure_context;
if (result == Authenticator::Result::SUCCESS)
secure_context.reset(new StubSecureContext());
callback_.Run(result, std::move(secure_context));
@@ -136,16 +137,16 @@ class TestableRemoteDeviceLifeCycleImpl : public RemoteDeviceLifeCycleImpl {
FakeAuthenticator* authenticator() { return authenticator_; }
private:
- scoped_ptr<ConnectionFinder> CreateConnectionFinder() override {
- scoped_ptr<FakeConnectionFinder> scoped_connection_finder(
+ std::unique_ptr<ConnectionFinder> CreateConnectionFinder() override {
+ std::unique_ptr<FakeConnectionFinder> scoped_connection_finder(
new FakeConnectionFinder(remote_device_));
connection_finder_ = scoped_connection_finder.get();
return std::move(scoped_connection_finder);
}
- scoped_ptr<Authenticator> CreateAuthenticator() override {
+ std::unique_ptr<Authenticator> CreateAuthenticator() override {
EXPECT_TRUE(connection_finder_);
- scoped_ptr<FakeAuthenticator> scoped_authenticator(
+ std::unique_ptr<FakeAuthenticator> scoped_authenticator(
new FakeAuthenticator(connection_finder_->connection()));
authenticator_ = scoped_authenticator.get();
return std::move(scoped_authenticator);
« no previous file with comments | « components/proximity_auth/remote_device_life_cycle_impl.cc ('k') | components/proximity_auth/remote_device_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698