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

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

Issue 2395903002: API changes to support suspending requests (Closed)
Patch Set: Keep the JS with a boolean instead of forcing a double. Created 4 years, 2 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/background/request_coordinator.cc
diff --git a/components/offline_pages/background/request_coordinator.cc b/components/offline_pages/background/request_coordinator.cc
index 8aae54cfb739b5b3eadb46cd7abc254bd0ee4f1a..dcec816585dc7c0dcbe66d4efb2a6eb5ac06a5e6 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -105,13 +105,15 @@ RequestCoordinator::RequestCoordinator(
RequestCoordinator::~RequestCoordinator() {}
-bool RequestCoordinator::SavePageLater(
- const GURL& url, const ClientId& client_id, bool user_requested) {
+int64_t RequestCoordinator::SavePageLater(const GURL& url,
+ const ClientId& client_id,
+ bool user_requested,
+ RequestAvailability availability) {
DVLOG(2) << "URL is " << url << " " << __func__;
if (!OfflinePageModel::CanSaveURL(url)) {
DVLOG(1) << "Not able to save page for requested url: " << url;
- return false;
+ return 0L;
}
int64_t id = GenerateOfflineId();
@@ -124,7 +126,7 @@ bool RequestCoordinator::SavePageLater(
queue_->AddRequest(request,
base::Bind(&RequestCoordinator::AddRequestResultCallback,
weak_ptr_factory_.GetWeakPtr()));
- return true;
+ return id;
}
void RequestCoordinator::GetAllRequests(const GetRequestsCallback& callback) {
// Get all matching requests from the request queue, send them to our
@@ -563,6 +565,10 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
}
}
+void RequestCoordinator::EnableForOffliner(int64_t request_id) {}
+
+void RequestCoordinator::MarkRequestCompleted(int64_t request_id) {}
+
const Scheduler::TriggerConditions RequestCoordinator::GetTriggerConditions(
const bool user_requested) {
return Scheduler::TriggerConditions(

Powered by Google App Engine
This is Rietveld 408576698