Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Side by Side Diff: webkit/plugins/ppapi/v8_var_converter.h

Issue 16140011: Don't send PP_Vars/V8 values with cycles across PostMessage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_PLUGINS_PPAPI_V8_VAR_CONVERTER_H 5 #ifndef WEBKIT_PLUGINS_PPAPI_V8_VAR_CONVERTER_H
6 #define WEBKIT_PLUGINS_PPAPI_V8_VAR_CONVERTER_H 6 #define WEBKIT_PLUGINS_PPAPI_V8_VAR_CONVERTER_H
7 7
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "ppapi/c/pp_var.h" 11 #include "ppapi/c/pp_var.h"
12 #include "v8/include/v8.h" 12 #include "v8/include/v8.h"
13 #include "webkit/plugins/webkit_plugins_export.h" 13 #include "webkit/plugins/webkit_plugins_export.h"
14 14
15 namespace webkit { 15 namespace webkit {
16 namespace ppapi { 16 namespace ppapi {
17 17
18 // Class to convert between PP_Vars and V8 values. 18 // Class to convert between PP_Vars and V8 values.
19 class WEBKIT_PLUGINS_EXPORT V8VarConverter { 19 class WEBKIT_PLUGINS_EXPORT V8VarConverter {
20 public: 20 public:
21 V8VarConverter(); 21 V8VarConverter(bool allow_cycles);
dmichael (off chromium) 2013/06/04 16:59:10 Better to just always disallow them, I think. We c
raymes 2013/06/04 19:36:06 Done.
22 22
23 // Converts the given PP_Var to a v8::Value. True is returned upon success. 23 // Converts the given PP_Var to a v8::Value. True is returned upon success.
24 bool ToV8Value(const PP_Var& var, 24 bool ToV8Value(const PP_Var& var,
25 v8::Handle<v8::Context> context, 25 v8::Handle<v8::Context> context,
26 v8::Handle<v8::Value>* result) const; 26 v8::Handle<v8::Value>* result) const;
dmichael (off chromium) 2013/06/04 16:59:10 side issue: Looking at this now, these should prob
raymes 2013/06/04 19:36:06 Done.
27 // Converts the given v8::Value to a PP_Var. True is returned upon success. 27 // Converts the given v8::Value to a PP_Var. True is returned upon success.
28 // Every PP_Var in the reference graph of which |result| is apart will have 28 // Every PP_Var in the reference graph of which |result| is apart will have
29 // a refcount equal to the number of references to it in the graph. |result| 29 // a refcount equal to the number of references to it in the graph. |result|
30 // will have one additional reference. 30 // will have one additional reference.
31 bool FromV8Value(v8::Handle<v8::Value> val, 31 bool FromV8Value(v8::Handle<v8::Value> val,
32 v8::Handle<v8::Context> context, 32 v8::Handle<v8::Context> context,
33 PP_Var* result) const; 33 PP_Var* result) const;
34 34
35 private:
36 bool allow_cycles_;
37
35 DISALLOW_COPY_AND_ASSIGN(V8VarConverter); 38 DISALLOW_COPY_AND_ASSIGN(V8VarConverter);
36 }; 39 };
37 40
38 } // namespace ppapi 41 } // namespace ppapi
39 } // namespace webkit 42 } // namespace webkit
40 43
41 #endif // WEBKIT_PLUGINS_PPAPI_V8_VAR_CONVERTER_H 44 #endif // WEBKIT_PLUGINS_PPAPI_V8_VAR_CONVERTER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698