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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 if (info->GetResourceType() == ResourceType::MAIN_FRAME && host_zoom_map) { | 194 if (info->GetResourceType() == ResourceType::MAIN_FRAME && host_zoom_map) { |
195 const GURL& request_url = request()->url(); | 195 const GURL& request_url = request()->url(); |
196 info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL( | 196 info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL( |
197 info->GetRouteID(), | 197 info->GetRouteID(), |
198 request_url, host_zoom_map->GetZoomLevelForHostAndScheme( | 198 request_url, host_zoom_map->GetZoomLevelForHostAndScheme( |
199 request_url.scheme(), | 199 request_url.scheme(), |
200 net::GetHostOrSpecFromURL(request_url)))); | 200 net::GetHostOrSpecFromURL(request_url)))); |
201 } | 201 } |
202 | 202 |
| 203 // If the parent handler downloaded the resource to a file, grant the child |
| 204 // read permissions on it. Note: there is similar logic in |
| 205 // SyncResourceHandler. |
| 206 if (!response->head.download_file_path.empty()) { |
| 207 rdh_->RegisterDownloadedTempFile( |
| 208 info->GetChildID(), info->GetRequestID(), |
| 209 response->head.download_file_path); |
| 210 } |
| 211 |
203 response->head.request_start = request()->creation_time(); | 212 response->head.request_start = request()->creation_time(); |
204 response->head.response_start = TimeTicks::Now(); | 213 response->head.response_start = TimeTicks::Now(); |
205 info->filter()->Send(new ResourceMsg_ReceivedResponse(request_id, | 214 info->filter()->Send(new ResourceMsg_ReceivedResponse(request_id, |
206 response->head)); | 215 response->head)); |
207 sent_received_response_msg_ = true; | 216 sent_received_response_msg_ = true; |
208 | 217 |
209 if (request()->response_info().metadata.get()) { | 218 if (request()->response_info().metadata.get()) { |
210 std::vector<char> copy(request()->response_info().metadata->data(), | 219 std::vector<char> copy(request()->response_info().metadata->data(), |
211 request()->response_info().metadata->data() + | 220 request()->response_info().metadata->data() + |
212 request()->response_info().metadata->size()); | 221 request()->response_info().metadata->size()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 request()->LogUnblocked(); | 405 request()->LogUnblocked(); |
397 controller()->Resume(); | 406 controller()->Resume(); |
398 } | 407 } |
399 } | 408 } |
400 | 409 |
401 void AsyncResourceHandler::OnDefer() { | 410 void AsyncResourceHandler::OnDefer() { |
402 request()->LogBlockedBy("AsyncResourceHandler"); | 411 request()->LogBlockedBy("AsyncResourceHandler"); |
403 } | 412 } |
404 | 413 |
405 } // namespace content | 414 } // namespace content |
OLD | NEW |