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; |
bbudge
2012/01/25 22:19:07
byte_length is undefined in this case. You might w
dmichael (off chromium)
2012/01/25 23:50:11
Good point. My intent is that byte_length is guara
|
+ *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 |