Commit 554b977f authored by Andres Medina's avatar Andres Medina Committed by Commit Bot

[chromecast] Added virtual-channel to product data

Added virtual-channel field to be able to filter crash reports by this it.

Bug: internal b/64942730
Change-Id: I5375d574f6095a689e89d0c543df20da2b281b33
Reviewed-on: https://chromium-review.googlesource.com/1026150
Commit-Queue: Andres Medina <medinaandres@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579501}
parent b09dddf1
...@@ -42,6 +42,8 @@ const char kCrashServerStaging[] = ...@@ -42,6 +42,8 @@ const char kCrashServerStaging[] =
"https://clients2.google.com/cr/staging_report"; "https://clients2.google.com/cr/staging_report";
const char kCrashServerProduction[] = "https://clients2.google.com/cr/report"; const char kCrashServerProduction[] = "https://clients2.google.com/cr/report";
const char kVirtualChannel[] = "virtual-channel";
typedef std::vector<std::unique_ptr<DumpInfo>> DumpList; typedef std::vector<std::unique_ptr<DumpInfo>> DumpList;
std::unique_ptr<PrefService> CreatePrefService() { std::unique_ptr<PrefService> CreatePrefService() {
...@@ -52,6 +54,7 @@ std::unique_ptr<PrefService> CreatePrefService() { ...@@ -52,6 +54,7 @@ std::unique_ptr<PrefService> CreatePrefService() {
PrefRegistrySimple* registry = new PrefRegistrySimple; PrefRegistrySimple* registry = new PrefRegistrySimple;
registry->RegisterBooleanPref(prefs::kOptInStats, true); registry->RegisterBooleanPref(prefs::kOptInStats, true);
registry->RegisterStringPref(::metrics::prefs::kMetricsClientID, ""); registry->RegisterStringPref(::metrics::prefs::kMetricsClientID, "");
registry->RegisterStringPref(kVirtualChannel, "");
PrefServiceFactory prefServiceFactory; PrefServiceFactory prefServiceFactory;
prefServiceFactory.SetUserPrefsFile( prefServiceFactory.SetUserPrefsFile(
...@@ -128,6 +131,10 @@ bool MinidumpUploader::DoWork() { ...@@ -128,6 +131,10 @@ bool MinidumpUploader::DoWork() {
std::unique_ptr<PrefService> pref_service = pref_service_generator_.Run(); std::unique_ptr<PrefService> pref_service = pref_service_generator_.Run();
const std::string& client_id( const std::string& client_id(
pref_service->GetString(::metrics::prefs::kMetricsClientID)); pref_service->GetString(::metrics::prefs::kMetricsClientID));
std::string virtual_channel(pref_service->GetString(kVirtualChannel));
if (virtual_channel.empty()) {
virtual_channel = release_channel_;
}
bool opt_in_stats = pref_service->GetBoolean(prefs::kOptInStats); bool opt_in_stats = pref_service->GetBoolean(prefs::kOptInStats);
// Handle each dump and consume it out of the structure. // Handle each dump and consume it out of the structure.
while (dumps.size()) { while (dumps.size()) {
...@@ -231,6 +238,7 @@ bool MinidumpUploader::DoWork() { ...@@ -231,6 +238,7 @@ bool MinidumpUploader::DoWork() {
g.SetParameter("ro.product.model", device_model_); g.SetParameter("ro.product.model", device_model_);
g.SetParameter("ro.product.manufacturer", manufacturer_); g.SetParameter("ro.product.manufacturer", manufacturer_);
g.SetParameter("ro.system.version", system_version_); g.SetParameter("ro.system.version", system_version_);
g.SetParameter("release.virtual-channel", virtual_channel);
// Add app state information // Add app state information
if (!dump.params().previous_app_name.empty()) { if (!dump.params().previous_app_name.empty()) {
......
...@@ -31,6 +31,8 @@ namespace { ...@@ -31,6 +31,8 @@ namespace {
const char kLockfileName[] = "lockfile"; const char kLockfileName[] = "lockfile";
const char kMetadataName[] = "metadata"; const char kMetadataName[] = "metadata";
const char kMinidumpSubdir[] = "minidumps"; const char kMinidumpSubdir[] = "minidumps";
const char kVirtualChannel[] = "virtual-channel";
const char kVirtualChannelName[] = "a-virtual-chanel";
typedef std::vector<std::unique_ptr<DumpInfo>> DumpList; typedef std::vector<std::unique_ptr<DumpInfo>> DumpList;
...@@ -40,6 +42,7 @@ std::unique_ptr<PrefService> CreateFakePrefService(bool opt_in) { ...@@ -40,6 +42,7 @@ std::unique_ptr<PrefService> CreateFakePrefService(bool opt_in) {
retval->registry()->RegisterBooleanPref(prefs::kOptInStats, opt_in); retval->registry()->RegisterBooleanPref(prefs::kOptInStats, opt_in);
retval->registry()->RegisterStringPref(::metrics::prefs::kMetricsClientID, retval->registry()->RegisterStringPref(::metrics::prefs::kMetricsClientID,
""); "");
retval->registry()->RegisterStringPref(kVirtualChannel, kVirtualChannelName);
return std::move(retval); return std::move(retval);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment