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/async_resource_handler.h" | 5 #include "content/browser/loader/async_resource_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 if (info->GetResourceType() == ResourceType::MAIN_FRAME && host_zoom_map) { | 191 if (info->GetResourceType() == ResourceType::MAIN_FRAME && host_zoom_map) { |
192 const GURL& request_url = request()->url(); | 192 const GURL& request_url = request()->url(); |
193 info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL( | 193 info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL( |
194 info->GetRouteID(), | 194 info->GetRouteID(), |
195 request_url, host_zoom_map->GetZoomLevelForHostAndScheme( | 195 request_url, host_zoom_map->GetZoomLevelForHostAndScheme( |
196 request_url.scheme(), | 196 request_url.scheme(), |
197 net::GetHostOrSpecFromURL(request_url)))); | 197 net::GetHostOrSpecFromURL(request_url)))); |
198 } | 198 } |
199 | 199 |
| 200 // If the parent handler downloaded the resource to a file, grant the child |
| 201 // read permissions on it. Note: there is similar logic in |
| 202 // SyncResourceHandler. |
| 203 if (!response->head.download_file_path.empty()) { |
| 204 rdh_->RegisterDownloadedTempFile( |
| 205 info->GetChildID(), info->GetRequestID(), |
| 206 response->head.download_file_path); |
| 207 } |
| 208 |
200 response->head.request_start = request()->creation_time(); | 209 response->head.request_start = request()->creation_time(); |
201 response->head.response_start = TimeTicks::Now(); | 210 response->head.response_start = TimeTicks::Now(); |
202 info->filter()->Send(new ResourceMsg_ReceivedResponse(request_id, | 211 info->filter()->Send(new ResourceMsg_ReceivedResponse(request_id, |
203 response->head)); | 212 response->head)); |
204 sent_received_response_msg_ = true; | 213 sent_received_response_msg_ = true; |
205 | 214 |
206 if (request()->response_info().metadata.get()) { | 215 if (request()->response_info().metadata.get()) { |
207 std::vector<char> copy(request()->response_info().metadata->data(), | 216 std::vector<char> copy(request()->response_info().metadata->data(), |
208 request()->response_info().metadata->data() + | 217 request()->response_info().metadata->data() + |
209 request()->response_info().metadata->size()); | 218 request()->response_info().metadata->size()); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 request()->LogUnblocked(); | 397 request()->LogUnblocked(); |
389 controller()->Resume(); | 398 controller()->Resume(); |
390 } | 399 } |
391 } | 400 } |
392 | 401 |
393 void AsyncResourceHandler::OnDefer() { | 402 void AsyncResourceHandler::OnDefer() { |
394 request()->LogBlockedBy("AsyncResourceHandler"); | 403 request()->LogBlockedBy("AsyncResourceHandler"); |
395 } | 404 } |
396 | 405 |
397 } // namespace content | 406 } // namespace content |
OLD | NEW |