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

Side by Side Diff: components/proximity_auth/bluetooth_connection.h

Issue 1359043005: Fix BluetoothConnection to disconnect when the underlying device disconnects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proximity_auth_system2
Patch Set: 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H 5 #ifndef COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H
6 #define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H 6 #define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 26 matching lines...) Expand all
37 37
38 // Connection: 38 // Connection:
39 void Connect() override; 39 void Connect() override;
40 void Disconnect() override; 40 void Disconnect() override;
41 41
42 protected: 42 protected:
43 // Connection: 43 // Connection:
44 void SendMessageImpl(scoped_ptr<WireMessage> message) override; 44 void SendMessageImpl(scoped_ptr<WireMessage> message) override;
45 45
46 // BluetoothAdapter::Observer: 46 // BluetoothAdapter::Observer:
47 void DeviceChanged(device::BluetoothAdapter* adapter,
48 device::BluetoothDevice* device) override;
47 void DeviceRemoved(device::BluetoothAdapter* adapter, 49 void DeviceRemoved(device::BluetoothAdapter* adapter,
48 device::BluetoothDevice* device) override; 50 device::BluetoothDevice* device) override;
49 51
50 private: 52 private:
51 // Registers receive callbacks with the backing |socket_|. 53 // Registers receive callbacks with the backing |socket_|.
52 void StartReceive(); 54 void StartReceive();
53 55
54 // Callbacks for asynchronous Bluetooth operations. 56 // Callbacks for asynchronous Bluetooth operations.
55 void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter); 57 void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter);
56 void OnConnected(scoped_refptr<device::BluetoothSocket> socket); 58 void OnConnected(scoped_refptr<device::BluetoothSocket> socket);
(...skipping 21 matching lines...) Expand all
78 scoped_ptr<WireMessage> pending_message_; 80 scoped_ptr<WireMessage> pending_message_;
79 81
80 base::WeakPtrFactory<BluetoothConnection> weak_ptr_factory_; 82 base::WeakPtrFactory<BluetoothConnection> weak_ptr_factory_;
81 83
82 DISALLOW_COPY_AND_ASSIGN(BluetoothConnection); 84 DISALLOW_COPY_AND_ASSIGN(BluetoothConnection);
83 }; 85 };
84 86
85 } // namespace proximity_auth 87 } // namespace proximity_auth
86 88
87 #endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H 89 #endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H
OLDNEW
« no previous file with comments | « no previous file | components/proximity_auth/bluetooth_connection.cc » ('j') | components/proximity_auth/bluetooth_connection.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698