Changeset 208829 in webkit


Ignore:
Timestamp:
Nov 16, 2016, 4:59:04 PM (9 years ago)
Author:
Chris Dumez
Message:

ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary
https://bugs.webkit.org/show_bug.cgi?id=164812
<rdar://problem/29148465>

Reviewed by Geoffrey Garen.

ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary,
meaning when there is not already one pending.

  • dom/ScriptExecutionContext.cpp:

(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
(WebCore::ScriptExecutionContext::dispatchMessagePortEvents):

  • dom/ScriptExecutionContext.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r208828 r208829  
     12016-11-16  Chris Dumez  <cdumez@apple.com>
     2
     3        ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary
     4        https://bugs.webkit.org/show_bug.cgi?id=164812
     5        <rdar://problem/29148465>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary,
     10        meaning when there is not already one pending.
     11
     12        * dom/ScriptExecutionContext.cpp:
     13        (WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
     14        (WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
     15        * dom/ScriptExecutionContext.h:
     16
    1172016-11-16  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/dom/ScriptExecutionContext.cpp

    r208672 r208829  
    138138void ScriptExecutionContext::processMessagePortMessagesSoon()
    139139{
     140    if (m_willProcessMessagePortMessagesSoon)
     141        return;
     142
     143    m_willProcessMessagePortMessagesSoon = true;
    140144    postTask([] (ScriptExecutionContext& context) {
    141145        context.dispatchMessagePortEvents();
     
    148152
    149153    Ref<ScriptExecutionContext> protectedThis(*this);
     154    ASSERT(m_willProcessMessagePortMessagesSoon);
     155    m_willProcessMessagePortMessagesSoon = false;
    150156
    151157    // Make a frozen copy of the ports so we can iterate while new ones might be added or destroyed.
  • trunk/Source/WebCore/dom/ScriptExecutionContext.h

    r208672 r208829  
    260260
    261261    bool m_activeDOMObjectAdditionForbidden;
     262    bool m_willProcessMessagePortMessagesSoon { false };
    262263    int m_timerNestingLevel;
    263264
Note: See TracChangeset for help on using the changeset viewer.