| Index: base/process_util_linux.cc
|
| diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
|
| index 2f433d984eb628dbdeee3d6f711d303939ceb4ee..e4a24e75033765d7985afdbc037c1f9f40637317 100644
|
| --- a/base/process_util_linux.cc
|
| +++ b/base/process_util_linux.cc
|
| @@ -123,18 +123,18 @@ ProcessId GetParentProcessId(ProcessHandle process) {
|
|
|
| StringTokenizer tokenizer(status, ":\n");
|
| ParsingState state = KEY_NAME;
|
| - std::string last_key_name;
|
| + StringPiece last_key_name;
|
| while (tokenizer.GetNext()) {
|
| switch (state) {
|
| case KEY_NAME:
|
| - last_key_name = tokenizer.token();
|
| + last_key_name = tokenizer.token_piece();
|
| state = KEY_VALUE;
|
| break;
|
| case KEY_VALUE:
|
| DCHECK(!last_key_name.empty());
|
| if (last_key_name == "PPid") {
|
| int ppid;
|
| - base::StringToInt(tokenizer.token(), &ppid);
|
| + base::StringToInt(tokenizer.token_piece(), &ppid);
|
| return ppid;
|
| }
|
| state = KEY_NAME;
|
| @@ -380,12 +380,12 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
|
| }
|
| if (last_key_name.starts_with(private_prefix)) {
|
| int cur;
|
| - base::StringToInt(tokenizer.token(), &cur);
|
| + base::StringToInt(tokenizer.token_piece(), &cur);
|
| private_kb += cur;
|
| } else if (last_key_name.starts_with(pss_prefix)) {
|
| have_pss = true;
|
| int cur;
|
| - base::StringToInt(tokenizer.token(), &cur);
|
| + base::StringToInt(tokenizer.token_piece(), &cur);
|
| pss_kb += cur;
|
| }
|
| state = KEY_NAME;
|
| @@ -490,26 +490,26 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
|
|
|
| StringTokenizer tokenizer(proc_io_contents, ": \n");
|
| ParsingState state = KEY_NAME;
|
| - std::string last_key_name;
|
| + StringPiece last_key_name;
|
| while (tokenizer.GetNext()) {
|
| switch (state) {
|
| case KEY_NAME:
|
| - last_key_name = tokenizer.token();
|
| + last_key_name = tokenizer.token_piece();
|
| state = KEY_VALUE;
|
| break;
|
| case KEY_VALUE:
|
| DCHECK(!last_key_name.empty());
|
| if (last_key_name == "syscr") {
|
| - base::StringToInt64(tokenizer.token(),
|
| + base::StringToInt64(tokenizer.token_piece(),
|
| reinterpret_cast<int64*>(&(*io_counters).ReadOperationCount));
|
| } else if (last_key_name == "syscw") {
|
| - base::StringToInt64(tokenizer.token(),
|
| + base::StringToInt64(tokenizer.token_piece(),
|
| reinterpret_cast<int64*>(&(*io_counters).WriteOperationCount));
|
| } else if (last_key_name == "rchar") {
|
| - base::StringToInt64(tokenizer.token(),
|
| + base::StringToInt64(tokenizer.token_piece(),
|
| reinterpret_cast<int64*>(&(*io_counters).ReadTransferCount));
|
| } else if (last_key_name == "wchar") {
|
| - base::StringToInt64(tokenizer.token(),
|
| + base::StringToInt64(tokenizer.token_piece(),
|
| reinterpret_cast<int64*>(&(*io_counters).WriteTransferCount));
|
| }
|
| state = KEY_NAME;
|
|
|