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

Issue 2505643002: Concurrent Snippet Fetches. (Closed)

Created:
4 years, 1 month ago by fhorschig
Modified:
4 years ago
Reviewers:
Marc Treib, tschumann
CC:
chromium-reviews, ntp-dev+reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Concurrent Snippet Fetches. Multiple concurrent fetch processes ensure that the UI will always get a correct response for a |Fetch| request. In order to bind fetcher and callback to the request, a new |Request| class provides another layer of abstraction. (No tests were deleted. The test "ShouldCancelOngoingFetch" is not part of the use case anymore and was replaced with "ShouldProcessConcurrentFetches") BUG=659931 Committed: https://crrev.com/7530d98e8559cf6f598b57a073d19cf7470ba752 Cr-Commit-Position: refs/heads/master@{#436280}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Removing the remote_suggestions_provider from CL. #

Patch Set 3 : Moved Request into NTPSnippetsFetcher. #

Patch Set 4 : Reordered. #

Total comments: 18

Patch Set 5 : Request/Builder are private class of Fetcher. Request doesn't handle all callbacks. #

Total comments: 78

Patch Set 6 : Rebased. Reworked parts of the JSON handling. #

Total comments: 42

Patch Set 7 : Rebased. Reordered definitions to match declarations. #

Total comments: 19

Patch Set 8 : Renaming the Handler to JSONParser. #

Total comments: 22

Patch Set 9 : Tested and Fixed AuthHeader. #

Patch Set 10 : Stored last fetch directly into member. #

Patch Set 11 : Used base::Passed for callback parameters. #

Total comments: 8

Patch Set 12 : Request is parsing JSON now. #

Total comments: 8

Patch Set 13 : Removed alias for Callback-Builder-Pair. Fixed leaking test. #

Total comments: 28

Patch Set 14 : Unpaired Builder and Callback where it wasn't needed. #

Total comments: 6

Patch Set 15 : Addressing nits. #

Total comments: 12

Patch Set 16 : Hiding the request's URLFetcher. #

Total comments: 8

Patch Set 17 : Explanatory comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+750 lines, -392 lines) Patch
M components/ntp_snippets/remote/ntp_snippets_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 9 chunks +111 lines, -53 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 26 chunks +459 lines, -246 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_fetcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 chunks +180 lines, -93 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 60 (26 generated)
tschumann
a few overall comments https://codereview.chromium.org/2505643002/diff/20001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/20001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode399 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:399: parse_json_callback_.Run(last_fetch_json_, success_callback, why does the ...
4 years, 1 month ago (2016-11-15 19:43:50 UTC) #4
fhorschig
(Complete review not necessary yet.) Hi Tim, thanks for the feedback, I have addressed your ...
4 years, 1 month ago (2016-11-16 18:31:17 UTC) #6
tschumann
the overall design is still not 100% there. left a few comments. When they are ...
4 years, 1 month ago (2016-11-17 01:07:32 UTC) #7
fhorschig
The responsibilities should now be where they belong. @treib: Could you please take a look? ...
4 years, 1 month ago (2016-11-21 16:33:48 UTC) #9
Marc Treib
https://codereview.chromium.org/2505643002/diff/140001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/140001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode257 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:257: // categories. If only fetches for a single category ...
4 years, 1 month ago (2016-11-22 10:02:02 UTC) #11
fhorschig
Thanks for your comments! You found some serious bugs. https://codereview.chromium.org/2505643002/diff/140001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/140001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode257 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:257: ...
4 years, 1 month ago (2016-11-22 16:04:49 UTC) #13
Marc Treib
A bunch more comments, but much smaller ones :) https://codereview.chromium.org/2505643002/diff/140001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/140001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode1122 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:1122: ...
4 years, 1 month ago (2016-11-22 17:46:44 UTC) #14
fhorschig
All annotations addressed. https://codereview.chromium.org/2505643002/diff/180001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/180001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode283 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:283: DCHECK(!callback.is_null()); On 2016/11/22 17:46:43, Marc Treib ...
4 years ago (2016-11-23 10:33:06 UTC) #16
Marc Treib
https://codereview.chromium.org/2505643002/diff/220001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/220001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode346 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:346: ParseJSONCallback callback); const& https://codereview.chromium.org/2505643002/diff/220001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode367 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:367: // This callback is ...
4 years ago (2016-11-23 11:03:45 UTC) #17
fhorschig
https://codereview.chromium.org/2505643002/diff/220001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/220001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode346 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:346: ParseJSONCallback callback); On 2016/11/23 11:03:44, Marc Treib wrote: > ...
4 years ago (2016-11-23 12:31:55 UTC) #18
Marc Treib
LGTM with some last nits, and two actual fixes. We *really* need tests for authenticated ...
4 years ago (2016-11-23 12:42:26 UTC) #19
Marc Treib
And BTW, thanks for putting up with all my nagging! This is a super important ...
4 years ago (2016-11-23 12:44:02 UTC) #20
fhorschig
Tests are included for the bugs you found. Thank you for your thorough reviews! https://codereview.chromium.org/2505643002/diff/240001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc ...
4 years ago (2016-11-23 13:30:23 UTC) #21
Marc Treib
https://codereview.chromium.org/2505643002/diff/240001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/240001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode1082 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:1082: request->url_fetcher()->GetResponseAsString(&json_string); On 2016/11/23 13:30:23, fhorschig wrote: > On 2016/11/23 ...
4 years ago (2016-11-23 13:35:10 UTC) #22
fhorschig
https://codereview.chromium.org/2505643002/diff/240001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/240001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode1082 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:1082: request->url_fetcher()->GetResponseAsString(&json_string); On 2016/11/23 13:35:10, Marc Treib wrote: > On ...
4 years ago (2016-11-23 13:39:50 UTC) #23
fhorschig
4 years ago (2016-11-23 13:39:51 UTC) #24
tschumann
https://codereview.chromium.org/2505643002/diff/240001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/240001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode294 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:294: SnippetsAvailableCallback ExtractSnippetsAvailableCallback() { this function seems pretty dangerous. After ...
4 years ago (2016-11-24 09:32:56 UTC) #29
fhorschig
A rough design for the next iteration... https://codereview.chromium.org/2505643002/diff/240001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/240001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode294 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:294: SnippetsAvailableCallback ExtractSnippetsAvailableCallback() ...
4 years ago (2016-11-24 17:10:44 UTC) #30
tschumann
the overall design looks pretty nice now! thanks for all the iterations. I'll have another ...
4 years ago (2016-11-24 17:57:27 UTC) #31
fhorschig
I am not exactly sure about renaming the JsonRequest (see comment). Also still looking for ...
4 years ago (2016-11-25 09:39:20 UTC) #32
fhorschig
The leaking test is fixed and all comments are adressed. I'd like to hear your ...
4 years ago (2016-12-02 10:31:07 UTC) #38
Marc Treib
On 2016/12/02 10:31:07, fhorschig wrote: > The leaking test is fixed and all comments are ...
4 years ago (2016-12-02 10:47:14 UTC) #41
Marc Treib
https://codereview.chromium.org/2505643002/diff/430001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/430001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode435 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:435: OptionalFetchedCategories(), std::move(builder_and_callback.second), IMO this is a good signal that ...
4 years ago (2016-12-02 11:21:52 UTC) #44
fhorschig
Thanks for the comments. Just FMI: Is there a way to un-LGTM? (I would really ...
4 years ago (2016-12-02 12:54:27 UTC) #45
Marc Treib
You can't directly remove an l-g-t-m, but you can say not lgtm! (just for demonstration ...
4 years ago (2016-12-02 13:40:16 UTC) #46
Marc Treib
That being said: lgtm :)
4 years ago (2016-12-02 13:40:58 UTC) #47
fhorschig
Nice demonstration. The red comment is pretty eye-catching... https://codereview.chromium.org/2505643002/diff/450001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/450001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode462 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:462: pending_requests_.push({std::move(builder), ...
4 years ago (2016-12-02 16:28:01 UTC) #48
tschumann
lgtm few more nits on the design. Feel free to submit once addressed. https://codereview.chromium.org/2505643002/diff/470001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File ...
4 years ago (2016-12-05 10:53:07 UTC) #49
fhorschig
This is the moment I have been waiting for so long! https://codereview.chromium.org/2505643002/diff/470001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): ...
4 years ago (2016-12-05 12:46:28 UTC) #50
tschumann
lgtm https://codereview.chromium.org/2505643002/diff/470001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/470001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode277 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:277: void Start(CompletedCallback callback); On 2016/12/05 12:46:28, fhorschig wrote: ...
4 years ago (2016-12-05 12:54:35 UTC) #51
fhorschig
https://codereview.chromium.org/2505643002/diff/470001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc File components/ntp_snippets/remote/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2505643002/diff/470001/components/ntp_snippets/remote/ntp_snippets_fetcher.cc#newcode277 components/ntp_snippets/remote/ntp_snippets_fetcher.cc:277: void Start(CompletedCallback callback); On 2016/12/05 12:54:35, tschumann wrote: > ...
4 years ago (2016-12-05 13:13:25 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2505643002/510001
4 years ago (2016-12-05 13:13:54 UTC) #55
commit-bot: I haz the power
Committed patchset #17 (id:510001)
4 years ago (2016-12-05 13:54:14 UTC) #58
commit-bot: I haz the power
4 years ago (2016-12-05 13:56:21 UTC) #60
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/7530d98e8559cf6f598b57a073d19cf7470ba752
Cr-Commit-Position: refs/heads/master@{#436280}

Powered by Google App Engine
This is Rietveld 408576698