OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/core/prefetch/prefetch_service_impl.h" | 5 #include "components/offline_pages/core/prefetch/prefetch_service_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | |
10 #include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h" | 9 #include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h" |
11 | 10 |
12 namespace offline_pages { | 11 namespace offline_pages { |
13 | 12 |
14 PrefetchServiceImpl::PrefetchServiceImpl() | 13 PrefetchServiceImpl::PrefetchServiceImpl( |
15 : dispatcher_(base::MakeUnique<PrefetchDispatcherImpl>()) {} | 14 std::unique_ptr<PrefetchStore> store, |
| 15 std::unique_ptr<PrefetchDispatcher> dispatcher) |
| 16 : store_(std::move(store)), dispatcher_(std::move(dispatcher)) { |
| 17 dispatcher_->SetService(this); |
| 18 } |
16 | 19 |
17 PrefetchServiceImpl::~PrefetchServiceImpl() = default; | 20 PrefetchServiceImpl::~PrefetchServiceImpl() = default; |
18 | 21 |
19 PrefetchDispatcher* PrefetchServiceImpl::GetDispatcher() { | 22 PrefetchDispatcher* PrefetchServiceImpl::GetDispatcher() { |
20 return dispatcher_.get(); | 23 return dispatcher_.get(); |
21 }; | 24 }; |
22 | 25 |
| 26 PrefetchStore* PrefetchServiceImpl::GetStore() { |
| 27 return store_.get(); |
| 28 }; |
| 29 |
23 void PrefetchServiceImpl::Shutdown() {} | 30 void PrefetchServiceImpl::Shutdown() {} |
24 | 31 |
25 } // namespace offline_pages | 32 } // namespace offline_pages |
OLD | NEW |