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

Unified Diff: ppapi/cpp/var.h

Issue 148213016: [PPAPI] Moving pp::VarResource_Dev API into pp::Var (now stable). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove HTML note about dev interfaces. Created 6 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
Index: ppapi/cpp/var.h
diff --git a/ppapi/cpp/var.h b/ppapi/cpp/var.h
index 5cb26d9ee83a00d0ff41b0fccf259adf0f38cd0c..6328d49a4fe3afe241d301ee265962b27c228bee 100644
--- a/ppapi/cpp/var.h
+++ b/ppapi/cpp/var.h
@@ -10,6 +10,7 @@
#include "ppapi/c/pp_var.h"
#include "ppapi/cpp/pass_ref.h"
+#include "ppapi/cpp/resource.h"
/// @file
/// This file defines the API for handling the passing of data types between
@@ -50,6 +51,9 @@ class Var {
/// A constructor used to create a UTF-8 character <code>Var</code>.
Var(const std::string& utf8_str); // Must be encoded in UTF-8.
+ /// A constructor used to create a resource <code>Var</code>.
+ explicit Var(const pp::Resource& resource);
yzshen1 2014/02/06 18:02:58 Now that all the others are not 'explicit', maybe
dmichael (off chromium) 2014/02/06 18:33:14 I think I prefer that the developer has to know th
yzshen1 2014/02/06 19:58:18 I slightly prefer to be consistent. But I am fine
Matt Giuca 2014/02/07 03:11:22 I briefly discussed this with sammc@ yesterday. He
dmichael (off chromium) 2014/02/07 17:45:28 I agree in thinking this one is a little different
yzshen1 2014/02/07 17:49:36 Yeah. Your argument makes good sense. I agree we s
+
/// A constructor used when you have received a <code>Var</code> as a return
/// value that has had its reference count incremented for you.
///
@@ -211,6 +215,11 @@ class Var {
/// @return A string version of this <code>Var</code>.
std::string AsString() const;
+ /// Gets the resource contained in the var.
+ ///
+ /// @return The <code>pp::Resource</code> that is contained in the var.
+ pp::Resource AsResource() const;
+
/// This function returns the internal <code>PP_Var</code>
/// managed by this <code>Var</code> object.
///

Powered by Google App Engine
This is Rietveld 408576698