From 786416aaf1f45916af8869e26e485da883e809e4 Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Fri, 21 Apr 2017 14:21:36 -0400 Subject: [PATCH 01/36] Bug 1359952 - Fix CacheIRCompiler handling of boolean results r=jandem MozReview-Commit-ID: 5xeZQyprlpm --HG-- extra : rebase_source : f3df3bae4ab544d2de5610134ad9399d161288ad --- js/src/jit/CacheIRCompiler.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/js/src/jit/CacheIRCompiler.cpp b/js/src/jit/CacheIRCompiler.cpp index 205b46344a514..482b03b2e8efb 100644 --- a/js/src/jit/CacheIRCompiler.cpp +++ b/js/src/jit/CacheIRCompiler.cpp @@ -1635,18 +1635,24 @@ CacheIRCompiler::emitLoadUndefinedResult() return true; } -bool -CacheIRCompiler::emitLoadBooleanResult() +static void +EmitStoreBoolean(MacroAssembler& masm, bool b, const AutoOutputRegister& output) { - AutoOutputRegister output(*this); if (output.hasValue()) { - Value val = BooleanValue(reader.readBool()); + Value val = BooleanValue(b); masm.moveValue(val, output.valueReg()); } else { MOZ_ASSERT(output.type() == JSVAL_TYPE_BOOLEAN); - bool b = reader.readBool(); masm.movePtr(ImmWord(b), output.typedReg().gpr()); } +} + +bool +CacheIRCompiler::emitLoadBooleanResult() +{ + AutoOutputRegister output(*this); + bool b = reader.readBool(); + EmitStoreBoolean(masm, b, output); return true; } @@ -1950,12 +1956,7 @@ CacheIRCompiler::emitLoadDenseElementExistsResult() BaseObjectElementIndex element(scratch, index); masm.branchTestMagic(Assembler::Equal, element, failure->label()); - if (output.hasValue()) { - masm.moveValue(BooleanValue(true), output.valueReg()); - } else { - MOZ_ASSERT(output.type() == JSVAL_TYPE_BOOLEAN); - masm.movePtr(ImmWord(true), output.typedReg().gpr()); - } + EmitStoreBoolean(masm, true, output); return true; } @@ -1984,14 +1985,14 @@ CacheIRCompiler::emitLoadDenseElementHoleExistsResult() // Load value and replace with true. Label done; - masm.loadValue(BaseObjectElementIndex(scratch, index), output.valueReg()); - masm.branchTestMagic(Assembler::Equal, output.valueReg(), &hole); - masm.moveValue(BooleanValue(true), output.valueReg()); + BaseObjectElementIndex element(scratch, index); + masm.branchTestMagic(Assembler::Equal, element, &hole); + EmitStoreBoolean(masm, true, output); masm.jump(&done); // Load false for the hole. masm.bind(&hole); - masm.moveValue(BooleanValue(false), output.valueReg()); + EmitStoreBoolean(masm, false, output); masm.bind(&done); return true; From 46f8075f1ab7ff4f39d6f0e33958efaa3381eb7f Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Wed, 26 Apr 2017 16:06:42 -0400 Subject: [PATCH 02/36] Bug 1359952 - Remove shape arg from TestMatchingReceiver r=jandem MozReview-Commit-ID: L2EiAUvK5rW --HG-- extra : rebase_source : 487d447a05a14952a9a4b6d5260b9309d7e601a2 --- js/src/jit/CacheIR.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp index 50fd795d43a11..50d27fb2dd650 100644 --- a/js/src/jit/CacheIR.cpp +++ b/js/src/jit/CacheIR.cpp @@ -392,7 +392,7 @@ GeneratePrototypeHoleGuards(CacheIRWriter& writer, JSObject* obj, ObjOperandId o } static void -TestMatchingReceiver(CacheIRWriter& writer, JSObject* obj, Shape* shape, ObjOperandId objId, +TestMatchingReceiver(CacheIRWriter& writer, JSObject* obj, ObjOperandId objId, Maybe* expandoId) { if (obj->is()) { @@ -415,10 +415,10 @@ TestMatchingReceiver(CacheIRWriter& writer, JSObject* obj, Shape* shape, ObjOper static void EmitReadSlotGuard(CacheIRWriter& writer, JSObject* obj, JSObject* holder, - Shape* shape, ObjOperandId objId, Maybe* holderId) + ObjOperandId objId, Maybe* holderId) { Maybe expandoId; - TestMatchingReceiver(writer, obj, shape, objId, &expandoId); + TestMatchingReceiver(writer, obj, objId, &expandoId); if (obj != holder) { GeneratePrototypeGuards(writer, obj, holder, objId); @@ -452,7 +452,7 @@ EmitReadSlotResult(CacheIRWriter& writer, JSObject* obj, JSObject* holder, Shape* shape, ObjOperandId objId) { Maybe holderId; - EmitReadSlotGuard(writer, obj, holder, shape, objId, &holderId); + EmitReadSlotGuard(writer, obj, holder, objId, &holderId); if (obj == holder && obj->is()) holder = obj->as().maybeExpando(); @@ -514,7 +514,7 @@ EmitCallGetterResult(CacheIRWriter& writer, JSObject* obj, JSObject* holder, // require outerizing). if (mode == ICState::Mode::Specialized || IsWindow(obj)) { Maybe expandoId; - TestMatchingReceiver(writer, obj, shape, objId, &expandoId); + TestMatchingReceiver(writer, obj, objId, &expandoId); if (obj != holder) { GeneratePrototypeGuards(writer, obj, holder, objId); @@ -2113,7 +2113,7 @@ InIRGenerator::tryAttachNativeIn(HandleId key, ValOperandId keyId, Maybe holderId; emitIdGuard(keyId, key); - EmitReadSlotGuard(writer, obj, holder, prop.shape(), objId, &holderId); + EmitReadSlotGuard(writer, obj, holder, objId, &holderId); writer.loadBooleanResult(true); writer.returnFromIC(); @@ -2130,7 +2130,7 @@ InIRGenerator::tryAttachNativeInDoesNotExist(HandleId key, ValOperandId keyId, Maybe holderId; emitIdGuard(keyId, key); - EmitReadSlotGuard(writer, obj, nullptr, nullptr, objId, &holderId); + EmitReadSlotGuard(writer, obj, nullptr, objId, &holderId); writer.loadBooleanResult(false); writer.returnFromIC(); @@ -2243,7 +2243,7 @@ HasOwnIRGenerator::tryAttachNativeHasOwn(HandleId key, ValOperandId keyId, Maybe expandoId; emitIdGuard(keyId, key); - TestMatchingReceiver(writer, obj, nullptr, objId, &expandoId); + TestMatchingReceiver(writer, obj, objId, &expandoId); writer.loadBooleanResult(true); writer.returnFromIC(); @@ -2267,7 +2267,7 @@ HasOwnIRGenerator::tryAttachNativeHasOwnDoesNotExist(HandleId key, ValOperandId Maybe expandoId; emitIdGuard(keyId, key); - TestMatchingReceiver(writer, obj, nullptr, objId, &expandoId); + TestMatchingReceiver(writer, obj, objId, &expandoId); writer.loadBooleanResult(false); writer.returnFromIC(); @@ -2833,7 +2833,7 @@ SetPropIRGenerator::tryAttachSetter(HandleObject obj, ObjOperandId objId, Handle // require outerizing). if (mode_ == ICState::Mode::Specialized || IsWindow(obj)) { Maybe expandoId; - TestMatchingReceiver(writer, obj, propShape, objId, &expandoId); + TestMatchingReceiver(writer, obj, objId, &expandoId); if (obj != holder) { GeneratePrototypeGuards(writer, obj, holder, objId); From d561466341486125e36f20dbb11300e46d68ed1a Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Thu, 27 Apr 2017 12:06:13 -0400 Subject: [PATCH 03/36] Bug 1359952 - Add ownProp flag to CanAttachDenseElementHole r=jandem MozReview-Commit-ID: EvpCisLDTk2 --HG-- extra : rebase_source : ca652cb2e1c2ce2a208363bac7f283757afa5abf --- js/src/jit/CacheIR.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp index 50d27fb2dd650..0d2ef3b0c14d3 100644 --- a/js/src/jit/CacheIR.cpp +++ b/js/src/jit/CacheIR.cpp @@ -1408,7 +1408,7 @@ GetPropIRGenerator::tryAttachDenseElement(HandleObject obj, ObjOperandId objId, } static bool -CanAttachDenseElementHole(JSObject* obj) +CanAttachDenseElementHole(JSObject* obj, bool ownProp) { // Make sure the objects on the prototype don't have any indexed properties // or that such properties can't appear without a shape change. @@ -1422,6 +1422,10 @@ CanAttachDenseElementHole(JSObject* obj) if (ClassCanHaveExtraProperties(obj->getClass())) return false; + // Don't need to check prototype for OwnProperty checks + if (ownProp) + return true; + JSObject* proto = obj->staticPrototype(); if (!proto) break; @@ -1449,7 +1453,7 @@ GetPropIRGenerator::tryAttachDenseElementHole(HandleObject obj, ObjOperandId obj if (obj->as().containsDenseElement(index)) return false; - if (!CanAttachDenseElementHole(obj)) + if (!CanAttachDenseElementHole(obj, false)) return false; // Guard on the shape, to prevent non-dense elements from appearing. @@ -2085,7 +2089,7 @@ InIRGenerator::tryAttachDenseInHole(uint32_t index, Int32OperandId indexId, if (obj->as().containsDenseElement(index)) return false; - if (!CanAttachDenseElementHole(obj)) + if (!CanAttachDenseElementHole(obj, false)) return false; // Guard on the shape, to prevent non-dense elements from appearing. From 43e26a60a06cc692a381c2f16fd0250eb1f5a9d4 Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Thu, 27 Apr 2017 12:11:17 -0400 Subject: [PATCH 04/36] Bug 1359952 - Add HasPropIRGenerator r=jandem This combines InIRGenerator with HasOwnIRGenerator. MozReview-Commit-ID: 7FQX5YmVrM7 --HG-- extra : rebase_source : 9b0e735e303f6fa57d4407bec5b81bc8307d365a --- js/src/jit/BaselineIC.cpp | 8 +- js/src/jit/CacheIR.cpp | 277 ++++++++++++-------------------------- js/src/jit/CacheIR.h | 54 +++----- js/src/jit/IonIC.cpp | 2 +- 4 files changed, 111 insertions(+), 230 deletions(-) diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index 8c840236be3c1..2e53cfebdfa2d 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -1208,8 +1208,6 @@ DoInFallback(JSContext* cx, BaselineFrame* frame, ICIn_Fallback* stub_, return false; } - RootedObject obj(cx, &objValue.toObject()); - if (stub->state().maybeTransition()) stub->discardStubs(cx); @@ -1218,7 +1216,7 @@ DoInFallback(JSContext* cx, BaselineFrame* frame, ICIn_Fallback* stub_, jsbytecode* pc = stub->icEntry()->pc(script); ICStubEngine engine = ICStubEngine::Baseline; - InIRGenerator gen(cx, script, pc, stub->state().mode(), key, obj); + HasPropIRGenerator gen(cx, script, pc, CacheKind::In, stub->state().mode(), key, objValue); bool attached = false; if (gen.tryAttachStub()) { ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(), @@ -1230,6 +1228,7 @@ DoInFallback(JSContext* cx, BaselineFrame* frame, ICIn_Fallback* stub_, stub->state().trackNotAttached(); } + RootedObject obj(cx, &objValue.toObject()); bool cond = false; if (!OperatorIn(cx, key, obj, &cond)) return false; @@ -1284,7 +1283,8 @@ DoHasOwnFallback(JSContext* cx, BaselineFrame* frame, ICHasOwn_Fallback* stub_, jsbytecode* pc = stub->icEntry()->pc(script); ICStubEngine engine = ICStubEngine::Baseline; - HasOwnIRGenerator gen(cx, script, pc, stub->state().mode(), keyValue, objValue); + HasPropIRGenerator gen(cx, script, pc, CacheKind::HasOwn, + stub->state().mode(), keyValue, objValue); bool attached = false; if (gen.tryAttachStub()) { ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(), diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp index 0d2ef3b0c14d3..ed71446f7293b 100644 --- a/js/src/jit/CacheIR.cpp +++ b/js/src/jit/CacheIR.cpp @@ -440,7 +440,7 @@ EmitReadSlotGuard(CacheIRWriter& writer, JSObject* obj, JSObject* holder, lastObjId = protoId; } } - } else if (obj->is()) { + } else if (obj->is() && expandoId.isSome()) { holderId->emplace(*expandoId); } else { holderId->emplace(objId); @@ -2056,232 +2056,144 @@ BindNameIRGenerator::trackNotAttached() #endif } -InIRGenerator::InIRGenerator(JSContext* cx, HandleScript script, jsbytecode* pc, - ICState::Mode mode, HandleValue key, HandleObject obj) - : IRGenerator(cx, script, pc, CacheKind::In, mode), - key_(key), obj_(obj) +HasPropIRGenerator::HasPropIRGenerator(JSContext* cx, HandleScript script, jsbytecode* pc, + CacheKind cacheKind, ICState::Mode mode, + HandleValue idVal, HandleValue val) + : IRGenerator(cx, script, pc, cacheKind, mode), + val_(val), + idVal_(idVal) { } bool -InIRGenerator::tryAttachDenseIn(uint32_t index, Int32OperandId indexId, - HandleObject obj, ObjOperandId objId) +HasPropIRGenerator::tryAttachDense(HandleObject obj, ObjOperandId objId, + uint32_t index, Int32OperandId indexId) { if (!obj->isNative()) return false; if (!obj->as().containsDenseElement(index)) return false; + // Guard shape to ensure object class is NativeObject. writer.guardShape(objId, obj->as().lastProperty()); + writer.loadDenseElementExistsResult(objId, indexId); writer.returnFromIC(); - trackAttached("DenseIn"); + trackAttached("DenseHasProp"); return true; } bool -InIRGenerator::tryAttachDenseInHole(uint32_t index, Int32OperandId indexId, - HandleObject obj, ObjOperandId objId) +HasPropIRGenerator::tryAttachDenseHole(HandleObject obj, ObjOperandId objId, + uint32_t index, Int32OperandId indexId) { + bool hasOwn = (cacheKind_ == CacheKind::HasOwn); + if (!obj->isNative()) return false; - if (obj->as().containsDenseElement(index)) return false; - - if (!CanAttachDenseElementHole(obj, false)) + if (!CanAttachDenseElementHole(obj, hasOwn)) return false; - // Guard on the shape, to prevent non-dense elements from appearing. + // Guard shape to ensure class is NativeObject and to prevent non-dense + // elements being added. Also ensures prototype doesn't change if dynamic + // checks aren't emitted. writer.guardShape(objId, obj->as().lastProperty()); - GeneratePrototypeHoleGuards(writer, obj, objId); - writer.loadDenseElementHoleExistsResult(objId, indexId); - writer.returnFromIC(); - - trackAttached("DenseInHole"); - return true; -} + // Generate prototype guards if needed. This includes monitoring that + // properties were not added in the chain. + if (!hasOwn) + GeneratePrototypeHoleGuards(writer, obj, objId); -bool -InIRGenerator::tryAttachNativeIn(HandleId key, ValOperandId keyId, - HandleObject obj, ObjOperandId objId) -{ - PropertyResult prop; - JSObject* holder; - if (!LookupPropertyPure(cx_, obj, key, &holder, &prop)) - return false; - - if (!prop.isNativeProperty()) - return false; - - Maybe holderId; - emitIdGuard(keyId, key); - EmitReadSlotGuard(writer, obj, holder, objId, &holderId); - writer.loadBooleanResult(true); - writer.returnFromIC(); - - trackAttached("NativeIn"); - return true; -} - -bool -InIRGenerator::tryAttachNativeInDoesNotExist(HandleId key, ValOperandId keyId, - HandleObject obj, ObjOperandId objId) -{ - if (!CheckHasNoSuchProperty(cx_, obj, key)) - return false; - - Maybe holderId; - emitIdGuard(keyId, key); - EmitReadSlotGuard(writer, obj, nullptr, objId, &holderId); - writer.loadBooleanResult(false); + writer.loadDenseElementHoleExistsResult(objId, indexId); writer.returnFromIC(); - trackAttached("NativeInDoesNotExist"); + trackAttached("DenseHasPropHole"); return true; } bool -InIRGenerator::tryAttachStub() +HasPropIRGenerator::tryAttachNative(HandleObject obj, ObjOperandId objId, + HandleId key, ValOperandId keyId) { - MOZ_ASSERT(cacheKind_ == CacheKind::In); - - AutoAssertNoPendingException aanpe(cx_); - - ValOperandId keyId(writer.setInputOperandId(0)); - ValOperandId valId(writer.setInputOperandId(1)); - ObjOperandId objId = writer.guardIsObject(valId); - - RootedId id(cx_); - bool nameOrSymbol; - if (!ValueToNameOrSymbolId(cx_, key_, &id, &nameOrSymbol)) { - cx_->clearPendingException(); - return false; - } - - if (nameOrSymbol) { - if (tryAttachNativeIn(id, keyId, obj_, objId)) - return true; - if (tryAttachNativeInDoesNotExist(id, keyId, obj_, objId)) - return true; + bool hasOwn = (cacheKind_ == CacheKind::HasOwn); - trackNotAttached(); - return false; - } - - uint32_t index; - Int32OperandId indexId; - if (maybeGuardInt32Index(key_, keyId, &index, &indexId)) { - if (tryAttachDenseIn(index, indexId, obj_, objId)) - return true; - if (tryAttachDenseInHole(index, indexId, obj_, objId)) - return true; - - trackNotAttached(); - return false; - } - - trackNotAttached(); - return false; -} + JSObject* holder = nullptr; + PropertyResult prop; -void -InIRGenerator::trackAttached(const char* name) -{ -#ifdef JS_CACHEIR_SPEW - CacheIRSpewer& sp = CacheIRSpewer::singleton(); - if (sp.enabled()) { - LockGuard guard(sp.lock()); - sp.beginCache(guard, *this); - sp.valueProperty(guard, "base", ObjectValue(*obj_)); - sp.valueProperty(guard, "property", key_); - sp.attached(guard, name); - sp.endCache(guard); - } -#endif -} + if (hasOwn) { + if (!LookupOwnPropertyPure(cx_, obj, key, &prop)) + return false; -void -InIRGenerator::trackNotAttached() -{ -#ifdef JS_CACHEIR_SPEW - CacheIRSpewer& sp = CacheIRSpewer::singleton(); - if (sp.enabled()) { - LockGuard guard(sp.lock()); - sp.beginCache(guard, *this); - sp.valueProperty(guard, "base", ObjectValue(*obj_)); - sp.valueProperty(guard, "property", key_); - sp.endCache(guard); + holder = obj; + } else { + if (!LookupPropertyPure(cx_, obj, key, &holder, &prop)) + return false; } -#endif -} - -HasOwnIRGenerator::HasOwnIRGenerator(JSContext* cx, HandleScript script, jsbytecode* pc, - ICState::Mode mode, HandleValue key, HandleValue value) - : IRGenerator(cx, script, pc, CacheKind::HasOwn, mode), - key_(key), val_(value) -{ } - - -bool -HasOwnIRGenerator::tryAttachNativeHasOwn(HandleId key, ValOperandId keyId, - HandleObject obj, ObjOperandId objId) -{ - PropertyResult prop; - if (!LookupOwnPropertyPure(cx_, obj, key, &prop)) - return false; - if (!prop.isFound()) return false; - if (!obj->isNative() && !obj->is()) - return false; - - if (mode_ == ICState::Mode::Megamorphic) { + // Use MegamorphicHasOwnResult if applicable + if (hasOwn && mode_ == ICState::Mode::Megamorphic) { writer.megamorphicHasOwnResult(objId, keyId); writer.returnFromIC(); - trackAttached("MegamorphicHasOwn"); + trackAttached("MegamorphicHasProp"); return true; } - Maybe expandoId; + Maybe tempId; emitIdGuard(keyId, key); - TestMatchingReceiver(writer, obj, objId, &expandoId); + EmitReadSlotGuard(writer, obj, holder, objId, &tempId); writer.loadBooleanResult(true); writer.returnFromIC(); - trackAttached("NativeHasOwn"); + trackAttached("NativeHasProp"); return true; } bool -HasOwnIRGenerator::tryAttachNativeHasOwnDoesNotExist(HandleId key, ValOperandId keyId, - HandleObject obj, ObjOperandId objId) +HasPropIRGenerator::tryAttachNativeDoesNotExist(HandleObject obj, ObjOperandId objId, + HandleId key, ValOperandId keyId) { - if (!CheckHasNoSuchOwnProperty(cx_, obj, key)) - return false; + bool hasOwn = (cacheKind_ == CacheKind::HasOwn); + + if (hasOwn) { + if (!CheckHasNoSuchOwnProperty(cx_, obj, key)) + return false; + } else { + if (!CheckHasNoSuchProperty(cx_, obj, key)) + return false; + } - if (mode_ == ICState::Mode::Megamorphic) { + // Use MegamorphicHasOwnResult if applicable + if (hasOwn && mode_ == ICState::Mode::Megamorphic) { writer.megamorphicHasOwnResult(objId, keyId); writer.returnFromIC(); trackAttached("MegamorphicHasOwn"); return true; } - Maybe expandoId; + Maybe tempId; emitIdGuard(keyId, key); - TestMatchingReceiver(writer, obj, objId, &expandoId); + if (hasOwn) { + TestMatchingReceiver(writer, obj, objId, &tempId); + } else { + EmitReadSlotGuard(writer, obj, nullptr, objId, &tempId); + } writer.loadBooleanResult(false); writer.returnFromIC(); - trackAttached("NativeHasOwnDoesNotExist"); + trackAttached("NativeDoesNotExist"); return true; } bool -HasOwnIRGenerator::tryAttachProxyElement(ValOperandId keyId, HandleObject obj, ObjOperandId objId) +HasPropIRGenerator::tryAttachProxyElement(HandleObject obj, ObjOperandId objId, + ValOperandId keyId) { + MOZ_ASSERT(cacheKind_ == CacheKind::HasOwn); + if (!obj->is()) return false; @@ -2289,34 +2201,19 @@ HasOwnIRGenerator::tryAttachProxyElement(ValOperandId keyId, HandleObject obj, O writer.callProxyHasOwnResult(objId, keyId); writer.returnFromIC(); - trackAttached("ProxyHasOwn"); + trackAttached("ProxyHasProp"); return true; } bool -HasOwnIRGenerator::tryAttachDenseHasOwn(uint32_t index, Int32OperandId indexId, - HandleObject obj, ObjOperandId objId) +HasPropIRGenerator::tryAttachStub() { - if (!obj->isNative()) - return false; - if (!obj->as().containsDenseElement(index)) - return false; - - writer.guardShape(objId, obj->as().lastProperty()); - writer.loadDenseElementExistsResult(objId, indexId); - writer.returnFromIC(); - - trackAttached("DenseHasOwn"); - return true; -} - -bool -HasOwnIRGenerator::tryAttachStub() -{ - MOZ_ASSERT(cacheKind_ == CacheKind::HasOwn); + MOZ_ASSERT(cacheKind_ == CacheKind::In || + cacheKind_ == CacheKind::HasOwn); AutoAssertNoPendingException aanpe(cx_); + // NOTE: Argument order is PROPERTY, OBJECT ValOperandId keyId(writer.setInputOperandId(0)); ValOperandId valId(writer.setInputOperandId(1)); @@ -2325,23 +2222,25 @@ HasOwnIRGenerator::tryAttachStub() return false; } RootedObject obj(cx_, &val_.toObject()); - ObjOperandId objId = writer.guardIsObject(valId); - if (tryAttachProxyElement(keyId, obj, objId)) - return true; + // Optimize DOM Proxies for JSOP_HASOWN + if (cacheKind_ == CacheKind::HasOwn) { + if (tryAttachProxyElement(obj, objId, keyId)) + return true; + } RootedId id(cx_); bool nameOrSymbol; - if (!ValueToNameOrSymbolId(cx_, key_, &id, &nameOrSymbol)) { + if (!ValueToNameOrSymbolId(cx_, idVal_, &id, &nameOrSymbol)) { cx_->clearPendingException(); return false; } if (nameOrSymbol) { - if (tryAttachNativeHasOwn(id, keyId, obj, objId)) + if (tryAttachNative(obj, objId, id, keyId)) return true; - if (tryAttachNativeHasOwnDoesNotExist(id, keyId, obj, objId)) + if (tryAttachNativeDoesNotExist(obj, objId, id, keyId)) return true; trackNotAttached(); @@ -2350,8 +2249,10 @@ HasOwnIRGenerator::tryAttachStub() uint32_t index; Int32OperandId indexId; - if (maybeGuardInt32Index(key_, keyId, &index, &indexId)) { - if (tryAttachDenseHasOwn(index, indexId, obj, objId)) + if (maybeGuardInt32Index(idVal_, keyId, &index, &indexId)) { + if (tryAttachDense(obj, objId, index, indexId)) + return true; + if (tryAttachDenseHole(obj, objId, index, indexId)) return true; trackNotAttached(); @@ -2363,7 +2264,7 @@ HasOwnIRGenerator::tryAttachStub() } void -HasOwnIRGenerator::trackAttached(const char* name) +HasPropIRGenerator::trackAttached(const char* name) { #ifdef JS_CACHEIR_SPEW CacheIRSpewer& sp = CacheIRSpewer::singleton(); @@ -2371,7 +2272,7 @@ HasOwnIRGenerator::trackAttached(const char* name) LockGuard guard(sp.lock()); sp.beginCache(guard, *this); sp.valueProperty(guard, "base", val_); - sp.valueProperty(guard, "property", key_); + sp.valueProperty(guard, "property", idVal_); sp.attached(guard, name); sp.endCache(guard); } @@ -2379,7 +2280,7 @@ HasOwnIRGenerator::trackAttached(const char* name) } void -HasOwnIRGenerator::trackNotAttached() +HasPropIRGenerator::trackNotAttached() { #ifdef JS_CACHEIR_SPEW CacheIRSpewer& sp = CacheIRSpewer::singleton(); @@ -2387,7 +2288,7 @@ HasOwnIRGenerator::trackNotAttached() LockGuard guard(sp.lock()); sp.beginCache(guard, *this); sp.valueProperty(guard, "base", val_); - sp.valueProperty(guard, "property", key_); + sp.valueProperty(guard, "property", idVal_); sp.endCache(guard); } #endif diff --git a/js/src/jit/CacheIR.h b/js/src/jit/CacheIR.h index 9f6738c0a7e1d..a5dff67dd8b98 100644 --- a/js/src/jit/CacheIR.h +++ b/js/src/jit/CacheIR.h @@ -1276,51 +1276,31 @@ class MOZ_RAII SetPropIRGenerator : public IRGenerator } }; -// InIRGenerator generates CacheIR for a In IC. -class MOZ_RAII InIRGenerator : public IRGenerator +// HasPropIRGenerator generates CacheIR for a HasProp IC. Used for +// CacheKind::In / CacheKind::HasOwn. +class MOZ_RAII HasPropIRGenerator : public IRGenerator { - HandleValue key_; - HandleObject obj_; - - bool tryAttachDenseIn(uint32_t index, Int32OperandId indexId, - HandleObject obj, ObjOperandId objId); - bool tryAttachDenseInHole(uint32_t index, Int32OperandId indexId, - HandleObject obj, ObjOperandId objId); - bool tryAttachNativeIn(HandleId key, ValOperandId keyId, - HandleObject obj, ObjOperandId objId); - bool tryAttachNativeInDoesNotExist(HandleId key, ValOperandId keyId, - HandleObject obj, ObjOperandId objId); - - void trackAttached(const char* name); - void trackNotAttached(); - - public: - InIRGenerator(JSContext* cx, HandleScript, jsbytecode* pc, ICState::Mode mode, HandleValue key, - HandleObject obj); - - bool tryAttachStub(); -}; - -// HasOwnIRGenerator generates CacheIR for a HasOwn IC. -class MOZ_RAII HasOwnIRGenerator : public IRGenerator -{ - HandleValue key_; HandleValue val_; + HandleValue idVal_; - bool tryAttachProxyElement(ValOperandId keyId, HandleObject obj, ObjOperandId objId); - bool tryAttachDenseHasOwn(uint32_t index, Int32OperandId indexId, - HandleObject obj, ObjOperandId objId); - bool tryAttachNativeHasOwn(HandleId key, ValOperandId keyId, - HandleObject obj, ObjOperandId objId); - bool tryAttachNativeHasOwnDoesNotExist(HandleId key, ValOperandId keyId, - HandleObject obj, ObjOperandId objId); + bool tryAttachDense(HandleObject obj, ObjOperandId objId, + uint32_t index, Int32OperandId indexId); + bool tryAttachDenseHole(HandleObject obj, ObjOperandId objId, + uint32_t index, Int32OperandId indexId); + bool tryAttachNative(HandleObject obj, ObjOperandId objId, + HandleId key, ValOperandId keyId); + bool tryAttachNativeDoesNotExist(HandleObject obj, ObjOperandId objId, + HandleId key, ValOperandId keyId); + bool tryAttachProxyElement(HandleObject obj, ObjOperandId objId, + ValOperandId keyId); void trackAttached(const char* name); void trackNotAttached(); public: - HasOwnIRGenerator(JSContext* cx, HandleScript, jsbytecode* pc, ICState::Mode mode, HandleValue key, - HandleValue value); + // NOTE: Argument order is PROPERTY, OBJECT + HasPropIRGenerator(JSContext* cx, HandleScript script, jsbytecode* pc, CacheKind cacheKind, + ICState::Mode mode, HandleValue idVal, HandleValue val); bool tryAttachStub(); }; diff --git a/js/src/jit/IonIC.cpp b/js/src/jit/IonIC.cpp index 132d78d8e7617..f912d5399e25f 100644 --- a/js/src/jit/IonIC.cpp +++ b/js/src/jit/IonIC.cpp @@ -355,7 +355,7 @@ IonHasOwnIC::update(JSContext* cx, HandleScript outerScript, IonHasOwnIC* ic, if (ic->state().canAttachStub()) { bool attached = false; RootedScript script(cx, ic->script()); - HasOwnIRGenerator gen(cx, script, pc, ic->state().mode(), idVal, val); + HasPropIRGenerator gen(cx, script, pc, CacheKind::HasOwn, ic->state().mode(), idVal, val); if (gen.tryAttachStub()) ic->attachCacheIRStub(cx, gen.writerRef(), gen.cacheKind(), ionScript, &attached); From 26f948c0f331d95127bb36ec4e01561282995c0e Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Tue, 2 May 2017 17:22:53 -0400 Subject: [PATCH 05/36] Bug 1361495 - trigger winsock init early on STS to avoid main thread jank r=nwgh MozReview-Commit-ID: 9HhHWBwF47Z --HG-- extra : rebase_source : 63cc79d36fdf713ecb6e513fecd77fffa43bf182 --- netwerk/base/nsSocketTransportService2.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/netwerk/base/nsSocketTransportService2.cpp b/netwerk/base/nsSocketTransportService2.cpp index 19c2cc68ed1fa..7a91b4c4fbbe8 100644 --- a/netwerk/base/nsSocketTransportService2.cpp +++ b/netwerk/base/nsSocketTransportService2.cpp @@ -839,6 +839,18 @@ nsSocketTransportService::Run() { SOCKET_LOG(("STS thread init %d sockets\n", gMaxCount)); +#if defined(XP_WIN) + // see bug 1361495, gethostname() triggers winsock initialization. + // so do it here (on parent and child) to protect against it being done first + // accidentally on the main thread.. especially via PR_GetSystemInfo(). This + // will also improve latency of first real winsock operation + // .. + // If STS-thread is no longer needed this should still be run before exiting + + char ignoredStackBuffer[255]; + Unused << gethostname(ignoredStackBuffer, 255); +#endif + psm::InitializeSSLServerCertVerificationThreads(); gSocketThread = PR_GetCurrentThread(); From 8e7ddb1ceb7db89fab08a94e54f16195cc35ad8b Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Mon, 17 Apr 2017 13:55:27 -0400 Subject: [PATCH 06/36] Bug 1337773 - Add IonInIC r=jandem MozReview-Commit-ID: BmHPnJnMjVP --HG-- extra : rebase_source : d8ca3f631dd2da0bfb5b87b4db1ceac323f6131d --- js/src/jit/CodeGenerator.cpp | 23 +++++++++++++++++++- js/src/jit/IonCacheIRCompiler.cpp | 16 +++++++++++++- js/src/jit/IonIC.cpp | 26 +++++++++++++++++++++++ js/src/jit/IonIC.h | 35 +++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 2 deletions(-) diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 2db78d8a1cb8a..52c3014192211 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -158,6 +158,10 @@ typedef JSObject* (*IonBindNameICFn)(JSContext*, HandleScript, IonBindNameIC*, H static const VMFunction IonBindNameICInfo = FunctionInfo(IonBindNameIC::update, "IonBindNameIC::update"); +typedef bool (*IonInICFn)(JSContext*, HandleScript, IonInIC*, HandleValue, HandleObject, bool*); +static const VMFunction IonInICInfo = + FunctionInfo(IonInIC::update, "IonInIC::update"); + void CodeGenerator::visitOutOfLineICFallback(OutOfLineICFallback* ool) { @@ -243,7 +247,24 @@ CodeGenerator::visitOutOfLineICFallback(OutOfLineICFallback* ool) masm.jump(ool->rejoin()); return; } - case CacheKind::In: + case CacheKind::In: { + IonInIC* inIC = ic->asInIC(); + + saveLive(lir); + + pushArg(inIC->object()); + pushArg(inIC->key()); + icInfo_[cacheInfoIndex].icOffsetForPush = pushArgWithPatch(ImmWord(-1)); + pushArg(ImmGCPtr(gen->info().script())); + + callVM(IonInICInfo, lir); + + StoreRegisterTo(inIC->output()).generate(this); + restoreLiveIgnore(lir, StoreRegisterTo(inIC->output()).clobbered()); + + masm.jump(ool->rejoin()); + return; + } case CacheKind::TypeOf: MOZ_CRASH("Baseline-specific for now"); case CacheKind::HasOwn: { diff --git a/js/src/jit/IonCacheIRCompiler.cpp b/js/src/jit/IonCacheIRCompiler.cpp index ceef389b27b59..9c4fa6edb0431 100644 --- a/js/src/jit/IonCacheIRCompiler.cpp +++ b/js/src/jit/IonCacheIRCompiler.cpp @@ -440,7 +440,21 @@ IonCacheIRCompiler::init() allocator.initInputLocation(0, ic->environment(), JSVAL_TYPE_OBJECT); break; } - case CacheKind::In: + case CacheKind::In: { + IonInIC* ic = ic_->asInIC(); + Register output = ic->output(); + + available.add(output); + + liveRegs_.emplace(ic->liveRegs()); + outputUnchecked_.emplace(TypedOrValueRegister(MIRType::Boolean, AnyRegister(output))); + + MOZ_ASSERT(numInputs == 2); + allocator.initInputLocation(0, ic->key()); + allocator.initInputLocation(1, TypedOrValueRegister(MIRType::Object, + AnyRegister(ic->object()))); + break; + } case CacheKind::TypeOf: MOZ_CRASH("Invalid cache"); case CacheKind::HasOwn: { diff --git a/js/src/jit/IonIC.cpp b/js/src/jit/IonIC.cpp index f912d5399e25f..d7fd09e1645a6 100644 --- a/js/src/jit/IonIC.cpp +++ b/js/src/jit/IonIC.cpp @@ -49,6 +49,7 @@ IonIC::scratchRegisterForEntryJump() case CacheKind::BindName: return asBindNameIC()->temp(); case CacheKind::In: + return asInIC()->temp(); case CacheKind::TypeOf: MOZ_CRASH("Baseline-specific for now"); case CacheKind::HasOwn: @@ -371,6 +372,31 @@ IonHasOwnIC::update(JSContext* cx, HandleScript outerScript, IonHasOwnIC* ic, return true; } +/* static */ bool +IonInIC::update(JSContext* cx, HandleScript outerScript, IonInIC* ic, + HandleValue key, HandleObject obj, bool* res) +{ + IonScript* ionScript = outerScript->ionScript(); + + if (ic->state().maybeTransition()) + ic->discardStubs(cx->zone()); + + if (ic->state().canAttachStub()) { + bool attached = false; + RootedScript script(cx, ic->script()); + RootedValue objV(cx, ObjectValue(*obj)); + jsbytecode* pc = ic->pc(); + HasPropIRGenerator gen(cx, script, pc, CacheKind::In, ic->state().mode(), key, objV); + if (gen.tryAttachStub()) + ic->attachCacheIRStub(cx, gen.writerRef(), gen.cacheKind(), ionScript, &attached); + + if (!attached) + ic->state().trackNotAttached(); + } + + return OperatorIn(cx, key, obj, res); +} + uint8_t* IonICStub::stubDataStart() { diff --git a/js/src/jit/IonIC.h b/js/src/jit/IonIC.h index 4cc41e5887224..59a58dbee2014 100644 --- a/js/src/jit/IonIC.h +++ b/js/src/jit/IonIC.h @@ -61,6 +61,7 @@ class IonSetPropertyIC; class IonGetNameIC; class IonBindNameIC; class IonHasOwnIC; +class IonInIC; class IonIC { @@ -152,6 +153,10 @@ class IonIC MOZ_ASSERT(kind_ == CacheKind::HasOwn); return (IonHasOwnIC*)this; } + IonInIC* asInIC() { + MOZ_ASSERT(kind_ == CacheKind::In); + return (IonInIC*)this; + } void updateBaseAddress(JitCode* code, MacroAssembler& masm); @@ -336,6 +341,36 @@ class IonHasOwnIC : public IonIC HandleValue val, HandleValue idVal, int32_t* res); }; +class IonInIC : public IonIC +{ + LiveRegisterSet liveRegs_; + + ConstantOrRegister key_; + Register object_; + Register output_; + Register temp_; + + public: + IonInIC(LiveRegisterSet liveRegs, const ConstantOrRegister& key, + Register object, Register output, Register temp) + : IonIC(CacheKind::In), + liveRegs_(liveRegs), + key_(key), + object_(object), + output_(output), + temp_(temp) + { } + + ConstantOrRegister key() const { return key_; } + Register object() const { return object_; } + Register output() const { return output_; } + Register temp() const { return temp_; } + LiveRegisterSet liveRegs() const { return liveRegs_; } + + static MOZ_MUST_USE bool update(JSContext* cx, HandleScript outerScript, IonInIC* ic, + HandleValue key, HandleObject obj, bool* res); +}; + } // namespace jit } // namespace js From 4e110f1b5d44b6d78d77071f48d3994e34914581 Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Mon, 17 Apr 2017 13:31:12 -0400 Subject: [PATCH 07/36] Bug 1337773 - Use IonInIC for MIn and rename to MInCache r=jandem MozReview-Commit-ID: 2Nl70H4MpPa --HG-- extra : rebase_source : c8c54a4c32769e6bfd323f9acd7860d043f9656a --- js/src/jit/CodeGenerator.cpp | 16 +++++++++------- js/src/jit/CodeGenerator.h | 2 +- js/src/jit/IonBuilder.cpp | 18 ++++++++++-------- js/src/jit/Lowering.cpp | 11 +++++++---- js/src/jit/Lowering.h | 2 +- js/src/jit/MIR.h | 15 ++++++--------- js/src/jit/MOpcodes.h | 2 +- js/src/jit/TypePolicy.cpp | 2 ++ js/src/jit/shared/LIR-shared.h | 13 ++++++++++--- js/src/jit/shared/LOpcodes-shared.h | 2 +- 10 files changed, 48 insertions(+), 35 deletions(-) diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 52c3014192211..8e9baf007746a 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -11206,16 +11206,18 @@ CodeGenerator::visitClampVToUint8(LClampVToUint8* lir) bailoutFrom(&fails, lir->snapshot()); } -typedef bool (*OperatorInFn)(JSContext*, HandleValue, HandleObject, bool*); -static const VMFunction OperatorInInfo = FunctionInfo(OperatorIn, "OperatorIn"); - void -CodeGenerator::visitIn(LIn* ins) +CodeGenerator::visitInCache(LInCache* ins) { - pushArg(ToRegister(ins->rhs())); - pushArg(ToValue(ins, LIn::LHS)); + LiveRegisterSet liveRegs = ins->safepoint()->liveRegs(); + + ConstantOrRegister key = toConstantOrRegister(ins, LInCache::LHS, ins->mir()->key()->type()); + Register object = ToRegister(ins->rhs()); + Register output = ToRegister(ins->output()); + Register temp = ToRegister(ins->temp()); - callVM(OperatorInInfo, ins); + IonInIC cache(liveRegs, key, object, output, temp); + addIC(ins, allocateIC(cache)); } typedef bool (*OperatorInIFn)(JSContext*, uint32_t, HandleObject, bool*); diff --git a/js/src/jit/CodeGenerator.h b/js/src/jit/CodeGenerator.h index 058d5b7341f24..f595dfe64bea6 100644 --- a/js/src/jit/CodeGenerator.h +++ b/js/src/jit/CodeGenerator.h @@ -358,7 +358,7 @@ class CodeGenerator final : public CodeGeneratorSpecific void visitBitNotV(LBitNotV* lir); void visitBitOpV(LBitOpV* lir); void emitInstanceOf(LInstruction* ins, JSObject* prototypeObject); - void visitIn(LIn* ins); + void visitInCache(LInCache* ins); void visitInArray(LInArray* ins); void visitInstanceOfO(LInstanceOfO* ins); void visitInstanceOfV(LInstanceOfV* ins); diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 109dacb6f655c..d60d528b502ac 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -12600,17 +12600,19 @@ IonBuilder::jsop_in() MDefinition* obj = convertUnboxedObjects(current->pop()); MDefinition* id = current->pop(); - bool emitted = false; + if (!forceInlineCaches()) { + bool emitted = false; - MOZ_TRY(inTryDense(&emitted, obj, id)); - if (emitted) - return Ok(); + MOZ_TRY(inTryDense(&emitted, obj, id)); + if (emitted) + return Ok(); - MOZ_TRY(hasTryNotDefined(&emitted, obj, id, /* ownProperty = */ false)); - if (emitted) - return Ok(); + MOZ_TRY(hasTryNotDefined(&emitted, obj, id, /* ownProperty = */ false)); + if (emitted) + return Ok(); + } - MIn* ins = MIn::New(alloc(), id, obj); + MInCache* ins = MInCache::New(alloc(), id, obj); current->add(ins); current->push(ins); diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp index c0deef5f888e7..131a36d425088 100644 --- a/js/src/jit/Lowering.cpp +++ b/js/src/jit/Lowering.cpp @@ -4186,16 +4186,19 @@ LIRGenerator::visitThrow(MThrow* ins) } void -LIRGenerator::visitIn(MIn* ins) +LIRGenerator::visitInCache(MInCache* ins) { MDefinition* lhs = ins->lhs(); MDefinition* rhs = ins->rhs(); - MOZ_ASSERT(lhs->type() == MIRType::Value); + MOZ_ASSERT(lhs->type() == MIRType::String || + lhs->type() == MIRType::Symbol || + lhs->type() == MIRType::Int32 || + lhs->type() == MIRType::Value); MOZ_ASSERT(rhs->type() == MIRType::Object); - LIn* lir = new(alloc()) LIn(useBoxAtStart(lhs), useRegisterAtStart(rhs)); - defineReturn(lir, ins); + LInCache* lir = new(alloc()) LInCache(useBoxOrTyped(lhs), useRegister(rhs), temp()); + define(lir, ins); assignSafepoint(lir, ins); } diff --git a/js/src/jit/Lowering.h b/js/src/jit/Lowering.h index 3b5592937c8d1..071cec2bf9830 100644 --- a/js/src/jit/Lowering.h +++ b/js/src/jit/Lowering.h @@ -286,7 +286,7 @@ class LIRGenerator : public LIRGeneratorSpecific void visitRunOncePrologue(MRunOncePrologue* ins); void visitRest(MRest* ins); void visitThrow(MThrow* ins); - void visitIn(MIn* ins); + void visitInCache(MInCache* ins); void visitInArray(MInArray* ins); void visitHasOwnCache(MHasOwnCache* ins); void visitInstanceOf(MInstanceOf* ins); diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index cb0faece66061..8487738a8b9a6 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -12489,24 +12489,21 @@ class MIteratorEnd }; -// Implementation for 'in' operator. -class MIn +// Implementation for 'in' operator using instruction cache +class MInCache : public MBinaryInstruction, - public MixPolicy, ObjectPolicy<1> >::Data + public MixPolicy, ObjectPolicy<1> >::Data { - MIn(MDefinition* key, MDefinition* obj) + MInCache(MDefinition* key, MDefinition* obj) : MBinaryInstruction(key, obj) { setResultType(MIRType::Boolean); } public: - INSTRUCTION_HEADER(In) + INSTRUCTION_HEADER(InCache) TRIVIAL_NEW_WRAPPERS - - bool possiblyCalls() const override { - return true; - } + NAMED_OPERANDS((0, key), (1, object)) }; diff --git a/js/src/jit/MOpcodes.h b/js/src/jit/MOpcodes.h index df90c06154dba..d32cc18feb1a8 100644 --- a/js/src/jit/MOpcodes.h +++ b/js/src/jit/MOpcodes.h @@ -266,7 +266,7 @@ namespace jit { _(Ceil) \ _(Round) \ _(NearbyInt) \ - _(In) \ + _(InCache) \ _(HasOwnCache) \ _(InstanceOf) \ _(CallInstanceOf) \ diff --git a/js/src/jit/TypePolicy.cpp b/js/src/jit/TypePolicy.cpp index 5229aec43e846..409a6cc732ae9 100644 --- a/js/src/jit/TypePolicy.cpp +++ b/js/src/jit/TypePolicy.cpp @@ -673,6 +673,7 @@ CacheIdPolicy::staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) } } +template bool CacheIdPolicy<0>::staticAdjustInputs(TempAllocator& alloc, MInstruction* ins); template bool CacheIdPolicy<1>::staticAdjustInputs(TempAllocator& alloc, MInstruction* ins); bool @@ -1250,6 +1251,7 @@ FilterTypeSetPolicy::adjustInputs(TempAllocator& alloc, MInstruction* ins) _(MixPolicy, IntPolicy<1> >) \ _(MixPolicy, BoxPolicy<1> >) \ _(MixPolicy, CacheIdPolicy<1>>) \ + _(MixPolicy, ObjectPolicy<1> >) \ _(MixPolicy, ConvertToStringPolicy<1> >) \ _(MixPolicy, IntPolicy<1> >) \ _(MixPolicy, IntPolicy<2> >) \ diff --git a/js/src/jit/shared/LIR-shared.h b/js/src/jit/shared/LIR-shared.h index e7358f846ddc9..14b469afe838a 100644 --- a/js/src/jit/shared/LIR-shared.h +++ b/js/src/jit/shared/LIR-shared.h @@ -7853,13 +7853,14 @@ class LGuardSharedTypedArray : public LInstructionHelper<0, 1, 1> } }; -class LIn : public LCallInstructionHelper<1, BOX_PIECES+1, 0> +class LInCache : public LInstructionHelper<1, BOX_PIECES+1, 1> { public: - LIR_HEADER(In) - LIn(const LBoxAllocation& lhs, const LAllocation& rhs) { + LIR_HEADER(InCache) + LInCache(const LBoxAllocation& lhs, const LAllocation& rhs, const LDefinition& temp) { setBoxOperand(LHS, lhs); setOperand(RHS, rhs); + setTemp(0, temp); } const LAllocation* lhs() { @@ -7868,6 +7869,12 @@ class LIn : public LCallInstructionHelper<1, BOX_PIECES+1, 0> const LAllocation* rhs() { return getOperand(RHS); } + const LDefinition* temp() { + return getTemp(0); + } + const MInCache* mir() const { + return mir_->toInCache(); + } static const size_t LHS = 0; static const size_t RHS = BOX_PIECES; diff --git a/js/src/jit/shared/LOpcodes-shared.h b/js/src/jit/shared/LOpcodes-shared.h index 453ba5cbb24b9..373cd06277675 100644 --- a/js/src/jit/shared/LOpcodes-shared.h +++ b/js/src/jit/shared/LOpcodes-shared.h @@ -375,7 +375,7 @@ _(RoundF) \ _(NearbyInt) \ _(NearbyIntF) \ - _(In) \ + _(InCache) \ _(InArray) \ _(HasOwnCache) \ _(InstanceOfO) \ From abd52a84b9f98314f78748d327d2fc35f810e863 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Tue, 2 May 2017 14:32:52 -0700 Subject: [PATCH 08/36] Bug 1361436 - Emit build stats immediately after build; r=ted The "generate-build-stats" mozharness action collects a bunch of build system metrics, including build_resources.json, ctors count, and installer size and reports them by writing special messages that log parsers read. Before this commit, this mozharness action occurred sometime after "build." But relative ordering to other actions was not consistent and appears to be significantly cargo culted. 4e61e69a383c (bug 1304508) changed the "check" mozharness action to invoke `mach build check` instead of `make` directly. An unintended consequence of this is that `mach build` replaced the build_resources.json file from the build itself with one measuring `make check`. This made the "build time summary" metric take a nose dive. This commit works around the issue introduced by 4e61e69a383c by reordering the mozharness actions so "generate-build-stats" follows immediately after the "build" action. Not only does it now occur before the "check" action, but it also occurs before uploading and other actions. I'm not sure why "generate-build-stats" is its own action and not part of "build" itself. As the diff shows, numerous instances of "generate-build-stats" are commented out, which means we aren't collecting metrics. "generate-build-stats" is also missing from a handful of mozharness configs, including Windows Clang builds. I'm not sure what the history is (it is likely varied and almost certainly involves a fair amount of cargo culting), but I think it is a bug that we aren't collecting build metrics for every build. I would like to fix this. And moving "generate-build-stats" immediately after "build" should make that transition easier. MozReview-Commit-ID: 7jNTVWRvMnh --HG-- extra : rebase_source : 0b5fd1f462caa5c283ba7e1b693fdc5b8b948add --- taskcluster/ci/build/linux.yml | 42 +++++++++---------- taskcluster/ci/valgrind/kind.yml | 2 +- .../builds/releng_base_android_64_builds.py | 2 +- .../builds/releng_base_linux_32_builds.py | 2 +- .../builds/releng_base_linux_64_builds.py | 2 +- .../builds/releng_base_mac_64_builds.py | 2 +- .../builds/releng_base_windows_32_builds.py | 2 +- .../builds/releng_base_windows_64_builds.py | 2 +- .../releng_sub_linux_configs/32_debug.py | 2 +- .../releng_sub_linux_configs/32_qr_debug.py | 2 +- .../64_add-on-devel.py | 2 +- .../releng_sub_linux_configs/64_artifact.py | 2 +- .../releng_sub_linux_configs/64_asan.py | 2 +- .../64_asan_and_debug.py | 2 +- .../releng_sub_linux_configs/64_asan_tc.py | 2 +- .../64_asan_tc_and_debug.py | 2 +- .../64_code_coverage.py | 2 +- .../releng_sub_linux_configs/64_debug.py | 2 +- .../64_debug_artifact.py | 2 +- .../releng_sub_linux_configs/64_qr_debug.py | 2 +- .../releng_sub_linux_configs/64_stylo.py | 2 +- .../64_stylo_debug.py | 2 +- .../releng_sub_linux_configs/64_valgrind.py | 2 +- .../releng_sub_mac_configs/64_add-on-devel.py | 2 +- .../releng_sub_mac_configs/64_cross_debug.py | 2 +- .../64_cross_qr_debug.py | 2 +- .../builds/releng_sub_mac_configs/64_debug.py | 2 +- .../64_stat_and_debug.py | 2 +- .../32_add-on-devel.py | 2 +- .../releng_sub_windows_configs/32_debug.py | 2 +- .../64_add-on-devel.py | 2 +- .../releng_sub_windows_configs/64_debug.py | 2 +- .../taskcluster_firefox_win32_qr_debug.py | 2 +- .../taskcluster_firefox_win32_qr_opt.py | 2 +- ...skcluster_firefox_windows_32_addondevel.py | 2 +- .../taskcluster_firefox_windows_32_debug.py | 2 +- .../taskcluster_firefox_windows_32_opt.py | 2 +- ...skcluster_firefox_windows_64_addondevel.py | 2 +- .../taskcluster_firefox_windows_64_debug.py | 2 +- .../taskcluster_firefox_windows_64_opt.py | 2 +- .../mozharness/scripts/fx_desktop_build.py | 2 +- 41 files changed, 61 insertions(+), 61 deletions(-) diff --git a/taskcluster/ci/build/linux.yml b/taskcluster/ci/build/linux.yml index 94f01913b0a69..84a233d2f8292 100644 --- a/taskcluster/ci/build/linux.yml +++ b/taskcluster/ci/build/linux.yml @@ -12,7 +12,7 @@ linux64/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -36,7 +36,7 @@ linux64/pgo: coalesce-name: linux64-pgo run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] options: [enable-pgo] config: - builds/releng_base_linux_64_builds.py @@ -60,7 +60,7 @@ linux64/debug: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -84,7 +84,7 @@ linux64-devedition/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -110,7 +110,7 @@ linux/opt: coalesce-name: opt_linux32 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_32_builds.py - balrog/production.py @@ -134,7 +134,7 @@ linux/debug: coalesce-name: dbg_linux32 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_32_builds.py - balrog/production.py @@ -159,7 +159,7 @@ linux/pgo: coalesce-name: linux32-pgo run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] options: [enable-pgo] config: - builds/releng_base_linux_32_builds.py @@ -183,7 +183,7 @@ linux-devedition/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_32_builds.py - balrog/production.py @@ -211,7 +211,7 @@ linux-nightly/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_32_builds.py - disable_signing.py @@ -236,7 +236,7 @@ linux64-asan/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -260,7 +260,7 @@ linux64-asan/debug: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -287,7 +287,7 @@ linux64-nightly/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - disable_signing.py @@ -312,7 +312,7 @@ linux64-stylo/opt: max-run-time: 3600 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -337,7 +337,7 @@ linux64-stylo/debug: max-run-time: 3600 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -363,7 +363,7 @@ linux64-jsdcov/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -389,7 +389,7 @@ linux64-ccov/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -414,7 +414,7 @@ linux64-add-on-devel/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -440,7 +440,7 @@ linux64-qr/debug: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -466,7 +466,7 @@ linux64-qr/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_64_builds.py - balrog/production.py @@ -492,7 +492,7 @@ linux-qr/opt: max-run-time: 36000 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_32_builds.py - balrog/production.py @@ -519,7 +519,7 @@ linux-qr/debug: coalesce-name: dbg_linux32 run: using: mozharness - actions: [get-secrets build check-test generate-build-stats update] + actions: [get-secrets build generate-build-stats check-test update] config: - builds/releng_base_linux_32_builds.py - balrog/production.py diff --git a/taskcluster/ci/valgrind/kind.yml b/taskcluster/ci/valgrind/kind.yml index 4630ec9413a55..4597427c3f8a6 100644 --- a/taskcluster/ci/valgrind/kind.yml +++ b/taskcluster/ci/valgrind/kind.yml @@ -27,7 +27,7 @@ jobs: max-run-time: 72000 run: using: mozharness - actions: [get-secrets build valgrind-test generate-build-stats] + actions: [get-secrets build generate-build-stats valgrind-test] custom-build-variant-cfg: valgrind config: - builds/releng_base_linux_64_builds.py diff --git a/testing/mozharness/configs/builds/releng_base_android_64_builds.py b/testing/mozharness/configs/builds/releng_base_android_64_builds.py index db16d269adfc2..126cddbaa26ef 100644 --- a/testing/mozharness/configs/builds/releng_base_android_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_android_64_builds.py @@ -11,10 +11,10 @@ 'checkout-sources', 'setup-mock', 'build', + 'generate-build-stats', 'upload-files', 'sendchange', 'multi-l10n', - 'generate-build-stats', 'update', # decided by query_is_nightly() ], "buildbot_json_path": "buildprops.json", diff --git a/testing/mozharness/configs/builds/releng_base_linux_32_builds.py b/testing/mozharness/configs/builds/releng_base_linux_32_builds.py index 1bbef56d0b6de..ce84dc6e97f6b 100644 --- a/testing/mozharness/configs/builds/releng_base_linux_32_builds.py +++ b/testing/mozharness/configs/builds/releng_base_linux_32_builds.py @@ -15,10 +15,10 @@ 'checkout-sources', 'setup-mock', 'build', + 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - 'generate-build-stats', 'update', # decided by query_is_nightly() ], "buildbot_json_path": "buildprops.json", diff --git a/testing/mozharness/configs/builds/releng_base_linux_64_builds.py b/testing/mozharness/configs/builds/releng_base_linux_64_builds.py index c874dd45bd377..a04fd4d61243f 100644 --- a/testing/mozharness/configs/builds/releng_base_linux_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_linux_64_builds.py @@ -14,10 +14,10 @@ 'checkout-sources', 'setup-mock', 'build', + 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - 'generate-build-stats', 'update', # decided by query_is_nightly() ], "buildbot_json_path": "buildprops.json", diff --git a/testing/mozharness/configs/builds/releng_base_mac_64_builds.py b/testing/mozharness/configs/builds/releng_base_mac_64_builds.py index aa0e761f157d0..6a49f1671457a 100644 --- a/testing/mozharness/configs/builds/releng_base_mac_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_mac_64_builds.py @@ -11,10 +11,10 @@ # 'setup-mock', 'checkout-sources', 'build', + 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - 'generate-build-stats', 'update', # decided by query_is_nightly() ], "buildbot_json_path": "buildprops.json", diff --git a/testing/mozharness/configs/builds/releng_base_windows_32_builds.py b/testing/mozharness/configs/builds/releng_base_windows_32_builds.py index 9f006de54ee24..84d366ad60626 100644 --- a/testing/mozharness/configs/builds/releng_base_windows_32_builds.py +++ b/testing/mozharness/configs/builds/releng_base_windows_32_builds.py @@ -15,10 +15,10 @@ 'checkout-sources', # 'setup-mock', windows do not use mock 'build', + 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - 'generate-build-stats', 'update', # decided by query_is_nightly() ], "buildbot_json_path": "buildprops.json", diff --git a/testing/mozharness/configs/builds/releng_base_windows_64_builds.py b/testing/mozharness/configs/builds/releng_base_windows_64_builds.py index ce899491afd4a..b37d978bdb0be 100644 --- a/testing/mozharness/configs/builds/releng_base_windows_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_windows_64_builds.py @@ -15,10 +15,10 @@ 'checkout-sources', # 'setup-mock', windows do not use mock 'build', + 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - 'generate-build-stats', 'update', # decided by query_is_nightly() ], "buildbot_json_path": "buildprops.json", diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/32_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/32_debug.py index 914bfdfe3411b..c5685f3737b1b 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/32_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/32_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'debug_build': True, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/32_qr_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/32_qr_debug.py index ae907e07270ee..8defab032df03 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/32_qr_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/32_qr_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'debug_build': True, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py index 98462a62f257f..eaf34fbf9b9aa 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py @@ -7,10 +7,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', # 'sendchange', 'check-test', - # 'generate-build-stats', # 'update', ], 'stage_platform': 'linux64-add-on-devel', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_artifact.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_artifact.py index 4813548499bf7..518855a571965 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_artifact.py @@ -8,8 +8,8 @@ 'checkout-sources', 'setup-mock', 'build', - 'sendchange', # 'generate-build-stats', + 'sendchange', ], "buildbot_json_path": "buildprops.json", 'exes': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py index 0f57520b5a984..1a455aaf8ebbe 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', # 'update', ], 'stage_platform': 'linux64-asan', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py index 4ff6a9d2c0a66..f5bab47c02f37 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', # 'update', ], 'stage_platform': 'linux64-asan-debug', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py index 0f57520b5a984..1a455aaf8ebbe 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', # 'update', ], 'stage_platform': 'linux64-asan', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py index 4ff6a9d2c0a66..f5bab47c02f37 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', # 'update', ], 'stage_platform': 'linux64-asan-debug', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_code_coverage.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_code_coverage.py index 3ab4f25a3ea5e..1f8a518a41893 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_code_coverage.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_code_coverage.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'linux64-ccov', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug.py index e97c82fcd2eab..dd51f2955d516 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'linux64-debug', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug_artifact.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug_artifact.py index 73dc52ba693dd..28ff8feb58c8e 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug_artifact.py @@ -10,8 +10,8 @@ 'checkout-sources', 'setup-mock', 'build', - 'sendchange', # 'generate-build-stats', + 'sendchange', ], "buildbot_json_path": "buildprops.json", 'exes': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_qr_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_qr_debug.py index bf6e053154cb8..520ac3ae09af6 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_qr_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_qr_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'linux64-debug', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stylo.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stylo.py index 8ff633f0e099e..5127565bfb8b5 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stylo.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stylo.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'linux64-stylo', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stylo_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stylo_debug.py index 1baf2be3e526a..04efa070e5800 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stylo_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stylo_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'linux64-stylo-debug', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py index d3b8c177aceaa..c7a2fba5638dd 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py @@ -9,11 +9,11 @@ 'checkout-sources', #'setup-mock', 'build', + # 'generate-build-stats', #'upload-files', #'sendchange', 'check-test', 'valgrind-test', - #'generate-build-stats', #'update', ], 'stage_platform': 'linux64-valgrind', diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py index d54c4d3a6f95a..9b6a3e2513757 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py @@ -7,10 +7,10 @@ 'checkout-sources', # 'setup-mock', 'build', +# 'generate-build-stats', 'upload-files', # 'sendchange', 'check-test', -# 'generate-build-stats', # 'update', ], 'stage_platform': 'macosx64-add-on-devel', diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_debug.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_debug.py index 4ca2d30773418..6f6940c854014 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_debug.py @@ -9,9 +9,9 @@ 'checkout-sources', # 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'macosx64-debug', diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_qr_debug.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_qr_debug.py index f461d54f3ad22..43d106d35a71b 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_qr_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_qr_debug.py @@ -9,9 +9,9 @@ 'checkout-sources', # 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'macosx64-debug', diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug.py index 16d15c0b0fefd..b584adfe7b105 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', # 'setup-mock', 'build', + 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'macosx64-debug', diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_stat_and_debug.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_stat_and_debug.py index 0dcd84e5acae3..c27a98bc3f321 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_stat_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_stat_and_debug.py @@ -9,9 +9,9 @@ 'checkout-sources', # 'setup-mock', 'build', + # 'generate-build-stats', 'upload-files', 'sendchange', - # 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'debug_build': True, diff --git a/testing/mozharness/configs/builds/releng_sub_windows_configs/32_add-on-devel.py b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_add-on-devel.py index 4e8fd9c39d76d..69658ea9a4212 100644 --- a/testing/mozharness/configs/builds/releng_sub_windows_configs/32_add-on-devel.py +++ b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_add-on-devel.py @@ -7,10 +7,10 @@ 'checkout-sources', # 'setup-mock', windows do not use mock 'build', +# 'generate-build-stats', 'upload-files', # 'sendchange', 'check-test', -# 'generate-build-stats', # 'update', ], 'stage_platform': 'win32-add-on-devel', diff --git a/testing/mozharness/configs/builds/releng_sub_windows_configs/32_debug.py b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_debug.py index a8dfd3e4ba1ba..70e90194ef019 100644 --- a/testing/mozharness/configs/builds/releng_sub_windows_configs/32_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', # 'setup-mock', windows do not use mock 'build', + 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'win32-debug', diff --git a/testing/mozharness/configs/builds/releng_sub_windows_configs/64_add-on-devel.py b/testing/mozharness/configs/builds/releng_sub_windows_configs/64_add-on-devel.py index b333d5c872848..ce5d6f6279ccf 100644 --- a/testing/mozharness/configs/builds/releng_sub_windows_configs/64_add-on-devel.py +++ b/testing/mozharness/configs/builds/releng_sub_windows_configs/64_add-on-devel.py @@ -7,10 +7,10 @@ 'checkout-sources', # 'setup-mock', windows do not use mock 'build', +# 'generate-build-stats', 'upload-files', # 'sendchange', 'check-test', -# 'generate-build-stats', # 'update', ], 'stage_platform': 'win64-add-on-devel', diff --git a/testing/mozharness/configs/builds/releng_sub_windows_configs/64_debug.py b/testing/mozharness/configs/builds/releng_sub_windows_configs/64_debug.py index 1fae3bcd580ed..37306dafa1aea 100644 --- a/testing/mozharness/configs/builds/releng_sub_windows_configs/64_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_windows_configs/64_debug.py @@ -9,10 +9,10 @@ 'checkout-sources', # 'setup-mock', windows do not use mock 'build', + 'generate-build-stats', 'upload-files', 'sendchange', 'check-test', - 'generate-build-stats', 'update', # decided by query_is_nightly() ], 'stage_platform': 'win64-debug', diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py index 56e42b4776dd0..e73a3246e46ed 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py @@ -19,8 +19,8 @@ 'default_actions': [ 'clone-tools', 'build', + 'generate-build-stats', 'check-test', - 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py index 75202e6c758db..6ec595b9f369f 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py @@ -19,8 +19,8 @@ 'default_actions': [ 'clone-tools', 'build', + 'generate-build-stats', 'check-test', - 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py index f972cc0ad0642..32f4f5258cb1a 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py @@ -19,8 +19,8 @@ 'default_actions': [ 'clone-tools', 'build', + 'generate-build-stats', 'check-test', - 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py index 31170b529057c..7c05722ff7e24 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py @@ -19,8 +19,8 @@ 'default_actions': [ 'clone-tools', 'build', + 'generate-build-stats', 'check-test', - 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py index ef262b4ea4626..d99785876d7bb 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py @@ -19,8 +19,8 @@ 'default_actions': [ 'clone-tools', 'build', + 'generate-build-stats', 'check-test', - 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py index d70f8174140d0..74c273126cb8d 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py @@ -20,8 +20,8 @@ 'default_actions': [ 'clone-tools', 'build', + 'generate-build-stats', 'check-test', - 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py index 4331df2dedbcc..d87ce623242ad 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py @@ -19,8 +19,8 @@ 'default_actions': [ 'clone-tools', 'build', + 'generate-build-stats', 'check-test', - 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py index e3358e339afb3..63549031f014d 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py @@ -19,8 +19,8 @@ 'default_actions': [ 'clone-tools', 'build', + 'generate-build-stats', 'check-test', - 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, diff --git a/testing/mozharness/scripts/fx_desktop_build.py b/testing/mozharness/scripts/fx_desktop_build.py index 75c23044169a8..617d963e0a572 100755 --- a/testing/mozharness/scripts/fx_desktop_build.py +++ b/testing/mozharness/scripts/fx_desktop_build.py @@ -39,6 +39,7 @@ def __init__(self): 'checkout-sources', 'setup-mock', 'build', + 'generate-build-stats', 'upload-files', # upload from BB to TC 'sendchange', 'check-test', @@ -46,7 +47,6 @@ def __init__(self): 'package-source', 'generate-source-signing-manifest', 'multi-l10n', - 'generate-build-stats', 'update', ], 'require_config_file': True, From fcfaefbb884b9e3cd57548fb5450186a430ac089 Mon Sep 17 00:00:00 2001 From: Shane Caraveo Date: Mon, 24 Apr 2017 13:59:36 -0700 Subject: [PATCH 09/36] Bug 1357723 fix intermittent failure of tab close, r=kmag,mattw MozReview-Commit-ID: 257gWUotCqE --HG-- extra : rebase_source : 98bb3df2caa7ee41fd170ef4fa51f9ab0ae49879 --- .../test/mochitest/file_WebRequest_page3.html | 3 -- .../mochitest/test_ext_webrequest_basic.html | 30 +++++++++++++++++++ .../mochitest/test_ext_webrequest_upload.html | 24 +++++++++++++-- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/toolkit/components/extensions/test/mochitest/file_WebRequest_page3.html b/toolkit/components/extensions/test/mochitest/file_WebRequest_page3.html index d33cc8ec801ce..24c7a4298641e 100644 --- a/toolkit/components/extensions/test/mochitest/file_WebRequest_page3.html +++ b/toolkit/components/extensions/test/mochitest/file_WebRequest_page3.html @@ -5,9 +5,6 @@ diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html index c6f246f084ff0..ec2a5a3103d1a 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html @@ -232,6 +232,30 @@ }); add_task(function* test_webRequest_tabId() { + function background() { + let tab; + browser.tabs.onCreated.addListener(newTab => { + tab = newTab; + }); + + browser.test.onMessage.addListener(msg => { + if (msg === "close-tab") { + browser.tabs.remove(tab.id); + browser.test.sendMessage("tab-closed"); + } + }); + } + + let tabExt = ExtensionTestUtils.loadExtension({ + manifest: { + permissions: [ + "tabs", + ], + }, + background, + }); + yield tabExt.startup(); + let expect = { "file_WebRequest_page3.html": { type: "main_frame", @@ -242,6 +266,12 @@ let a = addLink(`file_WebRequest_page3.html?trigger=a&nocache=${Math.random()}`); a.click(); yield extension.awaitMessage("done"); + + let closed = tabExt.awaitMessage("tab-closed"); + tabExt.sendMessage("close-tab"); + yield closed; + + yield tabExt.unload(); }); add_task(function* test_webRequest_tabId_browser() { diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html index 4b380582ff175..5dcdcfe1cadaa 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html @@ -111,12 +111,25 @@ browser.webRequest.onBeforeRequest.addListener( onBeforeRequest, FILTERS, ["requestBody"]); + + let tab; + browser.tabs.onCreated.addListener(newTab => { + tab = newTab; + }); + + browser.test.onMessage.addListener(msg => { + if (msg === "close-tab") { + browser.tabs.remove(tab.id); + browser.test.sendMessage("tab-closed"); + } + }); } add_task(function* test_xhr_forms() { let extension = ExtensionTestUtils.loadExtension({ manifest: { permissions: [ + "tabs", "webRequest", "webRequestBlocking", "", @@ -127,6 +140,13 @@ yield extension.startup(); + function* doneAndTabClosed() { + yield extension.awaitMessage("done"); + let closed = extension.awaitMessage("tab-closed"); + extension.sendMessage("close-tab"); + yield closed; + } + for (let form of document.forms) { if (file.name in form.elements) { SpecialPowers.wrap(form.elements[file.name]).mozSetFileArray(files); @@ -147,7 +167,7 @@ form.action = action; form.submit(); - yield extension.awaitMessage("done"); + yield doneAndTabClosed(); if (form.enctype !== "multipart/form-data") { continue; @@ -159,7 +179,7 @@ xhr.open("POST", action.href); xhr.send(data); action.searchParams.delete("xhr"); - return extension.awaitMessage("done"); + return doneAndTabClosed(); }; formData.append(blob.name, blob.content, blob.fileName); From 6f404897d1b1e543cc3f1a8d09614c41f1fcff40 Mon Sep 17 00:00:00 2001 From: Alexis Beingessner Date: Wed, 3 May 2017 12:44:37 -0500 Subject: [PATCH 10/36] servo: Merge #16652 - Update to webrender's new bincode IPC (from Gankro:bincode-ipc-5); r=jdm **DO NO MERGE YET** This is the required update to Servo for my changes to webrender in https://github.com/servo/webrender/pull/1181 Source-Repo: https://github.com/servo/servo Source-Revision: 74c36cb35ddac3bf7db9215d85b9d4d7a660197b --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 3f1a55f6dab59aa865e929b9fb36fb1572708bc1 --- servo/Cargo.lock | 5 ++-- servo/components/layout/webrender_helpers.rs | 31 ++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/servo/Cargo.lock b/servo/Cargo.lock index 9e00ee76e970f..8651eb4592849 100644 --- a/servo/Cargo.lock +++ b/servo/Cargo.lock @@ -3193,7 +3193,7 @@ dependencies = [ [[package]] name = "webrender" version = "0.36.0" -source = "git+https://github.com/servo/webrender#d126ebae1ad960f95791c747537c88181106173f" +source = "git+https://github.com/servo/webrender#964df2fa00f330daf4f233669e37133f93113792" dependencies = [ "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3222,9 +3222,10 @@ dependencies = [ [[package]] name = "webrender_traits" version = "0.36.0" -source = "git+https://github.com/servo/webrender#d126ebae1ad960f95791c747537c88181106173f" +source = "git+https://github.com/servo/webrender#964df2fa00f330daf4f233669e37133f93113792" dependencies = [ "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/servo/components/layout/webrender_helpers.rs b/servo/components/layout/webrender_helpers.rs index 70479d438379b..aceebd8a19d05 100644 --- a/servo/components/layout/webrender_helpers.rs +++ b/servo/components/layout/webrender_helpers.rs @@ -15,7 +15,8 @@ use msg::constellation_msg::PipelineId; use style::computed_values::{image_rendering, mix_blend_mode}; use style::computed_values::filter::{self, Filter}; use style::values::computed::BorderStyle; -use webrender_traits::{self, DisplayListBuilder, ExtendMode, LayoutTransform, ClipId}; +use webrender_traits::{self, DisplayListBuilder, ExtendMode}; +use webrender_traits::{LayoutTransform, ClipId, ClipRegionToken}; pub trait WebRenderDisplayListConverter { fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder; @@ -114,18 +115,18 @@ impl ToRectF for Rect { } trait ToClipRegion { - fn to_clip_region(&self, builder: &mut DisplayListBuilder) -> webrender_traits::ClipRegion; + fn push_clip_region(&self, builder: &mut DisplayListBuilder) -> ClipRegionToken; } impl ToClipRegion for ClippingRegion { - fn to_clip_region(&self, builder: &mut DisplayListBuilder) -> webrender_traits::ClipRegion { - builder.new_clip_region(&self.main.to_rectf(), + fn push_clip_region(&self, builder: &mut DisplayListBuilder) -> ClipRegionToken { + builder.push_clip_region(&self.main.to_rectf(), self.complex.iter().map(|complex_clipping_region| { webrender_traits::ComplexClipRegion::new( complex_clipping_region.rect.to_rectf(), complex_clipping_region.radii.to_border_radius(), ) - }).collect(), + }), None) } } @@ -241,7 +242,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { DisplayItem::SolidColor(ref item) => { let color = item.color; if color.a > 0.0 { - let clip = item.base.clip.to_clip_region(builder); + let clip = item.base.clip.push_clip_region(builder); builder.push_rect(item.base.bounds.to_rectf(), clip, color); } } @@ -272,7 +273,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { } if glyphs.len() > 0 { - let clip = item.base.clip.to_clip_region(builder); + let clip = item.base.clip.push_clip_region(builder); builder.push_text(item.base.bounds.to_rectf(), clip, &glyphs, @@ -287,7 +288,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { if let Some(id) = item.webrender_image.key { if item.stretch_size.width > Au(0) && item.stretch_size.height > Au(0) { - let clip = item.base.clip.to_clip_region(builder); + let clip = item.base.clip.push_clip_region(builder); builder.push_image(item.base.bounds.to_rectf(), clip, item.stretch_size.to_sizef(), @@ -298,13 +299,13 @@ impl WebRenderDisplayItemConverter for DisplayItem { } } DisplayItem::WebGL(ref item) => { - let clip = item.base.clip.to_clip_region(builder); + let clip = item.base.clip.push_clip_region(builder); builder.push_webgl_canvas(item.base.bounds.to_rectf(), clip, item.context_id); } DisplayItem::Border(ref item) => { let rect = item.base.bounds.to_rectf(); let widths = item.border_widths.to_border_widths(); - let clip = item.base.clip.to_clip_region(builder); + let clip = item.base.clip.push_clip_region(builder); let details = match item.details { BorderDetails::Normal(ref border) => { @@ -369,7 +370,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { let rect = item.base.bounds.to_rectf(); let start_point = item.gradient.start_point.to_pointf(); let end_point = item.gradient.end_point.to_pointf(); - let clip = item.base.clip.to_clip_region(builder); + let clip = item.base.clip.push_clip_region(builder); let extend_mode = if item.gradient.repeating { ExtendMode::Repeat } else { @@ -389,7 +390,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { let rect = item.base.bounds.to_rectf(); let center = item.gradient.center.to_pointf(); let radius = item.gradient.radius.to_sizef(); - let clip = item.base.clip.to_clip_region(builder); + let clip = item.base.clip.push_clip_region(builder); let extend_mode = if item.gradient.repeating { ExtendMode::Repeat } else { @@ -411,7 +412,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { DisplayItem::BoxShadow(ref item) => { let rect = item.base.bounds.to_rectf(); let box_bounds = item.box_bounds.to_rectf(); - let clip = item.base.clip.to_clip_region(builder); + let clip = item.base.clip.push_clip_region(builder); builder.push_box_shadow(rect, clip, box_bounds, @@ -425,7 +426,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { DisplayItem::Iframe(ref item) => { let rect = item.base.bounds.to_rectf(); let pipeline_id = item.iframe.to_webrender(); - let clip = item.base.clip.to_clip_region(builder); + let clip = item.base.clip.push_clip_region(builder); builder.push_iframe(rect, clip, pipeline_id); } DisplayItem::PushStackingContext(ref item) => { @@ -452,7 +453,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { builder.push_clip_id(item.scroll_root.parent_id); let our_id = item.scroll_root.id; - let clip = item.scroll_root.clip.to_clip_region(builder); + let clip = item.scroll_root.clip.push_clip_region(builder); let content_rect = item.scroll_root.content_rect.to_rectf(); let webrender_id = builder.define_clip(content_rect, clip, Some(our_id)); debug_assert!(our_id == webrender_id); From 94d0f5f35ff17b2a804751cf89794e8a216a63f5 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Wed, 3 May 2017 20:46:28 +0200 Subject: [PATCH 11/36] Backed out changeset 97a3a6e6550b (bug 1356448) for frequently failing xpcshell's test_ChildScalars.js and test_ChildHistograms.js on Windows 7 VM debug. r=backout --- modules/libpref/init/all.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 23a341bc12b44..a7ea3196e9a60 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4637,9 +4637,6 @@ pref("layers.bench.enabled", false); pref("layers.gpu-process.enabled", true); pref("layers.gpu-process.max_restarts", 3); pref("media.gpu-process-decoder", true); -#ifdef NIGHTLY_BUILD -pref("layers.gpu-process.allow-software", true); -#endif #endif // Whether to force acceleration on, ignoring blacklists. From 979e3ee0357fbd179e9a7f69d4bccc8d080de330 Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Mon, 1 May 2017 19:59:08 -0400 Subject: [PATCH 12/36] Bug 1359868 - Move the ComputePartialPrerenderArea() helper to nsLayoutUtils so it can be reused. r=mstange MozReview-Commit-ID: GVRBUfYwOFP --HG-- extra : rebase_source : 8e16daf7709cc107f21e3b8b0050df44e83089fb --- layout/base/nsLayoutUtils.cpp | 16 ++++++++++++++++ layout/base/nsLayoutUtils.h | 13 +++++++++++++ layout/painting/nsDisplayList.cpp | 15 +-------------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index efc1ca9bee7ef..ba9c11b23e44f 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -9190,6 +9190,22 @@ nsLayoutUtils::GetCumulativeApzCallbackTransform(nsIFrame* aFrame) return delta; } +/* static */ nsRect +nsLayoutUtils::ComputePartialPrerenderArea(const nsRect& aDirtyRect, + const nsRect& aOverflow, + const nsSize& aPrerenderSize) +{ + // Simple calculation for now: center the pre-render area on the dirty rect, + // and clamp to the overflow area. Later we can do more advanced things like + // redistributing from one axis to another, or from one side to another. + nscoord xExcess = aPrerenderSize.width - aDirtyRect.width; + nscoord yExcess = aPrerenderSize.height - aDirtyRect.height; + nsRect result = aDirtyRect; + result.Inflate(xExcess / 2, yExcess / 2); + return result.MoveInsideAndClamp(aOverflow); +} + + /* static */ bool nsLayoutUtils::SupportsServoStyleBackend(nsIDocument* aDocument) { diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 0659528b1c392..e5d65f0c78596 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -2875,6 +2875,19 @@ class nsLayoutUtils */ static CSSPoint GetCumulativeApzCallbackTransform(nsIFrame* aFrame); + /** + * Compute a rect to pre-render in cases where we want to render more of + * something than what is visible (usually to support async transformation). + * @param aDirtyRect the area that's visible + * @param aOverflow the total size of the thing we're rendering + * @param aPrerenderSize how large of an area we're willing to render + * @return A rectangle that includes |aDirtyRect|, is clamped to |aOverflow|, + * and is no larger than |aPrerenderSize|. + */ + static nsRect ComputePartialPrerenderArea(const nsRect& aDirtyRect, + const nsRect& aOverflow, + const nsSize& aPrerenderSize); + /* * Returns whether the given document supports being rendered with a * Servo-backed style system. This checks whether Stylo is enabled diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 9e89e000aae92..89c12f8b1ced2 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -7184,20 +7184,7 @@ bool nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) { return mAllowAsyncAnimation; -} -static nsRect ComputePartialPrerenderArea(const nsRect& aDirtyRect, - const nsRect& aOverflow, - const nsSize& aPrerenderSize) -{ - // Simple calculation for now: center the pre-render area on the dirty rect, - // and clamp to the overflow area. Later we can do more advanced things like - // redistributing from one axis to another, or from one side to another. - nscoord xExcess = aPrerenderSize.width - aDirtyRect.width; - nscoord yExcess = aPrerenderSize.height - aDirtyRect.height; - nsRect result = aDirtyRect; - result.Inflate(xExcess / 2, yExcess / 2); - return result.MoveInsideAndClamp(aOverflow); } /* static */ auto @@ -7247,7 +7234,7 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui *aDirtyRect = overflow; return FullPrerender; } else if (gfxPrefs::PartiallyPrerenderAnimatedContent()) { - *aDirtyRect = ComputePartialPrerenderArea(*aDirtyRect, overflow, maxSize); + *aDirtyRect = nsLayoutUtils::ComputePartialPrerenderArea(*aDirtyRect, overflow, maxSize); return PartialPrerender; } From 15114b529793bb0227773616da9c054384693c07 Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Mon, 1 May 2017 20:32:07 -0400 Subject: [PATCH 13/36] Bug 1359868 - Try to pre-render offscreen portions of scrollbar thumbs. r=mstange MozReview-Commit-ID: K3TPswpjh3O --HG-- extra : rebase_source : f71262bf0ce948511ecc53175790beb38a0f6ba5 --- layout/generic/nsGfxScrollFrame.cpp | 34 +++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 90c6284f00fa9..753831de30b44 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3093,13 +3093,33 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder, appendToTopFlags |= APPEND_SCROLLBAR_CONTAINER; } - // The display port doesn't necessarily include the scrollbars, so just - // include all of the scrollbars if we are in a RCD-RSF. We only do - // this for the root scrollframe of the root content document, which is - // zoomable, and where the scrollbar sizes are bounded by the widget. - nsRect dirty = mIsRoot && mOuter->PresContext()->IsRootContentDocument() - ? scrollParts[i]->GetVisualOverflowRectRelativeToParent() - : aDirtyRect; + // The display port doesn't necessarily include the scrollbars. + bool thumbGetsLayer = (scrollTargetId != FrameMetrics::NULL_SCROLL_ID); + bool isRcdRsf = mIsRoot && mOuter->PresContext()->IsRootContentDocument(); + nsRect dirty = aDirtyRect; + if (isRcdRsf || thumbGetsLayer) { + nsRect overflow = scrollParts[i]->GetVisualOverflowRectRelativeToParent(); + if (isRcdRsf) { + // For the root content document's root scroll frame (RCD-RSF), include + // all of the scrollbars. We only do this for the RCD-RSF, which is + // zoomable, and where the scrollbar sizes are bounded by the widget. + dirty = overflow; + } else { + // For subframes, we still try to prerender parts of the scrollbar that + // are not currently visible, because they might be brought into view + // by async scrolling, but we bound the area to render by the size of + // the root reference frame (because subframe scrollbars can be + // arbitrary large). + nsSize refSize = aBuilder->RootReferenceFrame()->GetSize(); + gfxSize scale = nsLayoutUtils::GetTransformToAncestorScale(mOuter); + if (scale.width != 0 && scale.height != 0) { + refSize.width /= scale.width; + refSize.height /= scale.height; + } + dirty = nsLayoutUtils::ComputePartialPrerenderArea(dirty, overflow, refSize); + } + } + nsDisplayListBuilder::AutoBuildingDisplayList buildingForChild(aBuilder, scrollParts[i], dirty + mOuter->GetOffsetTo(scrollParts[i]), true); From 9bb9ee4a8d33f20418a133f38ba5699e661d0b70 Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Thu, 27 Apr 2017 15:47:40 +0800 Subject: [PATCH 14/36] Bug 1299949 - Pre: rename ActivityStream UI to ActivityStreamPanel r=sebastian This will avoid conflicts with the ActivityStream helper class. MozReview-Commit-ID: 5XNmwz4UwJo --HG-- rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStream.java => mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamPanel.java extra : rebase_source : 23000ae152f776de874053c712fb6e1a4b1ab546 --- .../activitystream/ActivityStreamHomeFragment.java | 12 ++++++------ .../activitystream/ActivityStreamHomeScreen.java | 2 +- ...{ActivityStream.java => ActivityStreamPanel.java} | 4 ++-- mobile/android/base/moz.build | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) rename mobile/android/base/java/org/mozilla/gecko/home/activitystream/{ActivityStream.java => ActivityStreamPanel.java} (97%) diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeFragment.java b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeFragment.java index ac4a54eb401f6..1f07c0511a40d 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeFragment.java +++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeFragment.java @@ -20,25 +20,25 @@ */ public class ActivityStreamHomeFragment extends HomeFragment { - private ActivityStream activityStream; + private ActivityStreamPanel activityStreamPanel; private boolean isSessionActive; @Override protected void load() { - activityStream.load(getLoaderManager()); + activityStreamPanel.load(getLoaderManager()); } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { - if (activityStream == null) { - activityStream = (ActivityStream) inflater.inflate(R.layout.activity_stream, container, false); - activityStream.setOnUrlOpenListeners(mUrlOpenListener, mUrlOpenInBackgroundListener); + if (activityStreamPanel == null) { + activityStreamPanel = (ActivityStreamPanel) inflater.inflate(R.layout.activity_stream, container, false); + activityStreamPanel.setOnUrlOpenListeners(mUrlOpenListener, mUrlOpenInBackgroundListener); } - return activityStream; + return activityStreamPanel; } @Override diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeScreen.java b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeScreen.java index 4decc82180e33..0c1040e1ed1f4 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeScreen.java +++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeScreen.java @@ -19,7 +19,7 @@ * HomeScreen implementation that displays ActivityStream. */ public class ActivityStreamHomeScreen - extends ActivityStream + extends ActivityStreamPanel implements HomeScreen { private boolean visible = false; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStream.java b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamPanel.java similarity index 97% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStream.java rename to mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamPanel.java index 41b4599415267..877ba0a1915a9 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStream.java +++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamPanel.java @@ -28,7 +28,7 @@ import java.util.Collections; import java.util.List; -public class ActivityStream extends FrameLayout { +public class ActivityStreamPanel extends FrameLayout { private final StreamRecyclerAdapter adapter; private static final int LOADER_ID_HIGHLIGHTS = 0; @@ -51,7 +51,7 @@ public class ActivityStream extends FrameLayout { private int desiredTilesHeight; private int tileMargin; - public ActivityStream(Context context, AttributeSet attrs) { + public ActivityStreamPanel(Context context, AttributeSet attrs) { super(context, attrs); setBackgroundColor(ContextCompat.getColor(context, R.color.about_page_header_grey)); diff --git a/mobile/android/base/moz.build b/mobile/android/base/moz.build index 6f0c68d739146..8331dd317aa42 100644 --- a/mobile/android/base/moz.build +++ b/mobile/android/base/moz.build @@ -600,9 +600,9 @@ gbjar.sources += ['java/org/mozilla/gecko/' + x for x in [ 'health/HealthRecorder.java', 'health/SessionInformation.java', 'health/StubbedHealthRecorder.java', - 'home/activitystream/ActivityStream.java', 'home/activitystream/ActivityStreamHomeFragment.java', 'home/activitystream/ActivityStreamHomeScreen.java', + 'home/activitystream/ActivityStreamPanel.java', 'home/activitystream/HighlightsLoader.java', 'home/activitystream/menu/ActivityStreamContextMenu.java', 'home/activitystream/menu/BottomSheetContextMenu.java', From 245eb8de9b8ed87980a20f8c8a2f0be3bc621a8e Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Thu, 27 Apr 2017 15:54:06 +0800 Subject: [PATCH 15/36] Bug 1299949 - Move omg.home.activitystream into omg.activitystream.homepanel r=sebastian Parts of ActivityStream already live under omg.activitystream, lets move the UI code there too to make it easier to actually find AS code. MozReview-Commit-ID: 6Aa7AZ9cw5n --HG-- rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeFragment.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamHomeFragment.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeScreen.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamHomeScreen.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamPanel.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamPanel.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/HighlightsLoader.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/HighlightsLoader.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamItemAnimator.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamItemAnimator.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamRecyclerAdapter.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/ActivityStreamContextMenu.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/BottomSheetContextMenu.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/BottomSheetContextMenu.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/PopupContextMenu.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/PopupContextMenu.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Highlight.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Highlight.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Item.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Item.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Metadata.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Metadata.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/TopSite.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/TopSite.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/HighlightItem.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightItem.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/HighlightsTitle.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightsTitle.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/StreamItem.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/StreamItem.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/TopPanel.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanel.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/WelcomePanel.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/WelcomePanel.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/CirclePageIndicator.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesCard.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesCard.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPage.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPageAdapter.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPageAdapter.java rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPagerAdapter.java => mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPagerAdapter.java extra : rebase_source : 517272e4feb41af8c0aec08be8d1e1bbfed93e01 --- .../ActivityStreamTelemetry.java | 2 +- .../ActivityStreamHomeFragment.java | 2 +- .../homepanel}/ActivityStreamHomeScreen.java | 2 +- .../homepanel}/ActivityStreamPanel.java | 6 +-- .../homepanel}/HighlightsLoader.java | 4 +- .../homepanel}/StreamItemAnimator.java | 4 +- .../homepanel}/StreamRecyclerAdapter.java | 16 +++---- .../menu/ActivityStreamContextMenu.java | 4 +- .../menu/BottomSheetContextMenu.java | 6 +-- .../homepanel}/menu/PopupContextMenu.java | 4 +- .../homepanel}/model/Highlight.java | 2 +- .../homepanel}/model/Item.java | 2 +- .../homepanel}/model/Metadata.java | 2 +- .../homepanel}/model/TopSite.java | 2 +- .../homepanel}/stream/HighlightItem.java | 6 +-- .../homepanel}/stream/HighlightsTitle.java | 2 +- .../homepanel}/stream/StreamItem.java | 2 +- .../homepanel}/stream/TopPanel.java | 6 +-- .../homepanel}/stream/WelcomePanel.java | 2 +- .../topsites/CirclePageIndicator.java | 2 +- .../homepanel}/topsites/TopSitesCard.java | 7 ++- .../homepanel}/topsites/TopSitesPage.java | 6 +-- .../topsites/TopSitesPageAdapter.java | 4 +- .../topsites/TopSitesPagerAdapter.java | 2 +- .../ranking/HighlightCandidate.java | 4 +- .../ranking/HighlightsRanking.java | 3 +- .../org/mozilla/gecko/home/HomeAdapter.java | 2 +- mobile/android/base/moz.build | 46 +++++++++---------- .../base/resources/layout/activity_stream.xml | 10 ++-- .../layout/activity_stream_main_toppanel.xml | 2 +- .../layout/activity_stream_topsites_page.xml | 10 ++-- .../tests/testActivityStreamContextMenu.java | 8 ++-- 32 files changed, 85 insertions(+), 97 deletions(-) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/ActivityStreamHomeFragment.java (98%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/ActivityStreamHomeScreen.java (97%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/ActivityStreamPanel.java (96%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/HighlightsLoader.java (96%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/StreamItemAnimator.java (91%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/StreamRecyclerAdapter.java (92%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/menu/ActivityStreamContextMenu.java (99%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/menu/BottomSheetContextMenu.java (96%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/menu/PopupContextMenu.java (96%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/model/Highlight.java (98%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/model/Item.java (92%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/model/Metadata.java (97%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/model/TopSite.java (98%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/stream/HighlightItem.java (96%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/stream/HighlightsTitle.java (90%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/stream/StreamItem.java (89%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/stream/TopPanel.java (93%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/stream/WelcomePanel.java (97%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/topsites/CirclePageIndicator.java (99%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/topsites/TopSitesCard.java (95%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/topsites/TopSitesPage.java (87%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/topsites/TopSitesPageAdapter.java (97%) rename mobile/android/base/java/org/mozilla/gecko/{home/activitystream => activitystream/homepanel}/topsites/TopSitesPagerAdapter.java (98%) diff --git a/mobile/android/base/java/org/mozilla/gecko/activitystream/ActivityStreamTelemetry.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/ActivityStreamTelemetry.java index 949ce7b15d3fd..b95cf65679dec 100644 --- a/mobile/android/base/java/org/mozilla/gecko/activitystream/ActivityStreamTelemetry.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/ActivityStreamTelemetry.java @@ -12,7 +12,7 @@ import org.json.JSONObject; import org.mozilla.gecko.R; import org.mozilla.gecko.db.BrowserContract; -import org.mozilla.gecko.home.activitystream.model.TopSite; +import org.mozilla.gecko.activitystream.homepanel.model.TopSite; import java.util.HashMap; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeFragment.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamHomeFragment.java similarity index 98% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeFragment.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamHomeFragment.java index 1f07c0511a40d..e0a44cd7a3f20 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeFragment.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamHomeFragment.java @@ -2,7 +2,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream; +package org.mozilla.gecko.activitystream.homepanel; import android.os.Bundle; import android.support.annotation.Nullable; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeScreen.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamHomeScreen.java similarity index 97% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeScreen.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamHomeScreen.java index 0c1040e1ed1f4..df3a12e6bfad0 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamHomeScreen.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamHomeScreen.java @@ -2,7 +2,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream; +package org.mozilla.gecko.activitystream.homepanel; import android.content.Context; import android.os.Bundle; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamPanel.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamPanel.java similarity index 96% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamPanel.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamPanel.java index 877ba0a1915a9..9a7d3de4ab1f6 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/ActivityStreamPanel.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamPanel.java @@ -2,7 +2,7 @@ * 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/. */ - package org.mozilla.gecko.home.activitystream; + package org.mozilla.gecko.activitystream.homepanel; import android.content.Context; import android.content.res.Resources; @@ -21,8 +21,8 @@ import org.mozilla.gecko.db.BrowserDB; import org.mozilla.gecko.fxa.FirefoxAccounts; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.activitystream.model.Highlight; -import org.mozilla.gecko.home.activitystream.topsites.TopSitesPagerAdapter; +import org.mozilla.gecko.activitystream.homepanel.model.Highlight; +import org.mozilla.gecko.activitystream.homepanel.topsites.TopSitesPagerAdapter; import org.mozilla.gecko.widget.RecyclerViewClickSupport; import java.util.Collections; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/HighlightsLoader.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/HighlightsLoader.java similarity index 96% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/HighlightsLoader.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/HighlightsLoader.java index bc7cf4b17e815..64a7c2f85aa4e 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/HighlightsLoader.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/HighlightsLoader.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream; +package org.mozilla.gecko.activitystream.homepanel; import android.content.Context; import android.database.ContentObserver; @@ -15,7 +15,7 @@ import org.mozilla.gecko.activitystream.ranking.HighlightsRanking; import org.mozilla.gecko.db.BrowserContract; import org.mozilla.gecko.db.BrowserDB; -import org.mozilla.gecko.home.activitystream.model.Highlight; +import org.mozilla.gecko.activitystream.homepanel.model.Highlight; import java.util.Collections; import java.util.List; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamItemAnimator.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamItemAnimator.java similarity index 91% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamItemAnimator.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamItemAnimator.java index b17563cd8be93..adb7fc55b833e 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamItemAnimator.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamItemAnimator.java @@ -2,13 +2,13 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream; +package org.mozilla.gecko.activitystream.homepanel; import android.support.annotation.NonNull; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.RecyclerView; -import org.mozilla.gecko.home.activitystream.stream.TopPanel; +import org.mozilla.gecko.activitystream.homepanel.stream.TopPanel; /** * We need our own item animator override to avoid default RV-style animations for certain panels. diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamRecyclerAdapter.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java similarity index 92% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamRecyclerAdapter.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java index 7de6b9c82b742..d4844c6c523d5 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamRecyclerAdapter.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream; +package org.mozilla.gecko.activitystream.homepanel; import android.database.Cursor; import android.support.v7.widget.RecyclerView; @@ -14,15 +14,13 @@ import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.TelemetryContract; import org.mozilla.gecko.activitystream.ActivityStreamTelemetry; -import org.mozilla.gecko.activitystream.Utils; -import org.mozilla.gecko.db.BrowserContract; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.activitystream.model.Highlight; -import org.mozilla.gecko.home.activitystream.stream.HighlightItem; -import org.mozilla.gecko.home.activitystream.stream.HighlightsTitle; -import org.mozilla.gecko.home.activitystream.stream.StreamItem; -import org.mozilla.gecko.home.activitystream.stream.TopPanel; -import org.mozilla.gecko.home.activitystream.stream.WelcomePanel; +import org.mozilla.gecko.activitystream.homepanel.model.Highlight; +import org.mozilla.gecko.activitystream.homepanel.stream.HighlightItem; +import org.mozilla.gecko.activitystream.homepanel.stream.HighlightsTitle; +import org.mozilla.gecko.activitystream.homepanel.stream.StreamItem; +import org.mozilla.gecko.activitystream.homepanel.stream.TopPanel; +import org.mozilla.gecko.activitystream.homepanel.stream.WelcomePanel; import org.mozilla.gecko.widget.RecyclerViewClickSupport; import java.util.Collections; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/ActivityStreamContextMenu.java similarity index 99% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/ActivityStreamContextMenu.java index 7d34c89abba8b..4cb877d49a356 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/ActivityStreamContextMenu.java @@ -2,7 +2,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.menu; +package org.mozilla.gecko.activitystream.homepanel.menu; import android.content.Context; import android.content.Intent; @@ -20,7 +20,7 @@ import org.mozilla.gecko.annotation.RobocopTarget; import org.mozilla.gecko.db.BrowserDB; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.activitystream.model.Item; +import org.mozilla.gecko.activitystream.homepanel.model.Item; import org.mozilla.gecko.reader.SavedReaderViewHelper; import org.mozilla.gecko.util.Clipboard; import org.mozilla.gecko.util.HardwareUtils; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/BottomSheetContextMenu.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/BottomSheetContextMenu.java similarity index 96% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/BottomSheetContextMenu.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/BottomSheetContextMenu.java index 38dfe89419786..03fe9f71688ed 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/BottomSheetContextMenu.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/BottomSheetContextMenu.java @@ -2,12 +2,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/. */ -package org.mozilla.gecko.home.activitystream.menu; +package org.mozilla.gecko.activitystream.homepanel.menu; import android.app.Activity; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.support.design.widget.BottomSheetBehavior; import android.support.design.widget.BottomSheetDialog; import android.support.design.widget.NavigationView; @@ -21,7 +19,7 @@ import org.mozilla.gecko.activitystream.ActivityStream; import org.mozilla.gecko.activitystream.ActivityStreamTelemetry; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.activitystream.model.Item; +import org.mozilla.gecko.activitystream.homepanel.model.Item; import org.mozilla.gecko.icons.IconCallback; import org.mozilla.gecko.icons.IconResponse; import org.mozilla.gecko.icons.Icons; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/PopupContextMenu.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/PopupContextMenu.java similarity index 96% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/PopupContextMenu.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/PopupContextMenu.java index a76aa2a86de3b..df1443230da8b 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/PopupContextMenu.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/PopupContextMenu.java @@ -2,7 +2,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.menu; +package org.mozilla.gecko.activitystream.homepanel.menu; import android.content.Context; import android.graphics.Color; @@ -18,7 +18,7 @@ import org.mozilla.gecko.R; import org.mozilla.gecko.activitystream.ActivityStreamTelemetry; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.activitystream.model.Item; +import org.mozilla.gecko.activitystream.homepanel.model.Item; /* package-private */ class PopupContextMenu extends ActivityStreamContextMenu { diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Highlight.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Highlight.java similarity index 98% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Highlight.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Highlight.java index 3ce8c90e27681..788e9854d0baf 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Highlight.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Highlight.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.model; +package org.mozilla.gecko.activitystream.homepanel.model; import android.database.Cursor; import android.support.annotation.Nullable; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Item.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Item.java similarity index 92% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Item.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Item.java index a11c0fdcf88d7..6a58417e14051 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Item.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Item.java @@ -1,4 +1,4 @@ -package org.mozilla.gecko.home.activitystream.model; +package org.mozilla.gecko.activitystream.homepanel.model; import android.support.annotation.Nullable; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Metadata.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Metadata.java similarity index 97% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Metadata.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Metadata.java index 52982c88edeb4..ef7ad7770b0cf 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/Metadata.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/Metadata.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.model; +package org.mozilla.gecko.activitystream.homepanel.model; import android.database.Cursor; import android.text.TextUtils; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/TopSite.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/TopSite.java similarity index 98% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/TopSite.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/TopSite.java index 5ca2ca52ad624..352545ab802e6 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/model/TopSite.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/TopSite.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.model; +package org.mozilla.gecko.activitystream.homepanel.model; import android.database.Cursor; import android.support.annotation.Nullable; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/HighlightItem.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightItem.java similarity index 96% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/HighlightItem.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightItem.java index c88cca79a6b82..bd02d72a1d894 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/HighlightItem.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightItem.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.stream; +package org.mozilla.gecko.activitystream.homepanel.stream; import android.graphics.Color; import android.text.TextUtils; @@ -19,8 +19,8 @@ import org.mozilla.gecko.activitystream.ActivityStreamTelemetry; import org.mozilla.gecko.activitystream.Utils; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu; -import org.mozilla.gecko.home.activitystream.model.Highlight; +import org.mozilla.gecko.activitystream.homepanel.menu.ActivityStreamContextMenu; +import org.mozilla.gecko.activitystream.homepanel.model.Highlight; import org.mozilla.gecko.icons.IconCallback; import org.mozilla.gecko.icons.IconResponse; import org.mozilla.gecko.icons.Icons; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/HighlightsTitle.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightsTitle.java similarity index 90% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/HighlightsTitle.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightsTitle.java index 65c031f351308..b8001c5f7f2f9 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/HighlightsTitle.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightsTitle.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.stream; +package org.mozilla.gecko.activitystream.homepanel.stream; import android.view.View; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/StreamItem.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/StreamItem.java similarity index 89% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/StreamItem.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/StreamItem.java index e83c8e3368dcb..a68e2657fcb11 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/StreamItem.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/StreamItem.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.stream; +package org.mozilla.gecko.activitystream.homepanel.stream; import android.support.v7.widget.RecyclerView; import android.view.View; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/TopPanel.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanel.java similarity index 93% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/TopPanel.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanel.java index 6577a1984651d..cef674a03f266 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/TopPanel.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanel.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.stream; +package org.mozilla.gecko.activitystream.homepanel.stream; import android.content.res.Resources; import android.database.Cursor; @@ -15,8 +15,8 @@ import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.TelemetryContract; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.activitystream.topsites.CirclePageIndicator; -import org.mozilla.gecko.home.activitystream.topsites.TopSitesPagerAdapter; +import org.mozilla.gecko.activitystream.homepanel.topsites.CirclePageIndicator; +import org.mozilla.gecko.activitystream.homepanel.topsites.TopSitesPagerAdapter; public class TopPanel extends StreamItem { public static final int LAYOUT_ID = R.layout.activity_stream_main_toppanel; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/WelcomePanel.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/WelcomePanel.java similarity index 97% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/WelcomePanel.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/WelcomePanel.java index 6aaeb0f7353c9..74acddb42af2f 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/stream/WelcomePanel.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/WelcomePanel.java @@ -3,7 +3,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.stream; +package org.mozilla.gecko.activitystream.homepanel.stream; import android.content.Context; import android.content.SharedPreferences; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/CirclePageIndicator.java similarity index 99% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/CirclePageIndicator.java index 50300ff02a684..ad1141d5aecc3 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/CirclePageIndicator.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.mozilla.gecko.home.activitystream.topsites; +package org.mozilla.gecko.activitystream.homepanel.topsites; import android.content.Context; import android.content.res.Resources; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesCard.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesCard.java similarity index 95% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesCard.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesCard.java index 83c4f4ddb9eca..39041fb52655c 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesCard.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesCard.java @@ -2,10 +2,9 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.topsites; +package org.mozilla.gecko.activitystream.homepanel.topsites; import android.graphics.Color; -import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.support.v4.widget.TextViewCompat; import android.support.v7.widget.RecyclerView; @@ -20,8 +19,8 @@ import org.mozilla.gecko.activitystream.ActivityStream; import org.mozilla.gecko.activitystream.ActivityStreamTelemetry; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu; -import org.mozilla.gecko.home.activitystream.model.TopSite; +import org.mozilla.gecko.activitystream.homepanel.menu.ActivityStreamContextMenu; +import org.mozilla.gecko.activitystream.homepanel.model.TopSite; import org.mozilla.gecko.icons.IconCallback; import org.mozilla.gecko.icons.IconResponse; import org.mozilla.gecko.icons.Icons; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPage.java similarity index 87% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPage.java index 45fdc0d1a2e86..4f53f9d2f351a 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPage.java @@ -2,19 +2,15 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.topsites; +package org.mozilla.gecko.activitystream.homepanel.topsites; import android.content.Context; import android.support.annotation.Nullable; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; -import android.view.View; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.widget.RecyclerViewClickSupport; - -import java.util.EnumSet; public class TopSitesPage extends RecyclerView { diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPageAdapter.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPageAdapter.java similarity index 97% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPageAdapter.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPageAdapter.java index 96a099ff9c08d..91931cc100a04 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPageAdapter.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPageAdapter.java @@ -2,7 +2,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.topsites; +package org.mozilla.gecko.activitystream.homepanel.topsites; import android.content.Context; import android.database.Cursor; @@ -18,7 +18,7 @@ import org.mozilla.gecko.TelemetryContract; import org.mozilla.gecko.activitystream.ActivityStreamTelemetry; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.activitystream.model.TopSite; +import org.mozilla.gecko.activitystream.homepanel.model.TopSite; import org.mozilla.gecko.widget.RecyclerViewClickSupport; import java.util.ArrayList; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPagerAdapter.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPagerAdapter.java similarity index 98% rename from mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPagerAdapter.java rename to mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPagerAdapter.java index 5f7022ff452db..9245e11e3a237 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPagerAdapter.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPagerAdapter.java @@ -2,7 +2,7 @@ * 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/. */ -package org.mozilla.gecko.home.activitystream.topsites; +package org.mozilla.gecko.activitystream.homepanel.topsites; import android.content.Context; import android.database.Cursor; diff --git a/mobile/android/base/java/org/mozilla/gecko/activitystream/ranking/HighlightCandidate.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/ranking/HighlightCandidate.java index a2c98895b4ae4..4d740a418eed6 100644 --- a/mobile/android/base/java/org/mozilla/gecko/activitystream/ranking/HighlightCandidate.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/ranking/HighlightCandidate.java @@ -13,13 +13,11 @@ import org.mozilla.gecko.activitystream.ranking.RankingUtils.Func1; import org.mozilla.gecko.db.BrowserContract; -import org.mozilla.gecko.home.activitystream.model.Highlight; +import org.mozilla.gecko.activitystream.homepanel.model.Highlight; import java.util.HashMap; import java.util.Map; -import static org.mozilla.gecko.activitystream.ranking.RankingUtils.normalize; - /** * A highlight candidate (Highlight object + features). Ranking will determine whether this is an * actual highlight. diff --git a/mobile/android/base/java/org/mozilla/gecko/activitystream/ranking/HighlightsRanking.java b/mobile/android/base/java/org/mozilla/gecko/activitystream/ranking/HighlightsRanking.java index f9d3c78f5178f..52fc78e962ec9 100644 --- a/mobile/android/base/java/org/mozilla/gecko/activitystream/ranking/HighlightsRanking.java +++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/ranking/HighlightsRanking.java @@ -7,9 +7,8 @@ import android.database.Cursor; import android.support.annotation.VisibleForTesting; -import android.util.Log; -import org.mozilla.gecko.home.activitystream.model.Highlight; +import org.mozilla.gecko.activitystream.homepanel.model.Highlight; import java.util.Arrays; import java.util.Comparator; diff --git a/mobile/android/base/java/org/mozilla/gecko/home/HomeAdapter.java b/mobile/android/base/java/org/mozilla/gecko/home/HomeAdapter.java index a76d30510f48a..cc5ec12096adf 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/HomeAdapter.java +++ b/mobile/android/base/java/org/mozilla/gecko/home/HomeAdapter.java @@ -8,7 +8,7 @@ import org.mozilla.gecko.activitystream.ActivityStream; import org.mozilla.gecko.home.HomeConfig.PanelConfig; import org.mozilla.gecko.home.HomeConfig.PanelType; -import org.mozilla.gecko.home.activitystream.ActivityStreamHomeFragment; +import org.mozilla.gecko.activitystream.homepanel.ActivityStreamHomeFragment; import android.content.Context; import android.os.Bundle; diff --git a/mobile/android/base/moz.build b/mobile/android/base/moz.build index 8331dd317aa42..004b13ff06b05 100644 --- a/mobile/android/base/moz.build +++ b/mobile/android/base/moz.build @@ -466,6 +466,29 @@ gbjar.sources += ['java/org/mozilla/gecko/' + x for x in [ 'activitystream/ActivityStream.java', 'activitystream/ActivityStreamPreference.java', 'activitystream/ActivityStreamTelemetry.java', + 'activitystream/homepanel/ActivityStreamHomeFragment.java', + 'activitystream/homepanel/ActivityStreamHomeScreen.java', + 'activitystream/homepanel/ActivityStreamPanel.java', + 'activitystream/homepanel/HighlightsLoader.java', + 'activitystream/homepanel/menu/ActivityStreamContextMenu.java', + 'activitystream/homepanel/menu/BottomSheetContextMenu.java', + 'activitystream/homepanel/menu/PopupContextMenu.java', + 'activitystream/homepanel/model/Highlight.java', + 'activitystream/homepanel/model/Item.java', + 'activitystream/homepanel/model/Metadata.java', + 'activitystream/homepanel/model/TopSite.java', + 'activitystream/homepanel/stream/HighlightItem.java', + 'activitystream/homepanel/stream/HighlightsTitle.java', + 'activitystream/homepanel/stream/StreamItem.java', + 'activitystream/homepanel/stream/TopPanel.java', + 'activitystream/homepanel/stream/WelcomePanel.java', + 'activitystream/homepanel/StreamItemAnimator.java', + 'activitystream/homepanel/StreamRecyclerAdapter.java', + 'activitystream/homepanel/topsites/CirclePageIndicator.java', + 'activitystream/homepanel/topsites/TopSitesCard.java', + 'activitystream/homepanel/topsites/TopSitesPage.java', + 'activitystream/homepanel/topsites/TopSitesPageAdapter.java', + 'activitystream/homepanel/topsites/TopSitesPagerAdapter.java', 'activitystream/ranking/HighlightCandidate.java', 'activitystream/ranking/HighlightsRanking.java', 'activitystream/ranking/RankingUtils.java', @@ -600,29 +623,6 @@ gbjar.sources += ['java/org/mozilla/gecko/' + x for x in [ 'health/HealthRecorder.java', 'health/SessionInformation.java', 'health/StubbedHealthRecorder.java', - 'home/activitystream/ActivityStreamHomeFragment.java', - 'home/activitystream/ActivityStreamHomeScreen.java', - 'home/activitystream/ActivityStreamPanel.java', - 'home/activitystream/HighlightsLoader.java', - 'home/activitystream/menu/ActivityStreamContextMenu.java', - 'home/activitystream/menu/BottomSheetContextMenu.java', - 'home/activitystream/menu/PopupContextMenu.java', - 'home/activitystream/model/Highlight.java', - 'home/activitystream/model/Item.java', - 'home/activitystream/model/Metadata.java', - 'home/activitystream/model/TopSite.java', - 'home/activitystream/stream/HighlightItem.java', - 'home/activitystream/stream/HighlightsTitle.java', - 'home/activitystream/stream/StreamItem.java', - 'home/activitystream/stream/TopPanel.java', - 'home/activitystream/stream/WelcomePanel.java', - 'home/activitystream/StreamItemAnimator.java', - 'home/activitystream/StreamRecyclerAdapter.java', - 'home/activitystream/topsites/CirclePageIndicator.java', - 'home/activitystream/topsites/TopSitesCard.java', - 'home/activitystream/topsites/TopSitesPage.java', - 'home/activitystream/topsites/TopSitesPageAdapter.java', - 'home/activitystream/topsites/TopSitesPagerAdapter.java', 'home/BookmarkFolderView.java', 'home/BookmarkScreenshotRow.java', 'home/BookmarksListAdapter.java', diff --git a/mobile/android/base/resources/layout/activity_stream.xml b/mobile/android/base/resources/layout/activity_stream.xml index b40c01cdeefae..60b415a85b642 100644 --- a/mobile/android/base/resources/layout/activity_stream.xml +++ b/mobile/android/base/resources/layout/activity_stream.xml @@ -1,6 +1,6 @@ - + diff --git a/mobile/android/base/resources/layout/activity_stream_main_toppanel.xml b/mobile/android/base/resources/layout/activity_stream_main_toppanel.xml index bb2e1870a72ea..3e17fe06d3311 100644 --- a/mobile/android/base/resources/layout/activity_stream_main_toppanel.xml +++ b/mobile/android/base/resources/layout/activity_stream_main_toppanel.xml @@ -13,7 +13,7 @@ android:id="@+id/topsites_pager" android:contentDescription="@string/activity_stream_topsites" /> - - + diff --git a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testActivityStreamContextMenu.java b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testActivityStreamContextMenu.java index 373cb7c932d8c..63fdcf5fc7fa6 100644 --- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testActivityStreamContextMenu.java +++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testActivityStreamContextMenu.java @@ -20,10 +20,10 @@ import org.mozilla.gecko.db.BrowserContract; import org.mozilla.gecko.db.BrowserDB; import org.mozilla.gecko.db.DBUtils; -import org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu; -import org.mozilla.gecko.home.activitystream.model.Highlight; -import org.mozilla.gecko.home.activitystream.model.Item; -import org.mozilla.gecko.home.activitystream.model.TopSite; +import org.mozilla.gecko.activitystream.homepanel.menu.ActivityStreamContextMenu; +import org.mozilla.gecko.activitystream.homepanel.model.Highlight; +import org.mozilla.gecko.activitystream.homepanel.model.Item; +import org.mozilla.gecko.activitystream.homepanel.model.TopSite; /** * This test is unfortunately closely coupled to the current implementation, however it is still From 963e44f5efb14ff30b3d0b7ce9bbfd37c4dcbd33 Mon Sep 17 00:00:00 2001 From: Edouard Oger Date: Fri, 7 Apr 2017 15:57:43 -0400 Subject: [PATCH 16/36] Bug 1353571 part 1 - Remove pref identity.fxaccounts.profile_image.enabled. r=markh MozReview-Commit-ID: 4iy2S1kYUEh --HG-- extra : rebase_source : 7e221ec8844a822b0983c1d0785c9fa8a25e830b --- browser/app/profile/firefox.js | 3 -- browser/base/content/browser-fxaccounts.js | 44 +++++++------------ .../preferences/in-content-old/sync.js | 14 +----- .../preferences/in-content-old/sync.xul | 2 +- .../components/preferences/in-content/sync.js | 14 +----- .../preferences/in-content/sync.xul | 2 +- .../shared/customizableui/panelUI.inc.css | 14 ++---- 7 files changed, 25 insertions(+), 68 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 03d95d94096b8..14ef288e139bd 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1384,9 +1384,6 @@ pref("identity.fxaccounts.remote.profile.uri", "https://profile.accounts.firefox // The remote URL of the FxA OAuth Server pref("identity.fxaccounts.remote.oauth.uri", "https://oauth.accounts.firefox.com/v1"); -// Whether we display profile images in the UI or not. -pref("identity.fxaccounts.profile_image.enabled", true); - // Token server used by the FxA Sync identity. pref("identity.sync.tokenserver.uri", "https://token.services.mozilla.com/1.0/sync/1.5"); diff --git a/browser/base/content/browser-fxaccounts.js b/browser/base/content/browser-fxaccounts.js index d9141b730a90e..b6d66c36d6220 100644 --- a/browser/base/content/browser-fxaccounts.js +++ b/browser/base/content/browser-fxaccounts.js @@ -154,8 +154,6 @@ var gFxAccounts = { // Note that updateUI() returns a Promise that's only used by tests. updateUI() { - let profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled", false); - this.panelUIFooter.hidden = false; // Make sure the button is disabled in customization mode. @@ -187,7 +185,6 @@ var gFxAccounts = { this.panelUILabel.setAttribute("label", defaultLabel); this.panelUIStatus.setAttribute("tooltiptext", defaultTooltiptext); this.panelUIFooter.removeAttribute("fxastatus"); - this.panelUIFooter.removeAttribute("fxaprofileimage"); this.panelUIAvatar.style.removeProperty("list-style-image"); let showErrorBadge = false; if (userData) { @@ -209,9 +206,6 @@ var gFxAccounts = { this.panelUIFooter.setAttribute("fxastatus", "signedin"); this.panelUILabel.setAttribute("label", userData.email); } - if (profileInfoEnabled) { - this.panelUIFooter.setAttribute("fxaprofileimage", "enabled"); - } } if (showErrorBadge) { PanelUI.showBadgeOnlyNotification("fxa-needs-authentication"); @@ -221,26 +215,22 @@ var gFxAccounts = { } let updateWithProfile = (profile) => { - if (profileInfoEnabled) { - if (profile.displayName) { - this.panelUILabel.setAttribute("label", profile.displayName); - } - if (profile.avatar) { - this.panelUIFooter.setAttribute("fxaprofileimage", "set"); - let bgImage = "url(\"" + profile.avatar + "\")"; - this.panelUIAvatar.style.listStyleImage = bgImage; - - let img = new Image(); - img.onerror = () => { - // Clear the image if it has trouble loading. Since this callback is asynchronous - // we check to make sure the image is still the same before we clear it. - if (this.panelUIAvatar.style.listStyleImage === bgImage) { - this.panelUIFooter.removeAttribute("fxaprofileimage"); - this.panelUIAvatar.style.removeProperty("list-style-image"); - } - }; - img.src = profile.avatar; - } + if (profile.displayName) { + this.panelUILabel.setAttribute("label", profile.displayName); + } + if (profile.avatar) { + let bgImage = "url(\"" + profile.avatar + "\")"; + this.panelUIAvatar.style.listStyleImage = bgImage; + + let img = new Image(); + img.onerror = () => { + // Clear the image if it has trouble loading. Since this callback is asynchronous + // we check to make sure the image is still the same before we clear it. + if (this.panelUIAvatar.style.listStyleImage === bgImage) { + this.panelUIAvatar.style.removeProperty("list-style-image"); + } + }; + img.src = profile.avatar; } } @@ -249,7 +239,7 @@ var gFxAccounts = { updateWithUserData(userData); // unverified users cause us to spew log errors fetching an OAuth token // to fetch the profile, so don't even try in that case. - if (!userData || !userData.verified || !profileInfoEnabled) { + if (!userData || !userData.verified) { return null; // don't even try to grab the profile. } if (this._cachedProfile) { diff --git a/browser/components/preferences/in-content-old/sync.js b/browser/components/preferences/in-content-old/sync.js index a836b798a7ed8..280f710ac80eb 100644 --- a/browser/components/preferences/in-content-old/sync.js +++ b/browser/components/preferences/in-content-old/sync.js @@ -129,8 +129,6 @@ var gSyncPane = { }); this.updateWeavePrefs(); - - this._initProfileImageUI(); }, _toggleComputerNameControls(editMode) { @@ -225,14 +223,6 @@ var gSyncPane = { }); }, - _initProfileImageUI() { - try { - if (Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled")) { - document.getElementById("fxaProfileImage").hidden = false; - } - } catch (e) { } - }, - updateWeavePrefs() { let service = Components.classes["@mozilla.org/weave/service;1"] .getService(Components.interfaces.nsISupports) @@ -243,8 +233,6 @@ var gSyncPane = { fxaEmailAddress1Label.hidden = false; displayNameLabel.hidden = true; - let profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled", false); - // determine the fxa status... this._showLoadPage(service); @@ -300,7 +288,7 @@ var gSyncPane = { return null; }).then(data => { let fxaLoginStatus = document.getElementById("fxaLoginStatus"); - if (data && profileInfoEnabled) { + if (data) { if (data.displayName) { fxaLoginStatus.setAttribute("hasName", true); displayNameLabel.hidden = false; diff --git a/browser/components/preferences/in-content-old/sync.xul b/browser/components/preferences/in-content-old/sync.xul index 5a6ce6d8e999d..ad11fee817d4e 100755 --- a/browser/components/preferences/in-content-old/sync.xul +++ b/browser/components/preferences/in-content-old/sync.xul @@ -88,7 +88,7 @@ diff --git a/browser/components/preferences/in-content/sync.js b/browser/components/preferences/in-content/sync.js index a836b798a7ed8..280f710ac80eb 100644 --- a/browser/components/preferences/in-content/sync.js +++ b/browser/components/preferences/in-content/sync.js @@ -129,8 +129,6 @@ var gSyncPane = { }); this.updateWeavePrefs(); - - this._initProfileImageUI(); }, _toggleComputerNameControls(editMode) { @@ -225,14 +223,6 @@ var gSyncPane = { }); }, - _initProfileImageUI() { - try { - if (Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled")) { - document.getElementById("fxaProfileImage").hidden = false; - } - } catch (e) { } - }, - updateWeavePrefs() { let service = Components.classes["@mozilla.org/weave/service;1"] .getService(Components.interfaces.nsISupports) @@ -243,8 +233,6 @@ var gSyncPane = { fxaEmailAddress1Label.hidden = false; displayNameLabel.hidden = true; - let profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled", false); - // determine the fxa status... this._showLoadPage(service); @@ -300,7 +288,7 @@ var gSyncPane = { return null; }).then(data => { let fxaLoginStatus = document.getElementById("fxaLoginStatus"); - if (data && profileInfoEnabled) { + if (data) { if (data.displayName) { fxaLoginStatus.setAttribute("hasName", true); displayNameLabel.hidden = false; diff --git a/browser/components/preferences/in-content/sync.xul b/browser/components/preferences/in-content/sync.xul index 0b81e5c46f8fe..5ce88b1cceff1 100755 --- a/browser/components/preferences/in-content/sync.xul +++ b/browser/components/preferences/in-content/sync.xul @@ -87,7 +87,7 @@ diff --git a/browser/themes/shared/customizableui/panelUI.inc.css b/browser/themes/shared/customizableui/panelUI.inc.css index 499bfbef107c3..093287fb3f8f8 100644 --- a/browser/themes/shared/customizableui/panelUI.inc.css +++ b/browser/themes/shared/customizableui/panelUI.inc.css @@ -571,8 +571,7 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { } #PanelUI-footer-fxa:not([fxastatus="signedin"]) > toolbarseparator, -#PanelUI-footer-fxa:not([fxastatus="signedin"]) > #PanelUI-fxa-icon, -#PanelUI-footer-fxa:not([fxaprofileimage]) > #PanelUI-fxa-status > #PanelUI-fxa-avatar { +#PanelUI-footer-fxa:not([fxastatus="signedin"]) > #PanelUI-fxa-icon { display: none; } @@ -725,8 +724,7 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { border-inline-start-style: none; } -#PanelUI-footer-fxa[fxaprofileimage="set"] > #PanelUI-fxa-status > #PanelUI-fxa-label, -#PanelUI-footer-fxa[fxaprofileimage="enabled"]:not([fxastatus="error"]) > #PanelUI-fxa-status > #PanelUI-fxa-label { +#PanelUI-footer-fxa[fxastatus="signedin"] > #PanelUI-fxa-status > #PanelUI-fxa-label { padding-inline-start: 0px; } @@ -887,11 +885,7 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { } #PanelUI-footer-fxa[fxastatus="signedin"] > #PanelUI-fxa-status > #PanelUI-fxa-label > .toolbarbutton-icon, -#PanelUI-footer-fxa[fxastatus="error"][fxaprofileimage="set"] > #PanelUI-fxa-status > #PanelUI-fxa-label > .toolbarbutton-icon { - display: none; -} - -#PanelUI-footer-fxa[fxastatus="error"]:not([fxaprofileimage="set"]) > #PanelUI-fxa-status > #PanelUI-fxa-avatar { +#PanelUI-footer-fxa:not([fxastatus="signedin"]) > #PanelUI-fxa-status > #PanelUI-fxa-avatar { display: none; } @@ -914,7 +908,7 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { margin-inline-end: 0; } -#PanelUI-footer-fxa[fxaprofileimage="enabled"] > #PanelUI-fxa-status > #PanelUI-fxa-avatar { +#PanelUI-footer-fxa > #PanelUI-fxa-status > #PanelUI-fxa-avatar { list-style-image: url(chrome://browser/skin/fxa/default-avatar.svg); } From aaae43483306fc9301ffc8d6e9787894928dc497 Mon Sep 17 00:00:00 2001 From: Edouard Oger Date: Fri, 14 Apr 2017 17:59:59 -0700 Subject: [PATCH 17/36] Bug 1353571 part 2 - Remove unused customization mode code for the FxA status bar. r=markh MozReview-Commit-ID: J7Nz93MG7yh --HG-- extra : rebase_source : 5a35ff4c90115c12f9ea2eae09e43fe3f86c2c5d --- browser/base/content/browser-fxaccounts.js | 22 ------------- .../shared/customizableui/panelUI.inc.css | 31 +++++++------------ 2 files changed, 11 insertions(+), 42 deletions(-) diff --git a/browser/base/content/browser-fxaccounts.js b/browser/base/content/browser-fxaccounts.js index b6d66c36d6220..a5320d97bbb7f 100644 --- a/browser/base/content/browser-fxaccounts.js +++ b/browser/base/content/browser-fxaccounts.js @@ -5,7 +5,6 @@ var gFxAccounts = { _initialized: false, - _inCustomizationMode: false, _cachedProfile: null, get weave() { @@ -115,9 +114,6 @@ var gFxAccounts = { Services.obs.addObserver(this, topic); } - gNavToolbox.addEventListener("customizationstarting", this); - gNavToolbox.addEventListener("customizationending", this); - EnsureFxAccountsWebChannel(); this._initialized = true; @@ -147,28 +143,10 @@ var gFxAccounts = { } }, - handleEvent(event) { - this._inCustomizationMode = event.type == "customizationstarting"; - this.updateUI(); - }, - // Note that updateUI() returns a Promise that's only used by tests. updateUI() { this.panelUIFooter.hidden = false; - // Make sure the button is disabled in customization mode. - if (this._inCustomizationMode) { - this.panelUIStatus.setAttribute("disabled", "true"); - this.panelUILabel.setAttribute("disabled", "true"); - this.panelUIAvatar.setAttribute("disabled", "true"); - this.panelUIIcon.setAttribute("disabled", "true"); - } else { - this.panelUIStatus.removeAttribute("disabled"); - this.panelUILabel.removeAttribute("disabled"); - this.panelUIAvatar.removeAttribute("disabled"); - this.panelUIIcon.removeAttribute("disabled"); - } - let defaultLabel = this.panelUIStatus.getAttribute("defaultlabel"); let errorLabel = this.panelUIStatus.getAttribute("errorlabel"); let unverifiedLabel = this.panelUIStatus.getAttribute("unverifiedlabel"); diff --git a/browser/themes/shared/customizableui/panelUI.inc.css b/browser/themes/shared/customizableui/panelUI.inc.css index 093287fb3f8f8..ce4d14103d95e 100644 --- a/browser/themes/shared/customizableui/panelUI.inc.css +++ b/browser/themes/shared/customizableui/panelUI.inc.css @@ -854,7 +854,7 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { display: none; } -#PanelUI-fxa-icon[syncstatus="active"]:not([disabled]) { +#PanelUI-fxa-icon[syncstatus="active"] { list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar.png); } @@ -889,11 +889,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { display: none; } -#PanelUI-fxa-status[disabled], -#PanelUI-fxa-icon[disabled] { - pointer-events: none; -} - #PanelUI-fxa-avatar { width: 32px; height: 32px; @@ -929,16 +924,12 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { } #PanelUI-help[disabled], -#PanelUI-quit[disabled], -#PanelUI-fxa-icon[disabled], -#PanelUI-fxa-avatar[disabled], -#PanelUI-fxa-label[disabled] > .toolbarbutton-icon, -#PanelUI-fxa-status::after { +#PanelUI-quit[disabled] { opacity: 0.4; } -#PanelUI-fxa-status:not([disabled]):hover, -#PanelUI-fxa-icon:not([disabled]):hover, +#PanelUI-fxa-status:hover, +#PanelUI-fxa-icon:hover, #PanelUI-help:not([disabled]):hover, #PanelUI-customize:hover, #PanelUI-quit:not([disabled]):hover { @@ -946,8 +937,8 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { background-color: var(--arrowpanel-dimmed); } -#PanelUI-fxa-status:not([disabled]):hover:active, -#PanelUI-fxa-icon:not([disabled]):hover:active, +#PanelUI-fxa-status:hover:active, +#PanelUI-fxa-icon:hover:active, #PanelUI-help:not([disabled]):hover:active, #PanelUI-customize:hover:active, #PanelUI-quit:not([disabled]):hover:active { @@ -956,10 +947,10 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { box-shadow: 0 1px 0 hsla(210,4%,10%,.05) inset; } -#PanelUI-fxa-status:not([disabled]):hover, -#PanelUI-fxa-status:not([disabled]):hover:active, -#PanelUI-fxa-icon:not([disabled]):hover, -#PanelUI-fxa-icon:not([disabled]):hover:active { +#PanelUI-fxa-status:hover, +#PanelUI-fxa-status:hover:active, +#PanelUI-fxa-icon:hover, +#PanelUI-fxa-icon:hover:active { outline: none; } @@ -1713,7 +1704,7 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left { list-style-image: url(chrome://browser/skin/sync-horizontalbar@2x.png); } - #PanelUI-fxa-icon[syncstatus="active"]:not([disabled]) { + #PanelUI-fxa-icon[syncstatus="active"] { list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar@2x.png); } From c11e66021df2a5a829d8083caea189f80d89bb2d Mon Sep 17 00:00:00 2001 From: Edouard Oger Date: Tue, 18 Apr 2017 14:15:43 -0400 Subject: [PATCH 18/36] Bug 1353571 part 3 - Refactor browser-syncui and browser-fxaccounts. r=markh MozReview-Commit-ID: K790Ag8WZgv --HG-- rename : browser/base/content/test/general/accounts_testRemoteCommands.html => browser/base/content/test/sync/accounts_testRemoteCommands.html rename : browser/base/content/test/general/browser_fxa_web_channel.html => browser/base/content/test/sync/browser_fxa_web_channel.html rename : browser/base/content/test/general/content_aboutAccounts.js => browser/base/content/test/sync/content_aboutAccounts.js extra : rebase_source : aa6cb209d312c6ef3f45589b0fd8fa8a39c612e3 --- browser/base/content/browser-context.inc | 4 +- browser/base/content/browser-fxaccounts.js | 398 ------------ browser/base/content/browser-menubar.inc | 13 +- browser/base/content/browser-sync.js | 574 ++++++++++++++++++ browser/base/content/browser-syncui.js | 498 --------------- browser/base/content/browser.js | 11 +- browser/base/content/browser.xul | 4 +- browser/base/content/global-scripts.inc | 4 +- browser/base/content/moz.build | 5 +- browser/base/content/nsContextMenu.js | 2 +- browser/base/content/test/general/browser.ini | 15 - .../test/general/browser_contextmenu.js | 4 +- .../test/general/browser_fxaccounts.js | 258 -------- .../content/test/general/browser_syncui.js | 205 ------- .../browser_visibleTabs_contextMenu.js | 10 +- .../test/general/fxa_profile_handler.sjs | 34 -- browser/base/content/test/general/head.js | 6 +- browser/base/content/test/sync/.eslintrc.js | 7 + .../accounts_testRemoteCommands.html | 0 browser/base/content/test/sync/browser.ini | 9 + .../browser_aboutAccounts.js | 4 +- .../browser_fxa_web_channel.html | 0 .../browser_fxa_web_channel.js | 2 +- .../base/content/test/sync/browser_sync.js | 241 ++++++++ .../content_aboutAccounts.js | 0 browser/base/content/web-panels.xul | 2 +- browser/base/content/webext-panels.xul | 2 +- browser/base/jar.mn | 3 +- browser/base/moz.build | 1 + .../customizableui/CustomizableWidgets.jsm | 2 +- .../customizableui/content/panelUI.inc.xul | 16 +- .../customizableui/test/browser.ini | 2 +- .../test/browser_987185_syncButton.js | 77 --- .../test/browser_remote_tabs_button.js | 84 +++ .../test/browser_synced_tabs_menu.js | 6 +- .../syncedtabs/SyncedTabsDeckComponent.js | 4 +- browser/components/syncedtabs/TabListView.js | 2 +- .../xpcshell/test_SyncedTabsDeckComponent.js | 23 +- browser/components/uitour/test/browser_fxa.js | 4 +- .../shared/customizableui/panelUI.inc.css | 12 +- services/fxaccounts/FxAccountsWebChannel.jsm | 4 +- services/sync/modules/SyncedTabs.jsm | 8 + services/sync/modules/UIState.jsm | 263 ++++++++ services/sync/moz.build | 1 + services/sync/tests/unit/test_uistate.js | 329 ++++++++++ services/sync/tests/unit/xpcshell.ini | 2 + 46 files changed, 1587 insertions(+), 1568 deletions(-) delete mode 100644 browser/base/content/browser-fxaccounts.js create mode 100644 browser/base/content/browser-sync.js delete mode 100644 browser/base/content/browser-syncui.js delete mode 100644 browser/base/content/test/general/browser_fxaccounts.js delete mode 100644 browser/base/content/test/general/browser_syncui.js delete mode 100644 browser/base/content/test/general/fxa_profile_handler.sjs create mode 100644 browser/base/content/test/sync/.eslintrc.js rename browser/base/content/test/{general => sync}/accounts_testRemoteCommands.html (100%) create mode 100644 browser/base/content/test/sync/browser.ini rename browser/base/content/test/{general => sync}/browser_aboutAccounts.js (99%) rename browser/base/content/test/{general => sync}/browser_fxa_web_channel.html (100%) rename browser/base/content/test/{general => sync}/browser_fxa_web_channel.js (99%) create mode 100644 browser/base/content/test/sync/browser_sync.js rename browser/base/content/test/{general => sync}/content_aboutAccounts.js (100%) delete mode 100755 browser/components/customizableui/test/browser_987185_syncButton.js create mode 100644 browser/components/customizableui/test/browser_remote_tabs_button.js create mode 100644 services/sync/modules/UIState.jsm create mode 100644 services/sync/tests/unit/test_uistate.js diff --git a/browser/base/content/browser-context.inc b/browser/base/content/browser-context.inc index bfd206dede393..1337b9d882aa1 100644 --- a/browser/base/content/browser-context.inc +++ b/browser/base/content/browser-context.inc @@ -285,7 +285,7 @@ accesskey="&sendPageToDevice.accesskey;" hidden="true"> + onpopupshowing="(() => { let browser = gBrowser || getPanelBrowser(); gSync.populateSendTabToDevicesMenu(event.target, browser.currentURI.spec, browser.contentTitle); })()"/>