From 83f8b61d6498f23b6e74598bffa9866fda52ea3a Mon Sep 17 00:00:00 2001 From: "ojan@google.com" Date: Tue, 3 Feb 2009 23:34:04 +0000 Subject: Reverting 9109. Broke the build. Review URL: http://codereview.chromium.org/20029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9110 0039d316-1c4b-4281-b951-d872f2087c98 --- base/win_util.cc | 63 -------------------------------------------------------- 1 file changed, 63 deletions(-) (limited to 'base/win_util.cc') diff --git a/base/win_util.cc b/base/win_util.cc index e18007b..cfd7f2b 100644 --- a/base/win_util.cc +++ b/base/win_util.cc @@ -4,15 +4,12 @@ #include "base/win_util.h" -#include #include #include "base/logging.h" #include "base/registry.h" #include "base/scoped_handle.h" -#include "base/singleton.h" #include "base/string_util.h" -#include "base/tracked.h" namespace win_util { @@ -364,66 +361,6 @@ std::wstring FormatLastWin32Error() { return FormatMessage(GetLastError()); } -typedef std::map HWNDInfoMap; -struct HWNDBirthMapTrait : public DefaultSingletonTraits { -}; -struct HWNDDeathMapTrait : public DefaultSingletonTraits { -}; - -void NotifyHWNDCreation(const tracked_objects::Location& from_here, HWND hwnd) { - HWNDInfoMap* birth_map = Singleton::get(); - HWNDInfoMap::iterator birth_iter = birth_map->find(hwnd); - if (birth_iter != birth_map->end()) { - birth_map->erase(birth_iter); - - // We have already seen this HWND, was it destroyed? - HWNDInfoMap* death_map = Singleton::get(); - HWNDInfoMap::iterator death_iter = death_map->find(hwnd); - if (death_iter == death_map->end()) { - // We did not get a destruction notification. The code is probably not - // calling NotifyHWNDDestruction for that HWND. - NOTREACHED() << "Creation of HWND reported for already tracked HWND. The " - "HWND destruction is probably not tracked properly. " - "Fix it!"; - } else { - death_map->erase(death_iter); - } - } - birth_map->insert(std::pair(hwnd, - from_here)); -} - -void NotifyHWNDDestruction(const tracked_objects::Location& from_here, - HWND hwnd) { - HWNDInfoMap* death_map = Singleton::get(); - HWNDInfoMap::iterator death_iter = death_map->find(hwnd); - - HWNDInfoMap* birth_map = Singleton::get(); - HWNDInfoMap::iterator birth_iter = birth_map->find(hwnd); - - if (death_iter != death_map->end()) { - std::string allocation, first_delete, second_delete; - if (birth_iter != birth_map->end()) - birth_iter->second.Write(true, true, &allocation); - death_iter->second.Write(true, true, &first_delete); - from_here.Write(true, true, &second_delete); - NOTREACHED() << "Double delete of an HWND. Please file a bug with info on " - "how you got that assertion and the following information:\n" - "Double delete of HWND 0x" << hwnd << "\n" << - "Allocated at " << allocation << "\n" << - "Deleted first at " << first_delete << "\n" << - "Deleted again at " << second_delete; - death_map->erase(death_iter); - } - - if (birth_iter == birth_map->end()) { - NOTREACHED() << "Destruction of HWND reported for unknown HWND. The HWND " - "construction is probably not tracked properly. Fix it!"; - } - death_map->insert(std::pair(hwnd, - from_here)); -} - } // namespace win_util #ifdef _MSC_VER -- cgit v1.1