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

Unified Diff: chrome/browser/process_singleton_win.cc

Issue 46076: Removed zombie hunter code (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/process_singleton_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
-}
« no previous file with comments | « chrome/browser/process_singleton_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698