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

Unified Diff: trunk/src/content/renderer/v8_value_converter_impl.h

Issue 16733002: Revert 204057 "Recurse to a maximum depth of 10 in v8_value_conv..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/content/renderer/v8_value_converter_impl.h
===================================================================
--- trunk/src/content/renderer/v8_value_converter_impl.h (revision 205183)
+++ trunk/src/content/renderer/v8_value_converter_impl.h (working copy)
@@ -39,9 +39,8 @@
private:
friend class ScopedAvoidIdentityHashForTesting;
+ typedef std::multimap<int, v8::Handle<v8::Object> > HashToHandleMap;
- class FromV8ValueState;
-
v8::Handle<v8::Value> ToV8ValueImpl(const base::Value* value) const;
v8::Handle<v8::Value> ToV8Array(const base::ListValue* list) const;
v8::Handle<v8::Value> ToV8Object(
@@ -49,9 +48,9 @@
v8::Handle<v8::Value> ToArrayBuffer(const base::BinaryValue* value) const;
base::Value* FromV8ValueImpl(v8::Handle<v8::Value> value,
- FromV8ValueState* state) const;
+ HashToHandleMap* unique_map) const;
base::Value* FromV8Array(v8::Handle<v8::Array> array,
- FromV8ValueState* state) const;
+ HashToHandleMap* unique_map) const;
// This will convert objects of type ArrayBuffer or any of the
// ArrayBufferView subclasses. The return value will be NULL if |value| is
@@ -59,8 +58,16 @@
base::BinaryValue* FromV8Buffer(v8::Handle<v8::Value> value) const;
base::Value* FromV8Object(v8::Handle<v8::Object> object,
- FromV8ValueState* state) const;
+ HashToHandleMap* unique_map) const;
+ // If |handle| is not in |map|, then add it to |map| and return true.
+ // Otherwise do nothing and return false. Here "A is unique" means that no
+ // other handle B in the map points to the same object as A. Note that A can
+ // be unique even if there already is another handle with the same identity
+ // hash (key) in the map, because two objects can have the same hash.
+ bool UpdateAndCheckUniqueness(HashToHandleMap* map,
+ v8::Handle<v8::Object> handle) const;
+
// If true, we will convert Date JavaScript objects to doubles.
bool date_allowed_;

Powered by Google App Engine
This is Rietveld 408576698