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

Unified Diff: components/upload_list/upload_list.cc

Issue 2070993002: List all crashes in chrome://crashes, including those not uploaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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/upload_list/upload_list.cc
diff --git a/components/upload_list/upload_list.cc b/components/upload_list/upload_list.cc
index 8ef4c2ee3a0cc3a2938c3c68cf4b9c32094bd4ad..cdaf6b16678af9655d65e9091e1879b783dbfc66 100644
--- a/components/upload_list/upload_list.cc
+++ b/components/upload_list/upload_list.cc
@@ -20,13 +20,17 @@
UploadList::UploadInfo::UploadInfo(const std::string& upload_id,
const base::Time& upload_time,
const std::string& local_id,
- const base::Time& capture_time)
- : upload_id(upload_id), upload_time(upload_time),
- local_id(local_id), capture_time(capture_time) {}
+ const base::Time& capture_time,
+ State state)
+ : upload_id(upload_id),
+ upload_time(upload_time),
+ local_id(local_id),
+ capture_time(capture_time),
+ state(state) {}
UploadList::UploadInfo::UploadInfo(const std::string& upload_id,
const base::Time& upload_time)
- : upload_id(upload_id), upload_time(upload_time) {}
+ : upload_id(upload_id), upload_time(upload_time), state(State::Uploaded) {}
UploadList::UploadInfo::~UploadInfo() {}
@@ -82,7 +86,7 @@ void UploadList::ParseLogEntries(
std::vector<std::string> components = base::SplitString(
*i, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
// Skip any blank (or corrupted) lines.
- if (components.size() < 2 || components.size() > 4)
+ if (components.size() < 2 || components.size() > 5)
continue;
base::Time upload_time;
double seconds_since_epoch;
@@ -104,6 +108,13 @@ void UploadList::ParseLogEntries(
info.capture_time = base::Time::FromDoubleT(seconds_since_epoch);
}
+ int state;
+ if (components.size() > 4 &&
+ !components[4].empty() &&
+ base::StringToInt(components[4], &state)) {
+ info.state = static_cast<UploadInfo::State>(state);
+ }
+
uploads->push_back(info);
}
}

Powered by Google App Engine
This is Rietveld 408576698