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

Side by Side Diff: base/trace_event/process_memory_maps_dump_provider.cc

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/trace_event/process_memory_maps_dump_provider.h" 5 #include "base/trace_event/process_memory_maps_dump_provider.h"
6 6
7 #include <cctype> 7 #include <cctype>
8 #include <fstream> 8 #include <fstream>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 29 matching lines...) Expand all
40 if (end_addr > region->start_address) { 40 if (end_addr > region->start_address) {
41 region->size_in_bytes = end_addr - region->start_address; 41 region->size_in_bytes = end_addr - region->start_address;
42 } else { 42 } else {
43 // This is not just paranoia, it can actually happen (See crbug.com/461237). 43 // This is not just paranoia, it can actually happen (See crbug.com/461237).
44 region->size_in_bytes = 0; 44 region->size_in_bytes = 0;
45 res = false; 45 res = false;
46 } 46 }
47 47
48 region->protection_flags = 0; 48 region->protection_flags = 0;
49 *smaps >> protection_flags; 49 *smaps >> protection_flags;
50 CHECK(4UL == protection_flags.size()); 50 CHECK_EQ(4UL, protection_flags.size());
51 if (protection_flags[0] == 'r') { 51 if (protection_flags[0] == 'r') {
52 region->protection_flags |= 52 region->protection_flags |=
53 ProcessMemoryMaps::VMRegion::kProtectionFlagsRead; 53 ProcessMemoryMaps::VMRegion::kProtectionFlagsRead;
54 } 54 }
55 if (protection_flags[1] == 'w') { 55 if (protection_flags[1] == 'w') {
56 region->protection_flags |= 56 region->protection_flags |=
57 ProcessMemoryMaps::VMRegion::kProtectionFlagsWrite; 57 ProcessMemoryMaps::VMRegion::kProtectionFlagsWrite;
58 } 58 }
59 if (protection_flags[2] == 'x') { 59 if (protection_flags[2] == 'x') {
60 region->protection_flags |= 60 region->protection_flags |=
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 return false; 179 return false;
180 } 180 }
181 181
182 const char* ProcessMemoryMapsDumpProvider::GetFriendlyName() const { 182 const char* ProcessMemoryMapsDumpProvider::GetFriendlyName() const {
183 return kDumperFriendlyName; 183 return kDumperFriendlyName;
184 } 184 }
185 185
186 } // namespace trace_event 186 } // namespace trace_event
187 } // namespace base 187 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | base/trace_event/process_memory_totals_dump_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698