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

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

Issue 314953005: Add an ASSERT about cross-world wrapper leakage into ScriptValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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: Source/bindings/v8/ScriptValue.h
diff --git a/Source/bindings/v8/ScriptValue.h b/Source/bindings/v8/ScriptValue.h
index 41be6553d9e0ac9800184574158d91e2cbf5a884..41c7684798752f59a80169aa8dfab9e0230f0261 100644
--- a/Source/bindings/v8/ScriptValue.h
+++ b/Source/bindings/v8/ScriptValue.h
@@ -57,6 +57,7 @@ public:
, m_scriptState(scriptState)
, m_value(value.IsEmpty() ? nullptr : SharedPersistent<v8::Value>::create(value, scriptState->isolate()))
{
+ ASSERT(isEmpty() || m_scriptState);
}
ScriptValue(const ScriptValue& value)
@@ -64,6 +65,7 @@ public:
, m_scriptState(value.m_scriptState)
, m_value(value.m_value)
{
+ ASSERT(isEmpty() || m_scriptState);
}
ScriptState* scriptState() const
@@ -144,10 +146,7 @@ public:
m_value = nullptr;
}
- v8::Handle<v8::Value> v8Value() const
- {
- return m_value.get() ? m_value->newLocal(isolate()) : v8::Handle<v8::Value>();
- }
+ v8::Handle<v8::Value> v8Value() const;
bool toString(String&) const;
PassRefPtr<JSONValue> toJSONValue(ScriptState*) const;

Powered by Google App Engine
This is Rietveld 408576698