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

Side by Side Diff: chrome/common/chrome_process_filter.cc

Issue 54003: Replace chrome_process_filter with chrome_process_util. (Closed)
Patch Set: error handling Created 11 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/common/chrome_process_filter.h ('k') | chrome/common/common.vcproj » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <windows.h>
6
7 #include "chrome/common/chrome_process_filter.h"
8
9 #include "base/path_service.h"
10 #include "chrome/common/chrome_constants.h"
11 #include "chrome/common/chrome_paths.h"
12
13 BrowserProcessFilter::BrowserProcessFilter(const std::wstring user_data_dir)
14 : browser_process_id_(0),
15 user_data_dir_(user_data_dir) {
16 // Find the message window (if any) for the current user data directory,
17 // and get its process ID. We'll only count browser processes that either
18 // have the same process ID or have that process ID as their parent.
19
20 if (user_data_dir_.length() == 0)
21 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_);
22
23
24 HWND message_window = FindWindowEx(HWND_MESSAGE, NULL,
25 chrome::kMessageWindowClass,
26 user_data_dir_.c_str());
27 if (message_window)
28 GetWindowThreadProcessId(message_window, &browser_process_id_);
29 }
30
31 bool BrowserProcessFilter::Includes(base::ProcessId pid,
32 base::ProcessId parent_pid) const {
33 return browser_process_id_ && (browser_process_id_ == pid ||
34 browser_process_id_ == parent_pid);
35 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_process_filter.h ('k') | chrome/common/common.vcproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698