Changeset 170743 in webkit


Ignore:
Timestamp:
Jul 2, 2014 8:31:05 PM (10 years ago)
Author:
roger_fong@apple.com
Message:

Improve handling of primary offscreen plugins.
https://bugs.webkit.org/show_bug.cgi?id=134528.
<rdar://problem/17471864>

Reviewed by Dean Jackson.

  • WebProcess/Plugins/PluginView.cpp:

Determine whether or not the plugin starts offscreen when the plugin is initialized.
(WebKit::PluginView::initializePlugin):
(WebKit::PluginView::pluginSnapshotTimerFired):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::createPlugin):
Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r170738 r170743  
     12014-07-02  Roger Fong  <roger_fong@apple.com>
     2
     3        Improve handling of primary offscreen plugins.
     4        https://bugs.webkit.org/show_bug.cgi?id=134528.
     5        <rdar://problem/17471864>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * WebProcess/Plugins/PluginView.cpp:
     10        Determine whether or not the plugin starts offscreen when the plugin is initialized.
     11        (WebKit::PluginView::initializePlugin):
     12        (WebKit::PluginView::pluginSnapshotTimerFired):
     13        * WebProcess/WebPage/WebPage.cpp:
     14        (WebKit::WebPage::createPlugin):
     15        Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins.
     16
    1172014-07-02  Enrica Casucci  <enrica@apple.com>
    218
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r170423 r170743  
    592592    }
    593593
     594    HTMLPlugInImageElement* plugInImageElement = toHTMLPlugInImageElement(m_pluginElement.get());
     595    m_didPlugInStartOffScreen = !m_webPage->plugInIntersectsSearchRect(*plugInImageElement);
    594596    m_plugin->initialize(this, m_parameters);
    595597   
     
    17131715    HTMLPlugInImageElement* plugInImageElement = toHTMLPlugInImageElement(m_pluginElement.get());
    17141716    bool isPlugInOnScreen = m_webPage->plugInIntersectsSearchRect(*plugInImageElement);
    1715     if (!m_countSnapshotRetries)
    1716         m_didPlugInStartOffScreen = !isPlugInOnScreen;
    1717 
    17181717    bool plugInCameOnScreen = isPlugInOnScreen && m_didPlugInStartOffScreen;
    17191718    bool snapshotFound = false;
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r170725 r170743  
    617617PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* pluginElement, const Plugin::Parameters& parameters, String& newMIMEType)
    618618{
     619    HTMLPlugInImageElement& pluginImageElement = toHTMLPlugInImageElement(*pluginElement);
    619620    String frameURLString = frame->coreFrame()->loader().documentLoader()->responseURL().string();
    620621    String pageURLString = m_page->mainFrame().loader().documentLoader()->responseURL().string();
    621     PluginProcessType processType = pluginElement->displayState() == HTMLPlugInElement::WaitingForSnapshot ? PluginProcessTypeSnapshot : PluginProcessTypeNormal;
    622 
     622    unsigned pluginArea = 0;
     623    PluginProcessType processType = pluginElement->displayState() == HTMLPlugInElement::WaitingForSnapshot && !(plugInIsPrimarySize(pluginImageElement, pluginArea) && !plugInIntersectsSearchRect(pluginImageElement))? PluginProcessTypeSnapshot : PluginProcessTypeNormal;
    623624    bool allowOnlyApplicationPlugins = !frame->coreFrame()->loader().subframeLoader().allowPlugins(NotAboutToInstantiatePlugin);
    624625
Note: See TracChangeset for help on using the changeset viewer.