Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: third_party/WebKit/Source/core/fetch/RawResource.cpp

Issue 2561403003: Use getDataBufferingPolicy() instead of the redundant dataBufferingPolicy(). (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698