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

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

Issue 2775623002: [ios] WebStateList owns all WebState it manages. (Closed)
Patch Set: Fix gn check 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 | « ios/chrome/browser/tabs/legacy_tab_helper.h ('k') | ios/chrome/browser/tabs/tab.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/legacy_tab_helper.mm
diff --git a/ios/chrome/browser/tabs/legacy_tab_helper.mm b/ios/chrome/browser/tabs/legacy_tab_helper.mm
index 476e916fa40fa850579f75db09102ba3cd0f4a08..2da072cc8f3b250bae7e89c8a232f5153c008f51 100644
--- a/ios/chrome/browser/tabs/legacy_tab_helper.mm
+++ b/ios/chrome/browser/tabs/legacy_tab_helper.mm
@@ -5,6 +5,7 @@
#import "ios/chrome/browser/tabs/legacy_tab_helper.h"
#import "ios/chrome/browser/tabs/tab.h"
+#import "ios/chrome/browser/tabs/tab_private.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
@@ -13,10 +14,12 @@
DEFINE_WEB_STATE_USER_DATA_KEY(LegacyTabHelper);
// static
-void LegacyTabHelper::CreateForWebState(web::WebState* web_state, Tab* tab) {
+void LegacyTabHelper::CreateForWebState(web::WebState* web_state) {
DCHECK(web_state);
DCHECK(!FromWebState(web_state));
- web_state->SetUserData(UserDataKey(), new LegacyTabHelper(web_state, tab));
+ web_state->SetUserData(UserDataKey(),
+ std::unique_ptr<base::SupportsUserData::Data>(
+ new LegacyTabHelper(web_state)));
}
// static
@@ -28,7 +31,5 @@ Tab* LegacyTabHelper::GetTabForWebState(web::WebState* web_state) {
LegacyTabHelper::~LegacyTabHelper() = default;
-LegacyTabHelper::LegacyTabHelper(web::WebState* web_state, Tab* tab)
- : tab_(tab) {
- DCHECK_EQ(web_state, tab.webState);
-}
+LegacyTabHelper::LegacyTabHelper(web::WebState* web_state)
+ : tab_([[Tab alloc] initWithWebState:web_state]) {}
« no previous file with comments | « ios/chrome/browser/tabs/legacy_tab_helper.h ('k') | ios/chrome/browser/tabs/tab.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698