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

Unified Diff: base/trace_event/process_memory_maps.cc

Issue 960873002: Update from https://crrev.com/318214 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « base/trace_event/process_memory_maps.h ('k') | base/trace_event/process_memory_maps_dump_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/process_memory_maps.cc
diff --git a/base/trace_event/process_memory_maps.cc b/base/trace_event/process_memory_maps.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bf3c5a00f15926b9331034e1c74f8afaf063ae10
--- /dev/null
+++ b/base/trace_event/process_memory_maps.cc
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/trace_event/process_memory_maps.h"
+
+#include "base/trace_event/trace_event_argument.h"
+
+namespace base {
+namespace trace_event {
+
+// static
+const uint32 ProcessMemoryMaps::VMRegion::kProtectionFlagsRead = 4;
+const uint32 ProcessMemoryMaps::VMRegion::kProtectionFlagsWrite = 2;
+const uint32 ProcessMemoryMaps::VMRegion::kProtectionFlagsExec = 1;
+
+ProcessMemoryMaps::ProcessMemoryMaps() {
+}
+
+ProcessMemoryMaps::~ProcessMemoryMaps() {
+}
+
+void ProcessMemoryMaps::AsValueInto(TracedValue* value) const {
+ value->BeginArray("vm_regions");
+ for (const auto& region : vm_regions_) {
+ value->BeginDictionary();
+
+ value->SetDouble("start_address", region.start_address);
+ value->SetDouble("size_in_bytes", region.size_in_bytes);
+ value->SetInteger("protection_flags", region.protection_flags);
+ value->SetString("mapped_file", region.mapped_file);
+ value->SetDouble("mapped_file_offset", region.mapped_file_offset);
+
+ value->BeginDictionary("byte_stats");
+ value->SetDouble("resident", region.byte_stats_resident);
+ value->SetDouble("anonymous", region.byte_stats_anonymous);
+ value->EndDictionary();
+
+ value->EndDictionary();
+ }
+ value->EndArray();
+}
+
+} // namespace trace_event
+} // namespace base
« no previous file with comments | « base/trace_event/process_memory_maps.h ('k') | base/trace_event/process_memory_maps_dump_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698