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

Unified Diff: chrome/test/chrome_process_util.cc

Issue 7185023: Support Chromium-branded builds and cleanup reference build usage. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: . Created 9 years, 6 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/chrome_process_util.cc
diff --git a/chrome/test/chrome_process_util.cc b/chrome/test/chrome_process_util.cc
index f17402665ab6a296e2b74366bb06cd73df56f255..833ea37074237d4f7e54ef349faa3b40ff533f8d 100644
--- a/chrome/test/chrome_process_util.cc
+++ b/chrome/test/chrome_process_util.cc
@@ -7,9 +7,11 @@
#include <vector>
#include <set>
+#include "base/command_line.h"
#include "base/process_util.h"
#include "base/time.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/test/test_switches.h"
#include "content/common/result_codes.h"
using base::TimeDelta;
@@ -50,13 +52,21 @@ class ChildProcessFilter : public base::ProcessFilter {
DISALLOW_COPY_AND_ASSIGN(ChildProcessFilter);
};
+const FilePath::CharType* GetRunningExecutableName() {
+ const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kEnableChromiumBranding))
+ return chrome::kBrowserProcessExecutableNameChromium;
+ return chrome::kBrowserProcessExecutableName;
+}
+
ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) {
+ const FilePath::CharType* executable_name = GetRunningExecutableName();
ChromeProcessList result;
if (browser_pid == static_cast<base::ProcessId>(-1))
return result;
ChildProcessFilter filter(browser_pid);
- base::NamedProcessIterator it(chrome::kBrowserProcessExecutableName, &filter);
+ base::NamedProcessIterator it(executable_name, &filter);
while (const base::ProcessEntry* process_entry = it.NextProcessEntry()) {
result.push_back(process_entry->pid());
}
@@ -67,8 +77,7 @@ ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) {
// are children of one of the processes that we've already seen.
{
ChildProcessFilter filter(result);
- base::NamedProcessIterator it(chrome::kBrowserProcessExecutableName,
- &filter);
+ base::NamedProcessIterator it(executable_name, &filter);
while (const base::ProcessEntry* process_entry = it.NextProcessEntry())
result.push_back(process_entry->pid());
}
@@ -80,8 +89,7 @@ ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) {
// name. We must collect them in a second pass.
{
ChildProcessFilter filter(browser_pid);
- base::NamedProcessIterator it(chrome::kHelperProcessExecutableName,
- &filter);
+ base::NamedProcessIterator it(executable_name, &filter);
while (const base::ProcessEntry* process_entry = it.NextProcessEntry())
result.push_back(process_entry->pid());
}

Powered by Google App Engine
This is Rietveld 408576698