Commit b3b8f6c1 authored by Danyao Wang's avatar Danyao Wang Committed by Commit Bot

Use URL instead of virtual URL when creating NSURLRequest.

I believe this is a latent bug. NSURLReuest should reflect the actual
URL to be loaded in the web view, not the virtual URL that is meant to
be displayed to the user. Using virtual URL here breaks
WKBasedNavigationManagerImpl::Restore(), which creates a NavigationItem
whose URL is restore_session.html and whose virtual URL is the to-be-
restored page for display in omnibox.

The virtual URL usage was introduced in
https://codereview.chromium.org/2581193002. The CL description indicates
that virtual URL may not have been the correct value to use here in the
first place.

Bug: 807102
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I5d40be25ee26e370ffa960b6acb2fb7e74ee91d6
Reviewed-on: https://chromium-review.googlesource.com/892285
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532892}
parent 8390438f
...@@ -1632,8 +1632,7 @@ registerLoadRequestForURL:(const GURL&)requestURL ...@@ -1632,8 +1632,7 @@ registerLoadRequestForURL:(const GURL&)requestURL
- (NSMutableURLRequest*)requestForCurrentNavigationItem { - (NSMutableURLRequest*)requestForCurrentNavigationItem {
web::NavigationItem* item = self.currentNavItem; web::NavigationItem* item = self.currentNavItem;
const GURL currentNavigationURL = const GURL currentNavigationURL = item ? item->GetURL() : GURL::EmptyGURL();
item ? item->GetVirtualURL() : GURL::EmptyGURL();
NSMutableURLRequest* request = [NSMutableURLRequest NSMutableURLRequest* request = [NSMutableURLRequest
requestWithURL:net::NSURLWithGURL(currentNavigationURL)]; requestWithURL:net::NSURLWithGURL(currentNavigationURL)];
const web::Referrer referrer(self.currentNavItemReferrer); const web::Referrer referrer(self.currentNavItemReferrer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment