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

Unified Diff: google_apis/gcm/engine/gcm_store_impl.cc

Issue 884783003: [GCM] Fixing the initialization of last checkin/fetch time if they are (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/gcm_store_impl.cc
diff --git a/google_apis/gcm/engine/gcm_store_impl.cc b/google_apis/gcm/engine/gcm_store_impl.cc
index 14e382e61980af17971ce0dce32febb42148ccf5..6a8e37221c2cbf2e09668ae2b1e6a453c17e737b 100644
--- a/google_apis/gcm/engine/gcm_store_impl.cc
+++ b/google_apis/gcm/engine/gcm_store_impl.cc
@@ -773,8 +773,10 @@ bool GCMStoreImpl::Backend::LoadLastCheckinInfo(
MakeSlice(kLastCheckinTimeKey),
&result);
int64 time_internal = 0LL;
- if (s.ok() && !base::StringToInt64(result, &time_internal))
+ if (s.ok() && !base::StringToInt64(result, &time_internal)) {
LOG(ERROR) << "Failed to restore last checkin time. Using default = 0.";
+ time_internal = 0LL;
miu 2015/01/29 02:56:15 Should this method return false here instead?
fgorski 2015/01/29 22:48:44 This is not as severe as other problems we might b
+ }
// In case we cannot read last checkin time, we default it to 0, as we don't
// want that situation to cause the whole load to fail.
@@ -852,8 +854,11 @@ bool GCMStoreImpl::Backend::LoadLastTokenFetchTime(
leveldb::Status s =
db_->Get(read_options, MakeSlice(kLastTokenFetchTimeKey), &result);
int64 time_internal = 0LL;
- if (s.ok() && !base::StringToInt64(result, &time_internal))
- LOG(ERROR) << "Failed to restore last checkin time. Using default = 0.";
+ if (s.ok() && !base::StringToInt64(result, &time_internal)) {
+ LOG(ERROR) <<
+ "Failed to restore last token fetching time. Using default = 0.";
+ time_internal = 0LL;
miu 2015/01/29 02:56:16 ditto: Should this method return false here instea
fgorski 2015/01/29 22:48:44 Same here.
+ }
// In case we cannot read last token fetching time, we default it to 0.
*last_token_fetch_time = base::Time::FromInternalValue(time_internal);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698