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

Unified Diff: ppapi/shared_impl/var_tracker.cc

Issue 9373032: PPAPI: Proxy VarArrayBuffer for out-of-process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge... again Created 8 years, 10 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/shared_impl/var_tracker.h ('k') | ppapi/thunk/interfaces_ppb_public_dev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/var_tracker.cc
diff --git a/ppapi/shared_impl/var_tracker.cc b/ppapi/shared_impl/var_tracker.cc
index 0b703491f40a36798ebd199c4713e9a24e3cf4df..9e1abe897a7f6594c84d20d9b058841f2cddf315 100644
--- a/ppapi/shared_impl/var_tracker.cc
+++ b/ppapi/shared_impl/var_tracker.cc
@@ -4,6 +4,8 @@
#include "ppapi/shared_impl/var_tracker.h"
+#include <string.h>
+
#include <limits>
#include "base/logging.h"
@@ -164,6 +166,15 @@ PP_Var VarTracker::MakeArrayBufferPPVar(uint32 size_in_bytes) {
return array_buffer->GetPPVar();
}
+PP_Var VarTracker::MakeArrayBufferPPVar(uint32 size_in_bytes,
+ const void* data) {
+ scoped_refptr<ArrayBufferVar> array_buffer(CreateArrayBuffer(size_in_bytes));
+ if (!array_buffer)
+ return PP_MakeNull();
+ memcpy(array_buffer->Map(), data, size_in_bytes);
+ return array_buffer->GetPPVar();
+}
+
std::vector<PP_Var> VarTracker::GetLiveVars() {
std::vector<PP_Var> var_vector;
var_vector.reserve(live_vars_.size());
« no previous file with comments | « ppapi/shared_impl/var_tracker.h ('k') | ppapi/thunk/interfaces_ppb_public_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698