| Index: ios/web/navigation/crw_session_entry.mm
|
| diff --git a/ios/web/navigation/crw_session_entry.mm b/ios/web/navigation/crw_session_entry.mm
|
| index 816fef83915216132a04e8bff96bd1a2450b762d..0ade76331f853a83bdb9240565afe23d0bad5761 100644
|
| --- a/ios/web/navigation/crw_session_entry.mm
|
| +++ b/ios/web/navigation/crw_session_entry.mm
|
| @@ -45,9 +45,8 @@
|
| }
|
|
|
| @interface CRWSessionEntry () {
|
| - // The NavigationItemImpl corresponding to this CRWSessionEntry.
|
| - // TODO(stuartmorgan): Move ownership to NavigationManagerImpl.
|
| - std::unique_ptr<web::NavigationItemImpl> _navigationItem;
|
| + // The NavigationItem passed on initialization.
|
| + web::NavigationItemImpl* _item;
|
| }
|
|
|
| // Returns a readable description of |displayState|.
|
| @@ -57,47 +56,38 @@ + (NSString*)descriptionForPageDisplayState:
|
|
|
| @implementation CRWSessionEntry
|
|
|
| -- (instancetype)initWithNavigationItem:
|
| - (std::unique_ptr<web::NavigationItem>)item {
|
| - self = [super init];
|
| - if (self) {
|
| - _navigationItem.reset(
|
| - static_cast<web::NavigationItemImpl*>(item.release()));
|
| +- (instancetype)initWithNavigationItem:(web::NavigationItemImpl*)item {
|
| + if ((self = [super init])) {
|
| + DCHECK(item);
|
| + _item = item;
|
| }
|
| return self;
|
| }
|
|
|
| -// TODO(ios): Shall we overwrite EqualTo:?
|
| +#pragma mark - Accessors
|
|
|
| -- (instancetype)copyWithZone:(NSZone*)zone {
|
| - CRWSessionEntry* copy = [[[self class] alloc] init];
|
| - copy->_navigationItem.reset(
|
| - new web::NavigationItemImpl(*_navigationItem.get()));
|
| - return copy;
|
| +- (web::NavigationItem*)navigationItem {
|
| + return _item;
|
| +}
|
| +
|
| +- (web::NavigationItemImpl*)navigationItemImpl {
|
| + return _item;
|
| }
|
|
|
| +#pragma mark - NSObject
|
| +
|
| - (NSString*)description {
|
| return [NSString
|
| stringWithFormat:
|
| @"url:%@ originalurl:%@ title:%@ transition:%d displayState:%@ "
|
| @"desktopUA:%d",
|
| - base::SysUTF8ToNSString(_navigationItem->GetURL().spec()),
|
| - base::SysUTF8ToNSString(
|
| - _navigationItem->GetOriginalRequestURL().spec()),
|
| - base::SysUTF16ToNSString(_navigationItem->GetTitle()),
|
| - _navigationItem->GetTransitionType(),
|
| + base::SysUTF8ToNSString(_item->GetURL().spec()),
|
| + base::SysUTF8ToNSString(_item->GetOriginalRequestURL().spec()),
|
| + base::SysUTF16ToNSString(_item->GetTitle()),
|
| + _item->GetTransitionType(),
|
| [[self class]
|
| - descriptionForPageDisplayState:_navigationItem
|
| - ->GetPageDisplayState()],
|
| - _navigationItem->IsOverridingUserAgent()];
|
| -}
|
| -
|
| -- (web::NavigationItem*)navigationItem {
|
| - return _navigationItem.get();
|
| -}
|
| -
|
| -- (web::NavigationItemImpl*)navigationItemImpl {
|
| - return _navigationItem.get();
|
| + descriptionForPageDisplayState:_item->GetPageDisplayState()],
|
| + _item->IsOverridingUserAgent()];
|
| }
|
|
|
| #pragma mark -
|
|
|