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

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

Issue 2093113002: Reorder functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 05ce9ffe9f656143119f54df05814fd7d91a7ccf..01cb8bbb8bd72dc7705d0cfbd1d77698bc867cbc 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -77,17 +77,10 @@ void RequestCoordinator::AddRequestResultCallback(
void RequestCoordinator::UpdateRequestCallback(
RequestQueue::UpdateRequestResult result) {}
-// Called by the request picker when a request has been picked.
-void RequestCoordinator::RequestPicked(const SavePageRequest& request) {
- // Send the request on to the offliner.
- SendRequestToOffliner(request);
-}
-
-void RequestCoordinator::RequestQueueEmpty() {
- // Clear the outstanding "safety" task in the scheduler.
- scheduler_->Unschedule();
- // Return control to the scheduler when there is no more to do.
- scheduler_callback_.Run(true);
+void RequestCoordinator::StopProcessing() {
+ is_canceled_ = true;
+ if (offliner_ && is_busy_)
+ offliner_->Cancel();
}
// Returns true if the caller should expect a callback, false otherwise. For
@@ -117,15 +110,17 @@ void RequestCoordinator::TryNextRequest() {
weak_ptr_factory_.GetWeakPtr()));
}
-void RequestCoordinator::StopProcessing() {
- is_canceled_ = true;
- if (offliner_ && is_busy_)
- offliner_->Cancel();
+// Called by the request picker when a request has been picked.
+void RequestCoordinator::RequestPicked(const SavePageRequest& request) {
+ // Send the request on to the offliner.
+ SendRequestToOffliner(request);
}
-Scheduler::TriggerConditions const&
-RequestCoordinator::GetTriggerConditionsForUserRequest() {
- return kUserRequestTriggerConditions;
+void RequestCoordinator::RequestQueueEmpty() {
+ // Clear the outstanding "safety" task in the scheduler.
+ scheduler_->Unschedule();
+ // Return control to the scheduler when there is no more to do.
+ scheduler_callback_.Run(true);
}
void RequestCoordinator::SendRequestToOffliner(const SavePageRequest& request) {
@@ -173,6 +168,11 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
}
}
+Scheduler::TriggerConditions const&
fgorski 2016/06/24 18:39:17 Could you also update the order here to const type
+RequestCoordinator::GetTriggerConditionsForUserRequest() {
+ return kUserRequestTriggerConditions;
+}
+
void RequestCoordinator::GetOffliner() {
if (!offliner_) {
offliner_ = factory_->GetOffliner(policy_.get());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698