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

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

Issue 2695923010: Add Network.setSendRequestIdHeader and use it in headless (Closed)
Patch Set: Fix the layout test Created 3 years, 9 months 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
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 static bool shouldIgnoreHeaderForCacheReuse(AtomicString headerName) { 241 static bool shouldIgnoreHeaderForCacheReuse(AtomicString headerName) {
242 // FIXME: This list of headers that don't affect cache policy almost certainly 242 // FIXME: This list of headers that don't affect cache policy almost certainly
243 // isn't complete. 243 // isn't complete.
244 DEFINE_STATIC_LOCAL( 244 DEFINE_STATIC_LOCAL(
245 HashSet<AtomicString>, headers, 245 HashSet<AtomicString>, headers,
246 ({ 246 ({
247 "Cache-Control", "If-Modified-Since", "If-None-Match", "Origin", 247 "Cache-Control", "If-Modified-Since", "If-None-Match", "Origin",
248 "Pragma", "Purpose", "Referer", "User-Agent", 248 "Pragma", "Purpose", "Referer", "User-Agent",
249 HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id, 249 HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id,
250 HTTPNames::X_DevTools_Request_Id,
250 })); 251 }));
251 return headers.contains(headerName); 252 return headers.contains(headerName);
252 } 253 }
253 254
254 static bool isCacheableHTTPMethod(const AtomicString& method) { 255 static bool isCacheableHTTPMethod(const AtomicString& method) {
255 // 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,
256 // these methods always invalidate the cache entry. 257 // these methods always invalidate the cache entry.
257 return method != "POST" && method != "PUT" && method != "DELETE"; 258 return method != "POST" && method != "PUT" && method != "DELETE";
258 } 259 }
259 260
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 SECURITY_CHECK(m_state != NotAddedAsClient); 356 SECURITY_CHECK(m_state != NotAddedAsClient);
356 SECURITY_CHECK(m_state != NotifyFinished); 357 SECURITY_CHECK(m_state != NotifyFinished);
357 SECURITY_CHECK(resource->errorOccurred() || 358 SECURITY_CHECK(resource->errorOccurred() ||
358 (m_state == ResponseReceived || 359 (m_state == ResponseReceived ||
359 m_state == SetSerializedCachedMetadata || 360 m_state == SetSerializedCachedMetadata ||
360 m_state == DataReceived || m_state == DataDownloaded)); 361 m_state == DataReceived || m_state == DataDownloaded));
361 m_state = NotifyFinished; 362 m_state = NotifyFinished;
362 } 363 }
363 364
364 } // namespace blink 365 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698