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

Side by Side Diff: device/bluetooth/bluetooth_device.h

Issue 1876753004: bluetooth: Check if device name is null before trying to convert (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Address scheib's comments Created 4 years, 8 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 FRIEND_TEST_ALL_PREFIXES( 477 FRIEND_TEST_ALL_PREFIXES(
478 BluetoothTest, 478 BluetoothTest,
479 BluetoothGattConnection_DisconnectGatt_SimulateConnect); 479 BluetoothGattConnection_DisconnectGatt_SimulateConnect);
480 FRIEND_TEST_ALL_PREFIXES( 480 FRIEND_TEST_ALL_PREFIXES(
481 BluetoothTest, 481 BluetoothTest,
482 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect); 482 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect);
483 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, 483 FRIEND_TEST_ALL_PREFIXES(BluetoothTest,
484 BluetoothGattConnection_ErrorAfterConnection); 484 BluetoothGattConnection_ErrorAfterConnection);
485 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, 485 FRIEND_TEST_ALL_PREFIXES(BluetoothTest,
486 BluetoothGattConnection_DisconnectGatt_Cleanup); 486 BluetoothGattConnection_DisconnectGatt_Cleanup);
487 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, GetDeviceName_NullName);
487 488
488 BluetoothDevice(BluetoothAdapter* adapter); 489 BluetoothDevice(BluetoothAdapter* adapter);
489 490
490 // Returns the internal name of the Bluetooth device, used by GetName(). 491 // Returns the internal name of the Bluetooth device, used by GetName().
491 virtual std::string GetDeviceName() const = 0; 492 virtual std::string GetDeviceName() const = 0;
492 493
493 // Implements platform specific operations to initiate a GATT connection. 494 // Implements platform specific operations to initiate a GATT connection.
494 // Subclasses must also call DidConnectGatt, DidFailToConnectGatt, or 495 // Subclasses must also call DidConnectGatt, DidFailToConnectGatt, or
495 // DidDisconnectGatt immediately or asynchronously as the connection state 496 // DidDisconnectGatt immediately or asynchronously as the connection state
496 // changes. 497 // changes.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 552
552 private: 553 private:
553 // Returns a localized string containing the device's bluetooth address and 554 // Returns a localized string containing the device's bluetooth address and
554 // a device type for display when |name_| is empty. 555 // a device type for display when |name_| is empty.
555 base::string16 GetAddressWithLocalizedDeviceTypeName() const; 556 base::string16 GetAddressWithLocalizedDeviceTypeName() const;
556 }; 557 };
557 558
558 } // namespace device 559 } // namespace device
559 560
560 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 561 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
OLDNEW
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_device_android.cc » ('j') | device/bluetooth/bluetooth_device_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698