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

Unified Diff: device/u2f/u2f_device.h

Issue 2743623006: Modify U2F apdu classes to use unique pointers (Closed)
Patch Set: Created 3 years, 9 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: device/u2f/u2f_device.h
diff --git a/device/u2f/u2f_device.h b/device/u2f/u2f_device.h
index f10c5929fe6fa53cae8ac6adfe90b4110893bcd5..2ddf7708028bc6ecedcd99a34bfec89cd9a8924b 100644
--- a/device/u2f/u2f_device.h
+++ b/device/u2f/u2f_device.h
@@ -31,7 +31,7 @@ class U2fDevice {
base::Callback<void(bool success, ProtocolVersion version)>;
using DeviceCallback =
base::Callback<void(bool success,
- scoped_refptr<U2fApduResponse> response)>;
+ std::unique_ptr<U2fApduResponse> response)>;
~U2fDevice();
@@ -52,24 +52,24 @@ class U2fDevice {
// Pure virtual function defined by each device type, implementing
// the device communication transaction.
- virtual void DeviceTransact(scoped_refptr<U2fApduCommand> command,
+ virtual void DeviceTransact(std::unique_ptr<U2fApduCommand> command,
const DeviceCallback& callback) = 0;
private:
// TODO Callback functions for device calls
void OnRegisterComplete(const MessageCallback& callback,
bool success,
- scoped_refptr<U2fApduResponse> register_response);
+ std::unique_ptr<U2fApduResponse> register_response);
void OnSignComplete(const MessageCallback& callback,
bool success,
- scoped_refptr<U2fApduResponse> sign_response);
+ std::unique_ptr<U2fApduResponse> sign_response);
void OnVersionComplete(const VersionCallback& callback,
bool success,
- scoped_refptr<U2fApduResponse> version_response);
+ std::unique_ptr<U2fApduResponse> version_response);
void OnLegacyVersionComplete(
const VersionCallback& callback,
bool success,
- scoped_refptr<U2fApduResponse> legacy_version_response);
+ std::unique_ptr<U2fApduResponse> legacy_version_response);
base::WeakPtrFactory<U2fDevice> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698