Changeset 70781 in webkit


Ignore:
Timestamp:
Oct 28, 2010 9:14:34 AM (14 years ago)
Author:
Adam Roben
Message:

Make PluginView retain its HTMLPlugInElement

This matches WebKit/mac's WebBaseNetscapePluginView. WebCore didn't do
this, but had a very different mechanism for implementing NPRuntime
that didn't require it.

Fixes <http://webkit.org/b/46672> <rdar://problem/8484208> Crash
(preceded by assertion) in Node::document when running
plugins/document-open.html in WebKit2 on Windows

Reviewed by Anders Carlsson.

LayoutTests:

Remove plugins/document-open.html from the win-wk2 Skipped file

It passes now that <http://webkit.org/b/46672> is fixed.

  • platform/win-wk2/Skipped:

WebKit2:

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::create): Moved here from the header file so that
clients of the header file won't have to pull in HTMLPlugInElement.h.
Changed to take a PassRefPtr<HTMLPlugInElement>.
(WebKit::PluginView::PluginView): Changed to take a
PassRefPtr<HTMLPlugInElement> and to use m_pluginElement later (because
the parameter to the function will be nulled-out after assigning into
m_pluginElement).
(WebKit::PluginView::pluginElementNPObject): Updated for change to m_pluginElement.

  • WebProcess/Plugins/PluginView.h: Made m_pluginElement a RefPtr.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70779 r70781  
     12010-10-28  Adam Roben  <aroben@apple.com>
     2
     3        Remove plugins/document-open.html from the win-wk2 Skipped file
     4
     5        It passes now that <http://webkit.org/b/46672> is fixed.
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * platform/win-wk2/Skipped:
     10
    1112010-10-28  Adam Roben  <aroben@apple.com>
    212
  • trunk/LayoutTests/platform/win-wk2/Skipped

    r70779 r70781  
    7979platform/win/plugins/plugin-delayed-destroy.html
    8080
    81 # http://webkit.org/b/46712
    82 plugins/document-open.html
    83 
    8481# http://webkit.org/b/46715
    8582plugins/npruntime/invoke-failure.html
  • trunk/WebKit2/ChangeLog

    r70777 r70781  
     12010-10-28  Adam Roben  <aroben@apple.com>
     2
     3        Make PluginView retain its HTMLPlugInElement
     4
     5        This matches WebKit/mac's WebBaseNetscapePluginView. WebCore didn't do
     6        this, but had a very different mechanism for implementing NPRuntime
     7        that didn't require it.
     8
     9        Fixes <http://webkit.org/b/46672> <rdar://problem/8484208> Crash
     10        (preceded by assertion) in Node::document when running
     11        plugins/document-open.html in WebKit2 on Windows
     12
     13        Reviewed by Anders Carlsson.
     14
     15        * WebProcess/Plugins/PluginView.cpp:
     16        (WebKit::PluginView::create): Moved here from the header file so that
     17        clients of the header file won't have to pull in HTMLPlugInElement.h.
     18        Changed to take a PassRefPtr<HTMLPlugInElement>.
     19        (WebKit::PluginView::PluginView): Changed to take a
     20        PassRefPtr<HTMLPlugInElement> and to use m_pluginElement later (because
     21        the parameter to the function will be nulled-out after assigning into
     22        m_pluginElement).
     23        (WebKit::PluginView::pluginElementNPObject): Updated for change to m_pluginElement.
     24
     25        * WebProcess/Plugins/PluginView.h: Made m_pluginElement a RefPtr.
     26
    1272010-10-28  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    228
  • trunk/WebKit2/WebProcess/Plugins/PluginView.cpp

    r70499 r70781  
    236236    return webPage;
    237237}
    238        
    239 PluginView::PluginView(HTMLPlugInElement* pluginElement, PassRefPtr<Plugin> plugin, const Plugin::Parameters& parameters)
     238
     239PassRefPtr<PluginView> PluginView::create(PassRefPtr<HTMLPlugInElement> pluginElement, PassRefPtr<Plugin> plugin, const Plugin::Parameters& parameters)
     240{
     241    return adoptRef(new PluginView(pluginElement, plugin, parameters));
     242}
     243
     244PluginView::PluginView(PassRefPtr<HTMLPlugInElement> pluginElement, PassRefPtr<Plugin> plugin, const Plugin::Parameters& parameters)
    240245    : PluginViewBase(0)
    241246    , m_pluginElement(pluginElement)
    242247    , m_plugin(plugin)
    243     , m_webPage(webPage(pluginElement))
     248    , m_webPage(webPage(m_pluginElement.get()))
    244249    , m_parameters(parameters)
    245250    , m_isInitialized(false)
     
    785790
    786791    // FIXME: Handle JavaScript being disabled.
    787     JSObject* object = frame()->script()->jsObjectForPluginElement(m_pluginElement);
     792    JSObject* object = frame()->script()->jsObjectForPluginElement(m_pluginElement.get());
    788793    ASSERT(object);
    789794
  • trunk/WebKit2/WebProcess/Plugins/PluginView.h

    r68962 r70781  
    4848class PluginView : public WebCore::PluginViewBase, WebCore::MediaCanStartListener, PluginController, WebFrame::LoadListener {
    4949public:
    50     static PassRefPtr<PluginView> create(WebCore::HTMLPlugInElement* pluginElement, PassRefPtr<Plugin> plugin, const Plugin::Parameters& parameters)
    51     {
    52         return adoptRef(new PluginView(pluginElement, plugin, parameters));
    53     }
     50    static PassRefPtr<PluginView> create(PassRefPtr<WebCore::HTMLPlugInElement>, PassRefPtr<Plugin>, const Plugin::Parameters&);
    5451
    5552    WebCore::Frame* frame();
     
    6966
    7067private:
    71     PluginView(WebCore::HTMLPlugInElement*, PassRefPtr<Plugin>, const Plugin::Parameters& parameters);
     68    PluginView(PassRefPtr<WebCore::HTMLPlugInElement>, PassRefPtr<Plugin>, const Plugin::Parameters& parameters);
    7269    virtual ~PluginView();
    7370
     
    138135    virtual void didFailLoad(WebFrame*, bool wasCancelled);
    139136
    140     WebCore::HTMLPlugInElement* m_pluginElement;
     137    RefPtr<WebCore::HTMLPlugInElement> m_pluginElement;
    141138    RefPtr<Plugin> m_plugin;
    142139    WebPage* m_webPage;
Note: See TracChangeset for help on using the changeset viewer.