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

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

Issue 1913803002: not for review, but for running tests with an error code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « content/child/web_url_request_util.cc ('k') | no next file » | 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 ASSERT(resource->canUseCacheValidator()); 540 ASSERT(resource->canUseCacheValidator());
541 ASSERT(!resource->isCacheValidator()); 541 ASSERT(!resource->isCacheValidator());
542 ASSERT(!context().isControlledByServiceWorker()); 542 ASSERT(!context().isControlledByServiceWorker());
543 543
544 ResourceRequest revalidatingRequest(resource->resourceRequest()); 544 ResourceRequest revalidatingRequest(resource->resourceRequest());
545 revalidatingRequest.clearHTTPReferrer(); 545 revalidatingRequest.clearHTTPReferrer();
546 initializeResourceRequest(revalidatingRequest, resource->getType(), request. defer()); 546 initializeResourceRequest(revalidatingRequest, resource->getType(), request. defer());
547 547
548 const AtomicString& lastModified = resource->response().httpHeaderField(HTTP Names::Last_Modified); 548 const AtomicString& lastModified = resource->response().httpHeaderField(HTTP Names::Last_Modified);
549 const AtomicString& eTag = resource->response().httpHeaderField(HTTPNames::E Tag); 549 const AtomicString& eTag = resource->response().httpHeaderField(HTTPNames::E Tag);
550 if (!lastModified.isEmpty() || !eTag.isEmpty()) {
551 ASSERT(context().getCachePolicy() != CachePolicyReload);
552 if (context().getCachePolicy() == CachePolicyRevalidate)
553 revalidatingRequest.setHTTPHeaderField(HTTPNames::Cache_Control, "ma x-age=0");
554 }
555 if (!lastModified.isEmpty()) 550 if (!lastModified.isEmpty())
556 revalidatingRequest.setHTTPHeaderField(HTTPNames::If_Modified_Since, las tModified); 551 revalidatingRequest.setHTTPHeaderField(HTTPNames::If_Modified_Since, las tModified);
557 if (!eTag.isEmpty()) 552 if (!eTag.isEmpty())
558 revalidatingRequest.setHTTPHeaderField(HTTPNames::If_None_Match, eTag); 553 revalidatingRequest.setHTTPHeaderField(HTTPNames::If_None_Match, eTag);
559 554
560 double stalenessLifetime = resource->stalenessLifetime(); 555 double stalenessLifetime = resource->stalenessLifetime();
561 if (std::isfinite(stalenessLifetime) && stalenessLifetime > 0) { 556 if (std::isfinite(stalenessLifetime) && stalenessLifetime > 0) {
562 revalidatingRequest.setHTTPHeaderField(HTTPNames::Resource_Freshness, At omicString(String::format("max-age=%.0lf,stale-while-revalidate=%.0lf,age=%.0lf" , resource->freshnessLifetime(), stalenessLifetime, resource->currentAge()))); 557 revalidatingRequest.setHTTPHeaderField(HTTPNames::Resource_Freshness, At omicString(String::format("max-age=%.0lf,stale-while-revalidate=%.0lf,age=%.0lf" , resource->freshnessLifetime(), stalenessLifetime, resource->currentAge())));
563 } 558 }
564 559
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 visitor->trace(m_context); 1170 visitor->trace(m_context);
1176 visitor->trace(m_archive); 1171 visitor->trace(m_archive);
1177 visitor->trace(m_loaders); 1172 visitor->trace(m_loaders);
1178 visitor->trace(m_nonBlockingLoaders); 1173 visitor->trace(m_nonBlockingLoaders);
1179 visitor->trace(m_documentResources); 1174 visitor->trace(m_documentResources);
1180 visitor->trace(m_preloads); 1175 visitor->trace(m_preloads);
1181 visitor->trace(m_resourceTimingInfoMap); 1176 visitor->trace(m_resourceTimingInfoMap);
1182 } 1177 }
1183 1178
1184 } // namespace blink 1179 } // namespace blink
OLDNEW
« no previous file with comments | « content/child/web_url_request_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698