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

Unified Diff: cloud_print/gcp20/prototype/printer.cc

Issue 21916003: GCP2.0 Device: XMPP pings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@xmpp
Patch Set: Created 7 years, 4 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: cloud_print/gcp20/prototype/printer.cc
diff --git a/cloud_print/gcp20/prototype/printer.cc b/cloud_print/gcp20/prototype/printer.cc
index 5a252c05645529dedf7f3aada60c5dd42b9fbeac..bad56baf23db73adb4110230119d1a67405bc93f 100644
--- a/cloud_print/gcp20/prototype/printer.cc
+++ b/cloud_print/gcp20/prototype/printer.cc
@@ -27,7 +27,8 @@ const char kPrinterStatePathDefault[] = "printer_state.json";
namespace {
const uint16 kHttpPortDefault = 10101;
-const uint32 kTtlDefault = 60*60;
+const uint32 kTtlDefault = 60*60; // in seconds
+const int kXmppPingIntervalDefault = 5*60; // in seconds
const char kServiceType[] = "_privet._tcp.local";
const char kServiceNamePrefixDefault[] = "first_gcp20_device";
@@ -182,6 +183,7 @@ void Printer::Stop() {
}
void Printer::OnAuthError() {
+ LOG(ERROR) << "Auth error occurred";
access_token_update_ = base::Time::Now();
ChangeState(OFFLINE);
// TODO(maksymb): Implement *instant* updating of access_token.
@@ -476,7 +478,8 @@ void Printer::TryConnect() {
void Printer::ConnectXmpp() {
xmpp_listener_.reset(
- new CloudPrintXmppListener(reg_info_.xmpp_jid, GetTaskRunner(), this));
+ new CloudPrintXmppListener(reg_info_.xmpp_jid, kXmppPingIntervalDefault,
+ GetTaskRunner(), this));
xmpp_listener_->Connect(access_token_);
}

Powered by Google App Engine
This is Rietveld 408576698