Fix <rdar://5346832> Infinite recursion when opening Web Inspector on more than...
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2007 00:44:38 +0000 (00:44 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2007 00:44:38 +0000 (00:44 +0000)
commit7fbba3d2af5424b1f110feb70e52702121f2f328
tree8a9149b8291b493063baa1b8c6a581a0085e19b7
parentdbc0c5fd75841a74b1e025aa28408cb5e8a4de64
 Fix <rdar://5346832> Infinite recursion when opening Web Inspector on more than one tab

 WebCore:

         Add WindowMessageBroadcaster

         This class is used to listen in on messages sent to HWNDs. Multiple
         WindowMessageListeners can be notified about messages sent to a single
         HWND, and one WindowMessageListener can listen to messages from
         multiple HWNDs.

         Reviewed by Ada.

         * WebCore.vcproj/WebCore.vcproj: Added new files to project.
         * platform/win/WindowMessageBroadcaster.cpp: Added.
         (WebCore::instancesMap): Static helper.
         (WebCore::WindowMessageBroadcaster::addListener): Registers a listener
         for a particular HWND.
         (WebCore::WindowMessageBroadcaster::removeListener): Removes a
         listener for a particular HWND.
         (WebCore::WindowMessageBroadcaster::WindowMessageBroadcaster):
         (WebCore::WindowMessageBroadcaster::~WindowMessageBroadcaster):
         (WebCore::WindowMessageBroadcaster::destroy): Removes this broadcaster
         from the instancesMap, removes all of its listeners, unsubclasses the
         window, and deletes the broadcaster.
         (WebCore::WindowMessageBroadcaster::unsubclassWindow): Unsubclasses
         the window (which means that SubclassedWndProc won't be called again
         for this window).
         (WebCore::WindowMessageBroadcaster::SubclassedWndProc): Notifies all
         the listeners about every message sent to the HWND
         * platform/win/WindowMessageBroadcaster.h: Added.
         (WebCore::WindowMessageBroadcaster::listeners):
         (WebCore::WindowMessageBroadcaster::originalWndProc):
         * platform/win/WindowMessageListener.h: Added.

 WebKit/win:

         Fix <rdar://5346832> Infinite recursion when opening Web Inspector on more than one tab

         The bug was that multiple WebNodeHighlights would subclass the same
         browser window, leading to infinite recursion within
         SubclassedWndProc.

         WebNodeHighlight is now a WindowMessageListener, and lets
         WindowMessageBroadcaster handle subclassing the window.

         Reviewed by Ada.

         * WebNodeHighlight.cpp:
         (WebNodeHighlight::WebNodeHighlight): Initialize m_observedWindow
         member.
         (WebNodeHighlight::~WebNodeHighlight): Unregister as a listener for
         m_observedWindow.
         (WebNodeHighlight::highlight): Register as a listener.
         (WebNodeHighlight::windowReceivedMessage): Do the work that used to be
         done in SubclassedWndProc.
         * WebNodeHighlight.h: Made WebNodeHighlight a WindowMessageListener,
         and renamed m_subclassedWindow to m_observedWindow.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/platform/win/WindowMessageBroadcaster.cpp [new file with mode: 0644]
WebCore/platform/win/WindowMessageBroadcaster.h [new file with mode: 0644]
WebCore/platform/win/WindowMessageListener.h [new file with mode: 0644]
WebKit/win/ChangeLog
WebKit/win/WebNodeHighlight.cpp
WebKit/win/WebNodeHighlight.h