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..11514f71789593707b81f3368aacb24950216aef 100644 |
--- a/content/public/renderer/v8_value_converter.h |
+++ b/content/public/renderer/v8_value_converter.h |
@@ -24,6 +24,20 @@ namespace content { |
// ArrayBufferView subclasses (Uint8Array, etc.). |
class CONTENT_EXPORT V8ValueConverter { |
public: |
+ // Extends the default behaviour of V8ValueConverter. |
+ class CONTENT_EXPORT Strategy { |
+ public: |
+ virtual ~Strategy() {} |
+ // If false is returned, V8ValueConverter proceeds with the default |
+ // behavior. |
+ virtual bool FromV8Object(v8::Handle<v8::Object> value, |
+ base::Value** out) const = 0; |
+ // If false is returned, V8ValueConverter proceeds with the default |
+ // behavior. |
+ virtual bool FromV8Array(v8::Handle<v8::Array> value, |
+ base::Value** out) const = 0; |
+ }; |
+ |
static V8ValueConverter* create(); |
virtual ~V8ValueConverter() {} |
@@ -52,6 +66,9 @@ class CONTENT_EXPORT V8ValueConverter { |
// converting arguments to extension APIs. |
virtual void SetStripNullFromObjects(bool val) = 0; |
+ // Extend default behavior of V8ValueConverter. |
+ virtual void SetStrategy(Strategy* strategy) = 0; |
+ |
// Converts a base::Value to a v8::Value. |
// |
// Unsupported types are replaced with null. If an array or object throws |