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

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

Issue 2509533002: Do not add a Resource with DoNotBufferData policy to the memory cache (Closed)
Patch Set: fix Created 4 years, 1 month 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 | 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 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 rights reserved.
7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 << request.resourceRequest().url().elidedString(); 737 << request.resourceRequest().url().elidedString();
738 738
739 Resource* resource = 739 Resource* resource =
740 factory.create(request.resourceRequest(), request.options(), charset); 740 factory.create(request.resourceRequest(), request.options(), charset);
741 resource->setLinkPreload(request.isLinkPreload()); 741 resource->setLinkPreload(request.isLinkPreload());
742 if (request.forPreload()) { 742 if (request.forPreload()) {
743 resource->setPreloadDiscoveryTime(request.preloadDiscoveryTime()); 743 resource->setPreloadDiscoveryTime(request.preloadDiscoveryTime());
744 } 744 }
745 resource->setCacheIdentifier(cacheIdentifier); 745 resource->setCacheIdentifier(cacheIdentifier);
746 746
747 // Don't add main resource to cache to prevent reuse. 747 // - Don't add main resource to cache to prevent reuse.
748 if (factory.type() != Resource::MainResource) 748 // - Don't add the resource if its body will not be stored.
749 if (factory.type() != Resource::MainResource &&
750 request.options().dataBufferingPolicy != DoNotBufferData) {
749 memoryCache()->add(resource); 751 memoryCache()->add(resource);
752 }
750 return resource; 753 return resource;
751 } 754 }
752 755
753 void ResourceFetcher::storeResourceTimingInitiatorInformation( 756 void ResourceFetcher::storeResourceTimingInitiatorInformation(
754 Resource* resource) { 757 Resource* resource) {
755 const AtomicString& fetchInitiator = resource->options().initiatorInfo.name; 758 const AtomicString& fetchInitiator = resource->options().initiatorInfo.name;
756 if (fetchInitiator == FetchInitiatorTypeNames::internal) 759 if (fetchInitiator == FetchInitiatorTypeNames::internal)
757 return; 760 return;
758 761
759 bool isMainResource = resource->getType() == Resource::MainResource; 762 bool isMainResource = resource->getType() == Resource::MainResource;
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 visitor->trace(m_context); 1644 visitor->trace(m_context);
1642 visitor->trace(m_archive); 1645 visitor->trace(m_archive);
1643 visitor->trace(m_loaders); 1646 visitor->trace(m_loaders);
1644 visitor->trace(m_nonBlockingLoaders); 1647 visitor->trace(m_nonBlockingLoaders);
1645 visitor->trace(m_documentResources); 1648 visitor->trace(m_documentResources);
1646 visitor->trace(m_preloads); 1649 visitor->trace(m_preloads);
1647 visitor->trace(m_resourceTimingInfoMap); 1650 visitor->trace(m_resourceTimingInfoMap);
1648 } 1651 }
1649 1652
1650 } // namespace blink 1653 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698