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

Unified Diff: ppapi/shared_impl/array_writer.h

Issue 12560003: Add support for Var arrays to ArrayWriter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | « no previous file | ppapi/shared_impl/array_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/array_writer.h
diff --git a/ppapi/shared_impl/array_writer.h b/ppapi/shared_impl/array_writer.h
index b761a072233632fe496793920c4b5fd964d64ab7..7e6c3492fd182691be5c737df95eb49de6396c15 100644
--- a/ppapi/shared_impl/array_writer.h
+++ b/ppapi/shared_impl/array_writer.h
@@ -18,6 +18,7 @@
namespace ppapi {
class Resource;
+class Var;
// Holds a PP_ArrayWriter and provides helper functions for writing arrays
// to it. It also handles 0-initialization of the raw C struct and attempts
@@ -89,13 +90,25 @@ class PPAPI_SHARED_EXPORT ArrayWriter {
// Note: potentially this could be a template in case you have a vector of
// FileRef objects, for example. However, this saves code since there's only
// one instantiation and is sufficient for now.
- bool StoreResourceVector(
- const std::vector< scoped_refptr<Resource> >& input);
+ bool StoreResourceVector(const std::vector< scoped_refptr<Resource> >& input);
- // Like the above version but takes an array of AddRed'ed PP_Resources. On
+ // Like the above version but takes an array of AddRef'ed PP_Resources. On
// storage failure, this will release each resource.
bool StoreResourceVector(const std::vector<PP_Resource>& input);
+ // Stores the given vector of vars as PP_Vars to the output vector,
+ // adding one reference to each.
+ //
+ // On failure this returns false, nothing will be copied, and the var
+ // refcounts will be unchanged. In either case, the object will become
+ // is_null() immediately after the call since one output function should only
+ // be issued once.
+ bool StoreVarVector(const std::vector< scoped_refptr<Var> >& input);
+
+ // Like the above version but takes an array of AddRef'ed PP_Vars. On
+ // storage failure, this will release each var.
+ bool StoreVarVector(const std::vector<PP_Var>& input);
+
private:
PP_ArrayOutput pp_array_output_;
« no previous file with comments | « no previous file | ppapi/shared_impl/array_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698