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

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

Issue 2714733003: [Offline Pages] Add a timer to BackgroundLoaderOffliner to delay SavePage by 2 seconds. (Closed)
Patch Set: fix tests and last comment Created 3 years, 10 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 f9c9002c9112a082a4c785002dafe4f6b4e0aad1..952f079402f5bec14f277890e2c5989dabf3cdee 100644
--- a/chrome/browser/android/offline_pages/background_loader_offliner.h
+++ b/chrome/browser/android/offline_pages/background_loader_offliner.h
@@ -46,6 +46,8 @@ class BackgroundLoaderOffliner : public Offliner,
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
+ void SetPageDelayForTest(long delay_ms);
+
protected:
// Called to reset internal loader and observer state.
virtual void ResetState();
@@ -56,6 +58,9 @@ class BackgroundLoaderOffliner : public Offliner,
enum SaveState { NONE, SAVING, DELETE_AFTER_SAVE };
enum PageLoadState { SUCCESS, RETRIABLE, NONRETRIABLE };
+ // Called when the page is ready to be saved.
+ void SavePage();
+
// Called when the page has been saved.
void OnPageSaved(SavePageResult save_result, int64_t offline_id);
@@ -80,6 +85,8 @@ class BackgroundLoaderOffliner : public Offliner,
SaveState save_state_;
// Page load state.
PageLoadState page_load_state_;
+ // Seconds to delay before taking snapshot.
+ long page_delay_ms_;
base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner);
« 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