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

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

Issue 2956483003: [ios] TabIdTabHelper (Closed)
Patch Set: Additional unit tests and other edits. 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/tabs/BUILD.gn ('k') | ios/chrome/browser/tabs/tab_helper_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index a89e1750b938e636d751186ede1a7893909171e1..7ca80f6123234cc671ae045d0da5c207426d668e 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -100,6 +100,7 @@
#import "ios/chrome/browser/web/navigation_manager_util.h"
#import "ios/chrome/browser/web/passkit_dialog_provider.h"
#include "ios/chrome/browser/web/print_observer.h"
+#import "ios/chrome/browser/web/tab_id_tab_helper.h"
#include "ios/chrome/grit/ios_strings.h"
#import "ios/web/navigation/navigation_item_impl.h"
#import "ios/web/navigation/navigation_manager_impl.h"
@@ -154,10 +155,6 @@ class TabHistoryContext;
class FaviconDriverObserverBridge;
class TabInfoBarObserver;
-// The key under which the Tab ID is stored in the WebState's serializable user
-// data.
-NSString* const kTabIDKey = @"TabID";
-
// Name of histogram for recording the state of the tab when the renderer is
// terminated.
const char kRendererTerminationStateHistogram[] =
@@ -425,7 +422,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
@implementation Tab
@synthesize browserState = _browserState;
-@synthesize tabId = tabId_;
@synthesize useGreyImageCache = useGreyImageCache_;
@synthesize isPrerenderTab = _isPrerenderTab;
@synthesize isLinkLoadingPrerenderTab = isLinkLoadingPrerenderTab_;
@@ -614,22 +610,9 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
// tabId should be nil.
return nil;
}
-
- if (tabId_)
- return tabId_;
-
- web::SerializableUserDataManager* userDataManager =
- web::SerializableUserDataManager::FromWebState(self.webState);
- NSString* tabId = base::mac::ObjCCast<NSString>(
- userDataManager->GetValueForSerializationKey(kTabIDKey));
-
- if (!tabId || ![tabId length]) {
- tabId = [[NSUUID UUID] UUIDString];
- userDataManager->AddSerializableData(tabId, kTabIDKey);
- }
-
- tabId_ = [tabId copy];
- return tabId_;
+ TabIdTabHelper* tab_id_helper = TabIdTabHelper::FromWebState(self.webState);
+ DCHECK(tab_id_helper);
+ return tab_id_helper->tab_id();
}
- (web::WebState*)webState {
« no previous file with comments | « ios/chrome/browser/tabs/BUILD.gn ('k') | ios/chrome/browser/tabs/tab_helper_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698