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

Unified Diff: ppapi/shared_impl/ppb_var_shared.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 reviews 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/plugin_array_buffer_var.cc ('k') | ppapi/shared_impl/var.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_var_shared.cc
diff --git a/ppapi/shared_impl/ppb_var_shared.cc b/ppapi/shared_impl/ppb_var_shared.cc
index 7b0ffb468f78aec461a337557d1deef054894043..3fb1c037fb32a10e97376c0f8234906b8d37f5c1 100644
--- a/ppapi/shared_impl/ppb_var_shared.cc
+++ b/ppapi/shared_impl/ppb_var_shared.cc
@@ -75,11 +75,12 @@ PP_Var CreateArrayBufferVar(uint32_t size_in_bytes) {
size_in_bytes);
}
-uint32_t ByteLength(PP_Var array) {
+PP_Bool ByteLength(PP_Var array, uint32_t* byte_length) {
ArrayBufferVar* buffer = ArrayBufferVar::FromPPVar(array);
if (!buffer)
- return 0;
- return buffer->ByteLength();
+ return PP_FALSE;
+ *byte_length = buffer->ByteLength();
+ return PP_TRUE;
}
void* Map(PP_Var array) {
@@ -89,10 +90,17 @@ void* Map(PP_Var array) {
return buffer->Map();
}
+void Unmap(PP_Var array) {
+ ArrayBufferVar* buffer = ArrayBufferVar::FromPPVar(array);
+ if (buffer)
+ buffer->Unmap();
+}
+
const PPB_VarArrayBuffer_Dev var_arraybuffer_interface = {
&CreateArrayBufferVar,
&ByteLength,
- &Map
+ &Map,
+ &Unmap
};
} // namespace
« no previous file with comments | « ppapi/proxy/plugin_array_buffer_var.cc ('k') | ppapi/shared_impl/var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698