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

Side by Side Diff: base/process/process_linux.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
« no previous file with comments | « base/process/process.h ('k') | base/process/process_metrics_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/process/process.h" 5 #include "base/process/process.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/resource.h> 8 #include <sys/resource.h>
9 9
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 DCHECK(IsValid()); 96 DCHECK(IsValid());
97 97
98 #if defined(OS_CHROMEOS) 98 #if defined(OS_CHROMEOS)
99 if (cgroups.Get().enabled) { 99 if (cgroups.Get().enabled) {
100 std::string proc; 100 std::string proc;
101 if (base::ReadFileToString( 101 if (base::ReadFileToString(
102 base::FilePath(StringPrintf(kProcPath, process_)), 102 base::FilePath(StringPrintf(kProcPath, process_)),
103 &proc)) { 103 &proc)) {
104 std::vector<std::string> proc_parts; 104 std::vector<std::string> proc_parts;
105 base::SplitString(proc, ':', &proc_parts); 105 base::SplitString(proc, ':', &proc_parts);
106 DCHECK(proc_parts.size() == 3); 106 DCHECK_EQ(proc_parts.size(), 3u);
107 bool ret = proc_parts[2] == std::string(kBackground); 107 bool ret = proc_parts[2] == std::string(kBackground);
108 return ret; 108 return ret;
109 } else { 109 } else {
110 return false; 110 return false;
111 } 111 }
112 } 112 }
113 #endif 113 #endif
114 return GetPriority() == kBackgroundPriority; 114 return GetPriority() == kBackgroundPriority;
115 } 115 }
116 116
(...skipping 13 matching lines...) Expand all
130 if (!CanBackgroundProcesses()) 130 if (!CanBackgroundProcesses())
131 return false; 131 return false;
132 132
133 int priority = background ? kBackgroundPriority : kForegroundPriority; 133 int priority = background ? kBackgroundPriority : kForegroundPriority;
134 int result = setpriority(PRIO_PROCESS, process_, priority); 134 int result = setpriority(PRIO_PROCESS, process_, priority);
135 DPCHECK(result == 0); 135 DPCHECK(result == 0);
136 return result == 0; 136 return result == 0;
137 } 137 }
138 138
139 } // namespace base 139 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process.h ('k') | base/process/process_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698