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

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

Issue 2266323002: Cancel prerendering when a request is paused or removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename flag Created 4 years, 4 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 | components/offline_pages/background/request_coordinator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/background/request_coordinator.h
diff --git a/components/offline_pages/background/request_coordinator.h b/components/offline_pages/background/request_coordinator.h
index 2b874332bc58508c60d21a306186a16b792aed2c..276836163296839a0266cbdaf73d1f2344d1740a 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -138,7 +138,7 @@ class RequestCoordinator : public KeyedService, public RequestNotifier {
// Tracks whether the last offlining attempt got canceled. This is reset by
// the next StartProcessing() call.
bool is_canceled() {
- return is_canceled_;
+ return is_stopped_;
}
OfflineEventLogger* GetLogger() {
@@ -174,6 +174,9 @@ class RequestCoordinator : public KeyedService, public RequestNotifier {
// Callback from the request picker when no more requests are in the queue.
void RequestQueueEmpty();
+ // Cancels an in progress pre-rendering, and updates state appropriately.
+ void StopPrerendering();
+
void SendRequestToOffliner(const SavePageRequest& request);
// Called by the offliner when an offlining request is completed. (and by
@@ -183,6 +186,9 @@ class RequestCoordinator : public KeyedService, public RequestNotifier {
void TryNextRequest();
+ // If there is an active request in the list, cancel that request.
+ bool CancelActiveRequestIfItMatches(const std::vector<int64_t>& request_ids);
+
// Returns the appropriate offliner to use, getting a new one from the factory
// if needed.
void GetOffliner();
@@ -202,7 +208,7 @@ class RequestCoordinator : public KeyedService, public RequestNotifier {
// use.
bool is_busy_;
// True if the current request has been canceled.
- bool is_canceled_;
+ bool is_stopped_;
// Unowned pointer to the current offliner, if any.
Offliner* offliner_;
base::Time operation_start_time_;
« no previous file with comments | « no previous file | components/offline_pages/background/request_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698