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

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

Issue 2693523003: Moved TabID implementation to SerializableUserData. (Closed)
Patch Set: 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 2374036eba26630f47937ccdeed18464b25307f1..83b11a1d38d4e18a4d012e7b4f32d877cb4acb1c 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
@@ -86,7 +85,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)
CRWSessionCertificatePolicyManager* sessionCertificatePolicyManager;
@@ -98,7 +96,6 @@ @interface CRWSessionController () {
@property(nonatomic, readwrite, assign) NSInteger openerNavigationIndex;
@property(nonatomic, readwrite, assign) NSInteger previousNavigationIndex;
-- (NSString*)uniqueID;
// Removes all items after currentNavigationIndex_.
- (void)clearForwardItems;
// Discards the transient item, if any.
@@ -123,7 +120,6 @@ - (NSArray*)entryListForItemList:(const web::NavigationItemList&)itemList;
@implementation CRWSessionController
-@synthesize tabId = _tabId;
@synthesize currentNavigationIndex = _currentNavigationIndex;
@synthesize previousNavigationIndex = _previousNavigationIndex;
@synthesize pendingItemIndex = _pendingItemIndex;
@@ -142,7 +138,6 @@ - (id)initWithWindowName:(NSString*)windowName
self = [super init];
if (self) {
self.windowName = windowName;
- _tabId = [[self uniqueID] copy];
_openerId = [openerId copy];
_openedByDOM = openedByDOM;
_openerNavigationIndex = openerIndex;
@@ -162,7 +157,6 @@ - (id)initWithNavigationItems:(web::ScopedNavigationItemList)items
browserState:(web::BrowserState*)browserState {
self = [super init];
if (self) {
- _tabId = [[self uniqueID] copy];
_openerId = nil;
_browserState = browserState;
_items = web::CreateScopedNavigationItemImplList(std::move(items));
@@ -331,20 +325,20 @@ - (NSArray*)forwardEntries {
- (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,
- self.entries, self.pendingEntry, self.transientEntry];
+ stringWithFormat:@"name: %@\nlast visit: %f\ncurrent index: %" PRIdNS
+ @"\nprevious index: %" PRIdNS
+ @"\npending index: %" PRIdNS
+ @"\n%@\npending: %@\ntransient: %@\n",
+ self.windowName, _lastVisitedTimestamp,
+ _currentNavigationIndex, _previousNavigationIndex,
+ _pendingItemIndex, self.entries, self.pendingEntry,
+ self.transientEntry];
}
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone*)zone {
CRWSessionController* copy = [[[self class] alloc] init];
- copy->_tabId = [_tabId copy];
copy->_openerId = [_openerId copy];
copy->_openedByDOM = _openedByDOM;
copy->_openerNavigationIndex = _openerNavigationIndex;
@@ -678,17 +672,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;
-}
-
- (std::unique_ptr<web::NavigationItemImpl>)
itemWithURL:(const GURL&)url
referrer:(const web::Referrer&)referrer

Powered by Google App Engine
This is Rietveld 408576698