1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "ios/chrome/app/safe_mode_crashing_modules_config.h"
7 #include "base/logging.h"
11 NSString* const kStartupCrashModulesKey = @"StartupCrashModules";
12 NSString* const kModuleFriendlyNameKey = @"ModuleFriendlyName";
16 @implementation SafeModeCrashingModulesConfig
18 + (SafeModeCrashingModulesConfig*)sharedInstance {
19 static SafeModeCrashingModulesConfig* instance =
20 [[SafeModeCrashingModulesConfig alloc] init];
24 - (instancetype)init {
25 return [super initWithAppId:nil version:nil plist:@"CrashingModules.plist"];
28 - (NSString*)startupCrashModuleFriendlyName:(NSString*)modulePath {
29 NSDictionary* configData = [self dictionaryFromConfig];
30 NSDictionary* modules = [configData objectForKey:kStartupCrashModulesKey];
32 DCHECK([modules isKindOfClass:[NSDictionary class]]);
33 NSDictionary* module = modules[modulePath];
35 DCHECK([module isKindOfClass:[NSDictionary class]]);
36 return module[kModuleFriendlyNameKey];