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

Unified Diff: ios/chrome/app/application_delegate/metrics_mediator.mm

Issue 2621943002: [ObjC ARC] Converts ios/chrome/app/application_delegate:application_delegate_internal to ARC. (Closed)
Patch Set: comment 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
Index: ios/chrome/app/application_delegate/metrics_mediator.mm
diff --git a/ios/chrome/app/application_delegate/metrics_mediator.mm b/ios/chrome/app/application_delegate/metrics_mediator.mm
index 074ff8fc2a82c280642aff2138f4664520ca87f4..0f0385e126f6cec90c526a9e39842317d5741bc3 100644
--- a/ios/chrome/app/application_delegate/metrics_mediator.mm
+++ b/ios/chrome/app/application_delegate/metrics_mediator.mm
@@ -4,7 +4,6 @@
#import "ios/chrome/app/application_delegate/metrics_mediator.h"
-#include "base/ios/weak_nsobject.h"
#include "base/mac/bind_objc_block.h"
#include "base/metrics/user_metrics_action.h"
#include "base/strings/sys_string_conversions.h"
@@ -31,6 +30,10 @@
#include "ios/web/public/web_thread.h"
#include "url/gurl.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// The amount of time (in seconds) between two background fetch calls.
// TODO(crbug.com/496172): Re-enable background fetch.
@@ -238,18 +241,16 @@ using metrics_mediator::kAppEnteredBackgroundDateKey;
}
// If metrics are enabled, process the logs. Otherwise, just delete them.
- base::mac::ScopedBlock<app_group::ProceduralBlockWithData> callback;
+ app_group::ProceduralBlockWithData callback;
if (enabled) {
- callback.reset(
- ^(NSData* log_content) {
- std::string log(static_cast<const char*>([log_content bytes]),
- static_cast<size_t>([log_content length]));
- web::WebThread::PostTask(web::WebThread::UI, FROM_HERE,
- base::BindBlock(^{
- metrics->PushExternalLog(log);
- }));
- },
- base::scoped_policy::RETAIN);
+ callback = [^(NSData* log_content) {
+ std::string log(static_cast<const char*>([log_content bytes]),
+ static_cast<size_t>([log_content length]));
+ web::WebThread::PostTask(web::WebThread::UI, FROM_HERE,
+ base::BindBlockArc(^{
+ metrics->PushExternalLog(log);
+ }));
+ } copy];
}
web::WebThread::PostTask(
« no previous file with comments | « ios/chrome/app/application_delegate/background_activity.mm ('k') | ios/chrome/app/application_delegate/url_opener.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698