merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2014-12-03 13:29:00 +01:00
commit c1415db52b
31 changed files with 840 additions and 763 deletions

View File

@ -583,7 +583,6 @@ MP4Reader::Update(TrackType aTrack)
bool needInput = false;
bool needOutput = false;
bool eos = false;
auto& decoder = GetDecoderData(aTrack);
nsRefPtr<MediaData> output;
{
@ -599,7 +598,6 @@ MP4Reader::Update(TrackType aTrack)
output = decoder.mOutput[0];
decoder.mOutput.RemoveElementAt(0);
}
eos = decoder.mEOS;
}
VLOG("Update(%s) ni=%d no=%d iex=%d or=%d fl=%d",
TrackTypeToStr(aTrack),
@ -617,16 +615,15 @@ MP4Reader::Update(TrackType aTrack)
{
MonitorAutoLock lock(decoder.mMonitor);
MOZ_ASSERT(!decoder.mEOS);
eos = decoder.mEOS = true;
decoder.mEOS = true;
}
// DrainComplete takes care of reporting EOS upwards
decoder.mDecoder->Drain();
}
}
if (needOutput) {
if (output) {
ReturnOutput(output, aTrack);
} else if (eos) {
ReturnEOS(aTrack);
}
}
}
@ -730,9 +727,14 @@ void
MP4Reader::DrainComplete(TrackType aTrack)
{
DecoderData& data = GetDecoderData(aTrack);
MonitorAutoLock mon(data.mMonitor);
data.mDrainComplete = true;
mon.NotifyAll();
bool eos;
{
MonitorAutoLock mon(data.mMonitor);
eos = data.mEOS;
}
if (eos) {
ReturnEOS(aTrack);
}
}
void
@ -771,7 +773,6 @@ MP4Reader::Flush(TrackType aTrack)
{
MonitorAutoLock mon(data.mMonitor);
data.mIsFlushing = true;
data.mDrainComplete = false;
data.mEOS = false;
}
data.mDecoder->Flush();

View File

@ -156,7 +156,6 @@ private:
, mInputExhausted(false)
, mError(false)
, mIsFlushing(false)
, mDrainComplete(false)
, mOutputRequested(false)
, mUpdateScheduled(false)
, mEOS(false)
@ -186,7 +185,6 @@ private:
bool mInputExhausted;
bool mError;
bool mIsFlushing;
bool mDrainComplete;
bool mOutputRequested;
bool mUpdateScheduled;
bool mEOS;

View File

@ -28,10 +28,9 @@ function startTest(test, token)
var v1 = SetupEME(test, case1token, { onSetKeysFail: setKeysFailed });
var context = new AudioContext();
var node = context.createMediaElementSource(v1);
v1.preload = "auto"; // Required due to "canplay" not firing for MSE unless we do this.
v1.addEventListener("error", bail(case1token + " got error event"));
v1.addEventListener("canplay", function(ev) {
ok(false, TimeStamp(case1token) + " should never reach canplay, as setMediaKeys should fail");
v1.addEventListener("loadeddata", function(ev) {
ok(false, TimeStamp(case1token) + " should never reach loadeddata, as setMediaKeys should fail");
});
manager.started(case1token);
LoadTest(test, v1, case1token);
@ -40,10 +39,9 @@ function startTest(test, token)
// Case 2. creating a MediaElementSource on a media element with a MediaKeys should fail.
var case2token = token + "_case2";
var v2 = SetupEME(test, case2token);
v2.preload = "auto"; // Required due to "canplay" not firing for MSE unless we do this.
v2.addEventListener("error", bail(case2token + " got error event"));
v2.addEventListener("canplay", function(ev) {
ok(true, case2token + " should reach canplay");
v2.addEventListener("loadeddata", function(ev) {
ok(true, case2token + " should reach loadeddata");
var threw = false;
try {
var context = new AudioContext();
@ -61,10 +59,9 @@ function startTest(test, token)
// Case 3. capturing a media element with mozCaptureStream that has a MediaKeys should fail.
var case3token = token + "_case3";
var v3 = SetupEME(test, case3token);
v3.preload = "auto"; // Required due to "canplay" not firing for MSE unless we do this.
v3.addEventListener("error", bail(case3token + " got error event"));
v3.addEventListener("canplay", function(ev) {
ok(true, TimeStamp(case3token) + " should reach canplay");
v3.addEventListener("loadeddata", function(ev) {
ok(true, TimeStamp(case3token) + " should reach loadeddata");
var threw = false;
try {
var stream = v3.mozCaptureStreamUntilEnded();

View File

@ -26,9 +26,8 @@
#include "OggReader.h"
// IntelWebMVideoDecoder uses the WMF backend, which is Windows Vista+ only.
#if defined(MOZ_FMP4) && defined(MOZ_WMF)
#if defined(MOZ_PDM_VPX)
#include "IntelWebMVideoDecoder.h"
#define MOZ_PDM_VPX 1
#endif
// Un-comment to enable logging of seek bisections.

View File

@ -19,7 +19,8 @@ UNIFIED_SOURCES += [
'WebMReader.cpp',
]
if CONFIG['MOZ_FMP4']:
if CONFIG['MOZ_FMP4'] and CONFIG['MOZ_WMF']:
DEFINES['MOZ_PDM_VPX'] = True
UNIFIED_SOURCES += ['IntelWebMVideoDecoder.cpp']
if CONFIG['MOZ_WEBM_ENCODER']:

View File

@ -47,6 +47,56 @@ CSPService::~CSPService()
NS_IMPL_ISUPPORTS(CSPService, nsIContentPolicy, nsIChannelEventSink)
// Helper function to identify protocols not subject to CSP.
bool
subjectToCSP(nsIURI* aURI) {
// The three protocols: data:, blob: and filesystem: share the same
// protocol flag (URI_IS_LOCAL_RESOURCE) with other protocols, like
// chrome:, resource:, moz-icon:, but those three protocols get
// special attention in CSP and are subject to CSP, hence we have
// to make sure those protocols are subject to CSP, see:
// http://www.w3.org/TR/CSP2/#source-list-guid-matching
bool match = false;
nsresult rv = aURI->SchemeIs("data", &match);
if (NS_SUCCEEDED(rv) && match) {
return true;
}
rv = aURI->SchemeIs("blob", &match);
if (NS_SUCCEEDED(rv) && match) {
return true;
}
rv = aURI->SchemeIs("filesystem", &match);
if (NS_SUCCEEDED(rv) && match) {
return true;
}
// finally we have to whitelist "about:" which does not fall in
// any of the two categories underneath but is not subject to CSP.
rv = aURI->SchemeIs("about", &match);
if (NS_SUCCEEDED(rv) && match) {
return false;
}
// Other protocols are not subject to CSP and can be whitelisted:
// * URI_IS_LOCAL_RESOURCE
// e.g. chrome:, data:, blob:, resource:, moz-icon:
// * URI_INHERITS_SECURITY_CONTEXT
// e.g. javascript:
//
// Please note that it should be possible for websites to
// whitelist their own protocol handlers with respect to CSP,
// hence we use protocol flags to accomplish that.
rv = NS_URIChainHasFlags(aURI, nsIProtocolHandler::URI_IS_LOCAL_RESOURCE, &match);
if (NS_SUCCEEDED(rv) && match) {
return false;
}
rv = NS_URIChainHasFlags(aURI, nsIProtocolHandler::URI_INHERITS_SECURITY_CONTEXT, &match);
if (NS_SUCCEEDED(rv) && match) {
return false;
}
// all other protocols are subject To CSP.
return true;
}
/* nsIContentPolicy implementation */
NS_IMETHODIMP
CSPService::ShouldLoad(uint32_t aContentType,
@ -58,8 +108,9 @@ CSPService::ShouldLoad(uint32_t aContentType,
nsIPrincipal *aRequestPrincipal,
int16_t *aDecision)
{
if (!aContentLocation)
if (!aContentLocation) {
return NS_ERROR_FAILURE;
}
#ifdef PR_LOGGING
{
@ -73,26 +124,14 @@ CSPService::ShouldLoad(uint32_t aContentType,
// default decision, CSP can revise it if there's a policy to enforce
*aDecision = nsIContentPolicy::ACCEPT;
// No need to continue processing if CSP is disabled
if (!sCSPEnabled)
// No need to continue processing if CSP is disabled or if the protocol
// is *not* subject to CSP.
// Please note, the correct way to opt-out of CSP using a custom
// protocolHandler is to set one of the nsIProtocolHandler flags
// that are whitelistet in subjectToCSP()
if (!sCSPEnabled || !subjectToCSP(aContentLocation)) {
return NS_OK;
// shortcut for about: chrome: and resource: and javascript: uris since
// they're not subject to CSP content policy checks.
bool schemeMatch = false;
NS_ENSURE_SUCCESS(aContentLocation->SchemeIs("about", &schemeMatch), NS_OK);
if (schemeMatch)
return NS_OK;
NS_ENSURE_SUCCESS(aContentLocation->SchemeIs("chrome", &schemeMatch), NS_OK);
if (schemeMatch)
return NS_OK;
NS_ENSURE_SUCCESS(aContentLocation->SchemeIs("resource", &schemeMatch), NS_OK);
if (schemeMatch)
return NS_OK;
NS_ENSURE_SUCCESS(aContentLocation->SchemeIs("javascript", &schemeMatch), NS_OK);
if (schemeMatch)
return NS_OK;
}
// These content types are not subject to CSP content policy checks:
// TYPE_CSP_REPORT -- csp can't block csp reports

View File

@ -105,6 +105,23 @@ GetLoadContext(nsIEditor* aEditor)
return loadContext.forget();
}
/**
* Helper function for converting underscore to dash in dictionary name,
* ie. en_CA to en-CA. This is required for some Linux distributions which
* use underscore as separator in system-wide installed dictionaries.
* We use it for nsStyleUtil::DashMatchCompare.
*/
static nsString
GetDictNameWithDash(const nsAString& aDictName)
{
nsString dictNameWithDash(aDictName);
int32_t underScore = dictNameWithDash.FindChar('_');
if (underScore != -1) {
dictNameWithDash.Replace(underScore, 1, '-');
}
return dictNameWithDash;
}
/**
* Fetches the dictionary stored in content prefs and maintains state during the
* fetch, which is asynchronous.
@ -603,8 +620,8 @@ nsEditorSpellCheck::SetCurrentDictionary(const nsAString& aDictionary)
} else {
langCode.Assign(aDictionary);
}
if (mPreferredLang.IsEmpty() || !nsStyleUtil::DashMatchCompare(mPreferredLang, langCode, comparator)) {
if (mPreferredLang.IsEmpty() ||
!nsStyleUtil::DashMatchCompare(GetDictNameWithDash(mPreferredLang), langCode, comparator)) {
// When user sets dictionary manually, we store this value associated
// with editor url.
StoreCurrentDictionary(mEditor, aDictionary);
@ -750,12 +767,6 @@ nsEditorSpellCheck::DictionaryFetched(DictionaryFetcher* aFetcher)
// otherwise, get language from preferences
nsAutoString preferedDict(Preferences::GetLocalizedString("spellchecker.dictionary"));
// Replace '_' with '-' in case the user has an underscore stored in their
// pref, see bug 992118 for how this could have happened.
int32_t underScore = preferedDict.FindChar('_');
if (underScore != -1) {
preferedDict.Replace(underScore, 1, '-');
}
if (dictName.IsEmpty()) {
dictName.Assign(preferedDict);
}
@ -794,8 +805,8 @@ nsEditorSpellCheck::DictionaryFetched(DictionaryFetcher* aFetcher)
// try dictionary.spellchecker preference if it starts with langCode (and
// if we haven't tried it already)
if (!preferedDict.IsEmpty() && !dictName.Equals(preferedDict) &&
nsStyleUtil::DashMatchCompare(preferedDict, langCode, comparator)) {
if (!preferedDict.IsEmpty() && !dictName.Equals(preferedDict) &&
nsStyleUtil::DashMatchCompare(GetDictNameWithDash(preferedDict), langCode, comparator)) {
rv = SetCurrentDictionary(preferedDict);
}
@ -823,8 +834,7 @@ nsEditorSpellCheck::DictionaryFetched(DictionaryFetcher* aFetcher)
// We have already tried it
continue;
}
if (nsStyleUtil::DashMatchCompare(dictStr, langCode, comparator) &&
if (nsStyleUtil::DashMatchCompare(GetDictNameWithDash(dictStr), langCode, comparator) &&
NS_SUCCEEDED(SetCurrentDictionary(dictStr))) {
break;
}

View File

@ -266,9 +266,9 @@ class UnboundnessFixer
{
CGRect mClipBounds;
CGLayerRef mLayer;
CGContextRef mCg;
CGContextRef mLayerCg;
public:
UnboundnessFixer() : mCg(nullptr) {}
UnboundnessFixer() : mLayerCg(nullptr) {}
CGContextRef Check(CGContextRef baseCg, CompositionOp blend, const Rect* maskBounds = nullptr)
{
@ -287,14 +287,14 @@ class UnboundnessFixer
//XXX: The size here is in default user space units, of the layer relative to the graphics context.
// is the clip bounds still correct if, for example, we have a scale applied to the context?
mLayer = CGLayerCreateWithContext(baseCg, mClipBounds.size, nullptr);
mCg = CGLayerGetContext(mLayer);
mLayerCg = CGLayerGetContext(mLayer);
// CGContext's default to have the origin at the bottom left
// so flip it to the top left and adjust for the origin
// of the layer
CGContextTranslateCTM(mCg, -mClipBounds.origin.x, mClipBounds.origin.y + mClipBounds.size.height);
CGContextScaleCTM(mCg, 1, -1);
CGContextTranslateCTM(mLayerCg, -mClipBounds.origin.x, mClipBounds.origin.y + mClipBounds.size.height);
CGContextScaleCTM(mLayerCg, 1, -1);
return mCg;
return mLayerCg;
} else {
return baseCg;
}
@ -302,12 +302,13 @@ class UnboundnessFixer
void Fix(CGContextRef baseCg)
{
if (mCg) {
if (mLayerCg) {
// we pushed a layer so draw it to baseCg
CGContextTranslateCTM(baseCg, 0, mClipBounds.size.height);
CGContextScaleCTM(baseCg, 1, -1);
mClipBounds.origin.y *= -1;
CGContextDrawLayerAtPoint(baseCg, mClipBounds.origin, mLayer);
CGContextRelease(mCg);
CGContextRelease(mLayerCg);
}
}
};

View File

@ -1,3 +1,3 @@
#define ANGLE_COMMIT_HASH "f0cacb827771"
#define ANGLE_COMMIT_HASH "0fb6a60df77b"
#define ANGLE_COMMIT_HASH_SIZE 12
#define ANGLE_COMMIT_DATE "2014-10-28 23:00:12 -0400"
#define ANGLE_COMMIT_DATE "2014-11-28 13:56:37 -0500"

View File

@ -16,12 +16,14 @@
#include "common/debug.h"
#include "common/platform.h"
#ifdef ANGLE_ENABLE_D3D11
// DXGISwapChain and DXGIFactory are typedef'd to specific required
// types. The HWND NativeWindow implementation requires IDXGISwapChain
// and IDXGIFactory and the Windows Store NativeWindow
// implementation requires IDXGISwapChain1 and IDXGIFactory2.
typedef IDXGISwapChain DXGISwapChain;
typedef IDXGIFactory DXGIFactory;
#endif
namespace rx
{
@ -37,9 +39,11 @@ class NativeWindow
inline bool getClientRect(LPRECT rect) { return GetClientRect(mWindow, rect) == TRUE; }
inline bool isIconic() { return IsIconic(mWindow) == TRUE; }
#ifdef ANGLE_ENABLE_D3D11
HRESULT createSwapChain(ID3D11Device* device, DXGIFactory* factory,
DXGI_FORMAT format, UINT width, UINT height,
DXGISwapChain** swapChain);
#endif
inline EGLNativeWindowType getNativeWindow() const { return mWindow; }

View File

@ -20,6 +20,7 @@ NativeWindow::NativeWindow(EGLNativeWindowType window) : mWindow(window)
{
}
#ifdef ANGLE_ENABLE_D3D11
HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory,
DXGI_FORMAT format, unsigned int width, unsigned int height,
DXGISwapChain** swapChain)
@ -48,4 +49,5 @@ HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory
return factory->CreateSwapChain(device, &swapChainDesc, swapChain);
}
};
#endif
};

View File

@ -987,6 +987,22 @@ void PadDrawTargetOutFromRegion(RefPtr<DrawTarget> drawTarget, nsIntRegion &regi
return x;
}
static void ensure_memcpy(uint8_t *dst, uint8_t *src, size_t n, uint8_t *bitmap, int stride, int height)
{
if (src + n > bitmap + stride*height) {
MOZ_CRASH("long src memcpy");
}
if (src < bitmap) {
MOZ_CRASH("short src memcpy");
}
if (dst + n > bitmap + stride*height) {
MOZ_CRASH("long dst mempcy");
}
if (dst < bitmap) {
MOZ_CRASH("short dst mempcy");
}
}
static void visitor(void *closure, VisitSide side, int x1, int y1, int x2, int y2) {
LockedBits *lb = static_cast<LockedBits*>(closure);
uint8_t *bitmap = lb->data;
@ -999,12 +1015,14 @@ void PadDrawTargetOutFromRegion(RefPtr<DrawTarget> drawTarget, nsIntRegion &regi
if (y1 > 0) {
x1 = clamp(x1, 0, width - 1);
x2 = clamp(x2, 0, width - 1);
ensure_memcpy(&bitmap[x1*bpp + (y1-1) * stride], &bitmap[x1*bpp + y1 * stride], (x2 - x1) * bpp, bitmap, stride, height);
memcpy(&bitmap[x1*bpp + (y1-1) * stride], &bitmap[x1*bpp + y1 * stride], (x2 - x1) * bpp);
}
} else if (side == VisitSide::BOTTOM) {
if (y1 < height) {
x1 = clamp(x1, 0, width - 1);
x2 = clamp(x2, 0, width - 1);
ensure_memcpy(&bitmap[x1*bpp + y1 * stride], &bitmap[x1*bpp + (y1-1) * stride], (x2 - x1) * bpp, bitmap, stride, height);
memcpy(&bitmap[x1*bpp + y1 * stride], &bitmap[x1*bpp + (y1-1) * stride], (x2 - x1) * bpp);
}
} else if (side == VisitSide::LEFT) {

View File

@ -86,13 +86,15 @@ public:
*
* This class is used on the compositor side.
*/
class TextureSource
class TextureSource: public RefCounted<TextureSource>
{
public:
NS_INLINE_DECL_REFCOUNTING(TextureSource)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(TextureSource)
TextureSource();
virtual ~TextureSource();
/**
* Should be overridden in order to deallocate the data that is associated
* with the rendering backend, such as GL textures.
@ -159,7 +161,6 @@ public:
int NumCompositableRefs() const { return mCompositableCount; }
protected:
virtual ~TextureSource();
RefPtr<TextureSource> mNextSibling;
int mCompositableCount;

View File

@ -938,7 +938,15 @@ CompositorD3D11::VerifyBufferSize()
return;
}
mDefaultRT = nullptr;
if (mDefaultRT) {
// Make sure the texture, which belongs to the swapchain, is destroyed
// before resizing the swapchain.
if (mCurrentRT == mDefaultRT) {
mCurrentRT = nullptr;
}
MOZ_ASSERT(mDefaultRT->hasOneRef());
mDefaultRT = nullptr;
}
if (IsRunningInWindowsMetro()) {
hr = mSwapChain->ResizeBuffers(2, mSize.width, mSize.height,

View File

@ -454,7 +454,7 @@ js::gc::GCRuntime::markRuntime(JSTracer *trc,
if (!c->zone()->isCollecting())
c->markCrossCompartmentWrappers(trc);
}
Debugger::markCrossCompartmentDebuggerObjectReferents(trc);
Debugger::markAllCrossCompartmentEdges(trc);
}
AutoGCRooter::traceAll(trc);

View File

@ -550,14 +550,14 @@ IonBuilder::InliningStatus
IonBuilder::inlineArrayJoin(CallInfo &callInfo)
{
if (callInfo.argc() != 1 || callInfo.constructing())
return InliningStatus_Error;
return InliningStatus_NotInlined;
if (getInlineReturnType() != MIRType_String)
return InliningStatus_Error;
return InliningStatus_NotInlined;
if (callInfo.thisArg()->type() != MIRType_Object)
return InliningStatus_Error;
return InliningStatus_NotInlined;
if (callInfo.getArg(0)->type() != MIRType_String)
return InliningStatus_Error;
return InliningStatus_NotInlined;
callInfo.setImplicitlyUsedUnchecked();

View File

@ -2033,8 +2033,8 @@ MacroAssemblerMIPSCompat::store32(Register src, const Address &address)
void
MacroAssemblerMIPSCompat::store32(Imm32 src, const Address &address)
{
move32(src, ScratchRegister);
storePtr(ScratchRegister, address);
move32(src, SecondScratchReg);
storePtr(SecondScratchReg, address);
}
void
@ -2053,8 +2053,8 @@ template <typename T>
void
MacroAssemblerMIPSCompat::storePtr(ImmWord imm, T address)
{
ma_li(ScratchRegister, Imm32(imm.value));
ma_sw(ScratchRegister, address);
ma_li(SecondScratchReg, Imm32(imm.value));
ma_sw(SecondScratchReg, address);
}
template void MacroAssemblerMIPSCompat::storePtr<Address>(ImmWord imm, Address address);
@ -2074,8 +2074,8 @@ template <typename T>
void
MacroAssemblerMIPSCompat::storePtr(ImmGCPtr imm, T address)
{
ma_li(ScratchRegister, imm);
ma_sw(ScratchRegister, address);
ma_li(SecondScratchReg, imm);
ma_sw(SecondScratchReg, address);
}
template void MacroAssemblerMIPSCompat::storePtr<Address>(ImmGCPtr imm, Address address);

View File

@ -1675,36 +1675,36 @@ class AssemblerX86Shared : public AssemblerShared
MOZ_CRASH("unexpected operand kind");
}
}
void cmpps(const Operand &src, FloatRegister dest, uint8_t order) {
void cmpps(uint8_t order, const Operand &src, FloatRegister dest) {
MOZ_ASSERT(HasSSE2());
switch (src.kind()) {
case Operand::FPREG:
masm.cmpps_rr(src.fpu(), dest.code(), order);
masm.cmpps_rr(order, src.fpu(), dest.code());
break;
case Operand::MEM_REG_DISP:
masm.cmpps_mr(src.disp(), src.base(), dest.code(), order);
masm.cmpps_mr(order, src.disp(), src.base(), dest.code());
break;
case Operand::MEM_ADDRESS32:
masm.cmpps_mr(src.address(), dest.code(), order);
masm.cmpps_mr(order, src.address(), dest.code());
break;
default:
MOZ_CRASH("unexpected operand kind");
}
}
void cmpeqps(const Operand &src, FloatRegister dest) {
cmpps(src, dest, X86Assembler::ConditionCmp_EQ);
cmpps(X86Assembler::ConditionCmp_EQ, src, dest);
}
void cmpltps(const Operand &src, FloatRegister dest) {
cmpps(src, dest, X86Assembler::ConditionCmp_LT);
cmpps(X86Assembler::ConditionCmp_LT, src, dest);
}
void cmpleps(const Operand &src, FloatRegister dest) {
cmpps(src, dest, X86Assembler::ConditionCmp_LE);
cmpps(X86Assembler::ConditionCmp_LE, src, dest);
}
void cmpunordps(const Operand &src, FloatRegister dest) {
cmpps(src, dest, X86Assembler::ConditionCmp_UNORD);
cmpps(X86Assembler::ConditionCmp_UNORD, src, dest);
}
void cmpneqps(const Operand &src, FloatRegister dest) {
cmpps(src, dest, X86Assembler::ConditionCmp_NEQ);
cmpps(X86Assembler::ConditionCmp_NEQ, src, dest);
}
void rcpps(const Operand &src, FloatRegister dest) {
MOZ_ASSERT(HasSSE2());
@ -2173,13 +2173,13 @@ class AssemblerX86Shared : public AssemblerShared
MOZ_ASSERT(HasSSE2());
masm.sqrtss_rr(src.code(), dest.code());
}
void roundsd(FloatRegister src, FloatRegister dest, X86Assembler::RoundingMode mode) {
void roundsd(X86Assembler::RoundingMode mode, FloatRegister src, FloatRegister dest) {
MOZ_ASSERT(HasSSE41());
masm.roundsd_rr(src.code(), dest.code(), mode);
masm.roundsd_rr(mode, src.code(), dest.code());
}
void roundss(FloatRegister src, FloatRegister dest, X86Assembler::RoundingMode mode) {
void roundss(X86Assembler::RoundingMode mode, FloatRegister src, FloatRegister dest) {
MOZ_ASSERT(HasSSE41());
masm.roundss_rr(src.code(), dest.code(), mode);
masm.roundss_rr(mode, src.code(), dest.code());
}
unsigned insertpsMask(SimdLane sourceLane, SimdLane destLane, unsigned zeroMask = 0)
{

File diff suppressed because it is too large Load Diff

View File

@ -1688,7 +1688,7 @@ CodeGeneratorX86Shared::visitFloor(LFloor *lir)
return false;
// Round toward -Infinity.
masm.roundsd(input, scratch, X86Assembler::RoundDown);
masm.roundsd(X86Assembler::RoundDown, input, scratch);
if (!bailoutCvttsd2si(scratch, output, lir->snapshot()))
return false;
@ -1751,7 +1751,7 @@ CodeGeneratorX86Shared::visitFloorF(LFloorF *lir)
return false;
// Round toward -Infinity.
masm.roundss(input, scratch, X86Assembler::RoundDown);
masm.roundss(X86Assembler::RoundDown, input, scratch);
if (!bailoutCvttss2si(scratch, output, lir->snapshot()))
return false;
@ -1822,7 +1822,7 @@ CodeGeneratorX86Shared::visitCeil(LCeil *lir)
// x <= -1 or x > -0
masm.bind(&lessThanMinusOne);
// Round toward +Infinity.
masm.roundsd(input, scratch, X86Assembler::RoundUp);
masm.roundsd(X86Assembler::RoundUp, input, scratch);
return bailoutCvttsd2si(scratch, output, lir->snapshot());
}
@ -1878,7 +1878,7 @@ CodeGeneratorX86Shared::visitCeilF(LCeilF *lir)
// x <= -1 or x > -0
masm.bind(&lessThanMinusOne);
// Round toward +Infinity.
masm.roundss(input, scratch, X86Assembler::RoundUp);
masm.roundss(X86Assembler::RoundUp, input, scratch);
return bailoutCvttss2si(scratch, output, lir->snapshot());
}
@ -1958,7 +1958,7 @@ CodeGeneratorX86Shared::visitRound(LRound *lir)
// Add 0.5 and round toward -Infinity. The result is stored in the temp
// register (currently contains 0.5).
masm.addsd(input, temp);
masm.roundsd(temp, scratch, X86Assembler::RoundDown);
masm.roundsd(X86Assembler::RoundDown, temp, scratch);
// Truncate.
if (!bailoutCvttsd2si(scratch, output, lir->snapshot()))
@ -2049,7 +2049,7 @@ CodeGeneratorX86Shared::visitRoundF(LRoundF *lir)
// Add 0.5 and round toward -Infinity. The result is stored in the temp
// register (currently contains 0.5).
masm.addss(input, temp);
masm.roundss(temp, scratch, X86Assembler::RoundDown);
masm.roundss(X86Assembler::RoundDown, temp, scratch);
// Truncate.
if (!bailoutCvttss2si(scratch, output, lir->snapshot()))

View File

@ -2082,20 +2082,6 @@ size_t ArenaHeader::countUsedCells()
return Arena::thingsPerArena(getThingSize()) - countFreeCells();
}
/*
* Iterate throught the list and count the number of cells used.
*
* We may be able to precalculate this while sweeping and store the result
* somewhere.
*/
size_t ArenaList::countUsedCells()
{
size_t count = 0;
for (ArenaHeader *arena = head_; arena; arena = arena->next)
count += arena->countUsedCells();
return count;
}
ArenaHeader *
ArenaList::removeRemainingArenas(ArenaHeader **arenap, const AutoLockGC &lock)
{
@ -2153,7 +2139,12 @@ ArenaList::pickArenasToRelocate(JSRuntime *runtime)
ArenaHeader **arenap = cursorp_; // Next arena to consider
size_t previousFreeCells = 0; // Count of free cells before
size_t followingUsedCells = countUsedCells(); // Count of used cells after
// Count of used cells after arenap.
size_t followingUsedCells = 0;
for (ArenaHeader *arena = *arenap; arena; arena = arena->next)
followingUsedCells += arena->countUsedCells();
mozilla::DebugOnly<size_t> lastFreeCells(0);
size_t cellsPerArena = Arena::thingsPerArena((*arenap)->getThingSize());
@ -2662,7 +2653,7 @@ GCRuntime::updatePointersToRelocatedCells()
// Mark roots to update them.
markRuntime(&trc, MarkRuntime);
Debugger::markAll(&trc);
Debugger::markCrossCompartmentDebuggerObjectReferents(&trc);
Debugger::markAllCrossCompartmentEdges(&trc);
for (GCCompartmentsIter c(rt); !c.done(); c.next()) {
WeakMapBase::markAll(c, &trc);

View File

@ -503,7 +503,6 @@ class ArenaList {
}
#ifdef JSGC_COMPACTING
size_t countUsedCells();
ArenaHeader *removeRemainingArenas(ArenaHeader **arenap, const AutoLockGC &lock);
ArenaHeader *pickArenasToRelocate(JSRuntime *runtime);
ArenaHeader *relocateArenas(ArenaHeader *toRelocate, ArenaHeader *relocated);

View File

@ -93,6 +93,11 @@ enum {
JSSLOT_DEBUGSOURCE_COUNT
};
void DebuggerObject_trace(JSTracer *trc, JSObject *obj);
void DebuggerEnv_trace(JSTracer *trc, JSObject *obj);
void DebuggerScript_trace(JSTracer *trc, JSObject *obj);
void DebuggerSource_trace(JSTracer *trc, JSObject *obj);
/*** Utils ***************************************************************************************/
@ -2073,17 +2078,12 @@ Debugger::setObservesAllExecution(JSContext *cx, IsObserving observing)
/*** Debugger JSObjects **************************************************************************/
void
Debugger::markKeysInCompartment(JSTracer *trc)
Debugger::markCrossCompartmentEdges(JSTracer *trc)
{
/*
* WeakMap::Range is deliberately private, to discourage C++ code from
* enumerating WeakMap keys. However in this case we need access, so we
* make a base-class reference. Range is public in HashMap.
*/
objects.markKeys(trc);
environments.markKeys(trc);
scripts.markKeys(trc);
sources.markKeys(trc);
objects.markCrossCompartmentEdges<DebuggerObject_trace>(trc);
environments.markCrossCompartmentEdges<DebuggerEnv_trace>(trc);
scripts.markCrossCompartmentEdges<DebuggerScript_trace>(trc);
sources.markCrossCompartmentEdges<DebuggerSource_trace>(trc);
}
/*
@ -2091,35 +2091,30 @@ Debugger::markKeysInCompartment(JSTracer *trc)
* discovered that the WeakMap was live; that is, some object containing the
* WeakMap was marked during mark phase.
*
* However, during compartment GC, we have to do something about
* cross-compartment WeakMaps in non-GC'd compartments. If their keys and values
* might need to be marked, we have to do it manually.
* However, during zone GC, we have to do something about cross-compartment
* edges in non-GC'd compartments. Since the source may be live, we
* conservatively assume it is and mark the edge.
*
* Each Debugger object keeps found cross-compartment WeakMaps: objects, scripts,
* script source objects, and environments. They have the nice property that all
* their values are in the same compartment as the Debugger object, so we only
* need to mark the keys. We must simply mark all keys that are in a compartment
* being GC'd.
* Each Debugger object keeps four cross-compartment WeakMaps: objects, scripts,
* script source objects, and environments. They have the property that all
* their values are in the same compartment as the Debugger object, but we have
* to mark the keys and the private pointer in the wrapper object.
*
* We must scan all Debugger objects regardless of whether they *currently*
* have any debuggees in a compartment being GC'd, because the WeakMap
* entries persist even when debuggees are removed.
* We must scan all Debugger objects regardless of whether they *currently* have
* any debuggees in a compartment being GC'd, because the WeakMap entries
* persist even when debuggees are removed.
*
* This happens during the initial mark phase, not iterative marking, because
* all the edges being reported here are strong references.
*/
/* static */ void
Debugger::markCrossCompartmentDebuggerObjectReferents(JSTracer *trc)
Debugger::markAllCrossCompartmentEdges(JSTracer *trc)
{
JSRuntime *rt = trc->runtime();
/*
* Mark all objects in comp that are referents of Debugger.Objects in other
* compartments.
*/
for (Debugger *dbg = rt->debuggerList.getFirst(); dbg; dbg = dbg->getNext()) {
if (!dbg->object->zone()->isCollecting())
dbg->markKeysInCompartment(trc);
dbg->markCrossCompartmentEdges(trc);
}
}
@ -2213,7 +2208,6 @@ Debugger::markAll(JSTracer *trc)
GlobalObjectSet &debuggees = dbg->debuggees;
for (GlobalObjectSet::Enum e(debuggees); !e.empty(); e.popFront()) {
GlobalObject *global = e.front();
MarkObjectUnbarriered(trc, &global, "Global Object");
if (global != e.front())
e.rekeyFront(global);
@ -3814,7 +3808,7 @@ GetScriptReferent(JSObject *obj)
return static_cast<JSScript *>(obj->as<NativeObject>().getPrivate());
}
static void
void
DebuggerScript_trace(JSTracer *trc, JSObject *obj)
{
/* This comes from a private pointer, so no barrier needed. */
@ -4765,7 +4759,7 @@ GetSourceReferent(JSObject *obj)
return static_cast<ScriptSourceObject *>(obj->as<NativeObject>().getPrivate());
}
static void
void
DebuggerSource_trace(JSTracer *trc, JSObject *obj)
{
/*
@ -5845,7 +5839,7 @@ static const JSFunctionSpec DebuggerFrame_methods[] = {
/*** Debugger.Object *****************************************************************************/
static void
void
DebuggerObject_trace(JSTracer *trc, JSObject *obj)
{
/*
@ -6753,7 +6747,7 @@ static const JSFunctionSpec DebuggerObject_methods[] = {
/*** Debugger.Environment ************************************************************************/
static void
void
DebuggerEnv_trace(JSTracer *trc, JSObject *obj)
{
/*

View File

@ -36,10 +36,9 @@ class Breakpoint;
class DebuggerMemory;
/*
* A weakmap that supports the keys being in different compartments to the
* values, although all values must be in the same compartment.
*
* The Key and Value classes must support the compartment() method.
* A weakmap from GC thing keys to JSObject values that supports the keys being
* in different compartments to the values. All values must be in the same
* compartment.
*
* The purpose of this is to allow the garbage collector to easily find edges
* from debugee object compartments to debugger compartments when calculating
@ -55,10 +54,13 @@ class DebuggerMemory;
* debugger compartments. If it is false, we assert that such entries are never
* created.
*/
template <class Key, class Value, bool InvisibleKeysOk=false>
class DebuggerWeakMap : private WeakMap<Key, Value, DefaultHasher<Key> >
template <class UnbarrieredKey, bool InvisibleKeysOk=false>
class DebuggerWeakMap : private WeakMap<PreBarriered<UnbarrieredKey>, RelocatablePtrObject>
{
private:
typedef PreBarriered<UnbarrieredKey> Key;
typedef RelocatablePtrObject Value;
typedef HashMap<JS::Zone *,
uintptr_t,
DefaultHasher<JS::Zone *>,
@ -112,8 +114,10 @@ class DebuggerWeakMap : private WeakMap<Key, Value, DefaultHasher<Key> >
}
public:
void markKeys(JSTracer *tracer) {
template <void (traceValueEdges)(JSTracer *, JSObject *)>
void markCrossCompartmentEdges(JSTracer *tracer) {
for (Enum e(*static_cast<Base *>(this)); !e.empty(); e.popFront()) {
traceValueEdges(tracer, e.front().value());
Key key = e.front().key();
gc::Mark(tracer, &key, "Debugger WeakMap key");
if (key != e.front().key())
@ -282,15 +286,15 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
FrameMap frames;
/* An ephemeral map from JSScript* to Debugger.Script instances. */
typedef DebuggerWeakMap<PreBarrieredScript, RelocatablePtrObject> ScriptWeakMap;
typedef DebuggerWeakMap<JSScript*> ScriptWeakMap;
ScriptWeakMap scripts;
/* The map from debuggee source script objects to their Debugger.Source instances. */
typedef DebuggerWeakMap<PreBarrieredObject, RelocatablePtrObject, true> SourceWeakMap;
typedef DebuggerWeakMap<JSObject*, true> SourceWeakMap;
SourceWeakMap sources;
/* The map from debuggee objects to their Debugger.Object instances. */
typedef DebuggerWeakMap<PreBarrieredObject, RelocatablePtrObject> ObjectWeakMap;
typedef DebuggerWeakMap<JSObject*> ObjectWeakMap;
ObjectWeakMap objects;
/* The map from debuggee Envs to Debugger.Environment instances. */
@ -356,7 +360,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
static void traceObject(JSTracer *trc, JSObject *obj);
void trace(JSTracer *trc);
static void finalize(FreeOp *fop, JSObject *obj);
void markKeysInCompartment(JSTracer *tracer);
void markCrossCompartmentEdges(JSTracer *tracer);
static const Class jsclass;
@ -506,7 +510,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
* Debugger objects that are definitely live but not yet marked, it marks
* them and returns true. If not, it returns false.
*/
static void markCrossCompartmentDebuggerObjectReferents(JSTracer *tracer);
static void markAllCrossCompartmentEdges(JSTracer *tracer);
static bool markAllIteratively(GCMarker *trc);
static void markAll(JSTracer *trc);
static void sweepAll(FreeOp *fop);

View File

@ -3382,13 +3382,16 @@ PropertyProvider::SetupJustificationSpacing(bool aPostReflow)
return;
}
// Remember that textrun measurements are in the run's orientation,
// so its advance "width" is actually a height in vertical writing modes,
// corresponding to the inline-direction of the frame.
gfxFloat naturalWidth =
mTextRun->GetAdvanceWidth(mStart.GetSkippedOffset(),
GetSkippedDistance(mStart, realEnd), this);
if (mFrame->GetStateBits() & TEXT_HYPHEN_BREAK) {
naturalWidth += GetHyphenWidth();
}
mJustificationSpacing = mFrame->GetSize().width - naturalWidth;
mJustificationSpacing = mFrame->ISize() - naturalWidth;
if (mJustificationSpacing <= 0) {
// No space available
return;

View File

@ -1172,7 +1172,6 @@ uint32_t tlsIntoleranceTelemetryBucket(PRErrorCode err)
case SSL_ERROR_NO_CYPHER_OVERLAP: return 7;
case SSL_ERROR_BAD_SERVER: return 8;
case SSL_ERROR_BAD_BLOCK_PADDING: return 9;
case SSL_ERROR_UNSUPPORTED_VERSION: return 10;
case SSL_ERROR_PROTOCOL_VERSION_ALERT: return 11;
case SSL_ERROR_RX_MALFORMED_FINISHED: return 12;
case SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE: return 13;

View File

@ -2,7 +2,7 @@ import os
from setuptools import setup, find_packages
import sys
version = '0.8.4'
version = '0.8.5'
# dependencies
with open('requirements.txt') as f:

View File

@ -4,7 +4,7 @@
from setuptools import setup
PACKAGE_VERSION = '1.0'
PACKAGE_VERSION = '1.1'
dependencies = ['mozdevice >= 0.44',
'mozfile >= 1.0',

View File

@ -1215,23 +1215,37 @@ function writeVersionFile(dir, version) {
}
/**
* Removes the MozUpdater folders that bgupdates/staged updates creates.
* Removes the MozUpdater directory that is created when replacing an install
* with a staged update and leftover MozUpdater-i folders in the tmp directory.
*/
function cleanUpMozUpdaterDirs() {
try {
// Remove the MozUpdater directory in the updates/0 directory.
var mozUpdaterDir = getUpdatesDir();
mozUpdaterDir.append("MozUpdater");
if (mozUpdaterDir.exists()) {
LOG("cleanUpMozUpdaterDirs - removing MozUpdater directory");
mozUpdaterDir.remove(true);
}
} catch (e) {
LOG("cleanUpMozUpdaterDirs - Exception: " + e);
}
try {
var tmpDir = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties).
get("TmpD", Ci.nsIFile);
// We used to store MozUpdater-i folders directly inside the temp directory.
// We need to cleanup these directories if we detect that they still exist.
// We used to store MozUpdater-i directories in the temp directory.
// We need to remove these directories if we detect that they still exist.
// To check if they still exist, we simply check for MozUpdater-1.
var mozUpdaterDir1 = tmpDir.clone();
mozUpdaterDir1.append("MozUpdater-1");
// Only try to delete the left over folders in "$Temp/MozUpdater-i/*" if
// Only try to delete the left over directories in "$Temp/MozUpdater-i/*" if
// MozUpdater-1 exists.
if (mozUpdaterDir1.exists()) {
LOG("cleanUpMozUpdaterDirs - Cleaning top level MozUpdater-i folders");
LOG("cleanUpMozUpdaterDirs - Removing top level tmp MozUpdater-i " +
"directories");
let i = 0;
let dirEntries = tmpDir.directoryEntries;
while (dirEntries.hasMoreElements() && i < 10) {
@ -1247,15 +1261,6 @@ function cleanUpMozUpdaterDirs() {
mozUpdaterDir1.remove(true);
}
}
// If we reach here, we simply need to clean the MozUpdater folder. In our
// new way of storing these files, the unique subfolders are inside MozUpdater
var mozUpdaterDir = tmpDir.clone();
mozUpdaterDir.append("MozUpdater");
if (mozUpdaterDir.exists()) {
LOG("cleanUpMozUpdaterDirs - Cleaning MozUpdater folder");
mozUpdaterDir.remove(true);
}
} catch (e) {
LOG("cleanUpMozUpdaterDirs - Exception: " + e);
}
@ -2298,7 +2303,8 @@ UpdateService.prototype = {
prompter.showUpdateError(update);
}
// Now trash the MozUpdater folders which staged/bgupdates uses.
// Now trash the MozUpdater directory created when replacing an install with
// a staged update.
cleanUpMozUpdaterDirs();
},

View File

@ -417,43 +417,40 @@ CopyUpdaterIntoUpdateDir(nsIFile *greDir, nsIFile *appDir, nsIFile *updateDir,
* staged.
*
* @param greDir the GRE dir
* @param updateDir the update root dir
* @param statusFile the update.status file
* @param updateDir the update dir where the mar file is located
* @param appDir the app dir
* @param appArgc the number of args to the application
* @param appArgv the args to the application, used for restarting if needed
*/
static void
SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile,
SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir,
nsIFile *appDir, int appArgc, char **appArgv)
{
nsresult rv;
// Steps:
// - copy updater into temp dir
// - copy updater into updates/0/MozUpdater/bgupdate/ dir
// - run updater with the correct arguments
nsCOMPtr<nsIFile> tmpDir;
GetSpecialSystemDirectory(OS_TemporaryDirectory,
getter_AddRefs(tmpDir));
if (!tmpDir) {
LOG(("failed getting a temp dir\n"));
nsCOMPtr<nsIFile> mozUpdaterDir;
rv = updateDir->Clone(getter_AddRefs(mozUpdaterDir));
if (NS_FAILED(rv)) {
LOG(("failed cloning update dir\n"));
return;
}
// Try to create our own new temp directory in case there is already an
// updater binary in the OS temporary location which we cannot write to.
// Note that we don't check for errors here, as if this directory can't
// be created, the following CopyUpdaterIntoUpdateDir call will fail.
// We create the unique directory inside a subfolder of MozUpdater instead
// of directly in the temp directory so we can efficiently delete everything
// after updates.
tmpDir->Append(NS_LITERAL_STRING("MozUpdater"));
tmpDir->Append(NS_LITERAL_STRING("bgupdate"));
tmpDir->CreateUnique(nsIFile::DIRECTORY_TYPE, 0755);
// Create a new directory named MozUpdater in the updates/0 directory to copy
// the updater files to that will be used to replace the installation with the
// staged application that has been updated. Note that we don't check for
// directory creation errors since the call to CopyUpdaterIntoUpdateDir will
// fail if the creation of the directory fails. A unique directory is created
// in MozUpdater in case a previous attempt locked the directory or files.
mozUpdaterDir->Append(NS_LITERAL_STRING("MozUpdater"));
mozUpdaterDir->Append(NS_LITERAL_STRING("bgupdate"));
mozUpdaterDir->CreateUnique(nsIFile::DIRECTORY_TYPE, 0755);
nsCOMPtr<nsIFile> updater;
if (!CopyUpdaterIntoUpdateDir(greDir, appDir, tmpDir, updater)) {
if (!CopyUpdaterIntoUpdateDir(greDir, appDir, mozUpdaterDir, updater)) {
LOG(("failed copying updater\n"));
return;
}
@ -1012,8 +1009,7 @@ ProcessUpdates(nsIFile *greDir, nsIFile *appDir, nsIFile *updRootDir,
case eAppliedService:
// An update was staged and needs to be switched so the updated application
// is used.
SwitchToUpdatedApp(greDir, updatesDir, statusFile,
appDir, argc, argv);
SwitchToUpdatedApp(greDir, updatesDir, appDir, argc, argv);
break;
case eNoUpdateAction:
// We don't need to do any special processing here, we'll just continue to

View File

@ -857,6 +857,12 @@ GfxInfo::GetGfxDriverInfo()
GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
DRIVER_LESS_THAN, V(8,62,0,0), "9.6" );
// Bug 1099252
APPEND_TO_DRIVER_BLOCKLIST2( DRIVER_OS_WINDOWS_7,
(nsAString&) GfxDriverInfo::GetDeviceVendor(VendorATI), GfxDriverInfo::allDevices,
GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
DRIVER_EQUAL, V(8,832,0,0));
/*
* Bug 783517 - crashes in AMD driver on Windows 8
*/