diff options
author | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-10 06:51:48 +0000 |
---|---|---|
committer | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-10 06:51:48 +0000 |
commit | 67600b937c4b6b905998fcc36b6c9bd1891356f6 (patch) | |
tree | 88bf474e00a2816651ca9e96474166d34649e454 /ppapi/proxy/var_serialization_rules.h | |
parent | e6658d22661ce644d6ada160a951a1eee87b6201 (diff) | |
download | chromium_src-67600b937c4b6b905998fcc36b6c9bd1891356f6.zip chromium_src-67600b937c4b6b905998fcc36b6c9bd1891356f6.tar.gz chromium_src-67600b937c4b6b905998fcc36b6c9bd1891356f6.tar.bz2 |
Fix a crash related to PPAPI scripting.
SerializedVar and MessageChannel didn't properly handle the case that the dispatcher goes away while waiting for the reply to a sync message.
BUG=110095
TEST=When click the Test button on ppapi/example/example.html, the plugin is removed but the renderer doesn't crash.
Review URL: http://codereview.chromium.org/9655019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/var_serialization_rules.h')
-rw-r--r-- | ppapi/proxy/var_serialization_rules.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/ppapi/proxy/var_serialization_rules.h b/ppapi/proxy/var_serialization_rules.h index bfedb06..bde9d4f 100644 --- a/ppapi/proxy/var_serialization_rules.h +++ b/ppapi/proxy/var_serialization_rules.h @@ -5,7 +5,7 @@ #ifndef PPAPI_PROXY_VAR_SERIALIZATION_RULES_H_ #define PPAPI_PROXY_VAR_SERIALIZATION_RULES_H_ -#include "base/memory/scoped_ptr.h" +#include "base/memory/ref_counted.h" #include "ppapi/c/pp_var.h" #include <string> @@ -13,12 +13,10 @@ namespace ppapi { 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. -class VarSerializationRules { +class VarSerializationRules : public base::RefCounted<VarSerializationRules> { public: virtual ~VarSerializationRules() {} @@ -45,8 +43,7 @@ class VarSerializationRules { // the object or string that was added to the tracker. (Note, if the recipient // took a reference to the Var, it will remain in the tracker after // EndReceiveCallerOwned). - virtual PP_Var BeginReceiveCallerOwned(const PP_Var& var, - Dispatcher* dispatcher) = 0; + virtual PP_Var BeginReceiveCallerOwned(const PP_Var& var) = 0; virtual void EndReceiveCallerOwned(const PP_Var& var) = 0; // Passing refs ------------------------------------------------------------- @@ -64,8 +61,7 @@ class VarSerializationRules { // SendPassRef in the remote process. The return value is the var valid in // the host process for object vars. Otherwise, the return value is a var // which is valid in the local process. - virtual PP_Var ReceivePassRef(const PP_Var& var, - Dispatcher* dispatcher) = 0; + virtual PP_Var ReceivePassRef(const PP_Var& var) = 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* @@ -75,7 +71,7 @@ class VarSerializationRules { // valid for the host process. Otherwise, it is a var that is valid in the // local process. This same var must be passed to EndSendPassRef. virtual PP_Var BeginSendPassRef(const PP_Var& var) = 0; - virtual void EndSendPassRef(const PP_Var& var, Dispatcher* dispatcher) = 0; + virtual void EndSendPassRef(const PP_Var& var) = 0; // --------------------------------------------------------------------------- |