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

Unified Diff: ios/chrome/app/spotlight/spotlight_manager.mm

Issue 2704193002: [ObjC ARC] Converts ios/chrome/app/spotlight:spotlight to ARC. (Closed)
Patch Set: s/unsafe/weak Created 3 years, 10 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/app/spotlight/bookmarks_spotlight_manager.mm ('k') | ios/chrome/app/spotlight/spotlight_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/app/spotlight/spotlight_manager.mm
diff --git a/ios/chrome/app/spotlight/spotlight_manager.mm b/ios/chrome/app/spotlight/spotlight_manager.mm
index b4d057395eff6749bfe76905bf3d2d7722b5361c..3baf66b0260a538687ef2eaaa18127e466b2a115 100644
--- a/ios/chrome/app/spotlight/spotlight_manager.mm
+++ b/ios/chrome/app/spotlight/spotlight_manager.mm
@@ -5,17 +5,20 @@
#import "ios/chrome/app/spotlight/spotlight_manager.h"
#include "base/logging.h"
-#include "base/mac/scoped_nsobject.h"
#include "ios/chrome/app/spotlight/actions_spotlight_manager.h"
#include "ios/chrome/app/spotlight/bookmarks_spotlight_manager.h"
#include "ios/chrome/app/spotlight/topsites_spotlight_manager.h"
#include "ios/chrome/browser/experimental_flags.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
// Called from the BrowserBookmarkModelBridge from C++ -> ObjC.
@interface SpotlightManager ()<BookmarkUpdatedDelegate> {
- base::scoped_nsobject<BookmarksSpotlightManager> _bookmarkManager;
- base::scoped_nsobject<TopSitesSpotlightManager> _topSitesManager;
- base::scoped_nsobject<ActionsSpotlightManager> _actionsManager;
+ BookmarksSpotlightManager* _bookmarkManager;
+ TopSitesSpotlightManager* _topSitesManager;
+ ActionsSpotlightManager* _actionsManager;
}
- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
@@ -29,8 +32,7 @@
+ (SpotlightManager*)spotlightManagerWithBrowserState:
(ios::ChromeBrowserState*)browserState {
if (spotlight::IsSpotlightAvailable()) {
- return [[[SpotlightManager alloc] initWithBrowserState:browserState]
- autorelease];
+ return [[SpotlightManager alloc] initWithBrowserState:browserState];
}
return nil;
}
@@ -39,13 +41,12 @@
DCHECK(spotlight::IsSpotlightAvailable());
self = [super init];
if (self) {
- _topSitesManager.reset([[TopSitesSpotlightManager
- topSitesSpotlightManagerWithBrowserState:browserState] retain]);
- _bookmarkManager.reset([[BookmarksSpotlightManager
- bookmarksSpotlightManagerWithBrowserState:browserState] retain]);
+ _topSitesManager = [TopSitesSpotlightManager
+ topSitesSpotlightManagerWithBrowserState:browserState];
+ _bookmarkManager = [BookmarksSpotlightManager
+ bookmarksSpotlightManagerWithBrowserState:browserState];
[_bookmarkManager setDelegate:self];
- _actionsManager.reset(
- [[ActionsSpotlightManager actionsSpotlightManager] retain]);
+ _actionsManager = [ActionsSpotlightManager actionsSpotlightManager];
}
return self;
}
@@ -55,9 +56,6 @@
return nil;
}
-- (void)dealloc {
- [super dealloc];
-}
- (void)resyncIndex {
[_bookmarkManager reindexBookmarksIfNeeded];
« no previous file with comments | « ios/chrome/app/spotlight/bookmarks_spotlight_manager.mm ('k') | ios/chrome/app/spotlight/spotlight_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698