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

Issue 2440723002: predictors: Make ResourcePrefetchPredictor observable. (Closed)

Created:
4 years, 2 months ago by alexilin
Modified:
4 years, 1 month ago
Reviewers:
pasko, Benoit L
CC:
chromium-reviews, shishir+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

predictors: Make ResourcePrefetchPredictor observable. This observer is needed for browser tests. + a small refactoring of ResourcePrefetchPredictor nested classes and function parameters. BUG=631966 Committed: https://crrev.com/fdf3eb2acfa3444030d3988b664d00325a3e109d Cr-Commit-Position: refs/heads/master@{#427707}

Patch Set 1 #

Patch Set 2 : Fix a mess with access modifiers. #

Total comments: 17

Patch Set 3 : ObserverList -> Observer* #

Patch Set 4 : Make observer private #

Patch Set 5 : . #

Total comments: 16

Patch Set 6 : Small fixes. #

Total comments: 10

Patch Set 7 : Work around observer and predictor lifetime. #

Patch Set 8 : Tests for observer. #

Total comments: 31

Patch Set 9 : They are not friends anymore. #

Patch Set 10 : Make things simpler. #

Patch Set 11 : Rename TestObserver to TestDelegate #

Total comments: 7

Patch Set 12 : Revert renaming. #

Patch Set 13 : Move TestObserver outside ResourcePrefetchPredictor class. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+361 lines, -183 lines) Patch
M chrome/browser/predictors/resource_prefetch_predictor.h View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +52 lines, -53 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 15 chunks +118 lines, -76 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor_test_util.h View 1 2 3 4 5 6 7 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor_test_util.cc View 1 2 3 4 5 6 7 3 chunks +42 lines, -0 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 14 chunks +137 lines, -54 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 39 (11 generated)
alexilin
Hello! This is a first step to implement browser tests for resource prefetch predictor. In ...
4 years, 2 months ago (2016-10-20 16:45:22 UTC) #3
alexilin
On 2016/10/20 16:45:22, alexilin wrote: > Hello! > > This is a first step to ...
4 years, 2 months ago (2016-10-20 16:46:51 UTC) #5
pasko
if we need many observers, this would look reasonable (see question below, I was not ...
4 years, 2 months ago (2016-10-21 12:12:53 UTC) #6
alexilin
Pasko PTAL. Observer could be private because browser test class will be a friend of ...
4 years, 2 months ago (2016-10-21 13:38:04 UTC) #7
pasko
looks better, how about tests? https://codereview.chromium.org/2440723002/diff/20001/chrome/browser/predictors/resource_prefetch_predictor.h File chrome/browser/predictors/resource_prefetch_predictor.h (right): https://codereview.chromium.org/2440723002/diff/20001/chrome/browser/predictors/resource_prefetch_predictor.h#newcode105 chrome/browser/predictors/resource_prefetch_predictor.h:105: struct PageRequestSummary { On ...
4 years, 2 months ago (2016-10-21 14:41:36 UTC) #8
alexilin
https://codereview.chromium.org/2440723002/diff/20001/chrome/browser/predictors/resource_prefetch_predictor.h File chrome/browser/predictors/resource_prefetch_predictor.h (right): https://codereview.chromium.org/2440723002/diff/20001/chrome/browser/predictors/resource_prefetch_predictor.h#newcode105 chrome/browser/predictors/resource_prefetch_predictor.h:105: struct PageRequestSummary { On 2016/10/21 14:41:35, pasko wrote: > ...
4 years, 2 months ago (2016-10-21 16:04:19 UTC) #9
pasko
overall looks good, modulo tests https://codereview.chromium.org/2440723002/diff/20001/chrome/browser/predictors/resource_prefetch_predictor.h File chrome/browser/predictors/resource_prefetch_predictor.h (right): https://codereview.chromium.org/2440723002/diff/20001/chrome/browser/predictors/resource_prefetch_predictor.h#newcode105 chrome/browser/predictors/resource_prefetch_predictor.h:105: struct PageRequestSummary { On ...
4 years, 2 months ago (2016-10-21 16:47:34 UTC) #10
Benoit L
https://codereview.chromium.org/2440723002/diff/100001/chrome/browser/predictors/resource_prefetch_predictor.h File chrome/browser/predictors/resource_prefetch_predictor.h (right): https://codereview.chromium.org/2440723002/diff/100001/chrome/browser/predictors/resource_prefetch_predictor.h#newcode103 chrome/browser/predictors/resource_prefetch_predictor.h:103: // Stores the data is learned from single navigation. ...
4 years, 2 months ago (2016-10-21 17:16:24 UTC) #11
pasko
https://codereview.chromium.org/2440723002/diff/100001/chrome/browser/predictors/resource_prefetch_predictor.h File chrome/browser/predictors/resource_prefetch_predictor.h (right): https://codereview.chromium.org/2440723002/diff/100001/chrome/browser/predictors/resource_prefetch_predictor.h#newcode346 chrome/browser/predictors/resource_prefetch_predictor.h:346: void SetObserverForTesting(TestObserver* observer); On 2016/10/21 17:16:24, Benoit L wrote: ...
4 years, 2 months ago (2016-10-21 17:38:22 UTC) #12
alexilin
This is the last for today. Tests to be continued... https://codereview.chromium.org/2440723002/diff/100001/chrome/browser/predictors/resource_prefetch_predictor.h File chrome/browser/predictors/resource_prefetch_predictor.h (right): https://codereview.chromium.org/2440723002/diff/100001/chrome/browser/predictors/resource_prefetch_predictor.h#newcode103 ...
4 years, 2 months ago (2016-10-21 18:37:15 UTC) #13
Benoit L
https://codereview.chromium.org/2440723002/diff/100001/chrome/browser/predictors/resource_prefetch_predictor.h File chrome/browser/predictors/resource_prefetch_predictor.h (right): https://codereview.chromium.org/2440723002/diff/100001/chrome/browser/predictors/resource_prefetch_predictor.h#newcode346 chrome/browser/predictors/resource_prefetch_predictor.h:346: void SetObserverForTesting(TestObserver* observer); On 2016/10/21 18:37:15, alexilin wrote: > ...
4 years, 2 months ago (2016-10-24 02:13:56 UTC) #14
alexilin
I've finished with tests for this CL. Note last test in resource_prefetch_predictor_unittest.cc. It illustrates how ...
4 years, 1 month ago (2016-10-24 16:03:50 UTC) #15
Benoit L
lgtm, thanks.
4 years, 1 month ago (2016-10-24 17:30:55 UTC) #16
pasko
thank you for the tests, now I finally get a better idea of how learn-navigation ...
4 years, 1 month ago (2016-10-24 17:59:39 UTC) #17
Benoit L
On 2016/10/24 17:59:39, pasko wrote: > thank you for the tests, now I finally get ...
4 years, 1 month ago (2016-10-24 23:19:14 UTC) #18
alexilin
Let's have some chat. Benoit: https://memegen.googleplex.com/5270515979124736 :) https://codereview.chromium.org/2440723002/diff/140001/chrome/browser/predictors/resource_prefetch_predictor.cc File chrome/browser/predictors/resource_prefetch_predictor.cc (right): https://codereview.chromium.org/2440723002/diff/140001/chrome/browser/predictors/resource_prefetch_predictor.cc#newcode385 chrome/browser/predictors/resource_prefetch_predictor.cc:385: predictor_->observer_ = ...
4 years, 1 month ago (2016-10-25 11:38:09 UTC) #19
pasko
some chat: Done. ;) https://codereview.chromium.org/2440723002/diff/140001/chrome/browser/predictors/resource_prefetch_predictor.cc File chrome/browser/predictors/resource_prefetch_predictor.cc (right): https://codereview.chromium.org/2440723002/diff/140001/chrome/browser/predictors/resource_prefetch_predictor.cc#newcode385 chrome/browser/predictors/resource_prefetch_predictor.cc:385: predictor_->observer_ = nullptr; On 2016/10/25 ...
4 years, 1 month ago (2016-10-25 14:05:40 UTC) #20
alexilin
No memes this time. https://codereview.chromium.org/2440723002/diff/140001/chrome/browser/predictors/resource_prefetch_predictor.cc File chrome/browser/predictors/resource_prefetch_predictor.cc (right): https://codereview.chromium.org/2440723002/diff/140001/chrome/browser/predictors/resource_prefetch_predictor.cc#newcode385 chrome/browser/predictors/resource_prefetch_predictor.cc:385: predictor_->observer_ = nullptr; On 2016/10/25 ...
4 years, 1 month ago (2016-10-25 15:10:59 UTC) #21
alexilin
TestObserver renamed to TestDelegate because we don't support Observer's add/remove semantics and it looks more ...
4 years, 1 month ago (2016-10-25 17:54:17 UTC) #22
pasko
On 2016/10/25 17:54:17, alexilin wrote: > TestObserver renamed to TestDelegate because we don't support Observer's ...
4 years, 1 month ago (2016-10-26 11:44:37 UTC) #23
pasko
overall looking good with two non-trivial suggestions and some rant: 1. s/TestDelegate/TestObserver/ (or discuss, as ...
4 years, 1 month ago (2016-10-26 12:05:41 UTC) #24
alexilin
Concerning Delegate vs. Observer: Observers make some work too, not 'just observing what is being ...
4 years, 1 month ago (2016-10-26 13:09:59 UTC) #25
pasko
> Observers make some work too, not 'just observing what is being done'. The > ...
4 years, 1 month ago (2016-10-26 13:48:35 UTC) #26
alexilin
Already renamed back to TestObserver. TestObserver is moved out of ResourcePrefetchPredictor. https://codereview.chromium.org/2440723002/diff/200001/chrome/browser/predictors/resource_prefetch_predictor.h File chrome/browser/predictors/resource_prefetch_predictor.h (right): ...
4 years, 1 month ago (2016-10-26 15:22:02 UTC) #27
pasko
lgtm, thank you!
4 years, 1 month ago (2016-10-26 15:24:43 UTC) #28
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/2440723002/240001
4 years, 1 month ago (2016-10-26 16:16:02 UTC) #35
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 1 month ago (2016-10-26 16:20:51 UTC) #37
commit-bot: I haz the power
4 years, 1 month ago (2016-10-26 17:12:23 UTC) #39
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/fdf3eb2acfa3444030d3988b664d00325a3e109d
Cr-Commit-Position: refs/heads/master@{#427707}

Powered by Google App Engine
This is Rietveld 408576698