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_database.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_database.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Filename suffix for the unwanted software blacklist store. | 66 // Filename suffix for the unwanted software blacklist store. |
67 const base::FilePath::CharType kUnwantedSoftwareDBFile[] = | 67 const base::FilePath::CharType kUnwantedSoftwareDBFile[] = |
68 FILE_PATH_LITERAL(" UwS List"); | 68 FILE_PATH_LITERAL(" UwS List"); |
69 | 69 |
70 // Filename suffix for browse store. | 70 // Filename suffix for browse store. |
71 // TODO(shess): "Safe Browsing Bloom Prefix Set" is full of win. | 71 // TODO(shess): "Safe Browsing Bloom Prefix Set" is full of win. |
72 // Unfortunately, to change the name implies lots of transition code | 72 // Unfortunately, to change the name implies lots of transition code |
73 // for little benefit. If/when file formats change (say to put all | 73 // for little benefit. If/when file formats change (say to put all |
74 // the data in one file), that would be a convenient point to rectify | 74 // the data in one file), that would be a convenient point to rectify |
75 // this. | 75 // this. |
76 // TODO(shess): This shouldn't be OS-driven <http://crbug.com/394379> | |
77 #if defined(OS_ANDROID) | |
78 // NOTE(shess): This difference is also reflected in the list name in | |
79 // safe_browsing_util.cc. | |
80 // TODO(shess): Spin up an alternate list id which can be persisted in the | |
81 // store. Then if a mistake is made, it won't cause confusion between | |
82 // incompatible lists. | |
83 const base::FilePath::CharType kBrowseDBFile[] = FILE_PATH_LITERAL(" Mobile"); | |
84 #else | |
85 const base::FilePath::CharType kBrowseDBFile[] = FILE_PATH_LITERAL(" Bloom"); | 76 const base::FilePath::CharType kBrowseDBFile[] = FILE_PATH_LITERAL(" Bloom"); |
86 #endif | |
87 | 77 |
88 // Maximum number of entries we allow in any of the whitelists. | 78 // Maximum number of entries we allow in any of the whitelists. |
89 // If a whitelist on disk contains more entries then all lookups to | 79 // If a whitelist on disk contains more entries then all lookups to |
90 // the whitelist will be considered a match. | 80 // the whitelist will be considered a match. |
91 const size_t kMaxWhitelistSize = 5000; | 81 const size_t kMaxWhitelistSize = 5000; |
92 | 82 |
93 // If the hash of this exact expression is on a whitelist then all | 83 // If the hash of this exact expression is on a whitelist then all |
94 // lookups to this whitelist will be considered a match. | 84 // lookups to this whitelist will be considered a match. |
95 const char kWhitelistKillSwitchUrl[] = | 85 const char kWhitelistKillSwitchUrl[] = |
96 "sb-ssl.google.com/safebrowsing/csd/killswitch"; // Don't change this! | 86 "sb-ssl.google.com/safebrowsing/csd/killswitch"; // Don't change this! |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1832 else | 1822 else |
1833 NOTREACHED(); // Add support for new lists above. | 1823 NOTREACHED(); // Add support for new lists above. |
1834 | 1824 |
1835 // Histogram properties as in UMA_HISTOGRAM_COUNTS macro. | 1825 // Histogram properties as in UMA_HISTOGRAM_COUNTS macro. |
1836 base::HistogramBase* histogram_pointer = base::Histogram::FactoryGet( | 1826 base::HistogramBase* histogram_pointer = base::Histogram::FactoryGet( |
1837 histogram_name, 1, 1000000, 50, | 1827 histogram_name, 1, 1000000, 50, |
1838 base::HistogramBase::kUmaTargetedHistogramFlag); | 1828 base::HistogramBase::kUmaTargetedHistogramFlag); |
1839 | 1829 |
1840 histogram_pointer->Add(file_size_kilobytes); | 1830 histogram_pointer->Add(file_size_kilobytes); |
1841 } | 1831 } |
OLD | NEW |