| 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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 ResourceFetcher::RevalidationPolicy | 814 ResourceFetcher::RevalidationPolicy |
| 815 ResourceFetcher::DetermineRevalidationPolicy(Resource::Type type, | 815 ResourceFetcher::DetermineRevalidationPolicy(Resource::Type type, |
| 816 const FetchRequest& fetch_request, | 816 const FetchRequest& fetch_request, |
| 817 Resource* existing_resource, | 817 Resource* existing_resource, |
| 818 bool is_static_data) const { | 818 bool is_static_data) const { |
| 819 const ResourceRequest& request = fetch_request.GetResourceRequest(); | 819 const ResourceRequest& request = fetch_request.GetResourceRequest(); |
| 820 | 820 |
| 821 if (!existing_resource) | 821 if (!existing_resource) |
| 822 return kLoad; | 822 return kLoad; |
| 823 | 823 |
| 824 // If the existing resource is loading and the associated fetcher is not equal | |
| 825 // to |this|, we must not use the resource. Otherwise, CSP violation may | |
| 826 // happen in redirect handling. | |
| 827 if (existing_resource->Loader() && | |
| 828 existing_resource->Loader()->Fetcher() != this) { | |
| 829 return kReload; | |
| 830 } | |
| 831 | |
| 832 // Checks if the resource has an explicit policy about integrity metadata. | 824 // Checks if the resource has an explicit policy about integrity metadata. |
| 833 // | 825 // |
| 834 // This is necessary because ScriptResource and CSSStyleSheetResource objects | 826 // This is necessary because ScriptResource and CSSStyleSheetResource objects |
| 835 // do not keep the raw data around after the source is accessed once, so if | 827 // do not keep the raw data around after the source is accessed once, so if |
| 836 // the resource is accessed from the MemoryCache for a second time, there is | 828 // the resource is accessed from the MemoryCache for a second time, there is |
| 837 // no way to redo an integrity check. | 829 // no way to redo an integrity check. |
| 838 // | 830 // |
| 839 // Thus, Blink implements a scheme where it caches the integrity information | 831 // Thus, Blink implements a scheme where it caches the integrity information |
| 840 // for those resources after the first time it is checked, and if there is | 832 // for those resources after the first time it is checked, and if there is |
| 841 // another request for that resource, with the same integrity metadata, Blink | 833 // another request for that resource, with the same integrity metadata, Blink |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1577 visitor->Trace(context_); | 1569 visitor->Trace(context_); |
| 1578 visitor->Trace(archive_); | 1570 visitor->Trace(archive_); |
| 1579 visitor->Trace(loaders_); | 1571 visitor->Trace(loaders_); |
| 1580 visitor->Trace(non_blocking_loaders_); | 1572 visitor->Trace(non_blocking_loaders_); |
| 1581 visitor->Trace(document_resources_); | 1573 visitor->Trace(document_resources_); |
| 1582 visitor->Trace(preloads_); | 1574 visitor->Trace(preloads_); |
| 1583 visitor->Trace(resource_timing_info_map_); | 1575 visitor->Trace(resource_timing_info_map_); |
| 1584 } | 1576 } |
| 1585 | 1577 |
| 1586 } // namespace blink | 1578 } // namespace blink |
| OLD | NEW |