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

Side by Side Diff: device/bluetooth/bluetooth_adapter.cc

Issue 1256313002: bluetooth: android: Implement & test CreateGattConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split tests up into smaller tests Created 5 years, 2 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/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_device.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "device/bluetooth/bluetooth_adapter.h" 5 #include "device/bluetooth/bluetooth_adapter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "device/bluetooth/bluetooth_device.h" 10 #include "device/bluetooth/bluetooth_device.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 (*iter)->MarkAsInactive(); 193 (*iter)->MarkAsInactive();
194 } 194 }
195 } 195 }
196 196
197 void BluetoothAdapter::DiscoverySessionBecameInactive( 197 void BluetoothAdapter::DiscoverySessionBecameInactive(
198 BluetoothDiscoverySession* discovery_session) { 198 BluetoothDiscoverySession* discovery_session) {
199 DCHECK(!discovery_session->IsActive()); 199 DCHECK(!discovery_session->IsActive());
200 discovery_sessions_.erase(discovery_session); 200 discovery_sessions_.erase(discovery_session);
201 } 201 }
202 202
203 void BluetoothAdapter::DeleteDeviceForTesting(const std::string& address) {
204 std::map<const std::string, BluetoothDevice*>::iterator device_iterator =
205 devices_.find(address);
206 BluetoothDevice* device = device_iterator->second;
207 devices_.erase(device_iterator);
208 delete device;
209 }
210
203 scoped_ptr<BluetoothDiscoveryFilter> 211 scoped_ptr<BluetoothDiscoveryFilter>
204 BluetoothAdapter::GetMergedDiscoveryFilterHelper( 212 BluetoothAdapter::GetMergedDiscoveryFilterHelper(
205 const BluetoothDiscoveryFilter* masked_filter, 213 const BluetoothDiscoveryFilter* masked_filter,
206 bool omit) const { 214 bool omit) const {
207 scoped_ptr<BluetoothDiscoveryFilter> result; 215 scoped_ptr<BluetoothDiscoveryFilter> result;
208 bool first_merge = true; 216 bool first_merge = true;
209 217
210 std::set<BluetoothDiscoverySession*> temp(discovery_sessions_); 218 std::set<BluetoothDiscoverySession*> temp(discovery_sessions_);
211 for (const auto& iter : temp) { 219 for (const auto& iter : temp) {
212 const BluetoothDiscoveryFilter* curr_filter = iter->GetDiscoveryFilter(); 220 const BluetoothDiscoveryFilter* curr_filter = iter->GetDiscoveryFilter();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 256
249 // static 257 // static
250 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome( 258 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome(
251 UMABluetoothDiscoverySessionOutcome outcome) { 259 UMABluetoothDiscoverySessionOutcome outcome) {
252 UMA_HISTOGRAM_ENUMERATION( 260 UMA_HISTOGRAM_ENUMERATION(
253 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), 261 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome),
254 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); 262 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT));
255 } 263 }
256 264
257 } // namespace device 265 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698