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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ScriptResource.h

Issue 2398733003: Cache SubResourceIntegrity checks at Resource (Closed)
Patch Set: add include Created 4 years, 2 months 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
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) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 void onMemoryDump(WebMemoryDumpLevelOfDetail, 69 void onMemoryDump(WebMemoryDumpLevelOfDetail,
70 WebProcessMemoryDump*) const override; 70 WebProcessMemoryDump*) const override;
71 71
72 void destroyDecodedDataForFailedRevalidation() override; 72 void destroyDecodedDataForFailedRevalidation() override;
73 73
74 const String& script(); 74 const String& script();
75 75
76 bool mimeTypeAllowedByNosniff() const; 76 bool mimeTypeAllowedByNosniff() const;
77 77
78 void setIntegrityMetadata(const IntegrityMetadataSet& metadata) {
79 m_integrityMetadata = metadata;
80 }
81 const IntegrityMetadataSet& integrityMetadata() const {
82 return m_integrityMetadata;
83 }
84 // The argument must never be |NotChecked|.
85 void setIntegrityDisposition(ScriptIntegrityDisposition);
86 ScriptIntegrityDisposition integrityDisposition() {
87 return m_integrityDisposition;
88 }
89 bool mustRefetchDueToIntegrityMetadata(const FetchRequest&) const override;
90
91 private: 78 private:
92 class ScriptResourceFactory : public ResourceFactory { 79 class ScriptResourceFactory : public ResourceFactory {
93 public: 80 public:
94 ScriptResourceFactory() : ResourceFactory(Resource::Script) {} 81 ScriptResourceFactory() : ResourceFactory(Resource::Script) {}
95 82
96 Resource* create(const ResourceRequest& request, 83 Resource* create(const ResourceRequest& request,
97 const ResourceLoaderOptions& options, 84 const ResourceLoaderOptions& options,
98 const String& charset) const override { 85 const String& charset) const override {
99 return new ScriptResource(request, options, charset); 86 return new ScriptResource(request, options, charset);
100 } 87 }
101 }; 88 };
102 89
103 ScriptResource(const ResourceRequest&, 90 ScriptResource(const ResourceRequest&,
104 const ResourceLoaderOptions&, 91 const ResourceLoaderOptions&,
105 const String& charset); 92 const String& charset);
106 93
107 ScriptIntegrityDisposition m_integrityDisposition;
108 IntegrityMetadataSet m_integrityMetadata;
109
110 AtomicString m_script; 94 AtomicString m_script;
111 }; 95 };
112 96
113 DEFINE_RESOURCE_TYPE_CASTS(Script); 97 DEFINE_RESOURCE_TYPE_CASTS(Script);
114 98
115 } // namespace blink 99 } // namespace blink
116 100
117 #endif 101 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | third_party/WebKit/Source/core/fetch/ScriptResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698