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

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: Rebase. 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
« no previous file with comments | « ppapi/cpp/resource.h ('k') | ppapi/cpp/var.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/var.h
diff --git a/ppapi/cpp/var.h b/ppapi/cpp/var.h
index c00c90ad7ef8536cc0f25a93272fad438915da11..a79f3c4f3e2e3d34a6f52aa228916e1b38b42688 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);
+
/// A constructor used when you have received a <code>Var</code> as a return
/// value that has had its reference count incremented for you.
///
@@ -209,6 +213,12 @@ class Var {
/// @return A string version of this <code>Var</code>.
std::string AsString() const;
+ /// Gets the resource contained in the var. If this object is not a resource,
+ /// it will assert in debug mode, and return a null resource.
+ ///
+ /// @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.
///
« no previous file with comments | « ppapi/cpp/resource.h ('k') | ppapi/cpp/var.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698