diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-23 21:23:06 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-23 21:23:06 +0000 |
commit | f3b25f5b9d0e780fbf74d990c356d65d8601ad74 (patch) | |
tree | 47753c5643b205b7f6914da088b5430fd16f20a1 /chrome/browser/process_singleton_win.cc | |
parent | 0bdc167735e5eac417a2c5ba9120abf613c6757f (diff) | |
download | chromium_src-f3b25f5b9d0e780fbf74d990c356d65d8601ad74.zip chromium_src-f3b25f5b9d0e780fbf74d990c356d65d8601ad74.tar.gz chromium_src-f3b25f5b9d0e780fbf74d990c356d65d8601ad74.tar.bz2 |
Removed zombie hunter code
BUG=6468
Review URL: http://codereview.chromium.org/46076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton_win.cc')
-rw-r--r-- | chrome/browser/process_singleton_win.cc | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc index 190804f..af61e22 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc @@ -248,57 +248,3 @@ LRESULT CALLBACK ProcessSingleton::WndProc(HWND hwnd, UINT message, return ::DefWindowProc(hwnd, message, wparam, lparam); } - -void ProcessSingleton::HuntForZombieChromeProcesses() { - // Detecting dead renderers is simple: - // - The process is named chrome.exe. - // - The process' parent doesn't exist anymore. - // - The process doesn't have a chrome::kMessageWindowClass window. - // If these conditions hold, the process is a zombie renderer or plugin. - - // Retrieve the list of browser processes on start. This list is then used to - // detect zombie renderer process or plugin process. - class ZombieDetector : public base::ProcessFilter { - public: - ZombieDetector() { - for (HWND window = NULL;;) { - window = FindWindowEx(HWND_MESSAGE, - window, - chrome::kMessageWindowClass, - NULL); - if (!window) - break; - DWORD process = 0; - GetWindowThreadProcessId(window, &process); - if (process) - browsers_.push_back(process); - } - // We are also a browser, regardless of having the window or not. - browsers_.push_back(::GetCurrentProcessId()); - } - - virtual bool Includes(uint32 pid, uint32 parent_pid) const { - // Don't kill ourself eh. - if (GetCurrentProcessId() == pid) - return false; - - // Is this a browser? If so, ignore it. - if (std::find(browsers_.begin(), browsers_.end(), pid) != browsers_.end()) - return false; - - // Is the parent a browser? If so, ignore it. - if (std::find(browsers_.begin(), browsers_.end(), parent_pid) - != browsers_.end()) - return false; - - // The chrome process is orphan. - return true; - } - - protected: - std::vector<uint32> browsers_; - }; - - ZombieDetector zombie_detector; - base::KillProcesses(L"chrome.exe", ResultCodes::HUNG, &zombie_detector); -} |