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

Side by Side Diff: components/cryptauth/bluetooth_throttler_impl.cc

Issue 2896733002: [EasyUnlock] Reduce Bluetooth throttler time from 7 seconds to 2 seconds. (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 | « no previous file | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/cryptauth/bluetooth_throttler_impl.h" 5 #include "components/cryptauth/bluetooth_throttler_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "base/time/default_tick_clock.h" 11 #include "base/time/default_tick_clock.h"
12 #include "base/time/tick_clock.h" 12 #include "base/time/tick_clock.h"
13 #include "components/cryptauth/connection.h" 13 #include "components/cryptauth/connection.h"
14 14
15 namespace cryptauth { 15 namespace cryptauth {
16 namespace { 16 namespace {
17 17
18 // Time to wait after disconnect before reconnecting. 18 // Time to wait after disconnect before reconnecting.
19 const int kCooldownTimeSecs = 7; 19 const int kCooldownTimeSecs = 2;
sacomoto 2017/05/22 07:44:46 nit: set it to 1.
Tim Song 2017/05/22 18:10:27 Done.
20 20
21 } // namespace 21 } // namespace
22 22
23 // static 23 // static
24 BluetoothThrottlerImpl* BluetoothThrottlerImpl::GetInstance() { 24 BluetoothThrottlerImpl* BluetoothThrottlerImpl::GetInstance() {
25 return base::Singleton<BluetoothThrottlerImpl>::get(); 25 return base::Singleton<BluetoothThrottlerImpl>::get();
26 } 26 }
27 27
28 BluetoothThrottlerImpl::BluetoothThrottlerImpl() 28 BluetoothThrottlerImpl::BluetoothThrottlerImpl()
29 : BluetoothThrottlerImpl(base::MakeUnique<base::DefaultTickClock>()) {} 29 : BluetoothThrottlerImpl(base::MakeUnique<base::DefaultTickClock>()) {}
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 Connection::Status new_status) { 67 Connection::Status new_status) {
68 DCHECK(base::ContainsKey(connections_, connection)); 68 DCHECK(base::ContainsKey(connections_, connection));
69 if (new_status == Connection::DISCONNECTED) { 69 if (new_status == Connection::DISCONNECTED) {
70 last_disconnect_time_ = clock_->NowTicks(); 70 last_disconnect_time_ = clock_->NowTicks();
71 connection->RemoveObserver(this); 71 connection->RemoveObserver(this);
72 connections_.erase(connection); 72 connections_.erase(connection);
73 } 73 }
74 } 74 }
75 75
76 } // namespace cryptauth 76 } // namespace cryptauth
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698