OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_socket_mac.h" | 5 #include "device/bluetooth/bluetooth_socket_mac.h" |
6 | 6 |
7 #import <IOBluetooth/IOBluetooth.h> | 7 #import <IOBluetooth/IOBluetooth.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 AcceptConnectionRequest(); | 861 AcceptConnectionRequest(); |
862 } | 862 } |
863 | 863 |
864 void BluetoothSocketMac::AcceptConnectionRequest() { | 864 void BluetoothSocketMac::AcceptConnectionRequest() { |
865 DCHECK(thread_checker_.CalledOnValidThread()); | 865 DCHECK(thread_checker_.CalledOnValidThread()); |
866 DVLOG(1) << uuid_.canonical_value() << ": Accepting pending connection."; | 866 DVLOG(1) << uuid_.canonical_value() << ": Accepting pending connection."; |
867 | 867 |
868 linked_ptr<BluetoothChannelMac> channel = accept_queue_.front(); | 868 linked_ptr<BluetoothChannelMac> channel = accept_queue_.front(); |
869 accept_queue_.pop(); | 869 accept_queue_.pop(); |
870 | 870 |
871 adapter_->DeviceConnected(channel->GetDevice()); | 871 adapter_->ClassicDeviceConnected(channel->GetDevice()); |
872 BluetoothDevice* device = adapter_->GetDevice(channel->GetDeviceAddress()); | 872 BluetoothDevice* device = adapter_->GetDevice(channel->GetDeviceAddress()); |
873 DCHECK(device); | 873 DCHECK(device); |
874 | 874 |
875 scoped_refptr<BluetoothSocketMac> client_socket = | 875 scoped_refptr<BluetoothSocketMac> client_socket = |
876 BluetoothSocketMac::CreateSocket(); | 876 BluetoothSocketMac::CreateSocket(); |
877 | 877 |
878 client_socket->uuid_ = uuid_; | 878 client_socket->uuid_ = uuid_; |
879 client_socket->channel_.reset(channel.release()); | 879 client_socket->channel_.reset(channel.release()); |
880 | 880 |
881 // Associating the socket can synchronously call into OnChannelOpenComplete(). | 881 // Associating the socket can synchronously call into OnChannelOpenComplete(). |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 rfcomm_connection_listener_.reset(); | 941 rfcomm_connection_listener_.reset(); |
942 l2cap_connection_listener_.reset(); | 942 l2cap_connection_listener_.reset(); |
943 | 943 |
944 // Destroying the listener above prevents the callback delegate from being | 944 // Destroying the listener above prevents the callback delegate from being |
945 // called so it is now safe to release all callback state. | 945 // called so it is now safe to release all callback state. |
946 accept_request_.reset(); | 946 accept_request_.reset(); |
947 empty_queue(accept_queue_); | 947 empty_queue(accept_queue_); |
948 } | 948 } |
949 | 949 |
950 } // namespace device | 950 } // namespace device |
OLD | NEW |