| Index: ios/web/web_state/ui/crw_web_controller.mm
|
| diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
|
| index 43caea72ed96a0788c00a1af0c7544fd003325ed..3d7b36f718cb20042cb665d3d05ff91d7d19d0cf 100644
|
| --- a/ios/web/web_state/ui/crw_web_controller.mm
|
| +++ b/ios/web/web_state/ui/crw_web_controller.mm
|
| @@ -1221,11 +1221,6 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| [self recordStateInHistory];
|
| }
|
|
|
| - // If the web view had been discarded, and this request is to load that
|
| - // URL again, then it's a rebuild and should use the cache.
|
| - BOOL preferCache = _expectedReconstructionURL.is_valid() &&
|
| - _expectedReconstructionURL == requestURL;
|
| -
|
| [_delegate webWillAddPendingURL:requestURL transition:transition];
|
| // Add or update pending url.
|
| if (_webStateImpl->GetNavigationManagerImpl().GetPendingItem()) {
|
| @@ -1239,15 +1234,6 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| transition:transition
|
| rendererInitiated:YES];
|
| }
|
| - // Update the cache mode for all the network requests issued by this web view.
|
| - // The mode is reset to CACHE_NORMAL after each page load.
|
| - if (_webStateImpl->GetCacheMode() != net::RequestTracker::CACHE_NORMAL) {
|
| - _webStateImpl->GetRequestTracker()->SetCacheModeFromUIThread(
|
| - _webStateImpl->GetCacheMode());
|
| - } else if (preferCache) {
|
| - _webStateImpl->GetRequestTracker()->SetCacheModeFromUIThread(
|
| - net::RequestTracker::CACHE_HISTORY);
|
| - }
|
| _webStateImpl->SetIsLoading(true);
|
| [_delegate webDidAddPendingURL];
|
| _webStateImpl->OnProvisionalNavigationStarted(requestURL);
|
| @@ -1455,19 +1441,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| [_delegate webDidUpdateSessionForLoadWithParams:params
|
| wasInitialNavigation:initialNavigation];
|
|
|
| - // If a non-default cache mode is passed in, it takes precedence over
|
| - // |reload|.
|
| - const BOOL reload = [self shouldReload:navUrl transition:transition];
|
| - if (params.cache_mode != net::RequestTracker::CACHE_NORMAL) {
|
| - _webStateImpl->SetCacheMode(params.cache_mode);
|
| - } else if (reload) {
|
| - _webStateImpl->SetCacheMode(net::RequestTracker::CACHE_RELOAD);
|
| - }
|
| -
|
| [self loadCurrentURL];
|
| -
|
| - // Change the cache mode back to CACHE_NORMAL after a reload.
|
| - _webStateImpl->SetCacheMode(net::RequestTracker::CACHE_NORMAL);
|
| }
|
|
|
| - (void)loadCurrentURL {
|
| @@ -1616,10 +1590,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
|
|
| - (void)reload {
|
| [_delegate webWillReload];
|
| -
|
| - _webStateImpl->SetCacheMode(net::RequestTracker::CACHE_RELOAD);
|
| [self reloadInternal];
|
| - _webStateImpl->SetCacheMode(net::RequestTracker::CACHE_NORMAL);
|
| }
|
|
|
| - (void)loadCancelled {
|
| @@ -1709,9 +1680,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| [[sessionController currentEntry] retain]);
|
| [sessionController goDelta:delta];
|
| if (fromEntry) {
|
| - _webStateImpl->SetCacheMode(net::RequestTracker::CACHE_HISTORY);
|
| [self finishHistoryNavigationFromEntry:fromEntry];
|
| - _webStateImpl->SetCacheMode(net::RequestTracker::CACHE_NORMAL);
|
| }
|
| }
|
|
|
| @@ -1760,9 +1729,8 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| // (some of) the requests of the next page. It's expected to be an edge case,
|
| // but if it becomes a problem it should be possible to notice it afterwards
|
| // and react to it (by warning the user or reloading the page for example).
|
| - _webStateImpl->SetCacheMode(net::RequestTracker::CACHE_NORMAL);
|
| _webStateImpl->GetRequestTracker()->SetCacheModeFromUIThread(
|
| - _webStateImpl->GetCacheMode());
|
| + net::RequestTracker::CACHE_NORMAL);
|
|
|
| [self restoreStateFromHistory];
|
| [self loadCompletedForURL:currentURL];
|
|
|