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

Side by Side Diff: components/proximity_auth/authenticator.h

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 unified diff | Download patch
« no previous file with comments | « no previous file | components/proximity_auth/ble/bluetooth_low_energy_characteristics_finder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PROXIMITY_AUTH_AUTHENTICATOR_H 5 #ifndef COMPONENTS_PROXIMITY_AUTH_AUTHENTICATOR_H
6 #define COMPONENTS_PROXIMITY_AUTH_AUTHENTICATOR_H 6 #define COMPONENTS_PROXIMITY_AUTH_AUTHENTICATOR_H
7 7
8 #include <memory>
9
8 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
9 #include "base/memory/scoped_ptr.h"
10 11
11 namespace proximity_auth { 12 namespace proximity_auth {
12 13
13 class SecureContext; 14 class SecureContext;
14 15
15 // Interface for authenticating the remote connection. The two devices 16 // Interface for authenticating the remote connection. The two devices
16 // authenticate each other, and if the protocol succeeds, establishes a 17 // authenticate each other, and if the protocol succeeds, establishes a
17 // SecureContext that is used to securely encode and decode all messages sent 18 // SecureContext that is used to securely encode and decode all messages sent
18 // and received over the connection. 19 // and received over the connection.
19 // Do not reuse after calling |Authenticate()|. 20 // Do not reuse after calling |Authenticate()|.
20 class Authenticator { 21 class Authenticator {
21 public: 22 public:
22 // The result of the authentication protocol. 23 // The result of the authentication protocol.
23 enum class Result { 24 enum class Result {
24 SUCCESS, 25 SUCCESS,
25 DISCONNECTED, 26 DISCONNECTED,
26 FAILURE, 27 FAILURE,
27 }; 28 };
28 29
29 virtual ~Authenticator() {} 30 virtual ~Authenticator() {}
30 31
31 // Initiates the authentication attempt, invoking |callback| with the result. 32 // Initiates the authentication attempt, invoking |callback| with the result.
32 // If the authentication protocol succeeds, then |secure_context| will be 33 // If the authentication protocol succeeds, then |secure_context| will be
33 // contain the SecureContext used to securely exchange messages. Otherwise, it 34 // contain the SecureContext used to securely exchange messages. Otherwise, it
34 // will be null if the protocol fails. 35 // will be null if the protocol fails.
35 typedef base::Callback<void(Result result, 36 typedef base::Callback<void(Result result,
36 scoped_ptr<SecureContext> secure_context)> 37 std::unique_ptr<SecureContext> secure_context)>
37 AuthenticationCallback; 38 AuthenticationCallback;
38 virtual void Authenticate(const AuthenticationCallback& callback) = 0; 39 virtual void Authenticate(const AuthenticationCallback& callback) = 0;
39 }; 40 };
40 41
41 } // namespace proximity_auth 42 } // namespace proximity_auth
42 43
43 #endif // COMPONENTS_PROXIMITY_AUTH_AUTHENTICATOR_H 44 #endif // COMPONENTS_PROXIMITY_AUTH_AUTHENTICATOR_H
OLDNEW
« no previous file with comments | « no previous file | components/proximity_auth/ble/bluetooth_low_energy_characteristics_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698