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 | 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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 ResourceFetcher::determineRevalidationPolicy(Resource::Type type, | 769 ResourceFetcher::determineRevalidationPolicy(Resource::Type type, |
770 const FetchRequest& fetchRequest, | 770 const FetchRequest& fetchRequest, |
771 Resource* existingResource, | 771 Resource* existingResource, |
772 bool isStaticData) const { | 772 bool isStaticData) const { |
773 const ResourceRequest& request = fetchRequest.resourceRequest(); | 773 const ResourceRequest& request = fetchRequest.resourceRequest(); |
774 | 774 |
775 if (!existingResource) | 775 if (!existingResource) |
776 return Load; | 776 return Load; |
777 | 777 |
778 // Checks if the resource has an explicit policy about integrity metadata. | 778 // Checks if the resource has an explicit policy about integrity metadata. |
| 779 // Currently only applies to ScriptResources. |
779 // | 780 // |
780 // This is necessary because ScriptResource and CSSStyleSheetResource objects | 781 // This is necessary because ScriptResource objects do not keep the raw data |
781 // do not keep the raw data around after the source is accessed once, so if | 782 // around after the source is accessed once, so if the resource is accessed |
782 // the resource is accessed from the MemoryCache for a second time, there is | 783 // from the MemoryCache for a second time, there is no way to redo an |
783 // no way to redo an integrity check. | 784 // integrity check. |
784 // | 785 // |
785 // Thus, Blink implements a scheme where it caches the integrity information | 786 // Thus, Blink implements a scheme where it caches the integrity information |
786 // for those resources after the first time it is checked, and if there is | 787 // for a ScriptResource after the first time it is checked, and if there is |
787 // another request for that resource, with the same integrity metadata, Blink | 788 // another request for that resource, with the same integrity metadata, Blink |
788 // skips the integrity calculation. However, if the integrity metadata is a | 789 // skips the integrity calculation. However, if the integrity metadata is a |
789 // mismatch, the MemoryCache must be skipped here, and a new request for the | 790 // mismatch, the MemoryCache must be skipped here, and a new request for the |
790 // resource must be made to get the raw data. This is expected to be an | 791 // resource must be made to get the raw data. This is expected to be an |
791 // uncommon case, however, as it implies two same-origin requests to the same | 792 // uncommon case, however, as it implies two same-origin requests to the same |
792 // resource, but with different integrity metadata. | 793 // resource, but with different integrity metadata. |
793 RecordSriResourceIntegrityMismatchEvent(CheckingForIntegrityMismatch); | 794 RecordSriResourceIntegrityMismatchEvent(CheckingForIntegrityMismatch); |
794 if (existingResource->mustRefetchDueToIntegrityMetadata(fetchRequest)) { | 795 if (existingResource->mustRefetchDueToIntegrityMetadata(fetchRequest)) { |
795 RecordSriResourceIntegrityMismatchEvent(RefetchDueToIntegrityMismatch); | 796 RecordSriResourceIntegrityMismatchEvent(RefetchDueToIntegrityMismatch); |
796 return Reload; | 797 return Reload; |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 visitor->trace(m_context); | 1604 visitor->trace(m_context); |
1604 visitor->trace(m_archive); | 1605 visitor->trace(m_archive); |
1605 visitor->trace(m_loaders); | 1606 visitor->trace(m_loaders); |
1606 visitor->trace(m_nonBlockingLoaders); | 1607 visitor->trace(m_nonBlockingLoaders); |
1607 visitor->trace(m_documentResources); | 1608 visitor->trace(m_documentResources); |
1608 visitor->trace(m_preloads); | 1609 visitor->trace(m_preloads); |
1609 visitor->trace(m_resourceTimingInfoMap); | 1610 visitor->trace(m_resourceTimingInfoMap); |
1610 } | 1611 } |
1611 | 1612 |
1612 } // namespace blink | 1613 } // namespace blink |
OLD | NEW |