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

Unified Diff: content/public/renderer/v8_value_converter.h

Issue 19730002: V8ValueConverter for the activity logger that does not invoke interceptors and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ben's comments Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
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..7c43a172bff341d3267221103c0596d5eb6af52f 100644
--- a/content/public/renderer/v8_value_converter.h
+++ b/content/public/renderer/v8_value_converter.h
@@ -24,7 +24,20 @@ namespace content {
// ArrayBufferView subclasses (Uint8Array, etc.).
class CONTENT_EXPORT V8ValueConverter {
public:
- static V8ValueConverter* create();
+ // Extends the default behaviour of V8ValueConverter.
+ class CONTENT_EXPORT Strategy {
+ public:
+ // 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 +65,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

Powered by Google App Engine
This is Rietveld 408576698