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

Unified Diff: chrome/browser/android/offline_pages/background_loader_offliner.h

Issue 2748053004: [Offline Pages] Allow BackgroundLoader to track network bytes using prerenderer hook-in. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/background_loader_offliner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/background_loader_offliner.h
diff --git a/chrome/browser/android/offline_pages/background_loader_offliner.h b/chrome/browser/android/offline_pages/background_loader_offliner.h
index 4dcd598ba9599177f27d29f1c6240abe3ca5d467..7bf38d61d1a882250e000daf9d5988ccbb0064e5 100644
--- a/chrome/browser/android/offline_pages/background_loader_offliner.h
+++ b/chrome/browser/android/offline_pages/background_loader_offliner.h
@@ -34,6 +34,9 @@ class BackgroundLoaderOffliner : public Offliner,
OfflinePageModel* offline_page_model);
~BackgroundLoaderOffliner() override;
+ static BackgroundLoaderOffliner* FromWebContents(
+ content::WebContents* contents);
+
// Offliner implementation.
bool LoadAndSave(const SavePageRequest& request,
const CompletionCallback& completion_callback,
@@ -49,6 +52,7 @@ class BackgroundLoaderOffliner : public Offliner,
content::NavigationHandle* navigation_handle) override;
void SetPageDelayForTest(long delay_ms);
+ void OnNetworkBytesChanged(int64_t bytes);
protected:
// Called to reset internal loader and observer state.
@@ -81,6 +85,8 @@ class BackgroundLoaderOffliner : public Offliner,
std::unique_ptr<SavePageRequest> pending_request_;
// Callback when pending request completes.
CompletionCallback completion_callback_;
+ // Callback to report progress.
+ ProgressCallback progress_callback_;
// ApplicationStatusListener to monitor if Chrome moves to the foreground.
std::unique_ptr<base::android::ApplicationStatusListener> app_listener_;
// Whether we are on a low-end device.
@@ -92,6 +98,8 @@ class BackgroundLoaderOffliner : public Offliner,
PageLoadState page_load_state_;
// Seconds to delay before taking snapshot.
long page_delay_ms_;
+ // Network bytes loaded.
+ int64_t network_bytes_;
// Callback for cancel.
CancelCallback cancel_callback_;
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/background_loader_offliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698