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

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

Issue 2438503003: [Offline pages] Add MarkAttemptAbortedTask to Request Queue (Closed)
Patch Set: Addressing feedback -- adding comments and documentation 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 #include <vector> 10 #include <vector>
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 // Records an aborted attempt for the request and update it in the queue 305 // Records an aborted attempt for the request and update it in the queue
306 // (possibly removing it). Returns the updated copy. 306 // (possibly removing it). Returns the updated copy.
307 void AbortRequestAttempt(SavePageRequest* request); 307 void AbortRequestAttempt(SavePageRequest* request);
308 308
309 // Remove the attempted request from the queue with status to pass through to 309 // Remove the attempted request from the queue with status to pass through to
310 // any observers and UMA histogram. 310 // any observers and UMA histogram.
311 void RemoveAttemptedRequest(const SavePageRequest& request, 311 void RemoveAttemptedRequest(const SavePageRequest& request,
312 BackgroundSavePageResult status); 312 BackgroundSavePageResult status);
313 313
314 // Completes aborting the request, reports an error if it fails.
315 void MarkAttemptAbortedDone(int64_t request_id,
316 const ClientId& client_id,
317 std::unique_ptr<UpdateRequestsResult> result);
318
314 // Returns the appropriate offliner to use, getting a new one from the factory 319 // Returns the appropriate offliner to use, getting a new one from the factory
315 // if needed. 320 // if needed.
316 void GetOffliner(); 321 void GetOffliner();
317 322
318 // Method to wrap calls to getting the connection type so it can be 323 // Method to wrap calls to getting the connection type so it can be
319 // changed for tests. 324 // changed for tests.
320 net::NetworkChangeNotifier::ConnectionType GetConnectionType(); 325 net::NetworkChangeNotifier::ConnectionType GetConnectionType();
321 326
322 void SetNetworkConditionsForTest( 327 void SetNetworkConditionsForTest(
323 net::NetworkChangeNotifier::ConnectionType connection) { 328 net::NetworkChangeNotifier::ConnectionType connection) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 base::Callback<void(bool)> immediate_schedule_callback_; 391 base::Callback<void(bool)> immediate_schedule_callback_;
387 // Allows us to pass a weak pointer to callbacks. 392 // Allows us to pass a weak pointer to callbacks.
388 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; 393 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_;
389 394
390 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); 395 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator);
391 }; 396 };
392 397
393 } // namespace offline_pages 398 } // namespace offline_pages
394 399
395 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ 400 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698