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

Unified Diff: device/u2f/u2f_hid_device.h

Issue 2766723003: Use unique pointers for U2fPacket and U2fMessage (Closed)
Patch Set: Change fuzzer to use the new unique_ptr constructor 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 | « no previous file | device/u2f/u2f_hid_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/u2f/u2f_hid_device.h
diff --git a/device/u2f/u2f_hid_device.h b/device/u2f/u2f_hid_device.h
index 0e7d0164d675bf06d5c557441b78f1afb02f3092..527c0b30177d73554b328c108745ee2abbe4c3ad 100644
--- a/device/u2f/u2f_hid_device.h
+++ b/device/u2f/u2f_hid_device.h
@@ -43,7 +43,7 @@ class U2fHidDevice : public U2fDevice {
enum class State { INIT, CONNECTED, BUSY, IDLE, DEVICE_ERROR };
using U2fHidMessageCallback =
- base::OnceCallback<void(bool, scoped_refptr<U2fMessage>)>;
+ base::OnceCallback<void(bool, std::unique_ptr<U2fMessage>)>;
// Open a connection to this device
void Connect(const HidService::ConnectCallback& callback);
@@ -57,14 +57,14 @@ class U2fHidDevice : public U2fDevice {
std::unique_ptr<U2fApduCommand> command,
const DeviceCallback& callback,
bool success,
- scoped_refptr<U2fMessage> message);
+ std::unique_ptr<U2fMessage> message);
void Transition(std::unique_ptr<U2fApduCommand> command,
const DeviceCallback& callback);
// Write all message packets to device, and read response if expected
- void WriteMessage(scoped_refptr<U2fMessage> message,
+ void WriteMessage(std::unique_ptr<U2fMessage> message,
bool response_expected,
U2fHidMessageCallback callback);
- void PacketWritten(scoped_refptr<U2fMessage> message,
+ void PacketWritten(std::unique_ptr<U2fMessage> message,
bool response_expected,
U2fHidMessageCallback callback,
bool success);
@@ -72,19 +72,19 @@ class U2fHidDevice : public U2fDevice {
void ReadMessage(U2fHidMessageCallback callback);
void MessageReceived(const DeviceCallback& callback,
bool success,
- scoped_refptr<U2fMessage> message);
+ std::unique_ptr<U2fMessage> message);
void OnRead(U2fHidMessageCallback callback,
bool success,
scoped_refptr<net::IOBuffer> buf,
size_t size);
- void OnReadContinuation(scoped_refptr<U2fMessage> message,
+ void OnReadContinuation(std::unique_ptr<U2fMessage> message,
U2fHidMessageCallback,
bool success,
scoped_refptr<net::IOBuffer> buf,
size_t size);
void OnWink(const WinkCallback& callback,
bool success,
- scoped_refptr<U2fMessage> response);
+ std::unique_ptr<U2fMessage> response);
State state_;
std::list<std::pair<std::unique_ptr<U2fApduCommand>, DeviceCallback>>
« no previous file with comments | « no previous file | device/u2f/u2f_hid_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698