diff --git a/accessible/windows/msaa/Platform.cpp b/accessible/windows/msaa/Platform.cpp index 444af394fb2..b7bef854504 100644 --- a/accessible/windows/msaa/Platform.cpp +++ b/accessible/windows/msaa/Platform.cpp @@ -76,6 +76,11 @@ a11y::ProxyTextChangeEvent(ProxyAccessible* aText, const nsString& aStr, int32_t aStart, uint32_t aLen, bool aInsert, bool) { AccessibleWrap* wrapper = WrapperFor(aText); + MOZ_ASSERT(wrapper); + if (!wrapper) { + return; + } + auto text = static_cast(wrapper->AsHyperText()); if (text) { ia2AccessibleText::UpdateTextChangeData(text, aInsert, aStr, aStart, aLen); diff --git a/build/win32/moz.build b/build/win32/moz.build index 0d14f247d28..8033e502e21 100644 --- a/build/win32/moz.build +++ b/build/win32/moz.build @@ -4,9 +4,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -if CONFIG['_MSC_VER'] and CONFIG['OS_TEST'] != 'x86_64': - TEST_DIRS += ['vmwarerecordinghelper'] - TEST_DIRS += ['crashinjectdll'] if CONFIG['ENABLE_TESTS']: diff --git a/build/win32/vmwarerecordinghelper/moz.build b/build/win32/vmwarerecordinghelper/moz.build deleted file mode 100644 index 61e40fe8bf0..00000000000 --- a/build/win32/vmwarerecordinghelper/moz.build +++ /dev/null @@ -1,15 +0,0 @@ -# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -SOURCES += [ - 'vmwarerecordinghelper.cpp', -] - -SharedLibrary('vmwarerecordinghelper') - -DEFFILE = '%s/%s.def' % (SRCDIR, LIBRARY_NAME) - -USE_STATIC_LIBS = True diff --git a/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.cpp b/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.cpp deleted file mode 100644 index b56bab2abf9..00000000000 --- a/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * The following code comes from "Starting and Stopping Recording of Virtual - * Machine Activity from Within the Guest": - * - * http://kb.vmware.com/selfservice/documentLink.do?externalID=1001401 - */ - -void __cdecl -StartRecording() -{ - __asm { - mov eax, 564d5868h - mov ebx, 1 - mov cx, 47 - mov dx, 5658h - in eax, dx - } -} - -void __cdecl -StopRecording() -{ - __asm { - mov eax, 564d5868h - mov ebx, 2 - mov cx, 47 - mov dx, 5658h - in eax, dx - } -} diff --git a/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.def b/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.def deleted file mode 100644 index c0d97f8a7fa..00000000000 --- a/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.def +++ /dev/null @@ -1,8 +0,0 @@ -;+# This Source Code Form is subject to the terms of the Mozilla Public -;+# License, v. 2.0. If a copy of the MPL was not distributed with this -;+# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -LIBRARY vmwarerecordinghelper -EXPORTS - StartRecording - StopRecording diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index db11d12ee79..a337be5ff65 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -4917,9 +4917,10 @@ HTMLInputElement::GetFilesAndDirectories(ErrorResult& aRv) } int32_t leafSeparatorIndex = path.RFind(FILE_PATH_SEPARATOR); nsDependentSubstring dirname = Substring(path, 0, leafSeparatorIndex); - nsDependentSubstring basename = Substring(path, leafSeparatorIndex); fs = MakeOrReuseFileSystem(dirname, fs, window); - filesAndDirsSeq[i].SetAsDirectory() = new Directory(fs, basename); + nsAutoString dompath(NS_LITERAL_STRING(FILESYSTEM_DOM_PATH_SEPARATOR)); + dompath.Append(Substring(path, leafSeparatorIndex + 1)); + filesAndDirsSeq[i].SetAsDirectory() = new Directory(fs, dompath); } else { filesAndDirsSeq[i].SetAsFile() = filesAndDirs[i]; } diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index aff9c9a9bd9..1ea89ea71c0 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -142,6 +142,7 @@ #include "nsIXULRuntime.h" #include "gfxDrawable.h" #include "ImageOps.h" +#include "mozilla/dom/nsMixedContentBlocker.h" #include "nsMemoryInfoDumper.h" #include "nsMemoryReporterManager.h" #include "nsServiceManagerUtils.h" @@ -4175,6 +4176,17 @@ ContentParent::RecvIsSecureURI(const uint32_t& type, return NS_SUCCEEDED(rv); } +bool +ContentParent::RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive) +{ + nsCOMPtr ourURI = DeserializeURI(aURI); + if (!ourURI) { + return false; + } + nsMixedContentBlocker::AccumulateMixedContentHSTS(ourURI, aActive); + return true; +} + bool ContentParent::RecvLoadURIExternal(const URIParams& uri) { diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index ac881edeea0..d65cdca423e 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -626,6 +626,8 @@ private: virtual bool RecvIsSecureURI(const uint32_t& aType, const URIParams& aURI, const uint32_t& aFlags, bool* aIsSecureURI) override; + virtual bool RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive) override; + virtual bool DeallocPHalParent(PHalParent*) override; virtual PIccParent* AllocPIccParent(const uint32_t& aServiceId) override; diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 8934cf05f88..a8dcf6ea2b8 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -751,6 +751,8 @@ parent: sync IsSecureURI(uint32_t type, URIParams uri, uint32_t flags) returns (bool isSecureURI); + async AccumulateMixedContentHSTS(URIParams uri, bool active); + sync GetLookAndFeelCache() returns (LookAndFeelInt[] lookAndFeelIntCache); @@ -788,7 +790,7 @@ parent: PFMRadio(); PWebrtcGlobal(); - + PPresentation(); // Services remoting diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build index cf3981b490e..6bb479b9511 100644 --- a/dom/ipc/moz.build +++ b/dom/ipc/moz.build @@ -134,6 +134,7 @@ LOCAL_INCLUDES += [ '/dom/geolocation', '/dom/media/webspeech/synth/ipc', '/dom/mobilemessage/ipc', + '/dom/security', '/dom/storage', '/dom/workers', '/editor/libeditor', diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index f391be5f396..f792d614eb1 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -84,7 +84,7 @@ static const char kContentTimeoutPref[] = "dom.ipc.plugins.contentTimeoutSecs"; static const char kChildTimeoutPref[] = "dom.ipc.plugins.timeoutSecs"; static const char kParentTimeoutPref[] = "dom.ipc.plugins.parentTimeoutSecs"; static const char kLaunchTimeoutPref[] = "dom.ipc.plugins.processLaunchTimeoutSecs"; -static const char kAsyncInitPref[] = "dom.ipc.plugins.asyncInit"; +static const char kAsyncInitPref[] = "dom.ipc.plugins.asyncInit.enabled"; #ifdef XP_WIN static const char kHangUITimeoutPref[] = "dom.ipc.plugins.hangUITimeoutSecs"; static const char kHangUIMinDisplayPref[] = "dom.ipc.plugins.hangUIMinDisplaySecs"; diff --git a/dom/security/moz.build b/dom/security/moz.build index 8c99bd4366b..80890f46f29 100644 --- a/dom/security/moz.build +++ b/dom/security/moz.build @@ -33,6 +33,8 @@ UNIFIED_SOURCES += [ 'SRIMetadata.cpp', ] +include('/ipc/chromium/chromium-config.mozbuild') + FINAL_LIBRARY = 'xul' LOCAL_INCLUDES += [ '/caps', @@ -40,5 +42,5 @@ LOCAL_INCLUDES += [ ] if CONFIG['GNU_CC']: - CFLAGS += ['-Wshadow', '-Wformat-security'] - CXXFLAGS += ['-Wshadow', '-Wformat-security'] + CFLAGS += ['-Wformat-security'] + CXXFLAGS += ['-Wformat-security'] diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp index 5f6c47dddc9..59d8d662398 100644 --- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -32,8 +32,13 @@ #include "nsIChannelEventSink.h" #include "nsAsyncRedirectVerifyHelper.h" #include "mozilla/LoadInfo.h" +#include "nsISiteSecurityService.h" #include "mozilla/Logging.h" +#include "mozilla/Telemetry.h" +#include "mozilla/dom/ContentChild.h" +#include "mozilla/ipc/URIUtils.h" + using namespace mozilla; @@ -342,7 +347,7 @@ nsMixedContentBlocker::ShouldLoad(uint32_t aContentType, // callers of this method don't know whether the load went through cached // image redirects. This is handled by direct callers of the static // ShouldLoad. - nsresult rv = ShouldLoad(false, //aHadInsecureImageRedirect + nsresult rv = ShouldLoad(false, // aHadInsecureImageRedirect aContentType, aContentLocation, aRequestingLocation, @@ -381,7 +386,6 @@ nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect, // Make decision to block/reject by default *aDecision = REJECT_REQUEST; - // Notes on non-obvious decisions: // // TYPE_DTD: A DTD can contain entity definitions that expand to scripts. @@ -718,6 +722,33 @@ nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect, } nsresult stateRV = securityUI->GetState(&state); + // At this point we know that the request is mixed content, and the only + // question is whether we block it. Record telemetry at this point as to + // whether HSTS would have fixed things by making the content location + // into an HTTPS URL. + // + // Note that we count this for redirects as well as primary requests. This + // will cause some degree of double-counting, especially when mixed content + // is not blocked (e.g., for images). For more detail, see: + // https://bugzilla.mozilla.org/show_bug.cgi?id=1198572#c19 + // + // We do not count requests aHadInsecureImageRedirect=true, since these are + // just an artifact of the image caching system. + bool active = (classification == eMixedScript); + if (!aHadInsecureImageRedirect) { + if (XRE_IsParentProcess()) { + AccumulateMixedContentHSTS(aContentLocation, active); + } else { + // Ask the parent process to do the same call + mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton(); + if (cc) { + mozilla::ipc::URIParams uri; + SerializeURI(aContentLocation, uri); + cc->SendAccumulateMixedContentHSTS(uri, active); + } + } + } + // If the content is display content, and the pref says display content should be blocked, block it. if (sBlockMixedDisplay && classification == eMixedDisplay) { if (allowMixedContent) { @@ -857,3 +888,54 @@ nsMixedContentBlocker::ShouldProcess(uint32_t aContentType, aRequestingContext, aMimeGuess, aExtra, aRequestPrincipal, aDecision); } + +enum MixedContentHSTSState { + MCB_HSTS_PASSIVE_NO_HSTS = 0, + MCB_HSTS_PASSIVE_WITH_HSTS = 1, + MCB_HSTS_ACTIVE_NO_HSTS = 2, + MCB_HSTS_ACTIVE_WITH_HSTS = 3 +}; + +// Record information on when HSTS would have made mixed content not mixed +// content (regardless of whether it was actually blocked) +void +nsMixedContentBlocker::AccumulateMixedContentHSTS(nsIURI* aURI, bool aActive) +{ + // This method must only be called in the parent, because + // nsSiteSecurityService is only available in the parent + if (!XRE_IsParentProcess()) { + MOZ_ASSERT(false); + return; + } + + bool hsts; + nsresult rv; + nsCOMPtr sss = do_GetService(NS_SSSERVICE_CONTRACTID, &rv); + if (NS_FAILED(rv)) { + return; + } + rv = sss->IsSecureURI(nsISiteSecurityService::HEADER_HSTS, aURI, 0, &hsts); + if (NS_FAILED(rv)) { + return; + } + + if (!aActive) { + if (!hsts) { + Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS, + MCB_HSTS_PASSIVE_NO_HSTS); + } + else { + Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS, + MCB_HSTS_PASSIVE_WITH_HSTS); + } + } else { + if (!hsts) { + Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS, + MCB_HSTS_ACTIVE_NO_HSTS); + } + else { + Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS, + MCB_HSTS_ACTIVE_WITH_HSTS); + } + } +} diff --git a/dom/security/nsMixedContentBlocker.h b/dom/security/nsMixedContentBlocker.h index e77189c2a6b..216466fd83b 100644 --- a/dom/security/nsMixedContentBlocker.h +++ b/dom/security/nsMixedContentBlocker.h @@ -59,6 +59,7 @@ public: nsISupports* aExtra, nsIPrincipal* aRequestPrincipal, int16_t* aDecision); + static void AccumulateMixedContentHSTS(nsIURI* aURI, bool aActive); static bool sBlockMixedScript; static bool sBlockMixedDisplay; }; diff --git a/dom/xbl/nsXBLService.cpp b/dom/xbl/nsXBLService.cpp index d072eb4ef55..247f5977c33 100644 --- a/dom/xbl/nsXBLService.cpp +++ b/dom/xbl/nsXBLService.cpp @@ -651,7 +651,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, bool* aIsReady, nsXBLBinding** aResult) { // More than 6 binding URIs are rare, see bug 55070 comment 18. - nsAutoTArray uris; + nsAutoTArray, 6> uris; return GetBinding(aBoundElement, aURI, aPeekOnly, aOriginPrincipal, aIsReady, aResult, uris); } @@ -708,7 +708,7 @@ nsresult nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, bool aPeekOnly, nsIPrincipal* aOriginPrincipal, bool* aIsReady, nsXBLBinding** aResult, - nsTArray& aDontExtendURIs) + nsTArray>& aDontExtendURIs) { NS_ASSERTION(aPeekOnly || aResult, "Must have non-null out param if not just peeking to see " @@ -784,7 +784,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, rv = protoBinding->ResolveBaseBinding(); NS_ENSURE_SUCCESS(rv, rv); - nsIURI* baseBindingURI; + nsCOMPtr baseBindingURI; nsXBLPrototypeBinding* baseProto = protoBinding->GetBasePrototype(); if (baseProto) { baseBindingURI = baseProto->BindingURI(); @@ -818,7 +818,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, nsRefPtr baseBinding; if (baseBindingURI) { - nsIContent* child = protoBinding->GetBindingElement(); + nsCOMPtr child = protoBinding->GetBindingElement(); rv = GetBinding(aBoundElement, baseBindingURI, aPeekOnly, child->NodePrincipal(), aIsReady, getter_AddRefs(baseBinding), aDontExtendURIs); @@ -830,6 +830,8 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, if (!aPeekOnly) { // Make a new binding + protoBinding = docInfo->GetPrototypeBinding(ref); + NS_ENSURE_STATE(protoBinding); nsXBLBinding *newBinding = new nsXBLBinding(protoBinding); if (baseBinding) { diff --git a/dom/xbl/nsXBLService.h b/dom/xbl/nsXBLService.h index 9772b928389..5082bc42b2e 100644 --- a/dom/xbl/nsXBLService.h +++ b/dom/xbl/nsXBLService.h @@ -109,7 +109,7 @@ protected: nsresult GetBinding(nsIContent* aBoundElement, nsIURI* aURI, bool aPeekFlag, nsIPrincipal* aOriginPrincipal, bool* aIsReady, nsXBLBinding** aResult, - nsTArray& aDontExtendURIs); + nsTArray>& aDontExtendURIs); // MEMBER VARIABLES public: diff --git a/js/src/jit/arm/CodeGenerator-arm.cpp b/js/src/jit/arm/CodeGenerator-arm.cpp index c2234528b5e..494dc794cef 100644 --- a/js/src/jit/arm/CodeGenerator-arm.cpp +++ b/js/src/jit/arm/CodeGenerator-arm.cpp @@ -547,12 +547,14 @@ CodeGeneratorARM::visitDivI(LDivI* ins) if (mir->canTruncateRemainder()) { masm.ma_sdiv(lhs, rhs, output); } else { - ScratchRegisterScope scratch(masm); - masm.ma_sdiv(lhs, rhs, scratch); - masm.ma_mul(scratch, rhs, temp); - masm.ma_cmp(lhs, temp); + { + ScratchRegisterScope scratch(masm); + masm.ma_sdiv(lhs, rhs, temp); + masm.ma_mul(temp, rhs, scratch); + masm.ma_cmp(lhs, scratch); + } bailoutIf(Assembler::NotEqual, ins->snapshot()); - masm.ma_mov(scratch, output); + masm.ma_mov(temp, output); } masm.bind(&done); diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index ef8f489b813..8f7ceaa04ed 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -3670,7 +3670,7 @@ GetScrollClipIntersection(nsDisplayListBuilder* aBuilder, const nsIFrame* aAnima continue; } - const DisplayItemClip* clip = scrollFrame->ComputeScrollClip(aIsCaret); + Maybe clip = scrollFrame->ComputeScrollClip(aIsCaret); if (clip) { resultClip.IntersectWith(*clip); } @@ -4542,7 +4542,7 @@ ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry) } FrameMetrics& metrics = info->metrics; - const DisplayItemClip* clip = info->clip; + Maybe clip = info->clip; if (clip && clip->HasClip() && diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 5856d887674..aed21a2b350 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1806,8 +1806,6 @@ ScrollFrameHelper::ScrollFrameHelper(nsContainerFrame* aOuter, , mResolution(1.0) , mScrollPosForLayerPixelAlignment(-1, -1) , mLastUpdateImagesPos(-1, -1) - , mAncestorClip(nullptr) - , mAncestorClipForCaret(nullptr) , mNeverHasVerticalScrollbar(false) , mNeverHasHorizontalScrollbar(false) , mHasVerticalScrollbar(false) @@ -2786,8 +2784,8 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, } // Clear the scroll port clip that was set during the last paint. - mAncestorClip = nullptr; - mAncestorClipForCaret = nullptr; + mAncestorClip = Nothing(); + mAncestorClipForCaret = Nothing(); // We put non-overlay scrollbars in their own layers when this is the root // scroll frame and we are a toplevel content document. In this situation, @@ -3028,7 +3026,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, // Capture the clip state of the parent scroll frame. This will be saved // on FrameMetrics for layers with this frame as their animated geoemetry // root. - mAncestorClipForCaret = aBuilder->ClipState().GetCurrentCombinedClip(aBuilder); + mAncestorClipForCaret = ToMaybe(aBuilder->ClipState().GetCurrentCombinedClip(aBuilder)); // Add the non-caret content box clip here so that it gets picked up by // mAncestorClip. @@ -3041,7 +3039,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, clipStateNonCaret->ClipContainingBlockDescendants(*contentBoxClipForNonCaretContent); } } - mAncestorClip = aBuilder->ClipState().GetCurrentCombinedClip(aBuilder); + mAncestorClip = ToMaybe(aBuilder->ClipState().GetCurrentCombinedClip(aBuilder)); // If we are using a display port, then ignore any pre-existing clip // passed down from our parents. The pre-existing clip would just defeat @@ -3121,12 +3119,12 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, scrolledContent.MoveTo(aLists); } -const DisplayItemClip* +Maybe ScrollFrameHelper::ComputeScrollClip(bool aIsForCaret) const { - const DisplayItemClip* ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip; + const Maybe& ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip; if (!mShouldBuildScrollableLayer || mIsScrollableLayerInRootContainer) { - return nullptr; + return Nothing(); } return ancestorClip; @@ -3148,7 +3146,7 @@ ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer, needsParentLayerClip = false; } - const DisplayItemClip* ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip; + const Maybe& ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip; nsPoint toReferenceFrame = mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame); bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument(); diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index da35f5e2b45..f02bcfb3db6 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -382,7 +382,7 @@ public: Layer* aLayer, nsIFrame* aContainerReferenceFrame, const ContainerLayerParameters& aParameters, bool aIsForCaret) const; - virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const; + virtual mozilla::Maybe ComputeScrollClip(bool aIsForCaret) const; // nsIScrollbarMediator void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection, @@ -461,9 +461,9 @@ public: FrameMetrics::ViewID mScrollParentID; - // The scroll port clip. Only valid during painting. - const DisplayItemClip* mAncestorClip; - const DisplayItemClip* mAncestorClipForCaret; + // The scroll port clip. + Maybe mAncestorClip; + Maybe mAncestorClipForCaret; bool mNeverHasVerticalScrollbar:1; bool mNeverHasHorizontalScrollbar:1; @@ -845,7 +845,7 @@ public: { return mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame, aParameters, aIsForCaret); } - virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const override + virtual mozilla::Maybe ComputeScrollClip(bool aIsForCaret) const override { return mHelper.ComputeScrollClip(aIsForCaret); } @@ -1245,7 +1245,7 @@ public: { return mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame, aParameters, aIsForCaret); } - virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const override + virtual mozilla::Maybe ComputeScrollClip(bool aIsForCaret) const override { return mHelper.ComputeScrollClip(aIsForCaret); } diff --git a/layout/generic/nsIScrollableFrame.h b/layout/generic/nsIScrollableFrame.h index eb7f611fbe0..57ba49377c3 100644 --- a/layout/generic/nsIScrollableFrame.h +++ b/layout/generic/nsIScrollableFrame.h @@ -11,6 +11,7 @@ #define nsIScrollFrame_h___ #include "nsCoord.h" +#include "DisplayItemClip.h" #include "ScrollbarStyles.h" #include "mozilla/Maybe.h" #include "mozilla/gfx/Point.h" @@ -32,7 +33,6 @@ class nsDisplayListBuilder; namespace mozilla { struct ContainerLayerParameters; -class DisplayItemClip; namespace layers { class Layer; } // namespace layers @@ -40,7 +40,7 @@ class Layer; struct FrameMetricsAndClip { layers::FrameMetrics metrics; - const DisplayItemClip* clip; + mozilla::Maybe clip; }; } // namespace mozilla @@ -449,7 +449,7 @@ public: */ virtual bool UsesContainerScrolling() const = 0; - virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const = 0; + virtual mozilla::Maybe ComputeScrollClip(bool aIsForCaret) const = 0; }; #endif diff --git a/media/libstagefright/binding/H264.cpp b/media/libstagefright/binding/H264.cpp index ce8d555389c..950e3c0bcf6 100644 --- a/media/libstagefright/binding/H264.cpp +++ b/media/libstagefright/binding/H264.cpp @@ -26,7 +26,6 @@ public: uint32_t ReadBits(size_t aNum) { - MOZ_ASSERT(mBitReader.numBitsLeft()); MOZ_ASSERT(aNum <= 32); if (mBitReader.numBitsLeft() < aNum) { return 0; @@ -48,7 +47,10 @@ public: i++; } if (i == 32) { - MOZ_ASSERT(false); + // This can happen if the data is invalid, or if it's + // short, since ReadBit() will return 0 when it runs + // off the end of the buffer. + NS_WARNING("Invalid H.264 data"); return 0; } uint32_t r = ReadBits(i); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index b56da1696e0..39dc123ff80 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -2543,9 +2543,9 @@ pref("dom.ipc.plugins.unloadTimeoutSecs", 30); // Asynchronous plugin initialization should only be enabled on non-e10s // channels until some remaining bugs are resolved. #ifdef E10S_TESTING_ONLY -pref("dom.ipc.plugins.asyncInit", false); +pref("dom.ipc.plugins.asyncInit.enabled", false); #else -pref("dom.ipc.plugins.asyncInit", true); +pref("dom.ipc.plugins.asyncInit.enabled", true); #endif pref("dom.ipc.processCount", 1); diff --git a/testing/mochitest/Makefile.in b/testing/mochitest/Makefile.in index 21f6af9dc81..7d73e9d61cc 100644 --- a/testing/mochitest/Makefile.in +++ b/testing/mochitest/Makefile.in @@ -32,7 +32,6 @@ ifeq ($(OS_ARCH),WINNT) TEST_HARNESS_BINS += \ crashinject$(BIN_SUFFIX) \ crashinjectdll$(DLL_SUFFIX) \ - vmwarerecordinghelper$(DLL_SUFFIX) \ $(NULL) endif diff --git a/testing/mochitest/mochitest_options.py b/testing/mochitest/mochitest_options.py index ebf9e8d433e..64f3959fb92 100644 --- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -30,9 +30,6 @@ except ImportError: conditions = None -VMWARE_RECORDING_HELPER_BASENAME = "vmwarerecordinghelper" - - class ArgumentContainer(): __metaclass__ = ABCMeta @@ -290,14 +287,6 @@ class MochitestArguments(ArgumentContainer): "help": "Directory where testing-only JS modules are located.", "suppress": True, }], - [["--use-vmware-recording"], - {"action": "store_true", - "dest": "vmwareRecording", - "default": False, - "help": "Enables recording while the application is running inside a VMware " - "Workstation 7.0 or later VM.", - "suppress": True, - }], [["--repeat"], {"type": int, "default": 0, @@ -627,16 +616,6 @@ class MochitestArguments(ArgumentContainer): elif not options.symbolsPath and build_obj: options.symbolsPath = os.path.join(build_obj.distdir, 'crashreporter-symbols') - if options.vmwareRecording: - if not mozinfo.isWin: - parser.error( - "use-vmware-recording is only supported on Windows.") - options.vmwareHelperPath = os.path.join( - options.utilityPath, VMWARE_RECORDING_HELPER_BASENAME + ".dll") - if not os.path.exists(options.vmwareHelperPath): - parser.error("%s not found, cannot automate VMware recording." % - options.vmwareHelperPath) - if options.webapprtContent and options.webapprtChrome: parser.error( "Only one of --webapprt-content and --webapprt-chrome may be given.") diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index 201cfd77e6d..0dc8cafa947 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -1217,7 +1217,6 @@ class Mochitest(MochitestUtilsMixin): _active_tests = None certdbNew = False sslTunnel = None - vmwareHelper = None DEFAULT_TIMEOUT = 60.0 mediaDevices = None @@ -1624,37 +1623,6 @@ class Mochitest(MochitestUtilsMixin): return foundZombie - def startVMwareRecording(self, options): - """ starts recording inside VMware VM using the recording helper dll """ - assert mozinfo.isWin - from ctypes import cdll - self.vmwareHelper = cdll.LoadLibrary(self.vmwareHelperPath) - if self.vmwareHelper is None: - self.log.warning("runtests.py | Failed to load " - "VMware recording helper") - return - self.log.info("runtests.py | Starting VMware recording.") - try: - self.vmwareHelper.StartRecording() - except Exception as e: - self.log.warning("runtests.py | Failed to start " - "VMware recording: (%s)" % str(e)) - self.vmwareHelper = None - - def stopVMwareRecording(self): - """ stops recording inside VMware VM using the recording helper dll """ - try: - assert mozinfo.isWin - if self.vmwareHelper is not None: - self.log.info("runtests.py | Stopping VMware recording.") - self.vmwareHelper.StopRecording() - except Exception as e: - self.log.warning("runtests.py | Failed to stop " - "VMware recording: (%s)" % str(e)) - self.log.exception('Error stopping VMWare recording') - - self.vmwareHelper = None - def runApp(self, testUrl, env, @@ -2242,9 +2210,6 @@ class Mochitest(MochitestUtilsMixin): else: timeout = 330.0 # default JS harness timeout is 300 seconds - if options.vmwareRecording: - self.startVMwareRecording(options) - # detect shutdown leaks for m-bc runs detectShutdownLeaks = mozinfo.info[ "debug"] and options.browserChrome and not options.webapprtChrome @@ -2276,8 +2241,6 @@ class Mochitest(MochitestUtilsMixin): status = 1 finally: - if options.vmwareRecording: - self.stopVMwareRecording() self.stopServers() mozleak.process_leak_log( diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 1731e0eccf5..841bb2d18d7 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -7334,6 +7334,13 @@ "n_values": 3, "description": "A simple counter of daily mixed-content unblock operations and top documents loaded" }, + "MIXED_CONTENT_HSTS": { + "alert_emails": ["seceng@mozilla.org"], + "expires_in_version": "never", + "kind": "enumerated", + "n_values": 10, + "description": "How often would blocked mixed content be allowed if HSTS upgrades were allowed? 0=display/no-HSTS, 1=display/HSTS, 2=active/no-HSTS, 3=active/HSTS" + }, "NTLM_MODULE_USED_2": { "expires_in_version": "never", "kind": "enumerated", diff --git a/toolkit/components/telemetry/TelemetryEnvironment.jsm b/toolkit/components/telemetry/TelemetryEnvironment.jsm index 8a395f55656..a24305c10a3 100644 --- a/toolkit/components/telemetry/TelemetryEnvironment.jsm +++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm @@ -111,7 +111,7 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([ ["devtools.chrome.enabled", {what: RECORD_PREF_VALUE}], ["devtools.debugger.enabled", {what: RECORD_PREF_VALUE}], ["devtools.debugger.remote-enabled", {what: RECORD_PREF_VALUE}], - ["dom.ipc.plugins.asyncInit", {what: RECORD_PREF_VALUE}], + ["dom.ipc.plugins.asyncInit.enabled", {what: RECORD_PREF_VALUE}], ["dom.ipc.plugins.enabled", {what: RECORD_PREF_VALUE}], ["dom.ipc.processCount", {what: RECORD_PREF_VALUE, requiresRestart: true}], ["experiments.manifest.uri", {what: RECORD_PREF_VALUE}], diff --git a/toolkit/components/telemetry/TelemetrySession.jsm b/toolkit/components/telemetry/TelemetrySession.jsm index b37a14a5171..d826e1a2bd8 100644 --- a/toolkit/components/telemetry/TelemetrySession.jsm +++ b/toolkit/components/telemetry/TelemetrySession.jsm @@ -56,7 +56,7 @@ const LOGGER_PREFIX = "TelemetrySession" + (Utils.isContentProcess ? "#content:: const PREF_BRANCH = "toolkit.telemetry."; const PREF_PREVIOUS_BUILDID = PREF_BRANCH + "previousBuildID"; const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled"; -const PREF_ASYNC_PLUGIN_INIT = "dom.ipc.plugins.asyncInit"; +const PREF_ASYNC_PLUGIN_INIT = "dom.ipc.plugins.asyncInit.enabled"; const PREF_UNIFIED = PREF_BRANCH + "unified"; diff --git a/widget/cocoa/VibrancyManager.mm b/widget/cocoa/VibrancyManager.mm index c2cecc17a83..90dea1b9d9d 100644 --- a/widget/cocoa/VibrancyManager.mm +++ b/widget/cocoa/VibrancyManager.mm @@ -211,6 +211,12 @@ enum { }; #endif +#if !defined(MAC_OS_X_VERSION_10_11) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11 +enum { + NSVisualEffectMaterialMenu = 5 +}; +#endif + static NSUInteger VisualEffectStateForVibrancyType(VibrancyType aType) { @@ -263,13 +269,14 @@ VibrancyManager::CreateEffectView(VibrancyType aType, NSRect aRect) [effectView setState:VisualEffectStateForVibrancyType(aType)]; if (aType == VibrancyType::MENU) { - // NSVisualEffectMaterialTitlebar doesn't match the native menu look - // perfectly but comes pretty close. Ideally we'd use a material with - // materialTypeName "MacLight", since that's what menus use, but there's - // no entry with that material in the internalMaterialType-to- - // CGSWindowBackdropViewSpec table which NSVisualEffectView consults when - // setting up the effect. - [effectView setMaterial:NSVisualEffectMaterialTitlebar]; + if (nsCocoaFeatures::OnElCapitanOrLater()) { + [effectView setMaterial:NSVisualEffectMaterialMenu]; + } else { + // Before 10.11 there is no material that perfectly matches the menu + // look. Of all available material types, NSVisualEffectMaterialTitlebar + // is the one that comes closest. + [effectView setMaterial:NSVisualEffectMaterialTitlebar]; + } } else if (aType == VibrancyType::HIGHLIGHTED_MENUITEM) { [effectView setMaterial:NSVisualEffectMaterialMenuItem]; if ([effectView respondsToSelector:@selector(setEmphasized:)]) { diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index d453f88f906..8f67a2afa2d 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -6565,7 +6565,7 @@ HandleEvent(CGEventTapProxy aProxy, CGEventType aType, [self performSelector:@selector(shutdownAndReleaseCalledOnEventThread) onThread:mThread withObject:nil waitUntilDone:NO]; } -static const CGEventField kCGWindowNumberField = 51; +static const CGEventField kCGWindowNumberField = (const CGEventField) 51; // Called on scroll thread - (void)handleEvent:(CGEventRef)cgEvent type:(CGEventType)type diff --git a/widget/cocoa/nsCocoaFeatures.h b/widget/cocoa/nsCocoaFeatures.h index bb0ebcb4f31..14eb3bef525 100644 --- a/widget/cocoa/nsCocoaFeatures.h +++ b/widget/cocoa/nsCocoaFeatures.h @@ -22,6 +22,7 @@ public: static bool OnMountainLionOrLater(); static bool OnMavericksOrLater(); static bool OnYosemiteOrLater(); + static bool OnElCapitanOrLater(); static bool AccelerateByDefault(); static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0); diff --git a/widget/cocoa/nsCocoaFeatures.mm b/widget/cocoa/nsCocoaFeatures.mm index ca84e9bf309..fee8d329f35 100644 --- a/widget/cocoa/nsCocoaFeatures.mm +++ b/widget/cocoa/nsCocoaFeatures.mm @@ -18,6 +18,7 @@ #define MAC_OS_X_VERSION_10_8_HEX 0x00001080 #define MAC_OS_X_VERSION_10_9_HEX 0x00001090 #define MAC_OS_X_VERSION_10_10_HEX 0x000010A0 +#define MAC_OS_X_VERSION_10_11_HEX 0x000010B0 #include "nsCocoaFeatures.h" #include "nsCocoaUtils.h" @@ -172,6 +173,12 @@ nsCocoaFeatures::OnYosemiteOrLater() return (OSXVersion() >= MAC_OS_X_VERSION_10_10_HEX); } +/* static */ bool +nsCocoaFeatures::OnElCapitanOrLater() +{ + return (OSXVersion() >= MAC_OS_X_VERSION_10_11_HEX); +} + /* static */ bool nsCocoaFeatures::AccelerateByDefault() {