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

Unified Diff: ppapi/shared_impl/var_tracker.h

Issue 8930010: Implement in-process PPB_VarArrayBuffer_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years 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.cc ('k') | ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/var_tracker.h
diff --git a/ppapi/shared_impl/var_tracker.h b/ppapi/shared_impl/var_tracker.h
index f91c2090f6d380f6ddca9720567253e12ade813f..a2debe0761f7f31ef9a6ccf290e3a3524555e43e 100644
--- a/ppapi/shared_impl/var_tracker.h
+++ b/ppapi/shared_impl/var_tracker.h
@@ -8,11 +8,13 @@
#include "base/basictypes.h"
#include "base/hash_tables.h"
#include "base/memory/ref_counted.h"
+#include "ppapi/c/pp_module.h"
#include "ppapi/c/pp_var.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
namespace ppapi {
+class ArrayBufferVar;
class Var;
// Tracks non-POD (refcounted) var objects held by a plugin.
@@ -54,6 +56,10 @@ class PPAPI_SHARED_EXPORT VarTracker {
bool ReleaseVar(int32 var_id);
bool ReleaseVar(const PP_Var& var);
+ // Create a new array buffer of size |size_in_bytes|. Return a PP_Var that
+ // that references it and has an initial reference-count of 1.
+ PP_Var MakeArrayBufferPPVar(uint32 size_in_bytes);
+
protected:
struct VarInfo {
VarInfo();
@@ -126,6 +132,12 @@ class PPAPI_SHARED_EXPORT VarTracker {
// Last assigned var ID.
int32 last_var_id_;
+ private:
+ // Create and return a new ArrayBufferVar size_in_bytes bytes long. This is
+ // implemented by the Host and Plugin tracker separately, so that it can be
+ // a real WebKit ArrayBuffer on the host side.
+ virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) = 0;
+
DISALLOW_COPY_AND_ASSIGN(VarTracker);
};
« no previous file with comments | « ppapi/shared_impl/var.cc ('k') | ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698