Title: [98799] trunk/Source/WebCore
- Revision
- 98799
- Author
- [email protected]
- Date
- 2011-10-29 00:19:26 -0700 (Sat, 29 Oct 2011)
Log 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 <[email protected]> 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (98798 => 98799)
--- trunk/Source/WebCore/ChangeLog 2011-10-29 07:04:15 UTC (rev 98798)
+++ trunk/Source/WebCore/ChangeLog 2011-10-29 07:19:26 UTC (rev 98799)
@@ -1,3 +1,21 @@
+2011-10-29 Sheriff Bot <[email protected]>
+
+ 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).
+
+ * 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):
+
2011-10-28 Ryosuke Niwa <[email protected]>
Potential crash in ReplaceNodeWithSpanCommand
Modified: trunk/Source/WebCore/dom/ActiveDOMObject.cpp (98798 => 98799)
--- trunk/Source/WebCore/dom/ActiveDOMObject.cpp 2011-10-29 07:04:15 UTC (rev 98798)
+++ trunk/Source/WebCore/dom/ActiveDOMObject.cpp 2011-10-29 07:19:26 UTC (rev 98799)
@@ -54,7 +54,6 @@
void ContextDestructionObserver::contextDestroyed()
{
- ASSERT(m_scriptExecutionContext);
m_scriptExecutionContext = 0;
}
Modified: trunk/Source/WebCore/dom/MessagePort.cpp (98798 => 98799)
--- trunk/Source/WebCore/dom/MessagePort.cpp 2011-10-29 07:04:15 UTC (rev 98798)
+++ trunk/Source/WebCore/dom/MessagePort.cpp 2011-10-29 07:19:26 UTC (rev 98799)
@@ -41,9 +41,9 @@
namespace WebCore {
MessagePort::MessagePort(ScriptExecutionContext& scriptExecutionContext)
- : ContextDestructionObserver(&scriptExecutionContext)
- , m_started(false)
+ : m_started(false)
, m_closed(false)
+ , m_scriptExecutionContext(&scriptExecutionContext)
{
m_scriptExecutionContext->createdMessagePort(this);
@@ -152,10 +152,11 @@
void MessagePort::contextDestroyed()
{
+ ASSERT(m_scriptExecutionContext);
// Must be closed before blowing away the cached context, to ensure that we get no more calls to messageAvailable().
// ScriptExecutionContext::closeMessagePorts() takes care of that.
ASSERT(m_closed);
- ContextDestructionObserver::contextDestroyed();
+ m_scriptExecutionContext = 0;
}
const AtomicString& MessagePort::interfaceName() const
Modified: trunk/Source/WebCore/dom/MessagePort.h (98798 => 98799)
--- trunk/Source/WebCore/dom/MessagePort.h 2011-10-29 07:04:15 UTC (rev 98798)
+++ trunk/Source/WebCore/dom/MessagePort.h 2011-10-29 07:19:26 UTC (rev 98799)
@@ -27,7 +27,6 @@
#ifndef MessagePort_h
#define MessagePort_h
-#include "ActiveDOMObject.h"
#include "EventListener.h"
#include "EventTarget.h"
#include "MessagePortChannel.h"
@@ -53,7 +52,7 @@
// setPendingActivity / unsetPendingActivity instead of duplicating
// ActiveDOMObject's features and relying on _javascript_ garbage collection
// to get its lifetime right.
- class MessagePort : public RefCounted<MessagePort>, public EventTarget, public ContextDestructionObserver {
+ class MessagePort : public RefCounted<MessagePort>, public EventTarget {
public:
static PassRefPtr<MessagePort> create(ScriptExecutionContext& scriptExecutionContext) { return adoptRef(new MessagePort(scriptExecutionContext)); }
~MessagePort();
@@ -122,6 +121,7 @@
bool m_started;
bool m_closed;
+ ScriptExecutionContext* m_scriptExecutionContext;
EventTargetData m_eventTargetData;
};
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (98798 => 98799)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2011-10-29 07:04:15 UTC (rev 98798)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2011-10-29 07:19:26 UTC (rev 98799)
@@ -112,6 +112,11 @@
observer->contextDestroyed();
}
+ HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end();
+ for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) {
+ ASSERT((*iter)->scriptExecutionContext() == this);
+ (*iter)->contextDestroyed();
+ }
#if ENABLE(SQL_DATABASE)
if (m_databaseThread) {
ASSERT(m_databaseThread->terminationRequested());
@@ -295,8 +300,7 @@
m_destructionObservers.remove(observer);
}
-void ScriptExecutionContext::closeMessagePorts()
-{
+void ScriptExecutionContext::closeMessagePorts() {
HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end();
for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) {
ASSERT((*iter)->scriptExecutionContext() == this);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes