| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/safe_browsing_store_file.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_store_file.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
| 11 #include "base/md5.h" | 11 #include "base/md5.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/metrics/sparse_histogram.h" | 13 #include "base/metrics/sparse_histogram.h" |
| 14 #include "components/safe_browsing_db/prefix_set.h" | 14 #include "components/safe_browsing_db/prefix_set.h" |
| 15 | 15 |
| 16 namespace safe_browsing { | 16 namespace safe_browsing { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 // NOTE(shess): kFileMagic should not be a byte-wise palindrome, so | 20 // NOTE(shess): kFileMagic should not be a byte-wise palindrome, so |
| 21 // that byte-order changes force corruption. | 21 // that byte-order changes force corruption. |
| 22 const int32_t kFileMagic = 0x600D71FE; | 22 const int32_t kFileMagic = 0x600D71FE; |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 // also removed. | 1163 // also removed. |
| 1164 const base::FilePath journal_filename( | 1164 const base::FilePath journal_filename( |
| 1165 basename.value() + FILE_PATH_LITERAL("-journal")); | 1165 basename.value() + FILE_PATH_LITERAL("-journal")); |
| 1166 if (base::PathExists(journal_filename)) | 1166 if (base::PathExists(journal_filename)) |
| 1167 base::DeleteFile(journal_filename, false); | 1167 base::DeleteFile(journal_filename, false); |
| 1168 | 1168 |
| 1169 return true; | 1169 return true; |
| 1170 } | 1170 } |
| 1171 | 1171 |
| 1172 } // namespace safe_browsing | 1172 } // namespace safe_browsing |
| OLD | NEW |