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

Unified Diff: ios/chrome/browser/tabs/tab_model.mm

Issue 2819373004: [ios] Fix WebStateListFastEnumerationHelper observer unregistration. (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
« no previous file with comments | « no previous file | ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab_model.mm
diff --git a/ios/chrome/browser/tabs/tab_model.mm b/ios/chrome/browser/tabs/tab_model.mm
index c08186dc5fd2f508c753ea99c448da51bb734eee..f88d2ea8d52459bf49def45e7b2df646855c9828 100644
--- a/ios/chrome/browser/tabs/tab_model.mm
+++ b/ios/chrome/browser/tabs/tab_model.mm
@@ -138,8 +138,7 @@ void CleanCertificatePolicyCache(
std::unique_ptr<WebStateList> _webStateList;
// Helper providing NSFastEnumeration implementation over the WebStateList.
- base::scoped_nsobject<WebStateListFastEnumerationHelper>
- _fastEnumerationHelper;
+ std::unique_ptr<WebStateListFastEnumerationHelper> _fastEnumerationHelper;
// WebStateListObservers reacting to modifications of the model (may send
// notification, translate and forward events, update metrics, ...).
@@ -275,9 +274,9 @@ void CleanCertificatePolicyCache(
base::MakeUnique<TabModelWebStateListDelegate>(self);
_webStateList = base::MakeUnique<WebStateList>(_webStateListDelegate.get());
- _fastEnumerationHelper.reset([[WebStateListFastEnumerationHelper alloc]
- initWithWebStateList:_webStateList.get()
- proxyFactory:[[TabModelWebStateProxyFactory alloc] init]]);
+ _fastEnumerationHelper =
+ base::MakeUnique<WebStateListFastEnumerationHelper>(
+ _webStateList.get(), [[TabModelWebStateProxyFactory alloc] init]);
_browserState = browserState;
DCHECK(_browserState);
@@ -672,9 +671,10 @@ void CleanCertificatePolicyCache(
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState*)state
objects:(id*)objects
count:(NSUInteger)count {
- return [_fastEnumerationHelper countByEnumeratingWithState:state
- objects:objects
- count:count];
+ return [_fastEnumerationHelper->GetFastEnumeration()
+ countByEnumeratingWithState:state
+ objects:objects
+ count:count];
}
#pragma mark - TabUsageRecorderDelegate
« no previous file with comments | « no previous file | ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698