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

Unified Diff: Source/modules/webusb/USBOutTransferResult.h

Issue 1315683002: WebUSB bindings part 6 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remote USBTransferStatus.idl Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webusb/USBInTransferResult.idl ('k') | Source/modules/webusb/USBOutTransferResult.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webusb/USBOutTransferResult.h
diff --git a/Source/modules/webusb/USBOutTransferResult.h b/Source/modules/webusb/USBOutTransferResult.h
new file mode 100644
index 0000000000000000000000000000000000000000..27756ca0d20ae66de72005617484e74466394c05
--- /dev/null
+++ b/Source/modules/webusb/USBOutTransferResult.h
@@ -0,0 +1,46 @@
+// 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 USBOutTransferResult_h
+#define USBOutTransferResult_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 USBOutTransferResult final
+ : public GarbageCollectedFinalized<USBOutTransferResult>
+ , public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static USBOutTransferResult* create(const String& status, unsigned bytesWritten)
+ {
+ return new USBOutTransferResult(status, bytesWritten);
+ }
+
+ USBOutTransferResult(const String& status, unsigned bytesWritten)
+ : m_status(status)
+ , m_bytesWritten(bytesWritten)
+ {
+ }
+
+ virtual ~USBOutTransferResult() { }
+
+ String status() const { return m_status; }
+ unsigned bytesWritten() const { return m_bytesWritten; }
+
+ DEFINE_INLINE_TRACE() { }
+
+private:
+ const String m_status;
+ const unsigned m_bytesWritten;
+};
+
+} // namespace blink
+
+#endif // USBOutTransferResult_h
« no previous file with comments | « Source/modules/webusb/USBInTransferResult.idl ('k') | Source/modules/webusb/USBOutTransferResult.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698