Chromium Code Reviews| Index: Source/modules/webusb/USBInTransferResult.h |
| diff --git a/Source/modules/webusb/USBInTransferResult.h b/Source/modules/webusb/USBInTransferResult.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bf44449bc38387d2d860849debd13d51325f1f28 |
| --- /dev/null |
| +++ b/Source/modules/webusb/USBInTransferResult.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2015 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 USBInTransferResult_h |
| +#define USBInTransferResult_h |
| + |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "core/dom/DOMArrayBuffer.h" |
| +#include "platform/heap/Handle.h" |
| +#include "public/platform/modules/webusb/WebUSBTransferInfo.h" |
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +class ExceptionState; |
| +class USBDevice; |
| +class USBInterface; |
|
Reilly Grant (use Gerrit)
2015/08/24 21:47:17
These forward declarations are unnecessary.
Ken Rockot(use gerrit already)
2015/08/24 22:52:37
Done.
|
| + |
| +class USBInTransferResult |
| + : public GarbageCollected<USBInTransferResult> |
| + , public ScriptWrappable { |
| + DEFINE_WRAPPERTYPEINFO(); |
| +public: |
| + static USBInTransferResult* create(const String& status, const WebVector<uint8_t> data) |
| + { |
| + return new USBInTransferResult(status, data); |
| + } |
| + |
| + USBInTransferResult(const String& status, const WebVector<uint8_t> data) |
| + : m_status(status) |
| + , m_data(DOMArrayBuffer::create(data.data(), data.size())) |
| + { |
| + } |
| + |
| + String status() const { return m_status; } |
| + PassRefPtr<DOMArrayBuffer> data() const { return m_data; } |
| + |
| + DEFINE_INLINE_TRACE() { } |
| + |
| +private: |
| + const String m_status; |
| + const RefPtr<DOMArrayBuffer> m_data; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // USBInTransferResult_h |