| Index: chrome/browser/process_singleton_win.cc
|
| ===================================================================
|
| --- chrome/browser/process_singleton_win.cc (revision 11710)
|
| +++ chrome/browser/process_singleton_win.cc (working copy)
|
| @@ -248,57 +248,3 @@
|
|
|
| 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);
|
| -}
|
|
|