Граф коммитов

108 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey 8f667a0d22 Bug 1355661 - Add support for brotli streams in Jar archives. r=aklotz
Modern compression algorithms are better than zlib both in terms of
space and time. The jar format, used for e.g. omni.ja, addons, etc.
could benefit from using such modern algorithms, but the format only
allows a limited set of compression algorithms.

However, the format in itself is flexible, in that it can be extended
with arbitrary compression algorithms. This breaks compatibility with
programs like unzip, obviously, but we've never promised the files
shipped with Firefox will always remain "valid" zips (which they already
aren't, but they currently work with most zip readers).

With this change, we allow those archives to contain brotli streams,
using an arbitrary large value for the compression type in the Zip local
file header. This only allows to read such archives, but not to produce
them, and, for now, support for brotli streams is kept Nightly-only,
until everything is pieced together and we're happy to ship it.

--HG--
extra : rebase_source : fa637251f460ad0d91d5f5bec392c6e59555e80d
2017-04-07 14:48:25 +09:00
Eric Rahm 863c5ed327 Bug 1351801 - Switch libjar over to ArenaAllocator. r=bsmedberg
This converts libjar over to using ArenaAllocator instead of plarena.h. All
files can now be built in unified mode.

MozReview-Commit-ID: Ev8yyhxqRr7
2017-04-05 11:16:43 -07:00
Kirk Steuber 5e03f29369 Bug 1269185 - Prevent crashes in Windows when zip files cannot be read. r=spohl
MozReview-Commit-ID: 32uEegoKL4J

--HG--
extra : transplant_source : %2BN%22%E7%D0%A2%E8%BD%90%A6%E5%F3%F0J%9Ceg%25%FBc
2016-05-04 12:57:21 -07:00
Kirk Steuber a5ac9bebd2 Bug 1260836 - Add functionality to allow CRX files to be handled as ZIP files. r=spohl
MozReview-Commit-ID: 9JeSC6L4x6Z
2016-04-06 18:28:24 -07:00
Nathan Froyd 12d9670a60 Bug 1249389 - part 4 - make StartupCache::GetBuffer take a UniquePtr outparam; r=erahm
This change eliminates a number of nsAutoArrayPtr usages, as well as
making the pattern GetBuffer() -> NewObjectInputStreamFromBuffer more
pleasant.
2016-02-18 12:26:28 -05:00
Nathan Froyd 460db498a3 Bug 1249389 - part 3 - assert the size of nsZipItemPtr's storage type; r=erahm
The only uses of this class use a template argument with a size of
|char| (uint8_t and char), and the class isn't designed to accomodate
template arguments of larger size (e.g. the implementation of Forget()
neglects to divide by sizeof(T) for allocating a return buffer).  Let's
enforce this with a static_assert.  This change makes the class safer to
use and also makes future changes simpler to reason about.
2016-02-18 12:07:03 -05:00
Nathan Froyd 9bdab2140d Bug 1232732 - modify NS_WARNING in MOZ_WIN_MEM_TRY_CATCH; r=aklotz
The particular syntax for this warning is an MSVC extension, which
causes clang-cl to fallback to MSVC when compiling files that use this
macro.  Trying to use nsPrintfCString or equivalent here runs into
issues of unused variables in non-debug builds.  I think it's reasonable
to raise an warning without a specific location; folks can grovel about
in a debugger if they want to figure out what's going on.
2016-01-04 12:28:25 -05:00
Cameron McCormack fa1a36783a Bug 1225004 - Record reason for NS_ERROR_FILE_CORRUPTED in nsLayoutStylesheetCache::LoadSheet in crash reports. r=roc 2015-11-16 19:18:45 +11:00
Wes Kocher 12532a74a8 Backed out changeset 4efb6cc4fd5d (bug 1225004) for build bustage CLOSED TREE
--HG--
extra : commitid : 4eYsywoFekg
2015-11-16 14:51:17 -08:00
Cameron McCormack 6087c6d62a Bug 1225004 - Record reason for NS_ERROR_FILE_CORRUPTED in nsLayoutStylesheetCache::LoadSheet in crash reports. r=roc 2015-11-16 19:18:45 +11:00
Nigel Babu ef1ce5e989 Backed out changeset 6d47b0590988 (bug 1225004) for ASAN build bustage on a CLOSED TREE
--HG--
extra : amend_source : e082a4a17e47eac5922bcec3059999fae6798cb1
2015-11-16 14:46:58 +05:30
Cameron McCormack fa99a8cc59 Bug 1225004 - Record reason for NS_ERROR_FILE_CORRUPTED in nsLayoutStylesheetCache::LoadSheet in crash reports. r=roc 2015-11-16 19:18:45 +11:00
Nathan Froyd ac15b0955e Bug 1222575 - use UniquePtr<T[]> instead of nsAutoArrayPtr<T> in modules/libjar/; r=aklotz 2015-11-03 16:36:32 -05:00
Andrea Marchesini 51d11d89ea Bug 1214782, r=ehsan
--HG--
extra : rebase_source : f1dec852aa864b681b4417467992c7431f9103bf
2015-10-20 13:32:47 +02:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Shian-Yow Wu e696b31466 Bug 1069081 - Part 1: Always cache fd in JAR cache except Windows. r=mwu 2015-07-30 16:05:57 +08:00
Jed Davis c6383f1944 Bug 1034143: Step 2b: Add the ability to read jar files from arbitrary memory. r=honzab r=jduell 2015-03-10 17:00:01 -07:00
Ehsan Akhgari 4354953b4f Bug 1118486 - Part 1: Use `= delete` instead of MOZ_DELETE directly; r=Waldo
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:

#!/bin/bash

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00
Shian-Yow Wu ce46456625 Bug 988816 - Allow to keep file descriptor in JAR cache. r=aklotz, jduell 2014-07-18 10:46:24 +08:00
Ehsan Akhgari a11c39b680 Bug 1033457 - Use HAVE_SEH_EXCEPTIONS in order to use SEH exceptions in libjar; r=bsmedberg 2014-07-02 14:34:58 -04:00
Benoit Jacob 5947890285 Bug 1028588 - Fix dangerous public destructors in libjar/ - r=aklotz 2014-06-24 22:09:14 -04:00
Shian-Yow Wu 29e21bb5f7 Bug 945152 - Part 3-1: New libjar APIs. r=aklotz 2014-05-16 13:34:43 +08:00
Ehsan Akhgari 186680d83a Bug 798158 - Part 1: Use a pointer-sized type to store refcounts internally; r=bsmedberg 2014-03-27 16:38:33 -04:00
Ehsan Akhgari aac8d81bcb Bug 942486 - Move PL_ARENA_CONST_ALIGN_MASK out of nsZipArchive.h; r=mwu
--HG--
extra : rebase_source : 92410d30a1f8ae6d9df4fb6e6b278dc6307460a0
2013-11-25 15:44:25 -05:00
Birunthan Mohanathas 9722682a5a Bug 784739 - Switch from NULL to nullptr in modules/; r=ehsan
--HG--
extra : rebase_source : d82c3e2e18986d3b9ffc454ff84caf3634a6bbe7
2013-10-23 16:36:26 -04:00
Joshua Cranmer 47440ef749 Bug 884061 - Part 3p: Use NS_DECL_THREADSAFE_ISUPPORTS in modules/, r=taras,bsmedberg
--HG--
extra : rebase_source : e7b1a1d25ae9e602cae50f11d718dd1a94db782d
2013-07-18 21:23:44 -05:00
Aaron Klotz 5a7f6774ca Bug 810151: readahead for ordered jar files r=taras 2013-03-21 10:28:13 +01:00
Matt Brubeck b7dca43e54 Back out 7f6c38239328 (bug 810151) on suspicion of causing Windows xpcshell failures on a CLOSED TREE 2013-03-06 18:51:12 -08:00
Aaron Klotz 15755dd9f0 Bug 810151: readahead for ordered jar files r=taras
--HG--
extra : rebase_source : dd7984ff2dd7a57e77b8c5c74ab82ad5d033a772
2013-03-06 11:58:29 -07:00
Mike Hommey 026abf6d83 Bug 840094 - Change how nsZipArchive logging works. r=taras,r=gps
Now log in a single file given by the MOZ_JAR_LOG_FILE environment variable.
Log entries contain the URI of the Zip archive, followed by the path in the
archive.
* * *
Bug 840094 - Fixup for debug builds failure because of nsZipArchive::CloseArchive being called several times
2013-02-19 11:02:12 +01:00
Ehsan Akhgari e368dc9c85 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Aryeh Gregor c81630fddb Bug 777292 - Convert incorrect conversions to nsresult and fix named constants; r=ehsan 2012-07-27 16:59:29 +03:00
Joshua Cranmer a1186c1020 Bug 773637 - Kill NS_SCRIPTABLE annotations, Part 1: Remove NS_*PARAM annotations. r=ehsan
--HG--
extra : rebase_source : a0b4bc50fece36d9a90fed61431635948bfa33b5
2012-07-06 15:14:07 -05:00
Geoff Lankow 5cefea8480 Bug 749930 - Replace uses of nsILocalFile with nsIFile (compiled code only); r=bsmedberg 2012-06-06 14:08:30 +12:00
Gervase Markham 82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Nathan Froyd 5afd06737a Bug 711297 - add comment reading to nsZipArchive; r=taras 2012-02-22 13:45:09 -05:00
Jeff Walden 62f48d8793 Bug 711647 - Add MOZ_DELETE to a bunch of deliberately-not-implemented methods across the tree. r=dbaron
--HG--
extra : rebase_source : 507006c0f099da6851b585d2062267d285978ad7
2011-12-16 14:42:07 -05:00
Mike Hommey 511d9f638c Bug 695843 part 5 - Add a FileLocation class to either store a pair (zip, path) or a file, and do some operations on these. r=bsmedberg,mwu 2011-12-08 11:03:36 +01:00
Mike Hommey b83b7a72c9 Bug 695843 part 4 - Allow nsZipCursor to always use the given buffer. r=tglek 2011-12-08 11:03:36 +01:00
Mike Hommey cd155f464b Bug 695843 part 1 - Add Refcounting on nsZipArchives. r=mwu 2011-12-08 11:03:36 +01:00
Nicholas Nethercote 0ee9052aba Bug 696690 - Memory reporter for the startup cache. r=tglek. 2011-10-24 17:50:47 -07:00
Michael Wu d2b70213ac Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Mitchell Field a6788f0842 Bug 627277 - Remove (broken) BeOS support. r=biesi,dwitte,gavin,joe,jorendorff,josh,khuey,mfinkle,neil,Pike,roc,shaver,smontagu,taras 2011-02-20 06:10:24 +11:00
Jacek Caban af11ffdcd6 Bug 611984 - Compilation failure on mingw in modules/libjar after bug 598416 landing r=tglek a=benjamin 2011-01-22 12:56:28 +00:00
Taras Glek 23936101cc Bug 595924: API change to go with Bug 598416 to fix crash r=mwu a=blocking2.0-betaN 2010-11-11 12:13:57 -08:00
Taras Glek 82ac2d11bf Bug 598416: add try/catch in places in nsZipReader.cpp that access mmaped memory directly r=bsmedberg a=blocking2.0-betaN 2010-11-11 12:13:48 -08:00
Michael Wu 530165f48e Bug 533038 - 2. Generalize nsZipArchive and nsZipHandle to read from different sources, r=taras a=blocking-beta6 2010-09-08 20:37:34 -07:00
Michael Wu ef808d0528 Bug 533038 - 1. Generalize manifest reading code and add api for reading manifests from jars, r=bsmedberg a=blocking-beta6 2010-09-08 20:37:11 -07:00
bhsieh@mozilla.com df2049724f bug 520309, startupcache core r=dwitte sr=bsmedberg a=bsmedberg 2010-08-12 12:37:44 -07:00
Taras Glek b811791acb Bug 559961 - Reorder jar files as part of PGO, r=bsmedberg a=blocking2.0
--HG--
extra : rebase_source : d8a75545714a131291c74dd79c966150544ff9d1
2010-08-18 10:34:07 -07:00