OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/process_util.h" | 5 #include "base/process_util.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <dirent.h> | 8 #include <dirent.h> |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #include <errno.h> | 10 #include <errno.h> |
11 #include <fcntl.h> | 11 #include <fcntl.h> |
12 #include <sys/time.h> | 12 #include <sys/time.h> |
13 #include <sys/types.h> | 13 #include <sys/types.h> |
14 #include <sys/wait.h> | 14 #include <sys/wait.h> |
15 #include <time.h> | 15 #include <time.h> |
16 #include <unistd.h> | 16 #include <unistd.h> |
17 | 17 |
18 #include "base/file_util.h" | 18 #include "base/file_util.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/string_number_conversions.h" | 20 #include "base/string_number_conversions.h" |
| 21 #include "base/string_split.h" |
21 #include "base/string_tokenizer.h" | 22 #include "base/string_tokenizer.h" |
22 #include "base/string_util.h" | 23 #include "base/string_util.h" |
23 #include "base/sys_info.h" | 24 #include "base/sys_info.h" |
24 | 25 |
25 namespace { | 26 namespace { |
26 | 27 |
27 enum ParsingState { | 28 enum ParsingState { |
28 KEY_NAME, | 29 KEY_NAME, |
29 KEY_VALUE | 30 KEY_VALUE |
30 }; | 31 }; |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 | 643 |
643 if (!file_util::PathExists(oom_adj)) | 644 if (!file_util::PathExists(oom_adj)) |
644 return false; | 645 return false; |
645 | 646 |
646 std::string score_str = base::IntToString(score); | 647 std::string score_str = base::IntToString(score); |
647 return (static_cast<int>(score_str.length()) == | 648 return (static_cast<int>(score_str.length()) == |
648 file_util::WriteFile(oom_adj, score_str.c_str(), score_str.length())); | 649 file_util::WriteFile(oom_adj, score_str.c_str(), score_str.length())); |
649 } | 650 } |
650 | 651 |
651 } // namespace base | 652 } // namespace base |
OLD | NEW |