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

Unified Diff: src/inspector/InjectedScript.cpp

Issue 2352263003: Revert of [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') | no next file with comments »
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 5b1b2b1b6d34316b8999434bd90183531aefb7d6..ebd26ece673bb1c0dffe526be29082e9b600b650 100644
--- a/src/inspector/InjectedScript.cpp
+++ b/src/inspector/InjectedScript.cpp
@@ -144,10 +144,10 @@
*properties = Array<PropertyDescriptor>::create();
return;
}
- if (hasInternalError(errorString, resultValue.IsEmpty())) return;
+
std::unique_ptr<protocol::Value> protocolValue =
- toProtocolValue(errorString, context, resultValue);
- if (!protocolValue) return;
+ toProtocolValue(context, resultValue);
+ if (hasInternalError(errorString, !protocolValue)) return;
protocol::ErrorSupport errors(errorString);
std::unique_ptr<Array<PropertyDescriptor>> result =
Array<PropertyDescriptor>::parse(protocolValue.get(), &errors);
@@ -178,12 +178,10 @@
.ToLocal(&wrappedObject))
return nullptr;
protocol::ErrorSupport errors;
- std::unique_ptr<protocol::Value> protocolValue =
- toProtocolValue(errorString, context, wrappedObject);
- if (!protocolValue) return nullptr;
std::unique_ptr<protocol::Runtime::RemoteObject> remoteObject =
- protocol::Runtime::RemoteObject::parse(protocolValue.get(), &errors);
- if (!remoteObject) *errorString = errors.errors();
+ protocol::Runtime::RemoteObject::parse(
+ toProtocolValue(context, wrappedObject).get(), &errors);
+ if (!remoteObject) *errorString = "Object has too long reference chain";
return remoteObject;
}
@@ -274,13 +272,10 @@
function.appendArgument(columns);
bool hadException = false;
v8::Local<v8::Value> r = function.call(hadException);
- if (hadException || r.IsEmpty()) return nullptr;
- protocol::ErrorString errorString;
- std::unique_ptr<protocol::Value> protocolValue =
- toProtocolValue(&errorString, context, r);
- if (!protocolValue) return nullptr;
+ if (hadException) return nullptr;
protocol::ErrorSupport errors;
- return protocol::Runtime::RemoteObject::parse(protocolValue.get(), &errors);
+ return protocol::Runtime::RemoteObject::parse(
+ toProtocolValue(context, r).get(), &errors);
}
bool InjectedScript::findObject(ErrorString* errorString,
« no previous file with comments | « no previous file | src/inspector/StringUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698