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

Unified Diff: ios/chrome/browser/memory/memory_debugger_manager.mm

Issue 2917193002: [ObjC ARC] Converts ios/chrome/browser/memory:memory to ARC. (Closed)
Patch Set: Use __weak Created 3 years, 6 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/memory/memory_debugger.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/memory/memory_debugger_manager.mm
diff --git a/ios/chrome/browser/memory/memory_debugger_manager.mm b/ios/chrome/browser/memory/memory_debugger_manager.mm
index b177bc966c683ed02e6903f3d3e731f1b286cd8a..620db2d19ca8c76875ae85c05ef12bf8d36960a5 100644
--- a/ios/chrome/browser/memory/memory_debugger_manager.mm
+++ b/ios/chrome/browser/memory/memory_debugger_manager.mm
@@ -4,18 +4,20 @@
#import "ios/chrome/browser/memory/memory_debugger_manager.h"
-#include "base/ios/weak_nsobject.h"
#import "base/mac/bind_objc_block.h"
-#include "base/mac/scoped_nsobject.h"
#include "components/prefs/pref_member.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#import "ios/chrome/browser/memory/memory_debugger.h"
#import "ios/chrome/browser/pref_names.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
@implementation MemoryDebuggerManager {
- __unsafe_unretained UIView* debuggerParentView_; // weak
- base::scoped_nsobject<MemoryDebugger> memoryDebugger_;
+ __weak UIView* debuggerParentView_;
+ MemoryDebugger* memoryDebugger_;
BooleanPrefMember showMemoryDebugger_;
}
@@ -25,10 +27,9 @@
debuggerParentView_ = debuggerParentView;
// Set up the callback for when the pref to show/hide the debugger changes.
- base::WeakNSObject<MemoryDebuggerManager> weakSelf(self);
- base::Closure callback = base::BindBlock(^{
- base::scoped_nsobject<MemoryDebuggerManager> strongSelf(
- [weakSelf retain]);
+ __weak MemoryDebuggerManager* weakSelf = self;
+ base::Closure callback = base::BindBlockArc(^{
+ MemoryDebuggerManager* strongSelf = weakSelf;
if (strongSelf) {
[self onShowMemoryDebuggingToolsChange];
}
@@ -43,7 +44,6 @@
- (void)dealloc {
[self tearDownDebugger];
- [super dealloc];
}
#pragma mark - Pref-handling methods
@@ -56,7 +56,7 @@
// Shows or hides the debugger when the pref changes.
- (void)onShowMemoryDebuggingToolsChange {
if (showMemoryDebugger_.GetValue()) {
- memoryDebugger_.reset([[MemoryDebugger alloc] init]);
+ memoryDebugger_ = [[MemoryDebugger alloc] init];
[debuggerParentView_ addSubview:memoryDebugger_];
} else {
[self tearDownDebugger];
@@ -67,6 +67,6 @@
- (void)tearDownDebugger {
[memoryDebugger_ invalidateTimers];
[memoryDebugger_ removeFromSuperview];
- memoryDebugger_.reset();
+ memoryDebugger_ = nil;
}
@end
« no previous file with comments | « ios/chrome/browser/memory/memory_debugger.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698