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

Unified Diff: device/u2f/u2f_apdu_response.cc

Issue 2743623006: Modify U2F apdu classes to use unique pointers (Closed)
Patch Set: Use more concise form of base::Passed 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
« no previous file with comments | « device/u2f/u2f_apdu_response.h ('k') | device/u2f/u2f_apdu_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/u2f/u2f_apdu_response.cc
diff --git a/device/u2f/u2f_apdu_response.cc b/device/u2f/u2f_apdu_response.cc
index 6a0daf25493c913ae4f22da45eae40844c4dd73a..30336d52c25e7d3201526dd8a5550f0b22a4cfa5 100644
--- a/device/u2f/u2f_apdu_response.cc
+++ b/device/u2f/u2f_apdu_response.cc
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/memory/ptr_util.h"
+
#include "u2f_apdu_response.h"
namespace device {
-scoped_refptr<U2fApduResponse> U2fApduResponse::CreateFromMessage(
+std::unique_ptr<U2fApduResponse> U2fApduResponse::CreateFromMessage(
const std::vector<uint8_t>& message) {
uint16_t status_bytes;
Status response_status;
@@ -18,8 +20,7 @@ scoped_refptr<U2fApduResponse> U2fApduResponse::CreateFromMessage(
response_status = static_cast<Status>(status_bytes);
std::vector<uint8_t> data(message.begin(), message.end() - 2);
- return make_scoped_refptr(
- new U2fApduResponse(std::move(data), response_status));
+ return base::MakeUnique<U2fApduResponse>(std::move(data), response_status);
}
U2fApduResponse::U2fApduResponse(std::vector<uint8_t> message,
« no previous file with comments | « device/u2f/u2f_apdu_response.h ('k') | device/u2f/u2f_apdu_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698