Add support for product_name in Mac sym_upload v2

Change-Id: I6fab9f62434fd19eb7aea4a66f0dd809af57e595
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3436859
Reviewed-by: Nelson Billing <nbilling@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Nathan Scoglio
2022-02-04 14:24:50 -08:00
committed by Nelson Billing
parent 3123f102ff
commit 7685201906
3 changed files with 28 additions and 15 deletions

View File

@@ -96,7 +96,8 @@ typedef NS_ENUM(NSInteger, SymbolStatus) {
withUploadKey:(NSString*)uploadKey
withDebugFile:(NSString*)debugFile
withDebugID:(NSString*)debugID
withType:(NSString*)type;
withType:(NSString*)type
withProductName:(NSString*)productName;
@end

View File

@@ -190,18 +190,22 @@
withUploadKey:(NSString*)uploadKey
withDebugFile:(NSString*)debugFile
withDebugID:(NSString*)debugID
withType:(NSString*)type {
withType:(NSString*)type
withProductName:(NSString*)productName {
NSURL* URL = [NSURL
URLWithString:[NSString
stringWithFormat:@"%@/v1/uploads/%@:complete?key=%@",
APIURL, uploadKey, APIKey]];
NSDictionary* symbolIdDictionary =
[NSDictionary dictionaryWithObjectsAndKeys:debugFile, @"debug_file",
debugID, @"debug_id", nil];
NSDictionary* jsonDictionary = [NSDictionary
dictionaryWithObjectsAndKeys:symbolIdDictionary, @"symbol_id", type,
@"symbol_upload_type", nil];
NSMutableDictionary* jsonDictionary = [@{
@"symbol_id" : @{@"debug_file" : debugFile, @"debug_id" : debugID},
@"symbol_upload_type" : type
} mutableCopy];
if (productName != nil) {
jsonDictionary[@"metadata"] = @{@"product_name": productName};
}
NSError* error = nil;
NSData* jsonData =
[NSJSONSerialization dataWithJSONObject:jsonDictionary