Changeset 109538 in webkit
- Timestamp:
- Mar 2, 2012 2:24:43 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 18 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r109537 r109538 1 2012-03-02 Kenichi Ishibashi <bashi@chromium.org> 2 3 Adding WebSocket per-frame DEFLATE extension 4 https://bugs.webkit.org/show_bug.cgi?id=77522 5 6 Added tests for WebSocket deflate-frame extension. Also updated some 7 tests to follow the change. 8 9 Reviewed by Kent Tamura. 10 11 * http/tests/websocket/tests/hybi/compressed-control-frame-expected.txt: Added. 12 * http/tests/websocket/tests/hybi/compressed-control-frame.html: Added. 13 * http/tests/websocket/tests/hybi/compressed-control-frame_wsh.py: Added. 14 (web_socket_do_extra_handshake): 15 (web_socket_transfer_data): 16 * http/tests/websocket/tests/hybi/deflate-frame-comp-bit-onoff-expected.txt: Added. 17 * http/tests/websocket/tests/hybi/deflate-frame-comp-bit-onoff.html: Added. 18 * http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter-expected.txt: Added. 19 * http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter.html: Added. 20 * http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter_wsh.py: Added. 21 (web_socket_do_extra_handshake): 22 (web_socket_transfer_data): 23 * http/tests/websocket/tests/hybi/deflate-frame-parameter-expected.txt: Added. 24 * http/tests/websocket/tests/hybi/deflate-frame-parameter.html: Added. 25 * http/tests/websocket/tests/hybi/deflate-frame_wsh.py: Added. 26 (_get_deflate_frame_extension_processor): 27 (web_socket_do_extra_handshake): 28 (web_socket_transfer_data): 29 * http/tests/websocket/tests/hybi/handshake-fail-by-extensions-header-expected.txt: 30 * http/tests/websocket/tests/hybi/send-file-blob_wsh.py: 31 (_retrieve_frame): 32 (web_socket_transfer_data): 33 * platform/efl/Skipped: Skips tests rely on zlib 34 * platform/qt/Skipped: Ditto. 35 1 36 2012-03-02 Kentaro Hara <haraken@chromium.org> 2 37 -
trunk/LayoutTests/http/tests/websocket/tests/hybi/compressed-control-frame-expected.txt
r109537 r109538 1 CONSOLE MESSAGE: Received unexpected Sec-WebSocket-Extensions header2 Test whether WebSocket handshake fails if the server sends Sec-WebSocket-Extensions header.1 CONSOLE MESSAGE: Received unexpected compressed frame 2 Test whether a compressed control frame is rejected 3 3 4 4 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 5 5 6 onopen() was called. 7 onclose() was called. 6 8 PASS closeEvent.wasClean is false 7 9 PASS successfullyParsed is true -
trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-extensions-header-expected.txt
r108752 r109538 1 CONSOLE MESSAGE: Received unexpected Sec-WebSocket-Extensions header1 CONSOLE MESSAGE: Received unexpected extension: x-foo 2 2 Test whether WebSocket handshake fails if the server sends Sec-WebSocket-Extensions header. 3 3 -
trunk/LayoutTests/http/tests/websocket/tests/hybi/send-file-blob_wsh.py
r108752 r109538 1 1 from mod_pywebsocket import common 2 2 from mod_pywebsocket import msgutil 3 4 5 def _retrieve_frame(stream): 6 # FIXME: Use better API. 7 frame = stream._receive_frame_as_frame_object() 8 for frame_filter in stream._options.incoming_frame_filters: 9 frame_filter.filter(frame) 10 return frame 3 11 4 12 … … 11 19 12 20 for test_number, expected_message in enumerate(expected_messages): 13 # FIXME: Use better API. 14 opcode, payload, final, unused_reserved1, unused_reserved2, unused_reserved3 = request.ws_stream._receive_frame() 15 if opcode == common.OPCODE_BINARY and payload == expected_message and final: 21 frame = _retrieve_frame(request.ws_stream) 22 if frame.opcode == common.OPCODE_BINARY and frame.payload == expected_message and frame.fin: 16 23 msgutil.send_message(request, 'PASS: Message #%d.' % test_number) 17 24 else: 18 msgutil.send_message(request, 'FAIL: Message #%d: Received unexpected frame: opcode = %r, payload = %r, final = %r' % (test_number, opcode, payload, final))25 msgutil.send_message(request, 'FAIL: Message #%d: Received unexpected frame: opcode = %r, payload = %r, final = %r' % (test_number, frame.opcode, frame.payload, frame.fin)) 19 26 20 27 -
trunk/LayoutTests/platform/efl/Skipped
r109359 r109538 1280 1280 # This test verifies that a mismatch reftest will fail as intended if both results are same. 1281 1281 fast/harness/sample-fail-mismatch-reftest.html 1282 1283 # USE(ZLIB) is disabled 1284 http/tests/websocket/tests/hybi/compressed-control-frame.html 1285 http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter.html 1286 http/tests/websocket/tests/hybi/deflate-frame-parameter.html 1287 http/tests/websocket/tests/hybi/handshake-fail-by-extensions-header.html 1282 1288 1283 1289 # ---------------------------------------- -
trunk/LayoutTests/platform/qt/Skipped
r109359 r109538 257 257 fast/mutation/observe-exceptions.html 258 258 fast/mutation/observe-subtree.html 259 260 # USE(ZLIB) is disabled. 261 http/tests/websocket/tests/hybi/compressed-control-frame.html 262 http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter.html 263 http/tests/websocket/tests/hybi/deflate-frame-parameter.html 264 http/tests/websocket/tests/hybi/handshake-fail-by-extensions-header.html 259 265 260 266 # =========================================================================== # -
trunk/Source/JavaScriptCore/ChangeLog
r109522 r109538 1 2012-03-02 Kenichi Ishibashi <bashi@chromium.org> 2 3 Adding WebSocket per-frame DEFLATE extension 4 https://bugs.webkit.org/show_bug.cgi?id=77522 5 6 Added USE(ZLIB) flag. 7 8 Reviewed by Kent Tamura. 9 10 * wtf/Platform.h: 11 1 12 2012-03-02 Filip Pizlo <fpizlo@apple.com> 2 13 -
trunk/Source/JavaScriptCore/wtf/Platform.h
r109302 r109538 1204 1204 #endif 1205 1205 1206 #if !PLATFORM(QT) && !PLATFORM(EFL) 1207 #define WTF_USE_ZLIB 1 1208 #endif 1209 1206 1210 #endif /* WTF_Platform_h */ -
trunk/Source/WebCore/CMakeLists.txt
r109493 r109538 2071 2071 Modules/websockets/WebSocket.cpp 2072 2072 Modules/websockets/WebSocketChannel.cpp 2073 Modules/websockets/WebSocketDeflateFramer.cpp 2073 2074 Modules/websockets/WebSocketExtensionDispatcher.cpp 2074 2075 Modules/websockets/WebSocketHandshake.cpp -
trunk/Source/WebCore/ChangeLog
r109536 r109538 1 2012-03-02 Kenichi Ishibashi <bashi@chromium.org> 2 3 Adding WebSocket per-frame DEFLATE extension 4 https://bugs.webkit.org/show_bug.cgi?id=77522 5 6 Add WebSocketDeflateFramer class which handles deflate-frame extension. 7 This class encapsulates WebSocketDeflater and WebSocketInflater classes, 8 which depend on zlib, so that WebSocketChannel is not necessary to aware 9 zlib dependency. 10 11 Reviewed by Kent Tamura. 12 13 Tests: http/tests/websocket/tests/hybi/compressed-control-frame.html 14 http/tests/websocket/tests/hybi/deflate-frame-comp-bit-onoff.html 15 http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter.html 16 http/tests/websocket/tests/hybi/deflate-frame-parameter.html 17 18 * CMakeLists.txt: Added WebSocketDeflateFramer.(cpp|h) 19 * GNUmakefile.list.am: Ditto. 20 * Target.pri: Ditto. 21 * WebCore.gypi: Ditto. 22 * WebCore.gyp/WebCore.gyp: Added zlib dependency. 23 * WebCore.vcproj/WebCore.vcproj: Added WebSocketDeflateFramer.(cpp|h) 24 * WebCore.xcodeproj/project.pbxproj: Ditto. 25 * websockets/WebSocket.cpp: 26 (WebCore::WebSocket::didConnect): Set m_extensions. 27 * websockets/WebSocketChannel.cpp: 28 (WebCore::WebSocketChannel::connect): Add deflate-frame extension processor to WebSocketHanshake if deflate can use. 29 (WebCore::WebSocketChannel::fail): Call m_deflateFramer.didFail(). 30 (WebCore::WebSocketChannel::processFrame): Decompress frames if needed. 31 (WebCore::WebSocketChannel::sendFrame): Compress frames if possible. 32 * websockets/WebSocketChannel.h: 33 * websockets/WebSocketDeflateFramer.cpp: Added. 34 (WebCore): 35 (WebSocketExtensionDeflateFrame): 36 (WebCore::WebSocketExtensionDeflateFrame::create): 37 (WebCore::WebSocketExtensionDeflateFrame::~WebSocketExtensionDeflateFrame): 38 (WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame): 39 (WebCore::WebSocketExtensionDeflateFrame::handshakeString): 40 (WebCore::WebSocketExtensionDeflateFrame::processResponse): 41 (WebCore::DeflateResultHolder::DeflateResultHolder): 42 (WebCore::DeflateResultHolder::~DeflateResultHolder): 43 (WebCore::DeflateResultHolder::fail): 44 (WebCore::InflateResultHolder::InflateResultHolder): 45 (WebCore::InflateResultHolder::~InflateResultHolder): 46 (WebCore::InflateResultHolder::fail): 47 (WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer): 48 (WebCore::WebSocketDeflateFramer::createExtensionProcessor): 49 (WebCore::WebSocketDeflateFramer::canDeflate): 50 (WebCore::WebSocketDeflateFramer::enableDeflate): 51 (WebCore::WebSocketDeflateFramer::deflate): 52 (WebCore::WebSocketDeflateFramer::resetDeflateContext): 53 (WebCore::WebSocketDeflateFramer::inflate): 54 (WebCore::WebSocketDeflateFramer::resetInflateContext): 55 (WebCore::WebSocketDeflateFramer::didFail): 56 * websockets/WebSocketDeflateFramer.h: Added. 57 (WebCore): 58 (DeflateResultHolder): 59 (WebCore::DeflateResultHolder::succeeded): 60 (WebCore::DeflateResultHolder::failureReason): 61 (InflateResultHolder): 62 (WebCore::InflateResultHolder::succeeded): 63 (WebCore::InflateResultHolder::failureReason): 64 (WebSocketDeflateFramer): 65 (WebCore::WebSocketDeflateFramer::enabled): 66 1 67 2012-03-01 Vsevolod Vlasov <vsevik@chromium.org> 2 68 -
trunk/Source/WebCore/GNUmakefile.list.am
r109493 r109538 1064 1064 Source/WebCore/Modules/websockets/WebSocket.cpp \ 1065 1065 Source/WebCore/Modules/websockets/WebSocket.h \ 1066 Source/WebCore/Modules/websockets/WebSocketDeflateFramer.cpp \ 1067 Source/WebCore/Modules/websockets/WebSocketDeflateFramer.h \ 1066 1068 Source/WebCore/Modules/websockets/WebSocketDeflater.cpp \ 1067 1069 Source/WebCore/Modules/websockets/WebSocketDeflater.h \ -
trunk/Source/WebCore/Modules/websockets/WebSocket.cpp
r108752 r109538 479 479 m_state = OPEN; 480 480 m_subprotocol = m_channel->subprotocol(); 481 m_extensions = m_channel->extensions(); 481 482 dispatchEvent(Event::create(eventNames().openEvent, false, false)); 482 483 } -
trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp
r108752 r109538 128 128 m_handshake = adoptPtr(new WebSocketHandshake(url, protocol, m_document, m_useHixie76Protocol)); 129 129 m_handshake->reset(); 130 if (!m_useHixie76Protocol && m_deflateFramer.canDeflate()) 131 m_handshake->addExtensionProcessor(m_deflateFramer.createExtensionProcessor()); 130 132 if (m_identifier) 131 133 InspectorInstrumentation::didCreateWebSocket(m_document, m_identifier, url, m_document->url()); … … 229 231 if (m_buffer) 230 232 skipBuffer(m_bufferSize); // Save memory. 233 m_deflateFramer.didFail(); 231 234 m_hasContinuousFrame = false; 232 235 m_continuousFrameData.clear(); … … 618 621 ASSERT(m_buffer < frameEnd); 619 622 ASSERT(frameEnd <= m_buffer + m_bufferSize); 623 624 OwnPtr<InflateResultHolder> inflateResult = m_deflateFramer.inflate(frame); 625 if (!inflateResult->succeeded()) { 626 fail(inflateResult->failureReason()); 627 return false; 628 } 620 629 621 630 // Validate the frame data. … … 1012 1021 ASSERT(!(opCode & ~opCodeMask)); // Checks whether "opCode" fits in the range of opCodes. 1013 1022 WebSocketFrame frame(opCode, true, false, true, data, dataLength); 1023 1024 OwnPtr<DeflateResultHolder> deflateResult = m_deflateFramer.deflate(frame); 1025 if (!deflateResult->succeeded()) { 1026 fail(deflateResult->failureReason()); 1027 return false; 1028 } 1029 1014 1030 Vector<char> frameData; 1015 1031 makeFrameData(frame, frameData); -
trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h
r108752 r109538 38 38 #include "ThreadableWebSocketChannel.h" 39 39 #include "Timer.h" 40 #include "WebSocketDeflateFramer.h" 40 41 #include "WebSocketFrame.h" 41 42 #include "WebSocketHandshake.h" … … 232 233 BlobLoaderStatus m_blobLoaderStatus; 233 234 #endif 235 236 WebSocketDeflateFramer m_deflateFramer; 234 237 }; 235 238 -
trunk/Source/WebCore/Target.pri
r109493 r109538 3676 3676 Modules/websockets/WebSocketChannel.h \ 3677 3677 Modules/websockets/WebSocketChannelClient.h \ 3678 Modules/websockets/WebSocketDeflateFramer.h \ 3678 3679 Modules/websockets/WebSocketExtensionDispatcher.h \ 3679 3680 Modules/websockets/WebSocketExtensionProcessor.h \ … … 3687 3688 Modules/websockets/WebSocket.cpp \ 3688 3689 Modules/websockets/WebSocketChannel.cpp \ 3690 Modules/websockets/WebSocketDeflateFramer.cpp \ 3689 3691 Modules/websockets/WebSocketExtensionDispatcher.cpp \ 3690 3692 Modules/websockets/WebSocketHandshake.cpp \ -
trunk/Source/WebCore/WebCore.gyp/WebCore.gyp
r109493 r109538 1196 1196 '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite', 1197 1197 '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_glsl', 1198 '<(chromium_src_dir)/third_party/zlib/zlib.gyp:zlib', 1198 1199 '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', 1199 1200 '<(libjpeg_gyp_path):libjpeg', -
trunk/Source/WebCore/WebCore.gypi
r109493 r109538 1413 1413 'Modules/websockets/WebSocketChannel.h', 1414 1414 'Modules/websockets/WebSocketChannelClient.h', 1415 'Modules/websockets/WebSocketDeflateFramer.cpp', 1416 'Modules/websockets/WebSocketDeflateFramer.h', 1415 1417 'Modules/websockets/WebSocketDeflater.cpp', 1416 1418 'Modules/websockets/WebSocketDeflater.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r109493 r109538 24314 24314 </File> 24315 24315 <File 24316 RelativePath="..\Modules\websockets\WebSocketDeflateFramer.cpp" 24317 > 24318 </File> 24319 <File 24320 RelativePath="..\Modules\websockets\WebSocketDeflateFramer.h" 24321 > 24322 </File> 24323 <File 24316 24324 RelativePath="..\Modules\websockets\WebSocketDeflater.cpp" 24317 24325 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r109493 r109538 1368 1368 4A1E71A514E106AC00626F9D /* JSShadowRoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A1E71A314E106AC00626F9D /* JSShadowRoot.cpp */; }; 1369 1369 4A1E71A614E106AC00626F9D /* JSShadowRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A1E71A414E106AC00626F9D /* JSShadowRoot.h */; }; 1370 4A38BF5014FE1C0900612512 /* WebSocketDeflateFramer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A38BF4E14FE1C0900612512 /* WebSocketDeflateFramer.cpp */; }; 1371 4A38BF5114FE1C0900612512 /* WebSocketDeflateFramer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A38BF4F14FE1C0900612512 /* WebSocketDeflateFramer.h */; }; 1370 1372 4A6E9FC313C17D1D0046A7F8 /* FontFeatureValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6E9FC113C17D1D0046A7F8 /* FontFeatureValue.cpp */; }; 1371 1373 4A6E9FC413C17D1D0046A7F8 /* FontFeatureValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A6E9FC213C17D1D0046A7F8 /* FontFeatureValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 8270 8272 4A1E71A314E106AC00626F9D /* JSShadowRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSShadowRoot.cpp; sourceTree = "<group>"; }; 8271 8273 4A1E71A414E106AC00626F9D /* JSShadowRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSShadowRoot.h; sourceTree = "<group>"; }; 8274 4A38BF4E14FE1C0900612512 /* WebSocketDeflateFramer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketDeflateFramer.cpp; path = Modules/websockets/WebSocketDeflateFramer.cpp; sourceTree = "<group>"; }; 8275 4A38BF4F14FE1C0900612512 /* WebSocketDeflateFramer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketDeflateFramer.h; path = Modules/websockets/WebSocketDeflateFramer.h; sourceTree = "<group>"; }; 8272 8276 4A6E9FC113C17D1D0046A7F8 /* FontFeatureValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFeatureValue.cpp; sourceTree = "<group>"; }; 8273 8277 4A6E9FC213C17D1D0046A7F8 /* FontFeatureValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFeatureValue.h; sourceTree = "<group>"; }; … … 17343 17347 97AABD0314FA09D5007457AE /* WebSocketChannel.h */, 17344 17348 97AABD0414FA09D5007457AE /* WebSocketChannelClient.h */, 17349 4A38BF4E14FE1C0900612512 /* WebSocketDeflateFramer.cpp */, 17350 4A38BF4F14FE1C0900612512 /* WebSocketDeflateFramer.h */, 17345 17351 97AABD0514FA09D5007457AE /* WebSocketDeflater.cpp */, 17346 17352 97AABD0614FA09D5007457AE /* WebSocketDeflater.h */, … … 24409 24415 97AABD1E14FA09D5007457AE /* WebSocketChannel.h in Headers */, 24410 24416 97AABD1F14FA09D5007457AE /* WebSocketChannelClient.h in Headers */, 24417 4A38BF5114FE1C0900612512 /* WebSocketDeflateFramer.h in Headers */, 24411 24418 97AABD2114FA09D5007457AE /* WebSocketDeflater.h in Headers */, 24412 24419 97AABD2314FA09D5007457AE /* WebSocketExtensionDispatcher.h in Headers */, … … 27386 27393 97AABD1A14FA09D5007457AE /* WebSocket.cpp in Sources */, 27387 27394 97AABD1D14FA09D5007457AE /* WebSocketChannel.cpp in Sources */, 27395 4A38BF5014FE1C0900612512 /* WebSocketDeflateFramer.cpp in Sources */, 27388 27396 97AABD2014FA09D5007457AE /* WebSocketDeflater.cpp in Sources */, 27389 27397 97AABD2214FA09D5007457AE /* WebSocketExtensionDispatcher.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.