Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 537 ASSERT(resource->canUseCacheValidator()); | 537 ASSERT(resource->canUseCacheValidator()); |
| 538 ASSERT(!resource->isCacheValidator()); | 538 ASSERT(!resource->isCacheValidator()); |
| 539 ASSERT(!context().isControlledByServiceWorker()); | 539 ASSERT(!context().isControlledByServiceWorker()); |
| 540 | 540 |
| 541 ResourceRequest revalidatingRequest(resource->resourceRequest()); | 541 ResourceRequest revalidatingRequest(resource->resourceRequest()); |
| 542 revalidatingRequest.clearHTTPReferrer(); | 542 revalidatingRequest.clearHTTPReferrer(); |
| 543 initializeResourceRequest(revalidatingRequest, resource->getType(), request. defer()); | 543 initializeResourceRequest(revalidatingRequest, resource->getType(), request. defer()); |
| 544 | 544 |
| 545 const AtomicString& lastModified = resource->response().httpHeaderField(HTTP Names::Last_Modified); | 545 const AtomicString& lastModified = resource->response().httpHeaderField(HTTP Names::Last_Modified); |
| 546 const AtomicString& eTag = resource->response().httpHeaderField(HTTPNames::E Tag); | 546 const AtomicString& eTag = resource->response().httpHeaderField(HTTPNames::E Tag); |
| 547 if (!lastModified.isEmpty() || !eTag.isEmpty()) { | |
| 548 ASSERT(context().getCachePolicy() != CachePolicyReload); | |
| 549 if (context().getCachePolicy() == CachePolicyRevalidate) | |
|
kinuko
2016/05/12 08:45:05
Hmm, it looks what we're changing here and the tes
Takashi Toyoshima
2016/05/13 05:27:13
I conformed that this code path is used for the im
| |
| 550 revalidatingRequest.setHTTPHeaderField(HTTPNames::Cache_Control, "ma x-age=0"); | |
| 551 } | |
| 552 if (!lastModified.isEmpty()) | 547 if (!lastModified.isEmpty()) |
| 553 revalidatingRequest.setHTTPHeaderField(HTTPNames::If_Modified_Since, las tModified); | 548 revalidatingRequest.setHTTPHeaderField(HTTPNames::If_Modified_Since, las tModified); |
| 554 if (!eTag.isEmpty()) | 549 if (!eTag.isEmpty()) |
| 555 revalidatingRequest.setHTTPHeaderField(HTTPNames::If_None_Match, eTag); | 550 revalidatingRequest.setHTTPHeaderField(HTTPNames::If_None_Match, eTag); |
| 556 | 551 |
| 557 double stalenessLifetime = resource->stalenessLifetime(); | 552 double stalenessLifetime = resource->stalenessLifetime(); |
| 558 if (std::isfinite(stalenessLifetime) && stalenessLifetime > 0) { | 553 if (std::isfinite(stalenessLifetime) && stalenessLifetime > 0) { |
| 559 revalidatingRequest.setHTTPHeaderField(HTTPNames::Resource_Freshness, At omicString(String::format("max-age=%.0lf,stale-while-revalidate=%.0lf,age=%.0lf" , resource->freshnessLifetime(), stalenessLifetime, resource->currentAge()))); | 554 revalidatingRequest.setHTTPHeaderField(HTTPNames::Resource_Freshness, At omicString(String::format("max-age=%.0lf,stale-while-revalidate=%.0lf,age=%.0lf" , resource->freshnessLifetime(), stalenessLifetime, resource->currentAge()))); |
| 560 } | 555 } |
| 561 | 556 |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1174 visitor->trace(m_context); | 1169 visitor->trace(m_context); |
| 1175 visitor->trace(m_archive); | 1170 visitor->trace(m_archive); |
| 1176 visitor->trace(m_loaders); | 1171 visitor->trace(m_loaders); |
| 1177 visitor->trace(m_nonBlockingLoaders); | 1172 visitor->trace(m_nonBlockingLoaders); |
| 1178 visitor->trace(m_documentResources); | 1173 visitor->trace(m_documentResources); |
| 1179 visitor->trace(m_preloads); | 1174 visitor->trace(m_preloads); |
| 1180 visitor->trace(m_resourceTimingInfoMap); | 1175 visitor->trace(m_resourceTimingInfoMap); |
| 1181 } | 1176 } |
| 1182 | 1177 |
| 1183 } // namespace blink | 1178 } // namespace blink |
| OLD | NEW |