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

Unified Diff: components/upload_list/upload_list.cc

Issue 1405373002: Fix WebRTC log list errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 2 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 | « components/upload_list/upload_list.h ('k') | components/upload_list/upload_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/upload_list/upload_list.cc
diff --git a/components/upload_list/upload_list.cc b/components/upload_list/upload_list.cc
index e99ce0b575bd7b8470bc8093f1178c7e88d17b60..893a7de8ac64a8f70cd06a5fd973cd528aac7cfd 100644
--- a/components/upload_list/upload_list.cc
+++ b/components/upload_list/upload_list.cc
@@ -16,13 +16,16 @@
#include "base/thread_task_runner_handle.h"
#include "base/threading/sequenced_worker_pool.h"
-UploadList::UploadInfo::UploadInfo(const std::string& id,
- const base::Time& t,
- const std::string& local_id)
- : id(id), time(t), local_id(local_id) {}
+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) {}
-UploadList::UploadInfo::UploadInfo(const std::string& id, const base::Time& t)
- : id(id), time(t) {}
+UploadList::UploadInfo::UploadInfo(const std::string& upload_id,
+ const base::Time& upload_time)
+ : upload_id(upload_id), upload_time(upload_time) {}
UploadList::UploadInfo::~UploadInfo() {}
@@ -84,7 +87,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() != 3)
+ if (components.size() < 2 || components.size() > 4)
continue;
base::Time upload_time;
double seconds_since_epoch;
@@ -94,8 +97,18 @@ void UploadList::ParseLogEntries(
upload_time = base::Time::FromDoubleT(seconds_since_epoch);
}
UploadInfo info(components[1], upload_time);
- if (components.size() == 3)
+
+ // Add local ID if present.
+ if (components.size() > 2)
info.local_id = components[2];
+
+ // Add capture time if present.
+ if (components.size() > 3 &&
+ !components[3].empty() &&
+ base::StringToDouble(components[3], &seconds_since_epoch)) {
+ info.capture_time = base::Time::FromDoubleT(seconds_since_epoch);
+ }
+
uploads_.push_back(info);
}
}
« no previous file with comments | « components/upload_list/upload_list.h ('k') | components/upload_list/upload_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698