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

Unified Diff: ppapi/proxy/raw_var_data.cc

Issue 26564009: [PPAPI] It is now possible to pass filesystems from JavaScript to NaCl modules. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Cleanup after refactor. Created 7 years, 2 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/proxy/raw_var_data.cc
diff --git a/ppapi/proxy/raw_var_data.cc b/ppapi/proxy/raw_var_data.cc
index 91bcfbfd1f0b0448126f2da92cc6081076cd1f14..9257ccf50cddd7cd822feda155980b916dff1465 100644
--- a/ppapi/proxy/raw_var_data.cc
+++ b/ppapi/proxy/raw_var_data.cc
@@ -695,14 +695,17 @@ bool ResourceRawVarData::Init(const PP_Var& var, PP_Instance /*instance*/) {
}
PP_Var ResourceRawVarData::CreatePPVar(PP_Instance instance) {
- // If pp_resource_ is NULL, it could be because we are on the plugin side and
- // there is a pending resource host on the renderer.
- // TODO(mgiuca): Create a plugin-side resource in this case.
- // Currently, this should never occur. This will be needed when passing a
- // resource from the renderer to the plugin (http://crbug.com/177017).
- DCHECK(pp_resource_);
-
- return PpapiGlobals::Get()->GetVarTracker()->MakeResourcePPVar(pp_resource_);
+ // If this is not a pending resource host, just create the var.
+ if (pp_resource_ || !creation_message_)
raymes 2013/10/30 06:31:51 nit: {} for multi-line if
Matt Giuca 2013/10/30 07:00:39 Done.
+ return PpapiGlobals::Get()->GetVarTracker()->MakeResourcePPVar(
+ pp_resource_);
+
+ // This is a pending resource host, so create the resource and var.
+ return PpapiGlobals::Get()->GetVarTracker()->MakeResourcePPVar(
+ *creation_message_,
+ pending_renderer_host_id_,
+ pending_browser_host_id_,
+ instance);
}
void ResourceRawVarData::PopulatePPVar(const PP_Var& var,

Powered by Google App Engine
This is Rietveld 408576698