author Andrew Osmond <>
Thu, 29 Nov 2018 14:38:28 -0500
changeset 449414 0861a85d13bb1664c019b76fc543d2679e39c99f
parent 420540 314e3ae1520f8e1b17e85982e8e2c515dced30a9
permissions -rw-r--r--
Bug 1510601 - Part 1. Move size increments into AnimationFrameBuffer::InsertInternal. r=tnikkel The size was originally incremented in AnimationFrameBuffer::Insert however if an animation was reset before we finished decoding, it would count some frames twice in the counter. Now we increment it inside InsertInternal, where AnimationFrameDiscardingQueue can make a more informed decision on whether the frame is a duplicate or not. Additionally we now fail explicitly when we insert more frames on subsequent decodes than the original decoders. This will help avoid getting out of sync with FrameAnimator. Differential Revision:

# 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

'''Parses a given application.ini file and outputs the corresponding
   StaticXREAppData structure as a C++ header file'''

import ConfigParser
import sys

def main(output, file):
    config = ConfigParser.RawConfigParser()
    flags = set()
        if config.getint('XRE', 'EnableProfileMigrator') == 1:
    except Exception:
        if config.getint('Crash Reporter', 'Enabled') == 1:
    except Exception:
    appdata = dict(("%s:%s" % (s, o), config.get(s, o))
                   for s in config.sections() for o in config.options(s))
    appdata['flags'] = ' | '.join(flags) if flags else '0'
    appdata['App:profile'] = ('"%s"' % appdata['App:profile']
                              if 'App:profile' in appdata else 'NULL')
    expected = ('App:vendor', 'App:name', 'App:remotingname', 'App:version', 'App:buildid',
                'App:id', 'Gecko:minversion', 'Gecko:maxversion')
    missing = [var for var in expected if var not in appdata]
    if missing:
        print >>sys.stderr, \
            "Missing values in %s: %s" % (file, ', '.join(missing))

    if 'Crash Reporter:serverurl' not in appdata:
        appdata['Crash Reporter:serverurl'] = ''

    if 'App:sourcerepository' in appdata and 'App:sourcestamp' in appdata:
        appdata['App:sourceurl'] = '"%(App:sourcerepository)s/rev/%(App:sourcestamp)s"' % appdata
        appdata['App:sourceurl'] = 'NULL'

    output.write('''#include "mozilla/XREAppData.h"
             static const mozilla::StaticXREAppData sAppData = {
                 NULL, // copyright
                 "%(Crash Reporter:serverurl)s",
                 NULL, // UAName
             };''' % appdata)

if __name__ == '__main__':
    if len(sys.argv) != 1:
        main(sys.stdout, sys.argv[1])
        print >>sys.stderr, "Usage: %s /path/to/application.ini" % sys.argv[0]