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

Unified Diff: components/offline_pages/core/background/request_coordinator.h

Issue 2736843002: Fix the Download Notifications for Offline Pages to indicate bytes loaded. (Closed)
Patch Set: more fixes to more tests. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/core/background/request_coordinator.h
diff --git a/components/offline_pages/core/background/request_coordinator.h b/components/offline_pages/core/background/request_coordinator.h
index 770cae3a8f1cd7595a44091e120efbc01741d914..d4b91009ebd52adadba5218bf41f340e8d507fc4 100644
--- a/components/offline_pages/core/background/request_coordinator.h
+++ b/components/offline_pages/core/background/request_coordinator.h
@@ -53,6 +53,8 @@ class RequestCoordinator : public KeyedService,
const SavePageRequest& request,
RequestNotifier::BackgroundSavePageResult status) = 0;
virtual void OnChanged(const SavePageRequest& request) = 0;
+ virtual void OnNetworkProgress(const SavePageRequest& request,
+ int64_t received_bytes) = 0;
};
enum class RequestAvailability {
@@ -184,6 +186,8 @@ class RequestCoordinator : public KeyedService,
const SavePageRequest& request,
RequestNotifier::BackgroundSavePageResult status) override;
void NotifyChanged(const SavePageRequest& request) override;
+ void NotifyNetworkProgress(const SavePageRequest& request,
+ int64_t received_bytes) override;
// Returns the request queue used for requests. Coordinator keeps ownership.
RequestQueue* queue() { return queue_.get(); }
@@ -346,6 +350,11 @@ class RequestCoordinator : public KeyedService,
void OfflinerDoneCallback(const SavePageRequest& request,
Offliner::RequestStatus status);
+ // Called by the offliner periodically to report the accumulated count of
+ // bytes received from the network.
+ void OfflinerProgressCallback(const SavePageRequest& request,
+ int64_t received_bytes);
+
// Records a completed attempt for the request and update it in the queue
// (possibly removing it).
void UpdateRequestForCompletedAttempt(const SavePageRequest& request,

Powered by Google App Engine
This is Rietveld 408576698