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

Unified Diff: chrome/test/base/chrome_process_util.cc

Issue 7714018: Give plug-in processes an executable heap and disable PIE/ASLR for Native (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
« no previous file with comments | « chrome/service/service_utility_process_host.cc ('k') | chrome/tools/build/mac/make_locale_dirs.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/chrome_process_util.cc
===================================================================
--- chrome/test/base/chrome_process_util.cc (revision 97969)
+++ chrome/test/base/chrome_process_util.cc (working copy)
@@ -4,8 +4,9 @@
#include "chrome/test/base/chrome_process_util.h"
+#include <set>
+#include <string>
#include <vector>
-#include <set>
#include "base/command_line.h"
#include "base/process_util.h"
@@ -59,11 +60,32 @@
return chrome::kBrowserProcessExecutableName;
}
-const FilePath::CharType* GetRunningHelperExecutableName() {
+std::vector<FilePath::StringType> GetRunningHelperExecutableNames() {
+ FilePath::StringType name;
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
- if (cmd_line->HasSwitch(switches::kEnableChromiumBranding))
- return chrome::kHelperProcessExecutableNameChromium;
- return chrome::kHelperProcessExecutableName;
+ if (cmd_line->HasSwitch(switches::kEnableChromiumBranding)) {
+ name = chrome::kHelperProcessExecutableNameChromium;
+ } else {
+ name = chrome::kHelperProcessExecutableName;
+ }
+
+ std::vector<FilePath::StringType> names;
+ names.push_back(name);
+
+#if defined(OS_MACOSX)
+ // The helper might show up as these different flavors depending on the
+ // executable flags required.
+ for (const char* const* suffix = chrome::kHelperFlavorSuffixes;
+ *suffix;
+ ++suffix) {
+ std::string flavor_name(name);
+ flavor_name.append(1, ' ');
+ flavor_name.append(*suffix);
+ names.push_back(flavor_name);
+ }
+#endif
+
+ return names;
}
ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) {
@@ -95,12 +117,16 @@
// on Linux via /proc/self/exe, so they end up with a different
// name. We must collect them in a second pass.
{
- ChildProcessFilter filter(browser_pid);
- base::NamedProcessIterator it(GetRunningHelperExecutableName(), &filter);
- while (const base::ProcessEntry* process_entry = it.NextProcessEntry())
- result.push_back(process_entry->pid());
+ std::vector<FilePath::StringType> names = GetRunningHelperExecutableNames();
+ for (size_t i = 0; i < names.size(); ++i) {
+ FilePath::StringType name = names[i];
+ ChildProcessFilter filter(browser_pid);
+ base::NamedProcessIterator it(name, &filter);
+ while (const base::ProcessEntry* process_entry = it.NextProcessEntry())
+ result.push_back(process_entry->pid());
+ }
}
-#endif // defined(OS_MACOSX)
+#endif // defined(OS_POSIX)
result.push_back(browser_pid);
« no previous file with comments | « chrome/service/service_utility_process_host.cc ('k') | chrome/tools/build/mac/make_locale_dirs.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698