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

Issue 13169: Add error messages to JSONReader and friends. This required a bit of refactor... (Closed)

Created:
12 years ago by Aaron Boodman
Modified:
9 years, 6 months ago
Reviewers:
tony
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add error messages to JSONReader and friends. This required a bit of refactoring to do cleanly. This CL doesn't actually use this capability anywhere except for unit tests. I will add that in a future CL. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=6459

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 8

Patch Set 3 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+312 lines, -110 lines) Patch
M base/json_reader.h View 1 2 4 chunks +47 lines, -10 lines 1 comment Download
M base/json_reader.cc View 1 2 7 chunks +103 lines, -23 lines 0 comments Download
M base/json_reader_unittest.cc View 1 2 18 chunks +117 lines, -44 lines 0 comments Download
M base/values.h View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/bookmarks/bookmark_storage.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extensions_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/page_state.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/json_value_serializer.h View 2 chunks +8 lines, -4 lines 0 comments Download
M chrome/common/json_value_serializer.cc View 1 2 2 chunks +8 lines, -4 lines 0 comments Download
M chrome/common/json_value_serializer_perftest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/json_value_serializer_unittest.cc View 1 2 8 chunks +9 lines, -9 lines 0 comments Download
M chrome/common/pref_service.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/pref_service_unittest.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/installer/util/master_preferences.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/automation/tab_proxy.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/ui/ui_test.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Aaron Boodman
12 years ago (2008-12-05 10:18:41 UTC) #1
tony
http://codereview.chromium.org/13169/diff/201/202 File base/json_reader.cc (right): http://codereview.chromium.org/13169/diff/201/202#newcode154 Line 154: if (error_message_.size() == 0) Nit: empty() http://codereview.chromium.org/13169/diff/201/203 File ...
12 years ago (2008-12-05 18:17:24 UTC) #2
Aaron Boodman
Ready for another look. http://codereview.chromium.org/13169/diff/201/202 File base/json_reader.cc (right): http://codereview.chromium.org/13169/diff/201/202#newcode154 Line 154: if (error_message_.size() == 0) ...
12 years ago (2008-12-05 20:23:27 UTC) #3
tony
12 years ago (2008-12-05 20:37:57 UTC) #4
I think you could add a GetErrorMessage method to JSONSerializer so you don't
have to change the callers.  Either way is fine with me.

LGTM.

http://codereview.chromium.org/13169/diff/41/405
File base/json_reader.h (right):

http://codereview.chromium.org/13169/diff/41/405#newcode117
Line 117: std::string* error_message() { return &error_message_; }
Nit: Can we just return a string here?  I think the extra copy is ok and then
the string won't deref unexpectedly when JSONReader goes out of scope.

Powered by Google App Engine
This is Rietveld 408576698