OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_COMMON_CHROME_PROCESS_FILTER_H__ | 5 #ifndef CHROME_COMMON_CHROME_PROCESS_FILTER_H__ |
6 #define CHROME_COMMON_CHROME_PROCESS_FILTER_H__ | 6 #define CHROME_COMMON_CHROME_PROCESS_FILTER_H__ |
7 | 7 |
8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
9 | 9 |
10 // Filter all chrome browser processes that run with the same user data | 10 // Filter all chrome browser processes that run with the same user data |
11 // directory. | 11 // directory. |
12 class BrowserProcessFilter : public base::ProcessFilter { | 12 class BrowserProcessFilter : public base::ProcessFilter { |
13 public: | 13 public: |
14 // Create the filter for the given user_data_dir. | 14 // Create the filter for the given user_data_dir. |
15 // If user_data_dir is an empty string, will use the PathService | 15 // If user_data_dir is an empty string, will use the PathService |
16 // user_data_dir (e.g. chrome::DIR_USER_DATA). | 16 // user_data_dir (e.g. chrome::DIR_USER_DATA). |
17 explicit BrowserProcessFilter(const std::wstring user_data_dir); | 17 explicit BrowserProcessFilter(const std::wstring user_data_dir); |
18 | 18 |
19 uint32 browser_process_id() const { return browser_process_id_; } | 19 uint32 browser_process_id() const { return browser_process_id_; } |
20 | 20 |
21 virtual bool Includes(uint32 pid, uint32 parent_pid) const; | 21 virtual bool Includes(base::ProcessId pid, base::ProcessId parent_pid) const; |
22 | 22 |
23 private: | 23 private: |
24 std::wstring user_data_dir_; | 24 std::wstring user_data_dir_; |
25 DWORD browser_process_id_; | 25 DWORD browser_process_id_; |
26 | 26 |
27 DISALLOW_EVIL_CONSTRUCTORS(BrowserProcessFilter); | 27 DISALLOW_EVIL_CONSTRUCTORS(BrowserProcessFilter); |
28 }; | 28 }; |
29 | 29 |
30 #endif // CHROME_COMMON_CHROME_PROCESS_FILTER_H__ | 30 #endif // CHROME_COMMON_CHROME_PROCESS_FILTER_H__ |
OLD | NEW |