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

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

Issue 2452593003: Fix incorrectly reported UMA OfflinePages.AggregatedRequestResult (Closed)
Patch Set: Address feedback 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 9968ee6b77424996c98bbd021da094475c578c89..3b42ab57bca4584b1d9658e263a6b4a108fd2322 100644
--- a/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
+++ b/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
@@ -96,6 +96,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.
@@ -109,7 +114,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 &&

Powered by Google App Engine
This is Rietveld 408576698