Commit fc015703 authored by Mike Dougherty's avatar Mike Dougherty Committed by Commit Bot

Remove Javascript POST workaround when running on iOS 11 or later

BUG=581021

Change-Id: Id6d7ab0cabc525cd575f6140281fdf5dc213a2b9
Reviewed-on: https://chromium-review.googlesource.com/565786Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485460}
parent 2b0d6d14
...@@ -5057,16 +5057,21 @@ registerLoadRequestForURL:(const GURL&)requestURL ...@@ -5057,16 +5057,21 @@ registerLoadRequestForURL:(const GURL&)requestURL
[request setHTTPMethod:@"POST"]; [request setHTTPMethod:@"POST"];
[request setHTTPBody:POSTData]; [request setHTTPBody:POSTData];
[request setAllHTTPHeaderFields:self.currentHTTPHeaders]; [request setAllHTTPHeaderFields:self.currentHTTPHeaders];
GURL navigationURL = // As of iOS 11, WKWebView supports requests with POST data, so the
currentItem ? currentItem->GetURL() : GURL::EmptyGURL(); // Javascript POST workaround only needs to be used if the OS version is
std::unique_ptr<web::NavigationContextImpl> navigationContext = // less than iOS 11.
[self registerLoadRequestForURL:navigationURL if (!base::ios::IsRunningOnIOS11OrLater()) {
referrer:self.currentNavItemReferrer GURL navigationURL =
transition:self.currentTransition]; currentItem ? currentItem->GetURL() : GURL::EmptyGURL();
WKNavigation* navigation = [self loadPOSTRequest:request]; std::unique_ptr<web::NavigationContextImpl> navigationContext =
[_navigationStates setContext:std::move(navigationContext) [self registerLoadRequestForURL:navigationURL
forNavigation:navigation]; referrer:self.currentNavItemReferrer
return; transition:self.currentTransition];
WKNavigation* navigation = [self loadPOSTRequest:request];
[_navigationStates setContext:std::move(navigationContext)
forNavigation:navigation];
return;
}
} }
ProceduralBlock defaultNavigationBlock = ^{ ProceduralBlock defaultNavigationBlock = ^{
......
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