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

Unified Diff: chrome/browser/component_updater/sw_reporter_installer_win.cc

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/component_updater/sw_reporter_installer_win.cc
diff --git a/chrome/browser/component_updater/sw_reporter_installer_win.cc b/chrome/browser/component_updater/sw_reporter_installer_win.cc
index 6de56e53af146b4477edb70f262c0a68cffc14bc..5dbfcc62f1d7789006bd76219a0dc5e7c10c03da 100644
--- a/chrome/browser/component_updater/sw_reporter_installer_win.cc
+++ b/chrome/browser/component_updater/sw_reporter_installer_win.cc
@@ -47,6 +47,7 @@ namespace component_updater {
namespace {
+using safe_browsing::SwReporterBehaviours;
using safe_browsing::SwReporterInvocation;
// These values are used to send UMA information and are replicated in the
@@ -119,10 +120,10 @@ void ReportExperimentError(SwReporterExperimentError error) {
SW_REPORTER_EXPERIMENT_ERROR_MAX);
}
-// Run the software reporter on the next Chrome startup after it's downloaded.
-// (This is the default |reporter_runner| function passed to the
-// |SwReporterInstallerTraits| constructor in |RegisterSwReporterComponent|
-// below.)
+// Once the Software Reporter is downloaded, schedules it to run sometime after
+// the current browser startup is complete. (This is the default
+// |reporter_runner| function passed to the |SwReporterInstallerTraits|
+// constructor in |RegisterSwReporterComponent| below.)
void RunSwReportersAfterStartup(
const safe_browsing::SwReporterQueue& invocations,
const base::Version& version) {
@@ -216,7 +217,8 @@ void RunExperimentalSwReporter(const base::FilePath& exe_path,
command_line.AppendSwitchASCII("registry-suffix", suffix);
// "prompt" is optional, but if present must be a boolean.
- SwReporterInvocation::Flags flags = 0;
+ SwReporterBehaviours supported_behaviours =
+ SwReporterBehaviours::ALL_DISABLED;
const base::Value* prompt_value = nullptr;
if (invocation_params->Get("prompt", &prompt_value)) {
bool prompt = false;
@@ -224,13 +226,15 @@ void RunExperimentalSwReporter(const base::FilePath& exe_path,
ReportExperimentError(SW_REPORTER_EXPERIMENT_ERROR_BAD_PARAMS);
return;
}
- if (prompt)
- flags |= SwReporterInvocation::FLAG_TRIGGER_PROMPT;
+ if (prompt) {
+ supported_behaviours =
+ supported_behaviours | SwReporterBehaviours::TRIGGER_PROMPT;
+ }
}
auto invocation = SwReporterInvocation::FromCommandLine(command_line);
invocation.suffix = suffix;
- invocation.flags = flags;
+ invocation.supported_behaviours = supported_behaviours;
invocations.push(invocation);
}
@@ -280,10 +284,11 @@ void SwReporterInstallerTraits::ComponentReady(
reporter_runner_);
} else {
auto invocation = SwReporterInvocation::FromFilePath(exe_path);
- invocation.flags = SwReporterInvocation::FLAG_LOG_TO_RAPPOR |
- SwReporterInvocation::FLAG_LOG_EXIT_CODE_TO_PREFS |
- SwReporterInvocation::FLAG_TRIGGER_PROMPT |
- SwReporterInvocation::FLAG_SEND_REPORTER_LOGS;
+ invocation.supported_behaviours =
+ SwReporterBehaviours::LOG_TO_RAPPOR |
+ SwReporterBehaviours::LOG_EXIT_CODE_TO_PREFS |
+ SwReporterBehaviours::TRIGGER_PROMPT |
+ SwReporterBehaviours::SEND_REPORTER_LOGS;
safe_browsing::SwReporterQueue invocations;
invocations.push(invocation);

Powered by Google App Engine
This is Rietveld 408576698