Chromium Code Reviews| 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 ed27327f19f3d11ab2bb1f30bedf0b0e4eca482d..b1b4e21091938fc124c5e3b48a5a02636220b07a 100644 |
| --- a/ios/web/navigation/crw_session_entry.mm |
| +++ b/ios/web/navigation/crw_session_entry.mm |
| @@ -45,17 +45,10 @@ |
| } |
| @interface CRWSessionEntry () { |
| - // The original URL of the page. In cases where a redirect occurred, |url_| |
| - // will contain the final post-redirect URL, and |originalUrl_| will contain |
| - // the pre-redirect URL. This field is not persisted to disk. |
| - GURL _originalUrl; |
| - |
| // The NavigationItemImpl corresponding to this CRWSessionEntry. |
| // TODO(stuartmorgan): Move ownership to NavigationManagerImpl. |
| std::unique_ptr<web::NavigationItemImpl> _navigationItem; |
| } |
| -// Redefine originalUrl to be read-write. |
| -@property(nonatomic, readwrite) const GURL& originalUrl; |
| // Converts a serialized NSDictionary to a web::PageDisplayState. |
| + (web::PageDisplayState)pageDisplayStateFromDictionary: |
| @@ -70,15 +63,12 @@ + (NSString*)descriptionForPageDisplayState: |
| @implementation CRWSessionEntry |
| -@synthesize originalUrl = _originalUrl; |
| - |
| - (instancetype)initWithNavigationItem: |
| (std::unique_ptr<web::NavigationItem>)item { |
| self = [super init]; |
| if (self) { |
| _navigationItem.reset( |
| static_cast<web::NavigationItemImpl*>(item.release())); |
| - self.originalUrl = _navigationItem->GetURL(); |
|
Eugene But (OOO till 7-30)
2016/12/16 22:18:18
Do we need to do this?:
|_navigationItem->SetOrigi
kkhorimoto
2017/01/21 02:41:29
This line is no longer necessary, as the original
|
| } |
| return self; |
| } |
| @@ -99,8 +89,8 @@ - (instancetype)initWithCoder:(NSCoder*)aDecoder { |
| url = net::GURLWithNSURL( |
| [aDecoder decodeObjectForKey:web::kSessionEntryURLDeperecatedKey]); |
| } |
| + _navigationItem->SetOriginalRequestURL(url); |
| _navigationItem->SetURL(url); |
| - self.originalUrl = url; |
| if ([aDecoder containsValueForKey:web::kSessionEntryReferrerURLKey]) { |
| const std::string referrerString(web::nscoder_util::DecodeString( |
| @@ -176,7 +166,6 @@ - (instancetype)copyWithZone:(NSZone*)zone { |
| CRWSessionEntry* copy = [[[self class] alloc] init]; |
| copy->_navigationItem.reset( |
| new web::NavigationItemImpl(*_navigationItem.get())); |
| - copy->_originalUrl = _originalUrl; |
| return copy; |
| } |
| @@ -186,11 +175,13 @@ - (NSString*)description { |
| @"url:%@ originalurl:%@ title:%@ transition:%d displayState:%@ " |
| @"desktopUA:%d", |
| base::SysUTF8ToNSString(_navigationItem->GetURL().spec()), |
| - base::SysUTF8ToNSString(self.originalUrl.spec()), |
| + base::SysUTF8ToNSString( |
| + _navigationItem->GetOriginalRequestURL().spec()), |
| base::SysUTF16ToNSString(_navigationItem->GetTitle()), |
| _navigationItem->GetTransitionType(), |
| - [[self class] descriptionForPageDisplayState: |
| - _navigationItem->GetPageDisplayState()], |
| + [[self class] |
| + descriptionForPageDisplayState:_navigationItem |
| + ->GetPageDisplayState()], |
| _navigationItem->IsOverridingUserAgent()]; |
| } |