build/mozconfig.comm-support
author Andrew Osmond <aosmond@mozilla.com>
Tue, 24 Apr 2018 13:51:35 -0400
changeset 415325 1173dccd114e1c86047a6f01e341cf1c4ea8fe9c
parent 389210 c7ae1c6f2a4914e863f7530b2c37469041d2d847
child 464786 2c2dd59df579888dd52057037d468cab5c316a56
permissions -rw-r--r--
Bug 1444537 - Part 3. Fix how redecode errors could cause animated image state inconsistencies. r=tnikkel We can discard frames from an animated image if the memory footprint exceeds the threshold. This will cause us to redecode frames on demand instead. However decoders can fail to produce the same results on subsequent runs due to differences in memory pressure, etc. If this happens our state can get inconsistent. In particular, if we keep failing on the first frame, we end up in an infinite loop on the decoder thread. Since we don't have the owning image to signal, as we had to release our reference to it after the first pass, we can do little but stop decoding. From the user's perspective, the animation will come to a stop.

# This file exists to support comm-central from building with mozilla-central
# as a subdirectory to building as a subdirectory of mozilla-central.

# In order to have mozconfig files that support building in either
# configuration during the transition, without duplicating the logic
# in every mozconfig file, there needs to exist a file that exists at the
# same path in mozilla-central and comm-central.

# This file gets included under two circumstances.
# 1. comm-central is being built as a subdirectory of mozilla-central.
# 2. comm-central is being built as a parent directory of mozilla-central,
#    but `mach` was invoked from the objdir and thinks that $topsrcdir is
#    the mozilla-central directory. If we detect this is the case, we fix
#    $topsrcdir before proceeding.
# In either case, we then invoke the identically named file that lives in
# comm-central, which sets some variables that can be used by the rest of the
# mozconfig.


# Note that the top-level mozconfig file is in $2.

if [ "$(dirname "$2")" = "$topsrcdir" ]; then
  # No weirdness
  if [ -d "$topsrcdir/mail" ]; then
    # Building with comm-central as top-level directory.
    echo "ERROR: Should not include mozilla/build/mozconfig.comm when building"
    echo "       with comm-central as top-level directory."
    exit 1
  elif [ -d "$topsrcdir/comm/mail" ]; then
    # Building with mozila-central as top-level directory.
    . "$topsrcdir/comm/build/mozconfig.comm-support"
  else
    echo "ERROR: Unknown build directory layout."
    exit 1
  fi
elif [ "$(dirname "$2")" = "$(dirname "$topsrcdir")" ]; then
  if [ -d "$topsrcdir/../mail" ]; then
    # Building with comm-central as top-level directory;
    # but invoked with $topsrcdir as "mozilla/".
    topsrcdir=$(dirname "$topsrcdir")
    . "$topsrcdir/build/mozconfig.comm-support"
  else
    echo "ERROR: Unknown build directory layout."
    exit 1
  fi
else
  echo "ERROR: Unknown build directory layout."
  exit 1
fi