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

Side by Side Diff: extensions/browser/api/usb/usb_api.h

Issue 1618393004: Update device/usb and its Mojo interface for variable size ISO packets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Document use of ErrorWithArguments. Created 4 years, 10 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_handle_impl.cc ('k') | extensions/browser/api/usb/usb_api.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 EXTENSIONS_BROWSER_API_USB_USB_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_USB_USB_API_H_
6 #define EXTENSIONS_BROWSER_API_USB_USB_API_H_ 6 #define EXTENSIONS_BROWSER_API_USB_USB_API_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 DISALLOW_COPY_AND_ASSIGN(UsbCloseDeviceFunction); 239 DISALLOW_COPY_AND_ASSIGN(UsbCloseDeviceFunction);
240 }; 240 };
241 241
242 class UsbClaimInterfaceFunction : public UsbConnectionFunction { 242 class UsbClaimInterfaceFunction : public UsbConnectionFunction {
243 public: 243 public:
244 DECLARE_EXTENSION_FUNCTION("usb.claimInterface", USB_CLAIMINTERFACE) 244 DECLARE_EXTENSION_FUNCTION("usb.claimInterface", USB_CLAIMINTERFACE)
245 245
246 UsbClaimInterfaceFunction(); 246 UsbClaimInterfaceFunction();
247 247
248 protected: 248 private:
249 ~UsbClaimInterfaceFunction() override; 249 ~UsbClaimInterfaceFunction() override;
250 250
251 // ExtensionFunction: 251 // ExtensionFunction:
252 ResponseAction Run() override; 252 ResponseAction Run() override;
253 253
254 void OnComplete(bool success); 254 void OnComplete(bool success);
255 255
256 DISALLOW_COPY_AND_ASSIGN(UsbClaimInterfaceFunction); 256 DISALLOW_COPY_AND_ASSIGN(UsbClaimInterfaceFunction);
257 }; 257 };
258 258
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 private: 328 private:
329 ~UsbInterruptTransferFunction() override; 329 ~UsbInterruptTransferFunction() override;
330 330
331 // ExtensionFunction: 331 // ExtensionFunction:
332 ResponseAction Run() override; 332 ResponseAction Run() override;
333 333
334 DISALLOW_COPY_AND_ASSIGN(UsbInterruptTransferFunction); 334 DISALLOW_COPY_AND_ASSIGN(UsbInterruptTransferFunction);
335 }; 335 };
336 336
337 class UsbIsochronousTransferFunction : public UsbTransferFunction { 337 class UsbIsochronousTransferFunction : public UsbConnectionFunction {
338 public: 338 public:
339 DECLARE_EXTENSION_FUNCTION("usb.isochronousTransfer", USB_ISOCHRONOUSTRANSFER) 339 DECLARE_EXTENSION_FUNCTION("usb.isochronousTransfer", USB_ISOCHRONOUSTRANSFER)
340 340
341 UsbIsochronousTransferFunction(); 341 UsbIsochronousTransferFunction();
342 342
343 private: 343 private:
344 ~UsbIsochronousTransferFunction() override; 344 ~UsbIsochronousTransferFunction() override;
345 345
346 // ExtensionFunction: 346 // ExtensionFunction:
347 ResponseAction Run() override; 347 ResponseAction Run() override;
348 348
349 void OnCompleted(
350 scoped_refptr<net::IOBuffer> data,
351 const std::vector<device::UsbDeviceHandle::IsochronousPacket>& packets);
352
349 DISALLOW_COPY_AND_ASSIGN(UsbIsochronousTransferFunction); 353 DISALLOW_COPY_AND_ASSIGN(UsbIsochronousTransferFunction);
350 }; 354 };
351 355
352 class UsbResetDeviceFunction : public UsbConnectionFunction { 356 class UsbResetDeviceFunction : public UsbConnectionFunction {
353 public: 357 public:
354 DECLARE_EXTENSION_FUNCTION("usb.resetDevice", USB_RESETDEVICE) 358 DECLARE_EXTENSION_FUNCTION("usb.resetDevice", USB_RESETDEVICE)
355 359
356 UsbResetDeviceFunction(); 360 UsbResetDeviceFunction();
357 361
358 private: 362 private:
359 ~UsbResetDeviceFunction() override; 363 ~UsbResetDeviceFunction() override;
360 364
361 // ExtensionFunction: 365 // ExtensionFunction:
362 ResponseAction Run() override; 366 ResponseAction Run() override;
363 367
364 void OnComplete(bool success); 368 void OnComplete(bool success);
365 369
366 scoped_ptr<extensions::api::usb::ResetDevice::Params> parameters_; 370 scoped_ptr<extensions::api::usb::ResetDevice::Params> parameters_;
367 371
368 DISALLOW_COPY_AND_ASSIGN(UsbResetDeviceFunction); 372 DISALLOW_COPY_AND_ASSIGN(UsbResetDeviceFunction);
369 }; 373 };
370 } // namespace extensions 374 } // namespace extensions
371 375
372 #endif // EXTENSIONS_BROWSER_API_USB_USB_API_H_ 376 #endif // EXTENSIONS_BROWSER_API_USB_USB_API_H_
OLDNEW
« no previous file with comments | « device/usb/usb_device_handle_impl.cc ('k') | extensions/browser/api/usb/usb_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698