| 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 26 matching lines...) Expand all  Loading... | 
|   37 #include "wtf/Vector.h" |   37 #include "wtf/Vector.h" | 
|   38  |   38  | 
|   39 struct z_stream_s; |   39 struct z_stream_s; | 
|   40 typedef z_stream_s z_stream; |   40 typedef z_stream_s z_stream; | 
|   41  |   41  | 
|   42 namespace WebCore { |   42 namespace WebCore { | 
|   43  |   43  | 
|   44 class WebSocketDeflater { |   44 class WebSocketDeflater { | 
|   45     WTF_MAKE_FAST_ALLOCATED; |   45     WTF_MAKE_FAST_ALLOCATED; | 
|   46 public: |   46 public: | 
 |   47     // This enum is reused for histogram. When this needs to be modified, add a | 
 |   48     // new enum for histogram and convert mode values into values in the new | 
 |   49     // enum to keep new data consistent with old one. | 
|   47     enum ContextTakeOverMode { |   50     enum ContextTakeOverMode { | 
|   48         DoNotTakeOverContext, |   51         DoNotTakeOverContext, | 
|   49         TakeOverContext |   52         TakeOverContext, | 
 |   53         ContextTakeOverModeMax, | 
|   50     }; |   54     }; | 
|   51     static PassOwnPtr<WebSocketDeflater> create(int windowBits, ContextTakeOverM
     ode = TakeOverContext); |   55     static PassOwnPtr<WebSocketDeflater> create(int windowBits, ContextTakeOverM
     ode = TakeOverContext); | 
|   52  |   56  | 
|   53     ~WebSocketDeflater(); |   57     ~WebSocketDeflater(); | 
|   54  |   58  | 
|   55     bool initialize(); |   59     bool initialize(); | 
|   56     bool addBytes(const char*, size_t); |   60     bool addBytes(const char*, size_t); | 
|   57     bool finish(); |   61     bool finish(); | 
|   58     const char* data() { return m_buffer.data(); } |   62     const char* data() { return m_buffer.data(); } | 
|   59     size_t size() const { return m_buffer.size(); } |   63     size_t size() const { return m_buffer.size(); } | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
|   90     explicit WebSocketInflater(int windowBits); |   94     explicit WebSocketInflater(int windowBits); | 
|   91  |   95  | 
|   92     int m_windowBits; |   96     int m_windowBits; | 
|   93     Vector<char> m_buffer; |   97     Vector<char> m_buffer; | 
|   94     OwnPtr<z_stream> m_stream; |   98     OwnPtr<z_stream> m_stream; | 
|   95 }; |   99 }; | 
|   96  |  100  | 
|   97 } |  101 } | 
|   98  |  102  | 
|   99 #endif // WebSocketDeflater_h |  103 #endif // WebSocketDeflater_h | 
| OLD | NEW |