From 2e2cf0fa3ed2b6b6804e5865cdb3632c7a1584b2 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Thu, 19 Nov 2015 10:13:28 +0100 Subject: [PATCH 01/46] Bug 1225821 - Add type write barrier to SetPropertyIC dense element stub. r=bhackett --- .../tests/ion/dense-elem-write-barrier.js | 22 ++++++++ js/src/jit/IonBuilder.cpp | 18 +++---- js/src/jit/IonCaches.cpp | 54 +++++++++++++------ 3 files changed, 65 insertions(+), 29 deletions(-) create mode 100644 js/src/jit-test/tests/ion/dense-elem-write-barrier.js diff --git a/js/src/jit-test/tests/ion/dense-elem-write-barrier.js b/js/src/jit-test/tests/ion/dense-elem-write-barrier.js new file mode 100644 index 00000000000..79fda227dab --- /dev/null +++ b/js/src/jit-test/tests/ion/dense-elem-write-barrier.js @@ -0,0 +1,22 @@ +var arr = []; +for (var i=0; i<20; i++) { + arr.push(new Int32Array(2000)); +} +arr.push([null, null]); + +function test(o, x) { + assertEq(o[0], x); +} + +function f() { + for (var i=0; i<3100; i++) { + var o = arr[i % arr.length]; + if (o.length > 10 || i > 2000) { + var val = (i > 3000 ? 1 : null); + o[0] = val; + if (o.length < 5) + test(o, val); + } + } +} +f(); diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 5b534252d81..a26960780fe 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -9863,17 +9863,11 @@ IonBuilder::setElemTryCache(bool* emitted, MDefinition* object, bool barrier = true; - if (index->mightBeType(MIRType_Int32)) { - // Bail if we might have a barriered write to a dense element, as the - // dense element stub doesn't support this yet. - if (PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current, - &object, nullptr, &value, /* canModify = */ true)) - { - trackOptimizationOutcome(TrackedOutcome::NeedsTypeBarrier); - return true; - } - if (index->type() == MIRType_Int32) - barrier = false; + if (index->type() == MIRType_Int32 && + !PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current, + &object, nullptr, &value, /* canModify = */ true)) + { + barrier = false; } // We can avoid worrying about holes in the IC if we know a priori we are safe @@ -9890,7 +9884,7 @@ IonBuilder::setElemTryCache(bool* emitted, MDefinition* object, if (NeedsPostBarrier(info(), value)) current->add(MPostWriteBarrier::New(alloc(), object, value)); - // Emit SetElementCache. + // Emit SetPropertyCache. bool strict = JSOp(*pc) == JSOP_STRICTSETELEM; MSetPropertyCache* ins = MSetPropertyCache::New(alloc(), object, index, value, strict, barrier, guardHoles); diff --git a/js/src/jit/IonCaches.cpp b/js/src/jit/IonCaches.cpp index b4a25afdc78..ab615c11632 100644 --- a/js/src/jit/IonCaches.cpp +++ b/js/src/jit/IonCaches.cpp @@ -2251,8 +2251,8 @@ CheckTypeSetForWrite(MacroAssembler& masm, JSObject* obj, jsid id, { TypedOrValueRegister valReg = value.reg(); ObjectGroup* group = obj->group(); - if (group->unknownProperties()) - return; + MOZ_ASSERT(!group->unknownProperties()); + HeapTypeSet* propTypes = group->maybeGetProperty(id); MOZ_ASSERT(propTypes); @@ -2272,11 +2272,9 @@ GenerateSetSlot(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& att // Guard that the incoming value is in the type set for the property // if a type barrier is required. - if (needsTypeBarrier) { - // We can't do anything that would change the HeapTypeSet, so - // just guard that it's already there. - if (checkTypeset) - CheckTypeSetForWrite(masm, obj, shape->propid(), tempReg, value, failures); + if (checkTypeset) { + MOZ_ASSERT(needsTypeBarrier); + CheckTypeSetForWrite(masm, obj, shape->propid(), tempReg, value, failures); } NativeObject::slotsSizeMustNotOverflow(); @@ -3131,8 +3129,9 @@ IsPropertySetInlineable(NativeObject* obj, HandleId id, MutableHandleShape pshap if (!pshape->writable()) return false; - if (needsTypeBarrier) - return CanInlineSetPropTypeCheck(obj, id, val, checkTypeset); + *checkTypeset = false; + if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset)) + return false; return true; } @@ -3199,10 +3198,10 @@ IsPropertyAddInlineable(JSContext* cx, NativeObject* obj, HandleId id, ConstantO if (obj->group()->newScript() && !obj->group()->newScript()->analyzed()) return false; - if (needsTypeBarrier) - return CanInlineSetPropTypeCheck(obj, id, val, checkTypeset); - *checkTypeset = false; + if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset)) + return false; + return true; } @@ -3289,6 +3288,7 @@ CanAttachSetUnboxed(JSContext* cx, HandleObject obj, HandleId id, ConstantOrRegi const UnboxedLayout::Property* property = obj->as().layout().lookup(id); if (property) { + *checkTypeset = false; if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset)) return false; *unboxedOffset = property->offset; @@ -3314,6 +3314,7 @@ CanAttachSetUnboxedExpando(JSContext* cx, HandleObject obj, HandleId id, Constan if (!shape || !shape->hasDefaultSetter() || !shape->hasSlot() || !shape->writable()) return false; + *checkTypeset = false; if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset)) return false; @@ -3342,6 +3343,7 @@ CanAttachAddUnboxedExpando(JSContext* cx, HandleObject obj, HandleShape oldShape if (PrototypeChainShadowsPropertyAdd(cx, obj, id)) return false; + *checkTypeset = false; if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset)) return false; @@ -3426,7 +3428,7 @@ SetPropertyIC::tryAttachNative(JSContext* cx, HandleScript outerScript, IonScrip RootedShape shape(cx); RootedObject holder(cx); - bool checkTypeset; + bool checkTypeset = false; NativeSetPropCacheability canCache = CanAttachNativeSetProp(cx, obj, id, value(), needsTypeBarrier(), &holder, &shape, &checkTypeset); switch (canCache) { @@ -4180,7 +4182,8 @@ GetPropertyIC::tryAttachArgumentsElement(JSContext* cx, HandleScript outerScript } static bool -IsDenseElementSetInlineable(JSObject* obj, const Value& idval) +IsDenseElementSetInlineable(JSObject* obj, const Value& idval, ConstantOrRegister val, + bool needsTypeBarrier, bool* checkTypeset) { if (!obj->is()) return false; @@ -4208,6 +4211,10 @@ IsDenseElementSetInlineable(JSObject* obj, const Value& idval) curObj = curObj->getProto(); } + *checkTypeset = false; + if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, JSID_VOID, val, checkTypeset)) + return false; + return true; } @@ -4277,7 +4284,7 @@ static bool GenerateSetDenseElement(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& attacher, JSObject* obj, const Value& idval, bool guardHoles, Register object, TypedOrValueRegister index, ConstantOrRegister value, Register tempToUnboxIndex, - Register temp) + Register temp, bool needsTypeBarrier, bool checkTypeset) { MOZ_ASSERT(obj->isNative()); MOZ_ASSERT(idval.isInt32()); @@ -4290,6 +4297,14 @@ GenerateSetDenseElement(JSContext* cx, MacroAssembler& masm, IonCache::StubAttac return false; masm.branchTestObjShape(Assembler::NotEqual, object, shape, &failures); + // Guard that the incoming value is in the type set for the property + // if a type barrier is required. + if (needsTypeBarrier) { + masm.branchTestObjGroup(Assembler::NotEqual, object, obj->group(), &failures); + if (checkTypeset) + CheckTypeSetForWrite(masm, obj, JSID_VOID, temp, value, &failures); + } + // Ensure the index is an int32 value. Register indexReg; if (index.hasValue()) { @@ -4377,7 +4392,11 @@ SetPropertyIC::tryAttachDenseElement(JSContext* cx, HandleScript outerScript, Io MOZ_ASSERT(!*emitted); MOZ_ASSERT(canAttachStub()); - if (hasDenseStub() || !IsDenseElementSetInlineable(obj, idval)) + if (hasDenseStub()) + return true; + + bool checkTypeset = false; + if (!IsDenseElementSetInlineable(obj, idval, value(), needsTypeBarrier(), &checkTypeset)) return true; *emitted = true; @@ -4386,7 +4405,8 @@ SetPropertyIC::tryAttachDenseElement(JSContext* cx, HandleScript outerScript, Io StubAttacher attacher(*this); if (!GenerateSetDenseElement(cx, masm, attacher, obj, idval, guardHoles(), object(), id().reg(), - value(), tempToUnboxIndex(), temp())) + value(), tempToUnboxIndex(), temp(), + needsTypeBarrier(), checkTypeset)) { return false; } From 2883b9b5d6b619b29417953151d5bfc40d91098c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 18 Nov 2015 18:43:32 +0100 Subject: [PATCH 02/46] Bug 1216283 - land NSPR_4_11_RTM, r=dkeeler --- configure.in | 2 +- nsprpub/TAG-INFO | 2 +- nsprpub/config/prdepend.h | 1 + nsprpub/pr/include/prinit.h | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 981c5782463..d69c5b48a71 100644 --- a/configure.in +++ b/configure.in @@ -53,7 +53,7 @@ dnl ======================================================== MOZJPEG=62 MOZPNG=10617 NSPR_VERSION=4 -NSPR_MINVER=4.10.10 +NSPR_MINVER=4.11 NSS_VERSION=3 dnl Set the minimum version of toolkit libs used by mozilla diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO index 335d0c8b5fa..9156f605b70 100644 --- a/nsprpub/TAG-INFO +++ b/nsprpub/TAG-INFO @@ -1 +1 @@ -NSPR_4_11_BETA1 +NSPR_4_11_RTM diff --git a/nsprpub/config/prdepend.h b/nsprpub/config/prdepend.h index e49e92677e3..6c66b37ca0f 100644 --- a/nsprpub/config/prdepend.h +++ b/nsprpub/config/prdepend.h @@ -10,3 +10,4 @@ */ #error "Do not include this header file." + diff --git a/nsprpub/pr/include/prinit.h b/nsprpub/pr/include/prinit.h index eb4241cac94..93749e634b7 100644 --- a/nsprpub/pr/include/prinit.h +++ b/nsprpub/pr/include/prinit.h @@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** ".[.] []" */ -#define PR_VERSION "4.11 Beta" +#define PR_VERSION "4.11" #define PR_VMAJOR 4 #define PR_VMINOR 11 #define PR_VPATCH 0 -#define PR_BETA PR_TRUE +#define PR_BETA PR_FALSE /* ** PRVersionCheck From 64ca1250f898a9896b86fb0b8a19e8bbc67fd994 Mon Sep 17 00:00:00 2001 From: Guang-De Lin Date: Wed, 18 Nov 2015 10:51:07 +0800 Subject: [PATCH 03/46] Bug 1154213 - Handle timestamps of video/webm vorbis track encoding. r=mreavy, r=rjesup --- dom/media/encoder/VorbisTrackEncoder.cpp | 2 ++ dom/media/webm/EbmlComposer.cpp | 23 +++++++++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/dom/media/encoder/VorbisTrackEncoder.cpp b/dom/media/encoder/VorbisTrackEncoder.cpp index 3a1c153bd51..0899ee8c744 100644 --- a/dom/media/encoder/VorbisTrackEncoder.cpp +++ b/dom/media/encoder/VorbisTrackEncoder.cpp @@ -142,6 +142,8 @@ VorbisTrackEncoder::GetEncodedFrames(EncodedFrameContainer& aData) VORBISLOG("vorbis_analysis_blockout block size %d", oggPacket.bytes); EncodedFrame* audiodata = new EncodedFrame(); audiodata->SetFrameType(EncodedFrame::VORBIS_AUDIO_FRAME); + audiodata->SetTimeStamp(oggPacket.granulepos * PR_USEC_PER_SEC + / mSamplingRate); nsTArray frameData; frameData.AppendElements(oggPacket.packet, oggPacket.bytes); audiodata->SwapInFrameData(frameData); diff --git a/dom/media/webm/EbmlComposer.cpp b/dom/media/webm/EbmlComposer.cpp index 186078e9601..a5dbecaa2cb 100644 --- a/dom/media/webm/EbmlComposer.cpp +++ b/dom/media/webm/EbmlComposer.cpp @@ -112,7 +112,9 @@ EbmlComposer::WriteSimpleBlock(EncodedFrame* aFrame) EbmlGlobal ebml; ebml.offset = 0; - if (aFrame->GetFrameType() == EncodedFrame::FrameType::VP8_I_FRAME) { + auto frameType = aFrame->GetFrameType(); + bool isVP8IFrame = (frameType == EncodedFrame::FrameType::VP8_I_FRAME); + if (isVP8IFrame) { FinishCluster(); } @@ -120,7 +122,7 @@ EbmlComposer::WriteSimpleBlock(EncodedFrame* aFrame) block->SetLength(aFrame->GetFrameData().Length() + DEFAULT_HEADER_SIZE); ebml.buf = block->Elements(); - if (aFrame->GetFrameType() == EncodedFrame::FrameType::VP8_I_FRAME) { + if (isVP8IFrame) { EbmlLoc ebmlLoc; Ebml_StartSubElement(&ebml, &ebmlLoc, Cluster); MOZ_ASSERT(mClusterBuffs.Length() > 0); @@ -132,18 +134,11 @@ EbmlComposer::WriteSimpleBlock(EncodedFrame* aFrame) mFlushState |= FLUSH_CLUSTER; } - if (aFrame->GetFrameType() != EncodedFrame::FrameType::VORBIS_AUDIO_FRAME) { - short timeCode = aFrame->GetTimeStamp() / PR_USEC_PER_MSEC - - mClusterTimecode; - writeSimpleBlock(&ebml, 0x1, timeCode, aFrame->GetFrameType() == - EncodedFrame::FrameType::VP8_I_FRAME, - 0, 0, (unsigned char*)aFrame->GetFrameData().Elements(), - aFrame->GetFrameData().Length()); - } else { - writeSimpleBlock(&ebml, 0x2, 0, false, - 0, 0, (unsigned char*)aFrame->GetFrameData().Elements(), - aFrame->GetFrameData().Length()); - } + bool isVorbis = (frameType == EncodedFrame::FrameType::VORBIS_AUDIO_FRAME); + short timeCode = aFrame->GetTimeStamp() / PR_USEC_PER_MSEC - mClusterTimecode; + writeSimpleBlock(&ebml, isVorbis ? 0x2 : 0x1, timeCode, isVP8IFrame, + 0, 0, (unsigned char*)aFrame->GetFrameData().Elements(), + aFrame->GetFrameData().Length()); MOZ_ASSERT(ebml.offset <= DEFAULT_HEADER_SIZE + aFrame->GetFrameData().Length(), "write more data > EBML_BUFFER_SIZE"); From 6319afda018407429db62cd017ee3a308b059bb6 Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Mon, 16 Nov 2015 17:05:39 -0600 Subject: [PATCH 04/46] Bug 1175609 - Bring onnegotiationneeded in line with spec. r=mt --- ..._peerConnection_remoteReofferRollback.html | 5 +- .../test_peerConnection_remoteRollback.html | 4 ++ .../src/peerconnection/PeerConnectionImpl.cpp | 65 ++++++++++++++----- .../src/peerconnection/PeerConnectionImpl.h | 4 +- 4 files changed, 59 insertions(+), 19 deletions(-) diff --git a/dom/media/tests/mochitest/test_peerConnection_remoteReofferRollback.html b/dom/media/tests/mochitest/test_peerConnection_remoteReofferRollback.html index 8f7ba4b4312..1c114918c2e 100644 --- a/dom/media/tests/mochitest/test_peerConnection_remoteReofferRollback.html +++ b/dom/media/tests/mochitest/test_peerConnection_remoteReofferRollback.html @@ -14,6 +14,7 @@ var test; runNetworkTest(function (options) { test = new PeerConnectionTest(options); + var firstNegotiationSize = test.chain.commands.length; addRenegotiation(test.chain, [ function PC_LOCAL_ADD_SECOND_STREAM(test) { @@ -42,6 +43,8 @@ }, function PC_LOCAL_ROLLBACK(test) { + // We haven't negotiated the new stream yet. + test.pcLocal.expectNegotiationNeeded(); return test.setLocalDescription( test.pcLocal, new RTCSessionDescription({ type: "rollback", sdp: ""}), @@ -53,7 +56,7 @@ return test.pcLocal.endOfTrickleIce; }, ], - 1 // Second PC_REMOTE_SET_REMOTE_DESCRIPTION + firstNegotiationSize // Second PC_REMOTE_SET_REMOTE_DESCRIPTION ); test.chain.append(commandsPeerConnectionOfferAnswer); test.setMediaConstraints([{audio: true}], [{audio: true}]); diff --git a/dom/media/tests/mochitest/test_peerConnection_remoteRollback.html b/dom/media/tests/mochitest/test_peerConnection_remoteRollback.html index 091a28de93c..830fb644126 100644 --- a/dom/media/tests/mochitest/test_peerConnection_remoteRollback.html +++ b/dom/media/tests/mochitest/test_peerConnection_remoteRollback.html @@ -18,6 +18,8 @@ test.chain.removeAfter('PC_REMOTE_SET_REMOTE_DESCRIPTION'); test.chain.append([ function PC_REMOTE_ROLLBACK(test) { + // We still haven't negotiated the tracks + test.pcRemote.expectNegotiationNeeded(); return test.setRemoteDescription( test.pcRemote, new RTCSessionDescription({ type: "rollback" }), @@ -25,6 +27,8 @@ }, function PC_LOCAL_ROLLBACK(test) { + // We still haven't negotiated the tracks + test.pcLocal.expectNegotiationNeeded(); return test.setLocalDescription( test.pcLocal, new RTCSessionDescription({ type: "rollback", sdp: ""}), diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index c63503a4d39..feec04609a5 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -393,7 +393,7 @@ PeerConnectionImpl::PeerConnectionImpl(const GlobalObject* aGlobal) , mHaveDataStream(false) , mAddCandidateErrorCount(0) , mTrickle(true) // TODO(ekr@rtfm.com): Use pref - , mShouldSuppressNegotiationNeeded(false) + , mNegotiationNeeded(false) { #if !defined(MOZILLA_EXTERNAL_LINKAGE) MOZ_ASSERT(NS_IsMainThread()); @@ -2619,8 +2619,10 @@ PeerConnectionImpl::SetSignalingState_m(PCImplSignalingState aSignalingState, mSignalingState = aSignalingState; bool fireNegotiationNeeded = false; - if (mSignalingState == PCImplSignalingState::SignalingStable) { + // Either negotiation is done, or we've rolled back. In either case, we + // need to re-evaluate whether further negotiation is required. + mNegotiationNeeded = false; // If we're rolling back a local offer, we might need to remove some // transports, but nothing further needs to be done. mMedia->ActivateOrRemoveTransports(*mJsepSession); @@ -2628,16 +2630,16 @@ PeerConnectionImpl::SetSignalingState_m(PCImplSignalingState aSignalingState, mMedia->UpdateMediaPipelines(*mJsepSession); InitializeDataChannel(); mMedia->StartIceChecks(*mJsepSession); - mShouldSuppressNegotiationNeeded = false; - if (!mJsepSession->AllLocalTracksAreAssigned()) { - CSFLogInfo(logTag, "Not all local tracks were assigned to an " - "m-section, either because the offerer did not offer" - " to receive enough tracks, or because tracks were " - "added after CreateOffer/Answer, but before " - "offer/answer completed. This requires " - "renegotiation."); - fireNegotiationNeeded = true; - } + } + + if (!mJsepSession->AllLocalTracksAreAssigned()) { + CSFLogInfo(logTag, "Not all local tracks were assigned to an " + "m-section, either because the offerer did not offer" + " to receive enough tracks, or because tracks were " + "added after CreateOffer/Answer, but before " + "offer/answer completed. This requires " + "renegotiation."); + fireNegotiationNeeded = true; } // Telemetry: record info on the current state of streams/renegotiations/etc @@ -2655,9 +2657,6 @@ PeerConnectionImpl::SetSignalingState_m(PCImplSignalingState aSignalingState, mMaxSending[i] = sending[i]; } } - - } else { - mShouldSuppressNegotiationNeeded = true; } if (mSignalingState == PCImplSignalingState::SignalingClosed) { @@ -2672,6 +2671,8 @@ PeerConnectionImpl::SetSignalingState_m(PCImplSignalingState aSignalingState, pco->OnStateChange(PCObserverStateType::SignalingState, rv); if (fireNegotiationNeeded) { + // We don't use MaybeFireNegotiationNeeded here, since content might have + // already cased a transition from stable. OnNegotiationNeeded(); } } @@ -3480,11 +3481,41 @@ PeerConnectionImpl::RecordLongtermICEStatistics() { void PeerConnectionImpl::OnNegotiationNeeded() { - if (mShouldSuppressNegotiationNeeded) { + if (mSignalingState != PCImplSignalingState::SignalingStable) { + // We will check whether we need to renegotiate when we reach stable again return; } - mShouldSuppressNegotiationNeeded = true; + if (mNegotiationNeeded) { + return; + } + + mNegotiationNeeded = true; + + RUN_ON_THREAD(mThread, + WrapRunnableNM(&MaybeFireNegotiationNeeded_static, mHandle), + NS_DISPATCH_NORMAL); +} + +/* static */ +void +PeerConnectionImpl::MaybeFireNegotiationNeeded_static( + const std::string& pcHandle) +{ + PeerConnectionWrapper wrapper(pcHandle); + if (!wrapper.impl()) { + return; + } + + wrapper.impl()->MaybeFireNegotiationNeeded(); +} + +void +PeerConnectionImpl::MaybeFireNegotiationNeeded() +{ + if (!mNegotiationNeeded) { + return; + } RefPtr pco = do_QueryObjectReferent(mPCObserver); if (!pco) { diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h index c9be977cadd..5a704b79f32 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h @@ -705,6 +705,8 @@ private: void RecordLongtermICEStatistics(); void OnNegotiationNeeded(); + static void MaybeFireNegotiationNeeded_static(const std::string& pcHandle); + void MaybeFireNegotiationNeeded(); // Timecard used to measure processing time. This should be the first class // attribute so that we accurately measure the time required to instantiate @@ -797,7 +799,7 @@ private: bool mTrickle; - bool mShouldSuppressNegotiationNeeded; + bool mNegotiationNeeded; // storage for Telemetry data uint16_t mMaxReceiving[SdpMediaSection::kMediaTypes]; From b9c29fd580efa61cbd0c3c2942d0721a85270b25 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 18 Nov 2015 01:03:00 +0100 Subject: [PATCH 05/46] Bug 1209659 - Disable client-side decorations on broken Gtk3 versions (<3.20). r=karlt --- widget/gtk/nsAppShell.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp index 80d2f2db491..f8b51e5596c 100644 --- a/widget/gtk/nsAppShell.cpp +++ b/widget/gtk/nsAppShell.cpp @@ -134,6 +134,10 @@ nsAppShell::Init() sReal_gtk_window_check_resize = *check_resize; *check_resize = wrap_gtk_window_check_resize; } + + // Workaround for bug 1209659 which is fixed by Gtk3.20 + if (gtk_check_version(3, 20, 0) != nullptr) + unsetenv("GTK_CSD"); #endif if (PR_GetEnv("MOZ_DEBUG_PAINTS")) From 45a0dc57c76e407b235aa56baca8b9e3587e4e01 Mon Sep 17 00:00:00 2001 From: Tobias Schneider Date: Fri, 13 Nov 2015 13:15:00 +0100 Subject: [PATCH 06/46] Bug 1221677 - "[css-grid] Put the 'subgrid' support behind a pref, disabled by default". r=mats --- .../en-US/chrome/layout/css.properties | 1 + layout/base/nsLayoutUtils.cpp | 17 +++++ layout/base/nsLayoutUtils.h | 6 ++ layout/style/nsCSSParser.cpp | 12 ++++ layout/style/test/property_database.js | 66 +++++++++++-------- .../test/test_grid_container_shorthands.html | 29 ++++---- .../test_grid_shorthand_serialization.html | 5 +- modules/libpref/init/all.js | 3 + 8 files changed, 100 insertions(+), 39 deletions(-) diff --git a/dom/locales/en-US/chrome/layout/css.properties b/dom/locales/en-US/chrome/layout/css.properties index 1fafc694c31..5f8dde727e9 100644 --- a/dom/locales/en-US/chrome/layout/css.properties +++ b/dom/locales/en-US/chrome/layout/css.properties @@ -171,3 +171,4 @@ PEExpectedVariableNameEOF=identifier for variable name PEExpectedVariableName=Expected identifier for variable name but found '%1$S'. PEExpectedVariableFallback=Expected variable reference fallback after ','. PEExpectedVariableCommaOrCloseParen=Expected ',' or ')' after variable name in variable reference but found '%1$S'. +PESubgridNotSupported=Support for the 'subgrid' keyword of CSS Grid is not enabled. diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 0cb599d4194..71ddcdbe182 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -131,6 +131,7 @@ using namespace mozilla::layout; using namespace mozilla::gfx; #define GRID_ENABLED_PREF_NAME "layout.css.grid.enabled" +#define GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME "layout.css.grid-template-subgrid-value.enabled" #define RUBY_ENABLED_PREF_NAME "layout.css.ruby.enabled" #define STICKY_ENABLED_PREF_NAME "layout.css.sticky.enabled" #define DISPLAY_CONTENTS_ENABLED_PREF_NAME "layout.css.display-contents.enabled" @@ -730,6 +731,22 @@ nsLayoutUtils::UnsetValueEnabled() return sUnsetValueEnabled; } +bool +nsLayoutUtils::IsGridTemplateSubgridValueEnabled() +{ + static bool sGridTemplateSubgridValueEnabled; + static bool sGridTemplateSubgridValueEnabledPrefCached = false; + + if (!sGridTemplateSubgridValueEnabledPrefCached) { + sGridTemplateSubgridValueEnabledPrefCached = true; + Preferences::AddBoolVarCache(&sGridTemplateSubgridValueEnabled, + GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME, + false); + } + + return sGridTemplateSubgridValueEnabled; +} + bool nsLayoutUtils::IsTextAlignTrueValueEnabled() { diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 7f743994a8d..4990fcecc6e 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -2308,6 +2308,12 @@ public: */ static bool UnsetValueEnabled(); + /** + * Checks whether support for the CSS grid-template-{columns,rows} 'subgrid X' + * value is enabled. + */ + static bool IsGridTemplateSubgridValueEnabled(); + /** * Checks whether support for the CSS text-align (and -moz-text-align-last) * 'true' value is enabled. diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index b3a93e73395..a2f6a137e59 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -8775,6 +8775,10 @@ CSSParserImpl::ParseGridTemplateColumnsRows(nsCSSProperty aPropID) nsSubstring* ident = NextIdent(); if (ident) { if (ident->LowerCaseEqualsLiteral("subgrid")) { + if (!nsLayoutUtils::IsGridTemplateSubgridValueEnabled()) { + REPORT_UNEXPECTED(PESubgridNotSupported); + return false; + } if (!ParseOptionalLineNameListAfterSubgrid(value)) { return false; } @@ -8946,6 +8950,10 @@ CSSParserImpl::ParseGridTemplate() nsSubstring* ident = NextIdent(); if (ident) { if (ident->LowerCaseEqualsLiteral("subgrid")) { + if (!nsLayoutUtils::IsGridTemplateSubgridValueEnabled()) { + REPORT_UNEXPECTED(PESubgridNotSupported); + return false; + } if (!ParseOptionalLineNameListAfterSubgrid(value)) { return false; } @@ -9019,6 +9027,10 @@ CSSParserImpl::ParseGridTemplateAfterSlash(bool aColumnsIsTrackList) nsSubstring* ident = NextIdent(); if (ident) { if (ident->LowerCaseEqualsLiteral("subgrid")) { + if (!nsLayoutUtils::IsGridTemplateSubgridValueEnabled()) { + REPORT_UNEXPECTED(PESubgridNotSupported); + return false; + } if (!ParseOptionalLineNameListAfterSubgrid(rowsValue)) { return false; } diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index b51ba29b315..3c8176b8f0e 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -5703,6 +5703,9 @@ if (IsCSSPropertyPrefEnabled("layout.css.ruby.enabled")) { } if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) { + var isGridTemplateSubgridValueEnabled = + IsCSSPropertyPrefEnabled("layout.css.grid-template-subgrid-value.enabled"); + gCSSProperties["display"].other_values.push("grid", "inline-grid"); gCSSProperties["grid-auto-flow"] = { domProp: "gridAutoFlow", @@ -5797,15 +5800,7 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) { "[a] 2.5fr [z] Repeat(4, [a] 20px [] auto [b c]) [d]", "[a] 2.5fr [z] Repeat(4, [a] 20px [] auto) [d]", "[a] 2.5fr [z] Repeat(4, 20px [b c] auto [b c]) [d]", - "[a] 2.5fr [z] Repeat(4, 20px auto) [d]", - - // See https://bugzilla.mozilla.org/show_bug.cgi?id=981300 - "[none auto subgrid min-content max-content foo] 40px", - - "subgrid", - "subgrid [] [foo bar]", - "subgrid repeat(1, [])", - "subgrid Repeat(4, [a] [b c] [] [d])", + "[a] 2.5fr [z] Repeat(4, 20px auto) [d]" ], invalid_values: [ "", @@ -5842,6 +5837,23 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) { "repeat(2.5, 20px)", "repeat(2, (foo))", "repeat(2, foo)", + "40px calc(0px + rubbish)" + ], + unbalanced_values: [ + "(foo] 40px", + ] + }; + if (isGridTemplateSubgridValueEnabled) { + gCSSProperties["grid-template-columns"].other_values.push( + // See https://bugzilla.mozilla.org/show_bug.cgi?id=981300 + "[none auto subgrid min-content max-content foo] 40px", + + "subgrid", + "subgrid [] [foo bar]", + "subgrid repeat(1, [])", + "subgrid Repeat(4, [a] [b c] [] [d])" + ); + gCSSProperties["grid-template-columns"].invalid_values.push( "subgrid (foo) 40px", "subgrid (foo 40px)", "(foo) subgrid", @@ -5854,13 +5866,9 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) { "subgrid repeat(1)", "subgrid repeat(1, )", "subgrid repeat(2, (40px))", - "subgrid repeat(2, foo)", - "40px calc(0px + rubbish)", - ], - unbalanced_values: [ - "(foo] 40px", - ] - }; + "subgrid repeat(2, foo)" + ); + } gCSSProperties["grid-template-rows"] = { domProp: "gridTemplateRows", inherited: false, @@ -5910,18 +5918,11 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) { "none / none", ], other_values: [ - "subgrid", // <'grid-template-columns'> / <'grid-template-rows'> "40px / 100px", "[foo] 40px [bar] / [baz] 100px [fizz]", " none/100px", "40px/none", - "subgrid/40px 20px", - "subgrid [foo] [] [bar baz] / 40px 20px", - "40px 20px/subgrid", - "40px 20px/subgrid [foo] [] repeat(3, [a] [b]) [bar baz]", - "subgrid/subgrid", - "subgrid [foo] [] [bar baz]/subgrid [foo] [] [bar baz]", // [ / ]? [ ? ? ? ]+ "'fizz'", "[bar] 'fizz'", @@ -5933,15 +5934,28 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) { "[foo] 40px / [bar] 'fizz' 100px [buzz] \n [a] '.' 200px [b]", ], invalid_values: [ - "subgrid []", - "subgrid [] / 'fizz'", - "subgrid / 'fizz'", "[foo] [bar] 40px / 100px", "40px / [fizz] [buzz] 100px", "40px / [fizz] [buzz] 'foo'", "none / 'foo'" ] }; + if (isGridTemplateSubgridValueEnabled) { + gCSSProperties["grid-template"].other_values.push( + "subgrid", + "subgrid/40px 20px", + "subgrid [foo] [] [bar baz] / 40px 20px", + "40px 20px/subgrid", + "40px 20px/subgrid [foo] [] repeat(3, [a] [b]) [bar baz]", + "subgrid/subgrid", + "subgrid [foo] [] [bar baz]/subgrid [foo] [] [bar baz]" + ); + gCSSProperties["grid-template"].invalid_values.push( + "subgrid []", + "subgrid [] / 'fizz'", + "subgrid / 'fizz'" + ); + } gCSSProperties["grid"] = { domProp: "grid", diff --git a/layout/style/test/test_grid_container_shorthands.html b/layout/style/test/test_grid_container_shorthands.html index 4de4aacfc8c..4cef96369d6 100644 --- a/layout/style/test/test_grid_container_shorthands.html +++ b/layout/style/test/test_grid_container_shorthands.html @@ -12,6 +12,9 @@ From 9d10ce063e3eebccebe8847126a368e69bbb1715 Mon Sep 17 00:00:00 2001 From: Wei Wu Date: Wed, 18 Nov 2015 01:36:00 +0100 Subject: [PATCH 28/46] Bug 1224123 - "Tracelogger: fix the use of LastEntryId in tracelogger.h". r=hv1989 --- js/src/vm/TraceLogging.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/src/vm/TraceLogging.h b/js/src/vm/TraceLogging.h index 9773a08d4af..09978d8b068 100644 --- a/js/src/vm/TraceLogging.h +++ b/js/src/vm/TraceLogging.h @@ -205,11 +205,11 @@ class TraceLoggerThread EventEntry* getEventsStartingAt(uint32_t* lastIteration, uint32_t* lastEntryId, size_t* num) { EventEntry* start; if (iteration_ == *lastIteration) { - MOZ_ASSERT(events.lastEntryId() >= *lastEntryId); + MOZ_ASSERT(*lastEntryId < events.size()); *num = events.lastEntryId() - *lastEntryId; start = events.data() + *lastEntryId + 1; } else { - *num = events.lastEntryId() + 1; + *num = events.size(); start = events.data(); } @@ -227,7 +227,7 @@ class TraceLoggerThread bool lostEvents(uint32_t lastIteration, uint32_t lastEntryId) { // If still logging in the same iteration, there are no lost events. if (lastIteration == iteration_) { - MOZ_ASSERT(lastEntryId <= events.lastEntryId()); + MOZ_ASSERT(lastEntryId < events.size()); return false; } From 1e2f24c30d46194bbc1a0f0b92cb511451f0fa61 Mon Sep 17 00:00:00 2001 From: Wei Wu Date: Sun, 15 Nov 2015 19:44:00 +0100 Subject: [PATCH 29/46] Bug 1224814 - "TraceLogger: Remove redundant checks in BaselineJIT". r=hv1989 --- js/src/jit/BaselineJIT.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/js/src/jit/BaselineJIT.cpp b/js/src/jit/BaselineJIT.cpp index 0dac096d11e..35e1a0539ab 100644 --- a/js/src/jit/BaselineJIT.cpp +++ b/js/src/jit/BaselineJIT.cpp @@ -921,10 +921,7 @@ BaselineScript::initTraceLogger(JSRuntime* runtime, JSScript* script) #endif TraceLoggerThread* logger = TraceLoggerForMainThread(runtime); - if (TraceLogTextIdEnabled(TraceLogger_Scripts)) - traceLoggerScriptEvent_ = TraceLoggerEvent(logger, TraceLogger_Scripts, script); - else - traceLoggerScriptEvent_ = TraceLoggerEvent(logger, TraceLogger_Scripts); + traceLoggerScriptEvent_ = TraceLoggerEvent(logger, TraceLogger_Scripts, script); if (TraceLogTextIdEnabled(TraceLogger_Engine) || TraceLogTextIdEnabled(TraceLogger_Scripts)) { CodeLocationLabel enter(method_, CodeOffsetLabel(traceLoggerEnterToggleOffset_)); From 64428b0bc49a22f8d2e8abc811655dc929eaf0b2 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 17 Nov 2015 12:35:10 -0500 Subject: [PATCH 30/46] Bug 1225381 - ensure mozCurrentTransform is finite. r=jmuizelaar --- dom/canvas/CanvasRenderingContext2D.cpp | 4 ++-- dom/canvas/crashtests/1225381-1.html | 17 +++++++++++++++++ dom/canvas/crashtests/crashtests.list | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 dom/canvas/crashtests/1225381-1.html diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 0c3a39c93d8..f105dc0dff1 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -1896,7 +1896,7 @@ CanvasRenderingContext2D::SetMozCurrentTransform(JSContext* cx, } Matrix newCTM; - if (ObjectToMatrix(cx, currentTransform, newCTM, error)) { + if (ObjectToMatrix(cx, currentTransform, newCTM, error) && newCTM.IsFinite()) { mTarget->SetTransform(newCTM); } } @@ -1924,7 +1924,7 @@ CanvasRenderingContext2D::SetMozCurrentTransformInverse(JSContext* cx, Matrix newCTMInverse; if (ObjectToMatrix(cx, currentTransform, newCTMInverse, error)) { // XXX ERRMSG we need to report an error to developers here! (bug 329026) - if (newCTMInverse.Invert()) { + if (newCTMInverse.Invert() && newCTMInverse.IsFinite()) { mTarget->SetTransform(newCTMInverse); } } diff --git a/dom/canvas/crashtests/1225381-1.html b/dom/canvas/crashtests/1225381-1.html new file mode 100644 index 00000000000..4519508a3fa --- /dev/null +++ b/dom/canvas/crashtests/1225381-1.html @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/dom/canvas/crashtests/crashtests.list b/dom/canvas/crashtests/crashtests.list index bc6a3b3493c..edb54352afe 100644 --- a/dom/canvas/crashtests/crashtests.list +++ b/dom/canvas/crashtests/crashtests.list @@ -23,4 +23,5 @@ load 1099143-1.html load 1161277-1.html load 1183363.html load 1190705.html +load 1225381-1.html load texImage2D.html From ecd42af34eb83f91ddeb1fcee3a3f3e95ecf4a2d Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Wed, 18 Nov 2015 11:00:00 +0100 Subject: [PATCH 31/46] Bug 1225942 - Enable some M1 e10s tests that seem to work. r=mrbkap --- dom/base/test/mochitest.ini | 10 +++++----- dom/tests/mochitest/pointerlock/mochitest.ini | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index f794134546e..3e4f9df0618 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -725,7 +725,7 @@ support-files = referrerHelper.js [test_classList.html] # This test fails on the Mac for some reason [test_copyimage.html] -skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || (toolkit != 'cocoa' && toolkit != 'gonk' && toolkit != 'gtk2' && toolkit != 'gtk3' && toolkit != 'windows') || e10s #b2g-desktop(Bug 931116, b2g desktop specific, initial triage) +skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || (toolkit != 'cocoa' && toolkit != 'gonk' && toolkit != 'gtk2' && toolkit != 'gtk3' && toolkit != 'windows') #b2g-desktop(Bug 931116, b2g desktop specific, initial triage) [test_copypaste.html] skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 904183 # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined) [test_copypaste.xhtml] @@ -775,15 +775,15 @@ skip-if = buildapp == 'b2g' || e10s # b2g(bug 901385, showmodaldialog) b2g-debug [test_object.html] skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(needs plugin support) b2g-debug(needs plugin support) b2g-desktop(needs plugin support) [test_plugin_freezing.html] -skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #CLICK_TO_PLAY +skip-if = buildapp == 'b2g' || toolkit == 'android' #CLICK_TO_PLAY [test_processing_instruction_update_stylesheet.xhtml] [test_progress_events_for_gzip_data.html] [test_range_bounds.html] -skip-if = toolkit == 'android' || e10s +skip-if = toolkit == 'android' [test_reentrant_flush.html] -skip-if = toolkit == 'android' || e10s #RANDOM +skip-if = toolkit == 'android' [test_sync_xhr_timer.xhtml] -skip-if = toolkit == 'android' || e10s #RANDOM +skip-if = toolkit == 'android' [test_text_wholeText.html] [test_textnode_normalize_in_selection.html] [test_textnode_split_in_selection.html] diff --git a/dom/tests/mochitest/pointerlock/mochitest.ini b/dom/tests/mochitest/pointerlock/mochitest.ini index a2ab8948c84..07aeac0abd1 100644 --- a/dom/tests/mochitest/pointerlock/mochitest.ini +++ b/dom/tests/mochitest/pointerlock/mochitest.ini @@ -21,4 +21,4 @@ support-files = iframe_differentDOM.html [test_pointerlock-api.html] -skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s || os == 'linux' || os == 'win' # B2G - window.open focus issues using fullscreen. (For Linux & Win) Bug1180351 +skip-if = buildapp == 'b2g' || toolkit == 'android' || os == 'linux' || os == 'win' # B2G - window.open focus issues using fullscreen. (For Linux & Win) Bug1180351 From 0fb4d58a20c80d13b4a93e766767e245d6f94580 Mon Sep 17 00:00:00 2001 From: Nigel Babu Date: Thu, 19 Nov 2015 17:48:09 +0530 Subject: [PATCH 32/46] Backed out changeset 9c8f83fb5930 (bug 1190093) for Gij(11) bustage on a CLOSED TREE --- dom/base/nsDocument.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 0f1592c028a..d9c842fb92a 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -3716,8 +3716,8 @@ nsIDocument::ShouldThrottleFrameRequests() return false; } - if (Hidden()) { - // We're not visible (probably in a background tab or the bf cache). + if (!mIsShowing) { + // We're not showing (probably in a background tab or the bf cache). return true; } From b4b0d26ddf00d9f4253a3bb113f8d44ebd11eb99 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Wed, 18 Nov 2015 18:36:48 +0000 Subject: [PATCH 33/46] Bug 1225761 - Clear axis lock in CancelAnimation and EndTouch. r=botond --- gfx/layers/apz/src/AsyncPanZoomController.cpp | 2 ++ gfx/layers/apz/src/Axis.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 40fd834d2cf..4dc9c32991f 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -2547,6 +2547,8 @@ void AsyncPanZoomController::CancelAnimation(CancelAnimationFlags aFlags) { bool repaint = !IsZero(GetVelocityVector()); mX.SetVelocity(0); mY.SetVelocity(0); + mX.SetAxisLocked(false); + mY.SetAxisLocked(false); // Setting the state to nothing and cancelling the animation can // preempt normal mechanisms for relieving overscroll, so we need to clear // overscroll here. diff --git a/gfx/layers/apz/src/Axis.cpp b/gfx/layers/apz/src/Axis.cpp index 5a38852dc4b..67d3c8f0381 100644 --- a/gfx/layers/apz/src/Axis.cpp +++ b/gfx/layers/apz/src/Axis.cpp @@ -382,6 +382,7 @@ void Axis::EndTouch(uint32_t aTimestampMs) { // mVelocityQueue is controller-thread only APZThreadUtils::AssertOnControllerThread(); + mAxisLocked = false; mVelocity = 0; int count = 0; while (!mVelocityQueue.IsEmpty()) { From cbe1ec5b41572583be1e49de11c248ecbbbc948d Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Thu, 19 Nov 2015 13:33:17 +0000 Subject: [PATCH 34/46] Bug 1223002 - Cherry-pick post-1.3.4 bugfixes for graphite2 from upstream. r=jdaggett --- gfx/graphite2/README.mozilla | 3 +++ gfx/graphite2/src/Code.cpp | 10 +++++++--- gfx/graphite2/src/Face.cpp | 1 - gfx/graphite2/src/TtfUtil.cpp | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gfx/graphite2/README.mozilla b/gfx/graphite2/README.mozilla index 1dde1c22dd7..8edf83bcc6e 100644 --- a/gfx/graphite2/README.mozilla +++ b/gfx/graphite2/README.mozilla @@ -1,3 +1,6 @@ This directory contains the Graphite2 library release 1.3.4 from https://github.com/silnrsi/graphite/releases/download/1.3.4/graphite2-minimal-1.3.4.tgz See ./gfx/graphite2/moz-gr-update.sh for update procedure. + +Bug 1223002: Updated to upstream commit 6106dcbd5bc4df2e6ef6a7c632c69ca71ba2b518 +to fix recently-discovered fuzzbugs. diff --git a/gfx/graphite2/src/Code.cpp b/gfx/graphite2/src/Code.cpp index b3515679c63..02ad54d7dcd 100644 --- a/gfx/graphite2/src/Code.cpp +++ b/gfx/graphite2/src/Code.cpp @@ -120,6 +120,7 @@ private: analysis _analysis; enum passtype _passtype; int _stack_depth; + bool _in_ctxt_item; }; @@ -139,7 +140,8 @@ inline Machine::Code::decoder::decoder(limits & lims, Code &code, enum passtype _pre_context(code._constraint ? 0 : lims.pre_context), _rule_length(code._constraint ? 1 : lims.rule_length), _instr(code._code), _data(code._data), _max(lims), _passtype(pt), - _stack_depth(0) + _stack_depth(0), + _in_ctxt_item(false) { } @@ -356,8 +358,8 @@ opcode Machine::Code::decoder::fetch_opcode(const byte * bc) break; case CNTXT_ITEM : valid_upto(_max.rule_length, _max.pre_context + int8(bc[0])); - if (bc + 2 + bc[1] >= _max.bytecode) failure(jump_past_end); - if (_pre_context != 0) failure(nested_context_item); + if (bc + 2 + bc[1] >= _max.bytecode) failure(jump_past_end); + if (_in_ctxt_item) failure(nested_context_item); break; case ATTR_SET : case ATTR_ADD : @@ -578,6 +580,7 @@ bool Machine::Code::decoder::emit_opcode(opcode opc, const byte * & bc) if (opc == CNTXT_ITEM) { assert(_pre_context == 0); + _in_ctxt_item = true; _pre_context = _max.pre_context + int8(_data[-2]); _rule_length = _max.rule_length; @@ -596,6 +599,7 @@ bool Machine::Code::decoder::emit_opcode(opcode opc, const byte * & bc) _rule_length = 1; _pre_context = 0; + _in_ctxt_item = false; } else { diff --git a/gfx/graphite2/src/Face.cpp b/gfx/graphite2/src/Face.cpp index ab77d7220f6..7aefdb98de0 100644 --- a/gfx/graphite2/src/Face.cpp +++ b/gfx/graphite2/src/Face.cpp @@ -195,7 +195,6 @@ bool Face::runGraphite(Segment *seg, const Silf *aSilf) const << "output" << json::array; for(Slot * s = seg->first(); s; s = s->next()) *dbgout << dslot(seg, s); - seg->finalise(0); // Call this here to fix up charinfo back indexes. *dbgout << json::close << "advance" << seg->advance() << "chars" << json::array; diff --git a/gfx/graphite2/src/TtfUtil.cpp b/gfx/graphite2/src/TtfUtil.cpp index 0b6b98035bd..90ced6aee6a 100644 --- a/gfx/graphite2/src/TtfUtil.cpp +++ b/gfx/graphite2/src/TtfUtil.cpp @@ -952,7 +952,7 @@ gid16 CmapSubtable4Lookup(const void * pCmapSubtabel4, unsigned int nUnicodeId, uint16 nSeg = be::swap(pTable->seg_count_x2) >> 1; uint16 n; - const uint16 * pLeft, * pMid; + const uint16 * pLeft, * pMid; uint16 cMid, chStart, chEnd; if (rangeKey) From ae94d039ad9df998d33d6b92e53b299ff0c8ad48 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Thu, 19 Nov 2015 14:04:47 +0000 Subject: [PATCH 35/46] Bug 1169068 - Performance.translateTime(), r=bz --- dom/base/nsPerformance.cpp | 71 ++++++++++++++---- dom/base/nsPerformance.h | 30 ++++++-- dom/base/test/empty_worker.js | 1 + dom/base/test/mochitest.ini | 2 + dom/base/test/test_performance_translate.html | 75 +++++++++++++++++++ dom/webidl/Performance.webidl | 9 ++- dom/workers/Performance.cpp | 14 ++-- dom/workers/Performance.h | 5 +- dom/workers/ServiceWorker.cpp | 7 ++ dom/workers/ServiceWorker.h | 3 + dom/workers/ServiceWorkerPrivate.h | 6 ++ 11 files changed, 189 insertions(+), 34 deletions(-) create mode 100644 dom/base/test/empty_worker.js create mode 100644 dom/base/test/test_performance_translate.html diff --git a/dom/base/nsPerformance.cpp b/dom/base/nsPerformance.cpp index a531e330794..fc7aa3736ab 100644 --- a/dom/base/nsPerformance.cpp +++ b/dom/base/nsPerformance.cpp @@ -11,6 +11,7 @@ #include "nsDOMNavigationTiming.h" #include "nsContentUtils.h" #include "nsIScriptSecurityManager.h" +#include "nsGlobalWindow.h" #include "nsIDOMWindow.h" #include "nsILoadInfo.h" #include "nsIURI.h" @@ -29,6 +30,8 @@ #include "mozilla/Preferences.h" #include "mozilla/IntegerPrintfMacros.h" #include "mozilla/TimeStamp.h" +#include "SharedWorker.h" +#include "ServiceWorker.h" #include "js/HeapAPI.h" #include "GeckoProfiler.h" #include "WorkerPrivate.h" @@ -500,12 +503,7 @@ nsPerformance::Navigation() DOMHighResTimeStamp nsPerformance::Now() const { - double nowTimeMs = GetDOMTiming()->TimeStampToDOMHighRes(TimeStamp::Now()); - // Round down to the nearest 5us, because if the timer is too accurate people - // can do nasty timing attacks with it. See similar code in the worker - // Performance implementation. - const double maxResolutionMs = 0.005; - return floor(nowTimeMs / maxResolutionMs) * maxResolutionMs; + return RoundTime(GetDOMTiming()->TimeStampToDOMHighRes(TimeStamp::Now())); } JSObject* @@ -802,15 +800,16 @@ nsPerformance::InsertUserEntry(PerformanceEntry* aEntry) PerformanceBase::InsertUserEntry(aEntry); } -DOMHighResTimeStamp -nsPerformance::DeltaFromNavigationStart(DOMHighResTimeStamp aTime) +TimeStamp +nsPerformance::CreationTimeStamp() const { - // If the time we're trying to convert is equal to zero, it hasn't been set - // yet so just return 0. - if (aTime == 0) { - return 0; - } - return aTime - GetDOMTiming()->GetNavigationStart(); + return GetDOMTiming()->GetNavigationStartTimeStamp(); +} + +DOMHighResTimeStamp +nsPerformance::CreationTime() const +{ + return GetDOMTiming()->GetNavigationStart(); } // PerformanceBase @@ -922,6 +921,48 @@ PerformanceBase::ClearResourceTimings() mResourceEntries.Clear(); } +DOMHighResTimeStamp +PerformanceBase::TranslateTime(DOMHighResTimeStamp aTime, + const WindowOrWorkerOrSharedWorkerOrServiceWorker& aTimeSource, + ErrorResult& aRv) +{ + TimeStamp otherCreationTimeStamp; + + if (aTimeSource.IsWindow()) { + RefPtr performance = aTimeSource.GetAsWindow().GetPerformance(); + if (NS_WARN_IF(!performance)) { + aRv.Throw(NS_ERROR_FAILURE); + } + otherCreationTimeStamp = performance->CreationTimeStamp(); + } else if (aTimeSource.IsWorker()) { + otherCreationTimeStamp = aTimeSource.GetAsWorker().NowBaseTimeStamp(); + } else if (aTimeSource.IsSharedWorker()) { + SharedWorker& sharedWorker = aTimeSource.GetAsSharedWorker(); + WorkerPrivate* workerPrivate = sharedWorker.GetWorkerPrivate(); + otherCreationTimeStamp = workerPrivate->NowBaseTimeStamp(); + } else if (aTimeSource.IsServiceWorker()) { + ServiceWorker& serviceWorker = aTimeSource.GetAsServiceWorker(); + WorkerPrivate* workerPrivate = serviceWorker.GetWorkerPrivate(); + otherCreationTimeStamp = workerPrivate->NowBaseTimeStamp(); + } else { + MOZ_CRASH("This should not be possible."); + } + + return RoundTime( + aTime + (otherCreationTimeStamp - CreationTimeStamp()).ToMilliseconds()); +} + +DOMHighResTimeStamp +PerformanceBase::RoundTime(double aTime) const +{ + // Round down to the nearest 5us, because if the timer is too accurate people + // can do nasty timing attacks with it. See similar code in the worker + // Performance implementation. + const double maxResolutionMs = 0.005; + return floor(aTime / maxResolutionMs) * maxResolutionMs; +} + + void PerformanceBase::Mark(const nsAString& aName, ErrorResult& aRv) { @@ -976,7 +1017,7 @@ PerformanceBase::ResolveTimestampFromName(const nsAString& aName, return 0; } - return DeltaFromNavigationStart(ts); + return ts - CreationTime(); } void diff --git a/dom/base/nsPerformance.h b/dom/base/nsPerformance.h index bca309cf216..6b1336d9b08 100644 --- a/dom/base/nsPerformance.h +++ b/dom/base/nsPerformance.h @@ -23,10 +23,15 @@ class nsPerformance; class nsIHttpChannel; namespace mozilla { + class ErrorResult; + namespace dom { - class PerformanceEntry; - class PerformanceObserver; + +class PerformanceEntry; +class PerformanceObserver; +class WindowOrWorkerOrSharedWorkerOrServiceWorker; + } // namespace dom } // namespace mozilla @@ -313,6 +318,11 @@ public: virtual DOMHighResTimeStamp Now() const = 0; + DOMHighResTimeStamp + TranslateTime(DOMHighResTimeStamp aTime, + const mozilla::dom::WindowOrWorkerOrSharedWorkerOrServiceWorker& aTimeSource, + mozilla::ErrorResult& aRv); + void Mark(const nsAString& aName, mozilla::ErrorResult& aRv); void ClearMarks(const mozilla::dom::Optional& aName); void Measure(const nsAString& aName, @@ -344,8 +354,9 @@ protected: virtual void DispatchBufferFullEvent() = 0; - virtual DOMHighResTimeStamp - DeltaFromNavigationStart(DOMHighResTimeStamp aTime) = 0; + virtual mozilla::TimeStamp CreationTimeStamp() const = 0; + + virtual DOMHighResTimeStamp CreationTime() const = 0; virtual bool IsPerformanceTimingAttribute(const nsAString& aName) = 0; @@ -363,6 +374,8 @@ protected: void RunNotificationObserversTask(); void QueueEntry(PerformanceEntry* aEntry); + DOMHighResTimeStamp RoundTime(double aTime) const; + nsTObserverArray mObservers; private: @@ -433,7 +446,11 @@ public: IMPL_EVENT_HANDLER(resourcetimingbufferfull) -private: + mozilla::TimeStamp CreationTimeStamp() const override; + + DOMHighResTimeStamp CreationTime() const override; + +protected: ~nsPerformance(); nsISupports* GetAsISupports() override @@ -445,9 +462,6 @@ private: bool IsPerformanceTimingAttribute(const nsAString& aName) override; - DOMHighResTimeStamp - DeltaFromNavigationStart(DOMHighResTimeStamp aTime) override; - DOMHighResTimeStamp GetPerformanceTimingFromString(const nsAString& aTimingName) override; diff --git a/dom/base/test/empty_worker.js b/dom/base/test/empty_worker.js new file mode 100644 index 00000000000..3053583c761 --- /dev/null +++ b/dom/base/test/empty_worker.js @@ -0,0 +1 @@ +/* nothing here */ diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index 3e4f9df0618..8472d443580 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -256,6 +256,7 @@ support-files = file_explicit_user_agent.sjs referrer_change_server.sjs file_change_policy_redirect.html + empty_worker.js [test_anonymousContent_api.html] [test_anonymousContent_append_after_reflow.html] @@ -855,3 +856,4 @@ skip-if = e10s || os != 'linux' || buildapp != 'browser' [test_change_policy.html] skip-if = buildapp == 'b2g' #no ssl support [test_document.all_iteration.html] +[test_performance_translate.html] diff --git a/dom/base/test/test_performance_translate.html b/dom/base/test/test_performance_translate.html new file mode 100644 index 00000000000..c64ecef2d04 --- /dev/null +++ b/dom/base/test/test_performance_translate.html @@ -0,0 +1,75 @@ + + + + Test for performance.translate() + + + + + +
+      
+    
+ + diff --git a/dom/webidl/Performance.webidl b/dom/webidl/Performance.webidl index 64c4bdb7b48..6df0dd2ae70 100644 --- a/dom/webidl/Performance.webidl +++ b/dom/webidl/Performance.webidl @@ -4,10 +4,10 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is - * http://www.w3.org/TR/hr-time/ + * http://w3c.github.io/hr-time/ * - * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C - * liability, trademark and document use rules apply. + * Copyright © 2015 W3C® (MIT, ERCIM, Keio, Beihang). + * W3C liability, trademark and document use rules apply. */ typedef double DOMHighResTimeStamp; @@ -17,6 +17,9 @@ typedef sequence PerformanceEntryList; interface Performance { [DependsOn=DeviceState, Affects=Nothing] DOMHighResTimeStamp now(); + + [Throws] + DOMHighResTimeStamp translateTime(DOMHighResTimeStamp time, (Window or Worker or SharedWorker or ServiceWorker) timeSource); }; [Exposed=Window] diff --git a/dom/workers/Performance.cpp b/dom/workers/Performance.cpp index 9590469b249..894bcdb7a1a 100644 --- a/dom/workers/Performance.cpp +++ b/dom/workers/Performance.cpp @@ -79,14 +79,16 @@ Performance::InsertUserEntry(PerformanceEntry* aEntry) PerformanceBase::InsertUserEntry(aEntry); } -DOMHighResTimeStamp -Performance::DeltaFromNavigationStart(DOMHighResTimeStamp aTime) +TimeStamp +Performance::CreationTimeStamp() const { - if (aTime == 0) { - return 0; - } + return mWorkerPrivate->NowBaseTimeStamp(); +} - return aTime - mWorkerPrivate->NowBaseTimeHighRes(); +DOMHighResTimeStamp +Performance::CreationTime() const +{ + return mWorkerPrivate->NowBaseTimeHighRes(); } void diff --git a/dom/workers/Performance.h b/dom/workers/Performance.h index ab18b078eaf..c0b5af8560f 100644 --- a/dom/workers/Performance.h +++ b/dom/workers/Performance.h @@ -55,8 +55,9 @@ private: DOMHighResTimeStamp GetPerformanceTimingFromString(const nsAString& aTimingName) override; - DOMHighResTimeStamp - DeltaFromNavigationStart(DOMHighResTimeStamp aTime) override; + TimeStamp CreationTimeStamp() const override; + + DOMHighResTimeStamp CreationTime() const override; }; END_WORKERS_NAMESPACE diff --git a/dom/workers/ServiceWorker.cpp b/dom/workers/ServiceWorker.cpp index 4542514f62c..777d7ef1b38 100644 --- a/dom/workers/ServiceWorker.cpp +++ b/dom/workers/ServiceWorker.cpp @@ -101,6 +101,13 @@ ServiceWorker::PostMessage(JSContext* aCx, JS::Handle aMessage, aRv = workerPrivate->SendMessageEvent(aCx, aMessage, aTransferable, Move(clientInfo)); } +WorkerPrivate* +ServiceWorker::GetWorkerPrivate() const +{ + ServiceWorkerPrivate* workerPrivate = mInfo->WorkerPrivate(); + return workerPrivate->GetWorkerPrivate(); +} + } // namespace workers } // namespace dom } // namespace mozilla diff --git a/dom/workers/ServiceWorker.h b/dom/workers/ServiceWorker.h index 15fc4fbc7a9..26cf53eb7be 100644 --- a/dom/workers/ServiceWorker.h +++ b/dom/workers/ServiceWorker.h @@ -67,6 +67,9 @@ public: const Optional>& aTransferable, ErrorResult& aRv); + WorkerPrivate* + GetWorkerPrivate() const; + private: // This class can only be created from the ServiceWorkerManager. ServiceWorker(nsPIDOMWindow* aWindow, ServiceWorkerInfo* aInfo); diff --git a/dom/workers/ServiceWorkerPrivate.h b/dom/workers/ServiceWorkerPrivate.h index 4ba25ac277c..ae225a8bbb9 100644 --- a/dom/workers/ServiceWorkerPrivate.h +++ b/dom/workers/ServiceWorkerPrivate.h @@ -128,6 +128,12 @@ public: void NoteStoppedControllingDocuments(); + WorkerPrivate* + GetWorkerPrivate() const + { + return mWorkerPrivate; + } + private: enum WakeUpReason { FetchEvent = 0, From a4cbc1813ac9bb6d6335f4eac81af7c64b43e3db Mon Sep 17 00:00:00 2001 From: John Daggett Date: Thu, 19 Nov 2015 23:06:41 +0900 Subject: [PATCH 36/46] Bug 1224641 - tweak the italic oblique tests to avoid failure on Ubuntu/Mulet. r=m_kato --- layout/reftests/font-matching/italic-oblique-1.html | 2 +- layout/reftests/font-matching/italic-oblique-2.html | 2 +- layout/reftests/font-matching/italic-oblique-3.html | 2 +- layout/reftests/font-matching/italic-oblique-4.html | 2 +- layout/reftests/font-matching/italic-oblique-5.html | 2 +- layout/reftests/font-matching/italic-oblique-6.html | 2 +- layout/reftests/font-matching/italic-oblique-7.html | 2 +- layout/reftests/font-matching/italic-oblique-8.html | 2 +- layout/reftests/font-matching/italic-oblique-9.html | 2 +- layout/reftests/font-matching/italic-oblique-ref.html | 2 +- layout/reftests/font-matching/reftest.list | 8 ++++---- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/layout/reftests/font-matching/italic-oblique-1.html b/layout/reftests/font-matching/italic-oblique-1.html index 7df94b51dc4..ae7e70fa6bb 100644 --- a/layout/reftests/font-matching/italic-oblique-1.html +++ b/layout/reftests/font-matching/italic-oblique-1.html @@ -20,7 +20,7 @@ } body { margin: 30px } -p { margin: 0; font: italic 300% test, serif; } +p { margin: 0; font: italic 600% test, serif; } diff --git a/layout/reftests/font-matching/italic-oblique-2.html b/layout/reftests/font-matching/italic-oblique-2.html index b3264120d56..f5ae4c33b51 100644 --- a/layout/reftests/font-matching/italic-oblique-2.html +++ b/layout/reftests/font-matching/italic-oblique-2.html @@ -20,7 +20,7 @@ } body { margin: 30px } -p { margin: 0; font: italic 300% test, serif; } +p { margin: 0; font: italic 600% test, serif; } diff --git a/layout/reftests/font-matching/italic-oblique-3.html b/layout/reftests/font-matching/italic-oblique-3.html index cf897ae44dc..5d1c95bfe64 100644 --- a/layout/reftests/font-matching/italic-oblique-3.html +++ b/layout/reftests/font-matching/italic-oblique-3.html @@ -26,7 +26,7 @@ } body { margin: 30px } -p { margin: 0; font: italic 300% test, serif; } +p { margin: 0; font: italic 600% test, serif; } diff --git a/layout/reftests/font-matching/italic-oblique-4.html b/layout/reftests/font-matching/italic-oblique-4.html index 2313462c340..92438c6a19e 100644 --- a/layout/reftests/font-matching/italic-oblique-4.html +++ b/layout/reftests/font-matching/italic-oblique-4.html @@ -26,7 +26,7 @@ } body { margin: 30px } -p { margin: 0; font: italic 300% test, serif; } +p { margin: 0; font: italic 600% test, serif; } diff --git a/layout/reftests/font-matching/italic-oblique-5.html b/layout/reftests/font-matching/italic-oblique-5.html index de1281b0a2e..d71ffa78034 100644 --- a/layout/reftests/font-matching/italic-oblique-5.html +++ b/layout/reftests/font-matching/italic-oblique-5.html @@ -26,7 +26,7 @@ } body { margin: 30px } -p { margin: 0; font: oblique 300% test, serif; } +p { margin: 0; font: oblique 600% test, serif; } diff --git a/layout/reftests/font-matching/italic-oblique-6.html b/layout/reftests/font-matching/italic-oblique-6.html index de23a2de9e2..3d249c504b2 100644 --- a/layout/reftests/font-matching/italic-oblique-6.html +++ b/layout/reftests/font-matching/italic-oblique-6.html @@ -26,7 +26,7 @@ } body { margin: 30px } -p { margin: 0; font: oblique 300% test, serif; } +p { margin: 0; font: oblique 600% test, serif; } diff --git a/layout/reftests/font-matching/italic-oblique-7.html b/layout/reftests/font-matching/italic-oblique-7.html index 05cc3c45f44..3064fa534cf 100644 --- a/layout/reftests/font-matching/italic-oblique-7.html +++ b/layout/reftests/font-matching/italic-oblique-7.html @@ -26,7 +26,7 @@ } body { margin: 30px } -p { margin: 0; font: oblique 300% test, serif; } +p { margin: 0; font: oblique 600% test, serif; } diff --git a/layout/reftests/font-matching/italic-oblique-8.html b/layout/reftests/font-matching/italic-oblique-8.html index ee4ec956ffe..13783610ddb 100644 --- a/layout/reftests/font-matching/italic-oblique-8.html +++ b/layout/reftests/font-matching/italic-oblique-8.html @@ -32,7 +32,7 @@ } body { margin: 30px } -p { margin: 0; font: oblique 300% test1, test2, test3, serif; } +p { margin: 0; font: oblique 600% test1, test2, test3, serif; } diff --git a/layout/reftests/font-matching/italic-oblique-9.html b/layout/reftests/font-matching/italic-oblique-9.html index dfc4012fa9c..a669682abf8 100644 --- a/layout/reftests/font-matching/italic-oblique-9.html +++ b/layout/reftests/font-matching/italic-oblique-9.html @@ -32,7 +32,7 @@ } body { margin: 30px } -p { margin: 0; font: oblique 300% test1, test2, test3, serif; } +p { margin: 0; font: oblique 600% test1, test2, test3, serif; } diff --git a/layout/reftests/font-matching/italic-oblique-ref.html b/layout/reftests/font-matching/italic-oblique-ref.html index 8ae9bbc19b9..d1fc2939cb2 100644 --- a/layout/reftests/font-matching/italic-oblique-ref.html +++ b/layout/reftests/font-matching/italic-oblique-ref.html @@ -13,7 +13,7 @@ src: url(../fonts/markA.woff); } body { margin: 30px } -p { margin: 0; font: 300% test, serif; } +p { margin: 0; font: 600% test, serif; } diff --git a/layout/reftests/font-matching/reftest.list b/layout/reftests/font-matching/reftest.list index cf7a2f4e66f..22d26734ef0 100644 --- a/layout/reftests/font-matching/reftest.list +++ b/layout/reftests/font-matching/reftest.list @@ -102,12 +102,12 @@ skip-if(!cocoaWidget) HTTP(..) != apple-symbols-1.html apple-symbols-1-notref.ht # distinguish between italic and oblique == simple-oblique.html simple-oblique-ref.html == italic-oblique-1.html italic-oblique-ref.html -fuzzy-if(Mulet,103,144) == italic-oblique-2.html italic-oblique-ref.html +== italic-oblique-2.html italic-oblique-ref.html == italic-oblique-3.html italic-oblique-ref.html == italic-oblique-4.html italic-oblique-ref.html == italic-oblique-5.html italic-oblique-ref.html -fuzzy-if(Mulet,103,144) == italic-oblique-6.html italic-oblique-ref.html +== italic-oblique-6.html italic-oblique-ref.html == italic-oblique-7.html italic-oblique-ref.html -fuzzy-if(Mulet,103,144) == italic-oblique-8.html italic-oblique-ref.html -fuzzy-if(Mulet,103,144) == italic-oblique-9.html italic-oblique-ref.html +== italic-oblique-8.html italic-oblique-ref.html +== italic-oblique-9.html italic-oblique-ref.html != italic-oblique-kinnari.html italic-oblique-kinnari-ref.html From 106e17b96310529dbcbc37278b94de6fc138c592 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Wed, 18 Nov 2015 17:14:07 -0500 Subject: [PATCH 37/46] Bug 1226063 - take advantage of UniquePtr in BluetoothMapSmsManager::SendMasObexData; r=btian Now that UnixSocketRawData can assume ownership of UniquePtrs, we can enhance SendMasObexData to accept UniquePtrs where possible. --- .../bluedroid/BluetoothMapSmsManager.cpp | 36 +++++++++++-------- .../bluedroid/BluetoothMapSmsManager.h | 4 ++- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/dom/bluetooth/bluedroid/BluetoothMapSmsManager.cpp b/dom/bluetooth/bluedroid/BluetoothMapSmsManager.cpp index a78f1f3a8eb..f6eb863cee2 100644 --- a/dom/bluetooth/bluedroid/BluetoothMapSmsManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothMapSmsManager.cpp @@ -348,8 +348,8 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage) * ObexResponseCode::Success */ if (mDataStream) { - nsAutoArrayPtr res(new uint8_t[mRemoteMaxPacketLength]); - if (!ReplyToGetWithHeaderBody(res.get(), kObexRespHeaderSize)) { + auto res = MakeUnique(mRemoteMaxPacketLength); + if (!ReplyToGetWithHeaderBody(Move(res), kObexRespHeaderSize)) { BT_LOGR("Failed to reply to MAP GET request."); SendReply(ObexResponseCode::InternalServerError); } @@ -565,7 +565,7 @@ BluetoothMapSmsManager::ReplyToSetPath() } bool -BluetoothMapSmsManager::ReplyToGetWithHeaderBody(uint8_t* aResponse, +BluetoothMapSmsManager::ReplyToGetWithHeaderBody(UniquePtr aResponse, unsigned int aIndex) { if (!mMasConnected) { @@ -634,7 +634,7 @@ BluetoothMapSmsManager::ReplyToGetWithHeaderBody(uint8_t* aResponse, opcode = ObexResponseCode::Continue; } - SendMasObexData(aResponse, opcode, aIndex); + SendMasObexData(Move(aResponse), opcode, aIndex); return true; } @@ -695,7 +695,7 @@ BluetoothMapSmsManager::ReplyToMessagesListing(Blob* aBlob, long aMasId, // ---- Part 1: [response code:1][length:2] ---- // // [response code:1][length:2] will be set in |SendObexData|. // Reserve index here - nsAutoArrayPtr res(new uint8_t[mRemoteMaxPacketLength]); + auto res = MakeUnique(mRemoteMaxPacketLength); unsigned int index = kObexRespHeaderSize; // ---- Part 2: headerId:1][length:2][appParam:var] ---- // @@ -729,7 +729,7 @@ BluetoothMapSmsManager::ReplyToMessagesListing(Blob* aBlob, long aMasId, msgListingSize, sizeof(msgListingSize)); - index += AppendHeaderAppParameters(res + index, + index += AppendHeaderAppParameters(&res[index], mRemoteMaxPacketLength, appParameters, len + 9); @@ -742,11 +742,11 @@ BluetoothMapSmsManager::ReplyToMessagesListing(Blob* aBlob, long aMasId, } // ---- Part 3: [headerId:1][length:2][Body:var] ---- // - ReplyToGetWithHeaderBody(res, index); + ReplyToGetWithHeaderBody(Move(res), index); // Reset flag mBodyRequired = false; } else { - SendMasObexData(res, ObexResponseCode::Success, index); + SendMasObexData(Move(res), ObexResponseCode::Success, index); } return true; @@ -783,7 +783,7 @@ BluetoothMapSmsManager::ReplyToGetMessage(Blob* aBlob, long aMasId) // ---- Part 1: [response code:1][length:2] ---- // // [response code:1][length:2] will be set in |SendObexData|. // Reserve index here - nsAutoArrayPtr res (new uint8_t[mRemoteMaxPacketLength]); + auto res = MakeUnique(mRemoteMaxPacketLength); unsigned int index = kObexRespHeaderSize; if (mFractionDeliverRequired) { @@ -797,7 +797,7 @@ BluetoothMapSmsManager::ReplyToGetMessage(Blob* aBlob, long aMasId) &fractionDeliver, sizeof(fractionDeliver)); - index += AppendHeaderAppParameters(res + index, + index += AppendHeaderAppParameters(&res[index], mRemoteMaxPacketLength, appParameters, sizeof(appParameters)); @@ -805,7 +805,7 @@ BluetoothMapSmsManager::ReplyToGetMessage(Blob* aBlob, long aMasId) // TODO: Support bMessage encoding in bug 1166652. // ---- Part 3: [headerId:1][length:2][Body:var] ---- // - ReplyToGetWithHeaderBody(res.get(), index); + ReplyToGetWithHeaderBody(Move(res), index); mFractionDeliverRequired = false; return true; @@ -838,11 +838,11 @@ BluetoothMapSmsManager::ReplyToSendMessage( *(handleId + (len * 2)) = 0x00; *(handleId + (len * 2 + 1)) = 0x00; - nsAutoArrayPtr res(new uint8_t[mRemoteMaxPacketLength]); + auto res = MakeUnique(mRemoteMaxPacketLength); int index = kObexRespHeaderSize; - index += AppendHeaderName(res + index, mRemoteMaxPacketLength - index, + index += AppendHeaderName(&res[index], mRemoteMaxPacketLength - index, handleId, (len + 1) * 2); - SendMasObexData(res.get(), ObexResponseCode::Success, index); + SendMasObexData(Move(res), ObexResponseCode::Success, index); return true; } @@ -1455,6 +1455,14 @@ BluetoothMapSmsManager::SendMasObexData(uint8_t* aData, uint8_t aOpcode, mMasSocket->SendSocketData(new UnixSocketRawData(aData, aSize)); } +void +BluetoothMapSmsManager::SendMasObexData(UniquePtr aData, + uint8_t aOpcode, int aSize) +{ + SetObexPacketInfo(aData.get(), aOpcode, aSize); + mMasSocket->SendSocketData(new UnixSocketRawData(Move(aData), aSize)); +} + void BluetoothMapSmsManager::SendMnsObexData(uint8_t* aData, uint8_t aOpcode, int aSize) diff --git a/dom/bluetooth/bluedroid/BluetoothMapSmsManager.h b/dom/bluetooth/bluedroid/BluetoothMapSmsManager.h index 9977bf23e42..7649d521315 100644 --- a/dom/bluetooth/bluedroid/BluetoothMapSmsManager.h +++ b/dom/bluetooth/bluedroid/BluetoothMapSmsManager.h @@ -13,6 +13,7 @@ #include "BluetoothProfileManagerBase.h" #include "BluetoothSocketObserver.h" #include "mozilla/ipc/SocketBase.h" +#include "mozilla/UniquePtr.h" class nsIInputStream; @@ -205,7 +206,7 @@ private: * packet. If the operation requires multiple response packets to complete * after the Final bit is set in the request. */ - bool ReplyToGetWithHeaderBody(uint8_t* aResponse, unsigned int aIndex); + bool ReplyToGetWithHeaderBody(UniquePtr aResponse, unsigned int aIndex); void ReplyToSetPath(); void ReplyToPut(); void SendReply(uint8_t aResponse); @@ -222,6 +223,7 @@ private: InfallibleTArray& aValues, const Map::AppParametersTagId aTagId); void SendMasObexData(uint8_t* aData, uint8_t aOpcode, int aSize); + void SendMasObexData(UniquePtr aData, uint8_t aOpcode, int aSize); void SendMnsObexData(uint8_t* aData, uint8_t aOpcode, int aSize); bool StatusResponse(bool aStatus); From 04b058fbaa145ab9679ce316f7fe18ab50838b29 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 19 Nov 2015 09:48:26 -0500 Subject: [PATCH 38/46] Bug 1226146: fix sndio audio_device backend after webrtc 43 landing in bug 1198458 r=jesup NPOTB --- .../audio_device/sndio/audio_device_sndio.cc | 38 ++--- .../audio_device/sndio/audio_device_sndio.h | 150 +++++++++--------- .../sndio/audio_device_utility_sndio.h | 2 +- 3 files changed, 88 insertions(+), 102 deletions(-) diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc index 9f138633889..227b97f7410 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc @@ -17,7 +17,6 @@ #include "webrtc/system_wrappers/interface/event_wrapper.h" #include "webrtc/system_wrappers/interface/sleep.h" -#include "webrtc/system_wrappers/interface/thread_wrapper.h" #include "webrtc/system_wrappers/interface/trace.h" #include "Latency.h" @@ -688,7 +687,6 @@ int32_t AudioDeviceSndio::InitRecording() int32_t AudioDeviceSndio::StartRecording() { - unsigned int unused_thread_id; const char* threadName = "webrtc_audio_module_capture_thread"; if (_recHandle == NULL) @@ -703,7 +701,6 @@ int32_t AudioDeviceSndio::StartRecording() _ptrThreadRec = ThreadWrapper::CreateThread(RecThreadFunc, this, - kRealtimePriority, threadName); if (_ptrThreadRec == NULL) { @@ -721,21 +718,19 @@ int32_t AudioDeviceSndio::StartRecording() { WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " couldn't start recording"); - delete _ptrThreadRec; - _ptrThreadRec = NULL; + _ptrThreadRec.reset(); delete [] _recordingBuffer; _recordingBuffer = NULL; return -1; } - if (!_ptrThreadRec->Start(unused_thread_id)) + if (!_ptrThreadRec->Start()) { WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " failed to start the rec audio thread"); _recording = false; sio_stop(_recHandle); - delete _ptrThreadRec; - _ptrThreadRec = NULL; + _ptrThreadRec.reset(); delete [] _recordingBuffer; _recordingBuffer = NULL; return -1; @@ -758,8 +753,10 @@ int32_t AudioDeviceSndio::StopRecording() _recording = false; } - if (_ptrThreadRec && !_ptrThreadRec->Stop()) + if (_ptrThreadRec) { + _ptrThreadRec->Stop(); + _ptrThreadRec.reset(); WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, " failed to stop the rec audio thread"); return -1; @@ -767,8 +764,6 @@ int32_t AudioDeviceSndio::StopRecording() sio_stop(_recHandle); - delete _ptrThreadRec; - _ptrThreadRec = NULL; return 0; } @@ -789,7 +784,6 @@ bool AudioDeviceSndio::PlayoutIsInitialized() const int32_t AudioDeviceSndio::StartPlayout() { - unsigned int unused_thread_id; const char* threadName = "webrtc_audio_module_play_thread"; if (_playHandle == NULL) @@ -804,7 +798,6 @@ int32_t AudioDeviceSndio::StartPlayout() _ptrThreadPlay = ThreadWrapper::CreateThread(PlayThreadFunc, this, - kRealtimePriority, threadName); if (_ptrThreadPlay == NULL) { @@ -819,19 +812,18 @@ int32_t AudioDeviceSndio::StartPlayout() if (!sio_start(_playHandle)) { WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " failed to start audio playback"); - delete _ptrThreadPlay; - _ptrThreadPlay = NULL; + _ptrThreadPlay.reset(); delete [] _playoutBuffer; _playoutBuffer = NULL; return -1; } - if (!_ptrThreadPlay->Start(unused_thread_id)) + if (!_ptrThreadPlay->Start()) { WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " failed to start the play audio thread"); sio_stop(_playHandle); - delete _ptrThreadPlay; + _ptrThreadPlay.reset(); _ptrThreadPlay = NULL; delete [] _playoutBuffer; _playoutBuffer = NULL; @@ -853,14 +845,10 @@ int32_t AudioDeviceSndio::StopPlayout() _playing = false; } - if (_ptrThreadPlay && !_ptrThreadPlay->Stop()) + if (_ptrThreadPlay) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - " failed to stop the play audio thread"); - return -1; - } else { - delete _ptrThreadPlay; - _ptrThreadPlay = NULL; + _ptrThreadPlay->Stop(); + _ptrThreadPlay.reset(); } sio_stop(_playHandle); @@ -869,8 +857,6 @@ int32_t AudioDeviceSndio::StopPlayout() delete [] _playoutBuffer; _playoutBuffer = NULL; - delete _ptrThreadPlay; - _ptrThreadPlay = NULL; return 0; } diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h index 6103183e61c..c95aef0c699 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h +++ b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h @@ -27,128 +27,128 @@ public: // Retrieve the currently utilized audio layer virtual int32_t ActiveAudioLayer( - AudioDeviceModule::AudioLayer& audioLayer) const OVERRIDE; + AudioDeviceModule::AudioLayer& audioLayer) const override; // Main initializaton and termination - virtual int32_t Init() OVERRIDE; - virtual int32_t Terminate() OVERRIDE; - virtual bool Initialized() const OVERRIDE; + virtual int32_t Init() override; + virtual int32_t Terminate() override; + virtual bool Initialized() const override; // Device enumeration - virtual int16_t PlayoutDevices() OVERRIDE; - virtual int16_t RecordingDevices() OVERRIDE; + virtual int16_t PlayoutDevices() override; + virtual int16_t RecordingDevices() override; virtual int32_t PlayoutDeviceName( uint16_t index, char name[kAdmMaxDeviceNameSize], - char guid[kAdmMaxGuidSize]) OVERRIDE; + char guid[kAdmMaxGuidSize]) override; virtual int32_t RecordingDeviceName( uint16_t index, char name[kAdmMaxDeviceNameSize], - char guid[kAdmMaxGuidSize]) OVERRIDE; + char guid[kAdmMaxGuidSize]) override; // Device selection - virtual int32_t SetPlayoutDevice(uint16_t index) OVERRIDE; + virtual int32_t SetPlayoutDevice(uint16_t index) override; virtual int32_t SetPlayoutDevice( - AudioDeviceModule::WindowsDeviceType device) OVERRIDE; - virtual int32_t SetRecordingDevice(uint16_t index) OVERRIDE; + AudioDeviceModule::WindowsDeviceType device) override; + virtual int32_t SetRecordingDevice(uint16_t index) override; virtual int32_t SetRecordingDevice( - AudioDeviceModule::WindowsDeviceType device) OVERRIDE; + AudioDeviceModule::WindowsDeviceType device) override; // Audio transport initialization - virtual int32_t PlayoutIsAvailable(bool& available) OVERRIDE; - virtual int32_t InitPlayout() OVERRIDE; - virtual bool PlayoutIsInitialized() const OVERRIDE; - virtual int32_t RecordingIsAvailable(bool& available) OVERRIDE; - virtual int32_t InitRecording() OVERRIDE; - virtual bool RecordingIsInitialized() const OVERRIDE; + virtual int32_t PlayoutIsAvailable(bool& available) override; + virtual int32_t InitPlayout() override; + virtual bool PlayoutIsInitialized() const override; + virtual int32_t RecordingIsAvailable(bool& available) override; + virtual int32_t InitRecording() override; + virtual bool RecordingIsInitialized() const override; // Audio transport control - virtual int32_t StartPlayout() OVERRIDE; - virtual int32_t StopPlayout() OVERRIDE; - virtual bool Playing() const OVERRIDE; - virtual int32_t StartRecording() OVERRIDE; - virtual int32_t StopRecording() OVERRIDE; - virtual bool Recording() const OVERRIDE; + virtual int32_t StartPlayout() override; + virtual int32_t StopPlayout() override; + virtual bool Playing() const override; + virtual int32_t StartRecording() override; + virtual int32_t StopRecording() override; + virtual bool Recording() const override; // Microphone Automatic Gain Control (AGC) - virtual int32_t SetAGC(bool enable) OVERRIDE; - virtual bool AGC() const OVERRIDE; + virtual int32_t SetAGC(bool enable) override; + virtual bool AGC() const override; // Volume control based on the Windows Wave API (Windows only) virtual int32_t SetWaveOutVolume(uint16_t volumeLeft, - uint16_t volumeRight) OVERRIDE; + uint16_t volumeRight) override; virtual int32_t WaveOutVolume(uint16_t& volumeLeft, - uint16_t& volumeRight) const OVERRIDE; + uint16_t& volumeRight) const override; // Audio mixer initialization - virtual int32_t InitSpeaker() OVERRIDE; - virtual bool SpeakerIsInitialized() const OVERRIDE; - virtual int32_t InitMicrophone() OVERRIDE; - virtual bool MicrophoneIsInitialized() const OVERRIDE; + virtual int32_t InitSpeaker() override; + virtual bool SpeakerIsInitialized() const override; + virtual int32_t InitMicrophone() override; + virtual bool MicrophoneIsInitialized() const override; // Speaker volume controls - virtual int32_t SpeakerVolumeIsAvailable(bool& available) OVERRIDE; - virtual int32_t SetSpeakerVolume(uint32_t volume) OVERRIDE; - virtual int32_t SpeakerVolume(uint32_t& volume) const OVERRIDE; - virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const OVERRIDE; - virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const OVERRIDE; - virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const OVERRIDE; + virtual int32_t SpeakerVolumeIsAvailable(bool& available) override; + virtual int32_t SetSpeakerVolume(uint32_t volume) override; + virtual int32_t SpeakerVolume(uint32_t& volume) const override; + virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override; + virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const override; + virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override; // Microphone volume controls - virtual int32_t MicrophoneVolumeIsAvailable(bool& available) OVERRIDE; - virtual int32_t SetMicrophoneVolume(uint32_t volume) OVERRIDE; - virtual int32_t MicrophoneVolume(uint32_t& volume) const OVERRIDE; - virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const OVERRIDE; - virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const OVERRIDE; + virtual int32_t MicrophoneVolumeIsAvailable(bool& available) override; + virtual int32_t SetMicrophoneVolume(uint32_t volume) override; + virtual int32_t MicrophoneVolume(uint32_t& volume) const override; + virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override; + virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const override; virtual int32_t MicrophoneVolumeStepSize( - uint16_t& stepSize) const OVERRIDE; + uint16_t& stepSize) const override; // Speaker mute control - virtual int32_t SpeakerMuteIsAvailable(bool& available) OVERRIDE; - virtual int32_t SetSpeakerMute(bool enable) OVERRIDE; - virtual int32_t SpeakerMute(bool& enabled) const OVERRIDE; + virtual int32_t SpeakerMuteIsAvailable(bool& available) override; + virtual int32_t SetSpeakerMute(bool enable) override; + virtual int32_t SpeakerMute(bool& enabled) const override; // Microphone mute control - virtual int32_t MicrophoneMuteIsAvailable(bool& available) OVERRIDE; - virtual int32_t SetMicrophoneMute(bool enable) OVERRIDE; - virtual int32_t MicrophoneMute(bool& enabled) const OVERRIDE; + virtual int32_t MicrophoneMuteIsAvailable(bool& available) override; + virtual int32_t SetMicrophoneMute(bool enable) override; + virtual int32_t MicrophoneMute(bool& enabled) const override; // Microphone boost control - virtual int32_t MicrophoneBoostIsAvailable(bool& available) OVERRIDE; - virtual int32_t SetMicrophoneBoost(bool enable) OVERRIDE; - virtual int32_t MicrophoneBoost(bool& enabled) const OVERRIDE; + virtual int32_t MicrophoneBoostIsAvailable(bool& available) override; + virtual int32_t SetMicrophoneBoost(bool enable) override; + virtual int32_t MicrophoneBoost(bool& enabled) const override; // Stereo support - virtual int32_t StereoPlayoutIsAvailable(bool& available) OVERRIDE; - virtual int32_t SetStereoPlayout(bool enable) OVERRIDE; - virtual int32_t StereoPlayout(bool& enabled) const OVERRIDE; - virtual int32_t StereoRecordingIsAvailable(bool& available) OVERRIDE; - virtual int32_t SetStereoRecording(bool enable) OVERRIDE; - virtual int32_t StereoRecording(bool& enabled) const OVERRIDE; + virtual int32_t StereoPlayoutIsAvailable(bool& available) override; + virtual int32_t SetStereoPlayout(bool enable) override; + virtual int32_t StereoPlayout(bool& enabled) const override; + virtual int32_t StereoRecordingIsAvailable(bool& available) override; + virtual int32_t SetStereoRecording(bool enable) override; + virtual int32_t StereoRecording(bool& enabled) const override; // Delay information and control virtual int32_t SetPlayoutBuffer( const AudioDeviceModule::BufferType type, - uint16_t sizeMS) OVERRIDE; + uint16_t sizeMS) override; virtual int32_t PlayoutBuffer( AudioDeviceModule::BufferType& type, - uint16_t& sizeMS) const OVERRIDE; - virtual int32_t PlayoutDelay(uint16_t& delayMS) const OVERRIDE; - virtual int32_t RecordingDelay(uint16_t& delayMS) const OVERRIDE; + uint16_t& sizeMS) const override; + virtual int32_t PlayoutDelay(uint16_t& delayMS) const override; + virtual int32_t RecordingDelay(uint16_t& delayMS) const override; - virtual int32_t CPULoad(uint16_t& load) const OVERRIDE; + virtual int32_t CPULoad(uint16_t& load) const override; public: - virtual bool PlayoutWarning() const OVERRIDE; - virtual bool PlayoutError() const OVERRIDE; - virtual bool RecordingWarning() const OVERRIDE; - virtual bool RecordingError() const OVERRIDE; - virtual void ClearPlayoutWarning() OVERRIDE; - virtual void ClearPlayoutError() OVERRIDE; - virtual void ClearRecordingWarning() OVERRIDE; - virtual void ClearRecordingError() OVERRIDE; + virtual bool PlayoutWarning() const override; + virtual bool PlayoutError() const override; + virtual bool RecordingWarning() const override; + virtual bool RecordingError() const override; + virtual void ClearPlayoutWarning() override; + virtual void ClearPlayoutError() override; + virtual void ClearRecordingWarning() override; + virtual void ClearRecordingError() override; - virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) OVERRIDE; + virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override; // needs to be public because playOnmove/recOnmove are extern "C" ? int _recDelay, _playDelay; @@ -169,8 +169,8 @@ private: CriticalSectionWrapper& _critSect; - ThreadWrapper* _ptrThreadRec; - ThreadWrapper* _ptrThreadPlay; + rtc::scoped_ptr _ptrThreadRec; + rtc::scoped_ptr _ptrThreadPlay; int32_t _id; diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h index 1b702647ef3..e675cb874ea 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h +++ b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h @@ -24,7 +24,7 @@ public: AudioDeviceUtilitySndio(const int32_t id); virtual ~AudioDeviceUtilitySndio(); - virtual int32_t Init() OVERRIDE; + virtual int32_t Init() override; private: CriticalSectionWrapper& _critSect; From 19932a17a05cf2208cb6589c19a4c5cd8d5481aa Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Thu, 19 Nov 2015 09:55:21 -0500 Subject: [PATCH 39/46] Bug 1223928 - Disable the Java scrollbars in Fennec with APZ enabled. r=snorp --- mobile/android/base/gfx/LayerRenderer.java | 71 +++++++++++++--------- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/mobile/android/base/gfx/LayerRenderer.java b/mobile/android/base/gfx/LayerRenderer.java index d0bb6233d08..58a5122d464 100644 --- a/mobile/android/base/gfx/LayerRenderer.java +++ b/mobile/android/base/gfx/LayerRenderer.java @@ -5,6 +5,7 @@ package org.mozilla.gecko.gfx; +import org.mozilla.gecko.AppConstants; import org.mozilla.gecko.GeckoAppShell; import org.mozilla.gecko.R; import org.mozilla.gecko.Tab; @@ -156,9 +157,16 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener { mTasks = new CopyOnWriteArrayList(); mLastFrameTime = System.nanoTime(); - mVertScrollLayer = new ScrollbarLayer(this, scrollbarImage, size, true); - mHorizScrollLayer = new ScrollbarLayer(this, diagonalFlip(scrollbarImage), new IntSize(size.height, size.width), false); - mFadeRunnable = new FadeRunnable(); + if (!AppConstants.MOZ_ANDROID_APZ) { + mVertScrollLayer = new ScrollbarLayer(this, scrollbarImage, size, true); + mHorizScrollLayer = new ScrollbarLayer(this, diagonalFlip(scrollbarImage), new IntSize(size.height, size.width), false); + mFadeRunnable = new FadeRunnable(); + } else { + // final variables need to be initialized in the constructor + mVertScrollLayer = null; + mHorizScrollLayer = null; + mFadeRunnable = null; + } mFrameTimings = new int[60]; mCurrentFrame = mFrameTimingsSum = mDroppedFrames = 0; @@ -191,8 +199,10 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener { mCoordByteBuffer = null; mCoordBuffer = null; } - mHorizScrollLayer.destroy(); - mVertScrollLayer.destroy(); + if (!AppConstants.MOZ_ANDROID_APZ) { + mHorizScrollLayer.destroy(); + mVertScrollLayer.destroy(); + } Tabs.unregisterOnTabsChangedListener(this); mZoomedViewListeners.clear(); } @@ -467,23 +477,27 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener { // Run through pre-render tasks runRenderTasks(mTasks, false, mFrameStartTime); - boolean hideScrollbars = (mView.getFullScreenState() == FullScreenState.NON_ROOT_ELEMENT); - if (!mPageContext.fuzzyEquals(mLastPageContext) && !hideScrollbars) { - // The viewport or page changed, so show the scrollbars again - // as per UX decision. Don't do this if we're disabling scrolling due to - // full-screen mode though. - mVertScrollLayer.unfade(); - mHorizScrollLayer.unfade(); - mFadeRunnable.scheduleStartFade(ScrollbarLayer.FADE_DELAY); - } else if (mFadeRunnable.timeToFade()) { - final long currentMillis = SystemClock.elapsedRealtime(); - final boolean stillFading = mVertScrollLayer.fade(mFadeRunnable.mRunAt, currentMillis) | - mHorizScrollLayer.fade(mFadeRunnable.mRunAt, currentMillis); - if (stillFading) { - mFadeRunnable.scheduleNextFadeFrame(); + if (!AppConstants.MOZ_ANDROID_APZ) { + boolean hideScrollbars = (mView.getFullScreenState() == FullScreenState.NON_ROOT_ELEMENT); + if (!mPageContext.fuzzyEquals(mLastPageContext) && !hideScrollbars) { + // The viewport or page changed, so show the scrollbars again + // as per UX decision. Don't do this if we're disabling scrolling due to + // full-screen mode though. + mVertScrollLayer.unfade(); + mHorizScrollLayer.unfade(); + mFadeRunnable.scheduleStartFade(ScrollbarLayer.FADE_DELAY); + } else if (mFadeRunnable.timeToFade()) { + final long currentMillis = SystemClock.elapsedRealtime(); + final boolean stillFading = mVertScrollLayer.fade(mFadeRunnable.mRunAt, currentMillis) | + mHorizScrollLayer.fade(mFadeRunnable.mRunAt, currentMillis); + if (stillFading) { + mFadeRunnable.scheduleNextFadeFrame(); + } } + mLastPageContext = mPageContext; + mUpdated &= mVertScrollLayer.update(mPageContext); // called on compositor thread + mUpdated &= mHorizScrollLayer.update(mPageContext); // called on compositor thread } - mLastPageContext = mPageContext; /* Update layers. */ if (rootLayer != null) { @@ -491,9 +505,6 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener { mUpdated &= rootLayer.update(mPageContext); } - mUpdated &= mVertScrollLayer.update(mPageContext); // called on compositor thread - mUpdated &= mHorizScrollLayer.update(mPageContext); // called on compositor thread - for (Layer layer : mExtraLayers) { mUpdated &= layer.update(mPageContext); // called on compositor thread } @@ -537,13 +548,15 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener { } } - /* Draw the vertical scrollbar. */ - if (mPageRect.height() > mFrameMetrics.getHeight()) - mVertScrollLayer.draw(mPageContext); + if (!AppConstants.MOZ_ANDROID_APZ) { + /* Draw the vertical scrollbar. */ + if (mPageRect.height() > mFrameMetrics.getHeight()) + mVertScrollLayer.draw(mPageContext); - /* Draw the horizontal scrollbar. */ - if (mPageRect.width() > mFrameMetrics.getWidth()) - mHorizScrollLayer.draw(mPageContext); + /* Draw the horizontal scrollbar. */ + if (mPageRect.width() > mFrameMetrics.getWidth()) + mHorizScrollLayer.draw(mPageContext); + } /* Measure how much of the screen is checkerboarding */ Layer rootLayer = mView.getLayerClient().getRoot(); From 08ccd0edfbfd6b943091c504d08af5f6b8505cd0 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Thu, 19 Nov 2015 09:55:21 -0500 Subject: [PATCH 40/46] Bug 1223928 - Enable gecko scrollbars on Fennec. r=snorp --- mobile/android/app/mobile.js | 9 ++- mobile/android/themes/core/content.css | 70 +++++++++---------- mobile/android/themes/core/defines.css | 4 +- mobile/android/themes/core/jar.mn | 5 ++ mobile/android/themes/core/scrollbar-apz.css | 10 +++ .../android/themes/core/scrollbar-nonapz.css | 10 +++ 6 files changed, 67 insertions(+), 41 deletions(-) create mode 100644 mobile/android/themes/core/scrollbar-apz.css create mode 100644 mobile/android/themes/core/scrollbar-nonapz.css diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index d9d05b4bc47..93d9e83193a 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -44,8 +44,13 @@ pref("browser.viewport.desktopWidth", 980); // the value is divided by 1000 and clamped to hard-coded min/max scale values. pref("browser.viewport.defaultZoom", -1); -/* allow scrollbars to float above chrome ui */ -pref("ui.scrollbarsCanOverlapContent", 1); +#ifdef MOZ_ANDROID_APZ +// Show/Hide scrollbars when active/inactive +pref("ui.showHideScrollbars", 1); +pref("ui.useOverlayScrollbars", 1); +pref("ui.scrollbarFadeBeginDelay", 450); +pref("ui.scrollbarFadeDuration", 0); +#endif /* turn off the caret blink after 10 cycles */ pref("ui.caretBlinkCount", 10); diff --git a/mobile/android/themes/core/content.css b/mobile/android/themes/core/content.css index cfeff7c3979..46339e8997d 100644 --- a/mobile/android/themes/core/content.css +++ b/mobile/android/themes/core/content.css @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @import "defines.css"; +@import "scrollbar.css"; @namespace url("http://www.w3.org/1999/xhtml"); @namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @@ -13,75 +14,72 @@ } /* Style the scrollbars */ -html xul|scrollbar { - display: none; -} - -xul|window xul|scrollbar { - display: block; -} - -xul|window xul|scrollbar[orient="vertical"] { - -moz-appearance: none !important; - opacity: 0; +xul|scrollbar[root="true"] { position: relative; - margin-left: -8px; - min-width: 8px; + z-index: 2147483647; +} + +xul|scrollbar { + -moz-appearance: none !important; background-color: transparent !important; background-image: none !important; border: 0px solid transparent !important; + pointer-events: none; } -xul|window xul|scrollbar[orient="vertical"] xul|thumb { +/* Scrollbar code will reset the margin to the correct side depending on + where layout actually puts the scrollbar */ +xul|scrollbar[orient="vertical"] { + margin-left: -8px; + min-width: 8px; + max-width: 8px; +} + +xul|scrollbar[orient="vertical"] xul|thumb { max-width: 6px !important; min-width: 6px !important; } -xul|window xul|scrollbar[orient="horizontal"] { - -moz-appearance: none !important; - opacity: 0; - position: relative; - min-height: 8px; +xul|scrollbar[orient="horizontal"] { margin-top: -8px; - background-color: transparent !important; - background-image: none !important; - border: 0px solid transparent !important; + min-height: 8px; + max-height: 8px; } -xul|window xul|scrollbar[orient="horizontal"] xul|thumb { +xul|scrollbar[orient="horizontal"] xul|thumb { max-height: 6px !important; min-height: 6px !important; } -xul|*[panning="true"] xul|scrollbar { - opacity: 1; +xul|scrollbar:not([active="true"]), +xul|scrollbar[disabled] { + opacity: 0; } -xul|window xul|scrollbox { - overflow-y: scroll; - overflow-x: scroll; -} - -xul|window xul|scrollbarbutton { +xul|scrollbarbutton { min-height: 8px !important; min-width: 8px !important; -moz-appearance: none !important; visibility: hidden; } -xul|window xul|scrollbarbutton[sbattr="scrollbar-up-top"], -xul|window xul|scrollbarbutton[sbattr="scrollbar-bottom-top"] { +xul|scrollbarbutton[sbattr="scrollbar-up-top"], +xul|scrollbarbutton[sbattr="scrollbar-bottom-top"] { display: none; } -xul|window xul|scrollbar xul|thumb { - background-color: var(--color_background_scroller) !important; +xul|thumb { + background-color: rgba(0, 0, 0, 0.4) !important; -moz-border-top-colors: none !important; -moz-border-bottom-colors: none !important; -moz-border-right-colors: none !important; -moz-border-left-colors: none !important; border: 1px solid rgba(255, 255, 255, 0.4) !important; - border-radius: var(--form_border_radius); + border-radius: 3px; +} + +xul|scrollbarbutton { + background-image: none !important; } select:not([size]):not([multiple]) > xul|scrollbar, diff --git a/mobile/android/themes/core/defines.css b/mobile/android/themes/core/defines.css index 3f4212c5cdb..094e696d616 100644 --- a/mobile/android/themes/core/defines.css +++ b/mobile/android/themes/core/defines.css @@ -10,11 +10,9 @@ --color_about_item: #ffffff; --color_about_item_border: #d7d9db; - --color_background_scroller: #9a9a9a; - --color_background_highlight: #febc2b; --color_background_highlight_overlay: rgba(171, 171, 171, 0.5); --color_text_highlight: #000; --margin_snormal: 0.64mm; -} \ No newline at end of file +} diff --git a/mobile/android/themes/core/jar.mn b/mobile/android/themes/core/jar.mn index 6c31f3ceddd..ca7c3f67929 100644 --- a/mobile/android/themes/core/jar.mn +++ b/mobile/android/themes/core/jar.mn @@ -29,6 +29,11 @@ chrome.jar: skin/aboutSupport.css (aboutSupport.css) skin/browser.css (browser.css) skin/content.css (content.css) +#ifdef MOZ_ANDROID_APZ + skin/scrollbar.css (scrollbar-apz.css) +#else + skin/scrollbar.css (scrollbar-nonapz.css) +#endif skin/config.css (config.css) skin/defines.css (defines.css) skin/touchcontrols.css (touchcontrols.css) diff --git a/mobile/android/themes/core/scrollbar-apz.css b/mobile/android/themes/core/scrollbar-apz.css new file mode 100644 index 00000000000..652881af5ff --- /dev/null +++ b/mobile/android/themes/core/scrollbar-apz.css @@ -0,0 +1,10 @@ +/* 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/. */ + +@namespace url("http://www.w3.org/1999/xhtml"); +@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +html xul|scrollbar { + display: block; +} diff --git a/mobile/android/themes/core/scrollbar-nonapz.css b/mobile/android/themes/core/scrollbar-nonapz.css new file mode 100644 index 00000000000..2b3f3803708 --- /dev/null +++ b/mobile/android/themes/core/scrollbar-nonapz.css @@ -0,0 +1,10 @@ +/* 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/. */ + +@namespace url("http://www.w3.org/1999/xhtml"); +@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +html xul|scrollbar { + display: none; +} From 34499af98ea62c7658be2ff9c537e8515cac7eb6 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Thu, 19 Nov 2015 09:55:21 -0500 Subject: [PATCH 41/46] Bug 1223928 - Make the horizontal scrollbar on the root scrollable shift correctly with the dynamic toolbar. r=botond --- .../composite/AsyncCompositionManager.cpp | 40 +++++++++++++++++++ .../composite/AsyncCompositionManager.h | 8 ++++ 2 files changed, 48 insertions(+) diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 698cd59e5ad..821d8f4c03e 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -40,6 +40,7 @@ #endif #include "GeckoProfiler.h" #include "FrameUniformityData.h" +#include "TreeTraversal.h" struct nsCSSValueSharedList; @@ -734,6 +735,40 @@ ExpandRootClipRect(Layer* aLayer, const ScreenMargin& aFixedLayerMargins) } } +#ifdef MOZ_ANDROID_APZ +static void +MoveScrollbarForLayerMargin(Layer* aRoot, FrameMetrics::ViewID aRootScrollId, + const ScreenMargin& aFixedLayerMargins) +{ + // See bug 1223928 comment 9 - once we can detect the RCD with just the + // isRootContent flag on the metrics, we can probably move this code into + // ApplyAsyncTransformToScrollbar rather than having it as a separate + // adjustment on the layer tree. + Layer* scrollbar = BreadthFirstSearch(aRoot, + [aRootScrollId](Layer* aNode) { + return (aNode->GetScrollbarDirection() == Layer::HORIZONTAL && + aNode->GetScrollbarTargetContainerId() == aRootScrollId); + }); + if (scrollbar) { + // Shift the horizontal scrollbar down into the new space exposed by the + // dynamic toolbar hiding. Technically we should also scale the vertical + // scrollbar a bit to expand into the new space but it's not as noticeable + // and it would add a lot more complexity, so we're going with the "it's not + // worth it" justification. + TranslateShadowLayer(scrollbar, gfxPoint(0, -aFixedLayerMargins.bottom), true); + if (scrollbar->GetParent()) { + // The layer that has the HORIZONTAL direction sits inside another + // ContainerLayer. This ContainerLayer also has a clip rect that causes + // the scrollbar to get clipped. We need to expand that clip rect to + // prevent that from happening. This is kind of ugly in that we're + // assuming a particular layer tree structure but short of adding more + // flags to the layer there doesn't appear to be a good way to do this. + ExpandRootClipRect(scrollbar->GetParent(), aFixedLayerMargins); + } + } +} +#endif + bool AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer, bool* aOutFoundRoot) @@ -805,6 +840,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer, (aLayer->GetParent() == nullptr && /* rootmost metrics */ i + 1 >= aLayer->GetFrameMetricsCount()); if (*aOutFoundRoot) { + mRootScrollableId = metrics.GetScrollId(); CSSToLayerScale geckoZoom = metrics.LayersPixelsPerCSSPixel().ToScaleFactor(); if (mIsFirstPaint) { LayerIntPoint scrollOffsetLayerPixels = RoundedToInt(metrics.GetScrollOffset() * geckoZoom); @@ -822,6 +858,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer, geckoZoom * asyncTransformWithoutOverscroll.mScale, metrics.GetScrollableRect(), displayPort, geckoZoom, mLayersUpdated, mPaintSyncId, fixedLayerMargins); + mFixedLayerMargins = fixedLayerMargins; mLayersUpdated = false; } mIsFirstPaint = false; @@ -1312,6 +1349,9 @@ AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame, if (ApplyAsyncContentTransformToTree(root, &foundRoot)) { #if defined(MOZ_ANDROID_APZ) MOZ_ASSERT(foundRoot); + if (foundRoot && mFixedLayerMargins != ScreenMargin()) { + MoveScrollbarForLayerMargin(root, mRootScrollableId, mFixedLayerMargins); + } #endif } else { nsAutoTArray scrollableLayers; diff --git a/gfx/layers/composite/AsyncCompositionManager.h b/gfx/layers/composite/AsyncCompositionManager.h index 0c28aa2a01c..3925966b235 100644 --- a/gfx/layers/composite/AsyncCompositionManager.h +++ b/gfx/layers/composite/AsyncCompositionManager.h @@ -227,6 +227,14 @@ private: gfx::Matrix mWorldTransform; LayerTransformRecorder mLayerTransformRecorder; + +#ifdef MOZ_ANDROID_APZ + // The following two fields are only needed on Fennec with C++ APZ, because + // then we need to reposition the gecko scrollbar to deal with the + // dynamic toolbar shifting content around. + FrameMetrics::ViewID mRootScrollableId; + ScreenMargin mFixedLayerMargins; +#endif }; MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AsyncCompositionManager::TransformsToSkip) From 3dd08bee0049808f3840281860bc396e5dad25be Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Thu, 19 Nov 2015 09:55:21 -0500 Subject: [PATCH 42/46] Bug 1223928 - Update various reftests that now pass/fail with gecko scrollbars on Android&&asyncPan. r=snorp --- .../elements/global-attributes/reftest.list | 4 ++-- layout/base/crashtests/crashtests.list | 4 ++-- layout/generic/crashtests/crashtests.list | 4 ++-- layout/reftests/bugs/reftest.list | 22 +++++++++---------- layout/reftests/font-face/reftest.list | 2 +- .../reftests/forms/placeholder/reftest.list | 2 +- layout/reftests/native-theme/reftest.list | 2 +- layout/reftests/z-index/reftest.list | 2 +- layout/xul/crashtests/crashtests.list | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dom/imptests/html/html/dom/elements/global-attributes/reftest.list b/dom/imptests/html/html/dom/elements/global-attributes/reftest.list index 1f5cc9f18b5..a5b69d63e4a 100644 --- a/dom/imptests/html/html/dom/elements/global-attributes/reftest.list +++ b/dom/imptests/html/html/dom/elements/global-attributes/reftest.list @@ -46,10 +46,10 @@ == dir_auto-pre-N-EN.html dir_auto-pre-N-EN-ref.html == dir_auto-R.html dir_auto-R-ref.html == dir_auto-textarea-mixed.html dir_auto-textarea-mixed-ref.html -fails-if(B2G||Mulet) == dir_auto-textarea-N-between-Rs.html dir_auto-textarea-N-between-Rs-ref.html # B2G scrollbar on opposite side +fails-if(B2G||Mulet||(Android&&asyncPan)) == dir_auto-textarea-N-between-Rs.html dir_auto-textarea-N-between-Rs-ref.html # B2G scrollbar on opposite side == dir_auto-textarea-N-EN.html dir_auto-textarea-N-EN-ref.html == dir_auto-textarea-script-mixed.html dir_auto-textarea-script-mixed-ref.html -fails-if(B2G||Mulet) == dir_auto-textarea-script-N-between-Rs.html dir_auto-textarea-script-N-between-Rs-ref.html # B2G scrollbar on reference only +fails-if(B2G||Mulet||(Android&&asyncPan)) == dir_auto-textarea-script-N-between-Rs.html dir_auto-textarea-script-N-between-Rs-ref.html # B2G scrollbar on reference only == dir_auto-textarea-script-N-EN.html dir_auto-textarea-script-N-EN-ref.html == lang-xyzzy.html lang-xyzzy-ref.html == lang-xmllang-01.html lang-xmllang-01-ref.html diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list index 02f834d3a1d..5bcc926be64 100644 --- a/layout/base/crashtests/crashtests.list +++ b/layout/base/crashtests/crashtests.list @@ -294,7 +294,7 @@ load 469861-1.xhtml load 469861-2.xhtml load 470851-1.xhtml load 471594-1.xhtml -asserts-if(Android,2) load 473042.xhtml # bug 1034369 (may also cause a few assertions to be registered on the next test) +asserts-if(Android&&!asyncPan,2) load 473042.xhtml # bug 1034369 (may also cause a few assertions to be registered on the next test) asserts(0-5) load 474075.html # bug 847368 load 477333-1.xhtml load 477731-1.html @@ -456,7 +456,7 @@ load 866588.html load 876092.html load 876221.html load 897852.html -asserts-if(Android,2) asserts-if(!Android,4-6) load 898913.html # bug 847368 +asserts(4-6) asserts-if(Android&&!asyncPan,2) load 898913.html # bug 847368 pref(layers.acceleration.disabled,true) pref(layers.force-active,true) load 919434.html load 926728.html load 930381.html diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index b30506955f2..0d69bf5d9ba 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -25,7 +25,7 @@ load 321224.xul load 322780-1.xul load 323381-1.html load 323381-2.html -asserts-if(gtkWidget,1) load 323386-1.html # Bug 718883 +asserts-if(gtkWidget,1) asserts-if(Android&&asyncPan,1) load 323386-1.html # Bug 718883 load 323389-1.html load 323389-2.html load 323493-1.html @@ -529,7 +529,7 @@ load 842166.html load 844529-1.html load 847130.xhtml load 847208.html -asserts-if(Android,2) asserts-if(!Android,4) load 847209.html # bug 847368 +asserts-if(Android,2) asserts-if(Android&&asyncPan,4) asserts-if(!Android,4) load 847209.html # bug 847368 load 847211-1.html load 849603.html asserts(0-12) load 850931.html # bug 569193 diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 5094b5ca04f..120aca0cf35 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -173,18 +173,18 @@ skip-if(B2G||Mulet) == 192767-26.xul 192767-36.xul # Initial mulet triage: parit skip-if(B2G||Mulet) == 192767-27.xul 192767-37.xul # Initial mulet triage: parity with B2G/B2G Desktop skip-if((B2G&&browserIsRemote)||Mulet) != 192767-01.xul 192767-21.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop skip-if((B2G&&browserIsRemote)||Mulet) != 192767-02.xul 192767-22.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop -fails-if(Android) skip-if(B2G||Mulet) != 192767-03.xul 192767-23.xul # Initial mulet triage: parity with B2G/B2G Desktop +fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-03.xul 192767-23.xul # Initial mulet triage: parity with B2G/B2G Desktop skip-if((B2G&&browserIsRemote)||Mulet) != 192767-04.xul 192767-24.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop skip-if((B2G&&browserIsRemote)||Mulet) != 192767-05.xul 192767-25.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop -fails-if(Android) skip-if(B2G||Mulet) != 192767-06.xul 192767-26.xul # Initial mulet triage: parity with B2G/B2G Desktop -fails-if(Android) skip-if(B2G||Mulet) != 192767-07.xul 192767-27.xul # Initial mulet triage: parity with B2G/B2G Desktop +fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-06.xul 192767-26.xul # Initial mulet triage: parity with B2G/B2G Desktop +fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-07.xul 192767-27.xul # Initial mulet triage: parity with B2G/B2G Desktop skip-if((B2G&&browserIsRemote)||Mulet) != 192767-11.xul 192767-31.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop skip-if((B2G&&browserIsRemote)||Mulet) != 192767-12.xul 192767-32.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop -fails-if(Android) skip-if(B2G||Mulet) != 192767-13.xul 192767-33.xul # Initial mulet triage: parity with B2G/B2G Desktop +fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-13.xul 192767-33.xul # Initial mulet triage: parity with B2G/B2G Desktop skip-if((B2G&&browserIsRemote)||Mulet) != 192767-14.xul 192767-34.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop skip-if((B2G&&browserIsRemote)||Mulet) != 192767-15.xul 192767-35.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop -fails-if(Android) skip-if(B2G||Mulet) != 192767-16.xul 192767-36.xul # Initial mulet triage: parity with B2G/B2G Desktop -fails-if(Android) skip-if(B2G||Mulet) != 192767-17.xul 192767-37.xul # Initial mulet triage: parity with B2G/B2G Desktop +fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-16.xul 192767-36.xul # Initial mulet triage: parity with B2G/B2G Desktop +fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-17.xul 192767-37.xul # Initial mulet triage: parity with B2G/B2G Desktop != 200774-1.html about:blank == 201215-1.html 201215-1-ref.html == 201293-1a.html 201293-1-ref.html @@ -247,7 +247,7 @@ skip-if(B2G||Mulet) == 240933-1.html 240933-1-ref.html # Initial mulet triage: p skip-if(Android||B2G||Mulet) == 240933-2.html 240933-2-ref.html # Initial mulet triage: parity with B2G/B2G Desktop == 243266-1.html 243266-1-ref.html == 243302-1.html 243302-1-ref.html -skip-if(B2G||Mulet) == 243519-1.html 243519-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop +skip-if(B2G||Mulet||(Android&&asyncPan)) == 243519-1.html 243519-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop == 243519-2.html 243519-2-ref.html == 243519-3.html 243519-3-ref.html == 243519-4a.html 243519-4-ref.html @@ -578,7 +578,7 @@ skip-if((B2G&&browserIsRemote)||Mulet) == 366616-1.xul 366616-1-ref.xul # bug 97 == 367247-s-hidden.html 367247-s-auto.html skip-if(B2G||Mulet) fails-if(Android) != 367247-s-auto.html 367247-s-scroll.html # Initial mulet triage: parity with B2G/B2G Desktop != 367247-l-visible.html 367247-l-hidden.html -skip-if(B2G||Mulet) fails-if(Android) != 367247-l-hidden.html 367247-l-scroll.html # Initial mulet triage: parity with B2G/B2G Desktop +skip-if(B2G||Mulet) fails-if(Android&&!asyncPan) != 367247-l-hidden.html 367247-l-scroll.html # Initial mulet triage: parity with B2G/B2G Desktop skip-if(B2G||Mulet) == 367247-l-scroll.html 367247-l-auto.html # Initial mulet triage: parity with B2G/B2G Desktop == 367332-1a.html 367332-1-ref.html == 367332-1b.html 367332-1-ref.html @@ -644,7 +644,7 @@ skip-if(B2G||Mulet) == 370629-2.html 370629-2-ref.html # Initial mulet triage: p == 371043-1.html 371043-1-ref.html == 371354-1.html 371354-1-ref.html == 371483-1.html about:blank # assertion test -fails-if(Android) == 371561-1.html 371561-1-ref.html +fails-if(Android&&!asyncPan) == 371561-1.html 371561-1-ref.html skip-if((B2G&&browserIsRemote)||Mulet) != 371681-1.xhtml about:blank # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop == 371925-1a.html 371925-1-ref.html == 371925-1b.html 371925-1-ref.html @@ -704,7 +704,7 @@ skip-if(B2G||Mulet) fuzzy-if(Android,2,140) == 379349-3b.xhtml 379349-3-ref.xhtm == 379461-1.xhtml 379461-1.html == 379461-2.xhtml 379461-2.html skip-if(B2G||Mulet) == 379461-3-container-xhtml.html 379461-3-container-html.html # Initial mulet triage: parity with B2G/B2G Desktop -skip-if(B2G||Mulet) fails-if(Android) != 379461-3-container-xhtml.html 379461-3-container-blank.html # there is a scrollbar # Initial mulet triage: parity with B2G/B2G Desktop +skip-if(B2G||Mulet) fails-if(Android&&!asyncPan) != 379461-3-container-xhtml.html 379461-3-container-blank.html # there is a scrollbar # Initial mulet triage: parity with B2G/B2G Desktop == 380004-1.html 380004-1-ref.html == 380227-1.html 380227-1-ref.html == 380825-1.html 380825-1-ref.html @@ -1425,7 +1425,7 @@ skip-if(B2G||Mulet) fuzzy-if(Android,5,1656) == 512410.html 512410-ref.html # In == 513153-2a.html 513153-2-ref.html == 513153-2b.html 513153-2-ref.html skip-if((B2G&&browserIsRemote)||Mulet) == 513318-1.xul 513318-1-ref.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop -skip-if(B2G||Mulet) fails-if(Android) != 513318-2.xul 513318-2-ref.xul # Initial mulet triage: parity with B2G/B2G Desktop +skip-if(B2G||Mulet) fails-if(Android&&(!asyncPan||AndroidVersion>=15)) != 513318-2.xul 513318-2-ref.xul # Initial mulet triage: parity with B2G/B2G Desktop == 514917-1.html 514917-1-ref.html HTTP(..) == 518172-1a.html 518172-a-ref.html HTTP(..) == 518172-1b.html 518172-b-ref.html diff --git a/layout/reftests/font-face/reftest.list b/layout/reftests/font-face/reftest.list index 7728db9ed93..ba130074616 100644 --- a/layout/reftests/font-face/reftest.list +++ b/layout/reftests/font-face/reftest.list @@ -7,7 +7,7 @@ HTTP(..) == download-2.html download-2-ref.html HTTP(..) != download-2.html about:blank random-if(winWidget) HTTP(..) == download-2-big.html download-2-big-otf.html # bug 470713 HTTP(..) != download-2-big-otf.html about:blank -asserts-if(Android,4-8) skip-if(Android&&AndroidVersion==17) HTTP(..) != download-3-notref.html download-3.html # bug 1019192, bug 936226 +asserts-if(Android&&!asyncPan,4-8) skip-if(Android&&AndroidVersion==17) HTTP(..) != download-3-notref.html download-3.html # bug 1019192, bug 936226 asserts-if(Android,0-8) HTTP(..) == download-3-ref.html download-3.html # same bugs as above asserts-if(Android,0-8) HTTP(..) == fallback-to-system-1.html fallback-to-system-1-ref.html # just delayed assertions from above tests HTTP(..) == name-override-simple-1.html name-override-simple-1-ref.html diff --git a/layout/reftests/forms/placeholder/reftest.list b/layout/reftests/forms/placeholder/reftest.list index ce3392438f9..a4ffeb05f3f 100644 --- a/layout/reftests/forms/placeholder/reftest.list +++ b/layout/reftests/forms/placeholder/reftest.list @@ -17,7 +17,7 @@ == placeholder-4.html placeholder-overridden-ref.html == placeholder-5.html placeholder-visible-ref.html fuzzy-if(winWidget,160,10) fuzzy-if(Android,1,1) fuzzy-if(asyncPan&&!layersGPUAccelerated,146,299) == placeholder-6.html placeholder-overflow-ref.html -skip-if(B2G||Mulet) == placeholder-6-textarea.html placeholder-overflow-textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop +skip-if(B2G||Mulet||(Android&&asyncPan)) == placeholder-6-textarea.html placeholder-overflow-textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop # needs-focus == placeholder-7.html placeholder-focus-ref.html # needs-focus == placeholder-8.html placeholder-focus-ref.html # needs-focus == placeholder-9.html placeholder-focus-ref.html diff --git a/layout/reftests/native-theme/reftest.list b/layout/reftests/native-theme/reftest.list index fdaeec3869d..5d3962e7202 100644 --- a/layout/reftests/native-theme/reftest.list +++ b/layout/reftests/native-theme/reftest.list @@ -39,7 +39,7 @@ skip-if(!winWidget) != 403458-winmenu-ltr.xul 403458-winmenu-rtl.xul == 492155-1.html about:blank == 492155-2.html about:blank == 492155-3.html about:blank -fails-if(Android) != 492155-4.html about:blank +fails-if(Android&&!asyncPan) != 492155-4.html about:blank != box-shadow-input.html box-shadow-input-ref.html != box-shadow-button.html box-shadow-button-ref.html diff --git a/layout/reftests/z-index/reftest.list b/layout/reftests/z-index/reftest.list index 5c6977919dd..134b83fb494 100644 --- a/layout/reftests/z-index/reftest.list +++ b/layout/reftests/z-index/reftest.list @@ -4,7 +4,7 @@ == stacking-context-perspective.html stacking-context-yes.html == stacking-context-backface-visibility.html stacking-context-no.html -fails-if(Android) != overlayscrollbar-sorting-ref-visible.html overlayscrollbar-sorting-ref-hidden.html +fails-if(Android&&!asyncPan) != overlayscrollbar-sorting-ref-visible.html overlayscrollbar-sorting-ref-hidden.html random-if(transparentScrollbars) == overlayscrollbar-sorting-1.html overlayscrollbar-sorting-ref-visible.html == overlayscrollbar-sorting-2.html overlayscrollbar-sorting-ref-visible.html == overlayscrollbar-sorting-3.html overlayscrollbar-sorting-ref-hidden.html diff --git a/layout/xul/crashtests/crashtests.list b/layout/xul/crashtests/crashtests.list index 629ff372eff..078a5af2fec 100644 --- a/layout/xul/crashtests/crashtests.list +++ b/layout/xul/crashtests/crashtests.list @@ -32,7 +32,7 @@ load 360642-1.xul load 365151.xul load 366112-1.xul asserts(0-50) load 366203-1.xul # bug 1217984 -asserts(24) asserts-if(Android,9) load 367185-1.xhtml # bug 1220345 +asserts(24) asserts-if(Android&&!asyncPan,9) load 367185-1.xhtml # bug 1220345 load 369942-1.xhtml load 374102-1.xul load 376137-1.html @@ -77,7 +77,7 @@ load 434458-1.xul load 452185.html load 460900-1.xul load 464149-1.xul -asserts-if(winWidget,1) load 464407-1.xhtml # Bug 450974 +asserts-if(winWidget,1) asserts-if(Android&&asyncPan,1) load 464407-1.xhtml # Bug 450974 on win, Bug 1217984 on android load 467080.xul load 467481-1.xul load 470063-1.html From f5211274b67c8c6a9fea0006742cf4bd310352fb Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Thu, 19 Nov 2015 09:57:51 -0500 Subject: [PATCH 43/46] Bug 1203058 - Set the paint sync id on the top-level window rather than the tab's window, because then it won't get lost during page unload. r=rbarker --- dom/base/nsDOMWindowUtils.cpp | 2 ++ mobile/android/chrome/content/browser.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 2cb8a4d4a71..99ab5bc5cf5 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -3786,9 +3786,11 @@ nsDOMWindowUtils::SetNextPaintSyncId(int32_t aSyncId) if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) { ClientLayerManager* clm = static_cast(lm.get()); clm->SetNextPaintSyncId(aSyncId); + return NS_OK; } } + NS_WARNING("Paint sync id could not be set on the ClientLayerManager"); return NS_OK; } diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 947b97dae1c..b4bc89d92b1 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -6204,9 +6204,9 @@ var ViewportHandler = { if (aData) { let scrollChange = JSON.parse(aData); - let win = BrowserApp.selectedTab.browser.contentWindow; - let windowUtils = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); + let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); windowUtils.setNextPaintSyncId(scrollChange.id); + let win = BrowserApp.selectedTab.browser.contentWindow; win.scrollBy(scrollChange.x, scrollChange.y); } }, From 99aa8fd7aed7b5fe1a83713e2749271e700f9758 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Thu, 19 Nov 2015 16:11:27 +0100 Subject: [PATCH 44/46] Bug 1219883 - Fix Ion typed array stub to handle constant string index. r=efaust --- js/src/jit/IonCaches.cpp | 75 +++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/js/src/jit/IonCaches.cpp b/js/src/jit/IonCaches.cpp index ab615c11632..7a5c663134b 100644 --- a/js/src/jit/IonCaches.cpp +++ b/js/src/jit/IonCaches.cpp @@ -3929,7 +3929,7 @@ static void GenerateGetTypedOrUnboxedArrayElement(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& attacher, HandleObject array, const Value& idval, Register object, - TypedOrValueRegister index, TypedOrValueRegister output, + ConstantOrRegister index, TypedOrValueRegister output, bool allowDoubleResult) { MOZ_ASSERT(GetPropertyIC::canAttachTypedOrUnboxedArrayElement(array, idval, output)); @@ -3945,49 +3945,54 @@ GenerateGetTypedOrUnboxedArrayElement(JSContext* cx, MacroAssembler& masm, if (idval.isString()) { MOZ_ASSERT(GetIndexFromString(idval.toString()) != UINT32_MAX); - // Part 1: Get the string into a register - Register str; - if (index.hasValue()) { - ValueOperand val = index.valueReg(); - masm.branchTestString(Assembler::NotEqual, val, &failures); - - str = masm.extractString(val, indexReg); + if (index.constant()) { + MOZ_ASSERT(idval == index.value()); + masm.move32(Imm32(GetIndexFromString(idval.toString())), indexReg); } else { - MOZ_ASSERT(!index.typedReg().isFloat()); - str = index.typedReg().gpr(); + // Part 1: Get the string into a register + Register str; + if (index.reg().hasValue()) { + ValueOperand val = index.reg().valueReg(); + masm.branchTestString(Assembler::NotEqual, val, &failures); + + str = masm.extractString(val, indexReg); + } else { + MOZ_ASSERT(!index.reg().typedReg().isFloat()); + str = index.reg().typedReg().gpr(); + } + + // Part 2: Call to translate the str into index + AllocatableRegisterSet regs(RegisterSet::Volatile()); + LiveRegisterSet save(regs.asLiveSet()); + masm.PushRegsInMask(save); + regs.takeUnchecked(str); + + Register temp = regs.takeAnyGeneral(); + + masm.setupUnalignedABICall(temp); + masm.passABIArg(str); + masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, GetIndexFromString)); + masm.mov(ReturnReg, indexReg); + + LiveRegisterSet ignore; + ignore.add(indexReg); + masm.PopRegsInMaskIgnore(save, ignore); + + masm.branch32(Assembler::Equal, indexReg, Imm32(UINT32_MAX), &failures); } - - // Part 2: Call to translate the str into index - AllocatableRegisterSet regs(RegisterSet::Volatile()); - LiveRegisterSet save(regs.asLiveSet()); - masm.PushRegsInMask(save); - regs.takeUnchecked(str); - - Register temp = regs.takeAnyGeneral(); - - masm.setupUnalignedABICall(temp); - masm.passABIArg(str); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, GetIndexFromString)); - masm.mov(ReturnReg, indexReg); - - LiveRegisterSet ignore; - ignore.add(indexReg); - masm.PopRegsInMaskIgnore(save, ignore); - - masm.branch32(Assembler::Equal, indexReg, Imm32(UINT32_MAX), &failures); - } else { MOZ_ASSERT(idval.isInt32()); + MOZ_ASSERT(!index.constant()); - if (index.hasValue()) { - ValueOperand val = index.valueReg(); + if (index.reg().hasValue()) { + ValueOperand val = index.reg().valueReg(); masm.branchTestInt32(Assembler::NotEqual, val, &failures); // Unbox the index. masm.unboxInt32(val, indexReg); } else { - MOZ_ASSERT(!index.typedReg().isFloat()); - indexReg = index.typedReg().gpr(); + MOZ_ASSERT(!index.reg().typedReg().isFloat()); + indexReg = index.reg().typedReg().gpr(); } } @@ -4061,7 +4066,7 @@ GetPropertyIC::tryAttachTypedOrUnboxedArrayElement(JSContext* cx, HandleScript o MacroAssembler masm(cx, ion, outerScript, profilerLeavePc_); StubAttacher attacher(*this); - GenerateGetTypedOrUnboxedArrayElement(cx, masm, attacher, obj, idval, object(), id().reg(), + GenerateGetTypedOrUnboxedArrayElement(cx, masm, attacher, obj, idval, object(), id(), output(), allowDoubleResult_); return linkAndAttachStub(cx, masm, attacher, ion, "typed array", JS::TrackedOutcome::ICGetElemStub_TypedArray); From 1947bc1e60e6785b9bd4e8be91652afec1566184 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Thu, 19 Nov 2015 08:04:19 -0800 Subject: [PATCH 45/46] Bumping manifests a=b2g-bump --- b2g/config/emulator-kk/sources.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 6594509d211..24d22405fc2 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -129,7 +129,7 @@ - + From c40bf8f6460f410bc6947b38b837e225292d36d1 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Thu, 19 Nov 2015 10:09:08 -0800 Subject: [PATCH 46/46] Touch CLOBBER to clear up bug 1168113's bustage a=merge --- CLOBBER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLOBBER b/CLOBBER index 52839108ffb..a18df802948 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Bug 1198458 Fix failures in TaskCluster builds due to analog_agc.cc moving +bug 1168113's backout needs a CLOBBER to clear up some TC bustage