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

Unified Diff: base/json/json_reader.h

Issue 7756022: base/json: Get rid of static initializer in JSONReader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add CreateInvalidToken() Created 9 years, 4 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 | base/json/json_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_reader.h
diff --git a/base/json/json_reader.h b/base/json/json_reader.h
index 39927dee9a1eb9c02bc08802780af06b75d53025..e91da2e5328f2e2a74cee43928cd8bce0bbacc39 100644
--- a/base/json/json_reader.h
+++ b/base/json/json_reader.h
@@ -64,14 +64,19 @@ class BASE_EXPORT JSONReader {
END_OF_INPUT,
INVALID_TOKEN,
};
+
Token(Type t, const wchar_t* b, int len)
- : type(t), begin(b), length(len) {}
+ : type(t), begin(b), length(len) {}
// Get the character that's one past the end of this token.
wchar_t NextChar() {
return *(begin + length);
}
+ static Token CreateInvalidToken() {
+ return Token(INVALID_TOKEN, 0, 0);
+ }
+
Type type;
// A pointer into JSONReader::json_pos_ that's the beginning of this token.
« no previous file with comments | « no previous file | base/json/json_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698