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

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

Issue 2849893003: Shorten USB enumeration control transfer timeouts to 2 seconds (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | device/usb/webusb_descriptors.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 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 "device/usb/usb_descriptors.h" 5 #include "device/usb/usb_descriptors.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 23 matching lines...) Expand all
34 const uint8_t kInterfaceDescriptorType = 0x04; 34 const uint8_t kInterfaceDescriptorType = 0x04;
35 const uint8_t kEndpointDescriptorType = 0x05; 35 const uint8_t kEndpointDescriptorType = 0x05;
36 const uint8_t kInterfaceAssociationDescriptorType = 11; 36 const uint8_t kInterfaceAssociationDescriptorType = 11;
37 37
38 const uint8_t kDeviceDescriptorLength = 18; 38 const uint8_t kDeviceDescriptorLength = 18;
39 const uint8_t kConfigurationDescriptorLength = 9; 39 const uint8_t kConfigurationDescriptorLength = 9;
40 const uint8_t kInterfaceDescriptorLength = 9; 40 const uint8_t kInterfaceDescriptorLength = 9;
41 const uint8_t kEndpointDescriptorLength = 7; 41 const uint8_t kEndpointDescriptorLength = 7;
42 const uint8_t kInterfaceAssociationDescriptorLength = 8; 42 const uint8_t kInterfaceAssociationDescriptorLength = 8;
43 43
44 const int kControlTransferTimeout = 60000; // 1 minute 44 const int kControlTransferTimeout = 2000; // 2 seconds
mcasas 2017/04/29 01:33:16 nit: consider encoding the units in the name, e.g.
45 45
46 struct UsbInterfaceAssociationDescriptor { 46 struct UsbInterfaceAssociationDescriptor {
47 UsbInterfaceAssociationDescriptor(uint8_t first_interface, 47 UsbInterfaceAssociationDescriptor(uint8_t first_interface,
48 uint8_t interface_count) 48 uint8_t interface_count)
49 : first_interface(first_interface), interface_count(interface_count) {} 49 : first_interface(first_interface), interface_count(interface_count) {}
50 50
51 bool operator<(const UsbInterfaceAssociationDescriptor& other) const { 51 bool operator<(const UsbInterfaceAssociationDescriptor& other) const {
52 return first_interface < other.first_interface; 52 return first_interface < other.first_interface;
53 } 53 }
54 54
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 callback.Run(std::move(index_map)); 536 callback.Run(std::move(index_map));
537 return; 537 return;
538 } 538 }
539 539
540 ReadStringDescriptor(device_handle, 0, 0, 540 ReadStringDescriptor(device_handle, 0, 0,
541 base::Bind(&OnReadLanguageIds, device_handle, 541 base::Bind(&OnReadLanguageIds, device_handle,
542 base::Passed(&index_map), callback)); 542 base::Passed(&index_map), callback));
543 } 543 }
544 544
545 } // namespace device 545 } // namespace device
OLDNEW
« no previous file with comments | « no previous file | device/usb/webusb_descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698