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

Issue 669573005: Add a class to parse answer json. (Closed)

Created:
6 years, 2 months ago by Justin Donnelly
Modified:
6 years, 1 month ago
CC:
chromium-reviews, James Su
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Add a class to parse answer json. In subsequent changes, this will be used across platforms to replace all answer json parsing. BUG=427107 Committed: https://crrev.com/7393cee9845330bbe5e4712f5e16751256e6cb7c Cr-Commit-Position: refs/heads/master@{#302210}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Respond to comments #

Patch Set 3 : Tweaked API and finished unit tests #

Total comments: 32

Patch Set 4 : Respond to comments #

Patch Set 5 : Respond to comments #

Total comments: 43

Patch Set 6 : Respond to comments #

Patch Set 7 : Sync and respond to comments #

Total comments: 3

Patch Set 8 : Fix broken test and switch to new-style for loop #

Patch Set 9 : Switch back to passing pointers to answers #

Total comments: 8

Patch Set 10 : Respond to comments #

Patch Set 11 : Fixed some unit test issues #

Total comments: 38

Patch Set 12 : Respond to comments, fix a copy bug #

Total comments: 41

Patch Set 13 : Respond to comments #

Total comments: 2

Patch Set 14 : Respond to comment and fix assignment operator issue #

Total comments: 2

Patch Set 15 : Fix case on "copyright" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+741 lines, -134 lines) Patch
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +18 lines, -2 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M components/omnibox.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M components/omnibox/BUILD.gn View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M components/omnibox/autocomplete_match.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
M components/omnibox/autocomplete_match.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -0 lines 0 comments Download
M components/omnibox/base_search_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +9 lines, -8 lines 0 comments Download
M components/omnibox/base_search_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +19 lines, -8 lines 0 comments Download
M components/omnibox/search_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +13 lines, -10 lines 0 comments Download
M components/omnibox/search_suggestion_parser.h View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +12 lines, -11 lines 0 comments Download
M components/omnibox/search_suggestion_parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +59 lines, -44 lines 0 comments Download
M components/omnibox/search_suggestion_parser_unittest.cc View 1 2 3 1 chunk +0 lines, -50 lines 0 comments Download
A components/omnibox/suggestion_answer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +136 lines, -0 lines 0 comments Download
A components/omnibox/suggestion_answer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +187 lines, -0 lines 0 comments Download
A components/omnibox/suggestion_answer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +275 lines, -0 lines 0 comments Download

Messages

Total messages: 54 (8 generated)
Justin Donnelly
I'm not done with the unit tests but I was hoping you could provide feedback ...
6 years, 2 months ago (2014-10-20 23:58:30 UTC) #2
groby-ooo-7-16
You're right - this results in really ugly code. So, given these constraints: * Parsing ...
6 years, 2 months ago (2014-10-21 00:35:54 UTC) #3
Justin Donnelly
https://codereview.chromium.org/669573005/diff/1/components/omnibox/autocomplete_match.cc File components/omnibox/autocomplete_match.cc (right): https://codereview.chromium.org/669573005/diff/1/components/omnibox/autocomplete_match.cc#newcode83 components/omnibox/autocomplete_match.cc:83: answer(match.answer.get() ? new SuggestionAnswer(*match.answer) : NULL), On 2014/10/21 00:35:54, ...
6 years, 2 months ago (2014-10-21 21:43:54 UTC) #4
Justin Donnelly
Finished unit tests and tweaked the API. No rush, but please take another look when ...
6 years, 2 months ago (2014-10-22 23:55:08 UTC) #5
groby-ooo-7-16
https://codereview.chromium.org/669573005/diff/40001/components/omnibox/search_suggestion_parser.cc File components/omnibox/search_suggestion_parser.cc (right): https://codereview.chromium.org/669573005/diff/40001/components/omnibox/search_suggestion_parser.cc#newcode471 components/omnibox/search_suggestion_parser.cc:471: answer.Clear(); Question: What if ParseAnswer() returned void, and error ...
6 years, 2 months ago (2014-10-23 00:46:20 UTC) #6
Justin Donnelly
https://codereview.chromium.org/669573005/diff/40001/components/omnibox/search_suggestion_parser.cc File components/omnibox/search_suggestion_parser.cc (right): https://codereview.chromium.org/669573005/diff/40001/components/omnibox/search_suggestion_parser.cc#newcode471 components/omnibox/search_suggestion_parser.cc:471: answer.Clear(); On 2014/10/23 00:46:19, groby wrote: > Question: What ...
6 years, 2 months ago (2014-10-23 17:59:37 UTC) #7
groby-ooo-7-16
https://codereview.chromium.org/669573005/diff/40001/components/omnibox/search_suggestion_parser.cc File components/omnibox/search_suggestion_parser.cc (right): https://codereview.chromium.org/669573005/diff/40001/components/omnibox/search_suggestion_parser.cc#newcode471 components/omnibox/search_suggestion_parser.cc:471: answer.Clear(); On 2014/10/23 17:59:37, Justin Donnelly wrote: > On ...
6 years, 2 months ago (2014-10-23 21:59:54 UTC) #8
Justin Donnelly
https://codereview.chromium.org/669573005/diff/40001/components/omnibox/search_suggestion_parser.cc File components/omnibox/search_suggestion_parser.cc (right): https://codereview.chromium.org/669573005/diff/40001/components/omnibox/search_suggestion_parser.cc#newcode471 components/omnibox/search_suggestion_parser.cc:471: answer.Clear(); On 2014/10/23 21:59:54, groby wrote: > On 2014/10/23 ...
6 years, 2 months ago (2014-10-24 14:58:08 UTC) #9
Justin Donnelly
Hi Peter - can you take a look at this Answers in Suggest JSON parsing ...
6 years, 2 months ago (2014-10-24 15:28:10 UTC) #12
Peter Kasting
https://codereview.chromium.org/669573005/diff/80001/components/omnibox/autocomplete_match.h File components/omnibox/autocomplete_match.h (right): https://codereview.chromium.org/669573005/diff/80001/components/omnibox/autocomplete_match.h#newcode322 components/omnibox/autocomplete_match.h:322: // clients are using the SuggestionAnswer. Does this just ...
6 years, 2 months ago (2014-10-24 22:38:11 UTC) #13
Justin Donnelly
https://codereview.chromium.org/669573005/diff/80001/components/omnibox/autocomplete_match.h File components/omnibox/autocomplete_match.h (right): https://codereview.chromium.org/669573005/diff/80001/components/omnibox/autocomplete_match.h#newcode322 components/omnibox/autocomplete_match.h:322: // clients are using the SuggestionAnswer. On 2014/10/24 22:38:09, ...
6 years, 1 month ago (2014-10-27 21:41:16 UTC) #14
Peter Kasting
https://codereview.chromium.org/669573005/diff/80001/components/omnibox/suggestion_answer.cc File components/omnibox/suggestion_answer.cc (right): https://codereview.chromium.org/669573005/diff/80001/components/omnibox/suggestion_answer.cc#newcode22 components/omnibox/suggestion_answer.cc:22: static const char* kAnswerJsonImageData = "i.d"; On 2014/10/27 21:41:15, ...
6 years, 1 month ago (2014-10-27 21:50:09 UTC) #15
Justin Donnelly
https://codereview.chromium.org/669573005/diff/80001/components/omnibox/suggestion_answer.cc File components/omnibox/suggestion_answer.cc (right): https://codereview.chromium.org/669573005/diff/80001/components/omnibox/suggestion_answer.cc#newcode22 components/omnibox/suggestion_answer.cc:22: static const char* kAnswerJsonImageData = "i.d"; On 2014/10/27 21:50:09, ...
6 years, 1 month ago (2014-10-28 00:39:34 UTC) #16
groby-ooo-7-16
Tiny nit, otherwise LGTM (Feel free to do the nit later if pkasting also LGs. ...
6 years, 1 month ago (2014-10-28 00:50:02 UTC) #17
Justin Donnelly
> Tiny nit, otherwise LGTM (Feel free to do the nit later if > pkasting ...
6 years, 1 month ago (2014-10-28 15:20:55 UTC) #18
Justin Donnelly
Hi Peter - did you want to take another look at this before I submit?
6 years, 1 month ago (2014-10-28 18:48:45 UTC) #19
Peter Kasting
On 2014/10/28 18:48:45, Justin Donnelly wrote: > Hi Peter - did you want to take ...
6 years, 1 month ago (2014-10-29 04:13:32 UTC) #20
Justin Donnelly
On 2014/10/29 04:13:32, Peter Kasting wrote: > On 2014/10/28 18:48:45, Justin Donnelly wrote: > > ...
6 years, 1 month ago (2014-10-29 16:30:35 UTC) #21
Peter Kasting
https://codereview.chromium.org/669573005/diff/80001/components/omnibox/suggestion_answer.cc File components/omnibox/suggestion_answer.cc (right): https://codereview.chromium.org/669573005/diff/80001/components/omnibox/suggestion_answer.cc#newcode32 components/omnibox/suggestion_answer.cc:32: void SuggestionAnswer::TextField::ParseTextField( On 2014/10/28 00:39:34, Justin Donnelly wrote: > ...
6 years, 1 month ago (2014-10-29 17:56:17 UTC) #22
Justin Donnelly
On 2014/10/29 17:56:17, Peter Kasting wrote: > https://codereview.chromium.org/669573005/diff/80001/components/omnibox/suggestion_answer.cc > File components/omnibox/suggestion_answer.cc (right): > > https://codereview.chromium.org/669573005/diff/80001/components/omnibox/suggestion_answer.cc#newcode32 ...
6 years, 1 month ago (2014-10-29 18:52:42 UTC) #23
groby-ooo-7-16
I do like the idea of an optional answer better than "isValid", because it represents ...
6 years, 1 month ago (2014-10-29 18:55:19 UTC) #24
Peter Kasting
On 2014/10/29 18:55:19, groby wrote: > Sidebar: What we technically want is discussed in N3339[1] ...
6 years, 1 month ago (2014-10-29 18:58:52 UTC) #25
groby-ooo-7-16
To clarify why I'm changing my mind again - the pointer solution looked _really_ ugly. ...
6 years, 1 month ago (2014-10-29 19:00:51 UTC) #26
groby-ooo-7-16
I think value_ptr could be useful in other places, but we probably should have concrete ...
6 years, 1 month ago (2014-10-29 19:05:21 UTC) #27
Peter Kasting
On 2014/10/29 19:05:21, groby wrote: > I think value_ptr could be useful in other places, ...
6 years, 1 month ago (2014-10-29 19:22:03 UTC) #28
Justin Donnelly
Ok, let me know what you guys think of this version.
6 years, 1 month ago (2014-10-29 23:20:06 UTC) #29
groby-ooo-7-16
I like this overall, but it bugs me that we have unnecessary copies when creating ...
6 years, 1 month ago (2014-10-29 23:51:16 UTC) #30
Justin Donnelly
https://codereview.chromium.org/669573005/diff/160001/components/omnibox/search_provider.cc File components/omnibox/search_provider.cc (right): https://codereview.chromium.org/669573005/diff/160001/components/omnibox/search_provider.cc#newcode848 components/omnibox/search_provider.cc:848: answer = SuggestionAnswer::Copy(it->answer.get()); On 2014/10/29 23:51:16, groby wrote: > ...
6 years, 1 month ago (2014-10-30 00:58:23 UTC) #31
Peter Kasting
LGTM although there are a few more substantive comments below, because I don't want to ...
6 years, 1 month ago (2014-10-30 03:43:30 UTC) #33
groby-ooo-7-16
https://codereview.chromium.org/669573005/diff/220001/components/omnibox/search_suggestion_parser.cc File components/omnibox/search_suggestion_parser.cc (right): https://codereview.chromium.org/669573005/diff/220001/components/omnibox/search_suggestion_parser.cc#newcode115 components/omnibox/search_suggestion_parser.cc:115: this->Result::operator=(rhs); On 2014/10/30 03:43:29, Peter Kasting wrote: > I ...
6 years, 1 month ago (2014-10-30 16:21:14 UTC) #34
Justin Donnelly
Rachel, you mind taking another look at this? I've made a ton of changes and ...
6 years, 1 month ago (2014-10-30 19:23:14 UTC) #36
groby-ooo-7-16
https://codereview.chromium.org/669573005/diff/220001/components/omnibox/suggestion_answer.cc File components/omnibox/suggestion_answer.cc (right): https://codereview.chromium.org/669573005/diff/220001/components/omnibox/suggestion_answer.cc#newcode151 components/omnibox/suggestion_answer.cc:151: bool SuggestionAnswer::ParseAnswer( On 2014/10/30 19:23:13, Justin Donnelly wrote: > ...
6 years, 1 month ago (2014-10-30 20:28:30 UTC) #37
Peter Kasting
https://codereview.chromium.org/669573005/diff/250001/components/omnibox/suggestion_answer.cc File components/omnibox/suggestion_answer.cc (right): https://codereview.chromium.org/669573005/diff/250001/components/omnibox/suggestion_answer.cc#newcode119 components/omnibox/suggestion_answer.cc:119: if (text_fields_.size() != line.text_fields_.size()) On 2014/10/30 20:28:29, groby wrote: ...
6 years, 1 month ago (2014-10-30 20:32:56 UTC) #38
groby-ooo-7-16
https://codereview.chromium.org/669573005/diff/250001/components/omnibox/suggestion_answer.cc File components/omnibox/suggestion_answer.cc (right): https://codereview.chromium.org/669573005/diff/250001/components/omnibox/suggestion_answer.cc#newcode119 components/omnibox/suggestion_answer.cc:119: if (text_fields_.size() != line.text_fields_.size()) On 2014/10/30 20:32:56, Peter Kasting ...
6 years, 1 month ago (2014-10-30 20:46:12 UTC) #39
Justin Donnelly
https://codereview.chromium.org/669573005/diff/250001/chrome/browser/autocomplete/search_provider_unittest.cc File chrome/browser/autocomplete/search_provider_unittest.cc (right): https://codereview.chromium.org/669573005/diff/250001/chrome/browser/autocomplete/search_provider_unittest.cc#newcode3441 chrome/browser/autocomplete/search_provider_unittest.cc:3441: match1.answer = answer1.Pass(); On 2014/10/30 20:28:29, groby wrote: > ...
6 years, 1 month ago (2014-10-30 21:38:04 UTC) #40
Peter Kasting
https://codereview.chromium.org/669573005/diff/250001/components/omnibox/autocomplete_match.cc File components/omnibox/autocomplete_match.cc (right): https://codereview.chromium.org/669573005/diff/250001/components/omnibox/autocomplete_match.cc#newcode83 components/omnibox/autocomplete_match.cc:83: answer(SuggestionAnswer::copy(match.answer.get())), On 2014/10/30 21:38:03, Justin Donnelly wrote: > On ...
6 years, 1 month ago (2014-10-30 22:09:37 UTC) #41
groby-ooo-7-16
push_back requires operator=... Seems you need to implement it after all. https://codereview.chromium.org/669573005/diff/250001/components/omnibox/autocomplete_match.cc File components/omnibox/autocomplete_match.cc (right): ...
6 years, 1 month ago (2014-10-30 22:13:58 UTC) #42
Justin Donnelly
Un-disallowed assignment operator for TextField, with comment explaining, continuing to disallow for the other two ...
6 years, 1 month ago (2014-10-30 23:52:34 UTC) #43
groby-ooo-7-16
lgtm
6 years, 1 month ago (2014-10-31 00:04:36 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/669573005/290001
6 years, 1 month ago (2014-10-31 00:06:09 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/21404)
6 years, 1 month ago (2014-10-31 00:11:31 UTC) #48
groby-ooo-7-16
https://codereview.chromium.org/669573005/diff/290001/components/omnibox/suggestion_answer_unittest.cc File components/omnibox/suggestion_answer_unittest.cc (right): https://codereview.chromium.org/669573005/diff/290001/components/omnibox/suggestion_answer_unittest.cc#newcode1 components/omnibox/suggestion_answer_unittest.cc:1: // copyright 2014 The Chromium Authors. All rights reserved. ...
6 years, 1 month ago (2014-10-31 00:20:14 UTC) #49
Justin Donnelly
https://codereview.chromium.org/669573005/diff/290001/components/omnibox/suggestion_answer_unittest.cc File components/omnibox/suggestion_answer_unittest.cc (right): https://codereview.chromium.org/669573005/diff/290001/components/omnibox/suggestion_answer_unittest.cc#newcode1 components/omnibox/suggestion_answer_unittest.cc:1: // copyright 2014 The Chromium Authors. All rights reserved. ...
6 years, 1 month ago (2014-10-31 00:46:47 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/669573005/310001
6 years, 1 month ago (2014-10-31 00:48:35 UTC) #52
commit-bot: I haz the power
Committed patchset #15 (id:310001)
6 years, 1 month ago (2014-10-31 01:53:06 UTC) #53
commit-bot: I haz the power
6 years, 1 month ago (2014-10-31 01:53:37 UTC) #54
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/7393cee9845330bbe5e4712f5e16751256e6cb7c
Cr-Commit-Position: refs/heads/master@{#302210}

Powered by Google App Engine
This is Rietveld 408576698