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

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

Issue 3750001: base: Move SplitString functions into the base namespace and update the callers. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: brett review, reverted changes in o3d due to it's using an old base revision Created 10 years, 2 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/chrome_process_util.h" 5 #include "chrome/test/chrome_process_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 19 matching lines...) Expand all
30 cmdline.push_back(StringPrintf("%d", *process_iter)); 30 cmdline.push_back(StringPrintf("%d", *process_iter));
31 } 31 }
32 32
33 // Invoke it 33 // Invoke it
34 std::string ps_output; 34 std::string ps_output;
35 if (!base::GetAppOutput(CommandLine(cmdline), &ps_output)) 35 if (!base::GetAppOutput(CommandLine(cmdline), &ps_output))
36 return result; // All the pids might have exited 36 return result; // All the pids might have exited
37 37
38 // Process the results 38 // Process the results
39 std::vector<std::string> ps_output_lines; 39 std::vector<std::string> ps_output_lines;
40 SplitString(ps_output, '\n', &ps_output_lines); 40 base::SplitString(ps_output, '\n', &ps_output_lines);
41 std::vector<std::string>::const_iterator line_iter; 41 std::vector<std::string>::const_iterator line_iter;
42 for (line_iter = ps_output_lines.begin(); 42 for (line_iter = ps_output_lines.begin();
43 line_iter != ps_output_lines.end(); 43 line_iter != ps_output_lines.end();
44 ++line_iter) { 44 ++line_iter) {
45 std::string line(CollapseWhitespaceASCII(*line_iter, false)); 45 std::string line(CollapseWhitespaceASCII(*line_iter, false));
46 std::vector<std::string> values; 46 std::vector<std::string> values;
47 SplitString(line, ' ', &values); 47 base::SplitString(line, ' ', &values);
48 if (values.size() == 3) { 48 if (values.size() == 3) {
49 MacChromeProcessInfo proc_info; 49 MacChromeProcessInfo proc_info;
50 int pid; 50 int pid;
51 base::StringToInt(values[0], &pid); 51 base::StringToInt(values[0], &pid);
52 proc_info.pid = pid; 52 proc_info.pid = pid;
53 base::StringToInt(values[1], &proc_info.rsz_in_kb); 53 base::StringToInt(values[1], &proc_info.rsz_in_kb);
54 base::StringToInt(values[2], &proc_info.vsz_in_kb); 54 base::StringToInt(values[2], &proc_info.vsz_in_kb);
55 if (proc_info.pid && proc_info.rsz_in_kb && proc_info.vsz_in_kb) 55 if (proc_info.pid && proc_info.rsz_in_kb && proc_info.vsz_in_kb)
56 result.push_back(proc_info); 56 result.push_back(proc_info);
57 } 57 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 GetMemoryValuesHack(process_handle_, &virtual_size, &working_set_size); 99 GetMemoryValuesHack(process_handle_, &virtual_size, &working_set_size);
100 return virtual_size; 100 return virtual_size;
101 } 101 }
102 102
103 size_t ChromeTestProcessMetrics::GetWorkingSetSize() { 103 size_t ChromeTestProcessMetrics::GetWorkingSetSize() {
104 size_t virtual_size; 104 size_t virtual_size;
105 size_t working_set_size; 105 size_t working_set_size;
106 GetMemoryValuesHack(process_handle_, &virtual_size, &working_set_size); 106 GetMemoryValuesHack(process_handle_, &virtual_size, &working_set_size);
107 return working_set_size; 107 return working_set_size;
108 } 108 }
OLDNEW
« no previous file with comments | « chrome/test/automated_ui_tests/automated_ui_tests.cc ('k') | chrome/test/selenium/selenium_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698