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

Side by Side Diff: chrome/browser/android/offline_pages/background_loader_offliner.h

Issue 2818783002: [Offline pages]: Implement background loader to save on last retry, and record last retry success U… (Closed)
Patch Set: request coordinator update Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/android/application_status_listener.h" 10 #include "base/android/application_status_listener.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void OnApplicationStateChange( 77 void OnApplicationStateChange(
78 base::android::ApplicationState application_state); 78 base::android::ApplicationState application_state);
79 void HandleApplicationStateChangeCancel(const SavePageRequest& request, 79 void HandleApplicationStateChangeCancel(const SavePageRequest& request,
80 int64_t offline_id); 80 int64_t offline_id);
81 81
82 std::unique_ptr<background_loader::BackgroundLoaderContents> loader_; 82 std::unique_ptr<background_loader::BackgroundLoaderContents> loader_;
83 // Not owned. 83 // Not owned.
84 content::BrowserContext* browser_context_; 84 content::BrowserContext* browser_context_;
85 // Not owned. 85 // Not owned.
86 OfflinePageModel* offline_page_model_; 86 OfflinePageModel* offline_page_model_;
87 // Not owned.
88 const OfflinerPolicy* policy_;
87 // Tracks pending request, if any. 89 // Tracks pending request, if any.
88 std::unique_ptr<SavePageRequest> pending_request_; 90 std::unique_ptr<SavePageRequest> pending_request_;
89 // Handles determining when a page should be snapshotted. 91 // Handles determining when a page should be snapshotted.
90 std::unique_ptr<SnapshotController> snapshot_controller_; 92 std::unique_ptr<SnapshotController> snapshot_controller_;
91 // Callback when pending request completes. 93 // Callback when pending request completes.
92 CompletionCallback completion_callback_; 94 CompletionCallback completion_callback_;
93 // Callback to report progress. 95 // Callback to report progress.
94 ProgressCallback progress_callback_; 96 ProgressCallback progress_callback_;
95 // ApplicationStatusListener to monitor if Chrome moves to the foreground. 97 // ApplicationStatusListener to monitor if Chrome moves to the foreground.
96 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_; 98 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_;
97 // Whether we are on a low-end device. 99 // Whether we are on a low-end device.
98 bool is_low_end_device_; 100 bool is_low_end_device_;
99 101
100 // Save state. 102 // Save state.
101 SaveState save_state_; 103 SaveState save_state_;
102 // Page load state. 104 // Page load state.
103 PageLoadState page_load_state_; 105 PageLoadState page_load_state_;
104 // Seconds to delay before taking snapshot. 106 // Seconds to delay before taking snapshot.
105 long page_delay_ms_; 107 long page_delay_ms_;
106 // Network bytes loaded. 108 // Network bytes loaded.
107 int64_t network_bytes_; 109 int64_t network_bytes_;
110 // Whether the low bar has been met.
fgorski 2017/04/14 05:15:57 be more specific about the low bar, please... low
chili 2017/04/15 00:34:58 Done.
111 bool is_low_bar_met_;
112 // Whether the snapshot is on the last retry.
113 bool did_snapshot_on_last_retry_;
108 114
109 // Callback for cancel. 115 // Callback for cancel.
110 CancelCallback cancel_callback_; 116 CancelCallback cancel_callback_;
111 117
112 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; 118 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_;
113 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); 119 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner);
114 }; 120 };
115 121
116 } // namespace offline_pages 122 } // namespace offline_pages
117 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ 123 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698