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

Unified Diff: ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h

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
Index: ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h
diff --git a/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h b/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h
index 369d53e2000f4628fce0e93307ff13718a487cba..2a8cbed9016808a9f4da9a4d25f3540353391d02 100644
--- a/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h
+++ b/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h
@@ -7,6 +7,11 @@
#import <Foundation/Foundation.h>
+#include <memory>
+
+#import "base/mac/scoped_nsobject.h"
+#include "base/macros.h"
+
class WebStateList;
namespace web {
@@ -22,14 +27,18 @@ class WebState;
@end
// Helper class allowing NSFastEnumeration over a WebStateList.
-@interface WebStateListFastEnumerationHelper : NSObject<NSFastEnumeration>
+class WebStateListFastEnumerationHelper {
+ public:
+ WebStateListFastEnumerationHelper(WebStateList* web_state_list,
+ id<WebStateProxyFactory> proxy_factory);
+ ~WebStateListFastEnumerationHelper();
-- (instancetype)initWithWebStateList:(WebStateList*)webStateList
- proxyFactory:(id<WebStateProxyFactory>)proxyFactory
- NS_DESIGNATED_INITIALIZER;
+ id<NSFastEnumeration> GetFastEnumeration();
-- (instancetype)init NS_UNAVAILABLE;
+ private:
+ base::scoped_nsprotocol<id<NSFastEnumeration>> fast_enumeration_;
-@end
+ DISALLOW_COPY_AND_ASSIGN(WebStateListFastEnumerationHelper);
+};
#endif // IOS_CHROME_BROWSER_WEB_STATE_LIST_WEB_STATE_LIST_FAST_ENUMERATION_HELPER_H_
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698