Chromium Code Reviews| 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, |