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

Unified Diff: remoting/ios/facade/host_info.cc

Issue 2912293003: [CRD iOS] Consistent host list order and showing last online time (Closed)
Patch Set: Fix comment Created 3 years, 7 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: remoting/ios/facade/host_info.cc
diff --git a/remoting/ios/facade/host_info.cc b/remoting/ios/facade/host_info.cc
index 939fc504e66db2f2784ce337730a1b547d827da8..a1cf275ec8c27db963f51be30527dbce145ef26f 100644
--- a/remoting/ios/facade/host_info.cc
+++ b/remoting/ios/facade/host_info.cc
@@ -51,21 +51,6 @@ bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) {
return false;
}
- if (!host_info.GetString("hostOS", &host_os)) {
- LOG(ERROR) << "hostOS was not found in host_info";
- return false;
- }
-
- if (!host_info.GetString("hostOsVersion", &host_os_version)) {
- LOG(ERROR) << "hostOsVersion was not found in host_info";
- return false;
- }
-
- if (!host_info.GetString("hostVersion", &host_version)) {
- LOG(ERROR) << "hostVersion was not found in host_info";
- return false;
- }
-
if (!host_info.GetString("publicKey", &public_key)) {
LOG(ERROR) << "publicKey was not found for " << host_name;
return false;
@@ -79,6 +64,17 @@ bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) {
return false;
}
+ std::string updated_time_iso;
+ if (host_info.GetString("updatedTime", &updated_time_iso)) {
+ if (!base::Time::FromString(updated_time_iso.c_str(), &updated_time)) {
+ LOG(WARNING) << "Failed to parse updatedTime";
+ }
+ }
+
+ host_info.GetString("hostOs", &host_os);
+ host_info.GetString("hostOsVersion", &host_os_version);
+ host_info.GetString("hostVersion", &host_version);
+
host_info.GetString("hostOfflineReason", &offline_reason);
return true;

Powered by Google App Engine
This is Rietveld 408576698