Chromium Code Reviews| Index: chrome/browser/android/offline_pages/prerendering_loader.cc |
| diff --git a/chrome/browser/android/offline_pages/prerendering_loader.cc b/chrome/browser/android/offline_pages/prerendering_loader.cc |
| index 6f454028d33ae1ed2e3157747b55aca825368e9b..b4a7ef39ce1b77b63e422086529318d52d0ebdd4 100644 |
| --- a/chrome/browser/android/offline_pages/prerendering_loader.cc |
| +++ b/chrome/browser/android/offline_pages/prerendering_loader.cc |
| @@ -157,17 +157,29 @@ void PrerenderingLoader::HandleLoadingStopped() { |
| if (IsIdle()) |
| return; |
| - if (adapter_->IsActive()) { |
| - DVLOG(1) << "Load failed: " << adapter_->GetFinalStatus(); |
| - adapter_->DestroyActive(); |
| - } |
| // Request status depends on whether we are still loading (failed) or |
| // did load and then loading was stopped (cancel - from prerender stack). |
| Offliner::RequestStatus request_status = |
| IsLoaded() ? Offliner::RequestStatus::PRERENDERING_CANCELED |
| : Offliner::RequestStatus::PRERENDERING_FAILED; |
| - // TODO(dougarnett): For failure, determine from final status if retry-able |
| - // and report different failure statuses if retry-able or not. |
| + |
| + if (adapter_->IsActive()) { |
| + prerender::FinalStatus final_status = adapter_->GetFinalStatus(); |
| + DVLOG(1) << "Load failed: " << final_status; |
| + |
| + // Loss of network connection can show up as unsupported scheme per |
| + // a redirect to a special data URL is used to navigate to error page. |
| + // We want to be able to retry these request so for now treat any |
| + // unsupported scheme error as a cancel. See issue 642025. |
|
Pete Williamson
2016/08/30 20:42:47
If we are closing bug 642025 after this change, we
dougarnett
2016/08/31 16:10:52
Acknowledged.
|
| + // TODO(dougarnett): Create whitelist of final status codes that should |
| + // not be considered failures (and define new RequestStatus code for them). |
| + if (adapter_->GetFinalStatus() == |
| + prerender::FinalStatus::FINAL_STATUS_UNSUPPORTED_SCHEME) { |
| + request_status = Offliner::RequestStatus::PRERENDERING_CANCELED; |
| + } |
| + adapter_->DestroyActive(); |
| + } |
| + |
| snapshot_controller_.reset(nullptr); |
| session_contents_.reset(nullptr); |
| state_ = State::IDLE; |