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

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: 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.
hiroshige 2016/11/16 06:34:58 Please update the comment.
yhirano 2016/11/16 07:21:49 Done.
748 if (factory.type() != Resource::MainResource) 748 if (factory.type() != Resource::MainResource &&
749 request.options().dataBufferingPolicy == BufferData)
hiroshige 2016/11/16 06:34:58 optional: |request.options().dataBufferingPolicy !
yhirano 2016/11/16 07:21:49 Done.
749 memoryCache()->add(resource); 750 memoryCache()->add(resource);
750 return resource; 751 return resource;
751 } 752 }
752 753
753 void ResourceFetcher::storeResourceTimingInitiatorInformation( 754 void ResourceFetcher::storeResourceTimingInitiatorInformation(
754 Resource* resource) { 755 Resource* resource) {
755 const AtomicString& fetchInitiator = resource->options().initiatorInfo.name; 756 const AtomicString& fetchInitiator = resource->options().initiatorInfo.name;
756 if (fetchInitiator == FetchInitiatorTypeNames::internal) 757 if (fetchInitiator == FetchInitiatorTypeNames::internal)
757 return; 758 return;
758 759
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 visitor->trace(m_context); 1642 visitor->trace(m_context);
1642 visitor->trace(m_archive); 1643 visitor->trace(m_archive);
1643 visitor->trace(m_loaders); 1644 visitor->trace(m_loaders);
1644 visitor->trace(m_nonBlockingLoaders); 1645 visitor->trace(m_nonBlockingLoaders);
1645 visitor->trace(m_documentResources); 1646 visitor->trace(m_documentResources);
1646 visitor->trace(m_preloads); 1647 visitor->trace(m_preloads);
1647 visitor->trace(m_resourceTimingInfoMap); 1648 visitor->trace(m_resourceTimingInfoMap);
1648 } 1649 }
1649 1650
1650 } // namespace blink 1651 } // 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