Changeset 121909 in webkit


Ignore:
Timestamp:
Jul 5, 2012 9:21:43 AM (12 years ago)
Author:
scheib@chromium.org
Message:

[Chromium] Clear m_currentInputEvent after handled by pointerLockMouseEvent().
https://bugs.webkit.org/show_bug.cgi?id=90391

Source/WebKit/chromium:

WebViewImpl::handleInputEvent was keeping a pointer to an input event that would
later be accessed. When in pointer lock, that pointer was not being cleared.
Code modified to use TemporaryChange to automatically clear the pointer at all
method exit points.

Reviewed by Abhishek Arya.

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::handleInputEvent):

LayoutTests:

Test that reproduces bug 90391:
Enable pointer lock, receive mouse move, call window.open, don't crash.

Reviewed by Abhishek Arya.

  • pointer-lock/bug90391-move-then-window-open-crash-expected.txt: Added.
  • pointer-lock/bug90391-move-then-window-open-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r121907 r121909  
     12012-07-05  Vincent Scheib  <scheib@chromium.org>
     2
     3        [Chromium] Clear m_currentInputEvent after handled by pointerLockMouseEvent().
     4        https://bugs.webkit.org/show_bug.cgi?id=90391
     5
     6        Test that reproduces bug 90391:
     7        Enable pointer lock, receive mouse move, call window.open, don't crash.
     8
     9        Reviewed by Abhishek Arya.
     10
     11        * pointer-lock/bug90391-move-then-window-open-crash-expected.txt: Added.
     12        * pointer-lock/bug90391-move-then-window-open-crash.html: Added.
     13
    1142012-07-05  John Mellor  <johnme@chromium.org>
    215
  • trunk/Source/WebKit/chromium/ChangeLog

    r121907 r121909  
     12012-07-05  Vincent Scheib  <scheib@chromium.org>
     2
     3        [Chromium] Clear m_currentInputEvent after handled by pointerLockMouseEvent().
     4        https://bugs.webkit.org/show_bug.cgi?id=90391
     5
     6        WebViewImpl::handleInputEvent was keeping a pointer to an input event that would
     7        later be accessed. When in pointer lock, that pointer was not being cleared.
     8        Code modified to use TemporaryChange to automatically clear the pointer at all
     9        method exit points.
     10
     11        Reviewed by Abhishek Arya.
     12
     13        * src/WebViewImpl.cpp:
     14        (WebKit::WebViewImpl::handleInputEvent):
     15
    1162012-07-05  John Mellor  <johnme@chromium.org>
    217
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r121451 r121909  
    165165#include <wtf/MainThread.h>
    166166#include <wtf/RefPtr.h>
     167#include <wtf/TemporaryChange.h>
    167168#include <wtf/Uint8ClampedArray.h>
    168169
     
    17611762        return false;
    17621763
    1763     m_currentInputEvent = &inputEvent;
     1764    TemporaryChange<const WebInputEvent*>(m_currentInputEvent, &inputEvent);
    17641765
    17651766#if ENABLE(POINTER_LOCK)
     
    17991800              PlatformMouseEventBuilder(mainFrameImpl()->frameView(), *static_cast<const WebMouseEvent*>(&inputEvent)),
    18001801              eventType, static_cast<const WebMouseEvent*>(&inputEvent)->clickCount);
    1801         m_currentInputEvent = 0;
    18021802        return true;
    18031803    }
    18041804
    18051805    bool handled = PageWidgetDelegate::handleInputEvent(m_page.get(), *this, inputEvent);
    1806     m_currentInputEvent = 0;
    18071806    return handled;
    18081807}
Note: See TracChangeset for help on using the changeset viewer.