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

Side by Side Diff: components/offline_pages/background/request_coordinator.cc

Issue 2054913002: hook up background task's "startProcessing" from Java to request_coordinator (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 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 #include "components/offline_pages/background/request_coordinator.h" 5 #include "components/offline_pages/background/request_coordinator.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 RequestQueue::AddRequestResult result, 62 RequestQueue::AddRequestResult result,
63 const SavePageRequest& request) { 63 const SavePageRequest& request) {
64 64
65 // Inform the scheduler that we have an outstanding task. 65 // Inform the scheduler that we have an outstanding task.
66 // TODO(petewil): Define proper TriggerConditions and set them. 66 // TODO(petewil): Define proper TriggerConditions and set them.
67 Scheduler::TriggerCondition conditions; 67 Scheduler::TriggerCondition conditions;
68 scheduler_->Schedule(conditions); 68 scheduler_->Schedule(conditions);
69 } 69 }
70 70
71 void RequestCoordinator::RequestPicked(const SavePageRequest& request) { 71 void RequestCoordinator::RequestPicked(const SavePageRequest& request) {
72 Scheduler::TriggerCondition conditions;
73
74 // Inform the scheduler that we have an outstanding task.
dougarnett 2016/06/09 21:54:27 thought this comment wording was confusing - the s
Pete Williamson 2016/06/09 22:09:48 No, this is really about ensuring that the current
dougarnett 2016/06/09 22:27:05 Hmm, not sure I understand your response. Might be
Pete Williamson 2016/06/09 22:30:17 I was thinking that we might also get here via an
75 scheduler_->Schedule(conditions);
76
72 // Send the request on to the offliner. 77 // Send the request on to the offliner.
73 SendRequestToOffliner(request); 78 SendRequestToOffliner(request);
74 } 79 }
75 80
76 void RequestCoordinator::RequestQueueEmpty() { 81 void RequestCoordinator::RequestQueueEmpty() {
77 // TODO(petewil): return to the BackgroundScheduler by calling 82 // TODO(petewil): return to the BackgroundScheduler by calling
78 // ProcessingDoneCallback 83 // ProcessingDoneCallback
79 } 84 }
80 85
81 bool RequestCoordinator::StartProcessing( 86 bool RequestCoordinator::StartProcessing(
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 << __FUNCTION__; 124 << __FUNCTION__;
120 last_offlining_status_ = status; 125 last_offlining_status_ = status;
121 126
122 // TODO(petewil): Check time budget. Start a request if we have time, return 127 // TODO(petewil): Check time budget. Start a request if we have time, return
123 // to the scheduler if we are out of time. 128 // to the scheduler if we are out of time.
124 129
125 // TODO(petewil): If the request succeeded, remove it from the Queue. 130 // TODO(petewil): If the request succeeded, remove it from the Queue.
126 } 131 }
127 132
128 } // namespace offline_pages 133 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698