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

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

Issue 1915833002: Introduce Platform::cacheMetadataInCacheStorage() to store V8 code cache in CacheStorage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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.
11 11
12 This library is distributed in the hope that it will be useful, 12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details. 15 Library General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. 20 Boston, MA 02110-1301, USA.
21 21
22 This class provides all functionality needed for loading images, style sheet s and html 22 This class provides all functionality needed for loading images, style sheet s and html
23 pages from the web. It has a memory cache for these objects. 23 pages from the web. It has a memory cache for these objects.
24 */ 24 */
25 25
26 #ifndef ScriptResource_h 26 #ifndef ScriptResource_h
27 #define ScriptResource_h 27 #define ScriptResource_h
28 28
29 #include "bindings/core/v8/V8CacheStrategiesForCacheStorage.h"
29 #include "core/CoreExport.h" 30 #include "core/CoreExport.h"
30 #include "core/fetch/IntegrityMetadata.h" 31 #include "core/fetch/IntegrityMetadata.h"
31 #include "core/fetch/ResourceClient.h" 32 #include "core/fetch/ResourceClient.h"
32 #include "core/fetch/TextResource.h" 33 #include "core/fetch/TextResource.h"
33 #include "platform/text/CompressibleString.h" 34 #include "platform/text/CompressibleString.h"
34 35
35 namespace blink { 36 namespace blink {
36 37
37 enum class ScriptIntegrityDisposition { 38 enum class ScriptIntegrityDisposition {
38 NotChecked = 0, 39 NotChecked = 0,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 77
77 bool mimeTypeAllowedByNosniff() const; 78 bool mimeTypeAllowedByNosniff() const;
78 79
79 void setIntegrityMetadata(const IntegrityMetadataSet& metadata) { m_integrit yMetadata = metadata; } 80 void setIntegrityMetadata(const IntegrityMetadataSet& metadata) { m_integrit yMetadata = metadata; }
80 const IntegrityMetadataSet& integrityMetadata() const { return m_integrityMe tadata; } 81 const IntegrityMetadataSet& integrityMetadata() const { return m_integrityMe tadata; }
81 // The argument must never be |NotChecked|. 82 // The argument must never be |NotChecked|.
82 void setIntegrityDisposition(ScriptIntegrityDisposition); 83 void setIntegrityDisposition(ScriptIntegrityDisposition);
83 ScriptIntegrityDisposition integrityDisposition() { return m_integrityDispos ition; } 84 ScriptIntegrityDisposition integrityDisposition() { return m_integrityDispos ition; }
84 bool mustRefetchDueToIntegrityMetadata(const FetchRequest&) const override; 85 bool mustRefetchDueToIntegrityMetadata(const FetchRequest&) const override;
85 86
87 void setV8CacheStrategiesForCacheStorage(V8CacheStrategiesForCacheStorage st rategies) { m_v8CacheStrategiesForCacheStorage = strategies; }
88
86 private: 89 private:
87 class ScriptResourceFactory : public ResourceFactory { 90 class ScriptResourceFactory : public ResourceFactory {
88 public: 91 public:
89 ScriptResourceFactory() 92 ScriptResourceFactory()
90 : ResourceFactory(Resource::Script) { } 93 : ResourceFactory(Resource::Script) { }
91 94
92 Resource* create(const ResourceRequest& request, const ResourceLoaderOpt ions& options, const String& charset) const override 95 Resource* create(const ResourceRequest& request, const ResourceLoaderOpt ions& options, const String& charset) const override
93 { 96 {
94 return new ScriptResource(request, options, charset); 97 return new ScriptResource(request, options, charset);
95 } 98 }
96 }; 99 };
97 100
98 ScriptResource(const ResourceRequest&, const ResourceLoaderOptions&, const S tring& charset); 101 ScriptResource(const ResourceRequest&, const ResourceLoaderOptions&, const S tring& charset);
102 bool cacheMetadataSendToPlatformDisabled() const override;
103 bool shouldAggressivelyCacheMetadata() const override;
99 104
100 ScriptIntegrityDisposition m_integrityDisposition; 105 ScriptIntegrityDisposition m_integrityDisposition;
101 IntegrityMetadataSet m_integrityMetadata; 106 IntegrityMetadataSet m_integrityMetadata;
107 V8CacheStrategiesForCacheStorage m_v8CacheStrategiesForCacheStorage;
102 108
103 CompressibleString m_script; 109 CompressibleString m_script;
104 }; 110 };
105 111
106 DEFINE_RESOURCE_TYPE_CASTS(Script); 112 DEFINE_RESOURCE_TYPE_CASTS(Script);
107 113
108 } // namespace blink 114 } // namespace blink
109 115
110 #endif 116 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698