[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