Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: Source/modules/websockets/WebSocketDeflateFramer.cpp

Issue 14247036: Remove USE(ZLIB) guard. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/websockets/WebSocketDeflateFramer.h ('k') | Source/modules/websockets/WebSocketDeflater.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/WebSocketDeflateFramer.cpp
diff --git a/Source/modules/websockets/WebSocketDeflateFramer.cpp b/Source/modules/websockets/WebSocketDeflateFramer.cpp
index bdc1a21a23bc88233454ebd562148edb7d677560..4a59a687782c863076674948ed9840f74883b8e1 100644
--- a/Source/modules/websockets/WebSocketDeflateFramer.cpp
+++ b/Source/modules/websockets/WebSocketDeflateFramer.cpp
@@ -75,7 +75,6 @@ String WebSocketExtensionDeflateFrame::handshakeString()
bool WebSocketExtensionDeflateFrame::processResponse(const HashMap<String, String>& serverParameters)
{
-#if USE(ZLIB)
if (m_responseProcessed) {
m_failureReason = "Received duplicate deflate-frame response";
return false;
@@ -112,10 +111,6 @@ bool WebSocketExtensionDeflateFrame::processResponse(const HashMap<String, Strin
m_framer->enableDeflate(windowBits, mode);
return true;
-#else
- ASSERT_NOT_REACHED();
- return false;
-#endif
}
DeflateResultHolder::DeflateResultHolder(WebSocketDeflateFramer* framer)
@@ -164,16 +159,6 @@ PassOwnPtr<WebSocketExtensionProcessor> WebSocketDeflateFramer::createExtensionP
return WebSocketExtensionDeflateFrame::create(this);
}
-bool WebSocketDeflateFramer::canDeflate() const
-{
-#if USE(ZLIB)
- return true;
-#else
- return false;
-#endif
-}
-
-#if USE(ZLIB)
void WebSocketDeflateFramer::enableDeflate(int windowBits, WebSocketDeflater::ContextTakeOverMode mode)
{
m_deflater = WebSocketDeflater::create(windowBits, mode);
@@ -185,11 +170,9 @@ void WebSocketDeflateFramer::enableDeflate(int windowBits, WebSocketDeflater::Co
}
m_enabled = true;
}
-#endif
PassOwnPtr<DeflateResultHolder> WebSocketDeflateFramer::deflate(WebSocketFrame& frame)
{
-#if USE(ZLIB)
OwnPtr<DeflateResultHolder> result = DeflateResultHolder::create(this);
if (!enabled() || !WebSocketFrame::isNonControlOpCode(frame.opCode) || !frame.payloadLength)
return result.release();
@@ -201,17 +184,12 @@ PassOwnPtr<DeflateResultHolder> WebSocketDeflateFramer::deflate(WebSocketFrame&
frame.payload = m_deflater->data();
frame.payloadLength = m_deflater->size();
return result.release();
-#else
- return DeflateResultHolder::create(this);
-#endif
}
void WebSocketDeflateFramer::resetDeflateContext()
{
-#if USE(ZLIB)
if (m_deflater)
m_deflater->reset();
-#endif
}
PassOwnPtr<InflateResultHolder> WebSocketDeflateFramer::inflate(WebSocketFrame& frame)
@@ -221,7 +199,6 @@ PassOwnPtr<InflateResultHolder> WebSocketDeflateFramer::inflate(WebSocketFrame&
result->fail("Compressed bit must be 0 if no negotiated deflate-frame extension");
return result.release();
}
-#if USE(ZLIB)
if (!frame.compress)
return result.release();
if (!WebSocketFrame::isNonControlOpCode(frame.opCode)) {
@@ -236,17 +213,12 @@ PassOwnPtr<InflateResultHolder> WebSocketDeflateFramer::inflate(WebSocketFrame&
frame.payload = m_inflater->data();
frame.payloadLength = m_inflater->size();
return result.release();
-#else
- return result.release();
-#endif
}
void WebSocketDeflateFramer::resetInflateContext()
{
-#if USE(ZLIB)
if (m_inflater)
m_inflater->reset();
-#endif
}
void WebSocketDeflateFramer::didFail()
« no previous file with comments | « Source/modules/websockets/WebSocketDeflateFramer.h ('k') | Source/modules/websockets/WebSocketDeflater.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698