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

Issue 1929223002: Add skeletons for the factories to create the request coordinator and (Closed)

Created:
4 years, 7 months ago by Pete Williamson
Modified:
4 years ago
CC:
chromium-reviews, davidben+watch_chromium.org, cbentzel+watch_chromium.org, romax+watch_chromium.org, tburkard+watch_chromium.org, fgorski+watch_chromium.org, petewil+watch_chromium.org, dewittj+watch_chromium.org, gavinp+prer_chromium.org, dimich+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add skeletons for the factories to create the request coordinator and prerender offliner BUG= patch from issue 1914333002 at patchset 60001 (http://crrev.com/1914333002#ps60001) Committed: https://crrev.com/6e3878cde4c06ff306d39f282316bc2123107076 Cr-Commit-Position: refs/heads/master@{#391826}

Patch Set 1 #

Patch Set 2 : Manual merge of changes in the base changelist. #

Total comments: 21

Patch Set 3 : Moved some factories to chrome side to have access to the variables we need #

Patch Set 4 : After merge #

Total comments: 5

Patch Set 5 : cleanup #

Total comments: 53

Patch Set 6 : CR fixes per DougArnett and FGorski #

Total comments: 12

Patch Set 7 : CR fixes per FGorski #

Total comments: 4

Patch Set 8 : Rebase and fix some nits #

Patch Set 9 : Remove files added in error #

Patch Set 10 : Add dependency in BUILD.gn file #

Patch Set 11 : Fix dependencies for the right build target. #

Patch Set 12 : Fix unit tests, gyp build. #

Patch Set 13 : Attempt gypi file fix. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+295 lines, -15 lines) Patch
M chrome/browser/android/offline_pages/prerendering_offliner.h View 1 2 3 4 5 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/android/offline_pages/prerendering_offliner.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
A chrome/browser/android/offline_pages/prerendering_offliner_factory.h View 1 2 3 4 5 6 7 1 chunk +45 lines, -0 lines 0 comments Download
A chrome/browser/android/offline_pages/prerendering_offliner_factory.cc View 1 2 3 4 5 1 chunk +44 lines, -0 lines 0 comments Download
A chrome/browser/android/offline_pages/request_coordinator_factory.h View 1 2 3 4 1 chunk +45 lines, -0 lines 0 comments Download
A chrome/browser/android/offline_pages/request_coordinator_factory.cc View 1 2 3 4 5 6 7 1 chunk +52 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M components/offline_pages.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M components/offline_pages/background/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
A components/offline_pages/background/offliner_factory.h View 1 2 3 4 5 1 chunk +31 lines, -0 lines 1 comment Download
A components/offline_pages/background/offliner_policy.h View 1 2 3 4 5 6 7 1 chunk +21 lines, -0 lines 0 comments Download
M components/offline_pages/background/request_coordinator.h View 1 2 3 4 5 6 7 2 chunks +18 lines, -5 lines 0 comments Download
M components/offline_pages/background/request_coordinator.cc View 1 2 3 4 5 6 7 1 chunk +11 lines, -5 lines 0 comments Download
M components/offline_pages/background/request_coordinator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -3 lines 0 comments Download

Messages

Total messages: 47 (19 generated)
fgorski
https://codereview.chromium.org/1929223002/diff/20001/components/offline_pages/background/offliner_factory.h File components/offline_pages/background/offliner_factory.h (right): https://codereview.chromium.org/1929223002/diff/20001/components/offline_pages/background/offliner_factory.h#newcode1 components/offline_pages/background/offliner_factory.h:1: // Copyright 2015 The Chromium Authors. All rights reserved. ...
4 years, 7 months ago (2016-04-29 04:16:46 UTC) #2
Pete Williamson
Thanks for the early feedback! Patch is still not quite ready for review. https://codereview.chromium.org/1929223002/diff/20001/components/offline_pages/background/offliner_factory.h File ...
4 years, 7 months ago (2016-05-02 20:51:14 UTC) #3
dougarnett
few advance glance comments https://codereview.chromium.org/1929223002/diff/60001/chrome/browser/android/offline_pages/prerendering_offliner_factory.cc File chrome/browser/android/offline_pages/prerendering_offliner_factory.cc (right): https://codereview.chromium.org/1929223002/diff/60001/chrome/browser/android/offline_pages/prerendering_offliner_factory.cc#newcode32 chrome/browser/android/offline_pages/prerendering_offliner_factory.cc:32: // TODO(petewil): Create a PrerenderMaanger, ...
4 years, 7 months ago (2016-05-03 18:32:41 UTC) #5
Pete Williamson
Ready for review. Note that the request coordinator factory is not yet hooked up to ...
4 years, 7 months ago (2016-05-03 21:34:42 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1929223002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1929223002/60001
4 years, 7 months ago (2016-05-03 21:35:32 UTC) #8
dougarnett
https://codereview.chromium.org/1929223002/diff/80001/chrome/browser/android/offline_pages/prerendering_offliner_factory.cc File chrome/browser/android/offline_pages/prerendering_offliner_factory.cc (right): https://codereview.chromium.org/1929223002/diff/80001/chrome/browser/android/offline_pages/prerendering_offliner_factory.cc#newcode40 chrome/browser/android/offline_pages/prerendering_offliner_factory.cc:40: return offliner_; too much indention https://codereview.chromium.org/1929223002/diff/80001/chrome/browser/android/offline_pages/prerendering_offliner_factory.h File chrome/browser/android/offline_pages/prerendering_offliner_factory.h (right): ...
4 years, 7 months ago (2016-05-03 22:30:44 UTC) #9
fgorski
https://codereview.chromium.org/1929223002/diff/80001/chrome/browser/android/offline_pages/prerendering_offliner.h File chrome/browser/android/offline_pages/prerendering_offliner.h (right): https://codereview.chromium.org/1929223002/diff/80001/chrome/browser/android/offline_pages/prerendering_offliner.h#newcode10 chrome/browser/android/offline_pages/prerendering_offliner.h:10: #include "components/offline_pages/background/offliner_policy.h" forward declare. you are only dealing with ...
4 years, 7 months ago (2016-05-03 22:48:17 UTC) #10
Pete Williamson
https://codereview.chromium.org/1929223002/diff/80001/chrome/browser/android/offline_pages/prerendering_offliner.h File chrome/browser/android/offline_pages/prerendering_offliner.h (right): https://codereview.chromium.org/1929223002/diff/80001/chrome/browser/android/offline_pages/prerendering_offliner.h#newcode10 chrome/browser/android/offline_pages/prerendering_offliner.h:10: #include "components/offline_pages/background/offliner_policy.h" On 2016/05/03 22:48:08, fgorski wrote: > forward ...
4 years, 7 months ago (2016-05-04 00:39:22 UTC) #11
fgorski
It's getting there. Let's sort out the lifetime management based on the dependencies that we ...
4 years, 7 months ago (2016-05-04 05:20:58 UTC) #12
Pete Williamson
https://codereview.chromium.org/1929223002/diff/80001/components/offline_pages/background/request_coordinator.h File components/offline_pages/background/request_coordinator.h (right): https://codereview.chromium.org/1929223002/diff/80001/components/offline_pages/background/request_coordinator.h#newcode50 components/offline_pages/background/request_coordinator.h:50: OfflinerPolicy* policy_; On 2016/05/04 05:20:57, fgorski wrote: > On ...
4 years, 7 months ago (2016-05-04 21:23:21 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1929223002/80002 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1929223002/80002
4 years, 7 months ago (2016-05-04 21:35:24 UTC) #15
fgorski
lgtm with nits https://codereview.chromium.org/1929223002/diff/80002/components/offline_pages/background/request_coordinator.h File components/offline_pages/background/request_coordinator.h (right): https://codereview.chromium.org/1929223002/diff/80002/components/offline_pages/background/request_coordinator.h#newcode28 components/offline_pages/background/request_coordinator.h:28: std::unique_ptr<OfflinerPolicy> policy, did you run git ...
4 years, 7 months ago (2016-05-04 21:38:25 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/207507) ios-device on ...
4 years, 7 months ago (2016-05-04 21:38:54 UTC) #18
Pete Williamson
Also removed unused weak_ptr .h file as noticed in another changelist. https://codereview.chromium.org/1929223002/diff/80002/components/offline_pages/background/request_coordinator.h File components/offline_pages/background/request_coordinator.h (right): ...
4 years, 7 months ago (2016-05-04 21:54:59 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1929223002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1929223002/140001
4 years, 7 months ago (2016-05-04 21:55:06 UTC) #21
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/106264)
4 years, 7 months ago (2016-05-04 22:00:17 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1929223002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1929223002/160001
4 years, 7 months ago (2016-05-04 22:28:57 UTC) #25
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/106286)
4 years, 7 months ago (2016-05-04 22:33:53 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1929223002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1929223002/180001
4 years, 7 months ago (2016-05-04 22:41:07 UTC) #29
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios-simulator-gn on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-gn/builds/907)
4 years, 7 months ago (2016-05-04 22:48:47 UTC) #31
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1929223002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1929223002/200001
4 years, 7 months ago (2016-05-04 23:09:54 UTC) #33
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_compile_dbg_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_compile_dbg_ng/builds/195859) linux_chromium_chromeos_rel_ng on ...
4 years, 7 months ago (2016-05-04 23:14:31 UTC) #35
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1929223002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1929223002/220001
4 years, 7 months ago (2016-05-04 23:30:17 UTC) #37
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-05 02:28:39 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1929223002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1929223002/220001
4 years, 7 months ago (2016-05-05 16:34:21 UTC) #42
commit-bot: I haz the power
Committed patchset #13 (id:220001)
4 years, 7 months ago (2016-05-05 16:38:23 UTC) #43
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/6e3878cde4c06ff306d39f282316bc2123107076 Cr-Commit-Position: refs/heads/master@{#391826}
4 years, 7 months ago (2016-05-05 16:40:45 UTC) #45
Dmitry Titov
4 years ago (2016-12-17 02:49:18 UTC) #47
Message was sent while issue was closed.
https://codereview.chromium.org/1929223002/diff/220001/components/offline_pag...
File components/offline_pages/background/offliner_factory.h (right):

https://codereview.chromium.org/1929223002/diff/220001/components/offline_pag...
components/offline_pages/background/offliner_factory.h:16: // The returned
factory is owned by the offliner, which is allowed to cache the
This comment (and design of this factory) seems off. This is a factory that
creates offliners, not the other way around?

Also, if this factory returns a single cached offliner, then perhaps it is
possible to return naked pointer like here. If it ever can produce more then a
single cached instance of offliner, it has to return unique_ptr.

Given this design, it can only ever return a singleton cached pointer with
assumption that lifetime of consumer is guaranteed longer that this factory.
Since this factory is not a part of KeyedServices mechanism, there is no
explicit contract here for that lifetime assumption.

I think a better solution would be to either create an offliner directly and
pass it into RequestCoordinator (without having yet another factory that only
can produce a singleton), or go with the multiple offliners from the start and
return unique_ptr. Those offliners may share state or they may be independent,
separately.

Powered by Google App Engine
This is Rietveld 408576698