OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef USBIsochronousInTransferResult_h |
| 6 #define USBIsochronousInTransferResult_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "core/dom/DOMArrayBuffer.h" |
| 10 #include "core/dom/DOMDataView.h" |
| 11 #include "modules/webusb/USBIsochronousInTransferPacket.h" |
| 12 #include "platform/heap/Handle.h" |
| 13 #include "wtf/text/WTFString.h" |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 class USBIsochronousInTransferResult final : public GarbageCollectedFinalized<US
BIsochronousInTransferResult>, public ScriptWrappable { |
| 18 DEFINE_WRAPPERTYPEINFO(); |
| 19 public: |
| 20 static USBIsochronousInTransferResult* create(PassRefPtr<DOMArrayBuffer> dat
a, const HeapVector<Member<USBIsochronousInTransferPacket>>& packets) |
| 21 { |
| 22 return new USBIsochronousInTransferResult(data, packets); |
| 23 } |
| 24 |
| 25 USBIsochronousInTransferResult(PassRefPtr<DOMArrayBuffer> data, const HeapVe
ctor<Member<USBIsochronousInTransferPacket>>& packets) |
| 26 : m_data(DOMDataView::create(data, 0, data->byteLength())) |
| 27 , m_packets(packets) |
| 28 { |
| 29 } |
| 30 |
| 31 virtual ~USBIsochronousInTransferResult() {} |
| 32 |
| 33 PassRefPtr<DOMDataView> data() const { return m_data; } |
| 34 const HeapVector<Member<USBIsochronousInTransferPacket>>& packets() const |
| 35 { |
| 36 return m_packets; |
| 37 } |
| 38 |
| 39 DEFINE_INLINE_TRACE() { visitor->trace(m_packets); } |
| 40 |
| 41 private: |
| 42 const RefPtr<DOMDataView> m_data; |
| 43 const HeapVector<Member<USBIsochronousInTransferPacket>> m_packets; |
| 44 }; |
| 45 |
| 46 } // namespace blink |
| 47 |
| 48 #endif // USBIsochronousInTransferResult_h |
OLD | NEW |