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

Unified Diff: net/base/sdch_dictionary_fetcher.cc

Issue 597633002: Handle URLRequest::Read() returning false without an error or ERR_IO_PENDING. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | net/base/sdch_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/sdch_dictionary_fetcher.cc
diff --git a/net/base/sdch_dictionary_fetcher.cc b/net/base/sdch_dictionary_fetcher.cc
index 3e6f590852c3ec84ec343f516ceb6c6e481133f9..4a45f107e3e8b48270ddac282525b7141ae3a819 100644
--- a/net/base/sdch_dictionary_fetcher.cc
+++ b/net/base/sdch_dictionary_fetcher.cc
@@ -204,6 +204,14 @@ int SdchDictionaryFetcher::DoRead(int rv) {
return ERR_IO_PENDING;
DCHECK_NE(current_request_->status().error(), OK);
Ryan Hamilton 2014/09/23 21:38:38 Technically, the style guide prohibits "handling"
+ if (current_request_->status().error() == OK) {
+ // This "should never happen", but if it does the result will be
+ // an infinite loop. It's not clear how to handle a read failure
+ // without a promise to invoke the callback at some point in the future,
+ // so the request is failed.
+ SdchManager::SdchErrorRecovery(SdchManager::DICTIONARY_FETCH_READ_FAILED);
+ return ERR_FAILED;
+ }
return current_request_->status().error();
}
« no previous file with comments | « no previous file | net/base/sdch_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698