Changeset 70685 in webkit


Ignore:
Timestamp:
Oct 27, 2010 12:05:54 PM (13 years ago)
Author:
Adam Roben
Message:

Don't allow setting NetscapePlugin::m_isWindowed after NPP_New has completed

In Firefox, Chrome, and WebKit1 trying to set this value after NPP_New
does not actually affect whether the plugin is windowed.

Fixes <http://webkit.org/b/46673> <rdar://problem/8484211> Assertion
failure in NetscapePlugin::platformDestroy when running
plugins/mouse-events.html in WebKit2 on Windows

Reviewed by Anders Carlsson.

  • WebProcess/Plugins/Netscape/NetscapePlugin.cpp:

(WebKit::NetscapePlugin::setIsWindowed): Moved here from the header.
Bail out if m_isStarted is true, indicating that NPP_New has already
finished.

  • WebProcess/Plugins/Netscape/NetscapePlugin.h: Removed the

implementation of setIsWindowed.

Location:
trunk/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r70680 r70685  
     12010-10-27  Adam Roben  <aroben@apple.com>
     2
     3        Don't allow setting NetscapePlugin::m_isWindowed after NPP_New has
     4        completed
     5
     6        In Firefox, Chrome, and WebKit1 trying to set this value after NPP_New
     7        does not actually affect whether the plugin is windowed.
     8
     9        Fixes <http://webkit.org/b/46673> <rdar://problem/8484211> Assertion
     10        failure in NetscapePlugin::platformDestroy when running
     11        plugins/mouse-events.html in WebKit2 on Windows
     12
     13        Reviewed by Anders Carlsson.
     14
     15        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
     16        (WebKit::NetscapePlugin::setIsWindowed): Moved here from the header.
     17        Bail out if m_isStarted is true, indicating that NPP_New has already
     18        finished.
     19
     20        * WebProcess/Plugins/Netscape/NetscapePlugin.h: Removed the
     21        implementation of setIsWindowed.
     22
    1232010-10-27  Timothy Hatcher  <timothy@apple.com>
    224
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

    r70653 r70685  
    152152}
    153153
     154void NetscapePlugin::setIsWindowed(bool isWindowed)
     155{
     156    // Once the plugin has started, it's too late to change whether the plugin is windowed or not.
     157    // (This is true in Firefox and Chrome, too.) Disallow setting m_isWindowed in that case to
     158    // keep our internal state consistent.
     159    if (m_isStarted)
     160        return;
     161
     162    m_isWindowed = isWindowed;
     163}
     164
    154165void NetscapePlugin::setStatusbarText(const String& statusbarText)
    155166{
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h

    r70265 r70685  
    6969                 const Vector<uint8_t>& httpBody, bool sendNotification, void* notificationData);
    7070    NPError destroyStream(NPStream*, NPReason);
    71     void setIsWindowed(bool windowed) { m_isWindowed = windowed; }
     71    void setIsWindowed(bool);
    7272    void setStatusbarText(const String&);
    7373    static void setException(const String&);
Note: See TracChangeset for help on using the changeset viewer.