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

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

Issue 2063353002: device/bluetooth: split out transport enum (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: renaming header, moving TransportMask back into filter Created 4 years, 6 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 (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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "device/bluetooth/bluetooth_device.h" 14 #include "device/bluetooth/bluetooth_device.h"
15 #include "device/bluetooth/bluetooth_discovery_session.h" 15 #include "device/bluetooth/bluetooth_discovery_session.h"
16 #include "device/bluetooth/bluetooth_discovery_session_outcome.h" 16 #include "device/bluetooth/bluetooth_discovery_session_outcome.h"
17 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" 17 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
18 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" 18 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h"
19 #include "device/bluetooth/bluetooth_remote_gatt_service.h" 19 #include "device/bluetooth/bluetooth_remote_gatt_service.h"
20 #include "device/bluetooth/bluetooth_types.h"
20 21
21 namespace device { 22 namespace device {
22 23
23 BluetoothAdapter::ServiceOptions::ServiceOptions() { 24 BluetoothAdapter::ServiceOptions::ServiceOptions() {
24 } 25 }
25 BluetoothAdapter::ServiceOptions::~ServiceOptions() { 26 BluetoothAdapter::ServiceOptions::~ServiceOptions() {
26 } 27 }
27 28
28 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX) && \ 29 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX) && \
29 !defined(OS_WIN) && !defined(OS_LINUX) 30 !defined(OS_WIN) && !defined(OS_LINUX)
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 // if masked_filter is pointing to empty filter, and there are 346 // if masked_filter is pointing to empty filter, and there are
346 // multiple empty filters in discovery_sessions_, make sure we'll 347 // multiple empty filters in discovery_sessions_, make sure we'll
347 // process next empty sessions. 348 // process next empty sessions.
348 omit = false; 349 omit = false;
349 continue; 350 continue;
350 } 351 }
351 352
352 if (first_merge) { 353 if (first_merge) {
353 first_merge = false; 354 first_merge = false;
354 if (curr_filter) { 355 if (curr_filter) {
355 result.reset(new BluetoothDiscoveryFilter( 356 result.reset(
356 BluetoothDiscoveryFilter::Transport::TRANSPORT_DUAL)); 357 new BluetoothDiscoveryFilter(BluetoothTransport::TRANSPORT_DUAL));
357 result->CopyFrom(*curr_filter); 358 result->CopyFrom(*curr_filter);
358 } 359 }
359 continue; 360 continue;
360 } 361 }
361 362
362 result = BluetoothDiscoveryFilter::Merge(result.get(), curr_filter); 363 result = BluetoothDiscoveryFilter::Merge(result.get(), curr_filter);
363 } 364 }
364 365
365 return result; 366 return result;
366 } 367 }
367 368
368 // static 369 // static
369 void BluetoothAdapter::RecordBluetoothDiscoverySessionStartOutcome( 370 void BluetoothAdapter::RecordBluetoothDiscoverySessionStartOutcome(
370 UMABluetoothDiscoverySessionOutcome outcome) { 371 UMABluetoothDiscoverySessionOutcome outcome) {
371 UMA_HISTOGRAM_ENUMERATION( 372 UMA_HISTOGRAM_ENUMERATION(
372 "Bluetooth.DiscoverySession.Start.Outcome", static_cast<int>(outcome), 373 "Bluetooth.DiscoverySession.Start.Outcome", static_cast<int>(outcome),
373 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); 374 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT));
374 } 375 }
375 376
376 // static 377 // static
377 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome( 378 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome(
378 UMABluetoothDiscoverySessionOutcome outcome) { 379 UMABluetoothDiscoverySessionOutcome outcome) {
379 UMA_HISTOGRAM_ENUMERATION( 380 UMA_HISTOGRAM_ENUMERATION(
380 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), 381 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome),
381 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); 382 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT));
382 } 383 }
383 384
384 } // namespace device 385 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698