diff --git a/dom/smil/SMILAnimationFunction.cpp b/dom/smil/SMILAnimationFunction.cpp index a2ee23adb15cf..bff4379d65051 100644 --- a/dom/smil/SMILAnimationFunction.cpp +++ b/dom/smil/SMILAnimationFunction.cpp @@ -7,12 +7,12 @@ #include "SMILAnimationFunction.h" #include "mozilla/dom/SVGAnimationElement.h" +#include "mozilla/Move.h" +#include "mozilla/SMILCSSValueType.h" +#include "mozilla/SMILNullType.h" #include "mozilla/SMILParserUtils.h" #include "mozilla/SMILTimedElement.h" -#include "mozilla/Move.h" #include "nsISMILAttr.h" -#include "SMILCSSValueType.h" -#include "SMILNullType.h" #include "nsAttrValueInlines.h" #include "nsGkAtoms.h" #include "nsCOMPtr.h" diff --git a/dom/smil/SMILBoolType.h b/dom/smil/SMILBoolType.h index ae6a76c07b0a7..388103a6da993 100644 --- a/dom/smil/SMILBoolType.h +++ b/dom/smil/SMILBoolType.h @@ -8,7 +8,7 @@ #define MOZILLA_SMILBOOLTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" namespace mozilla { diff --git a/dom/smil/SMILCSSProperty.cpp b/dom/smil/SMILCSSProperty.cpp index 6b8f266bad477..971d82d3f4fda 100644 --- a/dom/smil/SMILCSSProperty.cpp +++ b/dom/smil/SMILCSSProperty.cpp @@ -11,9 +11,9 @@ #include "mozilla/dom/Element.h" #include "mozilla/Move.h" #include "mozilla/ServoBindings.h" +#include "mozilla/SMILCSSValueType.h" #include "mozilla/StyleAnimationValue.h" #include "nsDOMCSSAttrDeclaration.h" -#include "SMILCSSValueType.h" #include "nsSMILValue.h" #include "nsCSSProps.h" diff --git a/dom/smil/SMILCSSValueType.h b/dom/smil/SMILCSSValueType.h index c55c8631fa643..a1efe2aa65c74 100644 --- a/dom/smil/SMILCSSValueType.h +++ b/dom/smil/SMILCSSValueType.h @@ -9,10 +9,10 @@ #ifndef NS_SMILCSSVALUETYPE_H_ #define NS_SMILCSSVALUETYPE_H_ -#include "SMILType.h" +#include "mozilla/Attributes.h" +#include "mozilla/SMILType.h" #include "nsCSSPropertyID.h" #include "nsStringFwd.h" -#include "mozilla/Attributes.h" namespace mozilla { struct AnimationValue; diff --git a/dom/smil/SMILEnumType.h b/dom/smil/SMILEnumType.h index f053902dcbeb9..ce14b98cd8dc6 100644 --- a/dom/smil/SMILEnumType.h +++ b/dom/smil/SMILEnumType.h @@ -8,7 +8,7 @@ #define MOZILLA_SMILENUMTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" namespace mozilla { diff --git a/dom/smil/SMILFloatType.h b/dom/smil/SMILFloatType.h index cc4ecb2202468..a6dc3ec90c998 100644 --- a/dom/smil/SMILFloatType.h +++ b/dom/smil/SMILFloatType.h @@ -8,7 +8,7 @@ #define NS_SMILFLOATTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" namespace mozilla { diff --git a/dom/smil/SMILIntegerType.h b/dom/smil/SMILIntegerType.h index c249d171f56ec..79fe640928620 100644 --- a/dom/smil/SMILIntegerType.h +++ b/dom/smil/SMILIntegerType.h @@ -8,7 +8,7 @@ #define MOZILLA_SMILINTEGERTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" namespace mozilla { diff --git a/dom/smil/SMILNullType.h b/dom/smil/SMILNullType.h index 6dbdb128ad5b8..61156dba4f90b 100644 --- a/dom/smil/SMILNullType.h +++ b/dom/smil/SMILNullType.h @@ -8,7 +8,7 @@ #define NS_SMILNULLTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" namespace mozilla { diff --git a/dom/smil/SMILStringType.h b/dom/smil/SMILStringType.h index 951675d4c20e3..9e6b25415751b 100644 --- a/dom/smil/SMILStringType.h +++ b/dom/smil/SMILStringType.h @@ -8,7 +8,7 @@ #define MOZILLA_SMILSTRINGTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" namespace mozilla { diff --git a/dom/smil/moz.build b/dom/smil/moz.build index 2b18b51f04b2c..d2ad95474b3ef 100644 --- a/dom/smil/moz.build +++ b/dom/smil/moz.build @@ -19,22 +19,22 @@ EXPORTS += [ 'nsSMILTimeValueSpecParams.h', 'nsSMILTypes.h', 'nsSMILValue.h', - 'SMILCSSValueType.h', - 'SMILNullType.h', - 'SMILType.h', ] EXPORTS.mozilla += [ 'SMILAnimationController.h', 'SMILAnimationFunction.h', 'SMILCompositorTable.h', + 'SMILCSSValueType.h', 'SMILKeySpline.h', 'SMILMilestone.h', + 'SMILNullType.h', 'SMILParserUtils.h', 'SMILSetAnimationFunction.h', 'SMILTargetIdentifier.h', 'SMILTimeContainer.h', 'SMILTimedElement.h', + 'SMILType.h', ] EXPORTS.mozilla.dom += [ diff --git a/dom/smil/nsSMILValue.h b/dom/smil/nsSMILValue.h index 098c1e9e0c2b8..a0405adef942c 100644 --- a/dom/smil/nsSMILValue.h +++ b/dom/smil/nsSMILValue.h @@ -7,8 +7,8 @@ #ifndef NS_SMILVALUE_H_ #define NS_SMILVALUE_H_ -#include "SMILType.h" -#include "SMILNullType.h" +#include "mozilla/SMILNullType.h" +#include "mozilla/SMILType.h" /** * Although objects of this type are generally only created on the stack and diff --git a/dom/svg/SVGIntegerPairSMILType.h b/dom/svg/SVGIntegerPairSMILType.h index c8757de660fd6..d540bd6064795 100644 --- a/dom/svg/SVGIntegerPairSMILType.h +++ b/dom/svg/SVGIntegerPairSMILType.h @@ -8,7 +8,7 @@ #define MOZILLA_SVGINTEGERPAIRSMILTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" class nsSMILValue; diff --git a/dom/svg/SVGLengthListSMILType.h b/dom/svg/SVGLengthListSMILType.h index aca9c49d6c29b..e24d0a7184f99 100644 --- a/dom/svg/SVGLengthListSMILType.h +++ b/dom/svg/SVGLengthListSMILType.h @@ -8,7 +8,7 @@ #define MOZILLA_SVGLENGTHLISTSMILTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" class nsSMILValue; diff --git a/dom/svg/SVGMotionSMILType.h b/dom/svg/SVGMotionSMILType.h index 7d21c971868b7..f16b228984a36 100644 --- a/dom/svg/SVGMotionSMILType.h +++ b/dom/svg/SVGMotionSMILType.h @@ -11,7 +11,7 @@ #include "mozilla/gfx/2D.h" #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" class nsSMILValue; diff --git a/dom/svg/SVGNumberListSMILType.h b/dom/svg/SVGNumberListSMILType.h index 04857e6b3fc66..19346d72f5b36 100644 --- a/dom/svg/SVGNumberListSMILType.h +++ b/dom/svg/SVGNumberListSMILType.h @@ -8,7 +8,7 @@ #define MOZILLA_SVGNUMBERLISTSMILTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" class nsSMILValue; diff --git a/dom/svg/SVGNumberPairSMILType.h b/dom/svg/SVGNumberPairSMILType.h index 3733c9b927e37..0cf93f2e3c689 100644 --- a/dom/svg/SVGNumberPairSMILType.h +++ b/dom/svg/SVGNumberPairSMILType.h @@ -8,7 +8,7 @@ #define MOZILLA_SVGNUMBERPAIRSMILTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" class nsSMILValue; diff --git a/dom/svg/SVGOrientSMILType.h b/dom/svg/SVGOrientSMILType.h index 9e6b73cbb5cdc..a7c75f685601b 100644 --- a/dom/svg/SVGOrientSMILType.h +++ b/dom/svg/SVGOrientSMILType.h @@ -8,7 +8,7 @@ #define MOZILLA_SVGORIENTSMILTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" class nsSMILValue; diff --git a/dom/svg/SVGPathSegListSMILType.h b/dom/svg/SVGPathSegListSMILType.h index 9458ded8554e9..816550250f652 100644 --- a/dom/svg/SVGPathSegListSMILType.h +++ b/dom/svg/SVGPathSegListSMILType.h @@ -8,7 +8,7 @@ #define MOZILLA_SVGPATHSEGLISTSMILTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" class nsSMILValue; diff --git a/dom/svg/SVGPointListSMILType.h b/dom/svg/SVGPointListSMILType.h index 8a50912b2493d..42042f26178f1 100644 --- a/dom/svg/SVGPointListSMILType.h +++ b/dom/svg/SVGPointListSMILType.h @@ -8,7 +8,7 @@ #define MOZILLA_SVGPOINTLISTSMILTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" class nsSMILValue; diff --git a/dom/svg/SVGTransformListSMILType.h b/dom/svg/SVGTransformListSMILType.h index 397ffb7a92c8b..1d989bbccb337 100644 --- a/dom/svg/SVGTransformListSMILType.h +++ b/dom/svg/SVGTransformListSMILType.h @@ -8,7 +8,7 @@ #define SVGTRANSFORMLISTSMILTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" #include "nsTArray.h" class nsSMILValue; diff --git a/dom/svg/SVGViewBoxSMILType.h b/dom/svg/SVGViewBoxSMILType.h index ad651be339dee..de627f4504dea 100644 --- a/dom/svg/SVGViewBoxSMILType.h +++ b/dom/svg/SVGViewBoxSMILType.h @@ -8,7 +8,7 @@ #define MOZILLA_SVGVIEWBOXSMILTYPE_H_ #include "mozilla/Attributes.h" -#include "SMILType.h" +#include "mozilla/SMILType.h" class nsSMILValue; diff --git a/editor/libeditor/EditorEventListener.cpp b/editor/libeditor/EditorEventListener.cpp index 69dbfbf46334c..801c07cdc3772 100644 --- a/editor/libeditor/EditorEventListener.cpp +++ b/editor/libeditor/EditorEventListener.cpp @@ -169,15 +169,12 @@ nsresult EditorEventListener::InstallToEditor() { TrustedEventsAtCapture()); elmP->AddEventListenerByType(this, NS_LITERAL_STRING("click"), TrustedEventsAtCapture()); - // Focus event doesn't bubble so adding the listener to capturing phase. - // XXX Should we listen focus/blur events of system group too? Or should - // editor notified focus/blur of the element from nsFocusManager - // directly? Because if the event propagation is stopped by JS, - // editor cannot initialize selection as expected. + // Focus event doesn't bubble so adding the listener to capturing phase as + // system event group. elmP->AddEventListenerByType(this, NS_LITERAL_STRING("blur"), - TrustedEventsAtCapture()); + TrustedEventsAtSystemGroupCapture()); elmP->AddEventListenerByType(this, NS_LITERAL_STRING("focus"), - TrustedEventsAtCapture()); + TrustedEventsAtSystemGroupCapture()); elmP->AddEventListenerByType(this, NS_LITERAL_STRING("text"), TrustedEventsAtSystemGroupBubble()); elmP->AddEventListenerByType(this, NS_LITERAL_STRING("compositionstart"), @@ -243,9 +240,9 @@ void EditorEventListener::UninstallFromEditor() { elmP->RemoveEventListenerByType(this, NS_LITERAL_STRING("click"), TrustedEventsAtCapture()); elmP->RemoveEventListenerByType(this, NS_LITERAL_STRING("blur"), - TrustedEventsAtCapture()); + TrustedEventsAtSystemGroupCapture()); elmP->RemoveEventListenerByType(this, NS_LITERAL_STRING("focus"), - TrustedEventsAtCapture()); + TrustedEventsAtSystemGroupCapture()); elmP->RemoveEventListenerByType(this, NS_LITERAL_STRING("text"), TrustedEventsAtSystemGroupBubble()); elmP->RemoveEventListenerByType(this, NS_LITERAL_STRING("compositionstart"), diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index 439c52c3c6806..d39637d8a5ca0 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -670,8 +670,7 @@ static inline bool FinalizeTypedArenas(FreeOp* fop, Arena** src, } /* - * Finalize the list. On return, |al|'s cursor points to the first non-empty - * arena in the list (which may be null if all arenas are full). + * Finalize the list of areans. */ static bool FinalizeArenas(FreeOp* fop, Arena** src, SortedArenaList& dest, AllocKind thingKind, SliceBudget& budget, diff --git a/layout/base/tests/bug1097242-1.html b/layout/base/tests/bug1097242-1.html index dc5d55eb1bac8..e94a8c9917c61 100644 --- a/layout/base/tests/bug1097242-1.html +++ b/layout/base/tests/bug1097242-1.html @@ -1,18 +1,22 @@ + - +
foobarbaz
+ diff --git a/layout/base/tests/bug1109968-1.html b/layout/base/tests/bug1109968-1.html index 27a4c8b46a9c4..fece54d082d06 100644 --- a/layout/base/tests/bug1109968-1.html +++ b/layout/base/tests/bug1109968-1.html @@ -3,7 +3,7 @@ -
foo
bar
baz
+
foo
bar
baz
-
foo
bar
+
foo
bar
diff --git a/layout/base/tests/bug1423331-2.html b/layout/base/tests/bug1423331-2.html index 28ec34f993cf1..9615a29bd471b 100644 --- a/layout/base/tests/bug1423331-2.html +++ b/layout/base/tests/bug1423331-2.html @@ -17,11 +17,13 @@
diff --git a/layout/base/tests/bug989012-1.html b/layout/base/tests/bug989012-1.html index dac0cc35218a0..c598f31aa43fa 100644 --- a/layout/base/tests/bug989012-1.html +++ b/layout/base/tests/bug989012-1.html @@ -4,7 +4,7 @@ -
fooIMAGEbar
+
fooIMAGEbar
+ + + + + + diff --git a/layout/base/tests/input-stoppropagation.html b/layout/base/tests/input-stoppropagation.html new file mode 100644 index 0000000000000..91157bde99c45 --- /dev/null +++ b/layout/base/tests/input-stoppropagation.html @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/layout/base/tests/mochitest.ini b/layout/base/tests/mochitest.ini index 38ca9e3794202..6055cdf12f12b 100644 --- a/layout/base/tests/mochitest.ini +++ b/layout/base/tests/mochitest.ini @@ -339,6 +339,8 @@ support-files = input-minlength-ui-valid-change.html input-minlength-valid-before-change.html input-minlength-valid-change.html + input-stoppropagation.html + input-stoppropagation-ref.html input-valid-ref.html multi-range-script-select.html multi-range-script-select-ref.html diff --git a/layout/base/tests/test_reftests_with_caret.html b/layout/base/tests/test_reftests_with_caret.html index c7d43ab50847f..ff7492c4d0a73 100644 --- a/layout/base/tests/test_reftests_with_caret.html +++ b/layout/base/tests/test_reftests_with_caret.html @@ -148,6 +148,7 @@ [ 'input-maxlength-ui-invalid-change.html', 'input-invalid-ref.html'] , [ 'input-minlength-ui-valid-change.html', 'input-valid-ref.html'] , [ 'input-minlength-ui-invalid-change.html', 'input-invalid-ref.html'] , + [ 'input-stoppropagation.html', 'input-stoppropagation-ref.html'] , [ 'textarea-maxlength-valid-before-change.html', 'textarea-valid-ref.html'] , [ 'textarea-maxlength-valid-change.html', 'textarea-valid-ref.html'] , [ 'textarea-maxlength-invalid-change.html', 'textarea-invalid-ref.html'] , diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index 7f90cb3001e5d..2f6040d4d4716 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -8,15 +8,15 @@ #include "nsDOMCSSAttrDeclaration.h" -#include "mozilla/DeclarationBlock.h" +#include "mozilla/dom/Document.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/MutationEventBinding.h" +#include "mozilla/DeclarationBlock.h" #include "mozilla/InternalMutationEvent.h" +#include "mozilla/SMILCSSValueType.h" #include "mozAutoDocUpdate.h" -#include "mozilla/dom/Document.h" #include "nsIURI.h" #include "nsNodeUtils.h" -#include "SMILCSSValueType.h" #include "nsWrapperCacheInlines.h" #include "nsIFrame.h" #include "ActiveLayerTracker.h" diff --git a/netwerk/cache2/CacheFileChunk.cpp b/netwerk/cache2/CacheFileChunk.cpp index 42eb5edfe7651..f890d19b80067 100644 --- a/netwerk/cache2/CacheFileChunk.cpp +++ b/netwerk/cache2/CacheFileChunk.cpp @@ -792,12 +792,17 @@ bool CacheFileChunk::CanAllocate(uint32_t aSize) const { LOG(("CacheFileChunk::CanAllocate() [this=%p, size=%u]", this, aSize)); - uint32_t limit = CacheObserver::MaxDiskChunksMemoryUsage(mIsPriority); + int64_t limit = CacheObserver::MaxDiskChunksMemoryUsage(mIsPriority); if (limit == 0) { return true; } - uint32_t usage = ChunksMemoryUsage(); + limit <<= 10; + if (limit > UINT32_MAX) { + limit = UINT32_MAX; + } + + int64_t usage = ChunksMemoryUsage(); if (usage + aSize > limit) { LOG(("CacheFileChunk::CanAllocate() - Returning false. [this=%p]", this)); return false; diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp index 1833cbb3c5d6d..05b16496cc03f 100644 --- a/netwerk/cache2/CacheFileIOManager.cpp +++ b/netwerk/cache2/CacheFileIOManager.cpp @@ -2010,11 +2010,12 @@ nsresult CacheFileIOManager::WriteInternal(CacheFileHandle *aHandle, "failed! [rv=0x%08" PRIx32 "]", static_cast(rv))); } else { + freeSpace >>= 10; // bytes to kilobytes uint32_t limit = CacheObserver::DiskFreeSpaceHardLimit(); if (freeSpace - aOffset - aCount + aHandle->mFileSize < limit) { LOG( ("CacheFileIOManager::WriteInternal() - Low free space, refusing " - "to write! [freeSpace=%" PRId64 ", limit=%u]", + "to write! [freeSpace=%" PRId64 "kB, limit=%ukB]", freeSpace, limit)); return NS_ERROR_FILE_DISK_FULL; } @@ -2547,11 +2548,12 @@ nsresult CacheFileIOManager::TruncateSeekSetEOFInternal( "GetDiskSpaceAvailable() failed! [rv=0x%08" PRIx32 "]", static_cast(rv))); } else { + freeSpace >>= 10; // bytes to kilobytes uint32_t limit = CacheObserver::DiskFreeSpaceHardLimit(); if (freeSpace - aEOFPos + aHandle->mFileSize < limit) { LOG( ("CacheFileIOManager::TruncateSeekSetEOFInternal() - Low free space" - ", refusing to write! [freeSpace=%" PRId64 ", limit=%u]", + ", refusing to write! [freeSpace=%" PRId64 "kB, limit=%ukB]", freeSpace, limit)); return NS_ERROR_FILE_DISK_FULL; } @@ -2727,6 +2729,7 @@ nsresult CacheFileIOManager::EvictIfOverLimitInternal() { "GetDiskSpaceAvailable() failed! [rv=0x%08" PRIx32 "]", static_cast(rv))); } else { + freeSpace >>= 10; // bytes to kilobytes UpdateSmartCacheSize(freeSpace); } @@ -2734,7 +2737,7 @@ nsresult CacheFileIOManager::EvictIfOverLimitInternal() { rv = CacheIndex::GetCacheSize(&cacheUsage); NS_ENSURE_SUCCESS(rv, rv); - uint32_t cacheLimit = CacheObserver::DiskCacheCapacity() >> 10; + uint32_t cacheLimit = CacheObserver::DiskCacheCapacity(); uint32_t freeSpaceLimit = CacheObserver::DiskFreeSpaceSoftLimit(); if (cacheUsage <= cacheLimit && @@ -2742,14 +2745,14 @@ nsresult CacheFileIOManager::EvictIfOverLimitInternal() { LOG( ("CacheFileIOManager::EvictIfOverLimitInternal() - Cache size and free " "space in limits. [cacheSize=%ukB, cacheSizeLimit=%ukB, " - "freeSpace=%" PRId64 ", freeSpaceLimit=%u]", + "freeSpace=%" PRId64 "kB, freeSpaceLimit=%ukB]", cacheUsage, cacheLimit, freeSpace, freeSpaceLimit)); return NS_OK; } LOG( ("CacheFileIOManager::EvictIfOverLimitInternal() - Cache size exceeded " - "limit. Starting overlimit eviction. [cacheSize=%u, limit=%u]", + "limit. Starting overlimit eviction. [cacheSize=%ukB, limit=%ukB]", cacheUsage, cacheLimit)); nsCOMPtr ev; @@ -2791,6 +2794,7 @@ nsresult CacheFileIOManager::OverLimitEvictionInternal() { "GetDiskSpaceAvailable() failed! [rv=0x%08" PRIx32 "]", static_cast(rv))); } else { + freeSpace >>= 10; // bytes to kilobytes UpdateSmartCacheSize(freeSpace); } @@ -2798,13 +2802,13 @@ nsresult CacheFileIOManager::OverLimitEvictionInternal() { rv = CacheIndex::GetCacheSize(&cacheUsage); NS_ENSURE_SUCCESS(rv, rv); - uint32_t cacheLimit = CacheObserver::DiskCacheCapacity() >> 10; + uint32_t cacheLimit = CacheObserver::DiskCacheCapacity(); uint32_t freeSpaceLimit = CacheObserver::DiskFreeSpaceSoftLimit(); if (cacheUsage > cacheLimit) { LOG( ("CacheFileIOManager::OverLimitEvictionInternal() - Cache size over " - "limit. [cacheSize=%u, limit=%u]", + "limit. [cacheSize=%ukB, limit=%ukB]", cacheUsage, cacheLimit)); // We allow cache size to go over the specified limit. Eviction should @@ -2824,13 +2828,13 @@ nsresult CacheFileIOManager::OverLimitEvictionInternal() { } else if (freeSpace != 1 && freeSpace < freeSpaceLimit) { LOG( ("CacheFileIOManager::OverLimitEvictionInternal() - Free space under " - "limit. [freeSpace=%" PRId64 ", freeSpaceLimit=%u]", + "limit. [freeSpace=%" PRId64 "kB, freeSpaceLimit=%ukB]", freeSpace, freeSpaceLimit)); } else { LOG( ("CacheFileIOManager::OverLimitEvictionInternal() - Cache size and " "free space in limits. [cacheSize=%ukB, cacheSizeLimit=%ukB, " - "freeSpace=%" PRId64 ", freeSpaceLimit=%u]", + "freeSpace=%" PRId64 "kB, freeSpaceLimit=%ukB]", cacheUsage, cacheLimit, freeSpace, freeSpaceLimit)); mCacheSizeOnHardLimit = false; @@ -4064,7 +4068,7 @@ void CacheFileIOManager::SyncRemoveAllCacheFiles() { // Returns default ("smart") size (in KB) of cache, given available disk space // (also in KB) -static uint32_t SmartCacheSize(const uint32_t availKB) { +static uint32_t SmartCacheSize(const int64_t availKB) { uint32_t maxSize; if (CacheObserver::ClearCacheOnShutdown()) { @@ -4145,15 +4149,14 @@ nsresult CacheFileIOManager::UpdateSmartCacheSize(int64_t aFreeSpace) { mLastSmartSizeTime = TimeStamp::NowLoRes(); - uint32_t smartSize = - SmartCacheSize(static_cast(aFreeSpace / 1024) + cacheUsage); + uint32_t smartSize = SmartCacheSize(aFreeSpace + cacheUsage); - if (smartSize == (CacheObserver::DiskCacheCapacity() >> 10)) { + if (smartSize == CacheObserver::DiskCacheCapacity()) { // Smart size has not changed. return NS_OK; } - CacheObserver::SetDiskCacheCapacity(smartSize << 10); + CacheObserver::SetDiskCacheCapacity(smartSize); return NS_OK; } diff --git a/netwerk/cache2/CacheObserver.cpp b/netwerk/cache2/CacheObserver.cpp index 4f0c0f8f0d328..f2161fbf1d273 100644 --- a/netwerk/cache2/CacheObserver.cpp +++ b/netwerk/cache2/CacheObserver.cpp @@ -37,7 +37,7 @@ uint32_t CacheObserver::sMetadataMemoryLimit = kDefaultMetadataMemoryLimit; static int32_t const kDefaultMemoryCacheCapacity = -1; // autodetect int32_t CacheObserver::sMemoryCacheCapacity = kDefaultMemoryCacheCapacity; -// Cache of the calculated memory capacity based on the system memory size +// Cache of the calculated memory capacity based on the system memory size in KB int32_t CacheObserver::sAutoMemoryCacheCapacity = -1; static uint32_t const kDefaultDiskCacheCapacity = 250 * 1024; // 250 MB @@ -211,7 +211,7 @@ void CacheObserver::AttachToPreferences() { // static uint32_t CacheObserver::MemoryCacheCapacity() { - if (sMemoryCacheCapacity >= 0) return sMemoryCacheCapacity << 10; + if (sMemoryCacheCapacity >= 0) return sMemoryCacheCapacity; if (sAutoMemoryCacheCapacity != -1) return sAutoMemoryCacheCapacity; @@ -234,16 +234,16 @@ uint32_t CacheObserver::MemoryCacheCapacity() { if (x > 0) { capacity = (int32_t)(x * x / 3.0 + x + 2.0 / 3 + 0.1); // 0.1 for rounding if (capacity > 32) capacity = 32; - capacity <<= 20; + capacity <<= 10; } - // Result is in bytes. + // Result is in kilobytes. return sAutoMemoryCacheCapacity = capacity; } // static void CacheObserver::SetDiskCacheCapacity(uint32_t aCapacity) { - sDiskCacheCapacity = aCapacity >> 10; + sDiskCacheCapacity = aCapacity; if (!sSelf) { return; @@ -383,10 +383,10 @@ bool CacheObserver::EntryIsTooBig(int64_t aSize, bool aUsingDisk) { if (preferredLimit != -1 && aSize > preferredLimit) return true; // Otherwise (or when in the custom limit), check limit based on the global - // limit. It's 1/8 (>> 3) of the respective capacity. + // limit. It's 1/8 of the respective capacity. int64_t derivedLimit = - aUsingDisk ? (static_cast(DiskCacheCapacity() >> 3)) - : (static_cast(MemoryCacheCapacity() >> 3)); + aUsingDisk ? DiskCacheCapacity() : MemoryCacheCapacity(); + derivedLimit <<= (10 - 3); if (aSize > derivedLimit) return true; diff --git a/netwerk/cache2/CacheObserver.h b/netwerk/cache2/CacheObserver.h index 65ee873f8de79..5b2bb82da3b77 100644 --- a/netwerk/cache2/CacheObserver.h +++ b/netwerk/cache2/CacheObserver.h @@ -27,38 +27,39 @@ class CacheObserver : public nsIObserver, public nsSupportsWeakReference { // Access to preferences static bool UseDiskCache() { return sUseDiskCache; } static bool UseMemoryCache() { return sUseMemoryCache; } - static uint32_t MetadataMemoryLimit() // result in bytes. + static uint32_t MetadataMemoryLimit() // result in kilobytes. { - return sMetadataMemoryLimit << 10; + return sMetadataMemoryLimit; } - static uint32_t MemoryCacheCapacity(); // result in bytes. - static uint32_t DiskCacheCapacity() // result in bytes. + static uint32_t MemoryCacheCapacity(); // result in kilobytes. + static uint32_t DiskCacheCapacity() // result in kilobytes. { - return sDiskCacheCapacity << 10; + return sDiskCacheCapacity; } - static void SetDiskCacheCapacity(uint32_t); // parameter in bytes. - static uint32_t DiskFreeSpaceSoftLimit() // result in bytes. + static void SetDiskCacheCapacity(uint32_t); // parameter in kilobytes. + static uint32_t DiskFreeSpaceSoftLimit() // result in kilobytes. { - return sDiskFreeSpaceSoftLimit << 10; + return sDiskFreeSpaceSoftLimit; } - static uint32_t DiskFreeSpaceHardLimit() // result in bytes. + static uint32_t DiskFreeSpaceHardLimit() // result in kilobytes. { - return sDiskFreeSpaceHardLimit << 10; + return sDiskFreeSpaceHardLimit; } static bool SmartCacheSizeEnabled() { return sSmartCacheSizeEnabled; } static uint32_t PreloadChunkCount() { return sPreloadChunkCount; } - static uint32_t MaxMemoryEntrySize() // result in bytes. + static uint32_t MaxMemoryEntrySize() // result in kilobytes. { - return sMaxMemoryEntrySize << 10; + return sMaxMemoryEntrySize; } - static uint32_t MaxDiskEntrySize() // result in bytes. + static uint32_t MaxDiskEntrySize() // result in kilobytes. { - return sMaxDiskEntrySize << 10; + return sMaxDiskEntrySize; } - static uint32_t MaxDiskChunksMemoryUsage(bool aPriority) // result in bytes. + static uint32_t MaxDiskChunksMemoryUsage( + bool aPriority) // result in kilobytes. { - return aPriority ? sMaxDiskPriorityChunksMemoryUsage << 10 - : sMaxDiskChunksMemoryUsage << 10; + return aPriority ? sMaxDiskPriorityChunksMemoryUsage + : sMaxDiskChunksMemoryUsage; } static uint32_t CompressionLevel() { return sCompressionLevel; } static uint32_t HalfLifeSeconds() { return sHalfLifeHours * 60.0F * 60.0F; } diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index 3cf3c05536640..7462463bc3ee6 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -83,15 +83,27 @@ CacheStorageService::MemoryPool::~MemoryPool() { } uint32_t CacheStorageService::MemoryPool::Limit() const { + uint32_t limit = 0; + switch (mType) { case DISK: - return CacheObserver::MetadataMemoryLimit(); + limit = CacheObserver::MetadataMemoryLimit(); + break; case MEMORY: - return CacheObserver::MemoryCacheCapacity(); + limit = CacheObserver::MemoryCacheCapacity(); + break; + default: + MOZ_CRASH("Bad pool type"); } - MOZ_CRASH("Bad pool type"); - return 0; + static const uint32_t kMaxLimit = 0x3FFFFF; + if (limit > kMaxLimit) { + LOG((" a memory limit (%u) is unexpectedly high, clipping to %u", limit, + kMaxLimit)); + limit = kMaxLimit; + } + + return limit << 10; } NS_IMPL_ISUPPORTS(CacheStorageService, nsICacheStorageService, @@ -258,9 +270,11 @@ class WalkMemoryCacheRunnable : public WalkCacheRunnable { if (mNotifyStorage) { LOG((" storage")); + uint64_t capacity = CacheObserver::MemoryCacheCapacity(); + capacity <<= 10; // kilobytes to bytes + // Second, notify overall storage info - mCallback->OnCacheStorageInfo(mEntryArray.Length(), mSize, - CacheObserver::MemoryCacheCapacity(), + mCallback->OnCacheStorageInfo(mEntryArray.Length(), mSize, capacity, nullptr); if (!mVisitEntries) return NS_OK; // done @@ -458,8 +472,9 @@ class WalkDiskCacheRunnable : public WalkCacheRunnable { if (mNotifyStorage) { nsCOMPtr dir; CacheFileIOManager::GetCacheDirectory(getter_AddRefs(dir)); - mCallback->OnCacheStorageInfo(mCount, mSize, - CacheObserver::DiskCacheCapacity(), dir); + uint64_t capacity = CacheObserver::DiskCacheCapacity(); + capacity <<= 10; // kilobytes to bytes + mCallback->OnCacheStorageInfo(mCount, mSize, capacity, dir); mNotifyStorage = false; } else { mCallback->OnCacheEntryVisitCompleted(); diff --git a/taskcluster/taskgraph/actions/backfill.py b/taskcluster/taskgraph/actions/backfill.py index b629e3c9019a9..e245de0298a69 100644 --- a/taskcluster/taskgraph/actions/backfill.py +++ b/taskcluster/taskgraph/actions/backfill.py @@ -143,7 +143,7 @@ def modifier(task): if 'testPath' in input: task.task['payload']['env']['MOZHARNESS_TEST_PATHS'] = json.dumps({ - task.task['extra']['suite']['flavor']: input['testPath'] + task.task['extra']['suite']['flavor']: [input['testPath']] }) cmd_parts = task.task['payload']['command'] diff --git a/testing/mozharness/mozharness/mozilla/testing/per_test_base.py b/testing/mozharness/mozharness/mozilla/testing/per_test_base.py index 4326d4664fa69..f58e3ec965efb 100644 --- a/testing/mozharness/mozharness/mozilla/testing/per_test_base.py +++ b/testing/mozharness/mozharness/mozilla/testing/per_test_base.py @@ -241,7 +241,8 @@ def get_automationrelevance(): changed_files = set() if os.environ.get('MOZHARNESS_TEST_PATHS', None) is not None: suite_to_paths = json.loads(os.environ['MOZHARNESS_TEST_PATHS']) - changed_files |= itertools.chain.from_iterable(suite_to_paths.values()) + specified_files = itertools.chain.from_iterable(suite_to_paths.values()) + changed_files.update(specified_files) self.info("Per-test run found explicit request in MOZHARNESS_TEST_PATHS:") self.info(str(changed_files)) else: diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index 7fb0bbb04b777..dfc955400f38f 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/xpcom/threads/TimerThread.cpp @@ -17,6 +17,7 @@ #include "mozilla/ArenaAllocator.h" #include "mozilla/ArrayUtils.h" #include "mozilla/BinarySearch.h" +#include "mozilla/OperatorNewExtensions.h" #include @@ -133,14 +134,18 @@ class nsTimerEvent final : public CancelableRunnable { NS_IMETHOD GetName(nsACString& aName) override; #endif - nsTimerEvent() - : mozilla::CancelableRunnable("nsTimerEvent"), mTimer(), mGeneration(0) { + explicit nsTimerEvent(already_AddRefed aTimer) + : mozilla::CancelableRunnable("nsTimerEvent"), + mTimer(aTimer), + mGeneration(mTimer->GetGeneration()) { // Note: We override operator new for this class, and the override is // fallible! sAllocatorUsers++; - } - TimeStamp mInitTime; + if (MOZ_LOG_TEST(GetTimerLog(), LogLevel::Debug)) { + mInitTime = TimeStamp::Now(); + } + } static void Init(); static void Shutdown(); @@ -156,11 +161,6 @@ class nsTimerEvent final : public CancelableRunnable { already_AddRefed ForgetTimer() { return mTimer.forget(); } - void SetTimer(already_AddRefed aTimer) { - mTimer = aTimer; - mGeneration = mTimer->GetGeneration(); - } - private: nsTimerEvent(const nsTimerEvent&) = delete; nsTimerEvent& operator=(const nsTimerEvent&) = delete; @@ -173,8 +173,9 @@ class nsTimerEvent final : public CancelableRunnable { sAllocatorUsers--; } + TimeStamp mInitTime; RefPtr mTimer; - int32_t mGeneration; + const int32_t mGeneration; static TimerEventAllocator* sAllocator; @@ -714,15 +715,6 @@ already_AddRefed TimerThread::PostTimerEvent( // event, so we can avoid firing a timer that was re-initialized after being // canceled. - RefPtr event = new nsTimerEvent; - if (!event) { - return timer.forget(); - } - - if (MOZ_LOG_TEST(GetTimerLog(), LogLevel::Debug)) { - event->mInitTime = TimeStamp::Now(); - } - #ifdef MOZ_TASK_TRACER // During the dispatch of TimerEvent, we overwrite the current TraceInfo // partially with the info saved in timer earlier, and restore it back by @@ -732,7 +724,12 @@ already_AddRefed TimerThread::PostTimerEvent( #endif nsCOMPtr target = timer->mEventTarget; - event->SetTimer(timer.forget()); + + void* p = nsTimerEvent::operator new(sizeof(nsTimerEvent)); + if (!p) { + return timer.forget(); + } + RefPtr event = ::new (KnownNotNull, p) nsTimerEvent(timer.forget()); nsresult rv; {