diff options
author | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-18 18:43:03 +0000 |
---|---|---|
committer | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-18 18:43:03 +0000 |
commit | 7131465c53d8705cf2243b6bb464c99a6da56f42 (patch) | |
tree | 13f3e0f1ef59031df1e9cbf7bf6e186233da60d4 /webkit/plugins/ppapi/v8_var_converter.h | |
parent | 2029581c413cad19feb2e4a11ce55c5c6907b252 (diff) | |
download | chromium_src-7131465c53d8705cf2243b6bb464c99a6da56f42.zip chromium_src-7131465c53d8705cf2243b6bb464c99a6da56f42.tar.gz chromium_src-7131465c53d8705cf2243b6bb464c99a6da56f42.tar.bz2 |
Don't send PP_Vars/V8 values with cycles across PostMessage
This prevents PP_Vars/V8 values with cycles being transmitted across PostMessage. An undefined value will be sent instead and an error will be logged to the console.
BUG=236958
Review URL: https://chromiumcodereview.appspot.com/16140011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/v8_var_converter.h')
-rw-r--r-- | webkit/plugins/ppapi/v8_var_converter.h | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/webkit/plugins/ppapi/v8_var_converter.h b/webkit/plugins/ppapi/v8_var_converter.h index c19644c..9dcae4f8 100644 --- a/webkit/plugins/ppapi/v8_var_converter.h +++ b/webkit/plugins/ppapi/v8_var_converter.h @@ -14,27 +14,21 @@ namespace webkit { namespace ppapi { - -// Class to convert between PP_Vars and V8 values. -class WEBKIT_PLUGINS_EXPORT V8VarConverter { - public: - V8VarConverter(); - - // Converts the given PP_Var to a v8::Value. True is returned upon success. - bool ToV8Value(const PP_Var& var, - v8::Handle<v8::Context> context, - v8::Handle<v8::Value>* result) const; - // Converts the given v8::Value to a PP_Var. True is returned upon success. - // Every PP_Var in the reference graph of which |result| is apart will have - // a refcount equal to the number of references to it in the graph. |result| - // will have one additional reference. - bool FromV8Value(v8::Handle<v8::Value> val, - v8::Handle<v8::Context> context, - PP_Var* result) const; - - DISALLOW_COPY_AND_ASSIGN(V8VarConverter); -}; - +namespace V8VarConverter { + +// Converts the given PP_Var to a v8::Value. True is returned upon success. +bool WEBKIT_PLUGINS_EXPORT ToV8Value(const PP_Var& var, + v8::Handle<v8::Context> context, + v8::Handle<v8::Value>* result); +// Converts the given v8::Value to a PP_Var. True is returned upon success. +// Every PP_Var in the reference graph of which |result| is apart will have +// a refcount equal to the number of references to it in the graph. |result| +// will have one additional reference. +bool WEBKIT_PLUGINS_EXPORT FromV8Value(v8::Handle<v8::Value> val, + v8::Handle<v8::Context> context, + PP_Var* result); + +} // namespace V8VarConverter } // namespace ppapi } // namespace webkit |