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

Unified Diff: components/variations/variations_seed_store.cc

Issue 2605293002: Add WARN_UNUSED_RESULT to base::Time methods that return bool. (Closed)
Patch Set: Add comment to PexeDownloader::didReceiveResponse() Created 3 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/variations/variations_seed_store.cc
diff --git a/components/variations/variations_seed_store.cc b/components/variations/variations_seed_store.cc
index 8067651b43545cfdde56d9501a89ec2995f35a05..647cc8dbf9cba17a2d2f09cc77762dccf168874b 100644
--- a/components/variations/variations_seed_store.cc
+++ b/components/variations/variations_seed_store.cc
@@ -139,6 +139,7 @@ enum FirstRunResult {
FIRST_RUN_SEED_IMPORT_FAIL_NO_CALLBACK,
FIRST_RUN_SEED_IMPORT_FAIL_NO_FIRST_RUN_SEED,
FIRST_RUN_SEED_IMPORT_FAIL_STORE_FAILED,
+ FIRST_RUN_SEED_IMPORT_FAIL_INVALID_RESPONSE_DATE,
Alexei Svitkine (slow) 2017/01/17 21:38:07 Can you add this to histograms.xml? Seems like you
digit1 2017/01/19 12:57:41 Thanks for spotting this. Please see the new patch
FIRST_RUN_RESULT_ENUM_SIZE,
};
@@ -367,7 +368,11 @@ void VariationsSeedStore::ImportFirstRunJavaSeed() {
}
base::Time current_date;
- base::Time::FromUTCString(response_date.c_str(), &current_date);
+ if (!base::Time::FromUTCString(response_date.c_str(), &current_date)) {
+ RecordFirstRunResult(FIRST_RUN_SEED_IMPORT_FAIL_INVALID_RESPONSE_DATE);
+ LOG(WARNING) << "Invalid response date: " << response_date;
+ return;
+ }
if (!StoreSeedData(seed_data, seed_signature, seed_country, current_date,
false, is_gzip_compressed, nullptr)) {
« no previous file with comments | « components/nacl/renderer/ppb_nacl_private_impl.cc ('k') | content/browser/blob_storage/blob_storage_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698