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" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/metrics/stats_counters.h" | 14 #include "base/metrics/stats_counters.h" |
| 15 #include "base/process/process.h" |
15 #include "base/process/process_metrics.h" | 16 #include "base/process/process_metrics.h" |
16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
17 #include "chrome/browser/safe_browsing/prefix_set.h" | 18 #include "chrome/browser/safe_browsing/prefix_set.h" |
18 #include "chrome/browser/safe_browsing/safe_browsing_store_file.h" | 19 #include "chrome/browser/safe_browsing/safe_browsing_store_file.h" |
19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
20 #include "crypto/sha2.h" | 21 #include "crypto/sha2.h" |
21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
22 | 23 |
23 #if defined(OS_MACOSX) | 24 #if defined(OS_MACOSX) |
24 #include "base/mac/mac_util.h" | 25 #include "base/mac/mac_util.h" |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 if (std::binary_search(new_whitelist.begin(), new_whitelist.end(), | 1599 if (std::binary_search(new_whitelist.begin(), new_whitelist.end(), |
1599 kill_switch)) { | 1600 kill_switch)) { |
1600 // The kill switch is whitelisted hence we whitelist all URLs. | 1601 // The kill switch is whitelisted hence we whitelist all URLs. |
1601 WhitelistEverything(whitelist); | 1602 WhitelistEverything(whitelist); |
1602 } else { | 1603 } else { |
1603 base::AutoLock locked(lookup_lock_); | 1604 base::AutoLock locked(lookup_lock_); |
1604 whitelist->second = false; | 1605 whitelist->second = false; |
1605 whitelist->first.swap(new_whitelist); | 1606 whitelist->first.swap(new_whitelist); |
1606 } | 1607 } |
1607 } | 1608 } |
OLD | NEW |