Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: build/mac/tweak_info_plist.py

Issue 2204473002: mac: Don't rely on Breakpad Info.plist keys for Crashpad initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove --breakpad_uploads from tweak_info_plist.py Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/config/features.gni ('k') | chrome/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # 7 #
8 # Xcode supports build variable substitutions and CPP; sadly, that doesn't work 8 # Xcode supports build variable substitutions and CPP; sadly, that doesn't work
9 # because: 9 # because:
10 # 10 #
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 return True 158 return True
159 159
160 160
161 def _AddBreakpadKeys(plist, branding, platform): 161 def _AddBreakpadKeys(plist, branding, platform):
162 """Adds the Breakpad keys. This must be called AFTER _AddVersionKeys() and 162 """Adds the Breakpad keys. This must be called AFTER _AddVersionKeys() and
163 also requires the |branding| argument.""" 163 also requires the |branding| argument."""
164 plist['BreakpadReportInterval'] = '3600' # Deliberately a string. 164 plist['BreakpadReportInterval'] = '3600' # Deliberately a string.
165 plist['BreakpadProduct'] = '%s_%s' % (branding, platform) 165 plist['BreakpadProduct'] = '%s_%s' % (branding, platform)
166 plist['BreakpadProductDisplay'] = branding 166 plist['BreakpadProductDisplay'] = branding
167 plist['BreakpadURL'] = 'https://clients2.google.com/cr/report'
scottmg 2016/08/01 20:38:34 BreakpadURL isn't used in crashpad_mac.mm any more
Mark Mentovai 2016/08/01 20:39:23 scottmg (OOO until August) wrote:
168
167 # These are both deliberately strings and not boolean. 169 # These are both deliberately strings and not boolean.
168 plist['BreakpadSendAndExit'] = 'YES' 170 plist['BreakpadSendAndExit'] = 'YES'
169 plist['BreakpadSkipConfirm'] = 'YES' 171 plist['BreakpadSkipConfirm'] = 'YES'
170 172
171 173
172 def _RemoveBreakpadKeys(plist): 174 def _RemoveBreakpadKeys(plist):
173 """Removes any set Breakpad keys.""" 175 """Removes any set Breakpad keys."""
174 _RemoveKeys(plist, 176 _RemoveKeys(plist,
175 'BreakpadURL', 177 'BreakpadURL',
176 'BreakpadReportInterval', 178 'BreakpadReportInterval',
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 229
228 def Main(argv): 230 def Main(argv):
229 parser = optparse.OptionParser('%prog [options]') 231 parser = optparse.OptionParser('%prog [options]')
230 parser.add_option('--plist', dest='plist_path', action='store', 232 parser.add_option('--plist', dest='plist_path', action='store',
231 type='string', default=None, help='The path of the plist to tweak.') 233 type='string', default=None, help='The path of the plist to tweak.')
232 parser.add_option('--output', dest='plist_output', action='store', 234 parser.add_option('--output', dest='plist_output', action='store',
233 type='string', default=None, help='If specified, the path to output ' + \ 235 type='string', default=None, help='If specified, the path to output ' + \
234 'the tweaked plist, rather than overwriting the input.') 236 'the tweaked plist, rather than overwriting the input.')
235 parser.add_option('--breakpad', dest='use_breakpad', action='store', 237 parser.add_option('--breakpad', dest='use_breakpad', action='store',
236 type='int', default=False, help='Enable Breakpad [1 or 0]') 238 type='int', default=False, help='Enable Breakpad [1 or 0]')
237 parser.add_option('--breakpad_uploads', dest='breakpad_uploads',
238 action='store', type='int', default=False,
239 help='Enable Breakpad\'s uploading of crash dumps [1 or 0]')
240 parser.add_option('--keystone', dest='use_keystone', action='store', 239 parser.add_option('--keystone', dest='use_keystone', action='store',
241 type='int', default=False, help='Enable Keystone [1 or 0]') 240 type='int', default=False, help='Enable Keystone [1 or 0]')
242 parser.add_option('--scm', dest='add_scm_info', action='store', type='int', 241 parser.add_option('--scm', dest='add_scm_info', action='store', type='int',
243 default=True, help='Add SCM metadata [1 or 0]') 242 default=True, help='Add SCM metadata [1 or 0]')
244 parser.add_option('--branding', dest='branding', action='store', 243 parser.add_option('--branding', dest='branding', action='store',
245 type='string', default=None, help='The branding of the binary') 244 type='string', default=None, help='The branding of the binary')
246 parser.add_option('--bundle_id', dest='bundle_identifier', 245 parser.add_option('--bundle_id', dest='bundle_identifier',
247 action='store', type='string', default=None, 246 action='store', type='string', default=None,
248 help='The bundle id of the binary') 247 help='The bundle id of the binary')
249 parser.add_option('--platform', choices=('ios', 'mac'), default='mac', 248 parser.add_option('--platform', choices=('ios', 'mac'), default='mac',
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 319
321 # Add Breakpad if configured to do so. 320 # Add Breakpad if configured to do so.
322 if options.use_breakpad: 321 if options.use_breakpad:
323 if options.branding is None: 322 if options.branding is None:
324 print >>sys.stderr, 'Use of Breakpad requires branding.' 323 print >>sys.stderr, 'Use of Breakpad requires branding.'
325 return 1 324 return 1
326 # Map gyp "OS" / gn "target_os" passed via the --platform parameter to 325 # Map gyp "OS" / gn "target_os" passed via the --platform parameter to
327 # the platform as known by breakpad. 326 # the platform as known by breakpad.
328 platform = {'mac': 'Mac', 'ios': 'iOS'}[options.platform] 327 platform = {'mac': 'Mac', 'ios': 'iOS'}[options.platform]
329 _AddBreakpadKeys(plist, options.branding, platform) 328 _AddBreakpadKeys(plist, options.branding, platform)
330 if options.breakpad_uploads:
331 plist['BreakpadURL'] = 'https://clients2.google.com/cr/report'
332 else:
333 # This allows crash dumping to a file without uploading the
334 # dump, for testing purposes. Breakpad does not recognise
335 # "none" as a special value, but this does stop crash dump
336 # uploading from happening. We need to specify something
337 # because if "BreakpadURL" is not present, Breakpad will not
338 # register its crash handler and no crash dumping will occur.
339 plist['BreakpadURL'] = 'none'
340 else: 329 else:
341 _RemoveBreakpadKeys(plist) 330 _RemoveBreakpadKeys(plist)
342 331
343 # Add Keystone if configured to do so. 332 # Add Keystone if configured to do so.
344 if options.use_keystone: 333 if options.use_keystone:
345 if options.bundle_identifier is None: 334 if options.bundle_identifier is None:
346 print >>sys.stderr, 'Use of Keystone requires the bundle id.' 335 print >>sys.stderr, 'Use of Keystone requires the bundle id.'
347 return 1 336 return 1
348 _AddKeystoneKeys(plist, options.bundle_identifier) 337 _AddKeystoneKeys(plist, options.bundle_identifier)
349 else: 338 else:
(...skipping 11 matching lines...) Expand all
361 with tempfile.NamedTemporaryFile() as temp_info_plist: 350 with tempfile.NamedTemporaryFile() as temp_info_plist:
362 plistlib.writePlist(plist, temp_info_plist.name) 351 plistlib.writePlist(plist, temp_info_plist.name)
363 352
364 # Convert Info.plist to the format requested by the --format flag. Any 353 # Convert Info.plist to the format requested by the --format flag. Any
365 # format would work on Mac but iOS requires specific format. 354 # format would work on Mac but iOS requires specific format.
366 return _ConvertPlist(temp_info_plist.name, output_path, options.format) 355 return _ConvertPlist(temp_info_plist.name, output_path, options.format)
367 356
368 357
369 if __name__ == '__main__': 358 if __name__ == '__main__':
370 sys.exit(Main(sys.argv[1:])) 359 sys.exit(Main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « build/config/features.gni ('k') | chrome/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698