Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/android/offline_pages/test_offline_page_model_builder.h " | 5 #include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h " |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | |
| 10 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 11 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 12 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
| 13 #include "components/offline_pages/offline_page_model.h" | 14 #include "components/offline_pages/offline_page_model.h" |
| 14 #include "components/offline_pages/offline_page_test_store.h" | 15 #include "components/offline_pages/offline_page_test_store.h" |
| 15 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
| 16 | 17 |
| 18 namespace rappor { | |
| 19 class RapporService; | |
|
fgorski
2016/05/13 17:49:17
this is a .cc file. Why do you forward declare thi
| |
| 20 } | |
| 21 | |
| 17 namespace offline_pages { | 22 namespace offline_pages { |
| 18 | 23 |
| 19 std::unique_ptr<KeyedService> BuildTestOfflinePageModel( | 24 std::unique_ptr<KeyedService> BuildTestOfflinePageModel( |
| 20 content::BrowserContext* context) { | 25 content::BrowserContext* context) { |
| 21 scoped_refptr<base::SingleThreadTaskRunner> task_runner = | 26 scoped_refptr<base::SingleThreadTaskRunner> task_runner = |
| 22 base::ThreadTaskRunnerHandle::Get(); | 27 base::ThreadTaskRunnerHandle::Get(); |
| 23 | 28 |
| 24 std::unique_ptr<OfflinePageTestStore> metadata_store( | 29 std::unique_ptr<OfflinePageTestStore> metadata_store( |
| 25 new OfflinePageTestStore(task_runner)); | 30 new OfflinePageTestStore(task_runner)); |
| 26 | 31 |
| 27 base::FilePath archives_dir = | 32 base::FilePath archives_dir = |
| 28 context->GetPath().Append(chrome::kOfflinePageArchviesDirname); | 33 context->GetPath().Append(chrome::kOfflinePageArchviesDirname); |
| 29 | 34 |
| 30 return std::unique_ptr<KeyedService>(new OfflinePageModel( | 35 return std::unique_ptr<KeyedService>(new OfflinePageModel( |
| 31 std::move(metadata_store), archives_dir, task_runner)); | 36 std::move(metadata_store), archives_dir, |
| 37 base::WeakPtr<rappor::RapporService>(), task_runner)); | |
| 32 } | 38 } |
| 33 | 39 |
| 34 } // namespace offline_pages | 40 } // namespace offline_pages |
| OLD | NEW |