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

Unified Diff: chrome/browser/safe_browsing/local_database_manager.h

Issue 1848973004: Makes V4UpdateProtocolManager auto-schedule update fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v4_01_
Patch Set: Delete v4_update_protocol_manager_ on IO thread stop. And fix BUILD.gn Created 4 years, 9 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: chrome/browser/safe_browsing/local_database_manager.h
diff --git a/chrome/browser/safe_browsing/local_database_manager.h b/chrome/browser/safe_browsing/local_database_manager.h
index 4891d6cf4076af157ae5941ef4fb45258c34a218..f1a886e7d0ab44a4255bd16368f10e3ffa53c94f 100644
--- a/chrome/browser/safe_browsing/local_database_manager.h
+++ b/chrome/browser/safe_browsing/local_database_manager.h
@@ -28,7 +28,10 @@
#include "chrome/browser/safe_browsing/protocol_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_util.h"
#include "components/safe_browsing_db/database_manager.h"
+#include "components/safe_browsing_db/safebrowsing.pb.h"
#include "components/safe_browsing_db/util.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"
namespace net {
@@ -82,7 +85,7 @@ class LocalSafeBrowsingDatabaseManager
bool is_extended_reporting;
bool need_get_hash;
base::TimeTicks start; // When check was sent to SB service.
- ListType check_type; // See comment in constructor.
+ ListType check_type; // See comment in constructor.
std::vector<SBThreatType> expected_threats;
std::vector<SBPrefix> prefix_hits;
std::vector<SBFullHashResult> cache_hits;
@@ -131,9 +134,8 @@ class LocalSafeBrowsingDatabaseManager
bool IsMalwareKillSwitchOn() override;
bool IsCsdWhitelistKillSwitchOn() override;
void CancelCheck(Client* client) override;
- void StartOnIOThread(
- net::URLRequestContextGetter* request_context_getter,
- const V4ProtocolConfig& config) override;
+ void StartOnIOThread(net::URLRequestContextGetter* request_context_getter,
+ const V4ProtocolConfig& config) override;
void StopOnIOThread(bool shutdown) override;
bool download_protection_enabled() const override;
@@ -155,8 +157,7 @@ class LocalSafeBrowsingDatabaseManager
friend class SafeBrowsingServiceTest;
friend class SafeBrowsingServiceTestHelper;
friend class LocalDatabaseManagerTest;
- FRIEND_TEST_ALL_PREFIXES(LocalDatabaseManagerTest,
- GetUrlSeverestThreatType);
+ FRIEND_TEST_ALL_PREFIXES(LocalDatabaseManagerTest, GetUrlSeverestThreatType);
FRIEND_TEST_ALL_PREFIXES(LocalDatabaseManagerTest,
ServiceStopWithPendingChecks);
@@ -194,6 +195,8 @@ class LocalSafeBrowsingDatabaseManager
const std::vector<SBFullHashResult>& full_hashes,
size_t* index);
+ void UpdateRequestCompleted(const std::vector<ListUpdateResponse>& responses);
+
// Called to stop operations on the io_thread. This may be called multiple
// times during the life of the DatabaseManager. Should be called on IO
// thread.
@@ -256,7 +259,7 @@ class LocalSafeBrowsingDatabaseManager
AddChunksCallback callback);
void DeleteDatabaseChunks(
- scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes);
+ scoped_ptr<std::vector<SBChunkDelete>> chunk_deletes);
void NotifyClientBlockingComplete(Client* client, bool proceed);
@@ -380,6 +383,13 @@ class LocalSafeBrowsingDatabaseManager
// Timeout to use for safe browsing checks.
base::TimeDelta check_timeout_;
+ // Stores the current status of the lists to download from the SafeBrowsing
+ // servers.
+ base::hash_map<UpdateListIdentifier, std::string> current_list_states_;
+
+ // The protocol manager that downloads the hash prefix updates.
+ scoped_ptr<V4UpdateProtocolManager> v4_update_protocol_manager_;
+
DISALLOW_COPY_AND_ASSIGN(LocalSafeBrowsingDatabaseManager);
}; // class LocalSafeBrowsingDatabaseManager

Powered by Google App Engine
This is Rietveld 408576698