| 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_;
|
|
|
|
|