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

Side by Side Diff: third_party/zlib/deflate.h

Issue 10874087: Merge 151720 - net: workaround compression leaks (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/zlib/README.chromium ('k') | third_party/zlib/deflate.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* deflate.h -- internal compression state 1 /* deflate.h -- internal compression state
2 * Copyright (C) 1995-2010 Jean-loup Gailly 2 * Copyright (C) 1995-2010 Jean-loup Gailly
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
6 /* WARNING: this file should *not* be used by applications. It is 6 /* WARNING: this file should *not* be used by applications. It is
7 part of the implementation of the compression library and is 7 part of the implementation of the compression library and is
8 subject to change. Applications should only use zlib.h. 8 subject to change. Applications should only use zlib.h.
9 */ 9 */
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } FAR tree_desc; 84 } FAR tree_desc;
85 85
86 typedef ush Pos; 86 typedef ush Pos;
87 typedef Pos FAR Posf; 87 typedef Pos FAR Posf;
88 typedef unsigned IPos; 88 typedef unsigned IPos;
89 89
90 /* A Pos is an index in the character window. We use short instead of int to 90 /* A Pos is an index in the character window. We use short instead of int to
91 * save space in the various tables. IPos is used only for parameter passing. 91 * save space in the various tables. IPos is used only for parameter passing.
92 */ 92 */
93 93
94 #define Z_COOKIE_HASH_SIZE 64
95 #define Z_COOKIE_HASH_MASK (Z_COOKIE_HASH_SIZE-1)
96
94 typedef struct internal_state { 97 typedef struct internal_state {
95 z_streamp strm; /* pointer back to this zlib stream */ 98 z_streamp strm; /* pointer back to this zlib stream */
96 int status; /* as the name implies */ 99 int status; /* as the name implies */
97 Bytef *pending_buf; /* output still pending */ 100 Bytef *pending_buf; /* output still pending */
98 ulg pending_buf_size; /* size of pending_buf */ 101 ulg pending_buf_size; /* size of pending_buf */
99 Bytef *pending_out; /* next pending byte to output to the stream */ 102 Bytef *pending_out; /* next pending byte to output to the stream */
100 uInt pending; /* nb of bytes in the pending buffer */ 103 uInt pending; /* nb of bytes in the pending buffer */
101 int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ 104 int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
102 gz_headerp gzhead; /* gzip header information to write */ 105 gz_headerp gzhead; /* gzip header information to write */
103 uInt gzindex; /* where in extra, name, or comment */ 106 uInt gzindex; /* where in extra, name, or comment */
(...skipping 28 matching lines...) Expand all
132 */ 135 */
133 136
134 Posf *head; /* Heads of the hash chains or NIL. */ 137 Posf *head; /* Heads of the hash chains or NIL. */
135 138
136 uInt ins_h; /* hash index of string to be inserted */ 139 uInt ins_h; /* hash index of string to be inserted */
137 uInt hash_size; /* number of elements in hash table */ 140 uInt hash_size; /* number of elements in hash table */
138 uInt hash_bits; /* log2(hash_size) */ 141 uInt hash_bits; /* log2(hash_size) */
139 uInt hash_mask; /* hash_size-1 */ 142 uInt hash_mask; /* hash_size-1 */
140 143
141 uInt hash_shift; 144 uInt hash_shift;
145 Bytef *class_bitmap; /* bitmap of class for each byte in window */
146 IPos cookie_locations[Z_COOKIE_HASH_SIZE];
142 /* Number of bits by which ins_h must be shifted at each input 147 /* Number of bits by which ins_h must be shifted at each input
143 * step. It must be such that after MIN_MATCH steps, the oldest 148 * step. It must be such that after MIN_MATCH steps, the oldest
144 * byte no longer takes part in the hash key, that is: 149 * byte no longer takes part in the hash key, that is:
145 * hash_shift * MIN_MATCH >= hash_bits 150 * hash_shift * MIN_MATCH >= hash_bits
146 */ 151 */
147 152
148 long block_start; 153 long block_start;
149 /* Window position at the beginning of the current output block. Gets 154 /* Window position at the beginning of the current output block. Gets
150 * negative when the window is moved backwards. 155 * negative when the window is moved backwards.
151 */ 156 */
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 s->dyn_dtree[d_code(dist)].Freq++; \ 338 s->dyn_dtree[d_code(dist)].Freq++; \
334 flush = (s->last_lit == s->lit_bufsize-1); \ 339 flush = (s->last_lit == s->lit_bufsize-1); \
335 } 340 }
336 #else 341 #else
337 # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) 342 # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
338 # define _tr_tally_dist(s, distance, length, flush) \ 343 # define _tr_tally_dist(s, distance, length, flush) \
339 flush = _tr_tally(s, distance, length) 344 flush = _tr_tally(s, distance, length)
340 #endif 345 #endif
341 346
342 #endif /* DEFLATE_H */ 347 #endif /* DEFLATE_H */
OLDNEW
« no previous file with comments | « third_party/zlib/README.chromium ('k') | third_party/zlib/deflate.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698