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

Unified Diff: remoting/host/chromoting_param_traits.cc

Issue 2933203002: [Chromoting] Use ProcessStatsSender in DesktopSessionAgent (desktop process) (Closed)
Patch Set: Resolve review comments Created 3 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: remoting/host/chromoting_param_traits.cc
diff --git a/remoting/host/chromoting_param_traits.cc b/remoting/host/chromoting_param_traits.cc
index de62d761859b3b4132fb4b84ba9cfe952f1b7575..0a5f26b372a7c96349f63f1345db4d272515a5b8 100644
--- a/remoting/host/chromoting_param_traits.cc
+++ b/remoting/host/chromoting_param_traits.cc
@@ -280,5 +280,45 @@ void ParamTraits<remoting::DesktopEnvironmentOptions>::Log(
l->append("DesktopEnvironmentOptions()");
}
+// static
+void ParamTraits<remoting::protocol::AggregatedProcessResourceUsage>::Write(
+ base::Pickle* m,
+ const remoting::protocol::AggregatedProcessResourceUsage& p) {
+ m->WriteString(p.name());
+ m->WriteDouble(p.processor_usage());
+ m->WriteUInt64(p.working_set_size());
+ m->WriteUInt64(p.pagefile_size());
+}
+
+// static
+bool ParamTraits<remoting::protocol::AggregatedProcessResourceUsage>::Read(
+ const base::Pickle* m,
+ base::PickleIterator* iter,
+ remoting::protocol::AggregatedProcessResourceUsage* p) {
+ std::string name;
+ double processor_usage;
+ uint64_t working_set_size;
+ uint64_t pagefile_size;
+ if (!iter->ReadString(&name) ||
+ !iter->ReadDouble(&processor_usage) ||
+ !iter->ReadUInt64(&working_set_size) ||
+ !iter->ReadUInt64(&pagefile_size)) {
+ return false;
+ }
+
+ p->set_name(name);
+ p->set_processor_usage(processor_usage);
+ p->set_working_set_size(working_set_size);
+ p->set_pagefile_size(pagefile_size);
+ return true;
+}
+
+// static
+void ParamTraits<remoting::protocol::AggregatedProcessResourceUsage>::Log(
+ const remoting::protocol::AggregatedProcessResourceUsage& p,
+ std::string* l) {
+ l->append("AggregatedProcessResourceUsage()");
+}
+
} // namespace IPC

Powered by Google App Engine
This is Rietveld 408576698