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

Unified Diff: content/browser/loader/mime_sniffing_resource_handler.cc

Issue 2626663002: Update MimeSniffingResourceHandler tests to use MockResourceLoader. (Closed)
Patch Set: Fix test? Created 3 years, 11 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 | content/browser/loader/mime_sniffing_resource_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/mime_sniffing_resource_handler.cc
diff --git a/content/browser/loader/mime_sniffing_resource_handler.cc b/content/browser/loader/mime_sniffing_resource_handler.cc
index 111e3f69ddf970f8245d43d9b3836cdfad835257..6c13e04700392ec80d311c06462fff2397f3d22e 100644
--- a/content/browser/loader/mime_sniffing_resource_handler.cc
+++ b/content/browser/loader/mime_sniffing_resource_handler.cc
@@ -245,8 +245,11 @@ void MimeSniffingResourceHandler::Resume() {
}
// Otherwise proceed with the replay of the response. If it is successful,
- // it will resume the request.
- AdvanceState();
+ // it will resume the request. Posted as a task to avoid re-entrancy into
+ // the calling class.
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&MimeSniffingResourceHandler::AdvanceState,
+ weak_ptr_factory_.GetWeakPtr()));
Randy Smith (Not in Mondays) 2017/01/12 18:44:29 Hmmm. Your top level comment is that this PostTas
mmenke 2017/01/12 19:04:01 I think what I said is correct, but it's not exact
mmenke 2017/01/12 19:06:32 (Also note that in pass through mode, we call resu
Randy Smith (Not in Mondays) 2017/01/12 19:08:58 *bonk* That's what I was missing. Thank you. LG
mmenke 2017/01/12 19:17:15 Note that there was a bug in my argument about the
}
void MimeSniffingResourceHandler::Cancel() {
« no previous file with comments | « no previous file | content/browser/loader/mime_sniffing_resource_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698