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

Unified Diff: base/process/process_linux.cc

Issue 1474483002: Fix split in base::ProcessIsProcessBackgrounded() (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Added tests Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/process/process_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_linux.cc
diff --git a/base/process/process_linux.cc b/base/process/process_linux.cc
index ce3dca1351872c44df97ceb274077bf3adb9083e..78000db9f21336ceebb1d3e3984c58bcd88e68dc 100644
--- a/base/process/process_linux.cc
+++ b/base/process/process_linux.cc
@@ -140,8 +140,8 @@ bool IsProcessBackgroundedCGroup(const StringPiece& cgroup_contents) {
// hierarchy there's an entry in the file. We look for a control group
// named "/chrome_renderers/background" to determine if the process is
// backgrounded. crbug.com/548818.
- std::vector<StringPiece> lines =
- SplitStringPiece(cgroup_contents, "\n", TRIM_WHITESPACE, SPLIT_WANT_ALL);
+ std::vector<StringPiece> lines = SplitStringPiece(
+ cgroup_contents, "\n", TRIM_WHITESPACE, SPLIT_WANT_NONEMPTY);
for (const auto& line : lines) {
std::vector<StringPiece> fields =
SplitStringPiece(line, ":", TRIM_WHITESPACE, SPLIT_WANT_ALL);
« no previous file with comments | « no previous file | base/process/process_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698