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

Unified Diff: components/gcm_driver/gcm_internals_helper.cc

Issue 2450383003: [GCM] Reset store on checkin rejection and add checkin state to internals (Closed)
Patch Set: Fix deps Created 4 years, 2 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 eb2ee7680a7c7cf12b287e359f31f8eced4d4528..66cada27816c7400cbbf62999c12562781d8bd04 100644
--- a/components/gcm_driver/gcm_internals_helper.cc
+++ b/components/gcm_driver/gcm_internals_helper.cc
@@ -8,9 +8,11 @@
#include <utility>
#include "base/format_macros.h"
+#include "base/i18n/time_formatting.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "components/gcm_driver/gcm_activity.h"
#include "components/gcm_driver/gcm_internals_constants.h"
@@ -118,6 +120,14 @@ void SetGCMInternalsInfo(const gcm::GCMClient::GCMStatistics* stats,
base::JoinString(stats->registered_app_ids, ","));
if (stats->connection_client_created)
device_info->SetString(kConnectionState, stats->connection_state);
+ device_info->SetString(
+ kLastCheckin, base::UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime(
+ stats->last_checkin)));
Peter Beverloo 2016/10/28 15:52:30 last_checkin can be NULL here when the CheckinRequ
Nicolas Zea 2016/11/01 00:18:16 Done.
+ if (!stats->next_checkin.is_null()) {
+ device_info->SetString(
+ kNextCheckin, base::UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime(
+ stats->next_checkin)));
+ }
if (stats->android_id > 0) {
device_info->SetString(
kAndroidId, base::StringPrintf("0x%" PRIx64, stats->android_id));

Powered by Google App Engine
This is Rietveld 408576698