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 return headers.contains(headerName); | 251 return headers.contains(headerName); |
252 } | 252 } |
253 | 253 |
254 static bool isCacheableHTTPMethod(const AtomicString& method) { | 254 static bool isCacheableHTTPMethod(const AtomicString& method) { |
255 // Per http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.10, | 255 // Per http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.10, |
256 // these methods always invalidate the cache entry. | 256 // these methods always invalidate the cache entry. |
257 return method != "POST" && method != "PUT" && method != "DELETE"; | 257 return method != "POST" && method != "PUT" && method != "DELETE"; |
258 } | 258 } |
259 | 259 |
260 bool RawResource::canReuse(const ResourceRequest& newRequest) const { | 260 bool RawResource::canReuse(const ResourceRequest& newRequest) const { |
261 if (dataBufferingPolicy() == DoNotBufferData) | 261 if (getDataBufferingPolicy() == DoNotBufferData) |
262 return false; | 262 return false; |
263 | 263 |
264 if (!isCacheableHTTPMethod(resourceRequest().httpMethod())) | 264 if (!isCacheableHTTPMethod(resourceRequest().httpMethod())) |
265 return false; | 265 return false; |
266 if (resourceRequest().httpMethod() != newRequest.httpMethod()) | 266 if (resourceRequest().httpMethod() != newRequest.httpMethod()) |
267 return false; | 267 return false; |
268 | 268 |
269 if (resourceRequest().httpBody() != newRequest.httpBody()) | 269 if (resourceRequest().httpBody() != newRequest.httpBody()) |
270 return false; | 270 return false; |
271 | 271 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 SECURITY_CHECK(m_state != NotAddedAsClient); | 355 SECURITY_CHECK(m_state != NotAddedAsClient); |
356 SECURITY_CHECK(m_state != NotifyFinished); | 356 SECURITY_CHECK(m_state != NotifyFinished); |
357 SECURITY_CHECK(resource->errorOccurred() || | 357 SECURITY_CHECK(resource->errorOccurred() || |
358 (m_state == ResponseReceived || | 358 (m_state == ResponseReceived || |
359 m_state == SetSerializedCachedMetadata || | 359 m_state == SetSerializedCachedMetadata || |
360 m_state == DataReceived || m_state == DataDownloaded)); | 360 m_state == DataReceived || m_state == DataDownloaded)); |
361 m_state = NotifyFinished; | 361 m_state = NotifyFinished; |
362 } | 362 } |
363 | 363 |
364 } // namespace blink | 364 } // namespace blink |
OLD | NEW |