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

Side by Side Diff: device/usb/usb_device_handle_impl.h

Issue 835313003: UsbDeviceHandleImpl must hold a scoped_refptr to UsbDeviceImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/usb_device_handle_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 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 #ifndef DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_ 5 #ifndef DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_
6 #define DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_ 6 #define DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 unsigned int timeout, 79 unsigned int timeout,
80 const UsbTransferCallback& callback) override; 80 const UsbTransferCallback& callback) override;
81 81
82 PlatformUsbDeviceHandle handle() const { return handle_; } 82 PlatformUsbDeviceHandle handle() const { return handle_; }
83 83
84 protected: 84 protected:
85 friend class UsbDeviceImpl; 85 friend class UsbDeviceImpl;
86 86
87 // This constructor is called by UsbDevice. 87 // This constructor is called by UsbDevice.
88 UsbDeviceHandleImpl(scoped_refptr<UsbContext> context, 88 UsbDeviceHandleImpl(scoped_refptr<UsbContext> context,
89 UsbDeviceImpl* device, 89 scoped_refptr<UsbDeviceImpl> device,
90 PlatformUsbDeviceHandle handle); 90 PlatformUsbDeviceHandle handle);
91 91
92 ~UsbDeviceHandleImpl() override; 92 ~UsbDeviceHandleImpl() override;
93 93
94 private: 94 private:
95 friend class Transfer; 95 friend class Transfer;
96 96
97 class InterfaceClaimer; 97 class InterfaceClaimer;
98 class Transfer; 98 class Transfer;
99 99
(...skipping 19 matching lines...) Expand all
119 119
120 // Invokes the callbacks associated with a given transfer, and removes it from 120 // Invokes the callbacks associated with a given transfer, and removes it from
121 // the in-flight transfer set. 121 // the in-flight transfer set.
122 void CompleteTransfer(scoped_ptr<Transfer> transfer); 122 void CompleteTransfer(scoped_ptr<Transfer> transfer);
123 123
124 bool GetSupportedLanguages(); 124 bool GetSupportedLanguages();
125 125
126 // Informs the object to drop internal references. 126 // Informs the object to drop internal references.
127 void InternalClose(); 127 void InternalClose();
128 128
129 UsbDeviceImpl* device_; 129 scoped_refptr<UsbDeviceImpl> device_;
130 130
131 PlatformUsbDeviceHandle handle_; 131 PlatformUsbDeviceHandle handle_;
132 132
133 std::vector<uint16> languages_; 133 std::vector<uint16> languages_;
134 std::map<uint8, base::string16> strings_; 134 std::map<uint8, base::string16> strings_;
135 135
136 typedef std::map<int, scoped_refptr<InterfaceClaimer>> ClaimedInterfaceMap; 136 typedef std::map<int, scoped_refptr<InterfaceClaimer>> ClaimedInterfaceMap;
137 ClaimedInterfaceMap claimed_interfaces_; 137 ClaimedInterfaceMap claimed_interfaces_;
138 138
139 // This set holds weak pointers to pending transfers. 139 // This set holds weak pointers to pending transfers.
(...skipping 11 matching lines...) Expand all
151 151
152 base::ThreadChecker thread_checker_; 152 base::ThreadChecker thread_checker_;
153 base::WeakPtrFactory<UsbDeviceHandleImpl> weak_factory_; 153 base::WeakPtrFactory<UsbDeviceHandleImpl> weak_factory_;
154 154
155 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandleImpl); 155 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandleImpl);
156 }; 156 };
157 157
158 } // namespace device 158 } // namespace device
159 159
160 #endif // DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_ 160 #endif // DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | device/usb/usb_device_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698