Changeset 35408 in webkit


Ignore:
Timestamp:
Jul 28, 2008 9:59:20 AM (16 years ago)
Author:
andersca@apple.com
Message:

2008-07-28 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

<rdar://problem/6105529>
https://bugs.webkit.org/show_bug.cgi?id=19659
Turning off plugins causes crash


When an active page has plug-ins, and plug-ins are disabled, they will be stopped and will
end up in a state where they don't have an event handler. Because of this, we need to
check that the plug-in has been started before calling the event handler.


  • Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendActivateEvent:]): (-[WebBaseNetscapePluginView sendDrawRectEvent:]): (-[WebBaseNetscapePluginView setHasFocus:]): (-[WebBaseNetscapePluginView mouseDown:]): (-[WebBaseNetscapePluginView mouseUp:]): (-[WebBaseNetscapePluginView mouseEntered:]): (-[WebBaseNetscapePluginView mouseExited:]): (-[WebBaseNetscapePluginView handleMouseMoved:]): (-[WebBaseNetscapePluginView mouseDragged:]): (-[WebBaseNetscapePluginView scrollWheel:]): (-[WebBaseNetscapePluginView keyUp:]): (-[WebBaseNetscapePluginView keyDown:]): (-[WebBaseNetscapePluginView flagsChanged:]): (-[WebBaseNetscapePluginView cut:]): (-[WebBaseNetscapePluginView copy:]): (-[WebBaseNetscapePluginView paste:]): (-[WebBaseNetscapePluginView selectAll:]): (-[WebBaseNetscapePluginView drawRect:]): (-[WebBaseNetscapePluginView inputContext]):
Location:
trunk/WebKit/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/mac/ChangeLog

    r35377 r35408  
     12008-07-28  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Adam.
     4
     5        <rdar://problem/6105529>
     6        https://bugs.webkit.org/show_bug.cgi?id=19659
     7        Turning off plugins causes crash
     8       
     9        When an active page has plug-ins, and plug-ins are disabled, they will be stopped and will
     10        end up in a state where they don't have an event handler. Because of this, we need to
     11        check that the plug-in has been started before calling the event handler.
     12       
     13        * Plugins/WebBaseNetscapePluginView.mm:
     14        (-[WebBaseNetscapePluginView sendActivateEvent:]):
     15        (-[WebBaseNetscapePluginView sendDrawRectEvent:]):
     16        (-[WebBaseNetscapePluginView setHasFocus:]):
     17        (-[WebBaseNetscapePluginView mouseDown:]):
     18        (-[WebBaseNetscapePluginView mouseUp:]):
     19        (-[WebBaseNetscapePluginView mouseEntered:]):
     20        (-[WebBaseNetscapePluginView mouseExited:]):
     21        (-[WebBaseNetscapePluginView handleMouseMoved:]):
     22        (-[WebBaseNetscapePluginView mouseDragged:]):
     23        (-[WebBaseNetscapePluginView scrollWheel:]):
     24        (-[WebBaseNetscapePluginView keyUp:]):
     25        (-[WebBaseNetscapePluginView keyDown:]):
     26        (-[WebBaseNetscapePluginView flagsChanged:]):
     27        (-[WebBaseNetscapePluginView cut:]):
     28        (-[WebBaseNetscapePluginView copy:]):
     29        (-[WebBaseNetscapePluginView paste:]):
     30        (-[WebBaseNetscapePluginView selectAll:]):
     31        (-[WebBaseNetscapePluginView drawRect:]):
     32        (-[WebBaseNetscapePluginView inputContext]):
     33
    1342008-07-26  Daniel Jalkut  <jalkut@red-sweater.com>
    235
  • trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm

    r35275 r35408  
    773773- (void)sendActivateEvent:(BOOL)activate
    774774{
     775    if (!isStarted)
     776        return;
     777
    775778    eventHandler->windowFocusChanged(activate);
    776779}
     
    778781- (void)sendDrawRectEvent:(NSRect)rect
    779782{
     783    ASSERT(eventHandler);
     784   
    780785    eventHandler->drawRect(rect);
    781786}
     
    832837- (void)setHasFocus:(BOOL)flag
    833838{
     839    if (!isStarted)
     840        return;
     841
    834842    if (hasFocus == flag)
    835843        return;
     
    870878- (void)mouseDown:(NSEvent *)theEvent
    871879{
     880    if (!isStarted)
     881        return;
     882
    872883    eventHandler->mouseDown(theEvent);
    873884}
     
    875886- (void)mouseUp:(NSEvent *)theEvent
    876887{
     888    if (!isStarted)
     889        return;
     890
    877891    eventHandler->mouseUp(theEvent);
    878892}
     
    880894- (void)mouseEntered:(NSEvent *)theEvent
    881895{
     896    if (!isStarted)
     897        return;
     898
    882899    eventHandler->mouseEntered(theEvent);
    883900}
     
    885902- (void)mouseExited:(NSEvent *)theEvent
    886903{
     904    if (!isStarted)
     905        return;
     906
    887907    eventHandler->mouseExited(theEvent);
    888908   
     
    896916- (void)handleMouseMoved:(NSEvent *)theEvent
    897917{
     918    if (!isStarted)
     919        return;
     920
    898921    eventHandler->mouseMoved(theEvent);
    899922}
     
    901924- (void)mouseDragged:(NSEvent *)theEvent
    902925{
     926    if (!isStarted)
     927        return;
     928
    903929    eventHandler->mouseDragged(theEvent);
    904930}
     
    906932- (void)scrollWheel:(NSEvent *)theEvent
    907933{
     934    if (!isStarted) {
     935        [super scrollWheel:theEvent];
     936        return;
     937    }
     938
    908939    if (!eventHandler->scrollWheel(theEvent))
    909940        [super scrollWheel:theEvent];
     
    912943- (void)keyUp:(NSEvent *)theEvent
    913944{
     945    if (!isStarted)
     946        return;
     947
    914948    eventHandler->keyUp(theEvent);
    915949}
     
    917951- (void)keyDown:(NSEvent *)theEvent
    918952{
     953    if (!isStarted)
     954        return;
     955
    919956    eventHandler->keyDown(theEvent);
    920957}
     
    922959- (void)flagsChanged:(NSEvent *)theEvent
    923960{
     961    if (!isStarted)
     962        return;
     963
    924964    eventHandler->flagsChanged(theEvent);
    925965}
     
    927967- (void)cut:(id)sender
    928968{
     969    if (!isStarted)
     970        return;
     971
    929972    eventHandler->keyDown([NSApp currentEvent]);
    930973}
     
    932975- (void)copy:(id)sender
    933976{
     977    if (!isStarted)
     978        return;
     979
    934980    eventHandler->keyDown([NSApp currentEvent]);
    935981}
     
    937983- (void)paste:(id)sender
    938984{
     985    if (!isStarted)
     986        return;
     987
    939988    eventHandler->keyDown([NSApp currentEvent]);
    940989}
     
    942991- (void)selectAll:(id)sender
    943992{
     993    if (!isStarted)
     994        return;
     995
    944996    eventHandler->keyDown([NSApp currentEvent]);
    945997}
     
    15641616- (void)drawRect:(NSRect)rect
    15651617{
    1566     if (!isStarted) {
    1567         return;
    1568     }
     1618    if (!isStarted)
     1619        return;
    15691620   
    15701621    if ([NSGraphicsContext currentContextDrawingToScreen])
     
    18881939{
    18891940#ifndef NP_NO_CARBON
    1890     if ([self isStarted] && eventModel == NPEventModelCarbon)
     1941    if (![self isStarted] || eventModel == NPEventModelCarbon)
    18911942        return nil;
    18921943#endif
Note: See TracChangeset for help on using the changeset viewer.