OLD | NEW |
---|---|
(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 | |
OLD | NEW |