[WebSocket] Add deflater/inflater classes
authorbashi@chromium.org <bashi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Feb 2012 08:59:42 +0000 (08:59 +0000)
committerbashi@chromium.org <bashi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Feb 2012 08:59:42 +0000 (08:59 +0000)
commit8925bd571b7a54db2e8dd37ca72307fda3c8e799
tree3c37c3cd8863f8b1325ada310850d272999d253b
parenta1d73a7f2758d86b03b10dc73641f6f47facb06c
[WebSocket] Add deflater/inflater classes
https://bugs.webkit.org/show_bug.cgi?id=78449

Source/WebCore:

Add WebSocketDeflater/WebSocketInflater classes which wrap zlib
functions. These classes are not used yet, but will be used for
supporting WebSocket deflate-frame extension.

This patch is second try. The previous patch broke Chromium Win
build. I added dependency of zlib to WebCore.gyp. I think it's
OK because Chromium already depends on zlib.

Reviewed by Kent Tamura.

No new tests except for chromium port. Behavior is unchanged.

* GNUmakefile.list.am: Added WebSocketDeflater.(cpp|h).
* WebCore.gyp/WebCore.gyp: Added zlib dependency.
* WebCore.gypi: Added WebSocketDeflater.(cpp|h).
* WebCore.vcproj/WebCore.vcproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* websockets/WebSocketDeflater.cpp: Added.
(WebCore):
(WebCore::WebSocketDeflater::create):
(WebCore::WebSocketDeflater::WebSocketDeflater):
(WebCore::WebSocketDeflater::initialize):
(WebCore::WebSocketDeflater::~WebSocketDeflater):
(WebCore::setStreamParameter):
(WebCore::WebSocketDeflater::addBytes):
(WebCore::WebSocketDeflater::finish):
(WebCore::WebSocketDeflater::reset):
(WebCore::WebSocketInflater::create):
(WebCore::WebSocketInflater::WebSocketInflater):
(WebCore::WebSocketInflater::initialize):
(WebCore::WebSocketInflater::~WebSocketInflater):
(WebCore::WebSocketInflater::addBytes):
(WebCore::WebSocketInflater::finish):
(WebCore::WebSocketInflater::reset):
* websockets/WebSocketDeflater.h: Added.
(WebCore):
(WebSocketDeflater):
(WebCore::WebSocketDeflater::data):
(WebCore::WebSocketDeflater::size):
(WebSocketInflater):
(WebCore::WebSocketInflater::data):
(WebCore::WebSocketInflater::size):

Source/WebKit/chromium:

Add tests which ensure WebSocketDeflater/WebSocketInflater can
compress/decompress data correctly.

Reviewed by Kent Tamura.

* WebKit.gypi: Added zlib dependency.
* WebKitUnitTests.gyp: Ditto.
* tests/WebSocketDeflaterTest.cpp: Added.
(WebCore):
(WebCore::TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gyp/WebCore.gyp
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/websockets/WebSocketDeflater.cpp [new file with mode: 0644]
Source/WebCore/websockets/WebSocketDeflater.h [new file with mode: 0644]
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/WebKitUnitTests.gyp
Source/WebKit/chromium/tests/WebSocketDeflaterTest.cpp [new file with mode: 0644]