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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 1836543002: [ios] Removed RequestTracker dependency from WebLoadParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/web_load_params.mm ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « ios/web/navigation/web_load_params.mm ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698