[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

eric at webkit.org eric at webkit.org
Fri Feb 26 22:19:07 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit acb5bab0a0b40e4f4de461ad0001e547dca7e4bc
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 12 23:21:25 2010 +0000

    2010-02-12  Eric Seidel  <eric at webkit.org>
    
            No review, rolling out r54694.
            http://trac.webkit.org/changeset/54694
            https://bugs.webkit.org/show_bug.cgi?id=34633
    
            This appears to have caused crashes on the Leopard bot.  See
            bug 34898.
    
            * websocket/tests/bufferedAmount-after-close-expected.txt: Removed.
            * websocket/tests/bufferedAmount-after-close.html: Removed.
            * websocket/tests/script-tests/bufferedAmount-after-close.js: Removed.
    2010-02-12  Eric Seidel  <eric at webkit.org>
    
            No review, rolling out r54694.
            http://trac.webkit.org/changeset/54694
            https://bugs.webkit.org/show_bug.cgi?id=34633
    
            This appears to have caused crashes on the Leopard bot.  See
            bug 34898.
    
            * websockets/ThreadableWebSocketChannelClientWrapper.h:
            (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
            * websockets/WebSocket.cpp:
            (WebCore::WebSocket::WebSocket):
            (WebCore::WebSocket::send):
            (WebCore::WebSocket::close):
            (WebCore::WebSocket::bufferedAmount):
            (WebCore::WebSocket::didConnect):
            (WebCore::WebSocket::didClose):
            * websockets/WebSocket.h:
            * websockets/WebSocketChannel.cpp:
            (WebCore::WebSocketChannel::WebSocketChannel):
            (WebCore::WebSocketChannel::send):
            (WebCore::WebSocketChannel::bufferedAmount):
            (WebCore::WebSocketChannel::didClose):
            * websockets/WebSocketChannel.h:
            * websockets/WebSocketChannelClient.h:
            (WebCore::WebSocketChannelClient::didClose):
            * websockets/WorkerThreadableWebSocketChannel.cpp:
            (WebCore::workerContextDidClose):
            (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
            * websockets/WorkerThreadableWebSocketChannel.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54741 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 231a6a4..59194e3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-12  Eric Seidel  <eric at webkit.org>
+
+        No review, rolling out r54694.
+        http://trac.webkit.org/changeset/54694
+        https://bugs.webkit.org/show_bug.cgi?id=34633
+
+        This appears to have caused crashes on the Leopard bot.  See
+        bug 34898.
+
+        * websocket/tests/bufferedAmount-after-close-expected.txt: Removed.
+        * websocket/tests/bufferedAmount-after-close.html: Removed.
+        * websocket/tests/script-tests/bufferedAmount-after-close.js: Removed.
+
 2010-02-12  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Reviewed by Dirk Schulze.
diff --git a/LayoutTests/websocket/tests/bufferedAmount-after-close-expected.txt b/LayoutTests/websocket/tests/bufferedAmount-after-close-expected.txt
deleted file mode 100644
index 19e600d..0000000
--- a/LayoutTests/websocket/tests/bufferedAmount-after-close-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Web Socket bufferedAmount after closed
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-Connected.
-Closed.
-PASS ws.readyState is 2
-PASS ws.bufferedAmount is 0
-PASS ws.send('send to closed socket') is false
-PASS ws.bufferedAmount is 23
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/websocket/tests/bufferedAmount-after-close.html b/LayoutTests/websocket/tests/bufferedAmount-after-close.html
deleted file mode 100644
index f9a60ab..0000000
--- a/LayoutTests/websocket/tests/bufferedAmount-after-close.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-<script src="../../fast/js/resources/js-test-post-function.js"></script>
-</head>
-<body>
-<div id="description"></div>
-<div id="console"></div>
-<script src="script-tests/bufferedAmount-after-close.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/websocket/tests/script-tests/bufferedAmount-after-close.js b/LayoutTests/websocket/tests/script-tests/bufferedAmount-after-close.js
deleted file mode 100644
index a79d3d7..0000000
--- a/LayoutTests/websocket/tests/script-tests/bufferedAmount-after-close.js
+++ /dev/null
@@ -1,34 +0,0 @@
-description("Web Socket bufferedAmount after closed");
-
-if (window.layoutTestController)
-    layoutTestController.waitUntilDone();
-
-function endTest()
-{
-    isSuccessfullyParsed();
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
-}
-
-var ws = new WebSocket("ws://localhost:8880/websocket/tests/simple");
-
-ws.onopen = function()
-{
-    debug("Connected.");
-    ws.close();
-};
-
-ws.onclose = function()
-{
-    debug("Closed.");
-    shouldBe("ws.readyState", "2");
-    shouldBe("ws.bufferedAmount", "0");
-    shouldBeFalse("ws.send('send to closed socket')");
-    // If the connection is closed, bufferedAmount attribute's value will only
-    // increase with each call to the send() method.
-    // (the number does not reset to zero once the connection closes).
-    shouldBe("ws.bufferedAmount", "23");
-    endTest();
-};
-
-var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 585351c..efa9c76 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,35 @@
+2010-02-12  Eric Seidel  <eric at webkit.org>
+
+        No review, rolling out r54694.
+        http://trac.webkit.org/changeset/54694
+        https://bugs.webkit.org/show_bug.cgi?id=34633
+
+        This appears to have caused crashes on the Leopard bot.  See
+        bug 34898.
+
+        * websockets/ThreadableWebSocketChannelClientWrapper.h:
+        (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
+        * websockets/WebSocket.cpp:
+        (WebCore::WebSocket::WebSocket):
+        (WebCore::WebSocket::send):
+        (WebCore::WebSocket::close):
+        (WebCore::WebSocket::bufferedAmount):
+        (WebCore::WebSocket::didConnect):
+        (WebCore::WebSocket::didClose):
+        * websockets/WebSocket.h:
+        * websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::WebSocketChannel):
+        (WebCore::WebSocketChannel::send):
+        (WebCore::WebSocketChannel::bufferedAmount):
+        (WebCore::WebSocketChannel::didClose):
+        * websockets/WebSocketChannel.h:
+        * websockets/WebSocketChannelClient.h:
+        (WebCore::WebSocketChannelClient::didClose):
+        * websockets/WorkerThreadableWebSocketChannel.cpp:
+        (WebCore::workerContextDidClose):
+        (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
+        * websockets/WorkerThreadableWebSocketChannel.h:
+
 2010-02-12  Gavin Barraclough  <barraclough at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebCore/websockets/ThreadableWebSocketChannelClientWrapper.h b/WebCore/websockets/ThreadableWebSocketChannelClientWrapper.h
index 28d6129..8bf51fa 100644
--- a/WebCore/websockets/ThreadableWebSocketChannelClientWrapper.h
+++ b/WebCore/websockets/ThreadableWebSocketChannelClientWrapper.h
@@ -99,10 +99,10 @@ public:
             m_client->didReceiveMessage(msg);
     }
 
-    void didClose(unsigned long unhandledBufferedAmount)
+    void didClose()
     {
         if (m_client)
-            m_client->didClose(unhandledBufferedAmount);
+            m_client->didClose();
     }
 
 protected:
diff --git a/WebCore/websockets/WebSocket.cpp b/WebCore/websockets/WebSocket.cpp
index 5a64b71..f50dc5c 100644
--- a/WebCore/websockets/WebSocket.cpp
+++ b/WebCore/websockets/WebSocket.cpp
@@ -97,7 +97,6 @@ bool WebSocket::isAvailable()
 WebSocket::WebSocket(ScriptExecutionContext* context)
     : ActiveDOMObject(context, this)
     , m_state(CONNECTING)
-    , m_bufferedAmountAfterClose(0)
 {
 }
 
@@ -163,12 +162,9 @@ bool WebSocket::send(const String& message, ExceptionCode& ec)
         return false;
     }
     // No exception is raised if the connection was once established but has subsequently been closed.
-    if (m_state == CLOSED) {
-        m_bufferedAmountAfterClose += message.utf8().length() + 2; // 2 for framing
+    if (m_state == CLOSED)
         return false;
-    }
     // FIXME: check message is valid utf8.
-    ASSERT(m_channel);
     return m_channel->send(message);
 }
 
@@ -178,7 +174,6 @@ void WebSocket::close()
     if (m_state == CLOSED)
         return;
     m_state = CLOSED;
-    m_bufferedAmountAfterClose = m_channel->bufferedAmount();
     m_channel->close();
 }
 
@@ -196,7 +191,7 @@ unsigned long WebSocket::bufferedAmount() const
 {
     if (m_state == OPEN)
         return m_channel->bufferedAmount();
-    return m_bufferedAmountAfterClose;
+    return 0;
 }
 
 ScriptExecutionContext* WebSocket::scriptExecutionContext() const
@@ -228,7 +223,7 @@ void WebSocket::didConnect()
 {
     LOG(Network, "WebSocket %p didConnect", this);
     if (m_state != CONNECTING || !scriptExecutionContext()) {
-        didClose(0);
+        didClose();
         return;
     }
     m_state = OPEN;
@@ -245,11 +240,10 @@ void WebSocket::didReceiveMessage(const String& msg)
     dispatchEvent(evt);
 }
 
-void WebSocket::didClose(unsigned long unhandledBufferedAmount)
+void WebSocket::didClose()
 {
     LOG(Network, "WebSocket %p didClose", this);
     m_state = CLOSED;
-    m_bufferedAmountAfterClose += unhandledBufferedAmount;
     dispatchEvent(Event::create(eventNames().closeEvent, false, false));
     m_channel = 0;
     if (hasPendingActivity())
diff --git a/WebCore/websockets/WebSocket.h b/WebCore/websockets/WebSocket.h
index 8bda882..c72dbbd 100644
--- a/WebCore/websockets/WebSocket.h
+++ b/WebCore/websockets/WebSocket.h
@@ -91,7 +91,7 @@ namespace WebCore {
         // WebSocketChannelClient
         virtual void didConnect();
         virtual void didReceiveMessage(const String& message);
-        virtual void didClose(unsigned long unhandledBufferedAmount);
+        virtual void didClose();
 
     private:
         WebSocket(ScriptExecutionContext*);
@@ -111,7 +111,6 @@ namespace WebCore {
         KURL m_url;
         String m_protocol;
         EventTargetData m_eventTargetData;
-        unsigned long m_bufferedAmountAfterClose;
     };
 
 } // namespace WebCore
diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp
index 2ab133c..df66c14 100644
--- a/WebCore/websockets/WebSocketChannel.cpp
+++ b/WebCore/websockets/WebSocketChannel.cpp
@@ -57,6 +57,7 @@ WebSocketChannel::WebSocketChannel(ScriptExecutionContext* context, WebSocketCha
     , m_handshake(url, protocol, context)
     , m_buffer(0)
     , m_bufferSize(0)
+    , m_unhandledBufferSize(0)
 {
 }
 
@@ -77,18 +78,22 @@ void WebSocketChannel::connect()
 bool WebSocketChannel::send(const String& msg)
 {
     LOG(Network, "WebSocketChannel %p send %s", this, msg.utf8().data());
-    ASSERT(m_handle);
     Vector<char> buf;
     buf.append('\0');  // frame type
     buf.append(msg.utf8().data(), msg.utf8().length());
     buf.append('\xff');  // frame end
+    if (!m_handle) {
+        m_unhandledBufferSize += buf.size();
+        return false;
+    }
     return m_handle->send(buf.data(), buf.size());
 }
 
 unsigned long WebSocketChannel::bufferedAmount() const
 {
     LOG(Network, "WebSocketChannel %p bufferedAmount", this);
-    ASSERT(m_handle);
+    if (!m_handle)
+        return m_unhandledBufferSize;
     return m_handle->bufferedAmount();
 }
 
@@ -121,14 +126,14 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
 void WebSocketChannel::didClose(SocketStreamHandle* handle)
 {
     LOG(Network, "WebSocketChannel %p didClose", this);
-    ASSERT_UNUSED(handle, handle == m_handle || !m_handle);
+    ASSERT(handle == m_handle || !m_handle);
     if (m_handle) {
-        unsigned long unhandledBufferedAmount = m_handle->bufferedAmount();
+        m_unhandledBufferSize = handle->bufferedAmount();
         WebSocketChannelClient* client = m_client;
         m_client = 0;
         m_handle = 0;
         if (client)
-            client->didClose(unhandledBufferedAmount);
+            client->didClose();
     }
     deref();
 }
diff --git a/WebCore/websockets/WebSocketChannel.h b/WebCore/websockets/WebSocketChannel.h
index 41a03ab..7ec826c 100644
--- a/WebCore/websockets/WebSocketChannel.h
+++ b/WebCore/websockets/WebSocketChannel.h
@@ -83,6 +83,7 @@ namespace WebCore {
         RefPtr<SocketStreamHandle> m_handle;
         char* m_buffer;
         int m_bufferSize;
+        unsigned long m_unhandledBufferSize;
     };
 
 } // namespace WebCore
diff --git a/WebCore/websockets/WebSocketChannelClient.h b/WebCore/websockets/WebSocketChannelClient.h
index 5328eb7..163070f 100644
--- a/WebCore/websockets/WebSocketChannelClient.h
+++ b/WebCore/websockets/WebSocketChannelClient.h
@@ -40,7 +40,7 @@ namespace WebCore {
         virtual ~WebSocketChannelClient() { }
         virtual void didConnect() { }
         virtual void didReceiveMessage(const String&) { }
-        virtual void didClose(unsigned long /* unhandledBufferedAmount */) { }
+        virtual void didClose() { }
 
     protected:
         WebSocketChannelClient() { }
diff --git a/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp b/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
index 3dda104..dac1f19 100644
--- a/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
+++ b/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
@@ -190,17 +190,17 @@ void WorkerThreadableWebSocketChannel::Peer::didReceiveMessage(const String& mes
     m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveMessage, m_workerClientWrapper, message), m_taskMode);
 }
 
-static void workerContextDidClose(ScriptExecutionContext* context, RefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper, unsigned long unhandledBufferedAmount)
+static void workerContextDidClose(ScriptExecutionContext* context, RefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper)
 {
     ASSERT_UNUSED(context, context->isWorkerContext());
-    workerClientWrapper->didClose(unhandledBufferedAmount);
+    workerClientWrapper->didClose();
 }
 
-void WorkerThreadableWebSocketChannel::Peer::didClose(unsigned long unhandledBufferedAmount)
+void WorkerThreadableWebSocketChannel::Peer::didClose()
 {
     ASSERT(isMainThread());
     m_mainWebSocketChannel = 0;
-    m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidClose, m_workerClientWrapper, unhandledBufferedAmount), m_taskMode);
+    m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidClose, m_workerClientWrapper), m_taskMode);
 }
 
 void WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel(ScriptExecutionContext* context, Bridge* thisPtr, Peer* peer, RefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper)
diff --git a/WebCore/websockets/WorkerThreadableWebSocketChannel.h b/WebCore/websockets/WorkerThreadableWebSocketChannel.h
index a6a1680..1106f43 100644
--- a/WebCore/websockets/WorkerThreadableWebSocketChannel.h
+++ b/WebCore/websockets/WorkerThreadableWebSocketChannel.h
@@ -91,7 +91,7 @@ private:
 
         virtual void didConnect();
         virtual void didReceiveMessage(const String& message);
-        virtual void didClose(unsigned long unhandledBufferedAmount);
+        virtual void didClose();
 
     private:
         Peer(RefPtr<ThreadableWebSocketChannelClientWrapper>, WorkerLoaderProxy&, ScriptExecutionContext*, const String& taskMode, const KURL&, const String& protocol);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list