Chromium Code Reviews| Index: content/public/renderer/v8_value_converter.h |
| diff --git a/content/public/renderer/v8_value_converter.h b/content/public/renderer/v8_value_converter.h |
| index b71b32dae3ab6563f5040485fcd9bc8b8d340364..2c3cf32af1fa485b5bb84e86847d3d74b7cd625d 100644 |
| --- a/content/public/renderer/v8_value_converter.h |
| +++ b/content/public/renderer/v8_value_converter.h |
| @@ -14,6 +14,17 @@ class Value; |
| namespace content { |
| +// Extends the default behaviour of V8ValueConverter. |
| +class CONTENT_EXPORT V8ValueConverterStrategy { |
| + public: |
| + // If false is returned, V8ValueConverter proceeds with the default behavior. |
| + virtual bool ToV8Value(const base::Value* value, |
| + v8::Handle<v8::Value>* out) const = 0; |
| + // If false is returned, V8ValueConverter proceeds with the default behavior. |
| + virtual bool FromV8Value(v8::Handle<v8::Value> value, |
| + base::Value** out) const = 0; |
|
not at google - send to devlin
2013/07/22 21:44:57
make this a member class of Strategy of V8ValueCon
pmarch
2013/07/22 23:06:55
Done.
|
| +}; |
| + |
| // Converts between v8::Value (JavaScript values in the v8 heap) and Chrome's |
| // values (from base/values.h). Lists and dictionaries are converted |
| // recursively. |
| @@ -52,6 +63,9 @@ class CONTENT_EXPORT V8ValueConverter { |
| // converting arguments to extension APIs. |
| virtual void SetStripNullFromObjects(bool val) = 0; |
| + // Extend default behavior of V8ValueConverter. |
| + virtual void SetStrategy(V8ValueConverterStrategy* strategy) = 0; |
| + |
| // Converts a base::Value to a v8::Value. |
| // |
| // Unsupported types are replaced with null. If an array or object throws |