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

Unified Diff: ppapi/native_client/src/shared/ppapi_proxy/object_serialize.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: update the documentation 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
Index: ppapi/native_client/src/shared/ppapi_proxy/object_serialize.cc
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/object_serialize.cc b/ppapi/native_client/src/shared/ppapi_proxy/object_serialize.cc
index 7d295027606fcb1c087890c6133dc630689593ea..6debbe22c43c47c4bc95f212535812a5d6e04daa 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/object_serialize.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/object_serialize.cc
@@ -131,7 +131,9 @@ uint32_t PpVarSize(const PP_Var& var) {
break;
}
case PP_VARTYPE_ARRAY_BUFFER: {
- uint32_t buffer_length = PPBVarArrayBufferInterface()->ByteLength(var);
+ uint32_t buffer_length = 0;
+ if (!PPBVarArrayBufferInterface()->ByteLength(var, &buffer_length))
+ return 0;
buffer_length = RoundedStringBytes(buffer_length);
if (AddWouldOverflow(buffer_length,
NACL_OFFSETOF(SerializedString, string_bytes))) {
@@ -226,8 +228,8 @@ bool SerializePpVar(const PP_Var* vars,
break;
}
case PP_VARTYPE_ARRAY_BUFFER: {
- uint32_t buffer_length =
- PPBVarArrayBufferInterface()->ByteLength(vars[i]);
+ uint32_t buffer_length = 0;
+ PPBVarArrayBufferInterface()->ByteLength(vars[i], &buffer_length);
SerializedString* ss = reinterpret_cast<SerializedString*>(p);
ss->fixed.u.string_length = buffer_length;
memcpy(reinterpret_cast<void*>(ss->string_bytes),

Powered by Google App Engine
This is Rietveld 408576698