diff options
-rw-r--r-- | chromium/net/http/http_cache_transaction.cc | 1 | ||||
-rw-r--r-- | chromium/services/network/cors/cors_url_loader_factory.cc | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/chromium/net/http/http_cache_transaction.cc b/chromium/net/http/http_cache_transaction.cc index 835b976b178..9303583f974 100644 --- a/chromium/net/http/http_cache_transaction.cc +++ b/chromium/net/http/http_cache_transaction.cc @@ -2060,6 +2060,7 @@ int HttpCache::Transaction::DoHeadersPhaseCannotProceed(int result) { SetRequest(net_log_); entry_ = nullptr; + SetResponse(HttpResponseInfo()); // Bypass the cache for timeout scenario. if (result == ERR_CACHE_LOCK_TIMEOUT) diff --git a/chromium/services/network/cors/cors_url_loader_factory.cc b/chromium/services/network/cors/cors_url_loader_factory.cc index e677c8c020d..e8021ec8088 100644 --- a/chromium/services/network/cors/cors_url_loader_factory.cc +++ b/chromium/services/network/cors/cors_url_loader_factory.cc @@ -47,7 +47,17 @@ CORSURLLoaderFactory::CORSURLLoaderFactory( network_loader_factory_(std::move(network_loader_factory)), preflight_finalizer_(preflight_finalizer) {} -CORSURLLoaderFactory::~CORSURLLoaderFactory() = default; +CORSURLLoaderFactory::~CORSURLLoaderFactory() { + // Delete loaders one at a time, since deleting one loader can cause another + // loader waiting on it to fail synchronously, which could result in the other + // loader calling DestroyURLLoader(). + while (!loaders_.empty()) { + // No need to call context_->LoaderDestroyed(), since this method is only + // called from the NetworkContext's destructor, or when there are no + // remaining URLLoaders. + loaders_.erase(loaders_.begin()); + } +} void CORSURLLoaderFactory::OnLoaderCreated( std::unique_ptr<mojom::URLLoader> loader) { |