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

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: 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
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..4659033493860f1201600a4bd5eb9f439a903d78 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) {
@@ -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);

Powered by Google App Engine
This is Rietveld 408576698