| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 })); | 251 })); |
| 252 return headers.contains(headerName); | 252 return headers.contains(headerName); |
| 253 } | 253 } |
| 254 | 254 |
| 255 static bool isCacheableHTTPMethod(const AtomicString& method) { | 255 static bool isCacheableHTTPMethod(const AtomicString& method) { |
| 256 // Per http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.10, | 256 // Per http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.10, |
| 257 // these methods always invalidate the cache entry. | 257 // these methods always invalidate the cache entry. |
| 258 return method != "POST" && method != "PUT" && method != "DELETE"; | 258 return method != "POST" && method != "PUT" && method != "DELETE"; |
| 259 } | 259 } |
| 260 | 260 |
| 261 bool RawResource::canReuse(const ResourceRequest& newRequest) const { | 261 bool RawResource::canReuse(const FetchRequest& newFetchRequest) const { |
| 262 const ResourceRequest& newRequest = newFetchRequest.resourceRequest(); |
| 263 |
| 262 if (getDataBufferingPolicy() == DoNotBufferData) | 264 if (getDataBufferingPolicy() == DoNotBufferData) |
| 263 return false; | 265 return false; |
| 264 | 266 |
| 265 if (!isCacheableHTTPMethod(resourceRequest().httpMethod())) | 267 if (!isCacheableHTTPMethod(resourceRequest().httpMethod())) |
| 266 return false; | 268 return false; |
| 267 if (resourceRequest().httpMethod() != newRequest.httpMethod()) | 269 if (resourceRequest().httpMethod() != newRequest.httpMethod()) |
| 268 return false; | 270 return false; |
| 269 | 271 |
| 270 if (resourceRequest().httpBody() != newRequest.httpBody()) | 272 if (resourceRequest().httpBody() != newRequest.httpBody()) |
| 271 return false; | 273 return false; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 SECURITY_CHECK(m_state != NotAddedAsClient); | 358 SECURITY_CHECK(m_state != NotAddedAsClient); |
| 357 SECURITY_CHECK(m_state != NotifyFinished); | 359 SECURITY_CHECK(m_state != NotifyFinished); |
| 358 SECURITY_CHECK(resource->errorOccurred() || | 360 SECURITY_CHECK(resource->errorOccurred() || |
| 359 (m_state == ResponseReceived || | 361 (m_state == ResponseReceived || |
| 360 m_state == SetSerializedCachedMetadata || | 362 m_state == SetSerializedCachedMetadata || |
| 361 m_state == DataReceived || m_state == DataDownloaded)); | 363 m_state == DataReceived || m_state == DataDownloaded)); |
| 362 m_state = NotifyFinished; | 364 m_state = NotifyFinished; |
| 363 } | 365 } |
| 364 | 366 |
| 365 } // namespace blink | 367 } // namespace blink |
| OLD | NEW |