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

Side by Side Diff: third_party/WebKit/Source/modules/webusb/USBAlternateInterface.h

Issue 1850023002: Consume Mojo services directly in Blink's WebUSB implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't do assignments in if statements. Created 4 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 USBAlternateInterface_h 5 #ifndef USBAlternateInterface_h
6 #define USBAlternateInterface_h 6 #define USBAlternateInterface_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "device/usb/public/interfaces/device.mojom-wtf.h"
9 #include "platform/heap/Heap.h" 10 #include "platform/heap/Heap.h"
10 #include "public/platform/modules/webusb/WebUSBDeviceInfo.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class ExceptionState; 14 class ExceptionState;
15 class USBEndpoint; 15 class USBEndpoint;
16 class USBInterface; 16 class USBInterface;
17 17
18 class USBAlternateInterface 18 class USBAlternateInterface
19 : public GarbageCollected<USBAlternateInterface> 19 : public GarbageCollected<USBAlternateInterface>
20 , public ScriptWrappable { 20 , public ScriptWrappable {
21 DEFINE_WRAPPERTYPEINFO(); 21 DEFINE_WRAPPERTYPEINFO();
22 public: 22 public:
23 static USBAlternateInterface* create(const USBInterface*, size_t alternateIn dex); 23 static USBAlternateInterface* create(const USBInterface*, size_t alternateIn dex);
24 static USBAlternateInterface* create(const USBInterface*, size_t alternateSe tting, ExceptionState&); 24 static USBAlternateInterface* create(const USBInterface*, size_t alternateSe tting, ExceptionState&);
25 25
26 USBAlternateInterface(const USBInterface*, size_t alternateIndex); 26 USBAlternateInterface(const USBInterface*, size_t alternateIndex);
27 27
28 const WebUSBDeviceInfo::AlternateInterface& info() const; 28 const device::usb::wtf::AlternateInterfaceInfo& info() const;
29 29
30 uint8_t alternateSetting() const; 30 uint8_t alternateSetting() const { return info().alternate_setting; }
31 uint8_t interfaceClass() const; 31 uint8_t interfaceClass() const { return info().class_code; }
32 uint8_t interfaceSubclass() const; 32 uint8_t interfaceSubclass() const { return info().subclass_code; }
33 uint8_t interfaceProtocol() const; 33 uint8_t interfaceProtocol() const { return info().protocol_code; }
34 String interfaceName() const; 34 String interfaceName() const { return info().interface_name; }
35 HeapVector<Member<USBEndpoint>> endpoints() const; 35 HeapVector<Member<USBEndpoint>> endpoints() const;
36 36
37 DECLARE_TRACE(); 37 DECLARE_TRACE();
38 38
39 private: 39 private:
40 Member<const USBInterface> m_interface; 40 Member<const USBInterface> m_interface;
41 const size_t m_alternateIndex; 41 const size_t m_alternateIndex;
42 }; 42 };
43 43
44 } // namespace blink 44 } // namespace blink
45 45
46 #endif // USBAlternateInterface_h 46 #endif // USBAlternateInterface_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webusb/USB.cpp ('k') | third_party/WebKit/Source/modules/webusb/USBAlternateInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698