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

Unified Diff: Source/bindings/v8/ScriptValue.h

Issue 293963003: Remove ScriptObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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: Source/bindings/v8/ScriptValue.h
diff --git a/Source/bindings/v8/ScriptValue.h b/Source/bindings/v8/ScriptValue.h
index 8ffa4caadbbf43c1d71b12bebb3287299daf76b9..7ecf070e13415162838905d8629f02bf5d7a270f 100644
--- a/Source/bindings/v8/ScriptValue.h
+++ b/Source/bindings/v8/ScriptValue.h
@@ -154,12 +154,23 @@ public:
private:
mutable v8::Isolate* m_isolate;
- // FIXME: m_scriptState is not yet used.
- // We will start using it once we remove ScriptValue(v8::Handle<v8::Value> value, v8::Isolate* isolate).
mutable RefPtr<ScriptState> m_scriptState;
RefPtr<SharedPersistent<v8::Value> > m_value;
};
+struct ScriptValueHash {
aandrey 2014/05/21 03:52:03 is this needed?
haraken 2014/05/21 06:45:10 Removed, thanks.
+ static unsigned hash(const ScriptValue& object) { return v8::Handle<v8::Object>::Cast(object.v8Value())->GetIdentityHash(); }
+ static bool equal(const ScriptValue& a, const ScriptValue& b) { return a == b; }
+ static const bool safeToCompareToEmptyOrDeleted = true;
+};
+
+struct ScriptValueHashTraits : WTF::GenericHashTraits<ScriptValue> {
+ static const bool emptyValueIsZero = false;
+ static ScriptValue emptyValue() { return ScriptValue(); }
+ static void constructDeletedValue(ScriptValue& slot) { slot = ScriptValue(); }
+ static bool isDeletedValue(ScriptValue value) { return value.isEmpty(); }
+};
+
} // namespace WebCore
#endif // ScriptValue_h

Powered by Google App Engine
This is Rietveld 408576698