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

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

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_hid_device.h ('k') | no next file » | 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 #include "u2f_hid_device.h" 5 #include "u2f_hid_device.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 id << device_info_->device_id(); 335 id << device_info_->device_id();
336 return id.str(); 336 return id.str();
337 } 337 }
338 338
339 // static 339 // static
340 bool U2fHidDevice::IsTestEnabled() { 340 bool U2fHidDevice::IsTestEnabled() {
341 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 341 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
342 return command_line->HasSwitch(switches::kEnableU2fHidTest); 342 return command_line->HasSwitch(switches::kEnableU2fHidTest);
343 } 343 }
344 344
345 base::WeakPtr<U2fDevice> U2fHidDevice::GetWeakPtr() {
346 return weak_factory_.GetWeakPtr();
347 }
348
345 } // namespace device 349 } // namespace device
OLDNEW
« no previous file with comments | « device/u2f/u2f_hid_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698