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

Unified Diff: content/renderer/manifest/manifest_parser.h

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 | « content/renderer/manifest/manifest_manager.cc ('k') | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/manifest/manifest_parser.h
diff --git a/content/renderer/manifest/manifest_parser.h b/content/renderer/manifest/manifest_parser.h
index 666f86d6748fc4f50d18c0f15900783513975eae..5f683a0e6348392cecfac660073553f1a6bc2dbd 100644
--- a/content/renderer/manifest/manifest_parser.h
+++ b/content/renderer/manifest/manifest_parser.h
@@ -26,6 +26,16 @@ namespace content {
// http://w3c.github.io/manifest/#dfn-steps-for-processing-a-manifest
class CONTENT_EXPORT ManifestParser {
public:
+ class ErrorInfo {
+ public:
+ ErrorInfo(const std::string& error_msg, int error_line, int error_column)
+ : error_msg(error_msg),
+ error_line(error_line),
+ error_column(error_column) {}
+ const std::string error_msg;
+ const int error_line;
+ const int error_column;
+ };
ManifestParser(const base::StringPiece& data,
const GURL& manifest_url,
const GURL& document_url);
@@ -36,7 +46,7 @@ class CONTENT_EXPORT ManifestParser {
void Parse();
const Manifest& manifest() const;
- const std::vector<std::string>& errors() const;
+ const std::vector<scoped_ptr<ErrorInfo>>& errors() const;
bool failed() const;
private:
@@ -183,13 +193,17 @@ class CONTENT_EXPORT ManifestParser {
base::NullableString16 ParseGCMSenderID(
const base::DictionaryValue& dictionary);
+ void AddErrorInfo(const std::string& error_msg,
+ int error_line = 0,
+ int error_column = 0);
+
const base::StringPiece& data_;
GURL manifest_url_;
GURL document_url_;
bool failed_;
Manifest manifest_;
- std::vector<std::string> errors_;
+ std::vector<scoped_ptr<ErrorInfo>> errors_;
DISALLOW_COPY_AND_ASSIGN(ManifestParser);
};
« no previous file with comments | « content/renderer/manifest/manifest_manager.cc ('k') | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698