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

Unified Diff: components/gcm_driver/gcm_internals_helper.cc

Issue 1616113003: List message decryption failures on chrome://gcm-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after CL 1619053003 Created 4 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
Index: components/gcm_driver/gcm_internals_helper.cc
diff --git a/components/gcm_driver/gcm_internals_helper.cc b/components/gcm_driver/gcm_internals_helper.cc
index c66d3d7e7d7c6d83b35ed3e6aaedac73570fbe3c..a3417e74467cacc124299124a3249ca1f80215e5 100644
--- a/components/gcm_driver/gcm_internals_helper.cc
+++ b/components/gcm_driver/gcm_internals_helper.cc
@@ -86,6 +86,19 @@ void SetSendingInfo(const std::vector<gcm::SendingActivity>& sends,
}
}
+void SetDecryptionFailureInfo(
+ const std::vector<gcm::DecryptionFailureActivity>& failures,
+ base::ListValue* failure_info) {
+ for (const gcm::DecryptionFailureActivity& failure : failures) {
+ base::ListValue* row = new base::ListValue();
+ failure_info->Append(row);
+
+ row->AppendDouble(failure.time.ToJsTime());
+ row->AppendString(failure.app_id);
+ row->AppendString(failure.details);
+ }
+}
+
} // namespace
void SetGCMInternalsInfo(const gcm::GCMClient::GCMStatistics* stats,
@@ -144,6 +157,14 @@ void SetGCMInternalsInfo(const gcm::GCMClient::GCMStatistics* stats,
results->Set(kSendInfo, send_info);
SetSendingInfo(stats->recorded_activities.sending_activities, send_info);
}
+
+ if (stats->recorded_activities.decryption_failure_activities.size() > 0) {
+ base::ListValue* failure_info = new base::ListValue();
+ results->Set(kDecryptionFailureInfo, failure_info);
+ SetDecryptionFailureInfo(
+ stats->recorded_activities.decryption_failure_activities,
+ failure_info);
+ }
}
}
« no previous file with comments | « components/gcm_driver/gcm_internals_constants.cc ('k') | components/gcm_driver/gcm_stats_recorder_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698