Changeset 108731 in webkit


Ignore:
Timestamp:
Feb 23, 2012 10:29:33 PM (12 years ago)
Author:
bashi@chromium.org
Message:

Adding WebSocket per-frame DEFLATE extension
https://bugs.webkit.org/show_bug.cgi?id=77522

Source/JavaScriptCore:

Added USE(ZLIB) flag.

Reviewed by Kent Tamura.

  • wtf/Platform.h:

Source/WebCore:

Add WebSocketDeflateFramer class which handles deflate-frame extension.
This class encapsulates WebSocketDeflater and WebSocketInflater classes,
which depend on zlib, so that WebSocketChannel is not necessary to aware
zlib dependency.

This is the second patch to land. The previous patch broke Chromium Win
release build. r108600 should fix the build failure. I also added
zlib entry to |export_dependent_settings| of |webcore_prerequisites|
target.

Reviewed by Kent Tamura.

Tests: http/tests/websocket/tests/hybi/compressed-control-frame.html

http/tests/websocket/tests/hybi/deflate-frame-comp-bit-onoff.html
http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter.html
http/tests/websocket/tests/hybi/deflate-frame-parameter.html

  • CMakeLists.txt: Added WebSocketDeflateFramer.(cpp|h)
  • GNUmakefile.list.am: Ditto.
  • Target.pri: Ditto.
  • WebCore.gypi: Ditto.
  • WebCore.gyp/WebCore.gyp: Added zlib dependency.
  • WebCore.vcproj/WebCore.vcproj: Added WebSocketDeflateFramer.(cpp|h)
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • websockets/WebSocket.cpp:

(WebCore::WebSocket::didConnect): Set m_extensions.

  • websockets/WebSocketChannel.cpp:

(WebCore::WebSocketChannel::connect): Add deflate-frame extension processor to WebSocketHanshake if deflate can use.
(WebCore::WebSocketChannel::fail): Call m_deflateFramer.didFail().
(WebCore::WebSocketChannel::processFrame): Decompress frames if needed.
(WebCore::WebSocketChannel::sendFrame): Compress frames if possible.

  • websockets/WebSocketChannel.h:
  • websockets/WebSocketDeflateFramer.cpp: Added.

(WebCore):
(WebSocketExtensionDeflateFrame):
(WebCore::WebSocketExtensionDeflateFrame::create):
(WebCore::WebSocketExtensionDeflateFrame::~WebSocketExtensionDeflateFrame):
(WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame):
(WebCore::WebSocketExtensionDeflateFrame::handshakeString):
(WebCore::WebSocketExtensionDeflateFrame::processResponse):
(WebCore::DeflateResultHolder::DeflateResultHolder):
(WebCore::DeflateResultHolder::~DeflateResultHolder):
(WebCore::DeflateResultHolder::fail):
(WebCore::InflateResultHolder::InflateResultHolder):
(WebCore::InflateResultHolder::~InflateResultHolder):
(WebCore::InflateResultHolder::fail):
(WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer):
(WebCore::WebSocketDeflateFramer::createExtensionProcessor):
(WebCore::WebSocketDeflateFramer::canDeflate):
(WebCore::WebSocketDeflateFramer::enableDeflate):
(WebCore::WebSocketDeflateFramer::deflate):
(WebCore::WebSocketDeflateFramer::resetDeflateContext):
(WebCore::WebSocketDeflateFramer::inflate):
(WebCore::WebSocketDeflateFramer::resetInflateContext):
(WebCore::WebSocketDeflateFramer::didFail):

  • websockets/WebSocketDeflateFramer.h: Added.

(WebCore):
(DeflateResultHolder):
(WebCore::DeflateResultHolder::succeeded):
(WebCore::DeflateResultHolder::failureReason):
(InflateResultHolder):
(WebCore::InflateResultHolder::succeeded):
(WebCore::InflateResultHolder::failureReason):
(WebSocketDeflateFramer):
(WebCore::WebSocketDeflateFramer::enabled):

LayoutTests:

Added tests for WebSocket deflate-frame extension. Also updated some
tests to follow the change.

Reviewed by Kent Tamura.

  • http/tests/websocket/tests/hybi/compressed-control-frame-expected.txt: Added.
  • http/tests/websocket/tests/hybi/compressed-control-frame.html: Added.
  • http/tests/websocket/tests/hybi/compressed-control-frame_wsh.py: Added.

(web_socket_do_extra_handshake):
(web_socket_transfer_data):

  • http/tests/websocket/tests/hybi/deflate-frame-comp-bit-onoff-expected.txt: Added.
  • http/tests/websocket/tests/hybi/deflate-frame-comp-bit-onoff.html: Added.
  • http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter-expected.txt: Added.
  • http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter.html: Added.
  • http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter_wsh.py: Added.

(web_socket_do_extra_handshake):
(web_socket_transfer_data):

  • http/tests/websocket/tests/hybi/deflate-frame-parameter-expected.txt: Added.
  • http/tests/websocket/tests/hybi/deflate-frame-parameter.html: Added.
  • http/tests/websocket/tests/hybi/deflate-frame_wsh.py: Added.

(_get_deflate_frame_extension_processor):
(web_socket_do_extra_handshake):
(web_socket_transfer_data):

  • http/tests/websocket/tests/hybi/handshake-fail-by-extensions-header-expected.txt:
  • http/tests/websocket/tests/hybi/send-file-blob_wsh.py:

(_retrieve_frame):
(web_socket_transfer_data):

Location:
trunk
Files:
12 added
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r108729 r108731  
     12012-02-23  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
    1342012-02-23  Erik Arvidsson  <arv@chromium.org>
    235
  • trunk/LayoutTests/http/tests/websocket/tests/hybi/compressed-control-frame-expected.txt

    r108730 r108731  
    1 CONSOLE MESSAGE: Received unexpected Sec-WebSocket-Extensions header
    2 Test whether WebSocket handshake fails if the server sends Sec-WebSocket-Extensions header.
     1CONSOLE MESSAGE: Received unexpected compressed frame
     2Test whether a compressed control frame is rejected
    33
    44On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    55
     6onopen() was called.
     7onclose() was called.
    68PASS closeEvent.wasClean is false
    79PASS successfullyParsed is true
  • trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-extensions-header-expected.txt

    r108476 r108731  
    1 CONSOLE MESSAGE: Received unexpected Sec-WebSocket-Extensions header
     1CONSOLE MESSAGE: Received unexpected extension: x-foo
    22Test whether WebSocket handshake fails if the server sends Sec-WebSocket-Extensions header.
    33
  • trunk/LayoutTests/http/tests/websocket/tests/hybi/send-file-blob_wsh.py

    r108476 r108731  
    11from mod_pywebsocket import common
    22from mod_pywebsocket import msgutil
     3
     4
     5def _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
    311
    412
     
    1119
    1220    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:
    1623            msgutil.send_message(request, 'PASS: Message #%d.' % test_number)
    1724        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))
    1926
    2027
  • trunk/Source/JavaScriptCore/ChangeLog

    r108716 r108731  
     12012-02-23  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
    1122012-02-23  Mark Hahnenberg  <mhahnenberg@apple.com>
    213
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r108661 r108731  
    11951195#endif
    11961196
     1197#if !PLATFORM(QT) && !PLATFORM(EFL)
     1198#define WTF_USE_ZLIB 1
     1199#endif
     1200
    11971201#endif /* WTF_Platform_h */
  • trunk/Source/WebCore/CMakeLists.txt

    r108710 r108731  
    20612061        websockets/WebSocket.cpp
    20622062        websockets/WebSocketChannel.cpp
     2063        websockets/WebSocketDeflateFramer.cpp
    20632064        websockets/WebSocketExtensionDispatcher.cpp
    20642065        websockets/WebSocketHandshake.cpp
  • trunk/Source/WebCore/ChangeLog

    r108730 r108731  
     12012-02-23  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        This is the second patch to land. The previous patch broke Chromium Win
     12        release build. r108600 should fix the build failure. I also added
     13        zlib entry to |export_dependent_settings| of |webcore_prerequisites|
     14        target.
     15
     16        Reviewed by Kent Tamura.
     17
     18        Tests: http/tests/websocket/tests/hybi/compressed-control-frame.html
     19               http/tests/websocket/tests/hybi/deflate-frame-comp-bit-onoff.html
     20               http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter.html
     21               http/tests/websocket/tests/hybi/deflate-frame-parameter.html
     22
     23        * CMakeLists.txt: Added WebSocketDeflateFramer.(cpp|h)
     24        * GNUmakefile.list.am: Ditto.
     25        * Target.pri: Ditto.
     26        * WebCore.gypi: Ditto.
     27        * WebCore.gyp/WebCore.gyp: Added zlib dependency.
     28        * WebCore.vcproj/WebCore.vcproj: Added WebSocketDeflateFramer.(cpp|h)
     29        * WebCore.xcodeproj/project.pbxproj: Ditto.
     30        * websockets/WebSocket.cpp:
     31        (WebCore::WebSocket::didConnect): Set m_extensions.
     32        * websockets/WebSocketChannel.cpp:
     33        (WebCore::WebSocketChannel::connect): Add deflate-frame extension processor to WebSocketHanshake if deflate can use.
     34        (WebCore::WebSocketChannel::fail): Call m_deflateFramer.didFail().
     35        (WebCore::WebSocketChannel::processFrame): Decompress frames if needed.
     36        (WebCore::WebSocketChannel::sendFrame): Compress frames if possible.
     37        * websockets/WebSocketChannel.h:
     38        * websockets/WebSocketDeflateFramer.cpp: Added.
     39        (WebCore):
     40        (WebSocketExtensionDeflateFrame):
     41        (WebCore::WebSocketExtensionDeflateFrame::create):
     42        (WebCore::WebSocketExtensionDeflateFrame::~WebSocketExtensionDeflateFrame):
     43        (WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame):
     44        (WebCore::WebSocketExtensionDeflateFrame::handshakeString):
     45        (WebCore::WebSocketExtensionDeflateFrame::processResponse):
     46        (WebCore::DeflateResultHolder::DeflateResultHolder):
     47        (WebCore::DeflateResultHolder::~DeflateResultHolder):
     48        (WebCore::DeflateResultHolder::fail):
     49        (WebCore::InflateResultHolder::InflateResultHolder):
     50        (WebCore::InflateResultHolder::~InflateResultHolder):
     51        (WebCore::InflateResultHolder::fail):
     52        (WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer):
     53        (WebCore::WebSocketDeflateFramer::createExtensionProcessor):
     54        (WebCore::WebSocketDeflateFramer::canDeflate):
     55        (WebCore::WebSocketDeflateFramer::enableDeflate):
     56        (WebCore::WebSocketDeflateFramer::deflate):
     57        (WebCore::WebSocketDeflateFramer::resetDeflateContext):
     58        (WebCore::WebSocketDeflateFramer::inflate):
     59        (WebCore::WebSocketDeflateFramer::resetInflateContext):
     60        (WebCore::WebSocketDeflateFramer::didFail):
     61        * websockets/WebSocketDeflateFramer.h: Added.
     62        (WebCore):
     63        (DeflateResultHolder):
     64        (WebCore::DeflateResultHolder::succeeded):
     65        (WebCore::DeflateResultHolder::failureReason):
     66        (InflateResultHolder):
     67        (WebCore::InflateResultHolder::succeeded):
     68        (WebCore::InflateResultHolder::failureReason):
     69        (WebSocketDeflateFramer):
     70        (WebCore::WebSocketDeflateFramer::enabled):
     71
    1722012-02-23  Andy Estes  <aestes@apple.com>
    273
  • trunk/Source/WebCore/GNUmakefile.list.am

    r108710 r108731  
    43454345        Source/WebCore/websockets/WebSocket.cpp \
    43464346        Source/WebCore/websockets/WebSocket.h \
     4347        Source/WebCore/websockets/WebSocketDeflateFramer.cpp \
     4348        Source/WebCore/websockets/WebSocketDeflateFramer.h \
    43474349        Source/WebCore/websockets/WebSocketDeflater.cpp \
    43484350        Source/WebCore/websockets/WebSocketDeflater.h \
  • trunk/Source/WebCore/Target.pri

    r108692 r108731  
    36763676        websockets/WebSocketChannel.h \
    36773677        websockets/WebSocketChannelClient.h \
     3678        websockets/WebSocketDeflateFramer.h \
    36783679        websockets/WebSocketExtensionDispatcher.h \
    36793680        websockets/WebSocketExtensionProcessor.h \
     
    36873688        websockets/WebSocket.cpp \
    36883689        websockets/WebSocketChannel.cpp \
     3690        websockets/WebSocketDeflateFramer.cpp \
    36893691        websockets/WebSocketExtensionDispatcher.cpp \
    36903692        websockets/WebSocketHandshake.cpp \
  • trunk/Source/WebCore/WebCore.gyp/WebCore.gyp

    r108428 r108731  
    11961196        '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
    11971197        '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_glsl',
     1198        '<(chromium_src_dir)/third_party/zlib/zlib.gyp:zlib',
    11981199        '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
    11991200        '<(libjpeg_gyp_path):libjpeg',
  • trunk/Source/WebCore/WebCore.gypi

    r108727 r108731  
    48314831            'websockets/WebSocketChannel.h',
    48324832            'websockets/WebSocketChannelClient.h',
     4833            'websockets/WebSocketDeflateFramer.cpp',
     4834            'websockets/WebSocketDeflateFramer.h',
    48334835            'websockets/WebSocketDeflater.cpp',
    48344836            'websockets/WebSocketDeflater.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r108561 r108731  
    7347573475                        </File>
    7347673476                        <File
     73477                                RelativePath="..\websockets\WebSocketDeflateFramer.cpp"
     73478                                >
     73479                        </File>
     73480                        <File
     73481                                RelativePath="..\websockets\WebSocketDeflateFramer.h"
     73482                                >
     73483                        </File>
     73484                        <File
    7347773485                                RelativePath="..\websockets\WebSocketDeflater.cpp"
    7347873486                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r108710 r108731  
    13681368                4A1E71A514E106AC00626F9D /* JSShadowRoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A1E71A314E106AC00626F9D /* JSShadowRoot.cpp */; };
    13691369                4A1E71A614E106AC00626F9D /* JSShadowRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A1E71A414E106AC00626F9D /* JSShadowRoot.h */; };
     1370                4A29222B14F468BA0021F77E /* WebSocketDeflateFramer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A29222914F468BA0021F77E /* WebSocketDeflateFramer.cpp */; };
     1371                4A29222C14F468BA0021F77E /* WebSocketDeflateFramer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A29222A14F468BA0021F77E /* WebSocketDeflateFramer.h */; };
    13701372                4A4A234614F1E1440046FBF1 /* WebSocketFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A4A234514F1E1440046FBF1 /* WebSocketFrame.h */; };
    13711373                4A6E9FC313C17D1D0046A7F8 /* FontFeatureValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6E9FC113C17D1D0046A7F8 /* FontFeatureValue.cpp */; };
     
    82338235                4A1E71A314E106AC00626F9D /* JSShadowRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSShadowRoot.cpp; sourceTree = "<group>"; };
    82348236                4A1E71A414E106AC00626F9D /* JSShadowRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSShadowRoot.h; sourceTree = "<group>"; };
     8237                4A29222914F468BA0021F77E /* WebSocketDeflateFramer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketDeflateFramer.cpp; sourceTree = "<group>"; };
     8238                4A29222A14F468BA0021F77E /* WebSocketDeflateFramer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketDeflateFramer.h; sourceTree = "<group>"; };
    82358239                4A4A234514F1E1440046FBF1 /* WebSocketFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketFrame.h; sourceTree = "<group>"; };
    82368240                4A6E9FC113C17D1D0046A7F8 /* FontFeatureValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFeatureValue.cpp; sourceTree = "<group>"; };
     
    1486114865                                510D4A48103177A20049EA54 /* WebSocketChannel.h */,
    1486214866                                510D4A49103177A20049EA54 /* WebSocketChannelClient.h */,
     14867                                4A29222914F468BA0021F77E /* WebSocketDeflateFramer.cpp */,
     14868                                4A29222A14F468BA0021F77E /* WebSocketDeflateFramer.h */,
    1486314869                                4AE02ABB14E8A9D200BC3BA7 /* WebSocketDeflater.cpp */,
    1486414870                                4AE02ABC14E8A9D200BC3BA7 /* WebSocketDeflater.h */,
     
    2425524261                                510D4A4F103177A20049EA54 /* WebSocketChannel.h in Headers */,
    2425624262                                510D4A50103177A20049EA54 /* WebSocketChannelClient.h in Headers */,
     24263                                4A29222C14F468BA0021F77E /* WebSocketDeflateFramer.h in Headers */,
    2425724264                                4AE02ABE14E8A9D200BC3BA7 /* WebSocketDeflater.h in Headers */,
    2425824265                                4A957F0714E241300049DBFB /* WebSocketExtensionDispatcher.h in Headers */,
     
    2721427221                                518A34C11026C831001B6896 /* WebSocket.cpp in Sources */,
    2721527222                                510D4A4E103177A20049EA54 /* WebSocketChannel.cpp in Sources */,
     27223                                4A29222B14F468BA0021F77E /* WebSocketDeflateFramer.cpp in Sources */,
    2721627224                                4AE02ABD14E8A9D200BC3BA7 /* WebSocketDeflater.cpp in Sources */,
    2721727225                                4A957F0614E2412A0049DBFB /* WebSocketExtensionDispatcher.cpp in Sources */,
  • trunk/Source/WebCore/websockets/WebSocket.cpp

    r108476 r108731  
    479479    m_state = OPEN;
    480480    m_subprotocol = m_channel->subprotocol();
     481    m_extensions = m_channel->extensions();
    481482    dispatchEvent(Event::create(eventNames().openEvent, false, false));
    482483}
  • trunk/Source/WebCore/websockets/WebSocketChannel.cpp

    r108476 r108731  
    128128    m_handshake = adoptPtr(new WebSocketHandshake(url, protocol, m_document, m_useHixie76Protocol));
    129129    m_handshake->reset();
     130    if (!m_useHixie76Protocol && m_deflateFramer.canDeflate())
     131        m_handshake->addExtensionProcessor(m_deflateFramer.createExtensionProcessor());
    130132    if (m_identifier)
    131133        InspectorInstrumentation::didCreateWebSocket(m_document, m_identifier, url, m_document->url());
     
    229231        if (m_buffer)
    230232            skipBuffer(m_bufferSize); // Save memory.
     233        m_deflateFramer.didFail();
    231234        m_hasContinuousFrame = false;
    232235        m_continuousFrameData.clear();
     
    618621    ASSERT(m_buffer < frameEnd);
    619622    ASSERT(frameEnd <= m_buffer + m_bufferSize);
     623
     624    InflateResultHolder inflateResult = m_deflateFramer.inflate(frame);
     625    if (!inflateResult.succeeded()) {
     626        fail(inflateResult.failureReason());
     627        return false;
     628    }
    620629
    621630    // Validate the frame data.
     
    10121021    ASSERT(!(opCode & ~opCodeMask)); // Checks whether "opCode" fits in the range of opCodes.
    10131022    WebSocketFrame frame(opCode, true, false, true, data, dataLength);
     1023
     1024    DeflateResultHolder deflateResult = m_deflateFramer.deflate(frame);
     1025    if (!deflateResult.succeeded()) {
     1026        fail(deflateResult.failureReason());
     1027        return false;
     1028    }
     1029
    10141030    Vector<char> frameData;
    10151031    makeFrameData(frame, frameData);
  • trunk/Source/WebCore/websockets/WebSocketChannel.h

    r108476 r108731  
    3838#include "ThreadableWebSocketChannel.h"
    3939#include "Timer.h"
     40#include "WebSocketDeflateFramer.h"
    4041#include "WebSocketFrame.h"
    4142#include "WebSocketHandshake.h"
     
    232233    BlobLoaderStatus m_blobLoaderStatus;
    233234#endif
     235
     236    WebSocketDeflateFramer m_deflateFramer;
    234237};
    235238
Note: See TracChangeset for help on using the changeset viewer.