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

Side by Side Diff: device/usb/usb_device_handle_usbfs.cc

Issue 2108923002: device: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: device 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
« no previous file with comments | « device/usb/usb_device.cc ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/usb/usb_device_handle_usbfs.h" 5 #include "device/usb/usb_device_handle_usbfs.h"
6 6
7 #if defined(OS_ANDROID) && __ANDROID_API__ < 21 7 #if defined(OS_ANDROID) && __ANDROID_API__ < 21
8 #include <linux/usb_ch9.h> 8 #include <linux/usb_ch9.h>
9 #else 9 #else
10 #include <linux/usb/ch9.h> 10 #include <linux/usb/ch9.h>
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 USB_PLOG(DEBUG) << "Failed to submit transfer"; 730 USB_PLOG(DEBUG) << "Failed to submit transfer";
731 callback_runner->PostTask( 731 callback_runner->PostTask(
732 FROM_HERE, base::Bind(callback, ConvertTransferResult(rc), nullptr, 0)); 732 FROM_HERE, base::Bind(callback, ConvertTransferResult(rc), nullptr, 0));
733 } else { 733 } else {
734 SetUpTimeoutCallback(transfer.get(), timeout); 734 SetUpTimeoutCallback(transfer.get(), timeout);
735 transfers_.push_back(std::move(transfer)); 735 transfers_.push_back(std::move(transfer));
736 } 736 }
737 } 737 }
738 738
739 void UsbDeviceHandleUsbfs::ReapedUrbs(const std::vector<usbdevfs_urb*>& urbs) { 739 void UsbDeviceHandleUsbfs::ReapedUrbs(const std::vector<usbdevfs_urb*>& urbs) {
740 for (const auto& urb : urbs) { 740 for (auto* urb : urbs) {
741 Transfer* this_transfer = static_cast<Transfer*>(urb->usercontext); 741 Transfer* this_transfer = static_cast<Transfer*>(urb->usercontext);
742 DCHECK_EQ(urb, &this_transfer->urb); 742 DCHECK_EQ(urb, &this_transfer->urb);
743 auto it = std::find_if( 743 auto it = std::find_if(
744 transfers_.begin(), transfers_.end(), 744 transfers_.begin(), transfers_.end(),
745 [this_transfer](const std::unique_ptr<Transfer>& transfer) -> bool { 745 [this_transfer](const std::unique_ptr<Transfer>& transfer) -> bool {
746 return transfer.get() == this_transfer; 746 return transfer.get() == this_transfer;
747 }); 747 });
748 DCHECK(it != transfers_.end()); 748 DCHECK(it != transfers_.end());
749 std::unique_ptr<Transfer> transfer = std::move(*it); 749 std::unique_ptr<Transfer> transfer = std::move(*it);
750 transfers_.erase(it); 750 transfers_.erase(it);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 packets[i].transferred_length = 0; 852 packets[i].transferred_length = 0;
853 packets[i].status = status; 853 packets[i].status = status;
854 } 854 }
855 transfer->RunIsochronousCallback(packets); 855 transfer->RunIsochronousCallback(packets);
856 } else { 856 } else {
857 transfer->RunCallback(status, 0); 857 transfer->RunCallback(status, 0);
858 } 858 }
859 } 859 }
860 860
861 } // namespace device 861 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/usb_device.cc ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698