⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 98799 in webkit


Ignore:
Timestamp:
Oct 29, 2011, 12:19:26 AM (15 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r98795.
http://trac.webkit.org/changeset/98795
https://bugs.webkit.org/show_bug.cgi?id=71171

Causes worker tests to crash (Requested by abarth on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-10-29

  • dom/ActiveDOMObject.cpp:

(WebCore::ContextDestructionObserver::contextDestroyed):

  • dom/MessagePort.cpp:

(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::contextDestroyed):

  • dom/MessagePort.h:
  • dom/ScriptExecutionContext.cpp:

(WebCore::ScriptExecutionContext::~ScriptExecutionContext):
(WebCore::ScriptExecutionContext::closeMessagePorts):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r98796 r98799  
     12011-10-29  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r98795.
     4        http://trac.webkit.org/changeset/98795
     5        https://bugs.webkit.org/show_bug.cgi?id=71171
     6
     7        Causes worker tests to crash (Requested by abarth on #webkit).
     8
     9        * dom/ActiveDOMObject.cpp:
     10        (WebCore::ContextDestructionObserver::contextDestroyed):
     11        * dom/MessagePort.cpp:
     12        (WebCore::MessagePort::MessagePort):
     13        (WebCore::MessagePort::contextDestroyed):
     14        * dom/MessagePort.h:
     15        * dom/ScriptExecutionContext.cpp:
     16        (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
     17        (WebCore::ScriptExecutionContext::closeMessagePorts):
     18
    1192011-10-28  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/Source/WebCore/dom/ActiveDOMObject.cpp

    r98795 r98799  
    5555void ContextDestructionObserver::contextDestroyed()
    5656{
    57     ASSERT(m_scriptExecutionContext);
    5857    m_scriptExecutionContext = 0;
    5958}
  • trunk/Source/WebCore/dom/MessagePort.cpp

    r98795 r98799  
    4242
    4343MessagePort::MessagePort(ScriptExecutionContext& scriptExecutionContext)
    44     : ContextDestructionObserver(&scriptExecutionContext)
    45     , m_started(false)
     44    : m_started(false)
    4645    , m_closed(false)
     46    , m_scriptExecutionContext(&scriptExecutionContext)
    4747{
    4848    m_scriptExecutionContext->createdMessagePort(this);
     
    153153void MessagePort::contextDestroyed()
    154154{
     155    ASSERT(m_scriptExecutionContext);
    155156    // Must be closed before blowing away the cached context, to ensure that we get no more calls to messageAvailable().
    156157    // ScriptExecutionContext::closeMessagePorts() takes care of that.
    157158    ASSERT(m_closed);
    158     ContextDestructionObserver::contextDestroyed();
     159    m_scriptExecutionContext = 0;
    159160}
    160161
  • trunk/Source/WebCore/dom/MessagePort.h

    r98795 r98799  
    2828#define MessagePort_h
    2929
    30 #include "ActiveDOMObject.h"
    3130#include "EventListener.h"
    3231#include "EventTarget.h"
     
    5453    // ActiveDOMObject's features and relying on JavaScript garbage collection
    5554    // to get its lifetime right.
    56     class MessagePort : public RefCounted<MessagePort>, public EventTarget, public ContextDestructionObserver {
     55    class MessagePort : public RefCounted<MessagePort>, public EventTarget {
    5756    public:
    5857        static PassRefPtr<MessagePort> create(ScriptExecutionContext& scriptExecutionContext) { return adoptRef(new MessagePort(scriptExecutionContext)); }
     
    123122        bool m_closed;
    124123
     124        ScriptExecutionContext* m_scriptExecutionContext;
    125125        EventTargetData m_eventTargetData;
    126126    };
  • trunk/Source/WebCore/dom/ScriptExecutionContext.cpp

    r98795 r98799  
    113113    }
    114114
     115    HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end();
     116    for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) {
     117        ASSERT((*iter)->scriptExecutionContext() == this);
     118        (*iter)->contextDestroyed();
     119    }
    115120#if ENABLE(SQL_DATABASE)
    116121    if (m_databaseThread) {
     
    296301}
    297302
    298 void ScriptExecutionContext::closeMessagePorts()
    299 {
     303void ScriptExecutionContext::closeMessagePorts() {
    300304    HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end();
    301305    for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) {
Note: See TracChangeset for help on using the changeset viewer.