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

Issue 2647323004: Move download attribution right after CheckDownloadUrl (Closed)

Created:
3 years, 11 months ago by Jialiu Lin
Modified:
3 years, 10 months ago
Reviewers:
asanka, Nathan Parker
CC:
asanka, chromium-reviews, grt+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Since SafeBrowsingNavigationObserverManager cleans up navigation events every two minutes, if downloading a file takes more than 2 minutes, we'll get nothing from the attribution logic. Therefore, this CL moves the download attribution logic to after download url checking (before download starts). This CL also changes the way of how referrer chain is constructed. Instead of putting referrer entries in a temporary vector, I put them directly into a RepeatedPtrField<ReferrerChainEntry> to avoid extra copying/moving operations. This should mitigate the out-of -memory issue. BUG=683299, 676675 Review-Url: https://codereview.chromium.org/2647323004 Cr-Commit-Position: refs/heads/master@{#446761} Committed: https://chromium.googlesource.com/chromium/src/+/20d16215e1bd867da6a23887046f4d6894222c00

Patch Set 1 #

Patch Set 2 : nit #

Patch Set 3 : threading refine comments #

Total comments: 10

Patch Set 4 : address naprker's comments #

Total comments: 8

Patch Set 5 : address comments from asanka@ #

Patch Set 6 : nit #

Total comments: 12

Patch Set 7 : address potential race conditions #

Total comments: 2

Patch Set 8 : move callback to the end of CheckDone(). #

Patch Set 9 : nit #

Patch Set 10 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+230 lines, -156 lines) Patch
M chrome/browser/download/chrome_download_manager_delegate.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/download_protection_service.h View 1 2 3 4 5 6 3 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/safe_browsing/download_protection_service.cc View 1 2 3 4 5 6 7 8 9 11 chunks +94 lines, -43 lines 0 comments Download
M chrome/browser/safe_browsing/download_protection_service_unittest.cc View 1 2 5 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc View 1 2 3 4 5 6 25 chunks +84 lines, -86 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h View 3 chunks +16 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc View 1 2 3 2 chunks +19 lines, -10 lines 0 comments Download

Messages

Total messages: 56 (43 generated)
Jialiu Lin
asanka@,nparker@, PTAL
3 years, 11 months ago (2017-01-24 21:09:45 UTC) #15
Nathan Parker
https://codereview.chromium.org/2647323004/diff/40001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2647323004/diff/40001/chrome/browser/safe_browsing/download_protection_service.cc#newcode173 chrome/browser/safe_browsing/download_protection_service.cc:173: DownloadProtectionService* service, Could service_ get destroyed before this DownloadSBClient ...
3 years, 11 months ago (2017-01-24 22:46:46 UTC) #16
Jialiu Lin
Thanks! https://codereview.chromium.org/2647323004/diff/40001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2647323004/diff/40001/chrome/browser/safe_browsing/download_protection_service.cc#newcode173 chrome/browser/safe_browsing/download_protection_service.cc:173: DownloadProtectionService* service, On 2017/01/24 22:46:46, Nathan Parker wrote: ...
3 years, 11 months ago (2017-01-25 00:11:20 UTC) #17
Jialiu Lin
gentle ping~
3 years, 11 months ago (2017-01-26 18:08:00 UTC) #18
asanka
https://codereview.chromium.org/2647323004/diff/60001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2647323004/diff/60001/chrome/browser/safe_browsing/download_protection_service.cc#newcode262 chrome/browser/safe_browsing/download_protection_service.cc:262: if (service_) { The DownloadProtectionService and the SafeBrowsingService outlives ...
3 years, 11 months ago (2017-01-26 18:54:47 UTC) #19
Nathan Parker
lgtm after addressing asanka's comments https://codereview.chromium.org/2647323004/diff/60001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2647323004/diff/60001/chrome/browser/safe_browsing/download_protection_service.cc#newcode114 chrome/browser/safe_browsing/download_protection_service.cc:114: nit: 3 blank lines ...
3 years, 11 months ago (2017-01-26 19:29:10 UTC) #20
Jialiu Lin
Thanks asanka@ and nparker@! DownloadSBClient is changed to a DownloadItem::Observer, and all the callings of ...
3 years, 10 months ago (2017-01-26 22:51:27 UTC) #23
asanka
Lifetimes are hard. https://codereview.chromium.org/2647323004/diff/100001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2647323004/diff/100001/chrome/browser/safe_browsing/download_protection_service.cc#newcode190 chrome/browser/safe_browsing/download_protection_service.cc:190: if (item_) |item_| had better be ...
3 years, 10 months ago (2017-01-27 00:10:49 UTC) #24
Jialiu Lin
Thank you so much asanka@! I probably won't realize these race conditions if you don't ...
3 years, 10 months ago (2017-01-27 01:29:46 UTC) #26
asanka
lgtm https://codereview.chromium.org/2647323004/diff/140001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2647323004/diff/140001/chrome/browser/safe_browsing/download_protection_service.cc#newcode224 chrome/browser/safe_browsing/download_protection_service.cc:224: base::Bind(callback_, result)); Forgot to move this? :-P
3 years, 10 months ago (2017-01-27 01:40:40 UTC) #27
Jialiu Lin
https://codereview.chromium.org/2647323004/diff/140001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2647323004/diff/140001/chrome/browser/safe_browsing/download_protection_service.cc#newcode224 chrome/browser/safe_browsing/download_protection_service.cc:224: base::Bind(callback_, result)); On 2017/01/27 01:40:40, asanka wrote: > Forgot ...
3 years, 10 months ago (2017-01-27 01:49:51 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/2647323004/260001
3 years, 10 months ago (2017-01-27 19:47:34 UTC) #53
commit-bot: I haz the power
3 years, 10 months ago (2017-01-27 20:52:16 UTC) #56
Message was sent while issue was closed.
Committed patchset #10 (id:260001) as
https://chromium.googlesource.com/chromium/src/+/20d16215e1bd867da6a23887046f...

Powered by Google App Engine
This is Rietveld 408576698