RESOLVED FIXED 160889
Clean up WebSockets
https://bugs.webkit.org/show_bug.cgi?id=160889
Summary Clean up WebSockets
Alex Christensen
Reported 2016-08-15 20:06:03 PDT
Clean up WebSockets
Attachments
Patch (12.95 KB, patch)
2016-08-15 20:11 PDT, Alex Christensen
no flags
Patch (16.58 KB, patch)
2016-08-15 20:20 PDT, Alex Christensen
no flags
Patch (19.30 KB, patch)
2016-08-15 20:26 PDT, Alex Christensen
no flags
Patch (19.75 KB, patch)
2016-08-15 20:32 PDT, Alex Christensen
no flags
Patch (19.93 KB, patch)
2016-08-15 20:43 PDT, Alex Christensen
no flags
Patch (20.07 KB, patch)
2016-08-15 21:03 PDT, Alex Christensen
no flags
Patch (22.78 KB, patch)
2016-08-16 00:14 PDT, Alex Christensen
no flags
Archive of layout-test-results from ews101 for mac-yosemite (933.43 KB, application/zip)
2016-08-16 01:04 PDT, Build Bot
no flags
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (1.00 MB, application/zip)
2016-08-16 01:07 PDT, Build Bot
no flags
Archive of layout-test-results from ews116 for mac-yosemite (1.55 MB, application/zip)
2016-08-16 01:16 PDT, Build Bot
no flags
Patch (23.87 KB, patch)
2016-08-16 09:37 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2016-08-15 20:11:04 PDT
Alex Christensen
Comment 2 2016-08-15 20:20:36 PDT
Alex Christensen
Comment 3 2016-08-15 20:26:31 PDT
Alex Christensen
Comment 4 2016-08-15 20:32:46 PDT
Alex Christensen
Comment 5 2016-08-15 20:43:21 PDT
Alex Christensen
Comment 6 2016-08-15 21:03:10 PDT
Darin Adler
Comment 7 2016-08-15 22:53:21 PDT
Comment on attachment 286146 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=286146&action=review Looks OK, but could be improved more. Seems that it introduces some small amount of new sloppiness. > Source/WebCore/Modules/websockets/WebSocketChannel.cpp:313 > + LOG(Network, "WebSocketChannel %p didReceiveSocketStreamData() Received %zu bytes", this, len); This is going to look crazy when len is std::numeric_limits<size_t>::max(). > Source/WebCore/Modules/websockets/WebSocketChannel.cpp:319 > + if (len == std::numeric_limits<size_t>::max()) { Why do we need this magic value here? Isn’t there a cleaner way to do this, like using a separate function for the "need to disconnect" case. Or using Optional to indicate there is no length? Or could we at least make this magic value a named constant? I don’t see the patch changing the call site, so I am concerned that this might not even be the correct value. > Source/WebCore/platform/network/SocketStreamHandle.cpp:69 > - if (bytesWritten < 0) > + if (bytesWritten == sendError) > return false; This should be nested inside the if statement above. > Source/WebCore/platform/network/SocketStreamHandle.h:58 > + const size_t sendError = std::numeric_limits<size_t>::max(); > + virtual size_t platformSend(const char* data, size_t length) = 0; Why use a magic value to indicate a send error? To indicate an error we could use Optional or some other technique without a magic number. > Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp:192 > + return static_cast<size_t>(written); This relies on casting a -1 to size_t yielding std::numeric_limits<size_t>::max(), something I believe the patch avoids in the CFNetwork version. > Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.h:74 > + void didOpenSocketStream(WebCore::SocketStreamHandle&) override { } > void didCloseSocketStream(WebCore::SocketStreamHandle&) override; > - void didReceiveSocketStreamData(WebCore::SocketStreamHandle&, const char* data, int length) override; > + void didReceiveSocketStreamData(WebCore::SocketStreamHandle&, const char* data, size_t length) override; > void didUpdateBufferedAmount(WebCore::SocketStreamHandle&, size_t bufferedAmount) override; > + void didFailSocketStream(WebCore::SocketStreamHandle&, const WebCore::SocketStreamError&) override { } Should use final instead of override.
Alex Christensen
Comment 8 2016-08-16 00:14:53 PDT
Alex Christensen
Comment 9 2016-08-16 00:59:46 PDT
Comment on attachment 286158 [details] Patch This patch changes something. Will look into later.
Build Bot
Comment 10 2016-08-16 01:04:15 PDT
Comment on attachment 286158 [details] Patch Attachment 286158 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/1879909 New failing tests: http/tests/websocket/tests/hybi/handshake-ok-with-legacy-sec-websocket-response-headers.html http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response-headers.html
Build Bot
Comment 11 2016-08-16 01:04:18 PDT
Created attachment 286165 [details] Archive of layout-test-results from ews101 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 12 2016-08-16 01:07:55 PDT
Comment on attachment 286158 [details] Patch Attachment 286158 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/1879917 New failing tests: http/tests/websocket/tests/hybi/handshake-ok-with-legacy-sec-websocket-response-headers.html http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response-headers.html
Build Bot
Comment 13 2016-08-16 01:07:58 PDT
Created attachment 286166 [details] Archive of layout-test-results from ews106 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 14 2016-08-16 01:16:05 PDT
Comment on attachment 286158 [details] Patch Attachment 286158 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/1879925 New failing tests: http/tests/websocket/tests/hybi/handshake-ok-with-legacy-sec-websocket-response-headers.html http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response-headers.html
Build Bot
Comment 15 2016-08-16 01:16:08 PDT
Created attachment 286168 [details] Archive of layout-test-results from ews116 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-yosemite Platform: Mac OS X 10.10.5
Alex Christensen
Comment 16 2016-08-16 09:37:21 PDT
Alex Christensen
Comment 17 2016-08-16 11:13:09 PDT
Note You need to log in before you can comment on or make changes to this bug.