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

Unified Diff: ios/web/navigation/crw_session_controller.mm

Issue 2693523003: Moved TabID implementation to SerializableUserData. (Closed)
Patch Set: fix compile 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
Index: ios/web/navigation/crw_session_controller.mm
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm
index 9bf772a633f5524ab4b77be7e22114c626ca9f4d..6fa48f3871d8851e4b03c5fa5e41f3992eb602ec 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -37,7 +37,6 @@ @interface CRWSessionController () {
// the incremental merging of the two classes.
web::NavigationManagerImpl* _navigationManager;
- NSString* _tabId; // Unique id of the tab.
NSString* _openerId; // Id of tab who opened this tab, empty/nil if none.
// Navigation index of the tab which opened this tab. Do not rely on the
// value of this member variable to indicate whether or not this tab has
@@ -92,7 +91,6 @@ @interface CRWSessionController () {
// TODO(rohitrao): These properties must be redefined readwrite to work around a
// clang bug. crbug.com/228650
-@property(nonatomic, readwrite, copy) NSString* tabId;
@property(nonatomic, readwrite, strong) NSArray* entries;
@property(nonatomic, readwrite, strong)
CRWSessionCertificatePolicyManager* sessionCertificatePolicyManager;
@@ -105,7 +103,6 @@ @interface CRWSessionController () {
@property(nonatomic, readwrite, assign) NSInteger openerNavigationIndex;
@property(nonatomic, readwrite, assign) NSInteger previousNavigationIndex;
-- (NSString*)uniqueID;
// Removes all entries after currentNavigationIndex_.
- (void)clearForwardItems;
// Discards the transient entry, if any.
@@ -125,7 +122,6 @@ - (BOOL)isRedirectTransitionForItemAtIndex:(NSInteger)index;
@implementation CRWSessionController
-@synthesize tabId = _tabId;
@synthesize currentNavigationIndex = _currentNavigationIndex;
@synthesize previousNavigationIndex = _previousNavigationIndex;
@synthesize pendingItemIndex = _pendingItemIndex;
@@ -145,7 +141,6 @@ - (id)initWithWindowName:(NSString*)windowName
self = [super init];
if (self) {
self.windowName = windowName;
- _tabId = [[self uniqueID] copy];
_openerId = [openerId copy];
_openedByDOM = openedByDOM;
_openerNavigationIndex = openerIndex;
@@ -167,7 +162,6 @@ - (id)initWithNavigationItems:
browserState:(web::BrowserState*)browserState {
self = [super init];
if (self) {
- _tabId = [[self uniqueID] copy];
_openerId = nil;
_browserState = browserState;
@@ -197,7 +191,6 @@ - (id)initWithNavigationItems:
- (id)copyWithZone:(NSZone*)zone {
CRWSessionController* copy = [[[self class] alloc] init];
- copy->_tabId = [_tabId copy];
copy->_openerId = [_openerId copy];
copy->_openedByDOM = _openedByDOM;
copy->_openerNavigationIndex = _openerNavigationIndex;
@@ -251,13 +244,14 @@ - (void)setBrowserState:(web::BrowserState*)browserState {
- (NSString*)description {
return [NSString
- stringWithFormat:
- @"id: %@\nname: %@\nlast visit: %f\ncurrent index: %" PRIdNS
- @"\nprevious index: %" PRIdNS @"\npending index: %" PRIdNS
- @"\n%@\npending: %@\ntransient: %@\n",
- _tabId, self.windowName, _lastVisitedTimestamp,
- _currentNavigationIndex, _previousNavigationIndex, _pendingItemIndex,
- _entries, _pendingEntry.get(), _transientEntry.get()];
+ stringWithFormat:@"name: %@\nlast visit: %f\ncurrent index: %" PRIdNS
+ @"\nprevious index: %" PRIdNS
+ @"\npending index: %" PRIdNS
+ @"\n%@\npending: %@\ntransient: %@\n",
+ self.windowName, _lastVisitedTimestamp,
+ _currentNavigationIndex, _previousNavigationIndex,
+ _pendingItemIndex, _entries, _pendingEntry.get(),
+ _transientEntry.get()];
}
- (web::NavigationItemList)items {
@@ -698,17 +692,6 @@ - (NSInteger)indexOfItem:(web::NavigationItem*)item {
#pragma mark -
#pragma mark Private methods
-- (NSString*)uniqueID {
- CFUUIDRef uuidRef = CFUUIDCreate(NULL);
- CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef);
- CFRelease(uuidRef);
-
- NSString* uuid =
- [NSString stringWithString:base::mac::ObjCCastStrict<NSString>(
- CFBridgingRelease(uuidStringRef))];
- return uuid;
-}
-
- (CRWSessionEntry*)sessionEntryWithURL:(const GURL&)url
referrer:(const web::Referrer&)referrer
transition:(ui::PageTransition)transition
« no previous file with comments | « ios/web/navigation/crw_session_controller.h ('k') | ios/web/navigation/serializable_user_data_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698