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

Unified Diff: device/u2f/u2f_hid_device.h

Issue 2824803003: Add timeout task to U2F HID state machine (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: device/u2f/u2f_hid_device.h
diff --git a/device/u2f/u2f_hid_device.h b/device/u2f/u2f_hid_device.h
index 527c0b30177d73554b328c108745ee2abbe4c3ad..eaa2f37f0967fb8ae6d31123245bbbd8dfebee6e 100644
--- a/device/u2f/u2f_hid_device.h
+++ b/device/u2f/u2f_hid_device.h
@@ -7,6 +7,7 @@
#include <list>
+#include "base/cancelable_callback.h"
#include "device/hid/hid_service.h"
#include "u2f_device.h"
@@ -23,7 +24,7 @@ class HidDeviceInfo;
class U2fHidDevice : public U2fDevice {
public:
U2fHidDevice(scoped_refptr<HidDeviceInfo>);
- ~U2fHidDevice();
+ ~U2fHidDevice() final;
// Send a U2f command to this device
void DeviceTransact(std::unique_ptr<U2fApduCommand> command,
@@ -70,7 +71,7 @@ class U2fHidDevice : public U2fDevice {
bool success);
// Read all response message packets from device
void ReadMessage(U2fHidMessageCallback callback);
- void MessageReceived(const DeviceCallback& callback,
+ void MessageReceived(DeviceCallback callback,
Reilly Grant (use Gerrit) 2017/04/17 22:25:17 DeviceCallback is not a OnceCallback so it should
Casey Piper 2017/04/17 23:02:38 Done.
bool success,
std::unique_ptr<U2fMessage> message);
void OnRead(U2fHidMessageCallback callback,
@@ -85,8 +86,12 @@ class U2fHidDevice : public U2fDevice {
void OnWink(const WinkCallback& callback,
bool success,
std::unique_ptr<U2fMessage> response);
+ void OnTimeout(DeviceCallback callback);
+ void OnDeviceTransact(bool success,
+ std::unique_ptr<U2fApduResponse> response);
State state_;
+ base::CancelableClosure timeout_callback_;
std::list<std::pair<std::unique_ptr<U2fApduCommand>, DeviceCallback>>
pending_transactions_;
scoped_refptr<HidDeviceInfo> device_info_;

Powered by Google App Engine
This is Rietveld 408576698