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

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

Issue 2647323009: Add extended reporting level in the update request (Closed)
Patch Set: rebase Created 3 years, 11 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/safe_browsing_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_service.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h
index 07b97413901be99de79430e8ed362daed3eef9a8..d1d355499100f56654c773e772e1a2d32068da10 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -20,6 +20,7 @@
#include "base/observer_list.h"
#include "base/sequenced_task_runner_helpers.h"
#include "chrome/browser/safe_browsing/services_delegate.h"
+#include "components/safe_browsing_db/safe_browsing_prefs.h"
#include "components/safe_browsing_db/util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
@@ -100,6 +101,15 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
// Returns the client_name field for both V3 and V4 protocol manager configs.
std::string GetProtocolConfigClientName() const;
+ // NOTE(vakh): This is not the most reliable way to find out if extended
+ // reporting has been enabled. That's why it starts with estimated_. It
+ // returns true if any of the profiles have extended reporting enabled. It may
+ // be called on any thread. That can lead to a race condition, but that's
+ // acceptable.
+ ExtendedReportingLevel estimated_extended_reporting_by_prefs() const {
+ return estimated_extended_reporting_by_prefs_;
+ }
+
// Get current enabled status. Must be called on IO thread.
bool enabled() const {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
@@ -274,6 +284,10 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
// Provides phishing and malware statistics. Accessed on IO thread.
std::unique_ptr<SafeBrowsingPingManager> ping_manager_;
+ // Whether SafeBrowsing Extended Reporting is enabled by the current set of
+ // profiles. Updated on the UI thread.
+ ExtendedReportingLevel estimated_extended_reporting_by_prefs_;
+
// Whether the service is running. 'enabled_' is used by SafeBrowsingService
// on the IO thread during normal operations.
bool enabled_;
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698