| OLD | NEW |
| 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 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 OfflineEventLogger* GetLogger() { | 98 OfflineEventLogger* GetLogger() { |
| 99 return &event_logger_; | 99 return &event_logger_; |
| 100 } | 100 } |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 void AddRequestResultCallback(RequestQueue::AddRequestResult result, | 103 void AddRequestResultCallback(RequestQueue::AddRequestResult result, |
| 104 const SavePageRequest& request); | 104 const SavePageRequest& request); |
| 105 | 105 |
| 106 void UpdateRequestCallback(RequestQueue::UpdateRequestResult result); | 106 void UpdateRequestCallback(const ClientId& client_id, |
| 107 RequestQueue::UpdateRequestResult result); |
| 108 |
| 109 void UpdateMultipleRequestCallback(RequestQueue::UpdateRequestResult result); |
| 107 | 110 |
| 108 // Callback from the request picker when it has chosen our next request. | 111 // Callback from the request picker when it has chosen our next request. |
| 109 void RequestPicked(const SavePageRequest& request); | 112 void RequestPicked(const SavePageRequest& request); |
| 110 | 113 |
| 111 // Callback from the request picker when no more requests are in the queue. | 114 // Callback from the request picker when no more requests are in the queue. |
| 112 void RequestQueueEmpty(); | 115 void RequestQueueEmpty(); |
| 113 | 116 |
| 114 void SendRequestToOffliner(const SavePageRequest& request); | 117 void SendRequestToOffliner(const SavePageRequest& request); |
| 115 | 118 |
| 116 // Called by the offliner when an offlining request is completed. (and by | 119 // Called by the offliner when an offlining request is completed. (and by |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 base::TimeDelta offliner_timeout_; | 170 base::TimeDelta offliner_timeout_; |
| 168 // Allows us to pass a weak pointer to callbacks. | 171 // Allows us to pass a weak pointer to callbacks. |
| 169 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; | 172 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; |
| 170 | 173 |
| 171 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); | 174 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); |
| 172 }; | 175 }; |
| 173 | 176 |
| 174 } // namespace offline_pages | 177 } // namespace offline_pages |
| 175 | 178 |
| 176 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 179 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| OLD | NEW |