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

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: 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..d62519b559044de0061690f6719db94676c83cd3 100644
--- a/base/process_util.cc
+++ b/base/process_util.cc
@@ -60,6 +60,16 @@ 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)
brettw 2011/08/24 20:46:58 Use {} for multiple-line conditionals.
michaelbai 2011/08/24 23:02:18 Done.
+ executable_name_ = FilePath::StringType(executable_name_,
+ executable_name_.size() - 15, 15);
+#endif
}
NamedProcessIterator::~NamedProcessIterator() {

Powered by Google App Engine
This is Rietveld 408576698