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

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

Issue 2578173005: Add GetOriginalRequestURL() to NavigationItem interface. (Closed)
Patch Set: fix callers Created 3 years, 11 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
« no previous file with comments | « ios/web/navigation/crw_session_entry.h ('k') | ios/web/navigation/crw_session_entry_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()];
}
« no previous file with comments | « ios/web/navigation/crw_session_entry.h ('k') | ios/web/navigation/crw_session_entry_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698