Changeset 141357 in webkit


Ignore:
Timestamp:
Jan 30, 2013 6:15:03 PM (11 years ago)
Author:
leviw@chromium.org
Message:

[Chromium] WebPluginContainerImpl adding imbalanced touch handler refs
https://bugs.webkit.org/show_bug.cgi?id=108381

Reviewed by James Robinson.

Source/WebKit/chromium:

WebPluginContainerImpl would call Document::didAddTouchEventHandler every time the plugin requested
touch events. Some plugins make this request more than once, leading to an imbalance in Document's
touch event handler map, and a stale node pointer when the plugin is destroyed. This change
has WebPluginContainerImpl only add one ref for the plugin at a time.

  • src/WebPluginContainerImpl.cpp:

(WebKit::WebPluginContainerImpl::requestTouchEventType):

Tools:

  • DumpRenderTree/chromium/TestRunner/src/WebTestPlugin.cpp: Adding an attribute that

tickles the case in WebPluginContainerImpl that imbalanced touch handler refs in Document.

LayoutTests:

  • platform/chromium/plugins/re-request-touch-events-crash-expected.txt: Added.
  • platform/chromium/plugins/re-request-touch-events-crash.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r141354 r141357  
     12013-01-30  Levi Weintraub  <leviw@chromium.org>
     2
     3        [Chromium] WebPluginContainerImpl adding imbalanced touch handler refs
     4        https://bugs.webkit.org/show_bug.cgi?id=108381
     5
     6        Reviewed by James Robinson.
     7
     8        * platform/chromium/plugins/re-request-touch-events-crash-expected.txt: Added.
     9        * platform/chromium/plugins/re-request-touch-events-crash.html: Added.
     10
    1112013-01-30  Rouslan Solomakhin  <rouslan@chromium.org>
    212
  • trunk/Source/WebKit/chromium/ChangeLog

    r141356 r141357  
     12013-01-30  Levi Weintraub  <leviw@chromium.org>
     2
     3        [Chromium] WebPluginContainerImpl adding imbalanced touch handler refs
     4        https://bugs.webkit.org/show_bug.cgi?id=108381
     5
     6        Reviewed by James Robinson.
     7
     8        WebPluginContainerImpl would call Document::didAddTouchEventHandler every time the plugin requested
     9        touch events. Some plugins make this request more than once, leading to an imbalance in Document's
     10        touch event handler map, and a stale node pointer when the plugin is destroyed. This change
     11        has WebPluginContainerImpl only add one ref for the plugin at a time.
     12
     13        * src/WebPluginContainerImpl.cpp:
     14        (WebKit::WebPluginContainerImpl::requestTouchEventType):
     15
    1162013-01-30  Yusuf Ozuysal  <yusufo@google.com>
    217
  • trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp

    r140183 r141357  
    474474    if (m_touchEventRequestType == requestType)
    475475        return;
     476   
     477    if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == TouchEventRequestTypeNone)
     478        m_element->document()->didAddTouchEventHandler(m_element);
     479    else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType != TouchEventRequestTypeNone)
     480        m_element->document()->didRemoveTouchEventHandler(m_element);
    476481    m_touchEventRequestType = requestType;
    477     if (m_touchEventRequestType != TouchEventRequestTypeNone)
    478         m_element->document()->didAddTouchEventHandler(m_element);
    479     else
    480         m_element->document()->didRemoveTouchEventHandler(m_element);
    481482}
    482483
  • trunk/Tools/ChangeLog

    r141355 r141357  
     12013-01-30  Levi Weintraub  <leviw@chromium.org>
     2
     3        [Chromium] WebPluginContainerImpl adding imbalanced touch handler refs
     4        https://bugs.webkit.org/show_bug.cgi?id=108381
     5
     6        Reviewed by James Robinson.
     7
     8        * DumpRenderTree/chromium/TestRunner/src/WebTestPlugin.cpp: Adding an attribute that
     9        tickles the case in WebPluginContainerImpl that imbalanced touch handler refs in Document.
     10
    1112013-01-30  Julie Parent  <jparent@chromium.org>
    212
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestPlugin.cpp

    r140565 r141357  
    236236
    237237    WebPluginContainer::TouchEventRequestType m_touchEventRequest;
     238    // Requests touch events from the WebPluginContainerImpl multiple times to tickle webkit.org/b/108381
     239    bool m_reRequestTouchEvents;
    238240    bool m_printEventDetails;
    239241    bool m_printUserGestureStatus;
     
    247249    , m_context(0)
    248250    , m_touchEventRequest(WebPluginContainer::TouchEventRequestTypeNone)
     251    , m_reRequestTouchEvents(false)
    249252    , m_printEventDetails(false)
    250253    , m_printUserGestureStatus(false)
     
    256259    static const WebString kAttributeOpacity = WebString::fromUTF8("opacity");
    257260    static const WebString kAttributeAcceptsTouch = WebString::fromUTF8("accepts-touch");
     261    static const WebString kAttributeReRequestTouchEvents = WebString::fromUTF8("re-request-touch");
    258262    static const WebString kAttributePrintEventDetails = WebString::fromUTF8("print-event-details");
    259263    static const WebString kAttributeCanProcessDrag = WebString::fromUTF8("can-process-drag");
     
    276280        else if (attributeName == kAttributeAcceptsTouch)
    277281            m_touchEventRequest = parseTouchEventRequestType(attributeValue);
     282        else if (attributeName == kAttributeReRequestTouchEvents)
     283            m_reRequestTouchEvents = parseBoolean(attributeValue);
    278284        else if (attributeName == kAttributePrintEventDetails)
    279285            m_printEventDetails = parseBoolean(attributeValue);
     
    305311    m_container = container;
    306312    m_container->setWebLayer(m_layer->layer());
     313    if (m_reRequestTouchEvents) {
     314        m_container->requestTouchEventType(WebPluginContainer::TouchEventRequestTypeSynthesizedMouse);
     315        m_container->requestTouchEventType(WebPluginContainer::TouchEventRequestTypeRaw);
     316    }
    307317    m_container->requestTouchEventType(m_touchEventRequest);
    308318    m_container->setWantsWheelEvents(true);
Note: See TracChangeset for help on using the changeset viewer.