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 | |
212 response->head.request_start = request()->creation_time(); | 203 response->head.request_start = request()->creation_time(); |
213 response->head.response_start = TimeTicks::Now(); | 204 response->head.response_start = TimeTicks::Now(); |
214 info->filter()->Send(new ResourceMsg_ReceivedResponse(request_id, | 205 info->filter()->Send(new ResourceMsg_ReceivedResponse(request_id, |
215 response->head)); | 206 response->head)); |
216 sent_received_response_msg_ = true; | 207 sent_received_response_msg_ = true; |
217 | 208 |
218 if (request()->response_info().metadata.get()) { | 209 if (request()->response_info().metadata.get()) { |
219 std::vector<char> copy(request()->response_info().metadata->data(), | 210 std::vector<char> copy(request()->response_info().metadata->data(), |
220 request()->response_info().metadata->data() + | 211 request()->response_info().metadata->data() + |
221 request()->response_info().metadata->size()); | 212 request()->response_info().metadata->size()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 request()->LogUnblocked(); | 396 request()->LogUnblocked(); |
406 controller()->Resume(); | 397 controller()->Resume(); |
407 } | 398 } |
408 } | 399 } |
409 | 400 |
410 void AsyncResourceHandler::OnDefer() { | 401 void AsyncResourceHandler::OnDefer() { |
411 request()->LogBlockedBy("AsyncResourceHandler"); | 402 request()->LogBlockedBy("AsyncResourceHandler"); |
412 } | 403 } |
413 | 404 |
414 } // namespace content | 405 } // namespace content |
OLD | NEW |