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 "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" | 8 #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "net/url_request/url_request_context_getter.h" | 10 #include "net/url_request/url_request_context_getter.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 v4_get_hash_protocol_manager_ = NULL; | 94 v4_get_hash_protocol_manager_ = NULL; |
95 } | 95 } |
96 | 96 |
97 // Delete pending checks, calling back any clients with empty metadata. | 97 // Delete pending checks, calling back any clients with empty metadata. |
98 for (auto* check : api_checks_) { | 98 for (auto* check : api_checks_) { |
99 if (check->client()) { | 99 if (check->client()) { |
100 check->client()-> | 100 check->client()-> |
101 OnCheckApiBlacklistUrlResult(check->url(), ThreatMetadata()); | 101 OnCheckApiBlacklistUrlResult(check->url(), ThreatMetadata()); |
102 } | 102 } |
103 } | 103 } |
104 STLDeleteElements(&api_checks_); | 104 base::STLDeleteElements(&api_checks_); |
105 } | 105 } |
106 | 106 |
107 SafeBrowsingDatabaseManager::ApiCheckSet::iterator | 107 SafeBrowsingDatabaseManager::ApiCheckSet::iterator |
108 SafeBrowsingDatabaseManager::FindClientApiCheck(Client* client) { | 108 SafeBrowsingDatabaseManager::FindClientApiCheck(Client* client) { |
109 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 109 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
110 for (ApiCheckSet::iterator it = api_checks_.begin(); | 110 for (ApiCheckSet::iterator it = api_checks_.begin(); |
111 it != api_checks_.end(); ++it) { | 111 it != api_checks_.end(); ++it) { |
112 if ((*it)->client() == client) { | 112 if ((*it)->client() == client) { |
113 return it; | 113 return it; |
114 } | 114 } |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 const std::vector<SBFullHashResult>& cached_results, | 369 const std::vector<SBFullHashResult>& cached_results, |
370 Client* client) | 370 Client* client) |
371 : url_(url), prefixes_(prefixes), full_hashes_(full_hashes), | 371 : url_(url), prefixes_(prefixes), full_hashes_(full_hashes), |
372 cached_results_(cached_results), client_(client) { | 372 cached_results_(cached_results), client_(client) { |
373 } | 373 } |
374 | 374 |
375 SafeBrowsingDatabaseManager::SafeBrowsingApiCheck::~SafeBrowsingApiCheck() { | 375 SafeBrowsingDatabaseManager::SafeBrowsingApiCheck::~SafeBrowsingApiCheck() { |
376 } | 376 } |
377 | 377 |
378 } // namespace safe_browsing | 378 } // namespace safe_browsing |
OLD | NEW |