Chromium Code Reviews| 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); |