diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 00:26:43 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 00:26:43 +0000 |
commit | 4614f1974881ecfd0a0118683bac628c6128c2a9 (patch) | |
tree | c69836459560dd8003f7e18ca554f2e1d7f79b4d /ppapi/proxy/var_serialization_rules.h | |
parent | b8e6654fb91108033580f510e2d411093936fc2f (diff) | |
download | chromium_src-4614f1974881ecfd0a0118683bac628c6128c2a9.zip chromium_src-4614f1974881ecfd0a0118683bac628c6128c2a9.tar.gz chromium_src-4614f1974881ecfd0a0118683bac628c6128c2a9.tar.bz2 |
First pass at making the proxy handle multiple renderers. This associates the
instance with resources and has most callers retrieve the dispatcher
according to the appropriate instance. This isn't hooked up to anything yet.
This changes some PPB_Flash interface methods to use PP_Bool.
The most challenging part of the change is in the plugin_var_tracker which
now needs to track which dispatcher each var object came from, and remap var
IDs since each renderer will be generating var IDs in its own space, which
will likely overlap. A similar system will need to be done for resources
which is not implemented yet.
I added some null checks in audio_impl because audio_ can be NULL in some
cases when using the trusted API. I discovered this when testing NaCl for
this patch.
Review URL: http://codereview.chromium.org/6282007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/var_serialization_rules.h')
-rw-r--r-- | ppapi/proxy/var_serialization_rules.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/ppapi/proxy/var_serialization_rules.h b/ppapi/proxy/var_serialization_rules.h index a6741ee..f18b6f0 100644 --- a/ppapi/proxy/var_serialization_rules.h +++ b/ppapi/proxy/var_serialization_rules.h @@ -12,6 +12,8 @@ namespace pp { namespace proxy { +class Dispatcher; + // Encapsulates the rules for serializing and deserializing vars to and from // the local process. The renderer and the plugin process each have separate // bookkeeping rules. @@ -27,8 +29,9 @@ class VarSerializationRules { // Prepares the given var for sending to the callee. If the var is a string, // the value of that string will be placed in *str_val. If the var is not - // a string, str_val will be untouched and may be NULL. - virtual void SendCallerOwned(const PP_Var& var, std::string* str_val) = 0; + // a string, str_val will be untouched and may be NULL. The return value will + // be the var valid for the host process. + virtual PP_Var SendCallerOwned(const PP_Var& var, std::string* str_val) = 0; // When receiving a caller-owned variable, normally we don't have to do // anything. However, in the case of strings, we need to deserialize the @@ -39,13 +42,13 @@ class VarSerializationRules { // BeginReceiveCallerOwned takes a var from IPC and an optional pointer to // the deserialized string (which will be used only when var is a // VARTYPE_STRING and may be NULL otherwise) and returns a new var - // representing the input in the local process. The output will be the same - // as the input except for strings. + // representing the input in the local process. // // EndReceiveCallerOwned destroys the string created by Begin* and does // nothing otherwise. It should be called with the result of Begin*. virtual PP_Var BeginReceiveCallerOwned(const PP_Var& var, - const std::string* str_val) = 0; + const std::string* str_val, + Dispatcher* dispatcher) = 0; virtual void EndReceiveCallerOwned(const PP_Var& var) = 0; // Passinag refs ------------------------------------------------------------- @@ -61,14 +64,18 @@ class VarSerializationRules { // Creates a var in the context of the local process from the given // deserialized var and deserialized string (which will be used only when var // is a VARTYPE_STRING and may be NULL otherwise). The input var/string - // should be the result of calling SendPassRef in the remote process. + // should be the result of calling SendPassRef in the remote process. The + // return value is the var valid in the plugin process. virtual PP_Var ReceivePassRef(const PP_Var& var, - const std::string& str_val) = 0; + const std::string& str_val, + Dispatcher* dispatcher) = 0; // Prepares a var to be sent to the remote side. One local reference will // be passed to the remote side. Call Begin* before doing the send and End* // after doing the send. See SendCallerOwned for a description of the string. - virtual void BeginSendPassRef(const PP_Var& var, std::string* str_val) = 0; + // The return value from BeginSendPassRef will be the var valid for the host + // process. + virtual PP_Var BeginSendPassRef(const PP_Var& var, std::string* str_val) = 0; virtual void EndSendPassRef(const PP_Var& var) = 0; // --------------------------------------------------------------------------- |