1. 26 Feb, 2012 1 commit
    • abarth@webkit.org's avatar
      Move websockets to Modules/websockets · 1b18b622
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=79598
      
      Reviewed by Eric Seidel.
      
      Nowadays, the only ENABLE(WEB_SOCKETS) ifdef in WebCore proper is in
      WebCore::Settings, and that will be removed (soon?) once Apple drops
      support for the old WebSockets protocol.
      
      * CMakeLists.txt:
      * DerivedSources.make:
      * DerivedSources.pri:
      * GNUmakefile.am:
      * GNUmakefile.list.am:
      * Modules/websockets: Copied from Source/WebCore/websockets.
      * Target.pri:
      * WebCore.gyp/WebCore.gyp:
      * WebCore.gypi:
      * WebCore.pri:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.vcproj/WebCoreCommon.vsprops:
      * WebCore.vcproj/copyForwardingHeaders.cmd:
      * WebCore.xcodeproj/project.pbxproj:
      * websockets: Removed.
      * websockets/CloseEvent.h: Removed.
      * websockets/CloseEvent.idl: Removed.
      * websockets/DOMWindowWebSocket.idl: Removed.
      * websockets/ThreadableWebSocketChannel.cpp: Removed.
      * websockets/ThreadableWebSocketChannel.h: Removed.
      * websockets/ThreadableWebSocketChannelClientWrapper.cpp: Removed.
      * websockets/ThreadableWebSocketChannelClientWrapper.h: Removed.
      * websockets/WebSocket.cpp: Removed.
      * websockets/WebSocket.h: Removed.
      * websockets/WebSocket.idl: Removed.
      * websockets/WebSocketChannel.cpp: Removed.
      * websockets/WebSocketChannel.h: Removed.
      * websockets/WebSocketChannelClient.h: Removed.
      * websockets/WebSocketDeflater.cpp: Removed.
      * websockets/WebSocketDeflater.h: Removed.
      * websockets/WebSocketExtensionDispatcher.cpp: Removed.
      * websockets/WebSocketExtensionDispatcher.h: Removed.
      * websockets/WebSocketExtensionProcessor.h: Removed.
      * websockets/WebSocketFrame.h: Removed.
      * websockets/WebSocketHandshake.cpp: Removed.
      * websockets/WebSocketHandshake.h: Removed.
      * websockets/WebSocketHandshakeRequest.cpp: Removed.
      * websockets/WebSocketHandshakeRequest.h: Removed.
      * websockets/WebSocketHandshakeResponse.cpp: Removed.
      * websockets/WebSocketHandshakeResponse.h: Removed.
      * websockets/WorkerThreadableWebSocketChannel.cpp: Removed.
      * websockets/WorkerThreadableWebSocketChannel.h: Removed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1b18b622
  2. 14 Feb, 2012 1 commit
    • bashi@chromium.org's avatar
      [WebSocket] Add extension attribute support · afb40ae5
      bashi@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=78557
      
      Source/WebCore:
      
      Implement WebSocket "extensions" attribute that holds a list of
      extension the server accepted. No change in behavior at this time
      because we don't send any extension on handshake.
      
      Reviewed by Kent Tamura.
      
      No new tests. http/tests/websocket/tests/hybi/extensions.html checks the value of this attribute.
      
      * websockets/ThreadableWebSocketChannel.h: Add extensions().
      (ThreadableWebSocketChannel):
      * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
      (WebCore::ThreadableWebSocketChannelClientWrapper::extensions): Added.
      (WebCore):
      (WebCore::ThreadableWebSocketChannelClientWrapper::setExtensions): Added.
      * websockets/ThreadableWebSocketChannelClientWrapper.h:
      (ThreadableWebSocketChannelClientWrapper):
      * websockets/WebSocket.cpp: Added m_extensions member variable.
      (WebCore::WebSocket::WebSocket):
      (WebCore::WebSocket::extensions): Returns m_extensions.
      * websockets/WebSocket.h:
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::extensions): Added.
      (WebCore):
      * websockets/WebSocketChannel.h:
      (WebSocketChannel):
      * websockets/WebSocketExtensionDispatcher.cpp:
      (WebCore::WebSocketExtensionDispatcher::fail): Added.
      (WebCore::WebSocketExtensionDispatcher::processHeaderValue): Stores accepted extensions.
      (WebCore::WebSocketExtensionDispatcher::acceptedExtensions): Added.
      (WebCore):
      (WebCore::WebSocketExtensionDispatcher::acceptedExtensions): Added.
      * websockets/WebSocketExtensionDispatcher.h:
      (WebSocketExtensionDispatcher):
      * websockets/WebSocketHandshake.cpp:
      (WebCore::WebSocketHandshake::acceptedExtensions): Added.
      (WebCore):
      * websockets/WebSocketHandshake.h:
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::WorkerThreadableWebSocketChannel::extensions): Added.
      (WebCore):
      (WebCore::workerContextDidConnect): Calls ThreadableWebSocketChannelClientWrapper::setExtensions().
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect): Passes extensions as an argument.
      * websockets/WorkerThreadableWebSocketChannel.h:
      (WorkerThreadableWebSocketChannel):
      
      Source/WebKit/chromium:
      
      Add WebSocketExtensionDispatcher::acceptedExtensions() checks.
      
      Reviewed by Kent Tamura.
      
      * tests/WebSocketExtensionDispatcherTest.cpp:
      (WebCore::TEST_F):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      afb40ae5
  3. 30 Nov, 2011 2 commits
    • commit-queue@webkit.org's avatar
      Add OVERRIDE to WebSocket related sources for safe inheritances. · b221f113
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=73308
      
      Patch by Takashi Toyoshima <toyoshim@chromium.org> on 2011-11-30
      Reviewed by Kent Tamura.
      
      No new tests because this change contains no functional change.
      
      * platform/network/chromium/SocketStreamHandle.h:
      * websockets/CloseEvent.h:
      * websockets/WebSocket.h:
      * websockets/WebSocketChannel.h:
      * websockets/WorkerThreadableWebSocketChannel.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@101594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b221f113
    • commit-queue@webkit.org's avatar
      Add didUpdateBufferedAmount() callback to SocketStreamHandleClient · 742c1747
      commit-queue@webkit.org authored
      and WebSocketChannelClient.
      https://bugs.webkit.org/show_bug.cgi?id=73290
      
      Patch by Takashi Toyoshima <toyoshim@chromium.org> on 2011-11-30
      Reviewed by Kent Tamura.
      
      No new tests because this callback is not used in WebCore.
      
      * platform/network/SocketStreamHandleBase.cpp: Invoke new callback.
      (WebCore::SocketStreamHandleBase::send):
      (WebCore::SocketStreamHandleBase::sendPendingData):
      * platform/network/SocketStreamHandleBase.h: Change returning value type.
      (WebCore::SocketStreamHandleBase::bufferedAmount):
      * platform/network/SocketStreamHandleClient.h: Add new callback definition.
      (WebCore::SocketStreamHandleClient::didUpdateBufferedAmount):
      * websockets/ThreadableWebSocketChannelClientWrapper.cpp: Add new callback handling.
      (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
      (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmountCallback):
      * websockets/ThreadableWebSocketChannelClientWrapper.h: Add new callback inheritance and its helper method.
      * websockets/WebSocket.cpp: Add new callback handling.
      (WebCore::WebSocket::didUpdateBufferedAmount):
      * websockets/WebSocket.h: Add new callback inheritance.
      * websockets/WebSocketChannel.cpp: Add new callback handling.
      (WebCore::WebSocketChannel::didUpdateBufferedAmount):
      * websockets/WebSocketChannel.h: Add new callback inheritacne.
      * websockets/WebSocketChannelClient.h: Add new callback definition.
      (WebCore::WebSocketChannelClient::didUpdateBufferedAmount):
      * websockets/WorkerThreadableWebSocketChannel.cpp: Add new callback handling.
      (WebCore::workerContextDidUpdateBufferedAmount):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
      * websockets/WorkerThreadableWebSocketChannel.h: Add new callback inheritance and its helper method.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@101507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      742c1747
  4. 03 Sep, 2011 1 commit
    • yutak@chromium.org's avatar
      WebSocket: Send ArrayBuffer as WebSocket binary message · 4b47d620
      yutak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=67477
      
      Reviewed by Kent Tamura.
      
      Source/WebCore:
      
      Tests: http/tests/websocket/tests/hybi/send-arraybuffer.html
             http/tests/websocket/tests/hybi/workers/send-arraybuffer.html
             http/tests/websocket/tests/hybi/bufferedAmount-after-close.html (updated)
      
      * bindings/js/JSWebSocketCustom.cpp:
      (WebCore::JSWebSocket::send):
      * bindings/v8/custom/V8WebSocketCustom.cpp:
      (WebCore::V8WebSocket::sendCallback):
      * websockets/ThreadableWebSocketChannel.h:
      * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
      (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
      (WebCore::ThreadableWebSocketChannelClientWrapper::sendRequestResult):
      (WebCore::ThreadableWebSocketChannelClientWrapper::setSendRequestResult):
      * websockets/ThreadableWebSocketChannelClientWrapper.h:
      Rename "sent" to "sendRequestResult" to clarify the meaning. Messages from the script may not
      be sent immediately, thus the return value of WebSocketChannel::send() indicates whether the
      message has been queued successfully, rather than whether the message has been sent or not.
      * websockets/WebSocket.cpp:
      (WebCore::WebSocket::send):
      Case of sending "[object ArrayBuffer]" is covered by an existing test
      http/tests/websocket/tests/{hybi,hixie76}/send-object.html.
      * websockets/WebSocket.h:
      * websockets/WebSocket.idl:
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::send):
      * websockets/WebSocketChannel.h:
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::WorkerThreadableWebSocketChannel::send):
      (WebCore::workerContextDidSend):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
      (WebCore::WorkerThreadableWebSocketChannel::mainThreadSendArrayBuffer):
      Construct an ArrayBuffer from the data on Vector<char>.
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
      Copy the content into temporary buffer of Vector<char>, and send it to the main thread.
      * websockets/WorkerThreadableWebSocketChannel.h:
      
      LayoutTests:
      
      * http/tests/websocket/tests/hybi/bufferedAmount-after-close-expected.txt:
      * http/tests/websocket/tests/hybi/bufferedAmount-after-close.html:
      Add tests to send ArrayBuffers.
      * http/tests/websocket/tests/hybi/check-binary-messages_wsh.py:
      Renamed from LayoutTests/http/tests/websocket/tests/hybi/send-blob_wsh.py, because this handler
      is used from send-blob.html and send-arraybuffer.html.
      * http/tests/websocket/tests/hybi/send-arraybuffer-expected.txt: Added.
      * http/tests/websocket/tests/hybi/send-arraybuffer.html:
      Added. Send three small binary messages as ArrayBuffers.
      * http/tests/websocket/tests/hybi/send-blob.html:
      * http/tests/websocket/tests/hybi/workers/resources/check-binary-messages_wsh.py:
      Renamed from LayoutTests/http/tests/websocket/tests/hybi/workers/resources/send-blob_wsh.py.
      * http/tests/websocket/tests/hybi/workers/resources/send-arraybuffer.js:
      Added. Same as send-arraybuffer.html, except that this test is run on the worker.
      * http/tests/websocket/tests/hybi/workers/resources/send-blob.js:
      Removed the definition of unnecessary function startsWith().
      * http/tests/websocket/tests/hybi/workers/send-arraybuffer-expected.txt: Added.
      * http/tests/websocket/tests/hybi/workers/send-arraybuffer.html: Added
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4b47d620
  5. 02 Sep, 2011 4 commits
    • yutak@chromium.org's avatar
      WebSocket: Send Blob as WebSocket binary message · 7fe8a733
      yutak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=67465
      
      Reviewed by Kent Tamura.
      
      Re-lands r94399 with a fix for Leopard builds.
      
      Source/WebCore:
      
      * bindings/js/JSWebSocketCustom.cpp:
      (WebCore::JSWebSocket::send):
      * bindings/v8/custom/V8WebSocketCustom.cpp:
      (WebCore::V8WebSocket::sendCallback):
      * websockets/ThreadableWebSocketChannel.h:
      * websockets/WebSocket.cpp:
      (WebCore::WebSocket::send):
      * websockets/WebSocket.h:
      * websockets/WebSocket.idl:
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::send):
      * websockets/WebSocketChannel.h:
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::WorkerThreadableWebSocketChannel::send):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
      (WebCore::WorkerThreadableWebSocketChannel::mainThreadSendBlob):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
      * websockets/WorkerThreadableWebSocketChannel.h:
      
      LayoutTests:
      
      * http/tests/websocket/tests/hixie76/send-empty-expected.txt: Added.
      * http/tests/websocket/tests/hixie76/send-empty.html: Added.
      * http/tests/websocket/tests/hixie76/send-object-expected.txt: Added.
      * http/tests/websocket/tests/hixie76/send-object.html: Added.
      * http/tests/websocket/tests/hybi/bufferedAmount-after-close-expected.txt:
      * http/tests/websocket/tests/hybi/bufferedAmount-after-close.html:
      * http/tests/websocket/tests/hybi/send-blob-expected.txt: Added.
      * http/tests/websocket/tests/hybi/send-blob.html: Added.
      * http/tests/websocket/tests/hybi/send-blob_wsh.py: Added.
      * http/tests/websocket/tests/hybi/send-empty-expected.txt: Added.
      * http/tests/websocket/tests/hybi/send-empty.html: Added.
      * http/tests/websocket/tests/hybi/send-file-blob-expected.txt: Added.
      * http/tests/websocket/tests/hybi/send-file-blob-fail-expected.txt: Added.
      * http/tests/websocket/tests/hybi/send-file-blob-fail.html: Added.
      * http/tests/websocket/tests/hybi/send-file-blob.html: Added.
      * http/tests/websocket/tests/hybi/send-file-blob_wsh.py: Added.
      * http/tests/websocket/tests/hybi/workers/resources/send-blob.js: Added.
      * http/tests/websocket/tests/hybi/workers/resources/send-blob_wsh.py: Added.
      * http/tests/websocket/tests/hybi/workers/send-blob-expected.txt: Added.
      * http/tests/websocket/tests/hybi/workers/send-blob.html: Added.
      * platform/gtk/Skipped:
      * platform/mac/Skipped:
      * platform/qt/Skipped:
      * platform/win/Skipped:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7fe8a733
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r94399. · df47c988
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/94399
      https://bugs.webkit.org/show_bug.cgi?id=67471
      
      Broke Leopard build (Requested by yutak on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-09-02
      
      Source/WebCore:
      
      * bindings/js/JSWebSocketCustom.cpp:
      * bindings/v8/custom/V8WebSocketCustom.cpp:
      * websockets/ThreadableWebSocketChannel.h:
      * websockets/WebSocket.cpp:
      * websockets/WebSocket.h:
      * websockets/WebSocket.idl:
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::send):
      * websockets/WebSocketChannel.h:
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      * websockets/WorkerThreadableWebSocketChannel.h:
      
      LayoutTests:
      
      * http/tests/websocket/tests/hixie76/send-empty-expected.txt: Removed.
      * http/tests/websocket/tests/hixie76/send-empty.html: Removed.
      * http/tests/websocket/tests/hixie76/send-object-expected.txt: Removed.
      * http/tests/websocket/tests/hixie76/send-object.html: Removed.
      * http/tests/websocket/tests/hybi/bufferedAmount-after-close-expected.txt:
      * http/tests/websocket/tests/hybi/bufferedAmount-after-close.html:
      * http/tests/websocket/tests/hybi/send-blob-expected.txt: Removed.
      * http/tests/websocket/tests/hybi/send-blob.html: Removed.
      * http/tests/websocket/tests/hybi/send-blob_wsh.py: Removed.
      * http/tests/websocket/tests/hybi/send-empty-expected.txt: Removed.
      * http/tests/websocket/tests/hybi/send-empty.html: Removed.
      * http/tests/websocket/tests/hybi/send-file-blob-expected.txt: Removed.
      * http/tests/websocket/tests/hybi/send-file-blob-fail-expected.txt: Removed.
      * http/tests/websocket/tests/hybi/send-file-blob-fail.html: Removed.
      * http/tests/websocket/tests/hybi/send-file-blob.html: Removed.
      * http/tests/websocket/tests/hybi/send-file-blob_wsh.py: Removed.
      * http/tests/websocket/tests/hybi/workers/resources/send-blob.js: Removed.
      * http/tests/websocket/tests/hybi/workers/resources/send-blob_wsh.py: Removed.
      * http/tests/websocket/tests/hybi/workers/send-blob-expected.txt: Removed.
      * http/tests/websocket/tests/hybi/workers/send-blob.html: Removed.
      * platform/gtk/Skipped:
      * platform/mac/Skipped:
      * platform/qt/Skipped:
      * platform/win/Skipped:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      df47c988
    • yutak@chromium.org's avatar
      WebSocket: Send Blob as WebSocket binary message · 729efea7
      yutak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=67465
      
      Reviewed by Kent Tamura.
      
      Source/WebCore:
      
      Tests: http/tests/websocket/tests/hixie76/send-empty.html
             http/tests/websocket/tests/hixie76/send-object.html
             http/tests/websocket/tests/hybi/send-blob.html
             http/tests/websocket/tests/hybi/send-empty.html
             http/tests/websocket/tests/hybi/send-file-blob-fail.html
             http/tests/websocket/tests/hybi/send-file-blob.html
             http/tests/websocket/tests/hybi/workers/send-blob.html
             http/tests/websocket/tests/hybi/bufferedAmount-after-close.html (updated)
      
      * bindings/js/JSWebSocketCustom.cpp:
      (WebCore::JSWebSocket::send):
      * bindings/v8/custom/V8WebSocketCustom.cpp:
      (WebCore::V8WebSocket::sendCallback):
      * websockets/ThreadableWebSocketChannel.h:
      * websockets/WebSocket.cpp:
      (WebCore::WebSocket::send):
      * websockets/WebSocket.h:
      * websockets/WebSocket.idl:
      Fixing code generator did not sound easy, because there are some classes depending on
      broken behavior of current code generator (one such example is CanvasRenderingContext2D).
      As a temporary workaround, new custom handlers for send() are added.
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::send):
      * websockets/WebSocketChannel.h:
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::WorkerThreadableWebSocketChannel::send):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
      (WebCore::WorkerThreadableWebSocketChannel::mainThreadSendBlob):
      A Blob can be deserialized from url, type and size.
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
      KURL, String and long long (corresponding to url, type and size, respectively) can be passed
      safely across threads.
      * websockets/WorkerThreadableWebSocketChannel.h:
      
      LayoutTests:
      
      * http/tests/websocket/tests/hixie76/send-empty-expected.txt: Added.
      * http/tests/websocket/tests/hixie76/send-empty.html: Added.
      * http/tests/websocket/tests/hixie76/send-object-expected.txt: Added.
      * http/tests/websocket/tests/hixie76/send-object.html: Added.
      * http/tests/websocket/tests/hybi/bufferedAmount-after-close-expected.txt:
      * http/tests/websocket/tests/hybi/bufferedAmount-after-close.html:
      Updated. Added tests to send Blobs.
      * http/tests/websocket/tests/hybi/send-blob-expected.txt: Added.
      * http/tests/websocket/tests/hybi/send-blob.html:
      Added. Send three Blobs each of which contains a small binary message.
      * http/tests/websocket/tests/hybi/send-blob_wsh.py:
      Added. receive_message() returns a unicode value if the received message was text, or
      a str value if the message was binary.
      * http/tests/websocket/tests/hybi/send-empty-expected.txt: Added.
      * http/tests/websocket/tests/hybi/send-empty.html: Added.
      * http/tests/websocket/tests/hybi/send-file-blob-expected.txt: Added.
      * http/tests/websocket/tests/hybi/send-file-blob-fail-expected.txt: Added.
      * http/tests/websocket/tests/hybi/send-file-blob-fail.html:
      Added. If we delete a file before reading it, FileReaderLoader reliably fails.
      * http/tests/websocket/tests/hybi/send-file-blob.html:
      Added. Create a File and try to send it as a Blob.
      * http/tests/websocket/tests/hybi/send-file-blob_wsh.py: Added.
      * http/tests/websocket/tests/hybi/workers/resources/send-blob.js:
      Added. Same as send-blob.html above.
      * http/tests/websocket/tests/hybi/workers/resources/send-blob_wsh.py:
      Added. Same as send-blob_wsh.py above.
      * http/tests/websocket/tests/hybi/workers/send-blob-expected.txt: Added.
      * http/tests/websocket/tests/hybi/workers/send-blob.html: Added.
      * platform/gtk/Skipped:
      send-file-blob.html and send-file-blob-fail.html depend on availability of File API.
      * platform/mac/Skipped: Ditto.
      * platform/qt/Skipped: Ditto.
      * platform/win/Skipped: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      729efea7
    • commit-queue@webkit.org's avatar
      [WebSocket] Implement WebSocket::close() code and reason handling. · a5226de7
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=66925
      
      Patch by Takashi Toyoshima <toyoshim@chromium.org> on 2011-09-01
      Reviewed by Kent Tamura.
      
      Source/WebCore:
      
      Tests: http/tests/websocket/tests/hybi/close.html
             http/tests/websocket/tests/hybi/workers/close.html
      
      * bindings/js/JSWebSocketCustom.cpp:
      (WebCore::JSWebSocket::close):
      * bindings/v8/custom/V8WebSocketCustom.cpp:
      (WebCore::V8WebSocket::closeCallback):
      Add custom bridge for WebSocket::close().
      * websockets/ThreadableWebSocketChannel.h:
      * websockets/WebSocket.cpp:
      (WebCore::WebSocket::close):
      * websockets/WebSocket.h:
      * websockets/WebSocket.idl:
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::close):
      Add code and reason arguments handling.
      (WebCore::WebSocketChannel::startClosingHandshake):
      Send a close frame without code and reason on server initiated closing handshakes.
      (WebCore::WebSocketChannel::processFrame):
      (WebCore::WebSocketChannel::processFrameHixie76):
      * websockets/WebSocketChannel.h:
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::WorkerThreadableWebSocketChannel::close):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::close):
      (WebCore::WorkerThreadableWebSocketChannel::mainThreadClose):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::close):
      * websockets/WorkerThreadableWebSocketChannel.h:
      Add code and reason arguments handling.
      
      LayoutTests:
      
      * http/tests/websocket/tests/hybi/close-expected.txt: Added.
      * http/tests/websocket/tests/hybi/close.html: Added.
      * http/tests/websocket/tests/hybi/close_wsh.py: Added.
      * http/tests/websocket/tests/hybi/workers/close-expected.txt: Added.
      * http/tests/websocket/tests/hybi/workers/close.html: Added.
      * http/tests/websocket/tests/hybi/workers/resources/close.js: Added.
      (postResult):
      (testFailed):
      (debug):
      (shouldBe):
      (shouldBeTrue):
      (shouldBeFalse):
      (handleOpen):
      (handleError):
      (handleClose):
      (handleMessage):
      (setDefaultHandlers):
      (runCodeTest.else.ws.onclose):
      (runCodeTest):
      (runInvalidStringTest):
      (runReasonTest.else.ws.onclose):
      (runReasonTest):
      (runCodeAndReasonTest.):
      (runCodeAndReasonTest):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a5226de7
  6. 29 Aug, 2011 1 commit
    • yutak@chromium.org's avatar
      WebSocket: Receive binary message as Blob · eadc20d4
      yutak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=67115
      
      Reviewed by Kent Tamura.
      
      Source/WebCore:
      
      Make WebSocketChannel be able to receive WebSocket binary messages and deliver them via
      didReceiveBinaryData() callback of WebSocketChannelClient.
      
      Tests: http/tests/websocket/tests/hybi/fragmented-binary-frames.html
             http/tests/websocket/tests/hybi/receive-blob.html
             http/tests/websocket/tests/hybi/workers/receive-blob.html
      
      * bindings/js/JSMessageEventCustom.cpp:
      (WebCore::JSMessageEvent::data): Convert Blob to JSValue.
      * bindings/v8/custom/V8MessageEventCustom.cpp:
      (WebCore::V8MessageEvent::dataAccessorGetter): Convert Blob to v8::Value.
      * dom/MessageEvent.cpp:
      (WebCore::MessageEvent::MessageEvent):
      * dom/MessageEvent.h:
      Added DataTypeBlob and Blob-related functions.
      (WebCore::MessageEvent::create):
      (WebCore::MessageEvent::dataAsBlob):
      * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
      (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
      (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryDataCallback):
      * websockets/ThreadableWebSocketChannelClientWrapper.h:
      * websockets/WebSocket.cpp:
      (WebCore::WebSocket::didReceiveBinaryData):
      If binaryType attribute is "blob", construct a Blob using BlobData filled with the given
      binary message.
      * websockets/WebSocket.h:
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::processFrame):
      Create continuousFrameData as OwnPtr<> rather than stack-allocated value so we can easily
      pass it to didReceiveBinaryData() callback.
      Save the content of a fragmented message even if it is a binary opcode.
      * websockets/WebSocketChannelClient.h:
      (WebCore::WebSocketChannelClient::didReceiveBinaryData):
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::workerContextDidReceiveBinaryData):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
      Pass binaryData as PassOwnPtr<Vector<char> > to deliver the value efficiently (without
      copying the content) across threads.
      * websockets/WorkerThreadableWebSocketChannel.h:
      
      LayoutTests:
      
      * http/tests/websocket/tests/hybi/binary-frames_wsh.py: Added. Used from receive-blob.html.
      * http/tests/websocket/tests/hybi/fragmented-binary-frames-expected.txt: Added.
      * http/tests/websocket/tests/hybi/fragmented-binary-frames.html:
      Added. The content of this test is almost identical to receive-blob.html.
      * http/tests/websocket/tests/hybi/fragmented-binary-frames_wsh.py: Added.
      * http/tests/websocket/tests/hybi/receive-blob-expected.txt: Added.
      * http/tests/websocket/tests/hybi/receive-blob.html:
      Added. It is a bit complicated to validate the content of a Blob, because a Blob must be read
      asynchronously. FileReader is used to read a blob as an ArrayBuffer, each byte of which is
      compared with the expected result.
      * http/tests/websocket/tests/hybi/workers/receive-blob-expected.txt: Added.
      * http/tests/websocket/tests/hybi/workers/receive-blob.html: Added.
      * http/tests/websocket/tests/hybi/workers/resources/binary-frames_wsh.py:
      Added. Same as above binary-frames_wsh.py.
      * http/tests/websocket/tests/hybi/workers/resources/receive-blob.js: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eadc20d4
  7. 19 Aug, 2011 1 commit
    • commit-queue@webkit.org's avatar
      [WebSocket] CloseEvent's code and reason properties support. · f7b7ff75
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=66362
      
      Patch by Takashi Toyoshima <toyoshim@chromium.org> on 2011-08-19
      Reviewed by Kent Tamura.
      
      Current WebSocket implementation miss code and reason properties
      in CloseEvent. This change expose incoming closing frame's code
      and reason to JavaScript API.
      
      Source/WebCore:
      
      Tests: http/tests/websocket/tests/hybi/close-code-and-reason.html
             http/tests/websocket/tests/hybi/workers/close-code-and-reason.html
      
      * websockets/CloseEvent.h:
      (WebCore::CloseEvent::initCloseEvent):
      (WebCore::CloseEvent::code):
      (WebCore::CloseEvent::reason):
      (WebCore::CloseEvent::CloseEvent):
      * websockets/CloseEvent.idl:
      Add code and reason properies.
      * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
      (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
      (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
      * websockets/ThreadableWebSocketChannelClientWrapper.h:
      * websockets/WebSocket.cpp:
      (WebCore::WebSocket::didConnect):
      (WebCore::WebSocket::didClose):
      * websockets/WebSocket.h:
      Add implement to handle code and reason.
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::WebSocketChannel):
      (WebCore::WebSocketChannel::didCloseSocketStream):
      (WebCore::WebSocketChannel::processFrame):
      * websockets/WebSocketChannel.h:
      Add closing frame payload parser.
      * websockets/WebSocketChannelClient.h:
      (WebCore::WebSocketChannelClient::didClose):
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::workerContextDidClose):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
      * websockets/WorkerThreadableWebSocketChannel.h:
      Add implement to handle code and reason.
      
      LayoutTests:
      
      * http/tests/websocket/tests/hybi/close-code-and-reason-expected.txt: Added.
      * http/tests/websocket/tests/hybi/close-code-and-reason.html: Added.
      * http/tests/websocket/tests/hybi/close-code-and-reason_wsh.py: Added.
      * http/tests/websocket/tests/hybi/workers/close-code-and-reason-expected.txt: Added.
      * http/tests/websocket/tests/hybi/workers/close-code-and-reason.html: Added.
      * http/tests/websocket/tests/hybi/workers/resources/close-code-and-reason.js: Added.
      (postResult):
      (ws.onopen):
      (ws.onmessage):
      (ws.onclose):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f7b7ff75
  8. 12 Aug, 2011 1 commit
    • yutak@chromium.org's avatar
      WebSocket: Implement "protocol" attribute · 4d0c313f
      yutak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=65248
      
      Reviewed by Kent Tamura.
      
      Source/WebCore:
      
      Tests: http/tests/websocket/tests/hybi/no-subprotocol.html (added)
             http/tests/websocket/tests/hybi/set-protocol.html (added)
             http/tests/websocket/tests/hybi/workers/no-subprotocol.html (added)
             http/tests/websocket/tests/hixie76/undefined-attributes.html (updated)
             http/tests/websocket/tests/hybi/multiple-subprotocols.html (updated)
             http/tests/websocket/tests/hybi/workers/multiple-subprotocols.html (updated)
      
      * websockets/ThreadableWebSocketChannel.h:
      Added subprotocol() function. This function is named differently from the counterpart of
      WebSocket class, because the name "protocol" can be confused with the WebSocket protocol.
      Added m_useHixie76Protocol and m_subprotocol, because these value may be used after
      m_channel has been released. Using bool should be fine, because boolean literals do not
      appear in ambiguous context.
      * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
      (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
      (WebCore::ThreadableWebSocketChannelClientWrapper::subprotocol):
      (WebCore::ThreadableWebSocketChannelClientWrapper::setSubprotocol):
      * websockets/ThreadableWebSocketChannelClientWrapper.h:
      * websockets/WebSocket.cpp:
      (WebCore::WebSocket::WebSocket):
      (WebCore::WebSocket::connect):
      (WebCore::WebSocket::protocol):
      The "protocol" attribute is available only when the hybi-10 protocol is chosen.
      (WebCore::WebSocket::binaryType):
      (WebCore::WebSocket::setBinaryType):
      (WebCore::WebSocket::didConnect):
      * websockets/WebSocket.h:
      * websockets/WebSocket.idl:
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::subprotocol):
      * websockets/WebSocketChannel.h:
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::WorkerThreadableWebSocketChannel::subprotocol):
      (WebCore::workerContextDidConnect):
      Subprotocol value is saved in the client wrapper object after the WebSocket connection is
      established.
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
      * websockets/WorkerThreadableWebSocketChannel.h:
      
      LayoutTests:
      
      * http/tests/websocket/tests/hixie76/undefined-attributes-expected.txt:
      * http/tests/websocket/tests/hixie76/undefined-attributes.html:
      Added a test to check "protocol" attribute.
      * http/tests/websocket/tests/hybi/multiple-subprotocols-expected.txt:
      * http/tests/websocket/tests/hybi/multiple-subprotocols.html:
      The attribute should return an empty string at first. After the connection is established,
      it should return the value of Sec-WebSocket-Protocol header in the server's handshake response.
      * http/tests/websocket/tests/hybi/no-subprotocol-expected.txt: Added.
      * http/tests/websocket/tests/hybi/no-subprotocol.html: Added.
      * http/tests/websocket/tests/hybi/set-protocol-expected.txt: Added.
      * http/tests/websocket/tests/hybi/set-protocol.html: Added.
      * http/tests/websocket/tests/hybi/workers/multiple-subprotocols-expected.txt:
      * http/tests/websocket/tests/hybi/workers/no-subprotocol-expected.txt: Added.
      * http/tests/websocket/tests/hybi/workers/no-subprotocol.html: Added.
      * http/tests/websocket/tests/hybi/workers/resources/multiple-subprotocols.js:
      (ws.onopen):
      (ws.onclose):
      (checkAfterOnClose):
      * http/tests/websocket/tests/hybi/workers/resources/no-subprotocol.js: Added.
      (ws.onopen):
      (ws.onclose):
      (checkAfterOnClose):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4d0c313f
  9. 01 Aug, 2011 1 commit
    • yutak@chromium.org's avatar
      WebSocket: Receive URL and subprotocol in WebSocketChannel::connect() · 891dca6b
      yutak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=65367
      
      Reviewed by Kent Tamura.
      
      To implement multiple subprotocols support (bug 65247), WebSocket::connect() will need to validate
      the value of subprotocols after constructing WebSocketChannel, because the result depends on which
      WebSocket protocol is used, which is obtained from WebSocketChannel::useHixie76Protocol(). This
      means the subprotocol value will not be available at the time of WebSocketChannel construction.
      
      This change moves URL and subprotocol arguments in WebSocketChannel constructor to
      WebSocketChannel::connect(), which allows WebSocket::connect() function to check the subprotocol
      value before the actual connection is established.
      
      Relocating URL argument is technically not necessary, but seemed legitimate in terms of functional
      correspondence between WebSocket and WebSocketChannel (constructor versus connect()).
      
      No change in behavior, thus no new tests.
      
      * websockets/ThreadableWebSocketChannel.cpp:
      Remove "url" and "protocol" arguments from constructor and add them in connect().
      (WebCore::ThreadableWebSocketChannel::create):
      * websockets/ThreadableWebSocketChannel.h:
      * websockets/WebSocket.cpp:
      (WebCore::WebSocket::connect):
      * websockets/WebSocketChannel.cpp: Same as ThreadableWebSocketChannel.
      (WebCore::WebSocketChannel::WebSocketChannel):
      (WebCore::WebSocketChannel::connect):
      InspectorInstrumentation::didCreateWebSocket() call was moved to connect() because it needs URL.
      This does not change behavior, because connect() is guaranteed to be called immediately after
      WebSocketChannel is constructed.
      * websockets/WebSocketChannel.h:
      (WebCore::WebSocketChannel::create):
      * websockets/WorkerThreadableWebSocketChannel.cpp: Same as ThreadableWebSocketChannel.
      (WebCore::WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel):
      (WebCore::WorkerThreadableWebSocketChannel::connect):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::connect):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
      (WebCore::WorkerThreadableWebSocketChannel::mainThreadConnect):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
      * websockets/WorkerThreadableWebSocketChannel.h:
      (WebCore::WorkerThreadableWebSocketChannel::create):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::create):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::create):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      891dca6b
  10. 28 Jul, 2011 1 commit
    • yutak@chromium.org's avatar
      WebSocket: Pass the value of useHixie76Protocol flag to WebSocket object · 8812aabd
      yutak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=65250
      
      Reviewed by Alexey Proskuryakov.
      
      Add useHixie76Protocol() method to WebSocketChannel and its family. To implement hybi-specific
      attributes in WebSocket object, WebSocket class needs to be able to get the value of
      useHixie76Protocol flag of WebSocketChannel.
      
      If the WebSocket object is created in a worker thread, the flag value must be obtained from
      WebSocketChannel which resides in the loader thread (through WorkerThreadableWebSocketChannel).
      Since the value does not change after creation of WebSocketChannel, it can be cached in
      the worker thread.
      
      There is no change in behavior, thus no new tests.
      
      * websockets/ThreadableWebSocketChannel.h:
      * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
      (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
      (WebCore::ThreadableWebSocketChannelClientWrapper::useHixie76Protocol):
      (WebCore::ThreadableWebSocketChannelClientWrapper::setUseHixie76Protocol):
      * websockets/ThreadableWebSocketChannelClientWrapper.h:
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::useHixie76Protocol):
      * websockets/WebSocketChannel.h:
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::WorkerThreadableWebSocketChannel::useHixie76Protocol):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::useHixie76Protocol):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
      * websockets/WorkerThreadableWebSocketChannel.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8812aabd
  11. 23 Jun, 2011 1 commit
    • darin@apple.com's avatar
      2011-06-23 Darin Adler <darin@apple.com> · ce0eaedc
      darin@apple.com authored
              Reviewed by Ryosuke Niwa.
      
              RefPtr misused as argument type in a few classes
              https://bugs.webkit.org/show_bug.cgi?id=62955
      
              * dom/DataTransferItem.cpp:
              (WebCore::DataTransferItem::DataTransferItem):
              * dom/DataTransferItem.h:
              * dom/DataTransferItems.cpp:
              (WebCore::DataTransferItems::DataTransferItems):
              * dom/DataTransferItems.h:
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
              * editing/CompositeEditCommand.h:
              * page/WebKitAnimationList.cpp:
              (WebCore::WebKitAnimationList::append):
              (WebCore::WebKitAnimationList::insertAnimation):
              * page/WebKitAnimationList.h:
              * svg/graphics/filters/SVGFEImage.cpp:
              (WebCore::FEImage::FEImage):
              (WebCore::FEImage::create):
              * svg/graphics/filters/SVGFEImage.h:
              * svg/graphics/filters/SVGFilterBuilder.cpp:
              (WebCore::SVGFilterBuilder::SVGFilterBuilder):
              (WebCore::SVGFilterBuilder::add):
              (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
              * svg/graphics/filters/SVGFilterBuilder.h:
              * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
              (WebCore::ThreadableWebSocketChannelClientWrapper::didConnectCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
              * websockets/ThreadableWebSocketChannelClientWrapper.h:
              * websockets/WorkerThreadableWebSocketChannel.cpp:
              (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
              * websockets/WorkerThreadableWebSocketChannel.h:
              Use PassRefPtr or raw pointer as appropriate for RefPtr arguments.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ce0eaedc
  12. 22 Jun, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-06-22 Sheriff Bot <webkit.review.bot@gmail.com> · c145b067
      commit-queue@webkit.org authored
              Unreviewed, rolling out r89402.
              http://trac.webkit.org/changeset/89402
              https://bugs.webkit.org/show_bug.cgi?id=63129
      
              It made 6 tests crash (Requested by Ossy on #webkit).
      
              * dom/DataTransferItem.cpp:
              (WebCore::DataTransferItem::DataTransferItem):
              * dom/DataTransferItem.h:
              * dom/DataTransferItems.cpp:
              (WebCore::DataTransferItems::DataTransferItems):
              * dom/DataTransferItems.h:
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
              * editing/CompositeEditCommand.h:
              * page/WebKitAnimationList.cpp:
              (WebCore::WebKitAnimationList::append):
              (WebCore::WebKitAnimationList::insertAnimation):
              * page/WebKitAnimationList.h:
              (WebCore::WebKitAnimationList::create):
              * svg/graphics/filters/SVGFEImage.cpp:
              (WebCore::FEImage::FEImage):
              (WebCore::FEImage::create):
              * svg/graphics/filters/SVGFEImage.h:
              * svg/graphics/filters/SVGFilterBuilder.cpp:
              (WebCore::SVGFilterBuilder::SVGFilterBuilder):
              (WebCore::SVGFilterBuilder::add):
              (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
              * svg/graphics/filters/SVGFilterBuilder.h:
              * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
              (WebCore::ThreadableWebSocketChannelClientWrapper::didConnectCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
              * websockets/ThreadableWebSocketChannelClientWrapper.h:
              * websockets/WorkerThreadableWebSocketChannel.cpp:
              (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
              * websockets/WorkerThreadableWebSocketChannel.h:
              (WebCore::WorkerThreadableWebSocketChannel::Peer::create):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c145b067
  13. 21 Jun, 2011 1 commit
    • darin@apple.com's avatar
      2011-06-21 Darin Adler <darin@apple.com> · 18404ab4
      darin@apple.com authored
              Reviewed by Ryosuke Niwa.
      
              RefPtr misused as argument type in a few classes
              https://bugs.webkit.org/show_bug.cgi?id=62955
      
              * dom/DataTransferItem.cpp:
              (WebCore::DataTransferItem::DataTransferItem):
              * dom/DataTransferItem.h:
              * dom/DataTransferItems.cpp:
              (WebCore::DataTransferItems::DataTransferItems):
              * dom/DataTransferItems.h:
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
              * editing/CompositeEditCommand.h:
              * page/WebKitAnimationList.cpp:
              (WebCore::WebKitAnimationList::append):
              (WebCore::WebKitAnimationList::insertAnimation):
              * page/WebKitAnimationList.h:
              * svg/graphics/filters/SVGFEImage.cpp:
              (WebCore::FEImage::FEImage):
              (WebCore::FEImage::create):
              * svg/graphics/filters/SVGFEImage.h:
              * svg/graphics/filters/SVGFilterBuilder.cpp:
              (WebCore::SVGFilterBuilder::SVGFilterBuilder):
              (WebCore::SVGFilterBuilder::add):
              (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
              * svg/graphics/filters/SVGFilterBuilder.h:
              * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
              (WebCore::ThreadableWebSocketChannelClientWrapper::didConnectCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
              * websockets/ThreadableWebSocketChannelClientWrapper.h:
              * websockets/WorkerThreadableWebSocketChannel.cpp:
              (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
              * websockets/WorkerThreadableWebSocketChannel.h:
              Use PassRefPtr or raw pointer as appropriate for RefPtr arguments.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      18404ab4
  14. 19 Jun, 2011 2 commits
    • mrowe@apple.com's avatar
      4ba97d68
    • darin@apple.com's avatar
      2011-06-19 Darin Adler <darin@apple.com> · 9f246f7e
      darin@apple.com authored
              Reviewed by Sam Weinig.
      
              RefPtr misused as argument type in a few classes
              https://bugs.webkit.org/show_bug.cgi?id=62955
      
              * dom/DataTransferItem.cpp:
              (WebCore::DataTransferItem::DataTransferItem):
              * dom/DataTransferItem.h:
              * dom/DataTransferItems.cpp:
              (WebCore::DataTransferItems::DataTransferItems):
              * dom/DataTransferItems.h:
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
              * editing/CompositeEditCommand.h:
              * inspector/InspectorConsoleInstrumentation.h:
              * inspector/InspectorInstrumentation.cpp:
              (WebCore::InspectorInstrumentation::addProfileImpl):
              * inspector/InspectorInstrumentation.h:
              * inspector/InspectorProfilerAgent.h:
              * inspector/InspectorStyleSheet.cpp:
              (WebCore::InspectorStyleSheet::inspectorStyleForId):
              (WebCore::InspectorStyleSheet::rememberInspectorStyle):
              * inspector/InspectorStyleSheet.h:
              * page/WebKitAnimationList.cpp:
              (WebCore::WebKitAnimationList::append):
              (WebCore::WebKitAnimationList::insertAnimation):
              * page/WebKitAnimationList.h:
              * svg/graphics/filters/SVGFEImage.cpp:
              (WebCore::FEImage::FEImage):
              (WebCore::FEImage::create):
              * svg/graphics/filters/SVGFEImage.h:
              * svg/graphics/filters/SVGFilterBuilder.cpp:
              (WebCore::SVGFilterBuilder::SVGFilterBuilder):
              (WebCore::SVGFilterBuilder::add):
              (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
              * svg/graphics/filters/SVGFilterBuilder.h:
              * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
              (WebCore::ThreadableWebSocketChannelClientWrapper::didConnectCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
              * websockets/ThreadableWebSocketChannelClientWrapper.h:
              * websockets/WorkerThreadableWebSocketChannel.cpp:
              (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
              * websockets/WorkerThreadableWebSocketChannel.h:
              Use PassRefPtr or raw pointer as appropriate for RefPtr arguments.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9f246f7e
  15. 30 May, 2011 1 commit
    • yutak@chromium.org's avatar
      2011-05-29 Yuta Kitamura <yutak@chromium.org> · 1b50cd5e
      yutak@chromium.org authored
              Reviewed by Kent Tamura.
      
              WebSocket closing handshake
              https://bugs.webkit.org/show_bug.cgi?id=35721
      
              * http/tests/websocket/tests/client-close-expected.txt: Added.
              * http/tests/websocket/tests/client-close.html: Added. Test client-initiated close.
              * http/tests/websocket/tests/client-close_wsh.py: Added.
              * http/tests/websocket/tests/close-before-open-expected.txt: Add a new console message.
              * http/tests/websocket/tests/close-event-expected.txt:
              * http/tests/websocket/tests/close-event.html: Test if closeEvent.wasClean is true.
              * http/tests/websocket/tests/close-unref-websocket-expected.txt: Add a new console message.
              * http/tests/websocket/tests/frame-length-longer-than-buffer_wsh.py:
              We need to stop pywebsocket from starting the closing handshake. Otherwise, pywebsocket
              waits for a close frame to arrive and this test will time out.
              * http/tests/websocket/tests/server-close-expected.txt: Added.
              * http/tests/websocket/tests/server-close.html: Added. Test server-initiated close.
              * http/tests/websocket/tests/server-close_wsh.py: Added.
              * http/tests/websocket/tests/websocket-event-target-expected.txt: Add a new console message.
      2011-05-29  Yuta Kitamura  <yutak@chromium.org>
      
              Reviewed by Kent Tamura.
      
              WebSocket closing handshake
              https://bugs.webkit.org/show_bug.cgi?id=35721
      
              Implement WebSocket closing handshake based on Ian Hickson's
              WebSocket protocol draft 76.
      
              Tests: http/tests/websocket/tests/client-close.html
                     http/tests/websocket/tests/server-close.html
      
              * platform/network/SocketStreamHandleBase.cpp:
              (WebCore::SocketStreamHandleBase::send):
              Do not send a message if we are in Closing state.
              (WebCore::SocketStreamHandleBase::close):
              Do not disconnect if we have pending data which have not been sent yet.
              In this case, the actual disconnection will happen in sendPendingData().
              (WebCore::SocketStreamHandleBase::disconnect):
              Renamed from close(). Disconnect the connection immediately.
              (WebCore::SocketStreamHandleBase::sendPendingData):
              * platform/network/SocketStreamHandleBase.h:
              * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
              Add didStartClosingHandshake(). Add a function argument (ClosingHandshakeCompletionStatus)
              to didClose().
              (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
              * websockets/ThreadableWebSocketChannelClientWrapper.h:
              * websockets/WebSocket.cpp:
              (WebCore::WebSocket::send):
              (WebCore::WebSocket::close):
              Fail if close() is attempted before the connection is established.
              Otherwise, set the state to CLOSING and start the closing handshake.
              (WebCore::WebSocket::bufferedAmount):
              If the state is CLOSING, we need to consider buffered data in m_channel and sent after close().
              (WebCore::WebSocket::didConnect):
              (WebCore::WebSocket::didReceiveMessage):
              We need to invoke message event in CLOSING state as well as OPEN state.
              (WebCore::WebSocket::didReceiveMessageError):
              (WebCore::WebSocket::didStartClosingHandshake):
              (WebCore::WebSocket::didClose):
              * websockets/WebSocket.h:
              * websockets/WebSocketChannel.cpp:
              (WebCore::WebSocketChannel::WebSocketChannel):
              (WebCore::WebSocketChannel::close):
              Start the closing handshake.
              (WebCore::WebSocketChannel::disconnect):
              Disconnect the socket stream, instead of close.
              (WebCore::WebSocketChannel::didClose):
              (WebCore::WebSocketChannel::didReceiveData): Ditto.
              (WebCore::WebSocketChannel::didFail): Ditto.
              (WebCore::WebSocketChannel::processBuffer):
              Ditto.
              Handle 0xFF 0x00 byte sequence, and discard received data once the closing handshake has started.
              (WebCore::WebSocketChannel::startClosingHandshake):
              Send 0xFF 0x00 byte sequence.
              (WebCore::WebSocketChannel::closingTimerFired):
              Disconnect the socket stream if the closing handshake has timed out.
              * websockets/WebSocketChannel.h:
              m_closing is true if "the WebSocket closing handshake has started" (as stated in the protocol
              specification).
              * websockets/WebSocketChannelClient.h:
              (WebCore::WebSocketChannelClient::didStartClosingHandshake): Added.
              (WebCore::WebSocketChannelClient::didClose): Add closingHandshakeCompletion parameter.
              * websockets/WorkerThreadableWebSocketChannel.cpp:
              Add closingHandshakeCompletion parameter to didClose(), and add didStartClosingHandshake().
              (WebCore::WorkerThreadableWebSocketChannel::Peer::close):
              (WebCore::workerContextDidStartClosingHandshake):
              (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
              (WebCore::workerContextDidClose):
              (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
              * websockets/WorkerThreadableWebSocketChannel.h:
      2011-05-29  Yuta Kitamura  <yutak@chromium.org>
      
              Reviewed by Kent Tamura.
      
              WebSocket closing handshake
              https://bugs.webkit.org/show_bug.cgi?id=35721
      
              * Scripts/webkitpy/thirdparty/__init__.py:
              Pull in pywebsocket 0.6b1. We need to update pywebsocket
              to get the right behavior of closing handshake.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1b50cd5e
  16. 27 May, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-05-27 Sheriff Bot <webkit.review.bot@gmail.com> · 4bc56128
      commit-queue@webkit.org authored
              Unreviewed, rolling out r87464.
              http://trac.webkit.org/changeset/87464
              https://bugs.webkit.org/show_bug.cgi?id=61643
      
              client-close/server-close tests are flaky on Chromium Mac and
              Windows (Requested by aklein on #webkit).
      
              * http/tests/websocket/tests/client-close-expected.txt: Removed.
              * http/tests/websocket/tests/client-close.html: Removed.
              * http/tests/websocket/tests/client-close_wsh.py: Removed.
              * http/tests/websocket/tests/close-before-open-expected.txt:
              * http/tests/websocket/tests/close-event-expected.txt:
              * http/tests/websocket/tests/close-event.html:
              * http/tests/websocket/tests/close-unref-websocket-expected.txt:
              * http/tests/websocket/tests/frame-length-longer-than-buffer_wsh.py:
              * http/tests/websocket/tests/server-close-expected.txt: Removed.
              * http/tests/websocket/tests/server-close.html: Removed.
              * http/tests/websocket/tests/server-close_wsh.py: Removed.
              * http/tests/websocket/tests/websocket-event-target-expected.txt:
      2011-05-27  Sheriff Bot  <webkit.review.bot@gmail.com>
      
              Unreviewed, rolling out r87464.
              http://trac.webkit.org/changeset/87464
              https://bugs.webkit.org/show_bug.cgi?id=61643
      
              client-close/server-close tests are flaky on Chromium Mac and
              Windows (Requested by aklein on #webkit).
      
              * platform/network/SocketStreamHandleBase.cpp:
              (WebCore::SocketStreamHandleBase::send):
              (WebCore::SocketStreamHandleBase::close):
              (WebCore::SocketStreamHandleBase::sendPendingData):
              * platform/network/SocketStreamHandleBase.h:
              * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
              (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
              * websockets/ThreadableWebSocketChannelClientWrapper.h:
              * websockets/WebSocket.cpp:
              (WebCore::WebSocket::send):
              (WebCore::WebSocket::close):
              (WebCore::WebSocket::bufferedAmount):
              (WebCore::WebSocket::didConnect):
              (WebCore::WebSocket::didReceiveMessage):
              (WebCore::WebSocket::didReceiveMessageError):
              (WebCore::WebSocket::didClose):
              * websockets/WebSocket.h:
              * websockets/WebSocketChannel.cpp:
              (WebCore::WebSocketChannel::WebSocketChannel):
              (WebCore::WebSocketChannel::close):
              (WebCore::WebSocketChannel::disconnect):
              (WebCore::WebSocketChannel::didClose):
              (WebCore::WebSocketChannel::didReceiveData):
              (WebCore::WebSocketChannel::didFail):
              (WebCore::WebSocketChannel::processBuffer):
              * websockets/WebSocketChannel.h:
              * websockets/WebSocketChannelClient.h:
              (WebCore::WebSocketChannelClient::didClose):
              * websockets/WorkerThreadableWebSocketChannel.cpp:
              (WebCore::WorkerThreadableWebSocketChannel::Peer::close):
              (WebCore::workerContextDidClose):
              (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
              * websockets/WorkerThreadableWebSocketChannel.h:
      2011-05-27  Sheriff Bot  <webkit.review.bot@gmail.com>
      
              Unreviewed, rolling out r87464.
              http://trac.webkit.org/changeset/87464
              https://bugs.webkit.org/show_bug.cgi?id=61643
      
              client-close/server-close tests are flaky on Chromium Mac and
              Windows (Requested by aklein on #webkit).
      
              * Scripts/webkitpy/thirdparty/__init__.py:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87519 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4bc56128
  17. 26 May, 2011 1 commit
    • yutak@chromium.org's avatar
      2011-05-26 Yuta Kitamura <yutak@chromium.org> · 69cb9ece
      yutak@chromium.org authored
              Reviewed by Kent Tamura.
      
              WebSocket closing handshake
              https://bugs.webkit.org/show_bug.cgi?id=35721
      
              * http/tests/websocket/tests/client-close-expected.txt: Added.
              * http/tests/websocket/tests/client-close.html: Added. Test client-initiated close.
              * http/tests/websocket/tests/client-close_wsh.py: Added.
              * http/tests/websocket/tests/close-before-open-expected.txt: Add a new console message.
              * http/tests/websocket/tests/close-event-expected.txt:
              * http/tests/websocket/tests/close-event.html: Test if closeEvent.wasClean is true.
              * http/tests/websocket/tests/close-unref-websocket-expected.txt: Add a new console message.
              * http/tests/websocket/tests/frame-length-longer-than-buffer_wsh.py:
              We need to stop pywebsocket from starting the closing handshake. Otherwise, pywebsocket
              waits for a close frame to arrive and this test will time out.
              * http/tests/websocket/tests/server-close-expected.txt: Added.
              * http/tests/websocket/tests/server-close.html: Added. Test server-initiated close.
              * http/tests/websocket/tests/server-close_wsh.py: Added.
              * http/tests/websocket/tests/websocket-event-target-expected.txt: Add a new console message.
      2011-05-26  Yuta Kitamura  <yutak@chromium.org>
      
              Reviewed by Kent Tamura.
      
              WebSocket closing handshake
              https://bugs.webkit.org/show_bug.cgi?id=35721
      
              Implement WebSocket closing handshake based on Ian Hickson's
              WebSocket protocol draft 76.
      
              Tests: http/tests/websocket/tests/client-close.html
                     http/tests/websocket/tests/server-close.html
      
              * platform/network/SocketStreamHandleBase.cpp:
              (WebCore::SocketStreamHandleBase::send):
              Do not send a message if we are in Closing state.
              (WebCore::SocketStreamHandleBase::close):
              Do not disconnect if we have pending data which have not been sent yet.
              In this case, the actual disconnection will happen in sendPendingData().
              (WebCore::SocketStreamHandleBase::disconnect):
              Renamed from close(). Disconnect the connection immediately.
              (WebCore::SocketStreamHandleBase::sendPendingData):
              * platform/network/SocketStreamHandleBase.h:
              * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
              Add didStartClosingHandshake(). Add a function argument (ClosingHandshakeCompletionStatus)
              to didClose().
              (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
              (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
              * websockets/ThreadableWebSocketChannelClientWrapper.h:
              * websockets/WebSocket.cpp:
              (WebCore::WebSocket::send):
              (WebCore::WebSocket::close):
              Fail if close() is attempted before the connection is established.
              Otherwise, set the state to CLOSING and start the closing handshake.
              (WebCore::WebSocket::bufferedAmount):
              If the state is CLOSING, we need to consider buffered data in m_channel and sent after close().
              (WebCore::WebSocket::didConnect):
              (WebCore::WebSocket::didReceiveMessage):
              We need to invoke message event in CLOSING state as well as OPEN state.
              (WebCore::WebSocket::didReceiveMessageError):
              (WebCore::WebSocket::didStartClosingHandshake):
              (WebCore::WebSocket::didClose):
              * websockets/WebSocket.h:
              * websockets/WebSocketChannel.cpp:
              (WebCore::WebSocketChannel::WebSocketChannel):
              (WebCore::WebSocketChannel::close):
              Start the closing handshake.
              (WebCore::WebSocketChannel::disconnect):
              Disconnect the socket stream, instead of close.
              (WebCore::WebSocketChannel::didClose):
              (WebCore::WebSocketChannel::didReceiveData): Ditto.
              (WebCore::WebSocketChannel::didFail): Ditto.
              (WebCore::WebSocketChannel::processBuffer):
              Ditto.
              Handle 0xFF 0x00 byte sequence, and discard received data once the closing handshake has started.
              (WebCore::WebSocketChannel::startClosingHandshake):
              Send 0xFF 0x00 byte sequence.
              (WebCore::WebSocketChannel::closingTimerFired):
              Disconnect the socket stream if the closing handshake has timed out.
              * websockets/WebSocketChannel.h:
              m_closing is true if "the WebSocket closing handshake has started" (as stated in the protocol
              specification).
              * websockets/WebSocketChannelClient.h:
              (WebCore::WebSocketChannelClient::didStartClosingHandshake): Added.
              (WebCore::WebSocketChannelClient::didClose): Add closingHandshakeCompletion parameter.
              * websockets/WorkerThreadableWebSocketChannel.cpp:
              Add closingHandshakeCompletion parameter to didClose(), and add didStartClosingHandshake().
              (WebCore::WorkerThreadableWebSocketChannel::Peer::close):
              (WebCore::workerContextDidStartClosingHandshake):
              (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
              (WebCore::workerContextDidClose):
              (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
              * websockets/WorkerThreadableWebSocketChannel.h:
      2011-05-26  Yuta Kitamura  <yutak@chromium.org>
      
              Reviewed by Kent Tamura.
      
              WebSocket closing handshake
              https://bugs.webkit.org/show_bug.cgi?id=35721
      
              * Scripts/webkitpy/thirdparty/__init__.py:
              Pull in pywebsocket 0.6b1. We need to update pywebsocket
              to get the right behavior of closing handshake.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87464 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      69cb9ece
  18. 24 May, 2011 1 commit
    • yutak@chromium.org's avatar
      2011-05-24 Yuta Kitamura <yutak@chromium.org> · 25f6e077
      yutak@chromium.org authored
              Reviewed by Kent Tamura.
      
              WebSocket: Add fail() to WebSocketChannel and its family
              https://bugs.webkit.org/show_bug.cgi?id=61277
      
              This is the first part of refactoring effort described in bug 61115.
              Existing error reports will be modified to use fail() in a later patch.
      
              No change in behavior, thus no new tests.
      
              * websockets/ThreadableWebSocketChannel.h:
              * websockets/WebSocketChannel.cpp:
              (WebCore::WebSocketChannel::fail):
              * websockets/WebSocketChannel.h:
              * websockets/WorkerThreadableWebSocketChannel.cpp:
              (WebCore::WorkerThreadableWebSocketChannel::fail):
              (WebCore::WorkerThreadableWebSocketChannel::Peer::fail):
              (WebCore::WorkerThreadableWebSocketChannel::mainThreadFail):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::fail):
              * websockets/WorkerThreadableWebSocketChannel.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      25f6e077
  19. 20 Jan, 2011 1 commit
    • ossy@webkit.org's avatar
      Refactoring of the custom allocation framework · 95c1bc42
      ossy@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=49897
      
      Patch by Zoltan Horvath <zoltan@webkit.org> on 2011-01-20
      Reviewed by Csaba Osztrogonác.
      
      Source/JavaScriptCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      * wtf/FastAllocBase.h: Turn FastAllocBase's implementation into a macro.
      
      Source/WebCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit2:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Tools:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      95c1bc42
  20. 08 Jan, 2011 1 commit
  21. 10 May, 2010 1 commit
    • ukai@chromium.org's avatar
      2010-05-10 Fumitoshi Ukai <ukai@chromium.org> · 00bba7de
      ukai@chromium.org authored
              Reviewed by Alexey Proskuryakov.
      
              WebSocket needs to suspend/resume as Active DOM object.
              https://bugs.webkit.org/show_bug.cgi?id=38171
      
              Implement suspend()/resume() in WebSocket and WebSocketChannel.
              While WebSocketChannel is suspended, it only adds received data in m_buffer
              or record the handle was closed, and report no event to WebSocket.
              When resumed, it will process buffer or handle closing.
              Since suspend/resume would be called while processing JavaScript event handler (e.g. before/after alert()), WebSocketChannel method that would fire an event need to be reentrant.
              So, WebSocketChannel::processBuffer() call WebSocket to fire an event at most once and skips buffer before the calling,
              so that next call of processBuffer() would process the next frame.
      
              * websockets/ThreadableWebSocketChannel.h:
              * websockets/ThreadableWebSocketChannelClientWrapper.h:
              (WebCore::ThreadableWebSocketChannelClientWrapper::didConnect):
                Mark channel is opened, and process pending events if not suspended.
              (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessage):
                Push message back in pending queue, and process pending events if not suspended.
              (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
                Mark channel is closed, and process pending events if not suspended.
              (WebCore::ThreadableWebSocketChannelClientWrapper::suspend):
                Mark suspended.
              (WebCore::ThreadableWebSocketChannelClientWrapper::resume):
                Unmark suspended, and process pending events.
              (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
              (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingEvents):
              * websockets/WebSocket.cpp:
              (WebCore::WebSocket::canSuspend):
              (WebCore::WebSocket::suspend):
              (WebCore::WebSocket::resume):
              (WebCore::WebSocket::didClose):
              * websockets/WebSocket.h:
              * websockets/WebSocketChannel.cpp:
              (WebCore::WebSocketChannel::WebSocketChannel):
              (WebCore::WebSocketChannel::connect):
              (WebCore::WebSocketChannel::send):
              (WebCore::WebSocketChannel::bufferedAmount):
              (WebCore::WebSocketChannel::close):
              (WebCore::WebSocketChannel::suspend):
              (WebCore::WebSocketChannel::resume):
               When resumed, it will process buffer and
               handle closing if handle was already closed while suspended.
              (WebCore::WebSocketChannel::didClose):
               If suspended, record unhandled bufferedAmount and set m_closed true, so that closing will be processed when resumed.
              (WebCore::WebSocketChannel::didReceiveData):
               Add received data in buffer and process buffer while it is not suspended.
              (WebCore::WebSocketChannel::processBuffer):
               Process handshake header or one frame message.
               Return true if there are more data to be processed.
               Return false otherwise (e.g. incomplete handshake header or incomplete frame).
              * websockets/WebSocketChannel.h:
              * websockets/WorkerThreadableWebSocketChannel.cpp:
              (WebCore::WorkerThreadableWebSocketChannel::suspend):
              (WebCore::WorkerThreadableWebSocketChannel::resume):
              (WebCore::WorkerThreadableWebSocketChannel::Peer::suspend):
              (WebCore::WorkerThreadableWebSocketChannel::Peer::resume):
              (WebCore::WorkerThreadableWebSocketChannel::mainThreadSuspend):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::suspend):
              (WebCore::WorkerThreadableWebSocketChannel::mainThreadResume):
              (WebCore::WorkerThreadableWebSocketChannel::Bridge::resume):
              * websockets/WorkerThreadableWebSocketChannel.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      00bba7de
  22. 15 Apr, 2010 1 commit
  23. 17 Feb, 2010 1 commit
    • ukai@chromium.org's avatar
      2010-02-17 Fumitoshi Ukai <ukai@chromium.org> · 3065d182
      ukai@chromium.org authored
              Reviewed by Alexey Proskuryakov.
      
              WebSocket bufferedAmount should not be 0 when send after close.
              https://bugs.webkit.org/show_bug.cgi?id=34633
      
              * websocket/tests/bufferedAmount-after-close-expected.txt: Added.
              * websocket/tests/bufferedAmount-after-close.html: Added.
              * websocket/tests/script-tests/bufferedAmount-after-close.js: Added.
      2010-02-17  Fumitoshi Ukai  <ukai@chromium.org>
      
              Reviewed by Alexey Proskuryakov.
      
              WebSocket bufferedAmount should not be 0 when send after close.
              https://bugs.webkit.org/show_bug.cgi?id=34633
      
              Fixed bug in webkit r54694.  check m_client after it calls user
              callback, because user callback may call close(), which would
              call onclose event handler.
      
              Test: websocket/tests/bufferedAmount-after-close.html
      
              * 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):
              (WebCore::WebSocketChannel::didReceiveData):
              * 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@54927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3065d182
  24. 12 Feb, 2010 1 commit
    • eric@webkit.org's avatar
      2010-02-12 Eric Seidel <eric@webkit.org> · 157a018b
      eric@webkit.org authored
              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@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
      157a018b
  25. 11 Feb, 2010 1 commit
    • ukai@chromium.org's avatar
      2010-02-11 Fumitoshi Ukai <ukai@chromium.org> · e20b8981
      ukai@chromium.org authored
              Reviewed by Alexey Proskuryakov.
      
              WebSocket bufferedAmount should not be 0 when send after close.
              https://bugs.webkit.org/show_bug.cgi?id=34633
      
              * websocket/tests/bufferedAmount-after-close-expected.txt: Added.
              * websocket/tests/bufferedAmount-after-close.html: Added.
              * websocket/tests/script-tests/bufferedAmount-after-close.js: Added.
      2010-02-11  Fumitoshi Ukai  <ukai@chromium.org>
      
              Reviewed by Alexey Proskuryakov.
      
              WebSocket bufferedAmount should not be 0 when send after close.
              https://bugs.webkit.org/show_bug.cgi?id=34633
      
              Test: websocket/tests/bufferedAmount-after-close.html
      
              * 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@54694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e20b8981
  26. 20 Jan, 2010 1 commit
    • levin@chromium.org's avatar
      CrossThreadCopier needs to support ThreadSafeShared better. · 78e32a56
      levin@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=33698
      
      Reviewed by Oliver Hunt.
      
      JavaScriptCore:
      
      * wtf/TypeTraits.cpp: Added tests for the new type traits.
      * wtf/TypeTraits.h:
      (WTF::IsSubclass): Determines if a class is a derived from another class.
      (WTF::IsSubclassOfTemplate): Determines if a class is a derived from a
      template class (with one parameter that is unknown).
      (WTF::RemoveTemplate): Reveals the type for a template parameter.
      
      WebCore:
      
      Now the copier is able to handle types that derive from ThreadSafeShared.
      
      No change functionality so no new tests.
      
      * loader/WorkerThreadableLoader.cpp:
      (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel): Remove unnecessary cast.
      (WebCore::WorkerThreadableLoader::MainThreadBridge::clearClientWrapper): Ditto.
      * loader/WorkerThreadableLoader.h:
      Change to use the derived class instead of the ThreadSafeShared version.
      * platform/CrossThreadCopier.cpp:
      Add the new template parameter throughout the classes and adjust the class that
      handles ThreadSafeShared to allow for derived types.
      * platform/CrossThreadCopier.h:
      Add another template parameter to be able to detect classes that derive
      from ThreadSafeShared.
      * websockets/WorkerThreadableWebSocketChannel.cpp:
      Removed unnecessary casts and changed a type to use the derived class instead of
      the ThreadSafeShared version.
      (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
      (WebCore::workerContextDidSend):
      (WebCore::workerContextDidGetBufferedAmount):
      (WebCore::workerContextDidConnect):
      (WebCore::workerContextDidReceiveMessage):
      (WebCore::workerContextDidClose):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::clearClientWrapper):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::setMethodNotCompleted):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::waitForMethodCompletion):
      * websockets/WorkerThreadableWebSocketChannel.h:
      (WebCore::WorkerThreadableWebSocketChannel::Peer::create): Changed a type to use the
      derived class instead of the ThreadSafeShared version.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53568 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      78e32a56
  27. 15 Jan, 2010 1 commit
  28. 06 Jan, 2010 1 commit
    • ukai@chromium.org's avatar
      2010-01-06 Fumitoshi Ukai <ukai@chromium.org> · e31aa0c3
      ukai@chromium.org authored
              Reviewed by David Levin
      
              Add WebSocket feature in Worker
              https://bugs.webkit.org/show_bug.cgi?id=32214
      
              * websocket/tests/workers/resources/simple_wsh.py: Copied from LayoutTests/websocket/tests/simple_wsh.py.
              * websocket/tests/workers/resources/worker-simple.js: Added.
              * websocket/tests/workers/worker-simple-expected.txt: Added.
              * websocket/tests/workers/worker-simple.html: Added.
      2010-01-06  Fumitoshi Ukai  <ukai@chromium.org>
      
              Reviewed by David Levin.
      
              Add WebSocket feature in Worker
              https://bugs.webkit.org/show_bug.cgi?id=32214
      
              Introduce ThreadableWebSocketChannel interface and add
              WorkerThreadableWebSocketChannel for Worker.
              WorkerThreadableWebSocketChannel uses WebSocketChannel in the
              main thread, which is managed by Peer and communicated via Bridge.
      
              Test: websocket/tests/workers/worker-simple.html
      
              * GNUmakefile.am:
              * WebCore.gypi:
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * bindings/js/JSWebSocketConstructor.h:
              * bindings/js/JSWorkerContextCustom.cpp:
              (WebCore::JSWorkerContext::webSocket):
              * bindings/v8/WorkerContextExecutionProxy.cpp:
              (WebCore::WorkerContextExecutionProxy::convertEventTargetToV8Object):
              * bindings/v8/custom/V8WebSocketCustom.cpp:
              (WebCore::V8Custom::v8WebSocketConstructorCallback):
              * bindings/v8/custom/V8WorkerContextCustom.cpp:
              * platform/CrossThreadCopier.cpp:
              (WebCore::::copy):
              * platform/CrossThreadCopier.h:
              (WebCore::):
              * websockets/ThreadableWebSocketChannel.cpp: Added.
              * websockets/ThreadableWebSocketChannel.h: Added.
              * websockets/ThreadableWebSocketChannelClientWrapper.h: Added.
              * websockets/WebSocket.cpp:
              (WebCore::WebSocket::connect):
              (WebCore::WebSocket::didReceiveMessage):
              * websockets/WebSocket.h:
              * websockets/WebSocketChannel.h:
              (WebCore::WebSocketChannel::refThreadableWebSocketChannel):
              (WebCore::WebSocketChannel::derefThreadableWebSocketChannel):
              * websockets/WebSocketChannelClient.h:
              * websockets/WebSocketHandshake.h:
              * websockets/WorkerThreadableWebSocketChannel.cpp: Added.
              * websockets/WorkerThreadableWebSocketChannel.h: Added.
              * workers/WorkerContext.idl:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e31aa0c3