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

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

Issue 2030773002: Add unit tests for the Background Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable flaky test 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
« no previous file with comments | « components/offline_pages/background/request_coordinator_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PICKER_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_PICKER_H_
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_PICKER_H_ 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_PICKER_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "components/offline_pages/background/request_coordinator.h" 9 #include "components/offline_pages/background/request_coordinator.h"
10 #include "components/offline_pages/background/request_queue.h" 10 #include "components/offline_pages/background/request_queue.h"
11 11
12 namespace offline_pages { 12 namespace offline_pages {
13
14 class RequestPicker { 13 class RequestPicker {
15 public: 14 public:
16 RequestPicker(RequestQueue* requestQueue); 15 RequestPicker(RequestQueue* requestQueue);
17 16
18 ~RequestPicker(); 17 ~RequestPicker();
19 18
20 // Choose which request we should process next based on the current 19 // Choose which request we should process next based on the current
21 // conditions, and call back to the RequestCoordinator when we have one. 20 // conditions, and call back to the RequestCoordinator when we have one.
22 void ChooseNextRequest( 21 void ChooseNextRequest(
23 RequestCoordinator::RequestPickedCallback picked_callback, 22 RequestCoordinator::RequestPickedCallback picked_callback,
(...skipping 10 matching lines...) Expand all
34 RequestCoordinator::RequestPickedCallback picked_callback_; 33 RequestCoordinator::RequestPickedCallback picked_callback_;
35 // Callback for when there are no more reqeusts to pick. 34 // Callback for when there are no more reqeusts to pick.
36 RequestCoordinator::RequestQueueEmptyCallback empty_callback_; 35 RequestCoordinator::RequestQueueEmptyCallback empty_callback_;
37 // Allows us to pass a weak pointer to callbacks. 36 // Allows us to pass a weak pointer to callbacks.
38 base::WeakPtrFactory<RequestPicker> weak_ptr_factory_; 37 base::WeakPtrFactory<RequestPicker> weak_ptr_factory_;
39 }; 38 };
40 39
41 } // namespace offline_pages 40 } // namespace offline_pages
42 41
43 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_PICKER_H_ 42 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_PICKER_H_
OLDNEW
« no previous file with comments | « components/offline_pages/background/request_coordinator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698