<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[186313] releases/WebKitGTK/webkit-2.8/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/186313">186313</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-07-06 01:13:43 -0700 (Mon, 06 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/180968">r180968</a> - Remove unused compression code
https://bugs.webkit.org/show_bug.cgi?id=142237
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
* bytecode/UnlinkedCodeBlock.h:
Source/WTF:
* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Compression.cpp: Removed.
* wtf/Compression.h: Removed.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28SourceJavaScriptCoreChangeLog">releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceJavaScriptCorebytecodeUnlinkedCodeBlockh">releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFChangeLog">releases/WebKitGTK/webkit-2.8/Source/WTF/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFWTFvcxprojWTFvcxproj">releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.vcxproj/WTF.vcxproj</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFWTFvcxprojWTFvcxprojfilters">releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFWTFxcodeprojprojectpbxproj">releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.xcodeproj/project.pbxproj</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFwtfCMakeListstxt">releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/CMakeLists.txt</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFwtfCompressioncpp">releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/Compression.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFwtfCompressionh">releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/Compression.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit28SourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog (186312 => 186313)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog        2015-07-06 08:10:26 UTC (rev 186312)
+++ releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog        2015-07-06 08:13:43 UTC (rev 186313)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2015-03-03 Anders Carlsson <andersca@apple.com>
+
+ Remove unused compression code
+ https://bugs.webkit.org/show_bug.cgi?id=142237
+
+ Reviewed by Geoffrey Garen.
+
+ * bytecode/UnlinkedCodeBlock.h:
+
</ins><span class="cx"> 2015-05-17 Benjamin Poulain <benjamin@webkit.org>
</span><span class="cx">
</span><span class="cx"> Do not use fastMallocGoodSize anywhere
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceJavaScriptCorebytecodeUnlinkedCodeBlockh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h (186312 => 186313)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2015-07-06 08:10:26 UTC (rev 186312)
+++ releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2015-07-06 08:13:43 UTC (rev 186313)
</span><span class="lines">@@ -39,7 +39,6 @@
</span><span class="cx"> #include "SymbolTable.h"
</span><span class="cx"> #include "VirtualRegister.h"
</span><span class="cx">
</span><del>-#include <wtf/Compression.h>
</del><span class="cx"> #include <wtf/RefCountedArray.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WTF/ChangeLog (186312 => 186313)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/ChangeLog        2015-07-06 08:10:26 UTC (rev 186312)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/ChangeLog        2015-07-06 08:13:43 UTC (rev 186313)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-03-03 Anders Carlsson <andersca@apple.com>
+
+ Remove unused compression code
+ https://bugs.webkit.org/show_bug.cgi?id=142237
+
+ Reviewed by Geoffrey Garen.
+
+ * WTF.vcxproj/WTF.vcxproj:
+ * WTF.vcxproj/WTF.vcxproj.filters:
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/CMakeLists.txt:
+ * wtf/Compression.cpp: Removed.
+ * wtf/Compression.h: Removed.
+
</ins><span class="cx"> 2015-05-17 Benjamin Poulain <benjamin@webkit.org>
</span><span class="cx">
</span><span class="cx"> Do not use fastMallocGoodSize anywhere
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFWTFvcxprojWTFvcxproj"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.vcxproj/WTF.vcxproj (186312 => 186313)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.vcxproj/WTF.vcxproj        2015-07-06 08:10:26 UTC (rev 186312)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.vcxproj/WTF.vcxproj        2015-07-06 08:13:43 UTC (rev 186313)
</span><span class="lines">@@ -54,7 +54,6 @@
</span><span class="cx"> <ClCompile Include="..\wtf\Assertions.cpp" />
</span><span class="cx"> <ClCompile Include="..\wtf\BitVector.cpp" />
</span><span class="cx"> <ClCompile Include="..\wtf\CompilationThread.cpp" />
</span><del>- <ClCompile Include="..\wtf\Compression.cpp" />
</del><span class="cx"> <ClCompile Include="..\wtf\CryptographicUtilities.cpp" />
</span><span class="cx"> <ClCompile Include="..\wtf\CryptographicallyRandomNumber.cpp" />
</span><span class="cx"> <ClCompile Include="..\wtf\CurrentTime.cpp" />
</span><span class="lines">@@ -174,7 +173,6 @@
</span><span class="cx"> <ClInclude Include="..\wtf\CheckedArithmetic.h" />
</span><span class="cx"> <ClInclude Include="..\wtf\CheckedBoolean.h" />
</span><span class="cx"> <ClInclude Include="..\wtf\Compiler.h" />
</span><del>- <ClInclude Include="..\wtf\Compression.h" />
</del><span class="cx"> <ClInclude Include="..\wtf\CryptographicUtilities.h" />
</span><span class="cx"> <ClInclude Include="..\wtf\CryptographicallyRandomNumber.h" />
</span><span class="cx"> <ClInclude Include="..\wtf\CurrentTime.h" />
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFWTFvcxprojWTFvcxprojfilters"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters (186312 => 186313)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters        2015-07-06 08:10:26 UTC (rev 186312)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters        2015-07-06 08:13:43 UTC (rev 186313)
</span><span class="lines">@@ -228,9 +228,6 @@
</span><span class="cx"> <ClCompile Include="..\wtf\SixCharacterHash.cpp">
</span><span class="cx"> <Filter>wtf</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\wtf\Compression.cpp">
- <Filter>wtf</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\wtf\gobject\GlibUtilities.cpp">
</span><span class="cx"> <Filter>wtf\gobject</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -679,9 +676,6 @@
</span><span class="cx"> <ClInclude Include="..\wtf\SixCharacterHash.h">
</span><span class="cx"> <Filter>wtf</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\wtf\Compression.h">
- <Filter>wtf</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\wtf\FlipBytes.h">
</span><span class="cx"> <Filter>wtf</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFWTFxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.xcodeproj/project.pbxproj (186312 => 186313)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.xcodeproj/project.pbxproj        2015-07-06 08:10:26 UTC (rev 186312)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/WTF.xcodeproj/project.pbxproj        2015-07-06 08:13:43 UTC (rev 186313)
</span><span class="lines">@@ -100,8 +100,6 @@
</span><span class="cx">                 A748745217A0BDAE00FA04CB /* SixCharacterHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A748744F17A0BDAE00FA04CB /* SixCharacterHash.cpp */; };
</span><span class="cx">                 A748745317A0BDAE00FA04CB /* SixCharacterHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A748745017A0BDAE00FA04CB /* SixCharacterHash.h */; };
</span><span class="cx">                 A748745417A0BDAE00FA04CB /* StringHashDumpContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A748745117A0BDAE00FA04CB /* StringHashDumpContext.h */; };
</span><del>-                A7E643C617C5423B003BB16B /* Compression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E643C417C5423B003BB16B /* Compression.cpp */; };
-                A7E643C717C5423B003BB16B /* Compression.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E643C517C5423B003BB16B /* Compression.h */; };
</del><span class="cx">                 A876DBD8151816E500DADB95 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A876DBD7151816E500DADB95 /* Platform.h */; };
</span><span class="cx">                 A8A47385151A825B004123FF /* ASCIICType.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725A151A825A004123FF /* ASCIICType.h */; };
</span><span class="cx">                 A8A47386151A825B004123FF /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4725B151A825A004123FF /* Assertions.cpp */; };
</span><span class="lines">@@ -392,8 +390,6 @@
</span><span class="cx">                 A748744F17A0BDAE00FA04CB /* SixCharacterHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SixCharacterHash.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A748745017A0BDAE00FA04CB /* SixCharacterHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SixCharacterHash.h; sourceTree = "<group>"; };
</span><span class="cx">                 A748745117A0BDAE00FA04CB /* StringHashDumpContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringHashDumpContext.h; sourceTree = "<group>"; };
</span><del>-                A7E643C417C5423B003BB16B /* Compression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Compression.cpp; sourceTree = "<group>"; };
-                A7E643C517C5423B003BB16B /* Compression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compression.h; sourceTree = "<group>"; };
</del><span class="cx">                 A876DBD7151816E500DADB95 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Platform.h; sourceTree = "<group>"; };
</span><span class="cx">                 A8A4725A151A825A004123FF /* ASCIICType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCIICType.h; sourceTree = "<group>"; };
</span><span class="cx">                 A8A4725B151A825A004123FF /* Assertions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Assertions.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -727,8 +723,6 @@
</span><span class="cx">                                 0F8F2B8F172E00F0007DBDA5 /* CompilationThread.cpp */,
</span><span class="cx">                                 0F8F2B90172E00F0007DBDA5 /* CompilationThread.h */,
</span><span class="cx">                                 A8A47270151A825A004123FF /* Compiler.h */,
</span><del>-                                A7E643C417C5423B003BB16B /* Compression.cpp */,
-                                A7E643C517C5423B003BB16B /* Compression.h */,
</del><span class="cx">                                 E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */,
</span><span class="cx">                                 E15556F418A0CC18006F48FB /* CryptographicUtilities.h */,
</span><span class="cx">                                 A8A47273151A825A004123FF /* CryptographicallyRandomNumber.cpp */,
</span><span class="lines">@@ -1073,7 +1067,6 @@
</span><span class="cx">                                 0FC4EDE61696149600F65041 /* CommaPrinter.h in Headers */,
</span><span class="cx">                                 0F8F2B91172E00FC007DBDA5 /* CompilationThread.h in Headers */,
</span><span class="cx">                                 A8A47398151A825B004123FF /* Compiler.h in Headers */,
</span><del>-                                A7E643C717C5423B003BB16B /* Compression.h in Headers */,
</del><span class="cx">                                 A8A4748C151A8264004123FF /* config.h in Headers */,
</span><span class="cx">                                 0F8F2B9C172F2596007DBDA5 /* ConversionMode.h in Headers */,
</span><span class="cx">                                 A8A4739B151A825B004123FF /* CryptographicallyRandomNumber.h in Headers */,
</span><span class="lines">@@ -1334,7 +1327,6 @@
</span><span class="cx">                                 A8A47460151A825B004123FF /* CollatorDefault.cpp in Sources */,
</span><span class="cx">                                 A8A47463151A825B004123FF /* CollatorICU.cpp in Sources */,
</span><span class="cx">                                 0F8F2B92172E0103007DBDA5 /* CompilationThread.cpp in Sources */,
</span><del>-                                A7E643C617C5423B003BB16B /* Compression.cpp in Sources */,
</del><span class="cx">                                 A8A4739A151A825B004123FF /* CryptographicallyRandomNumber.cpp in Sources */,
</span><span class="cx">                                 A8A47439151A825B004123FF /* CString.cpp in Sources */,
</span><span class="cx">                                 A8A4739C151A825B004123FF /* CurrentTime.cpp in Sources */,
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFwtfCMakeListstxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/CMakeLists.txt (186312 => 186313)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/CMakeLists.txt        2015-07-06 08:10:26 UTC (rev 186312)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/CMakeLists.txt        2015-07-06 08:13:43 UTC (rev 186313)
</span><span class="lines">@@ -12,7 +12,6 @@
</span><span class="cx"> ByteOrder.h
</span><span class="cx"> CompilationThread.h
</span><span class="cx"> Compiler.h
</span><del>- Compression.h
</del><span class="cx"> CryptographicUtilities.h
</span><span class="cx"> CryptographicallyRandomNumber.h
</span><span class="cx"> CurrentTime.h
</span><span class="lines">@@ -148,7 +147,6 @@
</span><span class="cx"> Atomics.cpp
</span><span class="cx"> BitVector.cpp
</span><span class="cx"> CompilationThread.cpp
</span><del>- Compression.cpp
</del><span class="cx"> CryptographicUtilities.cpp
</span><span class="cx"> CryptographicallyRandomNumber.cpp
</span><span class="cx"> CurrentTime.cpp
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFwtfCompressioncpp"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/Compression.cpp (186312 => 186313)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/Compression.cpp        2015-07-06 08:10:26 UTC (rev 186312)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/Compression.cpp        2015-07-06 08:13:43 UTC (rev 186313)
</span><span class="lines">@@ -1,178 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Compression.h"
-
-#include "CheckedArithmetic.h"
-
-#if USE(ZLIB) && !COMPILER(MSVC)
-
-#include <string.h>
-#include <zlib.h>
-
-namespace WTF {
-
-static void* zAlloc(void*, uint32_t count, uint32_t size)
-{
- CheckedSize allocSize = count;
- allocSize *= size;
- if (allocSize.hasOverflowed())
- return Z_NULL;
- void* result = 0;
- if (tryFastMalloc(allocSize.unsafeGet()).getValue(result))
- return result;
- return Z_NULL;
-}
-
-static void zFree(void*, void* data)
-{
- fastFree(data);
-}
-
-std::unique_ptr<GenericCompressedData> GenericCompressedData::create(const uint8_t* data, size_t dataLength)
-{
- enum { MinimumSize = sizeof(GenericCompressedData) * 8 };
-
- if (!data || dataLength < MinimumSize)
- return nullptr;
-
- z_stream stream;
- memset(&stream, 0, sizeof(stream));
- stream.zalloc = zAlloc;
- stream.zfree = zFree;
- stream.data_type = Z_BINARY;
- stream.opaque = Z_NULL;
- stream.avail_in = dataLength;
- stream.next_in = const_cast<uint8_t*>(data);
-
- size_t currentOffset = OBJECT_OFFSETOF(GenericCompressedData, m_data);
- size_t currentCapacity = fastMallocGoodSize(MinimumSize);
- Bytef* compressedData = static_cast<Bytef*>(fastMalloc(currentCapacity));
- memset(compressedData, 0, sizeof(GenericCompressedData));
- stream.next_out = compressedData + currentOffset;
- stream.avail_out = currentCapacity - currentOffset;
-
- deflateInit(&stream, Z_BEST_COMPRESSION);
-
- while (true) {
- int deflateResult = deflate(&stream, Z_FINISH);
- if (deflateResult == Z_OK || !stream.avail_out) {
- size_t newCapacity = 0;
- currentCapacity -= stream.avail_out;
- if (!stream.avail_in)
- newCapacity = currentCapacity + 8;
- else {
- // Determine average capacity
- size_t compressedContent = stream.next_in - data;
- double expectedSize = static_cast<double>(dataLength) * compressedContent / currentCapacity;
-
- // Expand capacity by at least 8 bytes so we're always growing, and to
- // compensate for any exaggerated ideas of how effectively we'll compress
- // data in the future.
- newCapacity = std::max(static_cast<size_t>(expectedSize + 8), currentCapacity + 8);
- }
- newCapacity = fastMallocGoodSize(newCapacity);
- if (newCapacity >= dataLength)
- goto fail;
- compressedData = static_cast<Bytef*>(fastRealloc(compressedData, newCapacity));
- currentOffset = currentCapacity - stream.avail_out;
- stream.next_out = compressedData + currentOffset;
- stream.avail_out = newCapacity - currentCapacity;
- currentCapacity = newCapacity;
- continue;
- }
-
- if (deflateResult == Z_STREAM_END) {
- ASSERT(!stream.avail_in);
- break;
- }
-
- ASSERT_NOT_REACHED();
- fail:
- deflateEnd(&stream);
- fastFree(compressedData);
- return nullptr;
- }
- deflateEnd(&stream);
- static int64_t totalCompressed = 0;
- static int64_t totalInput = 0;
-
- totalCompressed += currentCapacity;
- totalInput += dataLength;
- return std::unique_ptr<GenericCompressedData>(new (compressedData) GenericCompressedData(dataLength, stream.total_out));
-}
-
-bool GenericCompressedData::decompress(uint8_t* destination, size_t bufferSize, size_t* decompressedByteCount)
-{
- if (decompressedByteCount)
- *decompressedByteCount = 0;
- z_stream stream;
- memset(&stream, 0, sizeof(stream));
- stream.zalloc = zAlloc;
- stream.zfree = zFree;
- stream.data_type = Z_BINARY;
- stream.opaque = Z_NULL;
- stream.next_out = destination;
- stream.avail_out = bufferSize;
- stream.next_in = m_data;
- stream.avail_in = compressedSize();
- if (inflateInit(&stream) != Z_OK) {
- ASSERT_NOT_REACHED();
- return false;
- }
-
- int inflateResult = inflate(&stream, Z_FINISH);
- inflateEnd(&stream);
-
- ASSERT(stream.total_out <= bufferSize);
- if (decompressedByteCount)
- *decompressedByteCount = stream.total_out;
-
- if (inflateResult != Z_STREAM_END) {
- ASSERT_NOT_REACHED();
- return false;
- }
-
- return true;
-}
-
-}
-
-#else
-
-namespace WTF {
-std::unique_ptr<GenericCompressedData> GenericCompressedData::create(const uint8_t*, size_t)
-{
- return nullptr;
-}
-
-bool GenericCompressedData::decompress(uint8_t*, size_t, size_t*)
-{
- return false;
-}
-}
-
-#endif
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFwtfCompressionh"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/Compression.h (186312 => 186313)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/Compression.h        2015-07-06 08:10:26 UTC (rev 186312)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/Compression.h        2015-07-06 08:13:43 UTC (rev 186313)
</span><span class="lines">@@ -1,149 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef Compression_h
-#define Compression_h
-
-#include <memory>
-#include <wtf/Vector.h>
-
-namespace WTF {
-
-class GenericCompressedData {
- WTF_MAKE_NONCOPYABLE(GenericCompressedData)
- WTF_MAKE_FAST_ALLOCATED;
-public:
- WTF_EXPORT_PRIVATE static std::unique_ptr<GenericCompressedData> create(const uint8_t*, size_t);
- uint32_t compressedSize() const { return m_compressedSize; }
- uint32_t originalSize() const { return m_originalSize; }
-
- WTF_EXPORT_PRIVATE bool decompress(uint8_t* destination, size_t bufferSize, size_t* decompressedByteCount = 0);
-
-private:
- GenericCompressedData(size_t originalSize, size_t compressedSize)
- {
- UNUSED_PARAM(m_data);
- ASSERT(!m_originalSize);
- ASSERT(!m_compressedSize);
- m_originalSize = originalSize;
- m_compressedSize = compressedSize;
- }
- uint32_t m_originalSize;
- uint32_t m_compressedSize;
- uint8_t m_data[1];
-};
-
-template <typename T> class CompressedVector : public GenericCompressedData {
-public:
- static std::unique_ptr<CompressedVector> create(const Vector<T>& source)
- {
- std::unique_ptr<GenericCompressedData> result = GenericCompressedData::create(reinterpret_cast<const uint8_t*>(source.data()), sizeof(T) * source.size());
- return std::unique_ptr<CompressedVector<T>>(static_cast<CompressedVector<T>*>(result.release()));
- }
-
- void decompress(Vector<T>& destination)
- {
- Vector<T> output(originalSize() / sizeof(T));
- ASSERT(output.size() * sizeof(T) == originalSize());
- size_t decompressedByteCount = 0;
- GenericCompressedData::decompress(reinterpret_cast<uint8_t*>(output.data()), originalSize(), &decompressedByteCount);
- ASSERT(decompressedByteCount == originalSize());
- ASSERT(output.size() * sizeof(T) == decompressedByteCount);
-
- destination.swap(output);
- }
-
- size_t size() const { return originalSize() / sizeof(T); }
-};
-
-template <typename T> class CompressibleVector {
- WTF_MAKE_NONCOPYABLE(CompressibleVector)
-public:
- CompressibleVector(size_t size = 0)
- : m_decompressedData(size)
- {
- }
-
- typedef typename Vector<T>::iterator iterator;
- typedef typename Vector<T>::const_iterator const_iterator;
-
- void shrinkToFit()
- {
- ASSERT(!m_compressedData);
- m_compressedData = CompressedVector<T>::create(m_decompressedData);
- if (m_compressedData)
- m_decompressedData.clear();
- else
- m_decompressedData.shrinkToFit();
- }
-
- size_t size()
- {
- if (m_compressedData)
- return m_compressedData->size();
- return m_decompressedData.size();
- }
-
- template <typename U> T& operator[](Checked<U> index) { return data().at(index); }
- template <typename U> const T& operator[](Checked<U> index) const { return data().at(index); }
- template <typename U> T& at(Checked<U> index) { return data().at(index); }
- template <typename U> const T& at(Checked<U> index) const { return data().at(index); }
-
- iterator begin() { return data().begin(); }
- iterator end() { return data().end(); }
- const_iterator begin() const { return data().begin(); }
- const_iterator end() const { return data().end(); }
-
- const Vector<T>& data() const
- {
- decompressIfNecessary();
- return m_decompressedData;
- }
-
- Vector<T>& data()
- {
- decompressIfNecessary();
- return m_decompressedData;
- }
-
-private:
- void decompressIfNecessary() const
- {
- if (!m_compressedData)
- return;
- m_compressedData->decompress(m_decompressedData);
- m_compressedData = nullptr;
- }
- mutable Vector<T> m_decompressedData;
- mutable std::unique_ptr<CompressedVector<T>> m_compressedData;
-};
-
-}
-
-using WTF::GenericCompressedData;
-using WTF::CompressedVector;
-using WTF::CompressibleVector;
-
-#endif
</del></span></pre>
</div>
</div>
</body>
</html>