summaryrefslogtreecommitdiffstats
path: root/ios/web/web_state
diff options
context:
space:
mode:
Diffstat (limited to 'ios/web/web_state')
-rw-r--r--ios/web/web_state/ui/crw_web_controller.mm34
-rw-r--r--ios/web/web_state/web_state_impl.h9
-rw-r--r--ios/web/web_state/web_state_impl.mm9
3 files changed, 1 insertions, 51 deletions
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index d47b34a..62591e7 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1222,11 +1222,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()) {
@@ -1240,15 +1235,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);
@@ -1456,19 +1442,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 {
@@ -1617,10 +1591,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 {
@@ -1710,9 +1681,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);
}
}
@@ -1761,9 +1730,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];
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h
index dab28e0..639f293 100644
--- a/ios/web/web_state/web_state_impl.h
+++ b/ios/web/web_state/web_state_impl.h
@@ -208,12 +208,6 @@ class WebStateImpl : public WebState, public NavigationManagerDelegate {
// Returns the tracker for this WebStateImpl.
RequestTrackerImpl* GetRequestTracker();
- // Gets and sets the mode controlling the HTTP cache behavior.
- // TODO(rohitrao): As with the other RequestTracker-related methods, this
- // should become an internal detail of this class.
- net::RequestTracker::CacheMode GetCacheMode();
- void SetCacheMode(net::RequestTracker::CacheMode mode);
-
// Lazily creates (if necessary) and returns |request_group_id_|.
// IMPORTANT: This should not be used for anything other than associating this
// instance to network requests.
@@ -330,9 +324,6 @@ class WebStateImpl : public WebState, public NavigationManagerDelegate {
// Request tracker associted with this object.
scoped_refptr<RequestTrackerImpl> request_tracker_;
- // Mode controlling the HTTP cache behavior.
- net::RequestTracker::CacheMode cache_mode_;
-
// A number identifying this object. This number is injected into the user
// agent to allow the network layer to know which web view requests originated
// from.
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm
index 9cd3386..0fa982f 100644
--- a/ios/web/web_state/web_state_impl.mm
+++ b/ios/web/web_state/web_state_impl.mm
@@ -38,7 +38,6 @@ WebStateImpl::WebStateImpl(BrowserState* browser_state)
web_controller_(nil),
navigation_manager_(this, browser_state),
interstitial_(nullptr),
- cache_mode_(net::RequestTracker::CACHE_NORMAL),
weak_factory_(this) {
GlobalWebStateEventTracker::GetInstance()->OnWebStateCreated(this);
}
@@ -439,14 +438,6 @@ RequestTrackerImpl* WebStateImpl::GetRequestTracker() {
return request_tracker_.get();
}
-net::RequestTracker::CacheMode WebStateImpl::GetCacheMode() {
- return cache_mode_;
-}
-
-void WebStateImpl::SetCacheMode(net::RequestTracker::CacheMode mode) {
- cache_mode_ = mode;
-}
-
NSString* WebStateImpl::GetRequestGroupID() {
if (request_group_id_.get() == nil)
request_group_id_.reset([GenerateNewRequestGroupID() copy]);