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

Unified Diff: content/browser/appcache/appcache_subresource_url_factory.cc

Issue 2991443002: The Appcache subresource URL factory needs to inform the URLLoaderClient if there is a failure. (Closed)
Patch Set: Disable the test for Android Created 3 years, 5 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: content/browser/appcache/appcache_subresource_url_factory.cc
diff --git a/content/browser/appcache/appcache_subresource_url_factory.cc b/content/browser/appcache/appcache_subresource_url_factory.cc
index 4b6f9fd36b56372749525dd7296dfdc9fb592209..62661651caa7c9372ecf07778ad393150c588c3a 100644
--- a/content/browser/appcache/appcache_subresource_url_factory.cc
+++ b/content/browser/appcache/appcache_subresource_url_factory.cc
@@ -63,17 +63,17 @@ void AppCacheSubresourceURLFactory::CreateLoaderAndStart(
// If the host is invalid, it means that the renderer has probably died.
// (Frame has navigated elsewhere?)
- if (!appcache_host_.get())
+ if (!appcache_host_.get()) {
+ NotifyError(std::move(client), net::ERR_FAILED);
return;
+ }
std::unique_ptr<AppCacheRequestHandler> handler =
appcache_host_->CreateRequestHandler(
AppCacheURLLoaderRequest::Create(request), request.resource_type,
request.should_reset_appcache);
if (!handler) {
- ResourceRequestCompletionStatus request_result;
- request_result.error_code = net::ERR_FAILED;
- client->OnComplete(request_result);
+ NotifyError(std::move(client), net::ERR_FAILED);
return;
}
@@ -109,4 +109,12 @@ void AppCacheSubresourceURLFactory::OnConnectionError() {
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
+void AppCacheSubresourceURLFactory::NotifyError(
+ mojom::URLLoaderClientPtr client,
+ int error_code) {
+ ResourceRequestCompletionStatus request_result;
+ request_result.error_code = error_code;
+ client->OnComplete(request_result);
+}
+
} // namespace content
« no previous file with comments | « content/browser/appcache/appcache_subresource_url_factory.h ('k') | content/browser/appcache/appcache_url_loader_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698