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

Unified Diff: ios/chrome/browser/web/auto_reload_controller.mm

Issue 2823953004: [ObjC ARC] Converts ios/chrome/browser/web:web_internal to ARC. (Closed)
Patch Set: Address comments Created 3 years, 8 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/browser/web/auto_reload_bridge.mm ('k') | ios/chrome/browser/web/blocked_popup_tab_helper.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/web/auto_reload_controller.mm
diff --git a/ios/chrome/browser/web/auto_reload_controller.mm b/ios/chrome/browser/web/auto_reload_controller.mm
index 73f0453f2ce9c21a146ea9fa5eb4ac8ecd8abfe6..2e64ca9322fb3bfe0b1bad9b22ce0b58338e1843 100644
--- a/ios/chrome/browser/web/auto_reload_controller.mm
+++ b/ios/chrome/browser/web/auto_reload_controller.mm
@@ -6,11 +6,13 @@
#include <memory>
-#include "base/ios/weak_nsobject.h"
#include "base/mac/bind_objc_block.h"
-#include "base/mac/scoped_nsobject.h"
#include "base/timer/timer.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
base::TimeDelta GetAutoReloadTime(size_t reload_count) {
@@ -29,7 +31,7 @@ base::TimeDelta GetAutoReloadTime(size_t reload_count) {
int _reloadCount;
BOOL _shouldReload;
BOOL _online;
- id<AutoReloadDelegate> _delegate;
+ __weak id<AutoReloadDelegate> _delegate;
std::unique_ptr<base::Timer> _timer;
}
@@ -102,11 +104,10 @@ base::TimeDelta GetAutoReloadTime(size_t reload_count) {
}
- (void)startTimer {
- base::WeakNSObject<AutoReloadController> weakSelf(self);
+ __weak AutoReloadController* weakSelf = self;
base::TimeDelta delay = GetAutoReloadTime(_reloadCount);
- _timer->Start(FROM_HERE, delay, base::BindBlock(^{
- base::scoped_nsobject<AutoReloadController> strongSelf(
- [weakSelf retain]);
+ _timer->Start(FROM_HERE, delay, base::BindBlockArc(^{
+ AutoReloadController* strongSelf = weakSelf;
// self owns the timer owns this closure, so self must outlive
// this closure.
DCHECK(strongSelf);
« no previous file with comments | « ios/chrome/browser/web/auto_reload_bridge.mm ('k') | ios/chrome/browser/web/blocked_popup_tab_helper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698