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

Unified Diff: ios/chrome/common/app_group/app_group_metrics_mainapp.mm

Issue 2622903003: [ObjC ARC] Converts ios/chrome/common/app_group:main_app to ARC. (Closed)
Patch Set: Remove scoped_block Created 3 years, 11 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/common/app_group/app_group_metrics_mainapp.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)];
}
« no previous file with comments | « ios/chrome/common/app_group/app_group_metrics_mainapp.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698