summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/moz.configure/old.configure1
-rw-r--r--js/src/jit/IonBuilder.cpp6
-rw-r--r--modules/xz-embedded/README.mozilla8
-rw-r--r--modules/xz-embedded/src/xz.h154
-rw-r--r--modules/xz-embedded/src/xz_config.h3
-rw-r--r--modules/xz-embedded/src/xz_crc32.c2
-rw-r--r--modules/xz-embedded/src/xz_crc64.c8
-rw-r--r--modules/xz-embedded/src/xz_dec_bcj.c4
-rw-r--r--modules/xz-embedded/src/xz_dec_lzma2.c193
-rw-r--r--modules/xz-embedded/src/xz_dec_stream.c102
-rw-r--r--modules/xz-embedded/src/xz_lzma2.h2
-rw-r--r--modules/xz-embedded/src/xz_private.h3
-rw-r--r--modules/xz-embedded/src/xz_stream.h2
-rwxr-xr-xmodules/xz-embedded/update.sh6
-rw-r--r--python/mozbuild/mozbuild/mach_commands.py10
-rw-r--r--toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd3
-rw-r--r--toolkit/mozapps/extensions/content/extensions.css17
-rw-r--r--toolkit/mozapps/extensions/content/extensions.xml8
-rw-r--r--toolkit/mozapps/extensions/internal/AddonRepository.jsm8
-rw-r--r--toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm28
-rw-r--r--toolkit/mozapps/extensions/internal/XPIProvider.jsm36
-rw-r--r--toolkit/mozapps/extensions/internal/XPIProviderUtils.js3
-rw-r--r--toolkit/mozapps/extensions/internal/moz.build6
-rw-r--r--toolkit/themes/linux/mozapps/extensions/extensions.css7
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-compatibility.pngbin1041 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-error.pngbin1979 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-info-negative.pngbin2027 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-info-positive.pngbin1852 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-warning.pngbin2177 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/jar.mn5
-rw-r--r--toolkit/themes/windows/mozapps/extensions/extensions.css7
-rw-r--r--toolkit/themes/windows/mozapps/extensions/stripes-compatibility.pngbin1041 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/jar.mn1
-rw-r--r--uriloader/exthandler/nsExternalHelperAppService.cpp3
34 files changed, 578 insertions, 58 deletions
diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
index d2c03d712e..5806dcbb8b 100644
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -306,6 +306,7 @@ def old_configure_options(*options):
'--disable-browser-statusbar',
'--disable-sync',
'--disable-personas',
+ '--enable-phoenix-extensions',
# Below are configure flags used by Basilisk
'--disable-webextensions',
diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
index 2b7ac6b9ce..dae86fd92a 100644
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -8181,12 +8181,14 @@ IonBuilder::maybeMarkEmpty(MDefinition* ins)
// as having no possible types too. This is to avoid degrading
// subsequent analysis.
for (size_t i = 0; i < ins->numOperands(); i++) {
- if (!ins->emptyResultTypeSet())
+ if (!ins->getOperand(i)->emptyResultTypeSet())
continue;
TemporaryTypeSet* types = alloc().lifoAlloc()->new_<TemporaryTypeSet>();
- if (types)
+ if (types) {
ins->setResultTypeSet(types);
+ return;
+ }
}
}
diff --git a/modules/xz-embedded/README.mozilla b/modules/xz-embedded/README.mozilla
index d0532e1e91..17dd755ee4 100644
--- a/modules/xz-embedded/README.mozilla
+++ b/modules/xz-embedded/README.mozilla
@@ -1,14 +1,14 @@
This is the XZ Embedded decompression library from
-http://tukaani.org/xz/embedded.html.
+https://tukaani.org/xz/embedded.html.
Upstream code can be viewed at
- http://git.tukaani.org/xz-embedded.git
+ https://git.tukaani.org/xz-embedded.git
and cloned by
- git clone http://git.tukaani.org/xz-embedded.git
+ git clone https://git.tukaani.org/xz-embedded.git
The in-tree copy is updated by running
sh update.sh
from within the modules/xz-embedded directory.
-Current version: [e75f4eb79165213a02d567940d344f5c2ff1be03].
+Current version: [3f438e15109229bb14ab45f285f4bff5412a9542].
diff --git a/modules/xz-embedded/src/xz.h b/modules/xz-embedded/src/xz.h
index 0a4b38d33c..f3801eb6f5 100644
--- a/modules/xz-embedded/src/xz.h
+++ b/modules/xz-embedded/src/xz.h
@@ -2,7 +2,7 @@
* XZ decompressor
*
* Authors: Lasse Collin <lasse.collin@tukaani.org>
- * Igor Pavlov <http://7-zip.org/>
+ * Igor Pavlov <https://7-zip.org/>
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
@@ -32,7 +32,7 @@ extern "C" {
* enum xz_mode - Operation mode
*
* @XZ_SINGLE: Single-call mode. This uses less RAM than
- * than multi-call modes, because the LZMA2
+ * multi-call modes, because the LZMA2
* dictionary doesn't need to be allocated as
* part of the decoder state. All required data
* structures are allocated at initialization,
@@ -198,7 +198,7 @@ struct xz_dec;
XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max);
/**
- * xz_dec_run() - Run the XZ decoder
+ * xz_dec_run() - Run the XZ decoder for a single XZ stream
* @s: Decoder state allocated using xz_dec_init()
* @b: Input and output buffers
*
@@ -214,10 +214,52 @@ XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max);
* cannot give the single-call decoder a too small buffer and then expect to
* get that amount valid data from the beginning of the stream. You must use
* the multi-call decoder if you don't want to uncompress the whole stream.
+ *
+ * Use xz_dec_run() when XZ data is stored inside some other file format.
+ * The decoding will stop after one XZ stream has been decompresed. To
+ * decompress regular .xz files which might have multiple concatenated
+ * streams, use xz_dec_catrun() instead.
*/
XZ_EXTERN enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b);
/**
+ * xz_dec_catrun() - Run the XZ decoder with support for concatenated streams
+ * @s: Decoder state allocated using xz_dec_init()
+ * @b: Input and output buffers
+ * @finish: This is an int instead of bool to avoid requiring stdbool.h.
+ * As long as more input might be coming, finish must be false.
+ * When the caller knows that it has provided all the input to
+ * the decoder (some possibly still in b->in), it must set finish
+ * to true. Only when finish is true can this function return
+ * XZ_STREAM_END to indicate successful decompression of the
+ * file. In single-call mode (XZ_SINGLE) finish is assumed to
+ * always be true; the caller-provided value is ignored.
+ *
+ * This is like xz_dec_run() except that this makes it easy to decode .xz
+ * files with multiple streams (multiple .xz files concatenated as is).
+ * The rarely-used Stream Padding feature is supported too, that is, there
+ * can be null bytes after or between the streams. The number of null bytes
+ * must be a multiple of four.
+ *
+ * When finish is false and b->in_pos == b->in_size, it is possible that
+ * XZ_BUF_ERROR isn't returned even when no progress is possible (XZ_OK is
+ * returned instead). This shouldn't matter because in this situation a
+ * reasonable caller will attempt to provide more input or set finish to
+ * true for the next xz_dec_catrun() call anyway.
+ *
+ * For any struct xz_dec that has been initialized for multi-call mode:
+ * Once decoding has been started with xz_dec_run() or xz_dec_catrun(),
+ * the same function must be used until xz_dec_reset() or xz_dec_end().
+ * Switching between the two decoding functions without resetting results
+ * in undefined behavior.
+ *
+ * xz_dec_catrun() is only available if XZ_DEC_CONCATENATED was defined
+ * at compile time.
+ */
+XZ_EXTERN enum xz_ret xz_dec_catrun(struct xz_dec *s, struct xz_buf *b,
+ int finish);
+
+/**
* xz_dec_reset() - Reset an already allocated decoder state
* @s: Decoder state allocated using xz_dec_init()
*
@@ -238,6 +280,112 @@ XZ_EXTERN void xz_dec_reset(struct xz_dec *s);
XZ_EXTERN void xz_dec_end(struct xz_dec *s);
/*
+ * Decompressor for MicroLZMA, an LZMA variant with a very minimal header.
+ * See xz_dec_microlzma_alloc() below for details.
+ *
+ * These functions aren't used or available in preboot code and thus aren't
+ * marked with XZ_EXTERN. This avoids warnings about static functions that
+ * are never defined.
+ */
+/**
+ * struct xz_dec_microlzma - Opaque type to hold the MicroLZMA decoder state
+ */
+struct xz_dec_microlzma;
+
+/**
+ * xz_dec_microlzma_alloc() - Allocate memory for the MicroLZMA decoder
+ * @mode XZ_SINGLE or XZ_PREALLOC
+ * @dict_size LZMA dictionary size. This must be at least 4 KiB and
+ * at most 3 GiB.
+ *
+ * In contrast to xz_dec_init(), this function only allocates the memory
+ * and remembers the dictionary size. xz_dec_microlzma_reset() must be used
+ * before calling xz_dec_microlzma_run().
+ *
+ * The amount of allocated memory is a little less than 30 KiB with XZ_SINGLE.
+ * With XZ_PREALLOC also a dictionary buffer of dict_size bytes is allocated.
+ *
+ * On success, xz_dec_microlzma_alloc() returns a pointer to
+ * struct xz_dec_microlzma. If memory allocation fails or
+ * dict_size is invalid, NULL is returned.
+ *
+ * The compressed format supported by this decoder is a raw LZMA stream
+ * whose first byte (always 0x00) has been replaced with bitwise-negation
+ * of the LZMA properties (lc/lp/pb) byte. For example, if lc/lp/pb is
+ * 3/0/2, the first byte is 0xA2. This way the first byte can never be 0x00.
+ * Just like with LZMA2, lc + lp <= 4 must be true. The LZMA end-of-stream
+ * marker must not be used. The unused values are reserved for future use.
+ * This MicroLZMA header format was created for use in EROFS but may be used
+ * by others too.
+ */
+extern struct xz_dec_microlzma *xz_dec_microlzma_alloc(enum xz_mode mode,
+ uint32_t dict_size);
+
+/**
+ * xz_dec_microlzma_reset() - Reset the MicroLZMA decoder state
+ * @s Decoder state allocated using xz_dec_microlzma_alloc()
+ * @comp_size Compressed size of the input stream
+ * @uncomp_size Uncompressed size of the input stream. A value smaller
+ * than the real uncompressed size of the input stream can
+ * be specified if uncomp_size_is_exact is set to false.
+ * uncomp_size can never be set to a value larger than the
+ * expected real uncompressed size because it would eventually
+ * result in XZ_DATA_ERROR.
+ * @uncomp_size_is_exact This is an int instead of bool to avoid
+ * requiring stdbool.h. This should normally be set to true.
+ * When this is set to false, error detection is weaker.
+ */
+extern void xz_dec_microlzma_reset(struct xz_dec_microlzma *s,
+ uint32_t comp_size, uint32_t uncomp_size,
+ int uncomp_size_is_exact);
+
+/**
+ * xz_dec_microlzma_run() - Run the MicroLZMA decoder
+ * @s Decoder state initialized using xz_dec_microlzma_reset()
+ * @b: Input and output buffers
+ *
+ * This works similarly to xz_dec_run() with a few important differences.
+ * Only the differences are documented here.
+ *
+ * The only possible return values are XZ_OK, XZ_STREAM_END, and
+ * XZ_DATA_ERROR. This function cannot return XZ_BUF_ERROR: if no progress
+ * is possible due to lack of input data or output space, this function will
+ * keep returning XZ_OK. Thus, the calling code must be written so that it
+ * will eventually provide input and output space matching (or exceeding)
+ * comp_size and uncomp_size arguments given to xz_dec_microlzma_reset().
+ * If the caller cannot do this (for example, if the input file is truncated
+ * or otherwise corrupt), the caller must detect this error by itself to
+ * avoid an infinite loop.
+ *
+ * If the compressed data seems to be corrupt, XZ_DATA_ERROR is returned.
+ * This can happen also when incorrect dictionary, uncompressed, or
+ * compressed sizes have been specified.
+ *
+ * With XZ_PREALLOC only: As an extra feature, b->out may be NULL to skip over
+ * uncompressed data. This way the caller doesn't need to provide a temporary
+ * output buffer for the bytes that will be ignored.
+ *
+ * With XZ_SINGLE only: In contrast to xz_dec_run(), the return value XZ_OK
+ * is also possible and thus XZ_SINGLE is actually a limited multi-call mode.
+ * After XZ_OK the bytes decoded so far may be read from the output buffer.
+ * It is possible to continue decoding but the variables b->out and b->out_pos
+ * MUST NOT be changed by the caller. Increasing the value of b->out_size is
+ * allowed to make more output space available; one doesn't need to provide
+ * space for the whole uncompressed data on the first call. The input buffer
+ * may be changed normally like with XZ_PREALLOC. This way input data can be
+ * provided from non-contiguous memory.
+ */
+extern enum xz_ret xz_dec_microlzma_run(struct xz_dec_microlzma *s,
+ struct xz_buf *b);
+
+/**
+ * xz_dec_microlzma_end() - Free the memory allocated for the decoder state
+ * @s: Decoder state allocated using xz_dec_microlzma_alloc().
+ * If s is NULL, this function does nothing.
+ */
+extern void xz_dec_microlzma_end(struct xz_dec_microlzma *s);
+
+/*
* Standalone build (userspace build or in-kernel build for boot time use)
* needs a CRC32 implementation. For normal in-kernel use, kernel's own
* CRC32 module is used instead, and users of this module don't need to
diff --git a/modules/xz-embedded/src/xz_config.h b/modules/xz-embedded/src/xz_config.h
index eb9dac1a4b..ee590d7ea6 100644
--- a/modules/xz-embedded/src/xz_config.h
+++ b/modules/xz-embedded/src/xz_config.h
@@ -10,6 +10,9 @@
#ifndef XZ_CONFIG_H
#define XZ_CONFIG_H
+/* Uncomment to enable building of xz_dec_catrun(). */
+/* #define XZ_DEC_CONCATENATED */
+
/* Uncomment to enable CRC64 support. */
/* #define XZ_USE_CRC64 */
diff --git a/modules/xz-embedded/src/xz_crc32.c b/modules/xz-embedded/src/xz_crc32.c
index 34532d14fd..5627b00fca 100644
--- a/modules/xz-embedded/src/xz_crc32.c
+++ b/modules/xz-embedded/src/xz_crc32.c
@@ -2,7 +2,7 @@
* CRC32 using the polynomial from IEEE-802.3
*
* Authors: Lasse Collin <lasse.collin@tukaani.org>
- * Igor Pavlov <http://7-zip.org/>
+ * Igor Pavlov <https://7-zip.org/>
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
diff --git a/modules/xz-embedded/src/xz_crc64.c b/modules/xz-embedded/src/xz_crc64.c
index ca1caee899..60c40f67e7 100644
--- a/modules/xz-embedded/src/xz_crc64.c
+++ b/modules/xz-embedded/src/xz_crc64.c
@@ -4,7 +4,7 @@
* This file is similar to xz_crc32.c. See the comments there.
*
* Authors: Lasse Collin <lasse.collin@tukaani.org>
- * Igor Pavlov <http://7-zip.org/>
+ * Igor Pavlov <https://7-zip.org/>
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
@@ -20,7 +20,11 @@ STATIC_RW_DATA uint64_t xz_crc64_table[256];
XZ_EXTERN void xz_crc64_init(void)
{
- const uint64_t poly = 0xC96C5795D7870F42;
+ /*
+ * The ULL suffix is needed for -std=gnu89 compatibility
+ * on 32-bit platforms.
+ */
+ const uint64_t poly = 0xC96C5795D7870F42ULL;
uint32_t i;
uint32_t j;
diff --git a/modules/xz-embedded/src/xz_dec_bcj.c b/modules/xz-embedded/src/xz_dec_bcj.c
index a768e6d28b..ef449e97d1 100644
--- a/modules/xz-embedded/src/xz_dec_bcj.c
+++ b/modules/xz-embedded/src/xz_dec_bcj.c
@@ -2,7 +2,7 @@
* Branch/Call/Jump (BCJ) filter decoders
*
* Authors: Lasse Collin <lasse.collin@tukaani.org>
- * Igor Pavlov <http://7-zip.org/>
+ * Igor Pavlov <https://7-zip.org/>
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
@@ -422,7 +422,7 @@ XZ_EXTERN enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s,
/*
* Flush pending already filtered data to the output buffer. Return
- * immediatelly if we couldn't flush everything, or if the next
+ * immediately if we couldn't flush everything, or if the next
* filter in the chain had already returned XZ_STREAM_END.
*/
if (s->temp.filtered > 0) {
diff --git a/modules/xz-embedded/src/xz_dec_lzma2.c b/modules/xz-embedded/src/xz_dec_lzma2.c
index 08c3c80499..c929f1c82b 100644
--- a/modules/xz-embedded/src/xz_dec_lzma2.c
+++ b/modules/xz-embedded/src/xz_dec_lzma2.c
@@ -2,7 +2,7 @@
* LZMA2 decoder
*
* Authors: Lasse Collin <lasse.collin@tukaani.org>
- * Igor Pavlov <http://7-zip.org/>
+ * Igor Pavlov <https://7-zip.org/>
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
@@ -147,8 +147,8 @@ struct lzma_dec {
/*
* LZMA properties or related bit masks (number of literal
- * context bits, a mask dervied from the number of literal
- * position bits, and a mask dervied from the number
+ * context bits, a mask derived from the number of literal
+ * position bits, and a mask derived from the number
* position bits)
*/
uint32_t lc;
@@ -248,6 +248,10 @@ struct lzma2_dec {
* before the first LZMA chunk.
*/
bool need_props;
+
+#ifdef XZ_DEC_MICROLZMA
+ bool pedantic_microlzma;
+#endif
};
struct xz_dec_lzma2 {
@@ -387,7 +391,14 @@ static void dict_uncompressed(struct dictionary *dict, struct xz_buf *b,
*left -= copy_size;
- memcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size);
+ /*
+ * If doing in-place decompression in single-call mode and the
+ * uncompressed size of the file is larger than the caller
+ * thought (i.e. it is invalid input!), the buffers below may
+ * overlap and cause undefined behavior with memcpy().
+ * With valid inputs memcpy() would be fine here.
+ */
+ memmove(dict->buf + dict->pos, b->in + b->in_pos, copy_size);
dict->pos += copy_size;
if (dict->full < dict->pos)
@@ -397,7 +408,11 @@ static void dict_uncompressed(struct dictionary *dict, struct xz_buf *b,
if (dict->pos == dict->end)
dict->pos = 0;
- memcpy(b->out + b->out_pos, b->in + b->in_pos,
+ /*
+ * Like above but for multi-call mode: use memmove()
+ * to avoid undefined behavior with invalid input.
+ */
+ memmove(b->out + b->out_pos, b->in + b->in_pos,
copy_size);
}
@@ -408,6 +423,12 @@ static void dict_uncompressed(struct dictionary *dict, struct xz_buf *b,
}
}
+#ifdef XZ_DEC_MICROLZMA
+# define DICT_FLUSH_SUPPORTS_SKIPPING true
+#else
+# define DICT_FLUSH_SUPPORTS_SKIPPING false
+#endif
+
/*
* Flush pending data from dictionary to b->out. It is assumed that there is
* enough space in b->out. This is guaranteed because caller uses dict_limit()
@@ -421,8 +442,19 @@ static uint32_t dict_flush(struct dictionary *dict, struct xz_buf *b)
if (dict->pos == dict->end)
dict->pos = 0;
- memcpy(b->out + b->out_pos, dict->buf + dict->start,
- copy_size);
+ /*
+ * These buffers cannot overlap even if doing in-place
+ * decompression because in multi-call mode dict->buf
+ * has been allocated by us in this file; it's not
+ * provided by the caller like in single-call mode.
+ *
+ * With MicroLZMA, b->out can be NULL to skip bytes that
+ * the caller doesn't need. This cannot be done with XZ
+ * because it would break BCJ filters.
+ */
+ if (!DICT_FLUSH_SUPPORTS_SKIPPING || b->out != NULL)
+ memcpy(b->out + b->out_pos, dict->buf + dict->start,
+ copy_size);
}
dict->start = dict->pos;
@@ -484,11 +516,11 @@ static __always_inline void rc_normalize(struct rc_dec *rc)
}
/*
- * Decode one bit. In some versions, this function has been splitted in three
+ * Decode one bit. In some versions, this function has been split in three
* functions so that the compiler is supposed to be able to more easily avoid
* an extra branch. In this particular version of the LZMA decoder, this
* doesn't seem to be a good idea (tested with GCC 3.3.6, 3.4.6, and 4.3.3
- * on x86). Using a non-splitted version results in nicer looking code too.
+ * on x86). Using a non-split version results in nicer looking code too.
*
* NOTE: This must return an int. Do not make it return a bool or the speed
* of the code generated by GCC 3.x decreases 10-15 %. (GCC 4.3 doesn't care,
@@ -761,7 +793,7 @@ static bool lzma_main(struct xz_dec_lzma2 *s)
}
/*
- * Reset the LZMA decoder and range decoder state. Dictionary is nore reset
+ * Reset the LZMA decoder and range decoder state. Dictionary is not reset
* here, because LZMA state may be reset without resetting the dictionary.
*/
static void lzma_reset(struct xz_dec_lzma2 *s)
@@ -774,6 +806,7 @@ static void lzma_reset(struct xz_dec_lzma2 *s)
s->lzma.rep1 = 0;
s->lzma.rep2 = 0;
s->lzma.rep3 = 0;
+ s->lzma.len = 0;
/*
* All probabilities are initialized to the same value. This hack
@@ -1146,6 +1179,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_reset(struct xz_dec_lzma2 *s, uint8_t props)
if (DEC_IS_DYNALLOC(s->dict.mode)) {
if (s->dict.allocated < s->dict.size) {
+ s->dict.allocated = s->dict.size;
vfree(s->dict.buf);
s->dict.buf = vmalloc(s->dict.size);
if (s->dict.buf == NULL) {
@@ -1156,8 +1190,6 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_reset(struct xz_dec_lzma2 *s, uint8_t props)
}
}
- s->lzma.len = 0;
-
s->lzma2.sequence = SEQ_CONTROL;
s->lzma2.need_dict_reset = true;
@@ -1173,3 +1205,140 @@ XZ_EXTERN void xz_dec_lzma2_end(struct xz_dec_lzma2 *s)
kfree(s);
}
+
+#ifdef XZ_DEC_MICROLZMA
+/* This is a wrapper struct to have a nice struct name in the public API. */
+struct xz_dec_microlzma {
+ struct xz_dec_lzma2 s;
+};
+
+enum xz_ret xz_dec_microlzma_run(struct xz_dec_microlzma *s_ptr,
+ struct xz_buf *b)
+{
+ struct xz_dec_lzma2 *s = &s_ptr->s;
+
+ /*
+ * sequence is SEQ_PROPERTIES before the first input byte,
+ * SEQ_LZMA_PREPARE until a total of five bytes have been read,
+ * and SEQ_LZMA_RUN for the rest of the input stream.
+ */
+ if (s->lzma2.sequence != SEQ_LZMA_RUN) {
+ if (s->lzma2.sequence == SEQ_PROPERTIES) {
+ /* One byte is needed for the props. */
+ if (b->in_pos >= b->in_size)
+ return XZ_OK;
+
+ /*
+ * Don't increment b->in_pos here. The same byte is
+ * also passed to rc_read_init() which will ignore it.
+ */
+ if (!lzma_props(s, ~b->in[b->in_pos]))
+ return XZ_DATA_ERROR;
+
+ s->lzma2.sequence = SEQ_LZMA_PREPARE;
+ }
+
+ /*
+ * xz_dec_microlzma_reset() doesn't validate the compressed
+ * size so we do it here. We have to limit the maximum size
+ * to avoid integer overflows in lzma2_lzma(). 3 GiB is a nice
+ * round number and much more than users of this code should
+ * ever need.
+ */
+ if (s->lzma2.compressed < RC_INIT_BYTES
+ || s->lzma2.compressed > (3U << 30))
+ return XZ_DATA_ERROR;
+
+ if (!rc_read_init(&s->rc, b))
+ return XZ_OK;
+
+ s->lzma2.compressed -= RC_INIT_BYTES;
+ s->lzma2.sequence = SEQ_LZMA_RUN;
+
+ dict_reset(&s->dict, b);
+ }
+
+ /* This is to allow increasing b->out_size between calls. */
+ if (DEC_IS_SINGLE(s->dict.mode))
+ s->dict.end = b->out_size - b->out_pos;
+
+ while (true) {
+ dict_limit(&s->dict, min_t(size_t, b->out_size - b->out_pos,
+ s->lzma2.uncompressed));
+
+ if (!lzma2_lzma(s, b))
+ return XZ_DATA_ERROR;
+
+ s->lzma2.uncompressed -= dict_flush(&s->dict, b);
+
+ if (s->lzma2.uncompressed == 0) {
+ if (s->lzma2.pedantic_microlzma) {
+ if (s->lzma2.compressed > 0 || s->lzma.len > 0
+ || !rc_is_finished(&s->rc))
+ return XZ_DATA_ERROR;
+ }
+
+ return XZ_STREAM_END;
+ }
+
+ if (b->out_pos == b->out_size)
+ return XZ_OK;
+
+ if (b->in_pos == b->in_size
+ && s->temp.size < s->lzma2.compressed)
+ return XZ_OK;
+ }
+}
+
+struct xz_dec_microlzma *xz_dec_microlzma_alloc(enum xz_mode mode,
+ uint32_t dict_size)
+{
+ struct xz_dec_microlzma *s;
+
+ /* Restrict dict_size to the same range as in the LZMA2 code. */
+ if (dict_size < 4096 || dict_size > (3U << 30))
+ return NULL;
+
+ s = kmalloc(sizeof(*s), GFP_KERNEL);
+ if (s == NULL)
+ return NULL;
+
+ s->s.dict.mode = mode;
+ s->s.dict.size = dict_size;
+
+ if (DEC_IS_MULTI(mode)) {
+ s->s.dict.end = dict_size;
+
+ s->s.dict.buf = vmalloc(dict_size);
+ if (s->s.dict.buf == NULL) {
+ kfree(s);
+ return NULL;
+ }
+ }
+
+ return s;
+}
+
+void xz_dec_microlzma_reset(struct xz_dec_microlzma *s, uint32_t comp_size,
+ uint32_t uncomp_size, int uncomp_size_is_exact)
+{
+ /*
+ * comp_size is validated in xz_dec_microlzma_run().
+ * uncomp_size can safely be anything.
+ */
+ s->s.lzma2.compressed = comp_size;
+ s->s.lzma2.uncompressed = uncomp_size;
+ s->s.lzma2.pedantic_microlzma = uncomp_size_is_exact;
+
+ s->s.lzma2.sequence = SEQ_PROPERTIES;
+ s->s.temp.size = 0;
+}
+
+void xz_dec_microlzma_end(struct xz_dec_microlzma *s)
+{
+ if (DEC_IS_MULTI(s->s.dict.mode))
+ vfree(s->s.dict.buf);
+
+ kfree(s);
+}
+#endif
diff --git a/modules/xz-embedded/src/xz_dec_stream.c b/modules/xz-embedded/src/xz_dec_stream.c
index d6525506a1..2c41f5f1b0 100644
--- a/modules/xz-embedded/src/xz_dec_stream.c
+++ b/modules/xz-embedded/src/xz_dec_stream.c
@@ -35,7 +35,8 @@ struct xz_dec {
SEQ_INDEX,
SEQ_INDEX_PADDING,
SEQ_INDEX_CRC32,
- SEQ_STREAM_FOOTER
+ SEQ_STREAM_FOOTER,
+ SEQ_STREAM_PADDING
} sequence;
/* Position in variable-length integers and Check fields */
@@ -423,12 +424,12 @@ static enum xz_ret dec_stream_header(struct xz_dec *s)
* check types too, but then the check won't be verified and
* a warning (XZ_UNSUPPORTED_CHECK) will be given.
*/
+ if (s->temp.buf[HEADER_MAGIC_SIZE + 1] > XZ_CHECK_MAX)
+ return XZ_OPTIONS_ERROR;
+
s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1];
#ifdef XZ_DEC_ANY_CHECK
- if (s->check_type > XZ_CHECK_MAX)
- return XZ_OPTIONS_ERROR;
-
if (s->check_type > XZ_CHECK_CRC32 && !IS_CRC64(s->check_type))
return XZ_UNSUPPORTED_CHECK;
#else
@@ -604,6 +605,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
if (ret != XZ_OK)
return ret;
+ /* Fall through */
+
case SEQ_BLOCK_START:
/* We need one byte of input to continue. */
if (b->in_pos == b->in_size)
@@ -627,6 +630,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.pos = 0;
s->sequence = SEQ_BLOCK_HEADER;
+ /* Fall through */
+
case SEQ_BLOCK_HEADER:
if (!fill_temp(s, b))
return XZ_OK;
@@ -637,6 +642,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_UNCOMPRESS;
+ /* Fall through */
+
case SEQ_BLOCK_UNCOMPRESS:
ret = dec_block(s, b);
if (ret != XZ_STREAM_END)
@@ -644,6 +651,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_PADDING;
+ /* Fall through */
+
case SEQ_BLOCK_PADDING:
/*
* Size of Compressed Data + Block Padding
@@ -664,6 +673,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_CHECK;
+ /* Fall through */
+
case SEQ_BLOCK_CHECK:
if (s->check_type == XZ_CHECK_CRC32) {
ret = crc_validate(s, b, 32);
@@ -691,6 +702,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_INDEX_PADDING;
+ /* Fall through */
+
case SEQ_INDEX_PADDING:
while ((s->index.size + (b->in_pos - s->in_start))
& 3) {
@@ -713,6 +726,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_INDEX_CRC32;
+ /* Fall through */
+
case SEQ_INDEX_CRC32:
ret = crc_validate(s, b, 32);
if (ret != XZ_STREAM_END)
@@ -721,11 +736,17 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.size = STREAM_HEADER_SIZE;
s->sequence = SEQ_STREAM_FOOTER;
+ /* Fall through */
+
case SEQ_STREAM_FOOTER:
if (!fill_temp(s, b))
return XZ_OK;
return dec_stream_footer(s);
+
+ case SEQ_STREAM_PADDING:
+ /* Never reached, only silencing a warning */
+ break;
}
}
@@ -793,6 +814,79 @@ XZ_EXTERN enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b)
return ret;
}
+#ifdef XZ_DEC_CONCATENATED
+XZ_EXTERN enum xz_ret xz_dec_catrun(struct xz_dec *s, struct xz_buf *b,
+ int finish)
+{
+ enum xz_ret ret;
+
+ if (DEC_IS_SINGLE(s->mode)) {
+ xz_dec_reset(s);
+ finish = true;
+ }
+
+ while (true) {
+ if (s->sequence == SEQ_STREAM_PADDING) {
+ /*
+ * Skip Stream Padding. Its size must be a multiple
+ * of four bytes which is tracked with s->pos.
+ */
+ while (true) {
+ if (b->in_pos == b->in_size) {
+ /*
+ * Note that if we are repeatedly
+ * given no input and finish is false,
+ * we will keep returning XZ_OK even
+ * though no progress is being made.
+ * The lack of XZ_BUF_ERROR support
+ * isn't a problem here because a
+ * reasonable caller will eventually
+ * provide more input or set finish
+ * to true.
+ */
+ if (!finish)
+ return XZ_OK;
+
+ if (s->pos != 0)
+ return XZ_DATA_ERROR;
+
+ return XZ_STREAM_END;
+ }
+
+ if (b->in[b->in_pos] != 0x00) {
+ if (s->pos != 0)
+ return XZ_DATA_ERROR;
+
+ break;
+ }
+
+ ++b->in_pos;
+ s->pos = (s->pos + 1) & 3;
+ }
+
+ /*
+ * More input remains. It should be a new Stream.
+ *
+ * In single-call mode xz_dec_run() will always call
+ * xz_dec_reset(). Thus, we need to do it here only
+ * in multi-call mode.
+ */
+ if (DEC_IS_MULTI(s->mode))
+ xz_dec_reset(s);
+ }
+
+ ret = xz_dec_run(s, b);
+
+ if (ret != XZ_STREAM_END)
+ break;
+
+ s->sequence = SEQ_STREAM_PADDING;
+ }
+
+ return ret;
+}
+#endif
+
XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max)
{
struct xz_dec *s = kmalloc(sizeof(*s), GFP_KERNEL);
diff --git a/modules/xz-embedded/src/xz_lzma2.h b/modules/xz-embedded/src/xz_lzma2.h
index 071d67bee9..92d852d4f8 100644
--- a/modules/xz-embedded/src/xz_lzma2.h
+++ b/modules/xz-embedded/src/xz_lzma2.h
@@ -2,7 +2,7 @@
* LZMA2 definitions
*
* Authors: Lasse Collin <lasse.collin@tukaani.org>
- * Igor Pavlov <http://7-zip.org/>
+ * Igor Pavlov <https://7-zip.org/>
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
diff --git a/modules/xz-embedded/src/xz_private.h b/modules/xz-embedded/src/xz_private.h
index 482b90f363..d9fd49b45f 100644
--- a/modules/xz-embedded/src/xz_private.h
+++ b/modules/xz-embedded/src/xz_private.h
@@ -37,6 +37,9 @@
# ifdef CONFIG_XZ_DEC_SPARC
# define XZ_DEC_SPARC
# endif
+# ifdef CONFIG_XZ_DEC_MICROLZMA
+# define XZ_DEC_MICROLZMA
+# endif
# define memeq(a, b, size) (memcmp(a, b, size) == 0)
# define memzero(buf, size) memset(buf, 0, size)
# endif
diff --git a/modules/xz-embedded/src/xz_stream.h b/modules/xz-embedded/src/xz_stream.h
index 66cb5a7055..430bb3a0d1 100644
--- a/modules/xz-embedded/src/xz_stream.h
+++ b/modules/xz-embedded/src/xz_stream.h
@@ -19,7 +19,7 @@
/*
* See the .xz file format specification at
- * http://tukaani.org/xz/xz-file-format.txt
+ * https://tukaani.org/xz/xz-file-format.txt
* to understand the container format.
*/
diff --git a/modules/xz-embedded/update.sh b/modules/xz-embedded/update.sh
index ecc1e3610e..37280bba12 100755
--- a/modules/xz-embedded/update.sh
+++ b/modules/xz-embedded/update.sh
@@ -4,11 +4,12 @@
MY_TEMP_DIR=$(mktemp -d -t xz-embedded_update.XXXXXX) || exit 1
-git clone http://git.tukaani.org/xz-embedded.git ${MY_TEMP_DIR}/xz-embedded
+git clone https://git.tukaani.org/xz-embedded.git ${MY_TEMP_DIR}/xz-embedded
COMMIT=$(git -C ${MY_TEMP_DIR}/xz-embedded rev-parse HEAD)
cd $(dirname $0)
-perl -p -i -e "s/\[commit [0-9a-f]{40}\]/[${COMMIT}]/" README.mozilla;
+perl -p -i -e "s/\[[0-9a-f]{40}\]/[${COMMIT}]/" README.mozilla;
+rm -f README.mozilla.bak;
rm -rf src
mkdir src
@@ -23,7 +24,6 @@ mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_bcj.c src/
mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_stream.c src/
mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_lzma2.c src/
rm -rf ${MY_TEMP_DIR}
-hg addremove src
echo "###"
echo "### Updated xz-embedded/src to $COMMIT."
diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
index e299fca18a..a2983b48c2 100644
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1086,8 +1086,14 @@ class L10n_Package(MachCommandBase):
@Command('langpack', category='post-build',
description='Build and package l10n as a language pack.')
- def l10n_package(self):
- return self._run_make(directory=".", target='l10n-package', ensure_exit_code=False)
+ @CommandArgument('-v', '--verbose', action='store_true',
+ help='Verbose output for what commands the packaging process is running.')
+ def l10n_package(self, verbose=False):
+ ret = self._run_make(directory=".", target='l10n-package',
+ silent=not verbose, ensure_exit_code=False)
+ if ret == 0:
+ self.notify('Packaging complete')
+ return ret
@CommandProvider
class Package(MachCommandBase):
diff --git a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
index 098896d99e..9ec6eaa12d 100644
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
@@ -207,6 +207,9 @@
<!ENTITY addon.loadingReleaseNotes.label "Loading…">
<!ENTITY addon.errorLoadingReleaseNotes.label "Sorry, but there was an error loading the release notes.">
+<!ENTITY addon.nativeAddon "This add-on directly targets &brandFullName;">
+<!ENTITY addon.compatAddon "This add-on targets Mozilla Firefox and runs in compatibility mode">
+
<!ENTITY addon.createdBy.label "By ">
<!ENTITY eula.title "End-User License Agreement">
diff --git a/toolkit/mozapps/extensions/content/extensions.css b/toolkit/mozapps/extensions/content/extensions.css
index 51828d544c..41c1405657 100644
--- a/toolkit/mozapps/extensions/content/extensions.css
+++ b/toolkit/mozapps/extensions/content/extensions.css
@@ -152,6 +152,8 @@ setting[type="menulist"] {
.addon:not([notification="info"]) .info,
.addon:not([pending]) .pending,
.addon:not([upgrade="true"]) .update-postfix,
+.addon:not([native="true"]) .nativeAddon,
+.addon:not([native="false"]) .compatAddon,
.addon[active="true"] .disabled-postfix,
.addon[pending="install"] .update-postfix,
.addon[pending="install"] .disabled-postfix,
@@ -264,6 +266,21 @@ richlistitem:not([selected]) * {
display: none;
}
+/* Indicator style for extension target application */
+.addon[native] .nativeIndicator {
+ margin-left: 5pt;
+ padding-bottom: 1pt;
+}
+.addon[native][active="false"] .nativeIndicator {
+ opacity: 0.4;
+}
+.addon[native] .nativeAddon {
+ color: #3366FF;
+}
+.addon[native] .compatAddon {
+ color: #FF6600;
+}
+
/* Translators for Language Pack details */
.translators > label {
-moz-margin-start: 0px;
diff --git a/toolkit/mozapps/extensions/content/extensions.xml b/toolkit/mozapps/extensions/content/extensions.xml
index a3246e2206..28feb19698 100644
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -857,6 +857,10 @@
<xul:label anonid="name" class="name" crop="end" flex="1"
xbl:inherits="value=name,tooltiptext=name"/>
<xul:label anonid="version" class="version"/>
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ <xul:label class="nativeIndicator nativeAddon" value="●" tooltiptext="&addon.nativeAddon;"/>
+ <xul:label class="nativeIndicator compatAddon" value="●" tooltiptext="&addon.compatAddon;"/>
+#endif
<xul:label class="disabled-postfix" value="&addon.disabled.postfix;"/>
<xul:label class="update-postfix" value="&addon.update.postfix;"/>
<xul:spacer flex="5000"/> <!-- Necessary to make the name crop -->
@@ -1352,6 +1356,10 @@
[this.mAddon.name], 1);
} else {
this.removeAttribute("notification");
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ if (this.mAddon.type == "extension")
+ this.setAttribute("native", this.mAddon.native);
+#endif
}
}
diff --git a/toolkit/mozapps/extensions/internal/AddonRepository.jsm b/toolkit/mozapps/extensions/internal/AddonRepository.jsm
index 41fb5c06d0..9750e99445 100644
--- a/toolkit/mozapps/extensions/internal/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm
@@ -64,6 +64,9 @@ const BLANK_DB = function() {
}
const TOOLKIT_ID = "toolkit@mozilla.org";
+#ifdef MOZ_PHOENIX_EXTENSIONS
+const FIREFOX_ID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
+#endif
Cu.import("resource://gre/modules/Log.jsm");
const LOGGER_ID = "addons.repository";
@@ -1251,7 +1254,12 @@ this.AddonRepository = {
let results = [];
function isSameApplication(aAppNode) {
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ if (self._getTextContent(aAppNode) == Services.appinfo.ID ||
+ self._getTextContent(aAppNode) == FIREFOX_ID) {
+#else
if (self._getTextContent(aAppNode) == Services.appinfo.ID) {
+#endif
return true;
}
return false;
diff --git a/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
index 4fce84095c..a475f7f1fa 100644
--- a/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
@@ -25,6 +25,7 @@ const XMLURI_PARSE_ERROR = "http://www.mozilla.org/newlayout/xml/pa
const TOOLKIT_ID = "toolkit@mozilla.org";
const FIREFOX_ID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
+const FIREFOX_APPCOMPATVERSION = "56.9"
const PREF_UPDATE_REQUIREBUILTINCERTS = "extensions.update.requireBuiltInCerts";
const PREF_EM_MIN_COMPAT_APP_VERSION = "extensions.minCompatibleAppVersion";
@@ -522,6 +523,18 @@ function parseJSONManifest(aId, aUpdateKey, aRequest, aManifestData) {
maxVersion: getRequiredProperty(app, "max_version", "string"),
}
}
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ else if (FIREFOX_ID in applications) {
+ logger.debug("update.json: Dual-GUID targetApplication");
+ app = getProperty(applications, FIREFOX_ID, "object");
+
+ appEntry = {
+ id: FIREFOX_ID,
+ minVersion: getRequiredProperty(app, "min_version", "string"),
+ maxVersion: getRequiredProperty(app, "max_version", "string"),
+ }
+ }
+#endif
else if (TOOLKIT_ID in applications) {
logger.debug("update.json: Toolkit targetApplication");
app = getProperty(applications, TOOLKIT_ID, "object");
@@ -545,7 +558,11 @@ function parseJSONManifest(aId, aUpdateKey, aRequest, aManifestData) {
id: TOOLKIT_ID,
minVersion: platformVersion,
#endif
+#if defined(MOZ_PHOENIX) && defined(MOZ_PHOENIX_EXTENSIONS)
+ maxVersion: FIREFOX_APPCOMPATVERSION,
+#else
maxVersion: '*',
+#endif
};
}
else {
@@ -808,6 +825,12 @@ function matchesVersions(aUpdate, aAppVersion, aPlatformVersion,
return (Services.vc.compare(aAppVersion, app.minVersion) >= 0) &&
(aIgnoreMaxVersion || (Services.vc.compare(aAppVersion, app.maxVersion) <= 0));
}
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ if (app.id == FIREFOX_ID) {
+ return (Services.vc.compare(aAppVersion, app.minVersion) >= 0) &&
+ (aIgnoreMaxVersion || (Services.vc.compare(aAppVersion, app.maxVersion) <= 0));
+ }
+#endif
if (app.id == TOOLKIT_ID) {
result = (Services.vc.compare(aPlatformVersion, app.minVersion) >= 0) &&
(aIgnoreMaxVersion || (Services.vc.compare(aPlatformVersion, app.maxVersion) <= 0));
@@ -865,7 +888,12 @@ this.AddonUpdateChecker = {
if (aIgnoreCompatibility) {
for (let targetApp of update.targetApplications) {
let id = targetApp.id;
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ if (id == Services.appinfo.ID || id == FIREFOX_ID ||
+ id == TOOLKIT_ID)
+#else
if (id == Services.appinfo.ID || id == TOOLKIT_ID)
+#endif
return update;
}
}
diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
index eb4e54720a..3bcb4275eb 100644
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -134,6 +134,10 @@ const RDFURI_INSTALL_MANIFEST_ROOT = "urn:mozilla:install-manifest";
const PREFIX_NS_EM = "http://www.mozilla.org/2004/em-rdf#";
const TOOLKIT_ID = "toolkit@mozilla.org";
+#ifdef MOZ_PHOENIX_EXTENSIONS
+const FIREFOX_ID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
+const FIREFOX_APPCOMPATVERSION = "56.9"
+#endif
// The value for this is in Makefile.in
#expand const DB_SCHEMA = __MOZ_EXTENSIONS_DB_SCHEMA__;
@@ -6402,11 +6406,27 @@ AddonInternal.prototype = {
if (!aPlatformVersion)
aPlatformVersion = Services.appinfo.platformVersion;
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ this.native = false;
+#endif
+
let version;
if (app.id == Services.appinfo.ID) {
version = aAppVersion;
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ this.native = true;
+ }
+ else if (app.id == FIREFOX_ID) {
+ version = FIREFOX_APPCOMPATVERSION;
+ if (this.type != "extension")
+ //Only allow extensions in Firefox compatibility mode
+ return false;
+#endif
}
else if (app.id == TOOLKIT_ID) {
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ this.native = true;
+#endif
version = aPlatformVersion;
}
@@ -6429,7 +6449,11 @@ AddonInternal.prototype = {
// Extremely old extensions should not be compatible by default.
let minCompatVersion;
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ if (app.id == Services.appinfo.ID || app.id == FIREFOX_ID)
+#else
if (app.id == Services.appinfo.ID)
+#endif
minCompatVersion = XPIProvider.minCompatibleAppVersion;
else if (app.id == TOOLKIT_ID)
minCompatVersion = XPIProvider.minCompatiblePlatformVersion;
@@ -6453,6 +6477,18 @@ AddonInternal.prototype = {
if (targetApp.id == TOOLKIT_ID)
app = targetApp;
}
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ // Special case: check for Firefox TargetApps. this has to be done AFTER
+ // the initial check to make sure appinfo.ID is preferred, even if
+ // Firefox is listed before it in the install manifest.
+ // Only do this for extensions. Other types should not be allowed.
+ if (this.type == "extension") {
+ for (let targetApp of this.targetApplications) {
+ if (targetApp.id == FIREFOX_ID) //Firefox GUID
+ return targetApp;
+ }
+ }
+#endif
// Return toolkit ID if toolkit.
return app;
},
diff --git a/toolkit/mozapps/extensions/internal/XPIProviderUtils.js b/toolkit/mozapps/extensions/internal/XPIProviderUtils.js
index 9f3273b1a5..512479d762 100644
--- a/toolkit/mozapps/extensions/internal/XPIProviderUtils.js
+++ b/toolkit/mozapps/extensions/internal/XPIProviderUtils.js
@@ -71,6 +71,9 @@ const PROP_JSON_FIELDS = ["id", "syncGUID", "location", "version", "type",
"softDisabled", "foreignInstall", "hasBinaryComponents",
"strictCompatibility", "locales", "targetApplications",
"targetPlatforms", "multiprocessCompatible",
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ "native"
+#endif
];
// Time to wait before async save of XPI JSON database, in milliseconds
diff --git a/toolkit/mozapps/extensions/internal/moz.build b/toolkit/mozapps/extensions/internal/moz.build
index 86cbbe82c5..3b967e0c6f 100644
--- a/toolkit/mozapps/extensions/internal/moz.build
+++ b/toolkit/mozapps/extensions/internal/moz.build
@@ -5,7 +5,6 @@
EXTRA_JS_MODULES.addons += [
'AddonLogging.jsm',
- 'AddonRepository.jsm',
'AddonRepository_SQLiteMigrator.jsm',
'Content.js',
'GMPProvider.jsm',
@@ -16,6 +15,7 @@ EXTRA_JS_MODULES.addons += [
]
EXTRA_PP_JS_MODULES.addons += [
+ 'AddonRepository.jsm',
'AddonUpdateChecker.jsm',
'XPIProvider.jsm',
'XPIProviderUtils.js',
@@ -28,3 +28,7 @@ DEFINES['MOZ_EXTENSIONS_DB_SCHEMA'] = 16
# Additional debugging info is exposed in debug builds
if CONFIG['MOZ_EM_DEBUG']:
DEFINES['MOZ_EM_DEBUG'] = 1
+
+# Apperently this needs to be defined because it isn't picked up automagically any more
+if CONFIG['MOZ_PHOENIX_EXTENSIONS']:
+ DEFINES['MOZ_PHOENIX_EXTENSIONS'] = 1 \ No newline at end of file
diff --git a/toolkit/themes/linux/mozapps/extensions/extensions.css b/toolkit/themes/linux/mozapps/extensions/extensions.css
index b21a655203..5c642fbbf1 100644
--- a/toolkit/themes/linux/mozapps/extensions/extensions.css
+++ b/toolkit/themes/linux/mozapps/extensions/extensions.css
@@ -517,13 +517,6 @@
background-repeat: repeat-x;
}
-.addon-view[notification="warning"][native="false"] {
- background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"),
- linear-gradient(rgba(255, 128, 0, 0.04),
- rgba(255, 128, 0, 0));
- background-repeat: repeat-x;
-}
-
.addon-view[notification="error"] {
background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"),
linear-gradient(rgba(255, 0, 0, 0.04),
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png
deleted file mode 100644
index dee75516b7..0000000000
--- a/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-error.png b/toolkit/themes/linux/mozapps/extensions/stripes-error.png
deleted file mode 100644
index 1dc2d8504c..0000000000
--- a/toolkit/themes/linux/mozapps/extensions/stripes-error.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png b/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png
deleted file mode 100644
index 901ab1ec29..0000000000
--- a/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png b/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png
deleted file mode 100644
index 370ceec0f2..0000000000
--- a/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-warning.png b/toolkit/themes/linux/mozapps/extensions/stripes-warning.png
deleted file mode 100644
index 69463fb1af..0000000000
--- a/toolkit/themes/linux/mozapps/extensions/stripes-warning.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/jar.mn b/toolkit/themes/linux/mozapps/jar.mn
index 27b6473084..0931d1823d 100644
--- a/toolkit/themes/linux/mozapps/jar.mn
+++ b/toolkit/themes/linux/mozapps/jar.mn
@@ -26,11 +26,6 @@ toolkit.jar:
skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png)
skin/classic/mozapps/extensions/themeGeneric-16.png (extensions/themeGeneric-16.png)
skin/classic/mozapps/extensions/localeGeneric.png (extensions/localeGeneric.png)
- skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png)
- skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png)
- skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png)
- skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png)
- skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png)
skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css)
skin/classic/mozapps/extensions/selectAddons.css (extensions/selectAddons.css)
skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png)
diff --git a/toolkit/themes/windows/mozapps/extensions/extensions.css b/toolkit/themes/windows/mozapps/extensions/extensions.css
index 96ea1b46ce..f350f7ca64 100644
--- a/toolkit/themes/windows/mozapps/extensions/extensions.css
+++ b/toolkit/themes/windows/mozapps/extensions/extensions.css
@@ -648,13 +648,6 @@
background-repeat: repeat-x;
}
-.addon-view[notification="warning"][native="false"] {
- background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"),
- linear-gradient(rgba(255, 128, 0, 0.04),
- rgba(255, 128, 0, 0));
- background-repeat: repeat-x;
-}
-
.addon-view[notification="error"] {
background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"),
linear-gradient(rgba(255, 0, 0, 0.04),
diff --git a/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png
deleted file mode 100644
index dee75516b7..0000000000
--- a/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/jar.mn b/toolkit/themes/windows/mozapps/jar.mn
index 5ca886051c..9f7562995f 100644
--- a/toolkit/themes/windows/mozapps/jar.mn
+++ b/toolkit/themes/windows/mozapps/jar.mn
@@ -39,7 +39,6 @@ toolkit.jar:
skin/classic/mozapps/extensions/heart.png (extensions/heart.png)
skin/classic/mozapps/extensions/navigation.png (extensions/navigation.png)
skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png)
- skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png)
skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png)
skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png)
skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png)
diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp
index 02a555f04c..dc7d200041 100644
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -384,6 +384,9 @@ static const nsDefaultMimeTypeEntry defaultMimeEntries[] =
{ "application/xhtml+xml", "xhtml" },
{ "application/xhtml+xml", "xht" },
{ TEXT_PLAIN, "txt" },
+ { APPLICATION_JSON, "json"},
+ { APPLICATION_XJAVASCRIPT, "js"},
+ { APPLICATION_XJAVASCRIPT, "jsm"},
{ VIDEO_OGG, "ogv" },
{ VIDEO_OGG, "ogg" },
{ APPLICATION_OGG, "ogg" },