| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 RefPtr<SubresourceLoader> protect(this); | 153 RefPtr<SubresourceLoader> protect(this); |
| 154 | 154 |
| 155 if (m_resource->resourceToRevalidate()) { | 155 if (m_resource->resourceToRevalidate()) { |
| 156 if (response.httpStatusCode() == 304) { | 156 if (response.httpStatusCode() == 304) { |
| 157 // 304 Not modified / Use local copy | 157 // 304 Not modified / Use local copy |
| 158 // Existing resource is ok, just use it updating the expiration time
. | 158 // Existing resource is ok, just use it updating the expiration time
. |
| 159 m_state = Revalidating; | 159 m_state = Revalidating; |
| 160 memoryCache()->revalidationSucceeded(m_resource, response); | 160 memoryCache()->revalidationSucceeded(m_resource, response); |
| 161 if (!reachedTerminalState()) { | 161 if (!reachedTerminalState()) { |
| 162 ResourceLoader::didReceiveResponse(response); | 162 ResourceLoader::didReceiveResponse(response); |
| 163 didFinishLoading(currentTime()); | 163 didFinishLoading(monotonicallyIncreasingTime()); |
| 164 } | 164 } |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 // Did not get 304 response, continue as a regular resource load. | 167 // Did not get 304 response, continue as a regular resource load. |
| 168 memoryCache()->revalidationFailed(m_resource); | 168 memoryCache()->revalidationFailed(m_resource); |
| 169 } | 169 } |
| 170 | 170 |
| 171 m_resource->setResponse(response); | 171 m_resource->setResponse(response); |
| 172 if (reachedTerminalState()) | 172 if (reachedTerminalState()) |
| 173 return; | 173 return; |
| 174 ResourceLoader::didReceiveResponse(response); | 174 ResourceLoader::didReceiveResponse(response); |
| 175 | 175 |
| 176 if (m_loadingMultipartContent) { | 176 if (m_loadingMultipartContent) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 if (reachedTerminalState()) | 302 if (reachedTerminalState()) |
| 303 return; | 303 return; |
| 304 m_resource->stopLoading(); | 304 m_resource->stopLoading(); |
| 305 m_documentLoader->removeSubresourceLoader(this); | 305 m_documentLoader->removeSubresourceLoader(this); |
| 306 } | 306 } |
| 307 m_document = 0; | 307 m_document = 0; |
| 308 ResourceLoader::releaseResources(); | 308 ResourceLoader::releaseResources(); |
| 309 } | 309 } |
| 310 | 310 |
| 311 } | 311 } |
| OLD | NEW |