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

Issue 1176253002: Fix IsPrecachingAllowed() to check Sync instead of Data Saver. (Closed)

Created:
5 years, 6 months ago by twifkak
Modified:
5 years, 6 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, Val Markovic, maxbogue
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix IsPrecachingAllowed() to check Sync instead of Data Saver. Fixed PrecacheManager::IsPrecachingAllowed() to check for the ability to sync tabs rather than to check that Data Saver is enabled. This was used only by ChromeNetworkDelegate to determine whether to report some request metrics to UMA. This definition of the function became out-of-date as of commit dd40ab5. Got rid of the internal IsSyncTabsEnabled() function, and had PrecacheLauncher call PrecacheManager::IsPrecachingAllowed() instead. This should eliminate this class of error in the future. BUG=309216 Committed: https://crrev.com/85f978746ea9ad414b4fc710a99e8f81d55f7a22 Cr-Commit-Position: refs/heads/master@{#335835}

Patch Set 1 : Fix IsPrecachingAllowed and remove IsSyncTabsEnabled. #

Patch Set 2 : Add check for GetEncryptedDataTypes by switching to SyncService. #

Patch Set 3 : Fix include paths. #

Total comments: 2

Patch Set 4 : Change IsSyncEnabledAndLoggedIn to CanSyncStart. #

Total comments: 6

Patch Set 5 : Remove explicit, add consts, remove user_prefs dep. #

Total comments: 1

Patch Set 6 : Fix encryption check. #

Patch Set 7 : Use active rather than preferred, per zea@. #

Total comments: 6

Patch Set 8 : Tweaks per bengr. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -113 lines) Patch
M chrome/browser/android/precache/precache_launcher.cc View 1 2 3 4 5 6 7 3 chunks +4 lines, -11 lines 0 comments Download
M chrome/browser/net/chrome_network_delegate.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
A + chrome/browser/precache/OWNERS View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/browser/precache/precache_manager_factory.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
A + chrome/browser/precache/precache_manager_factory.cc View 1 2 chunks +11 lines, -4 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M components/precache.gypi View 1 1 chunk +0 lines, -2 lines 0 comments Download
M components/precache/content/BUILD.gn View 1 1 chunk +0 lines, -2 lines 0 comments Download
M components/precache/content/DEPS View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M components/precache/content/precache_manager.h View 1 2 3 4 5 6 7 4 chunks +12 lines, -3 lines 0 comments Download
M components/precache/content/precache_manager.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -6 lines 0 comments Download
D components/precache/content/precache_manager_factory.h View 1 1 chunk +0 lines, -41 lines 0 comments Download
D components/precache/content/precache_manager_factory.cc View 1 1 chunk +0 lines, -36 lines 0 comments Download
M components/precache/content/precache_manager_unittest.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 37 (6 generated)
twifkak
This the correct one. Please review this.
5 years, 6 months ago (2015-06-11 02:17:00 UTC) #2
twifkak
On 2015/06/11 02:17:00, twifkak wrote: > This the correct one. Please review this. Hold off ...
5 years, 6 months ago (2015-06-12 21:07:57 UTC) #3
bengr
On 2015/06/12 21:07:57, twifkak wrote: > On 2015/06/11 02:17:00, twifkak wrote: > > This the ...
5 years, 6 months ago (2015-06-15 19:54:00 UTC) #4
twifkak
+maxbogue in case he wants to double-check my sync logic (discussed with chrome-sync-dev@)
5 years, 6 months ago (2015-06-16 03:12:24 UTC) #5
twifkak
bengr: PTAL.
5 years, 6 months ago (2015-06-16 03:12:56 UTC) #6
maxbogue
https://codereview.chromium.org/1176253002/diff/40001/components/precache/content/precache_manager.cc File components/precache/content/precache_manager.cc (right): https://codereview.chromium.org/1176253002/diff/40001/components/precache/content/precache_manager.cc#newcode69 components/precache/content/precache_manager.cc:69: return sync_service_ && sync_service_->IsSyncEnabledAndLoggedIn() && This logic lgtm. FYI, ...
5 years, 6 months ago (2015-06-16 19:51:27 UTC) #8
twifkak
https://codereview.chromium.org/1176253002/diff/40001/components/precache/content/precache_manager.cc File components/precache/content/precache_manager.cc (right): https://codereview.chromium.org/1176253002/diff/40001/components/precache/content/precache_manager.cc#newcode69 components/precache/content/precache_manager.cc:69: return sync_service_ && sync_service_->IsSyncEnabledAndLoggedIn() && On 2015/06/16 19:51:27, maxbogue ...
5 years, 6 months ago (2015-06-16 20:56:42 UTC) #9
bengr
lgtm
5 years, 6 months ago (2015-06-17 00:47:24 UTC) #10
twifkak
yfriedman@chromium.org: Please review changes in chrome/browser/android/precache/precache_launcher.cc battre@chromium.org: Please review changes in chrome/browser/net/chrome_network_delegate.cc thestig@chromium.org: Please review ...
5 years, 6 months ago (2015-06-17 01:02:14 UTC) #12
Lei Zhang
So is still a reason to have components/precache/content/, which will only have PrecacheManager. Especially considering ...
5 years, 6 months ago (2015-06-17 01:24:33 UTC) #13
Yaron
On 2015/06/17 01:24:33, Lei Zhang wrote: > So is still a reason to have components/precache/content/, ...
5 years, 6 months ago (2015-06-17 01:56:17 UTC) #14
twifkak
On 2015/06/17 01:24:33, Lei Zhang wrote: > So is still a reason to have components/precache/content/, ...
5 years, 6 months ago (2015-06-17 03:41:20 UTC) #15
twifkak
https://codereview.chromium.org/1176253002/diff/60001/chrome/chrome_browser.gypi File chrome/chrome_browser.gypi (right): https://codereview.chromium.org/1176253002/diff/60001/chrome/chrome_browser.gypi#newcode610 chrome/chrome_browser.gypi:610: 'browser/precache/precache_manager_factory.cc', On 2015/06/17 01:24:33, Lei Zhang wrote: > Is ...
5 years, 6 months ago (2015-06-17 03:49:04 UTC) #16
battre
chrome/browser/net/chrome_network_delegate.cc LGTM
5 years, 6 months ago (2015-06-17 11:34:33 UTC) #17
Lei Zhang
https://codereview.chromium.org/1176253002/diff/60001/components/precache/content/precache_manager.h File components/precache/content/precache_manager.h (right): https://codereview.chromium.org/1176253002/diff/60001/components/precache/content/precache_manager.h#newcode59 components/precache/content/precache_manager.h:59: explicit PrecacheManager(content::BrowserContext* browser_context, nit: no longer explicit https://codereview.chromium.org/1176253002/diff/60001/components/precache/content/precache_manager.h#newcode105 components/precache/content/precache_manager.h:105: ...
5 years, 6 months ago (2015-06-17 21:41:52 UTC) #18
Lei Zhang
On 2015/06/17 03:41:20, twifkak wrote: > On 2015/06/17 01:24:33, Lei Zhang wrote: > > So ...
5 years, 6 months ago (2015-06-17 21:44:50 UTC) #19
Lei Zhang
On 2015/06/17 03:49:04, twifkak wrote: > https://codereview.chromium.org/1176253002/diff/60001/chrome/chrome_browser.gypi > File chrome/chrome_browser.gypi (right): > > https://codereview.chromium.org/1176253002/diff/60001/chrome/chrome_browser.gypi#newcode610 > ...
5 years, 6 months ago (2015-06-17 21:46:29 UTC) #20
twifkak
On 2015/06/17 21:46:29, Lei Zhang wrote: > On 2015/06/17 03:49:04, twifkak wrote: > > > ...
5 years, 6 months ago (2015-06-17 22:04:57 UTC) #21
twifkak
zea@chromium.org: Please review changes in components/precache/content/DEPS (+sync_driver) https://codereview.chromium.org/1176253002/diff/60001/components/precache/content/precache_manager.h File components/precache/content/precache_manager.h (right): https://codereview.chromium.org/1176253002/diff/60001/components/precache/content/precache_manager.h#newcode59 components/precache/content/precache_manager.h:59: explicit PrecacheManager(content::BrowserContext* ...
5 years, 6 months ago (2015-06-17 22:12:02 UTC) #23
Nicolas Zea
https://codereview.chromium.org/1176253002/diff/80001/components/precache/content/precache_manager.cc File components/precache/content/precache_manager.cc (right): https://codereview.chromium.org/1176253002/diff/80001/components/precache/content/precache_manager.cc#newcode73 components/precache/content/precache_manager.cc:73: !sync_service_->GetEncryptedDataTypes().Has(syncer::SESSIONS); One correction (which I think was overlooked in ...
5 years, 6 months ago (2015-06-18 18:25:49 UTC) #24
twifkak
On 2015/06/18 18:25:49, Nicolas Zea wrote: > https://codereview.chromium.org/1176253002/diff/80001/components/precache/content/precache_manager.cc > File components/precache/content/precache_manager.cc (right): > > https://codereview.chromium.org/1176253002/diff/80001/components/precache/content/precache_manager.cc#newcode73 ...
5 years, 6 months ago (2015-06-18 19:37:02 UTC) #25
Nicolas Zea
On 2015/06/18 19:37:02, twifkak wrote: > On 2015/06/18 18:25:49, Nicolas Zea wrote: > > > ...
5 years, 6 months ago (2015-06-18 19:48:16 UTC) #26
twifkak
On 2015/06/18 19:48:16, Nicolas Zea wrote: > On 2015/06/18 19:37:02, twifkak wrote: > > On ...
5 years, 6 months ago (2015-06-18 20:13:07 UTC) #27
twifkak
On 2015/06/18 20:13:07, twifkak wrote: > On 2015/06/18 19:48:16, Nicolas Zea wrote: > > On ...
5 years, 6 months ago (2015-06-18 20:21:09 UTC) #28
twifkak
bengr and zea: PTAL. A couple notes: - EncryptEverythingEnabled() does not exist on the SyncService ...
5 years, 6 months ago (2015-06-22 23:19:55 UTC) #29
Nicolas Zea
sync usage LGTM
5 years, 6 months ago (2015-06-23 20:40:00 UTC) #30
bengr
lgtm with a few nits. https://codereview.chromium.org/1176253002/diff/120001/chrome/browser/android/precache/precache_launcher.cc File chrome/browser/android/precache/precache_launcher.cc (right): https://codereview.chromium.org/1176253002/diff/120001/chrome/browser/android/precache/precache_launcher.cc#newcode45 chrome/browser/android/precache/precache_launcher.cc:45: DCHECK(precache_manager); I'm 99.999% sure ...
5 years, 6 months ago (2015-06-23 22:16:19 UTC) #31
twifkak
Thanks, all! +CQ https://codereview.chromium.org/1176253002/diff/120001/chrome/browser/android/precache/precache_launcher.cc File chrome/browser/android/precache/precache_launcher.cc (right): https://codereview.chromium.org/1176253002/diff/120001/chrome/browser/android/precache/precache_launcher.cc#newcode45 chrome/browser/android/precache/precache_launcher.cc:45: DCHECK(precache_manager); On 2015/06/23 22:16:19, bengr wrote: ...
5 years, 6 months ago (2015-06-23 23:54:52 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1176253002/140001
5 years, 6 months ago (2015-06-23 23:56:41 UTC) #35
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 6 months ago (2015-06-24 01:00:20 UTC) #36
commit-bot: I haz the power
5 years, 6 months ago (2015-06-24 01:01:14 UTC) #37
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/85f978746ea9ad414b4fc710a99e8f81d55f7a22
Cr-Commit-Position: refs/heads/master@{#335835}

Powered by Google App Engine
This is Rietveld 408576698