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

Side by Side Diff: device/u2f/u2f_hid_device.h

Issue 2842003002: Reuse WeakFactory from U2fDevice derived classes (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « device/u2f/u2f_device.cc ('k') | device/u2f/u2f_hid_device.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_U2F_U2F_HID_DEVICE_H_ 5 #ifndef DEVICE_U2F_U2F_HID_DEVICE_H_
6 #define DEVICE_U2F_U2F_HID_DEVICE_H_ 6 #define DEVICE_U2F_U2F_HID_DEVICE_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 bool success, 83 bool success,
84 scoped_refptr<net::IOBuffer> buf, 84 scoped_refptr<net::IOBuffer> buf,
85 size_t size); 85 size_t size);
86 void OnWink(const WinkCallback& callback, 86 void OnWink(const WinkCallback& callback,
87 bool success, 87 bool success,
88 std::unique_ptr<U2fMessage> response); 88 std::unique_ptr<U2fMessage> response);
89 void ArmTimeout(const DeviceCallback& callback); 89 void ArmTimeout(const DeviceCallback& callback);
90 void OnTimeout(const DeviceCallback& callback); 90 void OnTimeout(const DeviceCallback& callback);
91 void OnDeviceTransact(bool success, 91 void OnDeviceTransact(bool success,
92 std::unique_ptr<U2fApduResponse> response); 92 std::unique_ptr<U2fApduResponse> response);
93 base::WeakPtr<U2fDevice> GetWeakPtr() override;
93 94
94 State state_; 95 State state_;
95 base::CancelableClosure timeout_callback_; 96 base::CancelableClosure timeout_callback_;
96 std::list<std::pair<std::unique_ptr<U2fApduCommand>, DeviceCallback>> 97 std::list<std::pair<std::unique_ptr<U2fApduCommand>, DeviceCallback>>
97 pending_transactions_; 98 pending_transactions_;
98 scoped_refptr<HidDeviceInfo> device_info_; 99 scoped_refptr<HidDeviceInfo> device_info_;
99 scoped_refptr<HidConnection> connection_; 100 scoped_refptr<HidConnection> connection_;
100 base::WeakPtrFactory<U2fHidDevice> weak_factory_; 101 base::WeakPtrFactory<U2fHidDevice> weak_factory_;
101 102
102 DISALLOW_COPY_AND_ASSIGN(U2fHidDevice); 103 DISALLOW_COPY_AND_ASSIGN(U2fHidDevice);
103 }; 104 };
104 105
105 } // namespace device 106 } // namespace device
106 107
107 #endif // DEVICE_U2F_U2F_HID_DEVICE_H_ 108 #endif // DEVICE_U2F_U2F_HID_DEVICE_H_
OLDNEW
« no previous file with comments | « device/u2f/u2f_device.cc ('k') | device/u2f/u2f_hid_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698