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

Unified Diff: mojo/common/common_custom_types_struct_traits.h

Issue 2831073003: Reland of [Memory UMA] Return the extra_processes_dump map as part of the ResponseCallback (Closed)
Patch Set: Created 3 years, 8 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 | « mojo/common/BUILD.gn ('k') | mojo/common/common_custom_types_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/common_custom_types_struct_traits.h
diff --git a/mojo/common/common_custom_types_struct_traits.h b/mojo/common/common_custom_types_struct_traits.h
index b20c795b96562e936573eb535e41cb3baf7c55b3..426489ff031678d59b4427619530f9fc249b9569 100644
--- a/mojo/common/common_custom_types_struct_traits.h
+++ b/mojo/common/common_custom_types_struct_traits.h
@@ -7,11 +7,13 @@
#include "base/files/file.h"
#include "base/i18n/rtl.h"
+#include "base/process/process_handle.h"
#include "base/strings/utf_string_conversions.h"
#include "base/unguessable_token.h"
#include "base/version.h"
#include "mojo/common/file.mojom-shared.h"
#include "mojo/common/mojo_common_export.h"
+#include "mojo/common/process_id.mojom-shared.h"
#include "mojo/common/string16.mojom-shared.h"
#include "mojo/common/text_direction.mojom-shared.h"
#include "mojo/common/time.mojom-shared.h"
@@ -63,6 +65,19 @@
};
template <>
+struct StructTraits<common::mojom::ProcessIdDataView, base::ProcessId> {
+ static uint32_t pid(const base::ProcessId& process_id) {
+ return static_cast<uint32_t>(process_id);
+ }
+
+ static bool Read(common::mojom::ProcessIdDataView data,
+ base::ProcessId* process_id) {
+ *process_id = static_cast<base::ProcessId>(data.pid());
+ return true;
+ }
+};
+
+template <>
struct StructTraits<common::mojom::TimeDeltaDataView, base::TimeDelta> {
static int64_t microseconds(const base::TimeDelta& delta) {
return delta.InMicroseconds();
« no previous file with comments | « mojo/common/BUILD.gn ('k') | mojo/common/common_custom_types_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698