| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 if (!base::DeleteFile(history_path, false) || | 50 if (!base::DeleteFile(history_path, false) || |
| 51 base::PathExists(history_path)) { | 51 base::PathExists(history_path)) { |
| 52 ADD_FAILURE() << "failed to delete history db file " | 52 ADD_FAILURE() << "failed to delete history db file " |
| 53 << history_path.value(); | 53 << history_path.value(); |
| 54 return NULL; | 54 return NULL; |
| 55 } | 55 } |
| 56 | 56 |
| 57 HistoryService* history_service = new HistoryService( | 57 HistoryService* history_service = new HistoryService( |
| 58 ChromeHistoryClientFactory::GetForProfile(profile), profile); | 58 ChromeHistoryClientFactory::GetForProfile(profile), profile); |
| 59 if (history_service->Init( | 59 if (history_service->Init( |
| 60 profile->GetPrefs(), |
| 60 history::HistoryDatabaseParamsForPath(profile->GetPath()))) { | 61 history::HistoryDatabaseParamsForPath(profile->GetPath()))) { |
| 61 return history_service; | 62 return history_service; |
| 62 } | 63 } |
| 63 | 64 |
| 64 ADD_FAILURE() << "failed to initialize history service"; | 65 ADD_FAILURE() << "failed to initialize history service"; |
| 65 delete history_service; | 66 delete history_service; |
| 66 return NULL; | 67 return NULL; |
| 67 } | 68 } |
| 68 | 69 |
| 69 } // namespace | 70 } // namespace |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 base::Unretained(this), | 343 base::Unretained(this), |
| 343 &last_download, | 344 &last_download, |
| 344 run_loop.QuitClosure()))); | 345 run_loop.QuitClosure()))); |
| 345 | 346 |
| 346 run_loop.Run(); | 347 run_loop.Run(); |
| 347 | 348 |
| 348 ExpectFoundTestDownload(last_download.Pass()); | 349 ExpectFoundTestDownload(last_download.Pass()); |
| 349 } | 350 } |
| 350 | 351 |
| 351 } // namespace safe_browsing | 352 } // namespace safe_browsing |
| OLD | NEW |