| Index: ios/chrome/common/app_group/app_group_metrics_mainapp.mm
|
| diff --git a/ios/chrome/common/app_group/app_group_metrics_mainapp.mm b/ios/chrome/common/app_group/app_group_metrics_mainapp.mm
|
| index 3e32438fd322e295241924f4e99039c6e51ce9dd..b33cfec0c983b9108fc545aacda9c8a3d02c24af 100644
|
| --- a/ios/chrome/common/app_group/app_group_metrics_mainapp.mm
|
| +++ b/ios/chrome/common/app_group/app_group_metrics_mainapp.mm
|
| @@ -7,16 +7,18 @@
|
| #include <stdint.h>
|
|
|
| #include "base/logging.h"
|
| -#include "base/mac/scoped_nsobject.h"
|
| #include "ios/chrome/common/app_group/app_group_constants.h"
|
| #include "ios/chrome/common/app_group/app_group_metrics.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| namespace app_group {
|
|
|
| namespace main_app {
|
|
|
| -void ProcessPendingLogs(
|
| - const base::mac::ScopedBlock<ProceduralBlockWithData>& callback) {
|
| +void ProcessPendingLogs(ProceduralBlockWithData callback) {
|
| NSFileManager* file_manager = [NSFileManager defaultManager];
|
| NSURL* store_url = [file_manager
|
| containerURLForSecurityApplicationGroupIdentifier:ApplicationGroup()];
|
| @@ -34,7 +36,7 @@ void ProcessPendingLogs(
|
| [log_dir_url URLByAppendingPathComponent:pending_log isDirectory:NO];
|
| if (callback) {
|
| NSData* log_content = [file_manager contentsAtPath:[file_url path]];
|
| - callback.get()(log_content);
|
| + callback(log_content);
|
| }
|
| [file_manager removeItemAtURL:file_url error:nil];
|
| }
|
| @@ -45,8 +47,8 @@ void EnableMetrics(NSString* client_id,
|
| NSString* brand_code,
|
| int64_t install_date,
|
| int64_t enable_metrics_date) {
|
| - base::scoped_nsobject<NSUserDefaults> shared_defaults(
|
| - [[NSUserDefaults alloc] initWithSuiteName:ApplicationGroup()]);
|
| + NSUserDefaults* shared_defaults =
|
| + [[NSUserDefaults alloc] initWithSuiteName:ApplicationGroup()];
|
| [shared_defaults setObject:client_id forKey:@(kChromeAppClientID)];
|
|
|
| [shared_defaults
|
| @@ -60,8 +62,8 @@ void EnableMetrics(NSString* client_id,
|
| }
|
|
|
| void DisableMetrics() {
|
| - base::scoped_nsobject<NSUserDefaults> shared_defaults(
|
| - [[NSUserDefaults alloc] initWithSuiteName:ApplicationGroup()]);
|
| + NSUserDefaults* shared_defaults =
|
| + [[NSUserDefaults alloc] initWithSuiteName:ApplicationGroup()];
|
| [shared_defaults removeObjectForKey:@(kChromeAppClientID)];
|
| }
|
|
|
|
|