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

Unified Diff: Source/modules/bluetooth/BluetoothArrayBuffer.h

Issue 1147243004: bluetooth: readValue Blink implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-read-value-interface
Patch Set: Address jyasskin's comments Created 5 years, 6 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
Index: Source/modules/bluetooth/BluetoothArrayBuffer.h
diff --git a/Source/modules/bluetooth/BluetoothArrayBuffer.h b/Source/modules/bluetooth/BluetoothArrayBuffer.h
new file mode 100644
index 0000000000000000000000000000000000000000..1605c67b0101d50ae76f3c33d7015a8911dcc5e9
--- /dev/null
+++ b/Source/modules/bluetooth/BluetoothArrayBuffer.h
@@ -0,0 +1,32 @@
+// 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 BluetoothArrayBuffer_h
+#define BluetoothArrayBuffer_h
+
+#include "core/dom/DOMArrayBuffer.h"
+#include "platform/heap/Handle.h"
+#include "public/platform/WebVector.h"
haraken 2015/06/11 01:13:13 WebVector will work for your purpose, but wouldn't
Jeffrey Yasskin 2015/06/11 01:30:36 I'm not an expert on Promises in Blink, but that's
haraken 2015/06/11 01:42:20 Ah, thanks; now I understand the flow you want. In
+
+namespace blink {
+
+class ScriptPromiseResolver;
+
+// BluetoothArrayBuffer is used with CallbackPromiseAdapter to receive
+// WebVector responses. See CallbackPromiseAdapter class comments.
+class BluetoothArrayBuffer {
+ WTF_MAKE_NONCOPYABLE(BluetoothArrayBuffer);
+public:
+ // Interface required by CallbackPromiseAdapter:
+ typedef WebVector<uint8_t> WebType;
+ static PassRefPtr<DOMArrayBuffer> take(ScriptPromiseResolver*, WebVector<uint8_t>*);
+ static void dispose(WebVector<uint8_t>*);
+
+private:
+ BluetoothArrayBuffer() = delete;
+};
+
+} // namespace blink
+
+#endif // BluetoothArrayBuffer_h

Powered by Google App Engine
This is Rietveld 408576698