| 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_bluez.h" | 5 #include "device/bluetooth/bluetooth_socket_bluez.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <queue> | 9 #include <queue> |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/bind.h" | 12 #include "base/bind.h" |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 13 #include "base/logging.h" | 14 #include "base/logging.h" |
| 14 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
| 18 #include "base/sequenced_task_runner.h" | 19 #include "base/sequenced_task_runner.h" |
| 19 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| 20 #include "base/task_runner_util.h" | 21 #include "base/task_runner_util.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 adapter_->AddObserver(this); | 133 adapter_->AddObserver(this); |
| 133 | 134 |
| 134 uuid_ = uuid; | 135 uuid_ = uuid; |
| 135 options_.reset(new bluez::BluetoothProfileManagerClient::Options()); | 136 options_.reset(new bluez::BluetoothProfileManagerClient::Options()); |
| 136 if (service_options.name) | 137 if (service_options.name) |
| 137 options_->name.reset(new std::string(*service_options.name)); | 138 options_->name.reset(new std::string(*service_options.name)); |
| 138 | 139 |
| 139 switch (socket_type) { | 140 switch (socket_type) { |
| 140 case kRfcomm: | 141 case kRfcomm: |
| 141 options_->channel.reset( | 142 options_->channel.reset( |
| 142 new uint16(service_options.channel ? *service_options.channel : 0)); | 143 new uint16_t(service_options.channel ? *service_options.channel : 0)); |
| 143 break; | 144 break; |
| 144 case kL2cap: | 145 case kL2cap: |
| 145 options_->psm.reset( | 146 options_->psm.reset( |
| 146 new uint16(service_options.psm ? *service_options.psm : 0)); | 147 new uint16_t(service_options.psm ? *service_options.psm : 0)); |
| 147 break; | 148 break; |
| 148 default: | 149 default: |
| 149 NOTREACHED(); | 150 NOTREACHED(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 RegisterProfile(static_cast<BluetoothAdapterBlueZ*>(adapter.get()), | 153 RegisterProfile(static_cast<BluetoothAdapterBlueZ*>(adapter.get()), |
| 153 success_callback, error_callback); | 154 success_callback, error_callback); |
| 154 } | 155 } |
| 155 | 156 |
| 156 void BluetoothSocketBlueZ::Close() { | 157 void BluetoothSocketBlueZ::Close() { |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 DCHECK(profile_); | 536 DCHECK(profile_); |
| 536 | 537 |
| 537 VLOG(1) << profile_->object_path().value() << ": Release profile"; | 538 VLOG(1) << profile_->object_path().value() << ": Release profile"; |
| 538 | 539 |
| 539 static_cast<BluetoothAdapterBlueZ*>(adapter_.get()) | 540 static_cast<BluetoothAdapterBlueZ*>(adapter_.get()) |
| 540 ->ReleaseProfile(device_path_, profile_); | 541 ->ReleaseProfile(device_path_, profile_); |
| 541 profile_ = nullptr; | 542 profile_ = nullptr; |
| 542 } | 543 } |
| 543 | 544 |
| 544 } // namespace bluez | 545 } // namespace bluez |
| OLD | NEW |