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

Side by Side Diff: base/process_util.cc

Issue 7701014: Upstream misc changes for android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address the comment Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « base/path_service_unittest.cc ('k') | base/shared_memory_android.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_util.h" 5 #include "base/process_util.h"
6 6
7 namespace base { 7 namespace base {
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {} 10 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {}
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 bool ProcessIterator::IncludeEntry() { 55 bool ProcessIterator::IncludeEntry() {
56 return !filter_ || filter_->Includes(entry_); 56 return !filter_ || filter_->Includes(entry_);
57 } 57 }
58 58
59 NamedProcessIterator::NamedProcessIterator( 59 NamedProcessIterator::NamedProcessIterator(
60 const FilePath::StringType& executable_name, 60 const FilePath::StringType& executable_name,
61 const ProcessFilter* filter) : ProcessIterator(filter), 61 const ProcessFilter* filter) : ProcessIterator(filter),
62 executable_name_(executable_name) { 62 executable_name_(executable_name) {
63 #if defined(OS_ANDROID)
64 // On Android, the process name contains only the last 15 characters, which
65 // is in file /proc/<pid>/stat, the string between open parenthesis and close
66 // parenthesis. Please See ProcessIterator::CheckForNextProcess for details.
67 // Now if the length of input process name is greater than 15, only save the
68 // last 15 characters.
69 if (executable_name_.size() > 15) {
70 executable_name_ = FilePath::StringType(executable_name_,
71 executable_name_.size() - 15, 15);
72 }
73 #endif
63 } 74 }
64 75
65 NamedProcessIterator::~NamedProcessIterator() { 76 NamedProcessIterator::~NamedProcessIterator() {
66 } 77 }
67 78
68 } // namespace base 79 } // namespace base
OLDNEW
« no previous file with comments | « base/path_service_unittest.cc ('k') | base/shared_memory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698