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

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

Issue 8310014: Only send the client-side phishing model to a renderer if its profile has SafeBrowsing enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a comment as Noe suggested Created 9 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/client_side_detection_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/client_side_detection_service.h
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.h b/chrome/browser/safe_browsing/client_side_detection_service.h
index 7e583a13ac5f6a293b73f16a6015f8a5ec687a88..0017824bf75dfeff5984181e30b4488b04e3a4b2 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.h
+++ b/chrome/browser/safe_browsing/client_side_detection_service.h
@@ -61,17 +61,19 @@ class ClientSideDetectionService : public URLFetcher::Delegate,
virtual ~ClientSideDetectionService();
// Creates a client-side detection service. The service is initially
- // disabled, use SetEnabled() to start it. The caller takes ownership of the
- // object. This function may return NULL.
+ // disabled, use SetEnabledAndRefreshState() to start it. The caller takes
+ // ownership of the object. This function may return NULL.
static ClientSideDetectionService* Create(
net::URLRequestContextGetter* request_context_getter);
- // Enables or disables the service. This is usually called by the
- // SafeBrowsingService, which tracks whether any profile uses these services
- // at all. Disabling cancels any pending requests; existing
- // ClientSideDetectionHosts will have their callbacks called with "false"
- // verdicts. Enabling starts downloading the model after a delay.
- void SetEnabled(bool enabled);
+ // Enables or disables the service, and refreshes the state of all renderers.
+ // This is usually called by the SafeBrowsingService, which tracks whether
+ // any profile uses these services at all. Disabling cancels any pending
+ // requests; existing ClientSideDetectionHosts will have their callbacks
+ // called with "false" verdicts. Enabling starts downloading the model after
+ // a delay. In all cases, each render process is updated to match the state
+ // of the SafeBrowsing preference for that profile.
+ void SetEnabledAndRefreshState(bool enabled);
bool enabled() const {
return enabled_;
@@ -164,7 +166,8 @@ class ClientSideDetectionService : public URLFetcher::Delegate,
friend class ClientSideDetectionServiceTest;
FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, FetchModelTest);
FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, SetBadSubnets);
- FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, SetEnabled);
+ FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest,
+ SetEnabledAndRefreshState);
FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, IsBadIpAddress);
FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest,
IsFalsePositiveResponse);
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/client_side_detection_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698