| 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> | 7 #include <stdint.h> |
| 8 | |
| 9 #include <queue> | 8 #include <queue> |
| 10 #include <string> | 9 #include <string> |
| 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
| 19 #include "base/sequenced_task_runner.h" | 19 #include "base/sequenced_task_runner.h" |
| 20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 if (!device_path_.value().empty()) { | 361 if (!device_path_.value().empty()) { |
| 362 DCHECK(device_path_ == device_path); | 362 DCHECK(device_path_ == device_path); |
| 363 | 363 |
| 364 socket_thread()->task_runner()->PostTask( | 364 socket_thread()->task_runner()->PostTask( |
| 365 FROM_HERE, | 365 FROM_HERE, |
| 366 base::Bind(&BluetoothSocketBlueZ::DoNewConnection, this, device_path_, | 366 base::Bind(&BluetoothSocketBlueZ::DoNewConnection, this, device_path_, |
| 367 base::Passed(&fd), options, callback)); | 367 base::Passed(&fd), options, callback)); |
| 368 } else { | 368 } else { |
| 369 linked_ptr<ConnectionRequest> request(new ConnectionRequest()); | 369 linked_ptr<ConnectionRequest> request(new ConnectionRequest()); |
| 370 request->device_path = device_path; | 370 request->device_path = device_path; |
| 371 request->fd = fd.Pass(); | 371 request->fd = std::move(fd); |
| 372 request->options = options; | 372 request->options = options; |
| 373 request->callback = callback; | 373 request->callback = callback; |
| 374 | 374 |
| 375 connection_request_queue_.push(request); | 375 connection_request_queue_.push(request); |
| 376 VLOG(1) << uuid_.canonical_value() << ": Connection is now pending."; | 376 VLOG(1) << uuid_.canonical_value() << ": Connection is now pending."; |
| 377 if (accept_request_) { | 377 if (accept_request_) { |
| 378 AcceptConnectionRequest(); | 378 AcceptConnectionRequest(); |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 } | 381 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 DCHECK(profile_); | 536 DCHECK(profile_); |
| 537 | 537 |
| 538 VLOG(1) << profile_->object_path().value() << ": Release profile"; | 538 VLOG(1) << profile_->object_path().value() << ": Release profile"; |
| 539 | 539 |
| 540 static_cast<BluetoothAdapterBlueZ*>(adapter_.get()) | 540 static_cast<BluetoothAdapterBlueZ*>(adapter_.get()) |
| 541 ->ReleaseProfile(device_path_, profile_); | 541 ->ReleaseProfile(device_path_, profile_); |
| 542 profile_ = nullptr; | 542 profile_ = nullptr; |
| 543 } | 543 } |
| 544 | 544 |
| 545 } // namespace bluez | 545 } // namespace bluez |
| OLD | NEW |