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

Unified Diff: components/safe_browsing_db/v4_local_database_manager.h

Issue 2261603002: PVer4: Re-use the PVer3 implementation to get full hashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_check_browse_url
Patch Set: BUILD: v4_local_database_manager depends on :v4_get_hash_protocol_manager Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: components/safe_browsing_db/v4_local_database_manager.h
diff --git a/components/safe_browsing_db/v4_local_database_manager.h b/components/safe_browsing_db/v4_local_database_manager.h
index 7fa07fbee4ca5dc95e1ca20b5274d8fede38b3e5..0b4b7fe2b460a67cc92db209fcc6e11ab16bd4c1 100644
--- a/components/safe_browsing_db/v4_local_database_manager.h
+++ b/components/safe_browsing_db/v4_local_database_manager.h
@@ -10,17 +10,20 @@
#include <memory>
+#include "base/sequenced_task_runner.h"
#include "components/safe_browsing_db/database_manager.h"
#include "components/safe_browsing_db/hit_report.h"
#include "components/safe_browsing_db/v4_database.h"
#include "components/safe_browsing_db/v4_protocol_manager_util.h"
-#include "components/safe_browsing_db/v4_update_protocol_manager.h"
#include "url/gurl.h"
using content::ResourceType;
namespace safe_browsing {
+class V4GetHashProtocolManager;
+class V4UpdateProtocolManager;
+
// Manages the local, on-disk database of updates downloaded from the
// SafeBrowsing service and interfaces with the protocol manager.
class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
@@ -66,11 +69,20 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
~V4LocalDatabaseManager() override;
+ // Called back by V4GetHashProtocolManager when the full hashes response has
+ // been received from the server.
+ void HandleGetHashes(const std::vector<SBFullHashResult>& full_hash_results,
+ const base::Time& negative_cache_expire);
+
// The callback called each time the protocol manager downloads updates
// successfully.
void UpdateRequestCompleted(
std::unique_ptr<ParsedServerResponse> parsed_server_response);
+ void SetupGetHashProtocolManager(
+ net::URLRequestContextGetter* request_context_getter,
+ const V4ProtocolConfig& config);
+
void SetupUpdateProtocolManager(
net::URLRequestContextGetter* request_context_getter,
const V4ProtocolConfig& config);
@@ -94,6 +106,10 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
// It should come through the database, from the various V4Stores.
base::hash_map<UpdateListIdentifier, std::string> current_list_states_;
+ // The protocol manager that downloads the full hashes for given hash
+ // prefixes.
+ std::unique_ptr<V4GetHashProtocolManager> v4_get_hash_protocol_manager_;
+
// The protocol manager that downloads the hash prefix updates.
std::unique_ptr<V4UpdateProtocolManager> v4_update_protocol_manager_;

Powered by Google App Engine
This is Rietveld 408576698