Skip to content

Commit

Permalink
Merge m-i to m-c, a=merge
Browse files Browse the repository at this point in the history
CLOSED TREE
  • Loading branch information
philor committed Sep 10, 2015
2 parents d14aca3 + bd0011b commit 2256507
Show file tree
Hide file tree
Showing 33 changed files with 187 additions and 172 deletions.
5 changes: 5 additions & 0 deletions accessible/windows/msaa/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<HyperTextAccessibleWrap*>(wrapper->AsHyperText());
if (text) {
ia2AccessibleText::UpdateTextChangeData(text, aInsert, aStr, aStart, aLen);
Expand Down
3 changes: 0 additions & 3 deletions build/win32/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down
15 changes: 0 additions & 15 deletions build/win32/vmwarerecordinghelper/moz.build

This file was deleted.

34 changes: 0 additions & 34 deletions build/win32/vmwarerecordinghelper/vmwarerecordinghelper.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions build/win32/vmwarerecordinghelper/vmwarerecordinghelper.def

This file was deleted.

5 changes: 3 additions & 2 deletions dom/html/HTMLInputElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
12 changes: 12 additions & 0 deletions dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -4175,6 +4176,17 @@ ContentParent::RecvIsSecureURI(const uint32_t& type,
return NS_SUCCEEDED(rv);
}

bool
ContentParent::RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive)
{
nsCOMPtr<nsIURI> ourURI = DeserializeURI(aURI);
if (!ourURI) {
return false;
}
nsMixedContentBlocker::AccumulateMixedContentHSTS(ourURI, aActive);
return true;
}

bool
ContentParent::RecvLoadURIExternal(const URIParams& uri)
{
Expand Down
2 changes: 2 additions & 0 deletions dom/ipc/ContentParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ class ContentParent final : public PContentParent
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;
Expand Down
4 changes: 3 additions & 1 deletion dom/ipc/PContent.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -788,7 +790,7 @@ parent:
PFMRadio();

PWebrtcGlobal();

PPresentation();

// Services remoting
Expand Down
1 change: 1 addition & 0 deletions dom/ipc/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ LOCAL_INCLUDES += [
'/dom/geolocation',
'/dom/media/webspeech/synth/ipc',
'/dom/mobilemessage/ipc',
'/dom/security',
'/dom/storage',
'/dom/workers',
'/editor/libeditor',
Expand Down
2 changes: 1 addition & 1 deletion dom/plugins/ipc/PluginModuleParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 4 additions & 2 deletions dom/security/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ UNIFIED_SOURCES += [
'SRIMetadata.cpp',
]

include('/ipc/chromium/chromium-config.mozbuild')

FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/caps',
'/netwerk/base',
]

if CONFIG['GNU_CC']:
CFLAGS += ['-Wshadow', '-Wformat-security']
CXXFLAGS += ['-Wshadow', '-Wformat-security']
CFLAGS += ['-Wformat-security']
CXXFLAGS += ['-Wformat-security']
86 changes: 84 additions & 2 deletions dom/security/nsMixedContentBlocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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<nsISiteSecurityService> 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);
}
}
}
1 change: 1 addition & 0 deletions dom/security/nsMixedContentBlocker.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class nsMixedContentBlocker : public nsIContentPolicy,
nsISupports* aExtra,
nsIPrincipal* aRequestPrincipal,
int16_t* aDecision);
static void AccumulateMixedContentHSTS(nsIURI* aURI, bool aActive);
static bool sBlockMixedScript;
static bool sBlockMixedDisplay;
};
Expand Down
10 changes: 6 additions & 4 deletions dom/xbl/nsXBLService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<nsIURI*, 6> uris;
nsAutoTArray<nsCOMPtr<nsIURI>, 6> uris;
return GetBinding(aBoundElement, aURI, aPeekOnly, aOriginPrincipal, aIsReady,
aResult, uris);
}
Expand Down Expand Up @@ -708,7 +708,7 @@ nsresult
nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
bool aPeekOnly, nsIPrincipal* aOriginPrincipal,
bool* aIsReady, nsXBLBinding** aResult,
nsTArray<nsIURI*>& aDontExtendURIs)
nsTArray<nsCOMPtr<nsIURI>>& aDontExtendURIs)
{
NS_ASSERTION(aPeekOnly || aResult,
"Must have non-null out param if not just peeking to see "
Expand Down Expand Up @@ -784,7 +784,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
rv = protoBinding->ResolveBaseBinding();
NS_ENSURE_SUCCESS(rv, rv);

nsIURI* baseBindingURI;
nsCOMPtr<nsIURI> baseBindingURI;
nsXBLPrototypeBinding* baseProto = protoBinding->GetBasePrototype();
if (baseProto) {
baseBindingURI = baseProto->BindingURI();
Expand Down Expand Up @@ -818,7 +818,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,

nsRefPtr<nsXBLBinding> baseBinding;
if (baseBindingURI) {
nsIContent* child = protoBinding->GetBindingElement();
nsCOMPtr<nsIContent> child = protoBinding->GetBindingElement();
rv = GetBinding(aBoundElement, baseBindingURI, aPeekOnly,
child->NodePrincipal(), aIsReady,
getter_AddRefs(baseBinding), aDontExtendURIs);
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dom/xbl/nsXBLService.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class nsXBLService final : public nsSupportsWeakReference
nsresult GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
bool aPeekFlag, nsIPrincipal* aOriginPrincipal,
bool* aIsReady, nsXBLBinding** aResult,
nsTArray<nsIURI*>& aDontExtendURIs);
nsTArray<nsCOMPtr<nsIURI>>& aDontExtendURIs);

// MEMBER VARIABLES
public:
Expand Down
12 changes: 7 additions & 5 deletions js/src/jit/arm/CodeGenerator-arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading

0 comments on commit 2256507

Please sign in to comment.