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

Side by Side Diff: Source/modules/bluetooth/ConvertWebVectorToArrayBuffer.cpp

Issue 1147243004: bluetooth: readValue Blink implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-read-value-interface
Patch Set: Fix Web Exposed Layout Test 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 unified diff | Download patch
« no previous file with comments | « Source/modules/bluetooth/ConvertWebVectorToArrayBuffer.h ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "modules/bluetooth/ConvertWebVectorToArrayBuffer.h"
7
8 #include "wtf/OwnPtr.h"
9
10 namespace blink {
11
12 PassRefPtr<DOMArrayBuffer> ConvertWebVectorToArrayBuffer::take(ScriptPromiseReso lver*, WebVector<uint8_t>* webVectorRawPointer)
13 {
14 OwnPtr<WebVector<uint8_t>> webVector = adoptPtr(webVectorRawPointer);
15
16 static_assert(sizeof(*webVector->data()) == 1, "uint8_t should be a single b yte");
17
18 RefPtr<DOMArrayBuffer> domBuffer = DOMArrayBuffer::create(webVector->data(), webVector->size());
19
20 return domBuffer;
21 }
22
23 void ConvertWebVectorToArrayBuffer::dispose(WebVector<uint8_t>* webBufferRaw)
24 {
25 delete webBufferRaw;
26 }
27
28 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/bluetooth/ConvertWebVectorToArrayBuffer.h ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698