Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Issue 2864293003: [Offline Pages] Add a GCMAppHandler for offline page prefetch. (Closed)

Created:
3 years, 7 months ago by dewittj
Modified:
3 years, 6 months ago
CC:
blundell+watchlist_chromium.org, chili+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, dewittj+watch_chromium.org, dimich+watch_chromium.org, droger+watchlist_chromium.org, fgorski+watch_chromium.org, jam, noyau+watch_chromium.org, ntp-dev+reviews_chromium.org, petewil+watch_chromium.org, romax+watch_chromium.org, sdefresne+watchlist_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Offline Pages] Add a GCMAppHandler for offline page prefetch. This does not yet react to such messages but hooks up the plumbing so that we are ready for them Because the app handlers need to be registered before any GCM messages are received, this app handler is added upon construction of the GCMProfileService. BUG=701939 Review-Url: https://codereview.chromium.org/2864293003 Cr-Commit-Position: refs/heads/master@{#475735} Committed: https://chromium.googlesource.com/chromium/src/+/d564808ec725e2eb36bef109d17fe641885e0ad0

Patch Set 1 #

Total comments: 1

Patch Set 2 : Alternate implementation where GCMDriver depends on us. #

Patch Set 3 : Touch ups. #

Total comments: 2

Patch Set 4 : Refactor to remove GCM dependency. #

Total comments: 13

Patch Set 5 : Move Content Suggestions Observer to //components/offline_pages/core and modify lifetime management #

Total comments: 4

Patch Set 6 : Comments. #

Patch Set 7 : Rebase. #

Patch Set 8 : Redo lifetime model of PrefetchService so that GCM depends on it. #

Patch Set 9 : Move the gcm app handler to components. #

Patch Set 10 : Fix windows compile. #

Total comments: 4

Patch Set 11 : Again fix windows. #

Patch Set 12 : Make PrefetchService dependency more explicit. #

Patch Set 13 : Remove includes. #

Patch Set 14 : Fix windows #

Unified diffs Side-by-side diffs Delta from patch set Stats (+491 lines, -703 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/android/offline_pages/prefetch/prefetch_background_task.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/gcm/gcm_profile_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +27 lines, -4 lines 0 comments Download
M chrome/browser/ntp_snippets/content_suggestions_service_factory.cc View 1 2 3 4 5 6 7 9 chunks +40 lines, -22 lines 0 comments Download
A + chrome/browser/offline_pages/prefetch/prefetch_service_factory.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
A + chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +4 lines, -3 lines 0 comments Download
M components/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M components/ntp_snippets/content_suggestions_service.h View 1 2 3 4 5 6 2 chunks +0 lines, -2 lines 0 comments Download
D components/offline_pages/content/BUILD.gn View 1 2 3 4 5 6 1 chunk +0 lines, -45 lines 0 comments Download
M components/offline_pages/content/DEPS View 1 2 3 1 chunk +0 lines, -6 lines 0 comments Download
D components/offline_pages/content/prefetch_service_factory.h View 2 3 1 chunk +0 lines, -43 lines 0 comments Download
D components/offline_pages/content/prefetch_service_factory.cc View 2 3 1 chunk +0 lines, -36 lines 0 comments Download
D components/offline_pages/content/suggested_articles_observer.h View 1 2 3 4 5 6 1 chunk +0 lines, -80 lines 0 comments Download
D components/offline_pages/content/suggested_articles_observer.cc View 1 2 3 4 5 6 1 chunk +0 lines, -170 lines 0 comments Download
D components/offline_pages/content/suggested_articles_observer_unittest.cc View 1 2 3 4 5 6 1 chunk +0 lines, -215 lines 0 comments Download
M components/offline_pages/core/DEPS View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M components/offline_pages/core/prefetch/BUILD.gn View 1 2 3 4 5 6 7 8 4 chunks +11 lines, -0 lines 0 comments Download
A components/offline_pages/core/prefetch/prefetch_gcm_app_handler.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +50 lines, -0 lines 0 comments Download
A components/offline_pages/core/prefetch/prefetch_gcm_app_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +59 lines, -0 lines 0 comments Download
A components/offline_pages/core/prefetch/prefetch_gcm_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +37 lines, -0 lines 0 comments Download
M components/offline_pages/core/prefetch/prefetch_service.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -0 lines 0 comments Download
M components/offline_pages/core/prefetch/prefetch_service_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +12 lines, -1 line 0 comments Download
M components/offline_pages/core/prefetch/prefetch_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +15 lines, -3 lines 0 comments Download
A components/offline_pages/core/prefetch/prefetch_service_impl_unittest.cc View 1 2 3 4 5 6 1 chunk +21 lines, -0 lines 0 comments Download
A components/offline_pages/core/prefetch/suggested_articles_observer.h View 1 2 3 4 1 chunk +67 lines, -0 lines 0 comments Download
A components/offline_pages/core/prefetch/suggested_articles_observer.cc View 1 2 3 4 5 6 1 chunk +115 lines, -0 lines 0 comments Download
A + components/offline_pages/core/prefetch/suggested_articles_observer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +14 lines, -67 lines 0 comments Download

Messages

Total messages: 115 (88 generated)
dewittj
+dimich This is not yet complete, but wanted to get your sense of whether PrefetchService ...
3 years, 7 months ago (2017-05-08 23:00:38 UTC) #4
Dmitry Titov
https://codereview.chromium.org/2864293003/diff/1/chrome/browser/android/offline_pages/prefetch/prefetch_service_factory.cc File chrome/browser/android/offline_pages/prefetch/prefetch_service_factory.cc (right): https://codereview.chromium.org/2864293003/diff/1/chrome/browser/android/offline_pages/prefetch/prefetch_service_factory.cc#newcode26 chrome/browser/android/offline_pages/prefetch/prefetch_service_factory.cc:26: DependsOn(gcm::GCMProfileServiceFactory::GetInstance()); I wonder if this is the other way ...
3 years, 7 months ago (2017-05-09 00:22:25 UTC) #7
Dmitry Titov
Also, I do think having a separate object would be good, and I'd expose a ...
3 years, 7 months ago (2017-05-09 00:23:50 UTC) #8
dewittj
dimich: PTAL, does this look better? fgorski: Would you be okay with the dependency as ...
3 years, 7 months ago (2017-05-09 17:07:54 UTC) #13
Dmitry Titov
Almost there! 1. I'm going to move the prefetch_service_factory to c/b/o_p/prefetch, preliminary patch (2875853003) is ...
3 years, 7 months ago (2017-05-11 03:35:20 UTC) #14
dewittj
PTAL, rewrote this to have teh following properties: * We assume that PrefetchService is very ...
3 years, 7 months ago (2017-05-16 17:56:44 UTC) #29
Dmitry Titov
https://codereview.chromium.org/2864293003/diff/120001/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc File chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc (right): https://codereview.chromium.org/2864293003/diff/120001/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc#newcode41 chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc:41: if (!offline_pages::IsPrefetchingOfflinePagesEnabled()) It feels this check belongs to delayed ...
3 years, 7 months ago (2017-05-16 19:33:23 UTC) #30
fgorski
https://codereview.chromium.org/2864293003/diff/120001/chrome/browser/offline_pages/prefetch/prefetch_gcm_app_handler.h File chrome/browser/offline_pages/prefetch/prefetch_gcm_app_handler.h (right): https://codereview.chromium.org/2864293003/diff/120001/chrome/browser/offline_pages/prefetch/prefetch_gcm_app_handler.h#newcode8 chrome/browser/offline_pages/prefetch/prefetch_gcm_app_handler.h:8: #include <vector> #include <string> instead is more appropriate I ...
3 years, 7 months ago (2017-05-16 20:03:02 UTC) #31
dewittj
ptal, thanks! https://codereview.chromium.org/2864293003/diff/120001/chrome/browser/offline_pages/prefetch/prefetch_gcm_app_handler.h File chrome/browser/offline_pages/prefetch/prefetch_gcm_app_handler.h (right): https://codereview.chromium.org/2864293003/diff/120001/chrome/browser/offline_pages/prefetch/prefetch_gcm_app_handler.h#newcode8 chrome/browser/offline_pages/prefetch/prefetch_gcm_app_handler.h:8: #include <vector> On 2017/05/16 20:03:01, fgorski wrote: ...
3 years, 7 months ago (2017-05-16 22:58:22 UTC) #35
Dmitry Titov
lgtm upon moving gcm handler and zine listener to components/ since they don't necessarily need ...
3 years, 7 months ago (2017-05-17 18:21:09 UTC) #45
dewittj
PTAL again, When I moved the suggested_articles_observer there were some substantial changes: * It hangs ...
3 years, 7 months ago (2017-05-17 21:43:19 UTC) #52
fgorski
lgtm https://codereview.chromium.org/2864293003/diff/220001/components/offline_pages/core/prefetch/prefetch_service_impl.h File components/offline_pages/core/prefetch/prefetch_service_impl.h (right): https://codereview.chromium.org/2864293003/diff/220001/components/offline_pages/core/prefetch/prefetch_service_impl.h#newcode23 components/offline_pages/core/prefetch/prefetch_service_impl.h:23: // lifetime purposes. TODO(dewittj): Add an interface method ...
3 years, 7 months ago (2017-05-17 23:15:02 UTC) #53
Dmitry Titov
still lgtm
3 years, 7 months ago (2017-05-18 01:13:41 UTC) #54
dewittj
+jochen - TBR but at your leisure please look at components/BUILD.gn, moving files around removed ...
3 years, 7 months ago (2017-05-18 06:23:09 UTC) #57
Bernhard Bauer
LGTM https://codereview.chromium.org/2864293003/diff/220001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc File chrome/browser/ntp_snippets/content_suggestions_service_factory.cc (right): https://codereview.chromium.org/2864293003/diff/220001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc#newcode78 chrome/browser/ntp_snippets/content_suggestions_service_factory.cc:78: #if BUILDFLAG(ENABLE_OFFLINE_PAGES) Nit: If you're touching this code ...
3 years, 7 months ago (2017-05-18 19:11:31 UTC) #58
jochen (gone - plz use gerrit)
lgtm
3 years, 7 months ago (2017-05-18 20:30:23 UTC) #59
dewittj
https://codereview.chromium.org/2864293003/diff/220001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc File chrome/browser/ntp_snippets/content_suggestions_service_factory.cc (right): https://codereview.chromium.org/2864293003/diff/220001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc#newcode78 chrome/browser/ntp_snippets/content_suggestions_service_factory.cc:78: #if BUILDFLAG(ENABLE_OFFLINE_PAGES) On 2017/05/18 19:11:31, Bernhard Bauer wrote: > ...
3 years, 7 months ago (2017-05-22 22:00:08 UTC) #64
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/2864293003/260001
3 years, 7 months ago (2017-05-22 22:00:12 UTC) #65
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/183969)
3 years, 7 months ago (2017-05-23 00:48:05 UTC) #67
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/2864293003/260001
3 years, 7 months ago (2017-05-23 17:20:45 UTC) #69
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/300715)
3 years, 7 months ago (2017-05-23 20:06:56 UTC) #71
dewittj
fgorski, dimich: PTAL, I reworked the lifetime of PrefetchService as we discussed in the office.
3 years, 7 months ago (2017-05-24 21:11:13 UTC) #76
fgorski
https://codereview.chromium.org/2864293003/diff/320001/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc File chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc (right): https://codereview.chromium.org/2864293003/diff/320001/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc#newcode9 chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc:9: #include "chrome/browser/gcm/gcm_profile_service_factory.h" are these includes needed? https://codereview.chromium.org/2864293003/diff/320001/components/offline_pages/core/prefetch/prefetch_service_impl.cc File components/offline_pages/core/prefetch/prefetch_service_impl.cc ...
3 years, 6 months ago (2017-05-30 18:20:05 UTC) #89
dewittj
fgorski, dimich: Updated as discussed, ptal. https://codereview.chromium.org/2864293003/diff/320001/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc File chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc (right): https://codereview.chromium.org/2864293003/diff/320001/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc#newcode9 chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc:9: #include "chrome/browser/gcm/gcm_profile_service_factory.h" On ...
3 years, 6 months ago (2017-05-30 21:09:19 UTC) #103
Dmitry Titov
LGTM with understanding that we need to do a quick refactor of suggestion listener to ...
3 years, 6 months ago (2017-05-30 21:21:23 UTC) #104
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/2864293003/400001
3 years, 6 months ago (2017-05-30 23:52:59 UTC) #112
commit-bot: I haz the power
3 years, 6 months ago (2017-05-31 01:57:53 UTC) #115

Powered by Google App Engine
This is Rietveld 408576698