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

Side by Side Diff: device/bluetooth/bluez/bluetooth_socket_bluez.cc

Issue 2070283002: Use container::back() and container::pop_back(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 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/bluez/bluetooth_socket_bluez.h" 5 #include "device/bluetooth/bluez/bluetooth_socket_bluez.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <queue> 10 #include <queue>
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 VLOG(1) << profile_->object_path().value() << ": Request disconnection"; 392 VLOG(1) << profile_->object_path().value() << ": Request disconnection";
393 callback.Run(SUCCESS); 393 callback.Run(SUCCESS);
394 } 394 }
395 395
396 void BluetoothSocketBlueZ::Cancel() { 396 void BluetoothSocketBlueZ::Cancel() {
397 DCHECK(ui_task_runner()->RunsTasksOnCurrentThread()); 397 DCHECK(ui_task_runner()->RunsTasksOnCurrentThread());
398 DCHECK(profile_); 398 DCHECK(profile_);
399 399
400 VLOG(1) << profile_->object_path().value() << ": Cancel"; 400 VLOG(1) << profile_->object_path().value() << ": Cancel";
401 401
402 if (!connection_request_queue_.size()) 402 if (connection_request_queue_.empty())
403 return; 403 return;
404 404
405 // If the front request is being accepted mark it as cancelled, otherwise 405 // If the front request is being accepted mark it as cancelled, otherwise
406 // just pop it from the queue. 406 // just pop it from the queue.
407 linked_ptr<ConnectionRequest> request = connection_request_queue_.front(); 407 linked_ptr<ConnectionRequest> request = connection_request_queue_.front();
408 if (!request->accepting) { 408 if (!request->accepting) {
409 request->cancelled = true; 409 request->cancelled = true;
410 } else { 410 } else {
411 connection_request_queue_.pop(); 411 connection_request_queue_.pop();
412 } 412 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 DCHECK(profile_); 535 DCHECK(profile_);
536 536
537 VLOG(1) << profile_->object_path().value() << ": Release profile"; 537 VLOG(1) << profile_->object_path().value() << ": Release profile";
538 538
539 static_cast<BluetoothAdapterBlueZ*>(adapter_.get()) 539 static_cast<BluetoothAdapterBlueZ*>(adapter_.get())
540 ->ReleaseProfile(device_path_, profile_); 540 ->ReleaseProfile(device_path_, profile_);
541 profile_ = nullptr; 541 profile_ = nullptr;
542 } 542 }
543 543
544 } // namespace bluez 544 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698