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

Issue 2736843002: Fix the Download Notifications for Offline Pages to indicate bytes loaded. (Closed)

Created:
3 years, 9 months ago by Dmitry Titov
Modified:
3 years, 9 months ago
Reviewers:
qinmin, fgorski
CC:
chromium-reviews, asanka, dewittj+watch_chromium.org, fgorski+watch_chromium.org, romax+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, agrieve+watch_chromium.org, dimich+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix the Download Notifications for Offline Pages to indicate bytes loaded. This wires the UpdateProgress call from PrerenderingOffliner via DownloadUIAdapter to the DownloadNotifyingObserver. As a result, the Android notifications about ongoing Offline Page downloads start to be updated with a real byte count. BUG=698020 Review-Url: https://codereview.chromium.org/2736843002 Cr-Commit-Position: refs/heads/master@{#455486} Committed: https://chromium.googlesource.com/chromium/src/+/0e2f6cb4e64a3d6c251e9aa782927cffb829a5d3

Patch Set 1 #

Total comments: 2

Patch Set 2 : cr feedback and improved routing of callbacks #

Patch Set 3 : fix typo #

Total comments: 9

Patch Set 4 : cr feedback, fix build test #

Patch Set 5 : a final test fix (hopefully) #

Patch Set 6 : more fixes to more tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -90 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java View 1 2 3 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/browser/android/offline_pages/background_loader_offliner.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/android/offline_pages/background_loader_offliner.cc View 1 2 chunks +8 lines, -4 lines 0 comments Download
M chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc View 1 2 3 4 5 17 chunks +39 lines, -16 lines 0 comments Download
M chrome/browser/android/offline_pages/downloads/offline_page_notification_bridge.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/prerendering_offliner.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/android/offline_pages/prerendering_offliner.cc View 1 4 5 3 chunks +8 lines, -9 lines 0 comments Download
M chrome/browser/android/offline_pages/prerendering_offliner_unittest.cc View 1 2 3 4 5 20 chunks +43 lines, -18 lines 0 comments Download
M components/offline_pages/core/background/cleanup_task_unittest.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M components/offline_pages/core/background/offliner.h View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M components/offline_pages/core/background/offliner_stub.h View 1 2 chunks +4 lines, -2 lines 0 comments Download
M components/offline_pages/core/background/offliner_stub.cc View 1 2 chunks +11 lines, -6 lines 0 comments Download
M components/offline_pages/core/background/pick_request_task_unittest.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M components/offline_pages/core/background/request_coordinator.h View 1 3 chunks +9 lines, -0 lines 0 comments Download
M components/offline_pages/core/background/request_coordinator.cc View 1 3 chunks +16 lines, -0 lines 0 comments Download
M components/offline_pages/core/background/request_coordinator_unittest.cc View 1 2 3 5 chunks +21 lines, -0 lines 0 comments Download
M components/offline_pages/core/background/request_notifier.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M components/offline_pages/core/background/request_queue_unittest.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M components/offline_pages/core/downloads/download_notifying_observer.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M components/offline_pages/core/downloads/download_notifying_observer.cc View 1 1 chunk +8 lines, -0 lines 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter.cc View 1 2 chunks +16 lines, -13 lines 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter_unittest.cc View 1 2 3 4 3 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 34 (26 generated)
Dmitry Titov
PTAL: fgorski: Offline pages, overall qinmin: DownloadNotificationService.java
3 years, 9 months ago (2017-03-07 00:04:26 UTC) #4
qinmin
lgtm % comment https://codereview.chromium.org/2736843002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java File chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java (right): https://codereview.chromium.org/2736843002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java#newcode502 chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java:502: || isDownloadPending || isOfflinePage; rather than ...
3 years, 9 months ago (2017-03-07 07:06:32 UTC) #8
Dmitry Titov
Changed a bit the routing of the network progress. The previous variant only worked when ...
3 years, 9 months ago (2017-03-07 21:58:07 UTC) #13
fgorski
lgtm mod compilation issues and a few comments. https://codereview.chromium.org/2736843002/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java File chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java (right): https://codereview.chromium.org/2736843002/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java#newcode19 chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java:19: public ...
3 years, 9 months ago (2017-03-07 22:26:43 UTC) #16
Dmitry Titov
https://codereview.chromium.org/2736843002/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java File chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java (right): https://codereview.chromium.org/2736843002/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java#newcode19 chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java:19: public static final int INVALID_DOWNLOAD_PERCENTAGE = -1; On 2017/03/07 ...
3 years, 9 months ago (2017-03-08 00:47:38 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/2736843002/100001
3 years, 9 months ago (2017-03-08 17:37:43 UTC) #30
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/0e2f6cb4e64a3d6c251e9aa782927cffb829a5d3
3 years, 9 months ago (2017-03-08 17:44:48 UTC) #33
fgorski
3 years, 9 months ago (2017-03-08 17:46:24 UTC) #34
Message was sent while issue was closed.
still lgtm and glad it landed

https://codereview.chromium.org/2736843002/diff/40001/chrome/browser/android/...
File chrome/browser/android/offline_pages/prerendering_offliner.cc (right):

https://codereview.chromium.org/2736843002/diff/40001/chrome/browser/android/...
chrome/browser/android/offline_pages/prerendering_offliner.cc:201:
pending_request_.reset(nullptr);
On 2017/03/08 00:47:38, Dmitry Titov wrote:
> On 2017/03/07 22:26:43, fgorski wrote:
> > note: it seems like we could reset both callbacks as well, when we reset
> > pending_request_ (as in: let's not keep stuff around we could accidentally
> > call).
> 
> Couple of reasons I think it probably should stay as it is:
> 
> - there is no good way to reset it other than to assign another copy of an
empty
> callback, like = base::Bind([] {}); which looks weird...
> 
> - there are multiple places here that only reset the request, and most of
those
> should not reset callbacks,at least at first look. It would be indeed good to
> reset all 'pending request state' at right moments but a bigger/more careful
> change is required for that.

Makes sense. Thanks for looking into it.

Powered by Google App Engine
This is Rietveld 408576698