zlib: refactor zlib internals

Split out things that are specific to zlib as a specific
compression library, vs. the interface that is common to
most C compression libraries.

This should pave the way for including support for e.g.
brotli.

PR-URL: https://github.com/nodejs/node/pull/23360
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit is contained in:
Anna Henningsen 2018-09-22 14:09:52 +02:00 committed by Daniel Bevenius
parent 74f854e769
commit c34eae5f88
2 changed files with 575 additions and 467 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,10 @@ require('../common');
const { validateSnapshotNodes } = require('../common/heap');
const zlib = require('zlib');
validateSnapshotNodes('Node / ZCtx', []);
validateSnapshotNodes('Node / ZlibStream', []);
// eslint-disable-next-line no-unused-vars
const gunzip = zlib.createGunzip();
validateSnapshotNodes('Node / ZCtx', [
validateSnapshotNodes('Node / ZlibStream', [
{
children: [
{ node_name: 'Zlib', edge_name: 'wrapped' },