OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 private: | 58 private: |
59 explicit CompressionMessageExtensionProcessor(WebSocketPerMessageDeflate&); | 59 explicit CompressionMessageExtensionProcessor(WebSocketPerMessageDeflate&); |
60 | 60 |
61 WebSocketPerMessageDeflate& m_compress; | 61 WebSocketPerMessageDeflate& m_compress; |
62 bool m_responseProcessed; | 62 bool m_responseProcessed; |
63 String m_failureReason; | 63 String m_failureReason; |
64 }; | 64 }; |
65 | 65 |
66 CompressionMessageExtensionProcessor::CompressionMessageExtensionProcessor(WebSo
cketPerMessageDeflate& compress) | 66 CompressionMessageExtensionProcessor::CompressionMessageExtensionProcessor(WebSo
cketPerMessageDeflate& compress) |
67 : WebSocketExtensionProcessor(ASCIILiteral("permessage-deflate")) | 67 : WebSocketExtensionProcessor("permessage-deflate") |
68 , m_compress(compress) | 68 , m_compress(compress) |
69 , m_responseProcessed(false) | 69 , m_responseProcessed(false) |
70 { | 70 { |
71 } | 71 } |
72 | 72 |
73 String CompressionMessageExtensionProcessor::handshakeString() | 73 String CompressionMessageExtensionProcessor::handshakeString() |
74 { | 74 { |
75 return ASCIILiteral("permessage-deflate; c2s_max_window_bits"); | 75 return "permessage-deflate; c2s_max_window_bits"; |
76 } | 76 } |
77 | 77 |
78 bool CompressionMessageExtensionProcessor::processResponse(const HashMap<String,
String>& parameters) | 78 bool CompressionMessageExtensionProcessor::processResponse(const HashMap<String,
String>& parameters) |
79 { | 79 { |
80 int numProcessedParameters = 0; | 80 int numProcessedParameters = 0; |
81 if (m_responseProcessed) { | 81 if (m_responseProcessed) { |
82 m_failureReason = "Received duplicate permessage-deflate response"; | 82 m_failureReason = "Received duplicate permessage-deflate response"; |
83 return false; | 83 return false; |
84 } | 84 } |
85 m_responseProcessed = true; | 85 m_responseProcessed = true; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 m_inflater->reset(); | 249 m_inflater->reset(); |
250 } | 250 } |
251 | 251 |
252 void WebSocketPerMessageDeflate::didFail() | 252 void WebSocketPerMessageDeflate::didFail() |
253 { | 253 { |
254 resetDeflateBuffer(); | 254 resetDeflateBuffer(); |
255 resetInflateBuffer(); | 255 resetInflateBuffer(); |
256 } | 256 } |
257 | 257 |
258 } // namespace WebCore | 258 } // namespace WebCore |
OLD | NEW |