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

Unified Diff: Source/core/inspector/InjectedScriptBase.cpp

Issue 1021713003: [bindings] Let NativeValueTraits<T>::nativeValue be variadic function and merge various convers… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed the compiler error behind ASSERT flag Created 5 years, 9 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/core/inspector/InjectedScriptBase.cpp
diff --git a/Source/core/inspector/InjectedScriptBase.cpp b/Source/core/inspector/InjectedScriptBase.cpp
index 4e95872e3e94e5c50834c398ebc33dac98c00a4b..abc4f218cfc7066599bc1d86b67ea116254b5ade 100644
--- a/Source/core/inspector/InjectedScriptBase.cpp
+++ b/Source/core/inspector/InjectedScriptBase.cpp
@@ -166,7 +166,10 @@ void InjectedScriptBase::makeCall(ScriptFunctionCall& function, RefPtr<JSONValue
ASSERT(!hadException);
if (!hadException) {
- *result = resultValue.toJSONValue(m_injectedScriptObject.scriptState());
+ ScriptState* scriptState = m_injectedScriptObject.scriptState();
+ ScriptState::Scope scope(scriptState);
+ NonThrowableExceptionState exceptionState;
+ *result = ScriptValue::to<JSONValuePtr>(scriptState->isolate(), resultValue, exceptionState);
if (!*result)
*result = JSONString::create(String::format("Object has too long reference chain(must not be longer than %d)", JSONValue::maxDepth));
} else {

Powered by Google App Engine
This is Rietveld 408576698