Index: third_party/WebKit/Source/modules/webusb/USBIsochronousInTransferResult.h |
diff --git a/third_party/WebKit/Source/modules/webusb/USBIsochronousInTransferResult.h b/third_party/WebKit/Source/modules/webusb/USBIsochronousInTransferResult.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..43f787f6c9aff8e14945539f191cdcbb426cffe3 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/webusb/USBIsochronousInTransferResult.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef USBIsochronousInTransferResult_h |
+#define USBIsochronousInTransferResult_h |
+ |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "core/dom/DOMArrayBuffer.h" |
+#include "core/dom/DOMDataView.h" |
+#include "modules/webusb/USBIsochronousInTransferPacket.h" |
+#include "platform/heap/Handle.h" |
+#include "wtf/text/WTFString.h" |
+ |
+namespace blink { |
+ |
+class USBIsochronousInTransferResult final : public GarbageCollectedFinalized<USBIsochronousInTransferResult>, public ScriptWrappable { |
+ DEFINE_WRAPPERTYPEINFO(); |
+public: |
+ static USBIsochronousInTransferResult* create(PassRefPtr<DOMArrayBuffer> data, const HeapVector<Member<USBIsochronousInTransferPacket>>& packets) |
+ { |
+ return new USBIsochronousInTransferResult(data, packets); |
+ } |
+ |
+ USBIsochronousInTransferResult(PassRefPtr<DOMArrayBuffer> data, const HeapVector<Member<USBIsochronousInTransferPacket>>& packets) |
+ : m_data(DOMDataView::create(data, 0, data->byteLength())) |
+ , m_packets(packets) |
+ { |
+ } |
+ |
+ virtual ~USBIsochronousInTransferResult() {} |
+ |
+ PassRefPtr<DOMDataView> data() const { return m_data; } |
+ const HeapVector<Member<USBIsochronousInTransferPacket>>& packets() const |
+ { |
+ return m_packets; |
+ } |
+ |
+ DEFINE_INLINE_TRACE() { visitor->trace(m_packets); } |
+ |
+private: |
+ const RefPtr<DOMDataView> m_data; |
+ const HeapVector<Member<USBIsochronousInTransferPacket>> m_packets; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // USBIsochronousInTransferResult_h |