Chromium Code Reviews| Index: components/safe_browsing_db/database_manager.cc |
| diff --git a/components/safe_browsing_db/database_manager.cc b/components/safe_browsing_db/database_manager.cc |
| index c8d7aa30afa2ae750bd85757b4927043b5e5bae0..df67504207e3e34c1e977978165770c5dcc82378 100644 |
| --- a/components/safe_browsing_db/database_manager.cc |
| +++ b/components/safe_browsing_db/database_manager.cc |
| @@ -86,7 +86,22 @@ void SafeBrowsingDatabaseManager::HandleGetHashesWithApisResults( |
| const std::vector<SBFullHashResult>& full_hash_results, |
| const base::TimeDelta& negative_cache_duration) { |
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| - // TODO(kcarattini): Implement response handler. |
| + DCHECK(check); |
|
Nathan Parker
2016/04/15 23:22:00
Sounds like a microphone check. "Check. Check. Ch
kcarattini
2016/04/18 07:12:02
Acknowledged.
|
| + |
| + ThreatMetadata md; |
| + // Merge the metadata from all matching results. |
| + for (const SBFullHashResult& result : full_hash_results) { |
|
Nathan Parker
2016/04/15 23:22:00
This is sort of O(N^2), where N is small but could
kcarattini
2016/04/18 07:12:02
Done.
|
| + for (const SBFullHash& full_hash : check->full_hashes()) { |
| + if (SBFullHashEqual(full_hash, result.hash)) { |
| + md.api_permissions.insert(md.api_permissions.end(), |
| + result.metadata.api_permissions.begin(), |
| + result.metadata.api_permissions.end()); |
| + break; |
| + } |
| + } |
| + } |
| + |
| + check->client()->OnCheckApiBlacklistUrlResult(check->url(), md); |
|
Nathan Parker
2016/04/15 23:22:00
Consider if we need the URL to be passed here, and
kcarattini
2016/04/18 07:12:02
I can imagine a client making calls for multiple u
Nathan Parker
2016/04/18 17:34:09
k. Another approach is that the caller could use
|
| } |
| SafeBrowsingDatabaseManager::SafeBrowsingApiCheck::SafeBrowsingApiCheck( |