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

Side by Side Diff: Source/core/fetch/ResourceLoader.cpp

Issue 126753002: Update the ResourceRequest in DocumentLoader after the embedder modified it (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 ResourceRequest& request(passedRequest.toMutableResourceRequest()); 261 ResourceRequest& request(passedRequest.toMutableResourceRequest());
262 ASSERT(!request.isNull()); 262 ASSERT(!request.isNull());
263 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe sponse()); 263 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe sponse());
264 ASSERT(!redirectResponse.isNull()); 264 ASSERT(!redirectResponse.isNull());
265 if (!m_host->shouldRequest(m_resource, request, m_options)) { 265 if (!m_host->shouldRequest(m_resource, request, m_options)) {
266 cancel(); 266 cancel();
267 return; 267 return;
268 } 268 }
269 m_host->redirectReceived(m_resource, redirectResponse); 269 m_host->redirectReceived(m_resource, redirectResponse);
270 m_host->willSendRequest(m_resource->identifier(), request, redirectResponse, m_options.initiatorInfo);
Nate Chapin 2014/01/07 22:30:12 If RenderFrameImpl::willSendRequest cancels the lo
270 m_resource->willSendRequest(request, redirectResponse); 271 m_resource->willSendRequest(request, redirectResponse);
271 if (request.isNull() || m_state == Terminated) 272 if (request.isNull() || m_state == Terminated)
272 return; 273 return;
273
274 m_host->willSendRequest(m_resource->identifier(), request, redirectResponse, m_options.initiatorInfo);
275 request.setReportLoadTiming(true); 274 request.setReportLoadTiming(true);
276 ASSERT(!request.isNull()); 275 ASSERT(!request.isNull());
277 m_request = request; 276 m_request = request;
278 } 277 }
279 278
280 void ResourceLoader::didReceiveCachedMetadata(blink::WebURLLoader*, const char* data, int length) 279 void ResourceLoader::didReceiveCachedMetadata(blink::WebURLLoader*, const char* data, int length)
281 { 280 {
282 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con nectionState == ConnectionStateReceivingData); 281 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con nectionState == ConnectionStateReceivingData);
283 ASSERT(m_state == Initialized); 282 ASSERT(m_state == Initialized);
284 m_resource->setSerializedCachedMetadata(data, length); 283 m_resource->setSerializedCachedMetadata(data, length);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 didReceiveResponse(0, responseOut); 430 didReceiveResponse(0, responseOut);
432 if (m_state == Terminated) 431 if (m_state == Terminated)
433 return; 432 return;
434 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo(); 433 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo();
435 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL oadInfo ? resourceLoadInfo->encodedDataLength : -1); 434 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL oadInfo ? resourceLoadInfo->encodedDataLength : -1);
436 m_resource->setResourceBuffer(dataOut); 435 m_resource->setResourceBuffer(dataOut);
437 didFinishLoading(0, monotonicallyIncreasingTime()); 436 didFinishLoading(0, monotonicallyIncreasingTime());
438 } 437 }
439 438
440 } 439 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698