Chromium Code Reviews| Index: ppapi/proxy/serialized_var.cc |
| =================================================================== |
| --- ppapi/proxy/serialized_var.cc (revision 74966) |
| +++ ppapi/proxy/serialized_var.cc (working copy) |
| @@ -273,6 +273,16 @@ |
| return inner_->GetVar(); |
| } |
| +// static |
| +PP_Var ReceiveSerializedVarReturnValue::Convert( |
| + Dispatcher* dispatcher, |
| + const SerializedVar& serialized) { |
| + // Emulate how this is called when receiving a return value. |
| + ReceiveSerializedVarReturnValue ret; |
| + static_cast<SerializedVar&>(ret) = serialized; |
|
piman
2011/02/17 21:25:07
How about adding an explicit constructor for Recei
|
| + return ret.Return(dispatcher); |
| +} |
| + |
| // ReceiveSerializedException -------------------------------------------------- |
| ReceiveSerializedException::ReceiveSerializedException(Dispatcher* dispatcher, |
| @@ -421,6 +431,16 @@ |
| serialized_->inner_->GetStringPtr())); |
| } |
| +// static |
| +SerializedVar SerializedVarReturnValue::Convert(Dispatcher* dispatcher, |
| + const PP_Var& var) { |
| + // Mimic what happens in the normal case. |
| + SerializedVar result; |
| + SerializedVarReturnValue retvalue(&result); |
| + retvalue.Return(dispatcher, var); |
| + return result; |
| +} |
| + |
| // SerializedVarOutParam ------------------------------------------------------- |
| SerializedVarOutParam::SerializedVarOutParam(SerializedVar* serialized) |