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

Side by Side Diff: content/browser/loader/async_resource_handler.cc

Issue 82273002: Fix various issues in RedirectToFileResourceHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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.
202 if (!response->head.download_file_path.empty()) {
203 rdh_->RegisterDownloadedTempFile(
204 info->GetChildID(), info->GetRequestID(),
205 response->head.download_file_path);
206 }
mmenke 2014/01/16 16:43:26 Sure you don't want to keep this in the RedirectTo
davidben 2014/01/29 21:41:50 Well, keeping it in RedirectToFileResourceHandler
207
200 response->head.request_start = request()->creation_time(); 208 response->head.request_start = request()->creation_time();
201 response->head.response_start = TimeTicks::Now(); 209 response->head.response_start = TimeTicks::Now();
202 info->filter()->Send(new ResourceMsg_ReceivedResponse(request_id, 210 info->filter()->Send(new ResourceMsg_ReceivedResponse(request_id,
203 response->head)); 211 response->head));
204 sent_received_response_msg_ = true; 212 sent_received_response_msg_ = true;
205 213
206 if (request()->response_info().metadata.get()) { 214 if (request()->response_info().metadata.get()) {
207 std::vector<char> copy(request()->response_info().metadata->data(), 215 std::vector<char> copy(request()->response_info().metadata->data(),
208 request()->response_info().metadata->data() + 216 request()->response_info().metadata->data() +
209 request()->response_info().metadata->size()); 217 request()->response_info().metadata->size());
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 request()->LogUnblocked(); 390 request()->LogUnblocked();
383 controller()->Resume(); 391 controller()->Resume();
384 } 392 }
385 } 393 }
386 394
387 void AsyncResourceHandler::OnDefer() { 395 void AsyncResourceHandler::OnDefer() {
388 request()->LogBlockedBy("AsyncResourceHandler"); 396 request()->LogBlockedBy("AsyncResourceHandler");
389 } 397 }
390 398
391 } // namespace content 399 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698