Chromium Code Reviews| Index: Source/bindings/core/v8/ScriptValue.h |
| diff --git a/Source/bindings/core/v8/ScriptValue.h b/Source/bindings/core/v8/ScriptValue.h |
| index 7ad2aecaed7c51507d12e55ea33d1dd2cecd2704..d234a9783aa9402e8eb8ed1805f85691b89b1571 100644 |
| --- a/Source/bindings/core/v8/ScriptValue.h |
| +++ b/Source/bindings/core/v8/ScriptValue.h |
| @@ -67,6 +67,14 @@ public: |
| ASSERT(isEmpty() || m_scriptState); |
|
haraken
2015/03/25 05:08:29
I'm just wondering but is it valid that m_scriptSt
bashi
2015/03/25 07:25:32
You mean we should just ASSERT(m_scriptState)? I t
bashi
2015/03/25 07:35:01
It seems that some tests fail when dropping isEmpt
haraken
2015/03/25 09:04:23
Thanks for the investigation. Yeah, if the value i
|
| } |
| + template <typename T> |
| + ScriptValue(ScriptState* scriptState, v8::MaybeLocal<T> value) |
| + : m_scriptState(scriptState) |
| + , m_value(value.IsEmpty() ? nullptr : SharedPersistent<v8::Value>::create(value.ToLocalChecked(), scriptState->isolate())) |
| + { |
| + ASSERT(isEmpty() || m_scriptState); |
|
haraken
2015/03/25 05:08:29
Ditto.
|
| + } |
| + |
| ScriptValue(const ScriptValue& value) |
| : m_scriptState(value.m_scriptState) |
| , m_value(value.m_value) |
| @@ -84,6 +92,12 @@ public: |
| return m_scriptState ? m_scriptState->isolate() : v8::Isolate::GetCurrent(); |
| } |
| + v8::Local<v8::Context> context() const |
| + { |
| + ASSERT(m_scriptState.get()); |
| + return m_scriptState->context(); |
| + } |
| + |
| ScriptValue& operator=(const ScriptValue& value) |
| { |
| if (this != &value) { |