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

Unified Diff: chrome/browser/android/offline_pages/offline_page_request_job.cc

Issue 2699933002: Re-ordering triggering priority of offline pages (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/offline_page_request_job.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_request_job.cc b/chrome/browser/android/offline_pages/offline_page_request_job.cc
index d327a5ae4c34ff8117a8d60017a996cd17bc075e..4f96f6c2344bb69205b3527a277c7f002d2c0cd9 100644
--- a/chrome/browser/android/offline_pages/offline_page_request_job.cc
+++ b/chrome/browser/android/offline_pages/offline_page_request_job.cc
@@ -134,6 +134,14 @@ NetworkState GetNetworkState(net::URLRequest* request,
if (net::NetworkChangeNotifier::IsOffline())
return NetworkState::DISCONNECTED_NETWORK;
+
+ // If offline header contains a reason other than RELOAD, the offline page
+ // should be forced to load even when the network is connected.
+ if (offline_header.reason != OfflinePageHeader::Reason::NONE &&
+ offline_header.reason != OfflinePageHeader::Reason::RELOAD) {
+ return NetworkState::FORCE_OFFLINE_ON_CONNECTED_NETWORK;
+ }
+
// Checks if previews are allowed, the network is slow, and the request is
// allowed to be shown for previews.
if (previews_decider &&
@@ -142,12 +150,8 @@ NetworkState GetNetworkState(net::URLRequest* request,
return NetworkState::PROHIBITIVELY_SLOW_NETWORK;
}
- // If offline header contains a reason other than RELOAD, the offline page
- // should be forced to load even when the network is connected.
- return (offline_header.reason != OfflinePageHeader::Reason::NONE &&
- offline_header.reason != OfflinePageHeader::Reason::RELOAD)
- ? NetworkState::FORCE_OFFLINE_ON_CONNECTED_NETWORK
- : NetworkState::CONNECTED_NETWORK;
+ // Otherwise, the network state is a good network.
+ return NetworkState::CONNECTED_NETWORK;
}
OfflinePageRequestJob::AggregatedRequestResult
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698