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

Unified Diff: device/u2f/mock_u2f_device.cc

Issue 2842003002: Reuse WeakFactory from U2fDevice derived classes (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
« no previous file with comments | « device/u2f/mock_u2f_device.h ('k') | device/u2f/u2f_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/u2f/mock_u2f_device.cc
diff --git a/device/u2f/mock_u2f_device.cc b/device/u2f/mock_u2f_device.cc
index 4f8bdc46f0e691c9c5febcdbde713c7c4d9dbd61..e833bbf6ef886891fbe0fe4d5c08f2695d78210a 100644
--- a/device/u2f/mock_u2f_device.cc
+++ b/device/u2f/mock_u2f_device.cc
@@ -6,7 +6,7 @@
namespace device {
-MockU2fDevice::MockU2fDevice() {}
+MockU2fDevice::MockU2fDevice() : weak_factory_(this) {}
MockU2fDevice::~MockU2fDevice() {}
@@ -50,4 +50,8 @@ void MockU2fDevice::WinkDoNothing(const WinkCallback& cb) {
cb.Run();
}
+base::WeakPtr<U2fDevice> MockU2fDevice::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
} // namespace device
« no previous file with comments | « device/u2f/mock_u2f_device.h ('k') | device/u2f/u2f_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698