blob: 6d16cfe60d0747db8ceee2175381b399d7170a98 [file] [log] [blame]
[email protected]47ef6142012-01-26 21:04:101// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]8cc26a42011-12-15 21:22:312// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ppapi/proxy/plugin_array_buffer_var.h"
6
7#include <stdlib.h>
8
9#include <limits>
10
11namespace ppapi {
12
13PluginArrayBufferVar::PluginArrayBufferVar(uint32 size_in_bytes)
14 : buffer_(size_in_bytes) {
15}
16
17PluginArrayBufferVar::~PluginArrayBufferVar() {
18}
19
20void* PluginArrayBufferVar::Map() {
21 if (buffer_.empty())
22 return NULL;
23 return &(buffer_[0]);
24}
25
[email protected]47ef6142012-01-26 21:04:1026void PluginArrayBufferVar::Unmap() {
27 // We don't actually use shared memory yet, so do nothing.
28}
29
[email protected]8cc26a42011-12-15 21:22:3130uint32 PluginArrayBufferVar::ByteLength() {
31 return buffer_.size();
32}
33
34} // namespace ppapi
35