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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
534 | 534 |
535 void ResourceFetcher::initializeRevalidation(const FetchRequest& request, Resour ce* resource) | 535 void ResourceFetcher::initializeRevalidation(const FetchRequest& request, Resour ce* resource) |
536 { | 536 { |
537 ASSERT(resource); | 537 ASSERT(resource); |
538 ASSERT(memoryCache()->contains(resource)); | 538 ASSERT(memoryCache()->contains(resource)); |
539 ASSERT(resource->isLoaded()); | 539 ASSERT(resource->isLoaded()); |
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 // Each resource may need a special initialization to load again. | |
545 resource->prepareToRevalidate(); | |
hiroshige
2016/04/19 07:51:50
How about calling prepareToRevalidate() in setReva
Takashi Toyoshima
2016/04/19 08:39:01
Thanks, that sounds smart, and I can just make the
| |
546 | |
544 ResourceRequest revalidatingRequest(resource->resourceRequest()); | 547 ResourceRequest revalidatingRequest(resource->resourceRequest()); |
545 revalidatingRequest.clearHTTPReferrer(); | 548 revalidatingRequest.clearHTTPReferrer(); |
546 initializeResourceRequest(revalidatingRequest, resource->getType(), request. defer()); | 549 initializeResourceRequest(revalidatingRequest, resource->getType(), request. defer()); |
547 | 550 |
548 const AtomicString& lastModified = resource->response().httpHeaderField(HTTP Names::Last_Modified); | 551 const AtomicString& lastModified = resource->response().httpHeaderField(HTTP Names::Last_Modified); |
549 const AtomicString& eTag = resource->response().httpHeaderField(HTTPNames::E Tag); | 552 const AtomicString& eTag = resource->response().httpHeaderField(HTTPNames::E Tag); |
550 if (!lastModified.isEmpty() || !eTag.isEmpty()) { | 553 if (!lastModified.isEmpty() || !eTag.isEmpty()) { |
551 ASSERT(context().getCachePolicy() != CachePolicyReload); | 554 ASSERT(context().getCachePolicy() != CachePolicyReload); |
552 if (context().getCachePolicy() == CachePolicyRevalidate) | 555 if (context().getCachePolicy() == CachePolicyRevalidate) |
553 revalidatingRequest.setHTTPHeaderField(HTTPNames::Cache_Control, "ma x-age=0"); | 556 revalidatingRequest.setHTTPHeaderField(HTTPNames::Cache_Control, "ma x-age=0"); |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1175 visitor->trace(m_context); | 1178 visitor->trace(m_context); |
1176 visitor->trace(m_archive); | 1179 visitor->trace(m_archive); |
1177 visitor->trace(m_loaders); | 1180 visitor->trace(m_loaders); |
1178 visitor->trace(m_nonBlockingLoaders); | 1181 visitor->trace(m_nonBlockingLoaders); |
1179 visitor->trace(m_documentResources); | 1182 visitor->trace(m_documentResources); |
1180 visitor->trace(m_preloads); | 1183 visitor->trace(m_preloads); |
1181 visitor->trace(m_resourceTimingInfoMap); | 1184 visitor->trace(m_resourceTimingInfoMap); |
1182 } | 1185 } |
1183 | 1186 |
1184 } // namespace blink | 1187 } // namespace blink |
OLD | NEW |