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

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

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

Powered by Google App Engine
This is Rietveld 408576698