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

Unified Diff: device/u2f/u2f_device.cc

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
« device/u2f/u2f_apdu_unittest.cc ('K') | « device/u2f/u2f_device.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/u2f/u2f_device.cc
diff --git a/device/u2f/u2f_device.cc b/device/u2f/u2f_device.cc
index f065c69d8b1707de136b6bc48446f14c7e299fae..02b42c435b90d54e3b43d20766a45b40059a4333 100644
--- a/device/u2f/u2f_device.cc
+++ b/device/u2f/u2f_device.cc
@@ -16,7 +16,7 @@ void U2fDevice::Register(const std::vector<uint8_t>& app_param,
U2fDevice::ProtocolVersion version,
const std::vector<uint8_t>& challenge_param,
const MessageCallback& callback) {
- scoped_refptr<U2fApduCommand> register_cmd =
+ std::unique_ptr<U2fApduCommand> register_cmd =
U2fApduCommand::CreateRegister(app_param, challenge_param);
if (!register_cmd) {
callback.Run(ReturnCode::INVALID_PARAMS, std::vector<uint8_t>());
@@ -31,7 +31,7 @@ void U2fDevice::Sign(const std::vector<uint8_t>& app_param,
const std::vector<uint8_t>& challenge_param,
const std::vector<uint8_t>& key_handle,
const MessageCallback& callback) {
- scoped_refptr<U2fApduCommand> sign_cmd =
+ std::unique_ptr<U2fApduCommand> sign_cmd =
U2fApduCommand::CreateSign(app_param, challenge_param, key_handle);
if (!sign_cmd) {
callback.Run(ReturnCode::INVALID_PARAMS, std::vector<uint8_t>());
@@ -43,7 +43,7 @@ void U2fDevice::Sign(const std::vector<uint8_t>& app_param,
}
void U2fDevice::Version(const VersionCallback& callback) {
- scoped_refptr<U2fApduCommand> version_cmd = U2fApduCommand::CreateVersion();
+ std::unique_ptr<U2fApduCommand> version_cmd = U2fApduCommand::CreateVersion();
if (!version_cmd) {
callback.Run(false, ProtocolVersion::UNKNOWN);
return;
@@ -56,20 +56,20 @@ void U2fDevice::Version(const VersionCallback& callback) {
void U2fDevice::OnRegisterComplete(
const MessageCallback& callback,
bool success,
- scoped_refptr<U2fApduResponse> register_response) {
+ std::unique_ptr<U2fApduResponse> register_response) {
NOTIMPLEMENTED();
}
void U2fDevice::OnSignComplete(const MessageCallback& callback,
bool success,
- scoped_refptr<U2fApduResponse> sign_response) {
+ std::unique_ptr<U2fApduResponse> sign_response) {
NOTIMPLEMENTED();
}
void U2fDevice::OnVersionComplete(
const VersionCallback& callback,
bool success,
- scoped_refptr<U2fApduResponse> version_response) {
+ std::unique_ptr<U2fApduResponse> version_response) {
if (success && version_response &&
version_response->status() == U2fApduResponse::Status::SW_NO_ERROR &&
version_response->data() ==
@@ -83,7 +83,7 @@ void U2fDevice::OnVersionComplete(
void U2fDevice::OnLegacyVersionComplete(
const VersionCallback& callback,
bool success,
- scoped_refptr<U2fApduResponse> legacy_version_response) {
+ std::unique_ptr<U2fApduResponse> legacy_version_response) {
NOTIMPLEMENTED();
}
« device/u2f/u2f_apdu_unittest.cc ('K') | « device/u2f/u2f_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698