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 #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 "components/offline_pages/background/offliner_factory.h" | 9 #include "components/offline_pages/background/offliner_factory.h" |
10 #include "components/offline_pages/background/offliner_policy.h" | 10 #include "components/offline_pages/background/offliner_policy.h" |
11 #include "components/offline_pages/background/save_page_request.h" | 11 #include "components/offline_pages/background/save_page_request.h" |
12 #include "components/offline_pages/offline_page_item.h" | |
12 | 13 |
13 namespace offline_pages { | 14 namespace offline_pages { |
14 | 15 |
15 RequestCoordinator::RequestCoordinator( | 16 RequestCoordinator::RequestCoordinator( |
16 std::unique_ptr<OfflinerPolicy> policy, | 17 std::unique_ptr<OfflinerPolicy> policy, |
17 std::unique_ptr<OfflinerFactory> factory) { | 18 std::unique_ptr<OfflinerFactory> factory) { |
18 // Do setup as needed. | 19 // Do setup as needed. |
19 // TODO(petewil): Assert policy not null. | 20 // TODO(petewil): Assert policy not null. |
20 policy_ = std::move(policy); | 21 policy_ = std::move(policy); |
21 factory_ = std::move(factory); | 22 factory_ = std::move(factory); |
22 } | 23 } |
23 | 24 |
24 RequestCoordinator::~RequestCoordinator() {} | 25 RequestCoordinator::~RequestCoordinator() {} |
25 | 26 |
26 bool RequestCoordinator::SavePageLater(const SavePageRequest& request) { | 27 bool RequestCoordinator::SavePageLater( |
28 const GURL url, const ClientId& client_id) { | |
29 DVLOG(0) << "URL is " << url << " " << __FUNCTION__; | |
jianli
2016/05/06 21:48:05
nit: avoid adding this in production code
Pete Williamson
2016/05/06 23:56:27
Done.
| |
30 | |
31 // TODO(petewil): We need a robust scheme for allocating new IDs. | |
jianli
2016/05/06 21:48:05
Is this comment conflict with ID being passed in?
Pete Williamson
2016/05/06 23:56:27
As it turns out, there are two IDs.
The ClientID i
| |
32 // TODO(petewil): Build a SavePageRequest. | |
33 // TODO(petewil): Put the request on the request queue, nudge the scheduler. | |
34 | |
27 return true; | 35 return true; |
28 } | 36 } |
29 | 37 |
30 bool RequestCoordinator::StartProcessing( | 38 bool RequestCoordinator::StartProcessing( |
31 const ProcessingDoneCallback& callback) { | 39 const ProcessingDoneCallback& callback) { |
32 return false; | 40 return false; |
33 } | 41 } |
34 | 42 |
35 void RequestCoordinator::StopProcessing() { | 43 void RequestCoordinator::StopProcessing() { |
36 } | 44 } |
37 | 45 |
38 } // namespace offline_pages | 46 } // namespace offline_pages |
OLD | NEW |