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

Side by Side Diff: third_party/WebKit/Source/core/mojo/MojoSharedBuffer.cpp

Issue 2720873002: Implements JS bindings for mojo shared buffer. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
(Empty)
1 // Copyright 2017 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 "core/mojo/MojoSharedBuffer.h"
6
7 #include "core/dom/DOMArrayBuffer.h"
8 #include "mojo/public/cpp/system/core.h"
9
10 namespace blink {
11
12 MojoSharedBuffer::MojoSharedBuffer(void* data, unsigned numBytes)
13 : m_buffer(DOMArrayBuffer::create(data, numBytes)) {
14 // TODO(alokp): We need to create an ArrayBuffer that does not own data.
alokp 2017/02/27 19:50:45 jbroman@: I could not find a way to create an arra
jbroman 2017/02/27 20:14:44 blink::DOMArrayBufferBase doesn't presently suppor
alokp 2017/02/27 20:30:34 I think the latter - teaching DOMArrayBufferBase a
alokp 2017/02/28 00:22:15 A quick patch to support externalized ArrayBuffer:
15 }
16
17 void MojoSharedBuffer::unmap() {
18 MojoUnmapBuffer(m_buffer->data());
19 // TODO(alokp): Neuter m_buffer.
alokp 2017/02/27 19:50:45 jbroman@: Is Neutering the correct thing to do her
jbroman 2017/02/27 20:14:44 Yes, probably.
20 }
21
22 DEFINE_TRACE(MojoSharedBuffer) {
23 visitor->trace(m_buffer);
24 }
25
26 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698