| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 m_loader.clear(); | 119 m_loader.clear(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 m_deferredRequest = ResourceRequest(); | 122 m_deferredRequest = ResourceRequest(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void ResourceLoader::init(const ResourceRequest& passedRequest) | 125 void ResourceLoader::init(const ResourceRequest& passedRequest) |
| 126 { | 126 { |
| 127 ResourceRequest request(passedRequest); | 127 ResourceRequest request(passedRequest); |
| 128 m_host->willSendRequest(m_resource->identifier(), request, ResourceResponse(
), m_options.initiatorInfo); | 128 m_host->willSendRequest(m_resource->identifier(), request, ResourceResponse(
), m_options.initiatorInfo); |
| 129 request.setReportLoadTiming(true); | |
| 130 ASSERT(m_state != Terminated); | 129 ASSERT(m_state != Terminated); |
| 131 ASSERT(!request.isNull()); | 130 ASSERT(!request.isNull()); |
| 132 m_originalRequest = m_request = applyOptions(request); | 131 m_originalRequest = m_request = applyOptions(request); |
| 133 m_resource->updateRequest(request); | 132 m_resource->updateRequest(request); |
| 134 m_host->didInitializeResourceLoader(this); | 133 m_host->didInitializeResourceLoader(this); |
| 135 } | 134 } |
| 136 | 135 |
| 137 void ResourceLoader::start() | 136 void ResourceLoader::start() |
| 138 { | 137 { |
| 139 ASSERT(!m_loader); | 138 ASSERT(!m_loader); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 return; | 290 return; |
| 292 } | 291 } |
| 293 | 292 |
| 294 applyOptions(request); // canAccessRedirect() can modify m_options so we sho
uld re-apply it. | 293 applyOptions(request); // canAccessRedirect() can modify m_options so we sho
uld re-apply it. |
| 295 m_host->redirectReceived(m_resource, redirectResponse); | 294 m_host->redirectReceived(m_resource, redirectResponse); |
| 296 m_resource->willSendRequest(request, redirectResponse); | 295 m_resource->willSendRequest(request, redirectResponse); |
| 297 if (request.isNull() || m_state == Terminated) | 296 if (request.isNull() || m_state == Terminated) |
| 298 return; | 297 return; |
| 299 | 298 |
| 300 m_host->willSendRequest(m_resource->identifier(), request, redirectResponse,
m_options.initiatorInfo); | 299 m_host->willSendRequest(m_resource->identifier(), request, redirectResponse,
m_options.initiatorInfo); |
| 301 request.setReportLoadTiming(true); | |
| 302 ASSERT(!request.isNull()); | 300 ASSERT(!request.isNull()); |
| 303 m_resource->updateRequest(request); | 301 m_resource->updateRequest(request); |
| 304 m_request = request; | 302 m_request = request; |
| 305 } | 303 } |
| 306 | 304 |
| 307 void ResourceLoader::didReceiveCachedMetadata(blink::WebURLLoader*, const char*
data, int length) | 305 void ResourceLoader::didReceiveCachedMetadata(blink::WebURLLoader*, const char*
data, int length) |
| 308 { | 306 { |
| 309 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con
nectionState == ConnectionStateReceivingData); | 307 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con
nectionState == ConnectionStateReceivingData); |
| 310 ASSERT(m_state == Initialized); | 308 ASSERT(m_state == Initialized); |
| 311 m_resource->setSerializedCachedMetadata(data, length); | 309 m_resource->setSerializedCachedMetadata(data, length); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); | 496 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); |
| 499 } | 497 } |
| 500 | 498 |
| 501 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const | 499 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const |
| 502 { | 500 { |
| 503 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC
redentials); | 501 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC
redentials); |
| 504 return request; | 502 return request; |
| 505 } | 503 } |
| 506 | 504 |
| 507 } | 505 } |
| OLD | NEW |