OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/safe_browsing_db/database_manager.h" | 5 #include "components/safe_browsing_db/database_manager.h" |
6 | 6 |
7 #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" | 7 #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "net/url_request/url_request_context_getter.h" | 9 #include "net/url_request/url_request_context_getter.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Must be called on IO thread. | 35 // Must be called on IO thread. |
36 void SafeBrowsingDatabaseManager::StopOnIOThread(bool shutdown) { | 36 void SafeBrowsingDatabaseManager::StopOnIOThread(bool shutdown) { |
37 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 37 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
38 // This cancels all in-flight GetHash requests. | 38 // This cancels all in-flight GetHash requests. |
39 if (v4_get_hash_protocol_manager_) { | 39 if (v4_get_hash_protocol_manager_) { |
40 delete v4_get_hash_protocol_manager_; | 40 delete v4_get_hash_protocol_manager_; |
41 v4_get_hash_protocol_manager_ = NULL; | 41 v4_get_hash_protocol_manager_ = NULL; |
42 } | 42 } |
43 | 43 |
44 // Delete pending checks, calling back any clients with empty metadata. | 44 // Delete pending checks, calling back any clients with empty metadata. |
45 for (auto check : api_checks_) { | 45 for (auto* check : api_checks_) { |
46 if (check->client()) { | 46 if (check->client()) { |
47 check->client()-> | 47 check->client()-> |
48 OnCheckApiBlacklistUrlResult(check->url(), ThreatMetadata()); | 48 OnCheckApiBlacklistUrlResult(check->url(), ThreatMetadata()); |
49 } | 49 } |
50 } | 50 } |
51 STLDeleteElements(&api_checks_); | 51 STLDeleteElements(&api_checks_); |
52 } | 52 } |
53 | 53 |
54 SafeBrowsingDatabaseManager::ApiCheckSet::iterator | 54 SafeBrowsingDatabaseManager::ApiCheckSet::iterator |
55 SafeBrowsingDatabaseManager::FindClientApiCheck(Client* client) { | 55 SafeBrowsingDatabaseManager::FindClientApiCheck(Client* client) { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 const std::vector<SBFullHashResult>& cached_results, | 292 const std::vector<SBFullHashResult>& cached_results, |
293 Client* client) | 293 Client* client) |
294 : url_(url), prefixes_(prefixes), full_hashes_(full_hashes), | 294 : url_(url), prefixes_(prefixes), full_hashes_(full_hashes), |
295 cached_results_(cached_results), client_(client) { | 295 cached_results_(cached_results), client_(client) { |
296 } | 296 } |
297 | 297 |
298 SafeBrowsingDatabaseManager::SafeBrowsingApiCheck::~SafeBrowsingApiCheck() { | 298 SafeBrowsingDatabaseManager::SafeBrowsingApiCheck::~SafeBrowsingApiCheck() { |
299 } | 299 } |
300 | 300 |
301 } // namespace safe_browsing | 301 } // namespace safe_browsing |
OLD | NEW |