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

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

Issue 2416083002: [Offline pages] Introduction of MarkAttemptStartedTask with tests (Closed)
Patch Set: 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 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 COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // Callback from the request picker when no more requests are in the queue. 258 // Callback from the request picker when no more requests are in the queue.
259 // The parameter is a signal for what (if any) conditions to schedule future 259 // The parameter is a signal for what (if any) conditions to schedule future
260 // processing for. 260 // processing for.
261 void RequestNotPicked(bool non_user_requested_tasks_remaining); 261 void RequestNotPicked(bool non_user_requested_tasks_remaining);
262 262
263 void HandleWatchdogTimeout(); 263 void HandleWatchdogTimeout();
264 264
265 // Cancels an in progress pre-rendering, and updates state appropriately. 265 // Cancels an in progress pre-rendering, and updates state appropriately.
266 void StopPrerendering(Offliner::RequestStatus stop_status); 266 void StopPrerendering(Offliner::RequestStatus stop_status);
267 267
268 // Marks attempt on the request and sends it to offliner in continuation.
268 void SendRequestToOffliner(const SavePageRequest& request); 269 void SendRequestToOffliner(const SavePageRequest& request);
Pete Williamson 2016/10/14 17:02:35 Should this be another task to both mark started a
dougarnett 2016/10/14 20:12:31 But I don't think this does any other queue/store
fgorski 2016/10/14 20:37:19 No, because right now we are not planning to seria
269 270
271 // Continuation of |SendRequestToOffliner| after the request is marked as
272 // started.
273 void StartOffliner(int64_t request_id,
274 const std::string& client_namespace,
275 std::unique_ptr<UpdateRequestsResult> update_result);
276
270 // Called by the offliner when an offlining request is completed. (and by 277 // Called by the offliner when an offlining request is completed. (and by
271 // tests). 278 // tests).
272 void OfflinerDoneCallback(const SavePageRequest& request, 279 void OfflinerDoneCallback(const SavePageRequest& request,
273 Offliner::RequestStatus status); 280 Offliner::RequestStatus status);
274 281
275 void TryNextRequest(); 282 void TryNextRequest();
276 283
277 // If there is an active request in the list, cancel that request. 284 // If there is an active request in the list, cancel that request.
278 bool CancelActiveRequestIfItMatches(const std::vector<int64_t>& request_ids); 285 bool CancelActiveRequestIfItMatches(const std::vector<int64_t>& request_ids);
279 286
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 base::TimeDelta offliner_timeout_; 372 base::TimeDelta offliner_timeout_;
366 // Allows us to pass a weak pointer to callbacks. 373 // Allows us to pass a weak pointer to callbacks.
367 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; 374 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_;
368 375
369 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); 376 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator);
370 }; 377 };
371 378
372 } // namespace offline_pages 379 } // namespace offline_pages
373 380
374 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ 381 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698