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

Unified Diff: src/inspector/InjectedScript.cpp

Issue 2345263003: [inspector] provide more usefull error message for non serializable value (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | src/inspector/StringUtil.h » ('j') | src/inspector/V8DebuggerAgentImpl.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/InjectedScript.cpp
diff --git a/src/inspector/InjectedScript.cpp b/src/inspector/InjectedScript.cpp
index ebd26ece673bb1c0dffe526be29082e9b600b650..d42c6646b9c115fc3249a498532ea54fb3d8962b 100644
--- a/src/inspector/InjectedScript.cpp
+++ b/src/inspector/InjectedScript.cpp
@@ -146,8 +146,8 @@ void InjectedScript::getProperties(
}
std::unique_ptr<protocol::Value> protocolValue =
dgozman 2016/09/19 17:35:05 Looks like resultValue could be empty here?
kozy 2016/09/20 15:34:27 Added check. I think that it should be not empty i
- toProtocolValue(context, resultValue);
- if (hasInternalError(errorString, !protocolValue)) return;
+ toProtocolValue(errorString, context, resultValue);
+ if (!protocolValue) return;
protocol::ErrorSupport errors(errorString);
std::unique_ptr<Array<PropertyDescriptor>> result =
Array<PropertyDescriptor>::parse(protocolValue.get(), &errors);
@@ -180,8 +180,7 @@ std::unique_ptr<protocol::Runtime::RemoteObject> InjectedScript::wrapObject(
protocol::ErrorSupport errors;
std::unique_ptr<protocol::Runtime::RemoteObject> remoteObject =
protocol::Runtime::RemoteObject::parse(
- toProtocolValue(context, wrappedObject).get(), &errors);
- if (!remoteObject) *errorString = "Object has too long reference chain";
+ toProtocolValue(errorString, context, wrappedObject).get(), &errors);
dgozman 2016/09/19 17:35:05 Should check return value of toProtocolValue and u
kozy 2016/09/20 15:34:27 Done.
return remoteObject;
}
@@ -274,8 +273,9 @@ std::unique_ptr<protocol::Runtime::RemoteObject> InjectedScript::wrapTable(
v8::Local<v8::Value> r = function.call(hadException);
dgozman 2016/09/19 17:35:05 Looks like r could be empty here?
kozy 2016/09/20 15:34:27 Done.
if (hadException) return nullptr;
protocol::ErrorSupport errors;
+ protocol::ErrorString errorString;
return protocol::Runtime::RemoteObject::parse(
- toProtocolValue(context, r).get(), &errors);
+ toProtocolValue(&errorString, context, r).get(), &errors);
dgozman 2016/09/19 17:35:05 Should check return value of toProtocolValue and u
kozy 2016/09/20 15:34:27 Done.
}
bool InjectedScript::findObject(ErrorString* errorString,
« no previous file with comments | « no previous file | src/inspector/StringUtil.h » ('j') | src/inspector/V8DebuggerAgentImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698