| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/safe_browsing/incident_reporting/last_download_finder.h
" | 5 #include "chrome/browser/safe_browsing/incident_reporting/last_download_finder.h
" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 profile->GetPath().Append(history::kHistoryFilename)); | 64 profile->GetPath().Append(history::kHistoryFilename)); |
| 65 if (!base::DeleteFile(history_path, false) || | 65 if (!base::DeleteFile(history_path, false) || |
| 66 base::PathExists(history_path)) { | 66 base::PathExists(history_path)) { |
| 67 ADD_FAILURE() << "failed to delete history db file " | 67 ADD_FAILURE() << "failed to delete history db file " |
| 68 << history_path.value(); | 68 << history_path.value(); |
| 69 return nullptr; | 69 return nullptr; |
| 70 } | 70 } |
| 71 | 71 |
| 72 std::unique_ptr<history::HistoryService> history_service( | 72 std::unique_ptr<history::HistoryService> history_service( |
| 73 new history::HistoryService( | 73 new history::HistoryService( |
| 74 base::WrapUnique(new ChromeHistoryClient( | 74 base::MakeUnique<ChromeHistoryClient>( |
| 75 BookmarkModelFactory::GetForBrowserContext(profile))), | 75 BookmarkModelFactory::GetForBrowserContext(profile)), |
| 76 std::unique_ptr<history::VisitDelegate>())); | 76 std::unique_ptr<history::VisitDelegate>())); |
| 77 if (history_service->Init( | 77 if (history_service->Init( |
| 78 history::HistoryDatabaseParamsForPath(profile->GetPath()))) { | 78 history::HistoryDatabaseParamsForPath(profile->GetPath()))) { |
| 79 return std::move(history_service); | 79 return std::move(history_service); |
| 80 } | 80 } |
| 81 | 81 |
| 82 ADD_FAILURE() << "failed to initialize history service"; | 82 ADD_FAILURE() << "failed to initialize history service"; |
| 83 return nullptr; | 83 return nullptr; |
| 84 } | 84 } |
| 85 | 85 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 base::Bind(&LastDownloadFinderTest::OnLastDownload, | 463 base::Bind(&LastDownloadFinderTest::OnLastDownload, |
| 464 base::Unretained(this), &last_binary_download, | 464 base::Unretained(this), &last_binary_download, |
| 465 &last_non_binary_download, run_loop.QuitClosure()))); | 465 &last_non_binary_download, run_loop.QuitClosure()))); |
| 466 | 466 |
| 467 run_loop.Run(); | 467 run_loop.Run(); |
| 468 | 468 |
| 469 ASSERT_TRUE(last_binary_download); | 469 ASSERT_TRUE(last_binary_download); |
| 470 } | 470 } |
| 471 | 471 |
| 472 } // namespace safe_browsing | 472 } // namespace safe_browsing |
| OLD | NEW |