Chromium Code Reviews| 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 |