OLD | NEW |
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 | 115 |
116 void ResourceLoader::init(const ResourceRequest& passedRequest) | 116 void ResourceLoader::init(const ResourceRequest& passedRequest) |
117 { | 117 { |
118 ResourceRequest request(passedRequest); | 118 ResourceRequest request(passedRequest); |
119 m_host->willSendRequest(m_resource->identifier(), request, ResourceResponse(
), m_options.initiatorInfo); | 119 m_host->willSendRequest(m_resource->identifier(), request, ResourceResponse(
), m_options.initiatorInfo); |
120 request.setReportLoadTiming(true); | 120 request.setReportLoadTiming(true); |
121 ASSERT(m_state != Terminated); | 121 ASSERT(m_state != Terminated); |
122 ASSERT(!request.isNull()); | 122 ASSERT(!request.isNull()); |
123 m_originalRequest = m_request = request; | 123 m_originalRequest = m_request = request; |
| 124 m_resource->updateRequest(request); |
124 m_host->didInitializeResourceLoader(this); | 125 m_host->didInitializeResourceLoader(this); |
125 } | 126 } |
126 | 127 |
127 void ResourceLoader::start() | 128 void ResourceLoader::start() |
128 { | 129 { |
129 ASSERT(!m_loader); | 130 ASSERT(!m_loader); |
130 ASSERT(!m_request.isNull()); | 131 ASSERT(!m_request.isNull()); |
131 ASSERT(m_deferredRequest.isNull()); | 132 ASSERT(m_deferredRequest.isNull()); |
132 | 133 |
133 m_host->willStartLoadingResource(m_request); | 134 m_host->willStartLoadingResource(m_request); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 return; | 268 return; |
268 } | 269 } |
269 m_host->redirectReceived(m_resource, redirectResponse); | 270 m_host->redirectReceived(m_resource, redirectResponse); |
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 |
274 m_host->willSendRequest(m_resource->identifier(), request, redirectResponse,
m_options.initiatorInfo); | 275 m_host->willSendRequest(m_resource->identifier(), request, redirectResponse,
m_options.initiatorInfo); |
275 request.setReportLoadTiming(true); | 276 request.setReportLoadTiming(true); |
276 ASSERT(!request.isNull()); | 277 ASSERT(!request.isNull()); |
| 278 m_resource->updateRequest(request); |
277 m_request = request; | 279 m_request = request; |
278 } | 280 } |
279 | 281 |
280 void ResourceLoader::didReceiveCachedMetadata(blink::WebURLLoader*, const char*
data, int length) | 282 void ResourceLoader::didReceiveCachedMetadata(blink::WebURLLoader*, const char*
data, int length) |
281 { | 283 { |
282 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con
nectionState == ConnectionStateReceivingData); | 284 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con
nectionState == ConnectionStateReceivingData); |
283 ASSERT(m_state == Initialized); | 285 ASSERT(m_state == Initialized); |
284 m_resource->setSerializedCachedMetadata(data, length); | 286 m_resource->setSerializedCachedMetadata(data, length); |
285 } | 287 } |
286 | 288 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 didReceiveResponse(0, responseOut); | 433 didReceiveResponse(0, responseOut); |
432 if (m_state == Terminated) | 434 if (m_state == Terminated) |
433 return; | 435 return; |
434 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse()
.resourceLoadInfo(); | 436 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse()
.resourceLoadInfo(); |
435 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL
oadInfo ? resourceLoadInfo->encodedDataLength : -1); | 437 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL
oadInfo ? resourceLoadInfo->encodedDataLength : -1); |
436 m_resource->setResourceBuffer(dataOut); | 438 m_resource->setResourceBuffer(dataOut); |
437 didFinishLoading(0, monotonicallyIncreasingTime()); | 439 didFinishLoading(0, monotonicallyIncreasingTime()); |
438 } | 440 } |
439 | 441 |
440 } | 442 } |
OLD | NEW |