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

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
Index: chrome/test/base/chrome_process_util.cc
===================================================================
--- chrome/test/base/chrome_process_util.cc (revision 97870)
+++ chrome/test/base/chrome_process_util.cc (working copy)
@@ -4,8 +4,8 @@
#include "chrome/test/base/chrome_process_util.h"
+#include <set>
#include <vector>
-#include <set>
#include "base/command_line.h"
#include "base/process_util.h"
@@ -59,11 +59,31 @@
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.
+ std::string name_eh(name);
+ name_eh.append(" EH");
+ names.push_back(name_eh);
+
+ std::string name_np(name);
+ name_np.append(" NP");
+ names.push_back(name_np);
+#endif
+
+ return names;
}
ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) {
@@ -95,12 +115,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);

Powered by Google App Engine
This is Rietveld 408576698