Changeset 31210 in webkit


Ignore:
Timestamp:
Mar 21, 2008 9:27:55 AM (16 years ago)
Author:
Adam Roben
Message:

Don't allow any newly-scheduled plugin requests to be serviced when JS is paused

This is a followup to r31199.

Reviewed by Tim Hatcher.

  • plugins/PluginView.cpp: (WebCore::PluginView::requestTimerFired): Added an assertion that JS is not paused. (WebCore::PluginView::scheduleRequest): Don't start the request timer if JS is paused. This is the bug fix. (WebCore::PluginView::setJavaScriptPaused): Replaced the use of m_requestTimerWasActive with a check to see if we have any pending requests. m_requestTimerWasActive would not be accurate if a new request had been scheduled while JS was paused. (WebCore::PluginView::PluginView): Removed initialization of m_requestTimerWasActive.
  • plugins/PluginView.h: Removed m_requestTimerWasActive.
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31206 r31210  
     12008-03-21  Adam Roben  <aroben@apple.com>
     2
     3        Don't allow any newly-scheduled plugin requests to be serviced when JS is paused
     4
     5        This is a followup to r31199.
     6
     7        Reviewed by Tim Hatcher.
     8
     9        * plugins/PluginView.cpp:
     10        (WebCore::PluginView::requestTimerFired): Added an assertion that JS
     11        is not paused.
     12        (WebCore::PluginView::scheduleRequest): Don't start the request timer
     13        if JS is paused. This is the bug fix.
     14        (WebCore::PluginView::setJavaScriptPaused): Replaced the use of
     15        m_requestTimerWasActive with a check to see if we have any pending
     16        requests. m_requestTimerWasActive would not be accurate if a new
     17        request had been scheduled while JS was paused.
     18        (WebCore::PluginView::PluginView): Removed initialization of
     19        m_requestTimerWasActive.
     20        * plugins/PluginView.h: Removed m_requestTimerWasActive.
     21
    1222008-03-20  Dan Bernstein  <mitz@apple.com>
    223
  • trunk/WebCore/plugins/PluginView.cpp

    r31199 r31210  
    266266    ASSERT(timer == &m_requestTimer);
    267267    ASSERT(m_requests.size() > 0);
     268    ASSERT(!m_isJavaScriptPaused);
    268269
    269270    PluginRequest* request = m_requests[0];
     
    282283{
    283284    m_requests.append(request);
    284     m_requestTimer.startOneShot(0);
     285
     286    if (!m_isJavaScriptPaused)
     287        m_requestTimer.startOneShot(0);
    285288}
    286289
     
    489492    m_isJavaScriptPaused = paused;
    490493
    491     if (m_isJavaScriptPaused) {
    492         m_requestTimerWasActive = m_requestTimer.isActive();
     494    if (m_isJavaScriptPaused)
    493495        m_requestTimer.stop();
    494     } else if (m_requestTimerWasActive)
     496    else if (!m_requests.isEmpty())
    495497        m_requestTimer.startOneShot(0);
    496498}
     
    583585    , m_manualStream(0)
    584586    , m_isJavaScriptPaused(false)
    585     , m_requestTimerWasActive(false)
    586587{
    587588    if (!m_plugin) {
  • trunk/WebCore/plugins/PluginView.h

    r31199 r31210  
    237237
    238238        bool m_isJavaScriptPaused;
    239         bool m_requestTimerWasActive;
    240239
    241240        static PluginView* s_currentPluginView;
Note: See TracChangeset for help on using the changeset viewer.