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

Unified Diff: base/json/json_reader.cc

Issue 1571633002: Pass Manifest JSON paser error line and column number to console. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comments Created 4 years, 11 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 | « base/json/json_reader.h ('k') | content/renderer/manifest/manifest_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_reader.cc
diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc
index 015df4379de82fd135ccf3c0c812de27af4ebde1..3ab5f754b72072ce9964b3c8eeb156cc27f6bae4 100644
--- a/base/json/json_reader.cc
+++ b/base/json/json_reader.cc
@@ -59,7 +59,9 @@ scoped_ptr<Value> JSONReader::Read(const StringPiece& json, int options) {
scoped_ptr<Value> JSONReader::ReadAndReturnError(const StringPiece& json,
int options,
int* error_code_out,
- std::string* error_msg_out) {
+ std::string* error_msg_out,
+ int* error_line_out,
+ int* error_column_out) {
internal::JSONParser parser(options);
scoped_ptr<Value> root(parser.Parse(json));
if (!root) {
@@ -67,6 +69,10 @@ scoped_ptr<Value> JSONReader::ReadAndReturnError(const StringPiece& json,
*error_code_out = parser.error_code();
if (error_msg_out)
*error_msg_out = parser.GetErrorMessage();
+ if (error_line_out)
+ *error_line_out = parser.error_line();
+ if (error_column_out)
+ *error_column_out = parser.error_column();
}
return root;
« no previous file with comments | « base/json/json_reader.h ('k') | content/renderer/manifest/manifest_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698