OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/chromoting_param_traits.h" | 5 #include "remoting/host/chromoting_param_traits.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "ipc/ipc_message_utils.h" | 10 #include "ipc/ipc_message_utils.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 return true; | 273 return true; |
274 } | 274 } |
275 | 275 |
276 // static | 276 // static |
277 void ParamTraits<remoting::DesktopEnvironmentOptions>::Log( | 277 void ParamTraits<remoting::DesktopEnvironmentOptions>::Log( |
278 const remoting::DesktopEnvironmentOptions& p, | 278 const remoting::DesktopEnvironmentOptions& p, |
279 std::string* l) { | 279 std::string* l) { |
280 l->append("DesktopEnvironmentOptions()"); | 280 l->append("DesktopEnvironmentOptions()"); |
281 } | 281 } |
282 | 282 |
| 283 // static |
| 284 void ParamTraits<remoting::protocol::AggregatedProcessResourceUsage>::Write( |
| 285 base::Pickle* m, |
| 286 const remoting::protocol::AggregatedProcessResourceUsage& p) { |
| 287 m->WriteString(p.name()); |
| 288 m->WriteDouble(p.processor_usage()); |
| 289 m->WriteUInt64(p.working_set_size()); |
| 290 m->WriteUInt64(p.pagefile_size()); |
| 291 } |
| 292 |
| 293 // static |
| 294 bool ParamTraits<remoting::protocol::AggregatedProcessResourceUsage>::Read( |
| 295 const base::Pickle* m, |
| 296 base::PickleIterator* iter, |
| 297 remoting::protocol::AggregatedProcessResourceUsage* p) { |
| 298 std::string name; |
| 299 double processor_usage; |
| 300 uint64_t working_set_size; |
| 301 uint64_t pagefile_size; |
| 302 if (!iter->ReadString(&name) || |
| 303 !iter->ReadDouble(&processor_usage) || |
| 304 !iter->ReadUInt64(&working_set_size) || |
| 305 !iter->ReadUInt64(&pagefile_size)) { |
| 306 return false; |
| 307 } |
| 308 |
| 309 p->set_name(name); |
| 310 p->set_processor_usage(processor_usage); |
| 311 p->set_working_set_size(working_set_size); |
| 312 p->set_pagefile_size(pagefile_size); |
| 313 return true; |
| 314 } |
| 315 |
| 316 // static |
| 317 void ParamTraits<remoting::protocol::AggregatedProcessResourceUsage>::Log( |
| 318 const remoting::protocol::AggregatedProcessResourceUsage& p, |
| 319 std::string* l) { |
| 320 l->append("AggregatedProcessResourceUsage()"); |
| 321 } |
| 322 |
283 } // namespace IPC | 323 } // namespace IPC |
284 | 324 |
OLD | NEW |