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

Unified Diff: ppapi/shared_impl/var.cc

Issue 23346009: [PPAPI] Added a new Var subclass, ResourceVar. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« ppapi/shared_impl/var.h ('K') | « ppapi/shared_impl/var.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/var.cc
diff --git a/ppapi/shared_impl/var.cc b/ppapi/shared_impl/var.cc
index e3ea224de4b746566c7d06a5ff83dad9ba031eae..6b99d980abe232e81b21f9e962905da9f5826ecd 100644
--- a/ppapi/shared_impl/var.cc
+++ b/ppapi/shared_impl/var.cc
@@ -91,6 +91,10 @@ DictionaryVar* Var::AsDictionaryVar() {
return NULL;
}
+ResourceVar* Var::AsResourceVar() {
+ return NULL;
+}
+
PP_Var Var::GetPPVar() {
int32 id = GetOrCreateVarID();
if (!id)
@@ -207,5 +211,46 @@ ArrayBufferVar* ArrayBufferVar::FromPPVar(PP_Var var) {
return var_object->AsArrayBufferVar();
}
+// ResourceVar -----------------------------------------------------------------
+
+ResourceInfo::ResourceInfo()
+ : pending_renderer_id(0),
+ resource_id(0),
+ file_system_type(PP_FILESYSTEMTYPE_INVALID) {
+}
+
+ResourceVar::ResourceVar() {}
+
+ResourceVar::~ResourceVar() {}
+
+void ResourceVar::SetPendingId(int pending_renderer_id) {
+ data_.pending_renderer_id = pending_renderer_id;
+}
+
+void ResourceVar::SetResourceId(int resource_id) {
+ data_.resource_id = resource_id;
+}
+
+void ResourceVar::SetFileSystemType(PP_FileSystemType file_system_type) {
+ data_.file_system_type = file_system_type;
+}
+
+ResourceVar* ResourceVar::AsResourceVar() {
+ return this;
+}
+
+PP_VarType ResourceVar::GetType() const {
+ // TODO(mgiuca): Return PP_VARTYPE_RESOURCE, once that is a valid enum value.
+ NOTREACHED();
+ return PP_VARTYPE_UNDEFINED;
+}
+
+// static
+ResourceVar* ResourceVar::FromPPVar(PP_Var var) {
+ // TODO(mgiuca): Implement this function, once PP_VARTYPE_RESOURCE is
+ // introduced.
+ return NULL;
+}
+
} // namespace ppapi
« ppapi/shared_impl/var.h ('K') | « ppapi/shared_impl/var.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698