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

Side by Side Diff: chrome/test/base/chrome_process_util_mac.cc

Issue 1548153002: Switch to standard integer types in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/test/base/chrome_process_util.h" 5 #include "chrome/test/base/chrome_process_util.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
7 #include <string> 10 #include <string>
8 #include <vector> 11 #include <vector>
9 12
10 #include "base/command_line.h" 13 #include "base/command_line.h"
11 #include "base/process/launch.h" 14 #include "base/process/launch.h"
12 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/string_split.h" 16 #include "base/strings/string_split.h"
14 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
15 18
16 MacChromeProcessInfoList GetRunningMacProcessInfo( 19 MacChromeProcessInfoList GetRunningMacProcessInfo(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 56 }
54 } 57 }
55 58
56 return result; 59 return result;
57 } 60 }
58 61
59 // Common interface for fetching memory values from parsed ps output. 62 // Common interface for fetching memory values from parsed ps output.
60 // We fill in both values we may get called for, even though our 63 // We fill in both values we may get called for, even though our
61 // callers typically only care about one, just to keep the code 64 // callers typically only care about one, just to keep the code
62 // simple and because this is a test. 65 // simple and because this is a test.
63 static bool GetMemoryValuesHack(uint32 process_id, 66 static bool GetMemoryValuesHack(uint32_t process_id,
64 size_t* virtual_size, 67 size_t* virtual_size,
65 size_t* working_set_size) { 68 size_t* working_set_size) {
66 DCHECK(virtual_size && working_set_size); 69 DCHECK(virtual_size && working_set_size);
67 70
68 std::vector<base::ProcessId> processes; 71 std::vector<base::ProcessId> processes;
69 processes.push_back(process_id); 72 processes.push_back(process_id);
70 73
71 MacChromeProcessInfoList process_info = GetRunningMacProcessInfo(processes); 74 MacChromeProcessInfoList process_info = GetRunningMacProcessInfo(processes);
72 if (process_info.empty()) 75 if (process_info.empty())
73 return false; 76 return false;
74 77
75 bool found_process = false; 78 bool found_process = false;
(...skipping 19 matching lines...) Expand all
95 GetMemoryValuesHack(process_handle_, &virtual_size, &working_set_size); 98 GetMemoryValuesHack(process_handle_, &virtual_size, &working_set_size);
96 return virtual_size; 99 return virtual_size;
97 } 100 }
98 101
99 size_t ChromeTestProcessMetrics::GetWorkingSetSize() { 102 size_t ChromeTestProcessMetrics::GetWorkingSetSize() {
100 size_t virtual_size; 103 size_t virtual_size;
101 size_t working_set_size; 104 size_t working_set_size;
102 GetMemoryValuesHack(process_handle_, &virtual_size, &working_set_size); 105 GetMemoryValuesHack(process_handle_, &virtual_size, &working_set_size);
103 return working_set_size; 106 return working_set_size;
104 } 107 }
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_process_util.cc ('k') | chrome/test/base/chrome_render_view_host_test_harness.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698