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

Side by Side Diff: chromeos/components/tether/ble_advertisement_device_queue.cc

Issue 2590553003: [CrOS Tether] Create ble_constants.h/cc, which include common constants to be shared among multiple… (Closed)
Patch Set: Created 3 years, 12 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chromeos/components/tether/ble_advertisement_device_queue.h" 5 #include "chromeos/components/tether/ble_advertisement_device_queue.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "chromeos/components/tether/ble_constants.h"
11 #include "components/proximity_auth/logging/logging.h" 12 #include "components/proximity_auth/logging/logging.h"
12 13
13 namespace chromeos { 14 namespace chromeos {
14 15
15 namespace tether { 16 namespace tether {
16 17
17 const int BleAdvertisementDeviceQueue::kMaxConcurrentAdvertisements = 2;
18
19 BleAdvertisementDeviceQueue::BleAdvertisementDeviceQueue() {} 18 BleAdvertisementDeviceQueue::BleAdvertisementDeviceQueue() {}
20 19
21 BleAdvertisementDeviceQueue::~BleAdvertisementDeviceQueue() {} 20 BleAdvertisementDeviceQueue::~BleAdvertisementDeviceQueue() {}
22 21
23 bool BleAdvertisementDeviceQueue::SetDevices( 22 bool BleAdvertisementDeviceQueue::SetDevices(
24 std::vector<cryptauth::RemoteDevice> devices) { 23 std::vector<cryptauth::RemoteDevice> devices) {
25 // Determine which devices exist in |devices| but not in |device_queue_|, then 24 // Determine which devices exist in |devices| but not in |device_queue_|, then
26 // add them to |device_queue_|. 25 // add them to |device_queue_|.
27 std::vector<cryptauth::RemoteDevice> missing_from_queue; 26 std::vector<cryptauth::RemoteDevice> missing_from_queue;
28 for (auto& device : devices) { 27 for (auto& device : devices) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 return to_advertise; 108 return to_advertise;
110 } 109 }
111 110
112 size_t BleAdvertisementDeviceQueue::GetSize() const { 111 size_t BleAdvertisementDeviceQueue::GetSize() const {
113 return device_queue_.size(); 112 return device_queue_.size();
114 } 113 }
115 114
116 } // namespace tether 115 } // namespace tether
117 116
118 } // namespace chromeos 117 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698