summaryrefslogtreecommitdiffstats
path: root/chrome/test/chrome_process_util.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 22:44:57 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 22:44:57 +0000
commit6aa9349ef5c1110d9c096945840e6a105e8a8295 (patch)
tree8afce0e1f3aae77e05105cfbe0d24ea3bdae9106 /chrome/test/chrome_process_util.h
parentb61236c6679615af0811d59d130c91397d8c6be7 (diff)
downloadchromium_src-6aa9349ef5c1110d9c096945840e6a105e8a8295.zip
chromium_src-6aa9349ef5c1110d9c096945840e6a105e8a8295.tar.gz
chromium_src-6aa9349ef5c1110d9c096945840e6a105e8a8295.tar.bz2
Replace chrome_process_filter with chrome_process_util.
- move code only used by tests to chrome/test - make a better, more portable abstraction For now, it still only works on Windows. But this is the first step to porting this part of code. Patch by phajdan.jr@chromium.org: <http://codereview.chromium.org/54003> Review URL: http://codereview.chromium.org/67004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13476 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/chrome_process_util.h')
-rw-r--r--chrome/test/chrome_process_util.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/chrome/test/chrome_process_util.h b/chrome/test/chrome_process_util.h
new file mode 100644
index 0000000..31f3b5f
--- /dev/null
+++ b/chrome/test/chrome_process_util.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_TEST_CHROME_PROCESS_UTIL_H_
+#define CHROME_TEST_CHROME_PROCESS_UTIL_H_
+
+#include <vector>
+
+#include "base/file_path.h"
+#include "base/process_util.h"
+
+typedef std::vector<base::ProcessId> ChromeProcessList;
+
+// Returns PID of browser process running with user data dir |data_dir|.
+// Returns -1 on error.
+base::ProcessId ChromeBrowserProcessId(const FilePath& data_dir);
+
+// Returns a vector of PIDs of chrome processes (main and renderers etc)
+// associated with user data dir |data_dir|. On error returns empty vector.
+ChromeProcessList GetRunningChromeProcesses(const FilePath& data_dir);
+
+// Attempts to terminate all chrome processes associated with |data_dir|.
+void TerminateAllChromeProcesses(const FilePath& data_dir);
+
+#endif // CHROME_TEST_CHROME_PROCESS_UTIL_H_