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

Side by Side Diff: ppapi/proxy/plugin_array_buffer_var.cc

Issue 9169052: Tweaks to PPB_VarArrayBuffer in preperation for taking out of Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes based on review comments Created 8 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/plugin_array_buffer_var.h" 5 #include "ppapi/proxy/plugin_array_buffer_var.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
11 namespace ppapi { 11 namespace ppapi {
12 12
13 PluginArrayBufferVar::PluginArrayBufferVar(uint32 size_in_bytes) 13 PluginArrayBufferVar::PluginArrayBufferVar(uint32 size_in_bytes)
14 : buffer_(size_in_bytes) { 14 : buffer_(size_in_bytes) {
15 } 15 }
16 16
17 PluginArrayBufferVar::~PluginArrayBufferVar() { 17 PluginArrayBufferVar::~PluginArrayBufferVar() {
18 } 18 }
19 19
20 void* PluginArrayBufferVar::Map() { 20 void* PluginArrayBufferVar::Map() {
21 if (buffer_.empty()) 21 if (buffer_.empty())
22 return NULL; 22 return NULL;
23 return &(buffer_[0]); 23 return &(buffer_[0]);
24 } 24 }
25 25
26 void PluginArrayBufferVar::Unmap() {
27 // We don't actually use shared memory yet, so do nothing.
28 }
29
26 uint32 PluginArrayBufferVar::ByteLength() { 30 uint32 PluginArrayBufferVar::ByteLength() {
27 return buffer_.size(); 31 return buffer_.size();
28 } 32 }
29 33
30 } // namespace ppapi 34 } // namespace ppapi
31 35
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698