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

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

Issue 82273002: Fix various issues in RedirectToFileResourceHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename test fixture Created 6 years, 9 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 | « content/browser/loader/resource_loader_unittest.cc ('k') | content/browser/loader/temporary_file_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/sync_resource_handler.cc
diff --git a/content/browser/loader/sync_resource_handler.cc b/content/browser/loader/sync_resource_handler.cc
index 865b29e404e0c1e276535bf759d4a55108d17c33..e39ae1c7d46241e366da2776938fa4ad8a7fe9f0 100644
--- a/content/browser/loader/sync_resource_handler.cc
+++ b/content/browser/loader/sync_resource_handler.cc
@@ -86,6 +86,18 @@ bool SyncResourceHandler::OnResponseStarted(
DevToolsNetLogObserver::PopulateResponseInfo(request(), response);
+ // If the parent handler downloaded the resource to a file, grant the child
+ // read permissions on it. Note: there is similar logic in
+ // AsyncResourceHandler.
+ //
+ // TODO(davidben): Can we remove support for download_file in sync requests
+ // altogether? I don't think Blink ever makes such requests.
+ if (!response->head.download_file_path.empty()) {
+ rdh_->RegisterDownloadedTempFile(
+ info->GetChildID(), info->GetRequestID(),
+ response->head.download_file_path);
+ }
+
// We don't care about copying the status here.
result_.headers = response->head.headers;
result_.mime_type = response->head.mime_type;
« no previous file with comments | « content/browser/loader/resource_loader_unittest.cc ('k') | content/browser/loader/temporary_file_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698