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

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

Issue 2347753002: Adds histograms for tracking Software Reporter logs uploads in SRT Fetcher. (Closed)
Patch Set: More comments Created 4 years, 3 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/srt_fetcher_win.h
diff --git a/chrome/browser/safe_browsing/srt_fetcher_win.h b/chrome/browser/safe_browsing/srt_fetcher_win.h
index 1ff81f3980caa5bfd82bef1258a706b170a81b07..cdc1a626d0c9328ec137a84b7b8b66f26a797315 100644
--- a/chrome/browser/safe_browsing/srt_fetcher_win.h
+++ b/chrome/browser/safe_browsing/srt_fetcher_win.h
@@ -50,6 +50,22 @@ extern const char kExtendedSafeBrowsingEnabledSwitch[];
extern const base::Feature kSwReporterExtendedSafeBrowsingFeature;
+// The possible behaviours implemented by the Software Reporter.
+enum class SwReporterBehaviours : uint8_t {
+ ALL_DISABLED = 0x0,
+ LOG_TO_RAPPOR = 0x1,
+ LOG_EXIT_CODE_TO_PREFS = 0x2,
+ TRIGGER_PROMPT = 0x4,
+ SEND_REPORTER_LOGS = 0x8,
+};
+
+SwReporterBehaviours operator&(SwReporterBehaviours a, SwReporterBehaviours b);
grt (UTC plus 2) 2016/09/16 20:12:42 oh my. this is overcomplicating things. i'm sorry
ftirelo 2016/09/16 21:00:10 Done. However, please notice that I kep BehaviourI
+SwReporterBehaviours operator|(SwReporterBehaviours a, SwReporterBehaviours b);
+
+// Returns true if |intended_behaviour| is enabled in |behaviours|.
+bool BehaviourIsEnabled(SwReporterBehaviours behaviours,
+ SwReporterBehaviours intended_behaviour);
+
// Parameters used to invoke the sw_reporter component.
struct SwReporterInvocation {
base::CommandLine command_line;
@@ -59,17 +75,15 @@ struct SwReporterInvocation {
// ending in |suffix|. For the canonical version, |suffix| will be empty.
std::string suffix;
- // Flags to control optional behaviours. By default all are enabled;
- // experimental versions of the reporter will turn off the behaviours that
- // are not yet supported.
- using Flags = uint32_t;
- enum : Flags {
- FLAG_LOG_TO_RAPPOR = 0x1,
- FLAG_LOG_EXIT_CODE_TO_PREFS = 0x2,
- FLAG_TRIGGER_PROMPT = 0x4,
- FLAG_SEND_REPORTER_LOGS = 0x8,
- };
- Flags flags = 0;
+ // Flags to control behaviours the Software Reporter should support by
+ // default. These flags are set in the Reporter installer, and experimental
+ // versions of the reporter will turn off the behaviours that are not yet
+ // supported.
+ SwReporterBehaviours supported_behaviours =
+ SwReporterBehaviours::ALL_DISABLED;
+
+ // Whether logs upload was enabled in this invocation.
+ bool logs_upload_enabled = false;
SwReporterInvocation();

Powered by Google App Engine
This is Rietveld 408576698