Chromium Code Reviews| Index: Source/core/inspector/InjectedScriptBase.cpp |
| diff --git a/Source/core/inspector/InjectedScriptBase.cpp b/Source/core/inspector/InjectedScriptBase.cpp |
| index 4e95872e3e94e5c50834c398ebc33dac98c00a4b..816b14d41623317b43304421e7f6e185e8d68464 100644 |
| --- a/Source/core/inspector/InjectedScriptBase.cpp |
| +++ b/Source/core/inspector/InjectedScriptBase.cpp |
| @@ -34,6 +34,7 @@ |
| #include "core/inspector/InjectedScriptBase.h" |
| #include "bindings/core/v8/ScriptFunctionCall.h" |
| +#include "bindings/core/v8/V8Binding.h" |
| #include "core/inspector/InspectorInstrumentation.h" |
| #include "core/inspector/InspectorTraceEvents.h" |
| #include "platform/JSONValues.h" |
| @@ -44,6 +45,14 @@ using blink::TypeBuilder::Runtime::RemoteObject; |
| namespace blink { |
| +PassRefPtr<JSONValue> toJSONValue(ScriptState* scriptState, const ScriptValue& value) |
|
haraken
2015/03/24 15:23:10
BTW, what's a relationship between scriptState and
|
| +{ |
| + ASSERT(scriptState->contextIsValid()); |
| + ScriptState::Scope scope(scriptState); |
|
vivekg
2015/03/24 05:21:49
When I remove above scope, we get this crash log:
|
| + NonThrowableExceptionState exceptionState; |
| + return ScriptValue::to<JSONValuePtr>(scriptState->isolate(), value, exceptionState); |
| +} |
| + |
| static PassRefPtr<TypeBuilder::Debugger::ExceptionDetails> toExceptionDetails(PassRefPtr<JSONObject> object) |
| { |
| String text; |
| @@ -166,7 +175,7 @@ void InjectedScriptBase::makeCall(ScriptFunctionCall& function, RefPtr<JSONValue |
| ASSERT(!hadException); |
| if (!hadException) { |
| - *result = resultValue.toJSONValue(m_injectedScriptObject.scriptState()); |
| + *result = toJSONValue(m_injectedScriptObject.scriptState(), resultValue); |
| if (!*result) |
| *result = JSONString::create(String::format("Object has too long reference chain(must not be longer than %d)", JSONValue::maxDepth)); |
| } else { |