OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/loader/sync_resource_handler.h" | 5 #include "content/browser/loader/sync_resource_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/browser/devtools/devtools_netlog_observer.h" | 8 #include "content/browser/devtools/devtools_netlog_observer.h" |
9 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 9 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
10 #include "content/browser/loader/resource_message_filter.h" | 10 #include "content/browser/loader/resource_message_filter.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (!info->filter()) | 76 if (!info->filter()) |
77 return false; | 77 return false; |
78 | 78 |
79 if (rdh_->delegate()) { | 79 if (rdh_->delegate()) { |
80 rdh_->delegate()->OnResponseStarted( | 80 rdh_->delegate()->OnResponseStarted( |
81 request(), info->GetContext(), response, info->filter()); | 81 request(), info->GetContext(), response, info->filter()); |
82 } | 82 } |
83 | 83 |
84 DevToolsNetLogObserver::PopulateResponseInfo(request(), response); | 84 DevToolsNetLogObserver::PopulateResponseInfo(request(), response); |
85 | 85 |
| 86 // If the parent handler downloaded the resource to a file, grant the child |
| 87 // read permissions on it. |
| 88 if (!response->head.download_file_path.empty()) { |
| 89 rdh_->RegisterDownloadedTempFile( |
| 90 info->GetChildID(), info->GetRequestID(), |
| 91 response->head.download_file_path); |
| 92 } |
| 93 |
86 // We don't care about copying the status here. | 94 // We don't care about copying the status here. |
87 result_.headers = response->head.headers; | 95 result_.headers = response->head.headers; |
88 result_.mime_type = response->head.mime_type; | 96 result_.mime_type = response->head.mime_type; |
89 result_.charset = response->head.charset; | 97 result_.charset = response->head.charset; |
90 result_.download_file_path = response->head.download_file_path; | 98 result_.download_file_path = response->head.download_file_path; |
91 result_.request_time = response->head.request_time; | 99 result_.request_time = response->head.request_time; |
92 result_.response_time = response->head.response_time; | 100 result_.response_time = response->head.response_time; |
93 result_.load_timing = response->head.load_timing; | 101 result_.load_timing = response->head.load_timing; |
94 result_.devtools_info = response->head.devtools_info; | 102 result_.devtools_info = response->head.devtools_info; |
95 return true; | 103 return true; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 148 } |
141 | 149 |
142 void SyncResourceHandler::OnDataDownloaded( | 150 void SyncResourceHandler::OnDataDownloaded( |
143 int request_id, | 151 int request_id, |
144 int bytes_downloaded) { | 152 int bytes_downloaded) { |
145 // Sync requests don't involve ResourceMsg_DataDownloaded messages | 153 // Sync requests don't involve ResourceMsg_DataDownloaded messages |
146 // being sent back to renderers as progress is made. | 154 // being sent back to renderers as progress is made. |
147 } | 155 } |
148 | 156 |
149 } // namespace content | 157 } // namespace content |
OLD | NEW |