Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: components/safe_browsing_db/database_manager.h

Issue 1881353002: SafeBrowsing: Adds response handler for API blacklist check in Database Manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@osb-impl-1
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // The Safe Browsing service is responsible for downloading anti-phishing and 5 // The Safe Browsing service is responsible for downloading anti-phishing and
6 // anti-malware tables and checking urls against them. 6 // anti-malware tables and checking urls against them.
7 7
8 #ifndef COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_ 8 #ifndef COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_
9 #define COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_ 9 #define COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 }; 66 };
67 67
68 // Bundled client info for an API abuse hash prefix check. 68 // Bundled client info for an API abuse hash prefix check.
69 class SafeBrowsingApiCheck { 69 class SafeBrowsingApiCheck {
70 public: 70 public:
71 SafeBrowsingApiCheck(const GURL& url, 71 SafeBrowsingApiCheck(const GURL& url,
72 const std::vector<SBFullHash>& full_hashes, 72 const std::vector<SBFullHash>& full_hashes,
73 Client* client); 73 Client* client);
74 ~SafeBrowsingApiCheck(); 74 ~SafeBrowsingApiCheck();
75 75
76 const GURL& url() {return url_;}
77 std::vector<SBFullHash>& full_hashes() {return full_hashes_;}
78 SafeBrowsingDatabaseManager::Client* client() {return client_;}
79
76 private: 80 private:
77 GURL url_; 81 GURL url_;
78 std::vector<SBFullHash> full_hashes_; 82 std::vector<SBFullHash> full_hashes_;
79 // Not owned. 83 // Not owned.
80 SafeBrowsingDatabaseManager::Client* client_; 84 SafeBrowsingDatabaseManager::Client* client_;
81 85
82 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingApiCheck); 86 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingApiCheck);
83 }; 87 };
84 88
85 // Returns true if URL-checking is supported on this build+device. 89 // Returns true if URL-checking is supported on this build+device.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 205
202 protected: 206 protected:
203 SafeBrowsingDatabaseManager(); 207 SafeBrowsingDatabaseManager();
204 208
205 virtual ~SafeBrowsingDatabaseManager(); 209 virtual ~SafeBrowsingDatabaseManager();
206 210
207 friend class base::RefCountedThreadSafe<SafeBrowsingDatabaseManager>; 211 friend class base::RefCountedThreadSafe<SafeBrowsingDatabaseManager>;
208 212
209 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, 213 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
210 CheckApiBlacklistUrlPrefixes); 214 CheckApiBlacklistUrlPrefixes);
215 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
216 HandleGetHashesWithApisResults);
217 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
218 HandleGetHashesWithApisResultsNoMatch);
219 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
220 HandleGetHashesWithApisResultsMatches);
211 221
212 // Created and destroyed via StartOnIOThread/StopOnIOThread. 222 // Created and destroyed via StartOnIOThread/StopOnIOThread.
213 V4GetHashProtocolManager* v4_get_hash_protocol_manager_; 223 V4GetHashProtocolManager* v4_get_hash_protocol_manager_;
214 }; // class SafeBrowsingDatabaseManager 224 }; // class SafeBrowsingDatabaseManager
215 225
216 } // namespace safe_browsing 226 } // namespace safe_browsing
217 227
218 #endif // COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_ 228 #endif // COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/database_manager.cc » ('j') | components/safe_browsing_db/database_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698