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

Unified Diff: components/gcm_driver/gcm_stats_recorder_impl.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_stats_recorder_impl.cc
diff --git a/components/gcm_driver/gcm_stats_recorder_impl.cc b/components/gcm_driver/gcm_stats_recorder_impl.cc
index de3035459fe791c89c695edaca83207f2465aa55..803e6baff0c2adbac480c48957c234375f58f408 100644
--- a/components/gcm_driver/gcm_stats_recorder_impl.cc
+++ b/components/gcm_driver/gcm_stats_recorder_impl.cc
@@ -163,6 +163,7 @@ void GCMStatsRecorderImpl::Clear() {
registration_activities_.clear();
receiving_activities_.clear();
sending_activities_.clear();
+ decryption_failure_activities_.clear();
}
void GCMStatsRecorderImpl::NotifyActivityRecorded() {
@@ -170,6 +171,22 @@ void GCMStatsRecorderImpl::NotifyActivityRecorded() {
delegate_->OnActivityRecorded();
}
+void GCMStatsRecorderImpl::RecordDecryptionFailure(
+ const std::string& app_id,
+ GCMEncryptionProvider::DecryptionFailure reason) {
+ if (!is_recording_)
+ return;
+
+ DecryptionFailureActivity data;
+ DecryptionFailureActivity* inserted_data = InsertCircularBuffer(
+ &decryption_failure_activities_, data);
+ inserted_data->app_id = app_id;
+ inserted_data->details =
+ GCMEncryptionProvider::ToDecryptionFailureDetailsString(reason);
+
+ NotifyActivityRecorded();
+}
+
void GCMStatsRecorderImpl::RecordCheckin(
const std::string& event,
const std::string& details) {
@@ -460,6 +477,10 @@ void GCMStatsRecorderImpl::CollectActivities(
recorded_activities->sending_activities.begin(),
sending_activities_.begin(),
sending_activities_.end());
+ recorded_activities->decryption_failure_activities.insert(
+ recorded_activities->decryption_failure_activities.begin(),
+ decryption_failure_activities_.begin(),
+ decryption_failure_activities_.end());
}
void GCMStatsRecorderImpl::RecordSending(const std::string& app_id,
« no previous file with comments | « components/gcm_driver/gcm_stats_recorder_impl.h ('k') | components/gcm_driver/gcm_stats_recorder_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698