| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/devtools/device/usb/usb_device_provider.h" | 5 #include "chrome/browser/devtools/device/usb/usb_device_provider.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/devtools/device/usb/android_rsa.h" | 10 #include "chrome/browser/devtools/device/usb/android_rsa.h" |
| 11 #include "chrome/browser/devtools/device/usb/android_usb_device.h" | 11 #include "chrome/browser/devtools/device/usb/android_usb_device.h" |
| 12 #include "crypto/rsa_private_key.h" | 12 #include "crypto/rsa_private_key.h" |
| 13 #include "net/base/io_buffer.h" |
| 13 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 14 #include "net/socket/stream_socket.h" | 15 #include "net/socket/stream_socket.h" |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 const char kLocalAbstractCommand[] = "localabstract:%s"; | 19 const char kLocalAbstractCommand[] = "localabstract:%s"; |
| 19 | 20 |
| 20 const int kBufferSize = 16 * 1024; | 21 const int kBufferSize = 16 * 1024; |
| 21 | 22 |
| 22 void OnOpenSocket(const UsbDeviceProvider::SocketCallback& callback, | 23 void OnOpenSocket(const UsbDeviceProvider::SocketCallback& callback, |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 device_map_.clear(); | 144 device_map_.clear(); |
| 144 for (AndroidUsbDevices::const_iterator it = devices.begin(); | 145 for (AndroidUsbDevices::const_iterator it = devices.begin(); |
| 145 it != devices.end(); ++it) { | 146 it != devices.end(); ++it) { |
| 146 result.push_back((*it)->serial()); | 147 result.push_back((*it)->serial()); |
| 147 device_map_[(*it)->serial()] = *it; | 148 device_map_[(*it)->serial()] = *it; |
| 148 (*it)->InitOnCallerThread(); | 149 (*it)->InitOnCallerThread(); |
| 149 } | 150 } |
| 150 callback.Run(result); | 151 callback.Run(result); |
| 151 } | 152 } |
| 152 | 153 |
| OLD | NEW |