| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebSocketDeflateFramer_h | 31 #ifndef WebSocketDeflateFramer_h |
| 32 #define WebSocketDeflateFramer_h | 32 #define WebSocketDeflateFramer_h |
| 33 | 33 |
| 34 #if USE(ZLIB) | |
| 35 #include "WebSocketDeflater.h" | 34 #include "WebSocketDeflater.h" |
| 36 #endif | |
| 37 #include "WebSocketExtensionProcessor.h" | 35 #include "WebSocketExtensionProcessor.h" |
| 38 #include "WebSocketFrame.h" | 36 #include "WebSocketFrame.h" |
| 39 #include <wtf/OwnPtr.h> | 37 #include <wtf/OwnPtr.h> |
| 40 #include <wtf/PassOwnPtr.h> | 38 #include <wtf/PassOwnPtr.h> |
| 41 | 39 |
| 42 namespace WebCore { | 40 namespace WebCore { |
| 43 | 41 |
| 44 class WebSocketDeflateFramer; | 42 class WebSocketDeflateFramer; |
| 45 | 43 |
| 46 class DeflateResultHolder { | 44 class DeflateResultHolder { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 bool m_succeeded; | 86 bool m_succeeded; |
| 89 String m_failureReason; | 87 String m_failureReason; |
| 90 }; | 88 }; |
| 91 | 89 |
| 92 class WebSocketDeflateFramer { | 90 class WebSocketDeflateFramer { |
| 93 public: | 91 public: |
| 94 WebSocketDeflateFramer(); | 92 WebSocketDeflateFramer(); |
| 95 | 93 |
| 96 PassOwnPtr<WebSocketExtensionProcessor> createExtensionProcessor(); | 94 PassOwnPtr<WebSocketExtensionProcessor> createExtensionProcessor(); |
| 97 | 95 |
| 98 bool canDeflate() const; | |
| 99 bool enabled() const { return m_enabled; } | 96 bool enabled() const { return m_enabled; } |
| 100 | 97 |
| 101 PassOwnPtr<DeflateResultHolder> deflate(WebSocketFrame&); | 98 PassOwnPtr<DeflateResultHolder> deflate(WebSocketFrame&); |
| 102 void resetDeflateContext(); | 99 void resetDeflateContext(); |
| 103 PassOwnPtr<InflateResultHolder> inflate(WebSocketFrame&); | 100 PassOwnPtr<InflateResultHolder> inflate(WebSocketFrame&); |
| 104 void resetInflateContext(); | 101 void resetInflateContext(); |
| 105 | 102 |
| 106 void didFail(); | 103 void didFail(); |
| 107 | 104 |
| 108 #if USE(ZLIB) | |
| 109 void enableDeflate(int windowBits, WebSocketDeflater::ContextTakeOverMode); | 105 void enableDeflate(int windowBits, WebSocketDeflater::ContextTakeOverMode); |
| 110 #endif | |
| 111 | 106 |
| 112 private: | 107 private: |
| 113 bool m_enabled; | 108 bool m_enabled; |
| 114 #if USE(ZLIB) | |
| 115 OwnPtr<WebSocketDeflater> m_deflater; | 109 OwnPtr<WebSocketDeflater> m_deflater; |
| 116 OwnPtr<WebSocketInflater> m_inflater; | 110 OwnPtr<WebSocketInflater> m_inflater; |
| 117 #endif | |
| 118 }; | 111 }; |
| 119 | 112 |
| 120 } | 113 } |
| 121 | 114 |
| 122 #endif // WebSocketDeflateFramer_h | 115 #endif // WebSocketDeflateFramer_h |
| OLD | NEW |