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

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

Issue 2452593003: Fix incorrectly reported UMA OfflinePages.AggregatedRequestResult (Closed)
Patch Set: Fix tests Created 4 years, 2 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
Index: chrome/browser/android/offline_pages/offline_page_tab_helper.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_tab_helper.cc b/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
index 59db3ee9b7a344ef09fd94e4a2d37ca00b5e8ef5..9858838ba12151d848a41b65c9d6419076dd28ea 100644
--- a/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
+++ b/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
@@ -92,6 +92,11 @@ void OfflinePageTabHelper::DidFinishNavigation(
}
provisional_offline_info_.Clear();
+ // If the offline page has been loaded successfully, nothing more to do.
+ net::Error error_code = navigation_handle->GetNetErrorCode();
+ if (error_code == net::OK)
+ return;
+
// We might be reloading the URL in order to fetch the offline page.
// * If successful, nothing to do.
// * Otherwise, we're hitting error again. Bail out to avoid loop.
@@ -105,7 +110,6 @@ void OfflinePageTabHelper::DidFinishNavigation(
// eventually fail. To handle this, we will reload the page to force the
// offline interception if the error code matches the following list.
// Otherwise, the error page will be shown.
- net::Error error_code = navigation_handle->GetNetErrorCode();
if (error_code != net::ERR_INTERNET_DISCONNECTED &&
error_code != net::ERR_NAME_NOT_RESOLVED &&
error_code != net::ERR_ADDRESS_UNREACHABLE &&
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_request_job_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698