| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 broken_ ? device::USB_TRANSFER_ERROR : device::USB_TRANSFER_COMPLETED; | 223 broken_ ? device::USB_TRANSFER_ERROR : device::USB_TRANSFER_COMPLETED; |
| 224 base::ThreadTaskRunnerHandle::Get()->PostTask( | 224 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 225 FROM_HERE, base::Bind(callback, status, nullptr, 0)); | 225 FROM_HERE, base::Bind(callback, status, nullptr, 0)); |
| 226 ProcessQueries(); | 226 ProcessQueries(); |
| 227 } else if (direction == device::USB_DIRECTION_INBOUND) { | 227 } else if (direction == device::USB_DIRECTION_INBOUND) { |
| 228 queries_.push(Query(callback, buffer, length)); | 228 queries_.push(Query(callback, buffer, length)); |
| 229 ProcessQueries(); | 229 ProcessQueries(); |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 | 232 |
| 233 bool FindInterfaceByEndpoint(uint8_t endpoint_address, | 233 const UsbInterfaceDescriptor* FindInterfaceByEndpoint( |
| 234 uint8_t* interface_number) { | 234 uint8_t endpoint_address) { |
| 235 NOTIMPLEMENTED(); | 235 NOTIMPLEMENTED(); |
| 236 return false; | 236 return nullptr; |
| 237 } | 237 } |
| 238 | 238 |
| 239 template <class D> | 239 template <class D> |
| 240 void append(D data) { | 240 void append(D data) { |
| 241 std::copy(reinterpret_cast<char*>(&data), | 241 std::copy(reinterpret_cast<char*>(&data), |
| 242 (reinterpret_cast<char*>(&data)) + sizeof(D), | 242 (reinterpret_cast<char*>(&data)) + sizeof(D), |
| 243 std::back_inserter(output_buffer_)); | 243 std::back_inserter(output_buffer_)); |
| 244 } | 244 } |
| 245 | 245 |
| 246 // Copied from AndroidUsbDevice::Checksum | 246 // Copied from AndroidUsbDevice::Checksum |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 EXPECT_EQ(2, listener.invoked_); | 793 EXPECT_EQ(2, listener.invoked_); |
| 794 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); | 794 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); |
| 795 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 795 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
| 796 } | 796 } |
| 797 | 797 |
| 798 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { | 798 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { |
| 799 MockCountListenerForCheckingTraits listener(adb_bridge_); | 799 MockCountListenerForCheckingTraits listener(adb_bridge_); |
| 800 adb_bridge_->AddDeviceCountListener(&listener); | 800 adb_bridge_->AddDeviceCountListener(&listener); |
| 801 runner_->Run(); | 801 runner_->Run(); |
| 802 } | 802 } |
| OLD | NEW |