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

Issue 45863006: Parse out XSSI guards in Suggestion JSON response (Closed)

Created:
7 years, 1 month ago by Anuj
Modified:
7 years, 1 month ago
CC:
chromium-reviews, James Su
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Parse out XSSI guards in Suggestion JSON response For personalized suggestions in Suggest response, there is a desire for additional security. In particular, there will be XSSI guards to prevent (well) XSSI. We are taking the approach of assuming that XSSI guards will always be there, and just try to parse it out by looking for the start of valid sugggestion response. Since the suggestion response is supposed to be a JS array, we look for "[" in the response. And we repeat the search, in case the XSSI guard contains "[". BUG=312458 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=231989

Patch Set 1 : Ready for review #

Total comments: 4

Patch Set 2 : Infinite loop fix #

Total comments: 4

Patch Set 3 : Adapted as per Peter's suggestion #

Patch Set 4 : Added relevance in testcase for predicatable matches #

Patch Set 5 : Rebase, reload, wish #

Patch Set 6 : Rebase, reload, retry #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -22 lines) Patch
M chrome/browser/autocomplete/search_provider.cc View 1 2 3 2 chunks +37 lines, -22 lines 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 2 3 3 chunks +93 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Anuj
Ready for Review PTAL.
7 years, 1 month ago (2013-10-28 23:02:34 UTC) #1
Peter Kasting
https://codereview.chromium.org/45863006/diff/30001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/45863006/diff/30001/chrome/browser/autocomplete/search_provider.cc#newcode653 chrome/browser/autocomplete/search_provider.cc:653: while (true) { This can infinite loop. If we ...
7 years, 1 month ago (2013-10-29 18:45:49 UTC) #2
Maria
https://codereview.chromium.org/45863006/diff/30001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/45863006/diff/30001/chrome/browser/autocomplete/search_provider.cc#newcode653 chrome/browser/autocomplete/search_provider.cc:653: while (true) { I don't think it's likely that ...
7 years, 1 month ago (2013-10-29 18:55:45 UTC) #3
Anuj
https://codereview.chromium.org/45863006/diff/30001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/45863006/diff/30001/chrome/browser/autocomplete/search_provider.cc#newcode653 chrome/browser/autocomplete/search_provider.cc:653: while (true) { Please see the test cases - ...
7 years, 1 month ago (2013-10-29 18:58:04 UTC) #4
mariakhomenko
I was under the impression that the XSSI guard used was always: ")]}'\n" On Tue, ...
7 years, 1 month ago (2013-10-29 19:02:54 UTC) #5
Anuj
https://codereview.chromium.org/45863006/diff/30001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/45863006/diff/30001/chrome/browser/autocomplete/search_provider.cc#newcode653 chrome/browser/autocomplete/search_provider.cc:653: while (true) { XSSI guard may not change. But ...
7 years, 1 month ago (2013-10-29 19:03:35 UTC) #6
Peter Kasting
LGTM https://codereview.chromium.org/45863006/diff/80001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/45863006/diff/80001/chrome/browser/autocomplete/search_provider.cc#newcode652 chrome/browser/autocomplete/search_provider.cc:652: int error_code = 0; This doesn't need to ...
7 years, 1 month ago (2013-10-29 19:03:57 UTC) #7
Anuj
Done. CQ now. https://codereview.chromium.org/45863006/diff/80001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/45863006/diff/80001/chrome/browser/autocomplete/search_provider.cc#newcode652 chrome/browser/autocomplete/search_provider.cc:652: int error_code = 0; On 2013/10/29 ...
7 years, 1 month ago (2013-10-29 19:10:34 UTC) #8
Anuj
Same as the reply to your code review comment :)
7 years, 1 month ago (2013-10-29 19:11:20 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/45863006/180001
7 years, 1 month ago (2013-10-29 19:34:06 UTC) #10
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=169238
7 years, 1 month ago (2013-10-30 00:22:06 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/45863006/170002
7 years, 1 month ago (2013-10-30 01:37:59 UTC) #12
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=215418
7 years, 1 month ago (2013-10-30 03:54:19 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/45863006/630001
7 years, 1 month ago (2013-10-30 06:05:14 UTC) #14
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=94882
7 years, 1 month ago (2013-10-30 09:57:06 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/45863006/810001
7 years, 1 month ago (2013-10-30 21:54:24 UTC) #16
commit-bot: I haz the power
7 years, 1 month ago (2013-10-31 04:09:50 UTC) #17
Message was sent while issue was closed.
Change committed as 231989

Powered by Google App Engine
This is Rietveld 408576698