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

Unified Diff: base/process_util.cc

Issue 7701014: Upstream misc changes for android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added more files, and addressed the comments Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: base/process_util.cc
diff --git a/base/process_util.cc b/base/process_util.cc
index 7fe1a8575b80d70b8621e1c930eeb3a4e0803ee6..9979dfa07b1b06ee9d8aca814da04907200f077d 100644
--- a/base/process_util.cc
+++ b/base/process_util.cc
@@ -60,6 +60,17 @@ NamedProcessIterator::NamedProcessIterator(
const FilePath::StringType& executable_name,
const ProcessFilter* filter) : ProcessIterator(filter),
executable_name_(executable_name) {
+#if defined(OS_ANDROID)
+ // On Android, the process name contains only the last 15 characters, which
+ // is in file /proc/<pid>/stat, the string between open parenthesis and close
+ // parenthesis. Please See ProcessIterator::CheckForNextProcess for details.
+ // Now if the length of input process name is greater than 15, only save the
+ // last 15 characters.
+ if (executable_name_.size() > 15) {
+ executable_name_ = FilePath::StringType(executable_name_,
+ executable_name_.size() - 15, 15);
+ }
+#endif
}
NamedProcessIterator::~NamedProcessIterator() {

Powered by Google App Engine
This is Rietveld 408576698