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

Unified Diff: ios/chrome/app/safe_mode_crashing_modules_config.mm

Issue 2146323003: Made CrashingModules.plist non-updatable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/app/safe_mode_crashing_modules_config.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/app/safe_mode_crashing_modules_config.mm
diff --git a/ios/chrome/app/safe_mode_crashing_modules_config.mm b/ios/chrome/app/safe_mode_crashing_modules_config.mm
index b0496cfb7a69c545d6f47f9b37c7a32086a6130a..9106d65af63356861229a1d3c0a0ae0a1569bfa7 100644
--- a/ios/chrome/app/safe_mode_crashing_modules_config.mm
+++ b/ios/chrome/app/safe_mode_crashing_modules_config.mm
@@ -5,6 +5,8 @@
#import "ios/chrome/app/safe_mode_crashing_modules_config.h"
#include "base/logging.h"
+#include "base/mac/foundation_util.h"
+#import "base/mac/scoped_nsobject.h"
namespace {
@@ -13,6 +15,11 @@ NSString* const kModuleFriendlyNameKey = @"ModuleFriendlyName";
} // namespace
+@interface SafeModeCrashingModulesConfig () {
+ base::scoped_nsobject<NSDictionary> _configuration;
+}
+@end
+
@implementation SafeModeCrashingModulesConfig
+ (SafeModeCrashingModulesConfig*)sharedInstance {
@@ -22,25 +29,23 @@ NSString* const kModuleFriendlyNameKey = @"ModuleFriendlyName";
}
- (instancetype)init {
- self = [super initWithAppId:nil version:nil plist:@"CrashingModules.plist"];
+ self = [super init];
if (self) {
- self.stopsUpdateChecksOnAppTermination = YES;
+ NSString* configPath =
+ [[NSBundle mainBundle] pathForResource:@"CrashingModules"
+ ofType:@"plist"];
+ _configuration.reset(
+ [[NSDictionary alloc] initWithContentsOfFile:configPath]);
}
return self;
}
- (NSString*)startupCrashModuleFriendlyName:(NSString*)modulePath {
- NSDictionary* configData = [self dictionaryFromConfig];
- NSDictionary* modules = [configData objectForKey:kStartupCrashModulesKey];
- if (modules) {
- DCHECK([modules isKindOfClass:[NSDictionary class]]);
- NSDictionary* module = modules[modulePath];
- if (module) {
- DCHECK([module isKindOfClass:[NSDictionary class]]);
- return module[kModuleFriendlyNameKey];
- }
- }
- return nil;
+ NSDictionary* modules = base::mac::ObjCCastStrict<NSDictionary>(
rohitrao (ping after 24h) 2016/07/15 17:23:19 Does this method also get called during startup?
pkl (ping after 24h if needed) 2016/07/15 20:33:18 This method is currently called from Safe Mode Vie
+ [_configuration objectForKey:kStartupCrashModulesKey]);
+ NSDictionary* module =
+ base::mac::ObjCCastStrict<NSDictionary>(modules[modulePath]);
+ return base::mac::ObjCCast<NSString>(module[kModuleFriendlyNameKey]);
}
@end
« no previous file with comments | « ios/chrome/app/safe_mode_crashing_modules_config.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698