diff options
-rw-r--r-- | application/basilisk/locales/en-US/chrome/browser-region/region.properties | 7 | ||||
-rw-r--r-- | application/palemoon/locales/en-US/chrome/browser-region/region.properties | 24 | ||||
-rw-r--r-- | dom/indexedDB/ActorsParent.cpp | 46 | ||||
-rw-r--r-- | dom/media/AudioConverter.cpp | 108 | ||||
-rw-r--r-- | embedding/components/find/nsFind.cpp | 5 | ||||
-rw-r--r-- | js/src/jit/arm/Assembler-arm.cpp | 7 | ||||
-rw-r--r-- | js/src/jit/arm/MacroAssembler-arm.cpp | 5 | ||||
-rw-r--r-- | media/libpng/png.c | 3 | ||||
-rw-r--r-- | parser/html/nsHtml5Portability.cpp | 2 | ||||
-rw-r--r-- | xpcom/base/nsCycleCollector.cpp | 5 | ||||
-rw-r--r-- | xpcom/ds/nsAtomTable.cpp | 8 | ||||
-rw-r--r-- | xpcom/ds/nsIAtom.idl | 10 |
12 files changed, 131 insertions, 99 deletions
diff --git a/application/basilisk/locales/en-US/chrome/browser-region/region.properties b/application/basilisk/locales/en-US/chrome/browser-region/region.properties index e35fc7497..8782ae46f 100644 --- a/application/basilisk/locales/en-US/chrome/browser-region/region.properties +++ b/application/basilisk/locales/en-US/chrome/browser-region/region.properties @@ -9,6 +9,7 @@ browser.search.defaultenginename=DuckDuckGo browser.search.order.1=DuckDuckGo browser.search.order.2=Yahoo browser.search.order.3=Bing +browser.search.order.4=Ecosia # This is the default set of web based feed handlers shown in the reader # selection UI @@ -20,11 +21,7 @@ browser.contentHandlers.types.0.uri=https://add.my.yahoo.com/rss?url=%s # profile database. Note that "new" is defined as "has a different URL"; this # means that it's not possible to update the name of existing handler, so # don't make any spelling errors here. -gecko.handlerService.defaultHandlersVersion=4 - -# The default set of protocol handlers for webcal: -gecko.handlerService.schemes.webcal.0.name=30 Boxes -gecko.handlerService.schemes.webcal.0.uriTemplate=https://30boxes.com/external/widget?refer=ff&url=%s +gecko.handlerService.defaultHandlersVersion=5 # The default set of protocol handlers for mailto: gecko.handlerService.schemes.mailto.0.name=Yahoo! Mail diff --git a/application/palemoon/locales/en-US/chrome/browser-region/region.properties b/application/palemoon/locales/en-US/chrome/browser-region/region.properties index ad6c1342f..8782ae46f 100644 --- a/application/palemoon/locales/en-US/chrome/browser-region/region.properties +++ b/application/palemoon/locales/en-US/chrome/browser-region/region.properties @@ -14,29 +14,25 @@ browser.search.order.4=Ecosia # This is the default set of web based feed handlers shown in the reader # selection UI browser.contentHandlers.types.0.title=My Yahoo! -browser.contentHandlers.types.0.uri=http://add.my.yahoo.com/rss?url=%s +browser.contentHandlers.types.0.uri=https://add.my.yahoo.com/rss?url=%s # increment this number when anything gets changed in the list below. This will # cause Firefox to re-read these prefs and inject any new handlers into the # profile database. Note that "new" is defined as "has a different URL"; this # means that it's not possible to update the name of existing handler, so # don't make any spelling errors here. -goanna.handlerService.defaultHandlersVersion=3 - -# The default set of protocol handlers for webcal: -goanna.handlerService.schemes.webcal.0.name=30 Boxes -goanna.handlerService.schemes.webcal.0.uriTemplate=http://30boxes.com/external/widget?refer=ff&url=%s +gecko.handlerService.defaultHandlersVersion=5 # The default set of protocol handlers for mailto: -goanna.handlerService.schemes.mailto.0.name=Yahoo! Mail -goanna.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s -goanna.handlerService.schemes.mailto.1.name=Gmail -goanna.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s +gecko.handlerService.schemes.mailto.0.name=Yahoo! Mail +gecko.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s +gecko.handlerService.schemes.mailto.1.name=Gmail +gecko.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s # The default set of protocol handlers for irc: -goanna.handlerService.schemes.irc.0.name=Mibbit -goanna.handlerService.schemes.irc.0.uriTemplate=https://www.mibbit.com/?url=%s +gecko.handlerService.schemes.irc.0.name=Mibbit +gecko.handlerService.schemes.irc.0.uriTemplate=https://www.mibbit.com/?url=%s # The default set of protocol handlers for ircs: -goanna.handlerService.schemes.ircs.0.name=Mibbit -goanna.handlerService.schemes.ircs.0.uriTemplate=https://www.mibbit.com/?url=%s +gecko.handlerService.schemes.ircs.0.name=Mibbit +gecko.handlerService.schemes.ircs.0.uriTemplate=https://www.mibbit.com/?url=%s diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 38621cee3..cd998c31c 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -23717,32 +23717,38 @@ TransactionDatabaseOperationBase::SendPreprocessInfoOrResults( MOZ_ASSERT(mTransaction); if (NS_WARN_IF(IsActorDestroyed())) { - // Don't send any notifications if the actor was destroyed already. + // Normally we wouldn't need to send any notifications if the actor was + // already destroyed, but this can be a VersionChangeOp which needs to + // notify its parent operation (OpenDatabaseOp) about the failure. + // So SendFailureResult needs to be called even when the actor was + // destroyed. Normal operations redundantly check if the actor was + // destroyed in SendSuccessResult and SendFailureResult, therefore it's + // ok to call it in all cases here. if (NS_SUCCEEDED(mResultCode)) { IDB_REPORT_INTERNAL_ERR(); mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; } - } else { - if (mTransaction->IsInvalidated() || mTransaction->IsAborted()) { - // Aborted transactions always see their requests fail with ABORT_ERR, - // even if the request succeeded or failed with another error. - mResultCode = NS_ERROR_DOM_INDEXEDDB_ABORT_ERR; - } else if (NS_SUCCEEDED(mResultCode)) { - if (aSendPreprocessInfo) { - // This should not release the IPDL reference. - mResultCode = SendPreprocessInfo(); - } else { - // This may release the IPDL reference. - mResultCode = SendSuccessResult(); - } + } else if (mTransaction->IsInvalidated() || mTransaction->IsAborted()) { + // Aborted transactions always see their requests fail with ABORT_ERR, + // even if the request succeeded or failed with another error. + mResultCode = NS_ERROR_DOM_INDEXEDDB_ABORT_ERR; + } + + if (NS_SUCCEEDED(mResultCode)) { + if (aSendPreprocessInfo) { + // This should not release the IPDL reference. + mResultCode = SendPreprocessInfo(); + } else { + // This may release the IPDL reference. + mResultCode = SendSuccessResult(); } + } - if (NS_FAILED(mResultCode)) { - // This should definitely release the IPDL reference. - if (!SendFailureResult(mResultCode)) { - // Abort the transaction. - mTransaction->Abort(mResultCode, /* aForce */ false); - } + if (NS_FAILED(mResultCode)) { + // This should definitely release the IPDL reference. + if (!SendFailureResult(mResultCode)) { + // Abort the transaction. + mTransaction->Abort(mResultCode, /* aForce */ false); } } diff --git a/dom/media/AudioConverter.cpp b/dom/media/AudioConverter.cpp index 25b981f43..002e79108 100644 --- a/dom/media/AudioConverter.cpp +++ b/dom/media/AudioConverter.cpp @@ -5,8 +5,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "AudioConverter.h" -#include <string.h> #include <speex/speex_resampler.h> +#include <string.h> #include <cmath> /* @@ -140,24 +140,28 @@ static inline int16_t clipTo15(int32_t aX) size_t AudioConverter::DownmixAudio(void* aOut, const void* aIn, size_t aFrames) const { - MOZ_ASSERT(mIn.Format() == AudioConfig::FORMAT_S16 || - mIn.Format() == AudioConfig::FORMAT_FLT); - MOZ_ASSERT(mIn.Channels() >= mOut.Channels()); - MOZ_ASSERT(mIn.Layout() == AudioConfig::ChannelLayout(mIn.Channels()), - "Can only downmix input data in SMPTE layout"); - MOZ_ASSERT(mOut.Layout() == AudioConfig::ChannelLayout(2) || - mOut.Layout() == AudioConfig::ChannelLayout(1)); + MOZ_DIAGNOSTIC_ASSERT(mIn.Format() == AudioConfig::FORMAT_S16 || + mIn.Format() == AudioConfig::FORMAT_FLT); + MOZ_DIAGNOSTIC_ASSERT(mIn.Channels() >= mOut.Channels()); + MOZ_DIAGNOSTIC_ASSERT( + mIn.Layout() == AudioConfig::ChannelLayout(mIn.Channels()), + "Can only downmix input data in SMPTE layout"); + MOZ_DIAGNOSTIC_ASSERT(mOut.Layout() == AudioConfig::ChannelLayout(2) || + mOut.Layout() == AudioConfig::ChannelLayout(1), + "Can only downmix to stereo or mono"); - uint32_t channels = mIn.Channels(); + uint32_t inChannels = mIn.Channels(); + uint32_t outChannels = mOut.Channels(); - if (channels == 1 && mOut.Channels() == 1) { + if (inChannels == outChannels) { + // Number of channels is equal; no processing needed, just move data. if (aOut != aIn) { memmove(aOut, aIn, FramesOutToBytes(aFrames)); } return aFrames; } - if (channels > 2) { + if (inChannels > 2) { if (mIn.Format() == AudioConfig::FORMAT_FLT) { // Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows 5-8. static const float dmatrix[6][8][2]= { @@ -174,12 +178,18 @@ AudioConverter::DownmixAudio(void* aOut, const void* aIn, size_t aFrames) const for (uint32_t i = 0; i < aFrames; i++) { float sampL = 0.0; float sampR = 0.0; - for (uint32_t j = 0; j < channels; j++) { - sampL += in[i*mIn.Channels()+j]*dmatrix[mIn.Channels()-3][j][0]; - sampR += in[i*mIn.Channels()+j]*dmatrix[mIn.Channels()-3][j][1]; + for (uint32_t j = 0; j < inChannels; j++) { + sampL += in[i * inChannels + j] * dmatrix[inChannels - 3][j][0]; + sampR += in[i * inChannels + j] * dmatrix[inChannels - 3][j][1]; + } + if (outChannels == 2) { + // Stereo + *out++ = sampL; + *out++ = sampR; + } else { + // Mono + *out++ = (sampL + sampR) * 0.5; } - *out++ = sampL; - *out++ = sampR; } } else if (mIn.Format() == AudioConfig::FORMAT_S16) { // Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows 5-8. @@ -198,45 +208,51 @@ AudioConverter::DownmixAudio(void* aOut, const void* aIn, size_t aFrames) const for (uint32_t i = 0; i < aFrames; i++) { int32_t sampL = 0; int32_t sampR = 0; - for (uint32_t j = 0; j < channels; j++) { - sampL+=in[i*channels+j]*dmatrix[channels-3][j][0]; - sampR+=in[i*channels+j]*dmatrix[channels-3][j][1]; + for (uint32_t j = 0; j < inChannels; j++) { + sampL += in[i * inChannels + j] * dmatrix[inChannels - 3][j][0]; + sampR += in[i * inChannels + j] * dmatrix[inChannels - 3][j][1]; + } + sampL = clipTo15((sampL + 8192) >> 14); + sampR = clipTo15((sampR + 8192) >> 14); + if (outChannels == 2) { + // Stereo + *out++ = sampL; + *out++ = sampR; + } else { + // Mono + *out++ = (sampL + sampR) * 0.5; } - *out++ = clipTo15((sampL + 8192)>>14); - *out++ = clipTo15((sampR + 8192)>>14); } } else { MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type"); } - // If we are to continue downmixing to mono, start working on the output - // buffer. - aIn = aOut; - channels = 2; + return aFrames; } - if (mOut.Channels() == 1) { - if (mIn.Format() == AudioConfig::FORMAT_FLT) { - const float* in = static_cast<const float*>(aIn); - float* out = static_cast<float*>(aOut); - for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) { - float sample = 0.0; - // The sample of the buffer would be interleaved. - sample = (in[fIdx*channels] + in[fIdx*channels + 1]) * 0.5; - *out++ = sample; - } - } else if (mIn.Format() == AudioConfig::FORMAT_S16) { - const int16_t* in = static_cast<const int16_t*>(aIn); - int16_t* out = static_cast<int16_t*>(aOut); - for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) { - int32_t sample = 0.0; - // The sample of the buffer would be interleaved. - sample = (in[fIdx*channels] + in[fIdx*channels + 1]) * 0.5; - *out++ = sample; - } - } else { - MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type"); + // If we get here, we're doing a stereo -> mono conversion. + MOZ_DIAGNOSTIC_ASSERT(inChannels == 2 && outChannels == 1); + + if (mIn.Format() == AudioConfig::FORMAT_FLT) { + const float* in = static_cast<const float*>(aIn); + float* out = static_cast<float*>(aOut); + for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) { + float sample = 0.0; + // The sample of the buffer would be interleaved. + sample = (in[fIdx * inChannels] + in[fIdx * inChannels + 1]) * 0.5; + *out++ = sample; } + } else if (mIn.Format() == AudioConfig::FORMAT_S16) { + const int16_t* in = static_cast<const int16_t*>(aIn); + int16_t* out = static_cast<int16_t*>(aOut); + for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) { + int32_t sample = 0.0; + // The sample of the buffer would be interleaved. + sample = (in[fIdx * inChannels] + in[fIdx * inChannels + 1]) * 0.5; + *out++ = sample; + } + } else { + MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type"); } return aFrames; } diff --git a/embedding/components/find/nsFind.cpp b/embedding/components/find/nsFind.cpp index 5fc1f9db6..6987c11d3 100644 --- a/embedding/components/find/nsFind.cpp +++ b/embedding/components/find/nsFind.cpp @@ -966,6 +966,11 @@ nsFind::Find(const char16_t* aPatText, nsIDOMRange* aSearchRange, const char16_t* patStr = patAutoStr.get(); int32_t patLen = patAutoStr.Length() - 1; + + // If this function is called with an empty string, we should early exit. + if (patLen < 0) { + return NS_OK; + } // current offset into the pattern -- reset to beginning/end: int32_t pindex = (mFindBackward ? patLen : 0); diff --git a/js/src/jit/arm/Assembler-arm.cpp b/js/src/jit/arm/Assembler-arm.cpp index 2830f0695..1e20da1c8 100644 --- a/js/src/jit/arm/Assembler-arm.cpp +++ b/js/src/jit/arm/Assembler-arm.cpp @@ -2401,7 +2401,12 @@ Assembler::as_b(Label* l, Condition c) if (oom()) return BufferOffset(); - as_b(BufferOffset(l).diffB<BOffImm>(ret), c, ret); + BOffImm off = BufferOffset(l).diffB<BOffImm>(ret); + if (off.isInvalid()) { + m_buffer.fail_bail(); + return BufferOffset(); + } + as_b(off, c, ret); #ifdef JS_DISASM_ARM spewBranch(m_buffer.getInstOrNull(ret), l); #endif diff --git a/js/src/jit/arm/MacroAssembler-arm.cpp b/js/src/jit/arm/MacroAssembler-arm.cpp index d40578514..a4161ab00 100644 --- a/js/src/jit/arm/MacroAssembler-arm.cpp +++ b/js/src/jit/arm/MacroAssembler-arm.cpp @@ -5012,7 +5012,10 @@ void MacroAssembler::patchCall(uint32_t callerOffset, uint32_t calleeOffset) { BufferOffset inst(callerOffset - 4); - as_bl(BufferOffset(calleeOffset).diffB<BOffImm>(inst), Always, inst); + BOffImm off = BufferOffset(calleeOffset).diffB<BOffImm>(inst); + MOZ_RELEASE_ASSERT(!off.isInvalid(), + "Failed to insert necessary far jump islands"); + as_bl(off, Always, inst); } CodeOffset diff --git a/media/libpng/png.c b/media/libpng/png.c index e6fe51722..3630b1f73 100644 --- a/media/libpng/png.c +++ b/media/libpng/png.c @@ -4517,8 +4517,7 @@ png_image_free(png_imagep image) if (image != NULL && image->opaque != NULL && image->opaque->error_buf == NULL) { - /* Ignore errors here: */ - (void)png_safe_execute(image, png_image_free_function, image); + png_image_free_function(image); image->opaque = NULL; } } diff --git a/parser/html/nsHtml5Portability.cpp b/parser/html/nsHtml5Portability.cpp index 36c7e758a..0a7c6f845 100644 --- a/parser/html/nsHtml5Portability.cpp +++ b/parser/html/nsHtml5Portability.cpp @@ -91,7 +91,7 @@ nsHtml5Portability::releaseString(nsString* str) bool nsHtml5Portability::localEqualsBuffer(nsIAtom* local, char16_t* buf, int32_t offset, int32_t length) { - return local->Equals(nsDependentSubstring(buf + offset, buf + offset + length)); + return local->Equals(buf + offset, length); } bool diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index 06ed42326..5dffa7409 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -2832,6 +2832,11 @@ nsCycleCollector::ForgetSkippable(bool aRemoveChildlessNodes, { CheckThreadSafety(); + // Avoid this when we're aleady dealing with snow-white objects. + if (mFreeingSnowWhite) { + return; + } + mozilla::Maybe<mozilla::AutoGlobalTimelineMarker> marker; if (NS_IsMainThread()) { marker.emplace("nsCycleCollector::ForgetSkippable", MarkerStackRequest::NO_STACK); diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp index 4c93625ae..c2e77e31f 100644 --- a/xpcom/ds/nsAtomTable.cpp +++ b/xpcom/ds/nsAtomTable.cpp @@ -325,13 +325,7 @@ AtomTableMatchKey(const PLDHashEntryHdr* aEntry, const void* aKey) nsDependentAtomString(he->mAtom)) == 0; } - uint32_t length = he->mAtom->GetLength(); - if (length != k->mLength) { - return false; - } - - return memcmp(he->mAtom->GetUTF16String(), - k->mUTF16String, length * sizeof(char16_t)) == 0; + return he->mAtom->Equals(k->mUTF16String, k->mLength); } static void diff --git a/xpcom/ds/nsIAtom.idl b/xpcom/ds/nsIAtom.idl index 6e8602c42..ce4cff485 100644 --- a/xpcom/ds/nsIAtom.idl +++ b/xpcom/ds/nsIAtom.idl @@ -37,9 +37,15 @@ interface nsIAtom : nsISupports size_t SizeOfIncludingThis(in MallocSizeOf aMallocSizeOf); %{C++ - // note this is NOT virtual so this won't muck with the vtable! + // note these are NOT virtual so they won't muck with the vtable! + inline bool Equals(char16ptr_t aString, uint32_t aLength) const + { + return mLength == aLength && + memcmp(mString, aString, mLength * sizeof(char16_t)) == 0; + } + inline bool Equals(const nsAString& aString) const { - return aString.Equals(nsDependentString(mString, mLength)); + return Equals(aString.BeginReading(), aString.Length()); } inline bool IsStaticAtom() const { |