Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | #!/usr/bin/python |
michael@0 | 2 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | |
michael@0 | 6 | |
michael@0 | 7 | from optparse import OptionParser |
michael@0 | 8 | from datetime import datetime |
michael@0 | 9 | import time |
michael@0 | 10 | import sys |
michael@0 | 11 | import os |
michael@0 | 12 | |
michael@0 | 13 | o = OptionParser() |
michael@0 | 14 | o.add_option("--buildid", dest="buildid") |
michael@0 | 15 | o.add_option("--print-buildid", action="store_true", dest="print_buildid") |
michael@0 | 16 | o.add_option("--print-timestamp", action="store_true", dest="print_timestamp") |
michael@0 | 17 | o.add_option("--sourcestamp", dest="sourcestamp") |
michael@0 | 18 | o.add_option("--sourcerepo", dest="sourcerepo") |
michael@0 | 19 | |
michael@0 | 20 | (options, args) = o.parse_args() |
michael@0 | 21 | |
michael@0 | 22 | if options.print_timestamp: |
michael@0 | 23 | print int(time.time()) |
michael@0 | 24 | sys.exit(0) |
michael@0 | 25 | |
michael@0 | 26 | if options.print_buildid: |
michael@0 | 27 | print datetime.now().strftime('%Y%m%d%H%M%S') |
michael@0 | 28 | sys.exit(0) |
michael@0 | 29 | |
michael@0 | 30 | if not options.buildid: |
michael@0 | 31 | print >>sys.stderr, "--buildid is required" |
michael@0 | 32 | sys.exit(1) |
michael@0 | 33 | |
michael@0 | 34 | (milestoneFile,) = args |
michael@0 | 35 | for line in open(milestoneFile, 'r'): |
michael@0 | 36 | if line[0] == '#': |
michael@0 | 37 | continue |
michael@0 | 38 | |
michael@0 | 39 | line = line.strip() |
michael@0 | 40 | if line == '': |
michael@0 | 41 | continue |
michael@0 | 42 | |
michael@0 | 43 | milestone = line |
michael@0 | 44 | |
michael@0 | 45 | print """[Build] |
michael@0 | 46 | BuildID=%s |
michael@0 | 47 | Milestone=%s""" % (options.buildid, milestone) |
michael@0 | 48 | if options.sourcestamp: |
michael@0 | 49 | print "SourceStamp=%s" % options.sourcestamp |
michael@0 | 50 | if options.sourcerepo: |
michael@0 | 51 | print "SourceRepository=%s" % options.sourcerepo |