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

Issue 2898393002: Split Android-specific dependency from BackgroundLoaderOffliner. Create a subfolder of c/b/offline_… (Closed)

Created:
3 years, 7 months ago by Dmitry Titov
Modified:
3 years, 6 months ago
Reviewers:
Yaron, chili, dewittj
CC:
chromium-reviews, cbentzel+watch_chromium.org, romax+watch_chromium.org, tburkard+watch_chromium.org, fgorski+watch_chromium.org, dewittj+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, gavinp+prer_chromium.org, dimich+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Split Android-specific dependency from BackgroundLoaderOffliner. Create a subfolder of c/b/offline_pages which will contain Android-specific code. Update DEPS files. BUG=722467 Review-Url: https://codereview.chromium.org/2898393002 Cr-Commit-Position: refs/heads/master@{#474687} Committed: https://chromium.googlesource.com/chromium/src/+/91494853f713cfb11c13ba2720689e6288639e4e

Patch Set 1 #

Patch Set 2 : c/b/o_p DEPS is strict now #

Patch Set 3 : rebased #

Patch Set 4 : build errors #

Patch Set 5 : comments cleanup #

Patch Set 6 : more build fixes #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+228 lines, -49 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc View 1 chunk +2 lines, -1 line 2 comments Download
M chrome/browser/android/offline_pages/prerendering_offliner.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/prerendering_offliner.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 2 comments Download
M chrome/browser/android/offline_pages/request_coordinator_factory.cc View 1 2 2 chunks +5 lines, -1 line 2 comments Download
M chrome/browser/offline_pages/DEPS View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
A chrome/browser/offline_pages/android/DEPS View 1 2 3 4 1 chunk +7 lines, -0 lines 2 comments Download
A chrome/browser/offline_pages/android/load_termination_listener_impl.h View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/browser/offline_pages/android/load_termination_listener_impl.cc View 1 2 3 1 chunk +35 lines, -0 lines 2 comments Download
M chrome/browser/offline_pages/background_loader_offliner.h View 5 chunks +10 lines, -10 lines 0 comments Download
M chrome/browser/offline_pages/background_loader_offliner.cc View 1 2 6 chunks +12 lines, -22 lines 0 comments Download
M chrome/browser/offline_pages/background_loader_offliner_unittest.cc View 1 2 3 4 5 10 chunks +53 lines, -5 lines 0 comments Download
M components/offline_pages/core/background/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
A components/offline_pages/core/background/load_termination_listener.h View 1 chunk +33 lines, -0 lines 0 comments Download
M components/offline_pages/core/background/offliner.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M components/offline_pages/core/background/offliner_stub.h View 2 chunks +3 lines, -1 line 0 comments Download
M components/offline_pages/core/background/offliner_stub.cc View 2 chunks +14 lines, -6 lines 0 comments Download

Messages

Total messages: 33 (24 generated)
Dmitry Titov
Next step of refactoring to split platform-independent code and Android-specific one into separate folders, with ...
3 years, 7 months ago (2017-05-24 05:03:13 UTC) #14
Dmitry Titov
+dewittj as OWNER of offline_pages
3 years, 7 months ago (2017-05-24 05:04:53 UTC) #16
chili
offliner parts lgtm
3 years, 7 months ago (2017-05-24 06:59:40 UTC) #19
dewittj
lgtm https://codereview.chromium.org/2898393002/diff/2/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc File chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc (right): https://codereview.chromium.org/2898393002/diff/2/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc#newcode178 chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc:178: nullptr)); // no need to connect LoadTerminatorListener for ...
3 years, 6 months ago (2017-05-24 23:24:40 UTC) #24
Yaron
base/android reference lgtm
3 years, 6 months ago (2017-05-25 02:16:22 UTC) #25
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/2898393002/2
3 years, 6 months ago (2017-05-25 15:45:27 UTC) #28
commit-bot: I haz the power
Committed patchset #6 (id:2) as https://chromium.googlesource.com/chromium/src/+/91494853f713cfb11c13ba2720689e6288639e4e
3 years, 6 months ago (2017-05-25 17:36:24 UTC) #31
Dmitry Titov
oops sorry didn't notice Justin's suggestions while hitting Checkin button on the phone :( Preparing ...
3 years, 6 months ago (2017-05-25 23:02:09 UTC) #32
Dmitry Titov
3 years, 6 months ago (2017-05-25 23:24:13 UTC) #33
Message was sent while issue was closed.
Justin, I've sent you a follow-up CL:
https://chromium-review.googlesource.com/c/516782/

Also some replies:

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/android/offl...
File
chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc
(right):

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/android/offl...
chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc:178:
nullptr));  // no need to connect LoadTerminatorListener for harness.
On 2017/05/24 23:24:39, dewittj wrote:
> nit: LoadTerminationListener

Done in followup CL

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/android/offl...
File chrome/browser/android/offline_pages/prerendering_offliner.cc (right):

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/android/offl...
chrome/browser/android/offline_pages/prerendering_offliner.cc:282: // This is
not implemented since this offliner is deprecated and
On 2017/05/24 23:24:40, dewittj wrote:
> Is this different behavior than we have today?

No, it directly uses Android class. I hope we will remove this file before it'll
be necessary to refactor it as well.

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/android/offl...
File chrome/browser/android/offline_pages/request_coordinator_factory.cc
(right):

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/android/offl...
chrome/browser/android/offline_pages/request_coordinator_factory.cc:20: #include
"chrome/browser/offline_pages/android/load_termination_listener_impl.h"
On 2017/05/24 23:24:40, dewittj wrote:
> I assume that this file will eventually want to move out from c/b/a. Should we
> start by adding #if defined(OS_ANDROID) for this?

My thought was that factories, as main dependency injection points, would be
living in leaf-most folders and directly inject specific dependencies, without
ifdefs. So we have a factory impl per platform, and include the right one in
BUILD.gn depending which platform we build.

So this specific one will eventually go to c/b/o_p/android.

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/offline_page...
File chrome/browser/offline_pages/android/DEPS (right):

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/offline_page...
chrome/browser/offline_pages/android/DEPS:5: # platform-inependent code and
Android-specific, and will go away.
On 2017/05/24 23:24:40, dewittj wrote:
> independent

Done in followup CL

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/offline_page...
File chrome/browser/offline_pages/android/load_termination_listener_impl.cc
(right):

https://codereview.chromium.org/2898393002/diff/2/chrome/browser/offline_page...
chrome/browser/offline_pages/android/load_termination_listener_impl.cc:18:
weak_ptr_factory_.GetWeakPtr()));
On 2017/05/24 23:24:40, dewittj wrote:
> q: technically could this be base::Unretained(this) since we own the
> app_listener_?

It indeed would be, in this specific case. I'm hesitant to switch to Unretained
though because it feels as more load on casual reader to verify that lifetimes
are correct. In this case, it's a non-local lookup into the code... Let me know
if you think there is a reason to switch!

Powered by Google App Engine
This is Rietveld 408576698