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 13a83e57f8fae18f0663739e6cbdc8d9c4d37b23..cb5addf06102de9c60fdbf9d3bdc194c0b4a570b 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(); |
} |
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()]; |
} |