| 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) 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 12 matching lines...) Expand all Loading... |
| 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 "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "core/fetch/IntegrityMetadata.h" | 30 #include "core/fetch/IntegrityMetadata.h" |
| 31 #include "core/fetch/ResourceClient.h" | 31 #include "core/fetch/ResourceClient.h" |
| 32 #include "core/fetch/TextResource.h" | 32 #include "core/fetch/TextResource.h" |
| 33 #include "platform/heap/Handle.h" | |
| 34 #include "platform/text/CompressibleString.h" | |
| 35 | 33 |
| 36 namespace blink { | 34 namespace blink { |
| 37 | 35 |
| 38 enum class ScriptIntegrityDisposition { | 36 enum class ScriptIntegrityDisposition { |
| 39 NotChecked = 0, | 37 NotChecked = 0, |
| 40 Failed, | 38 Failed, |
| 41 Passed | 39 Passed |
| 42 }; | 40 }; |
| 43 | 41 |
| 44 class FetchRequest; | 42 class FetchRequest; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 69 | 67 |
| 70 ~ScriptResource() override; | 68 ~ScriptResource() override; |
| 71 | 69 |
| 72 void didAddClient(ResourceClient*) override; | 70 void didAddClient(ResourceClient*) override; |
| 73 void appendData(const char*, size_t) override; | 71 void appendData(const char*, size_t) override; |
| 74 | 72 |
| 75 void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) const o
verride; | 73 void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) const o
verride; |
| 76 | 74 |
| 77 void destroyDecodedDataForFailedRevalidation() override; | 75 void destroyDecodedDataForFailedRevalidation() override; |
| 78 | 76 |
| 79 const CompressibleString& script(); | 77 const String& script(); |
| 80 | 78 |
| 81 bool mimeTypeAllowedByNosniff() const; | 79 bool mimeTypeAllowedByNosniff() const; |
| 82 | 80 |
| 83 void setIntegrityMetadata(const IntegrityMetadataSet& metadata) { m_integrit
yMetadata = metadata; } | 81 void setIntegrityMetadata(const IntegrityMetadataSet& metadata) { m_integrit
yMetadata = metadata; } |
| 84 const IntegrityMetadataSet& integrityMetadata() const { return m_integrityMe
tadata; } | 82 const IntegrityMetadataSet& integrityMetadata() const { return m_integrityMe
tadata; } |
| 85 // The argument must never be |NotChecked|. | 83 // The argument must never be |NotChecked|. |
| 86 void setIntegrityDisposition(ScriptIntegrityDisposition); | 84 void setIntegrityDisposition(ScriptIntegrityDisposition); |
| 87 ScriptIntegrityDisposition integrityDisposition() { return m_integrityDispos
ition; } | 85 ScriptIntegrityDisposition integrityDisposition() { return m_integrityDispos
ition; } |
| 88 bool mustRefetchDueToIntegrityMetadata(const FetchRequest&) const override; | 86 bool mustRefetchDueToIntegrityMetadata(const FetchRequest&) const override; |
| 89 | 87 |
| 90 private: | 88 private: |
| 91 class ScriptResourceFactory : public ResourceFactory { | 89 class ScriptResourceFactory : public ResourceFactory { |
| 92 public: | 90 public: |
| 93 ScriptResourceFactory() | 91 ScriptResourceFactory() |
| 94 : ResourceFactory(Resource::Script) { } | 92 : ResourceFactory(Resource::Script) { } |
| 95 | 93 |
| 96 Resource* create(const ResourceRequest& request, const ResourceLoaderOpt
ions& options, const String& charset) const override | 94 Resource* create(const ResourceRequest& request, const ResourceLoaderOpt
ions& options, const String& charset) const override |
| 97 { | 95 { |
| 98 return new ScriptResource(request, options, charset); | 96 return new ScriptResource(request, options, charset); |
| 99 } | 97 } |
| 100 }; | 98 }; |
| 101 | 99 |
| 102 ScriptResource(const ResourceRequest&, const ResourceLoaderOptions&, const S
tring& charset); | 100 ScriptResource(const ResourceRequest&, const ResourceLoaderOptions&, const S
tring& charset); |
| 103 | 101 |
| 104 ScriptIntegrityDisposition m_integrityDisposition; | 102 ScriptIntegrityDisposition m_integrityDisposition; |
| 105 IntegrityMetadataSet m_integrityMetadata; | 103 IntegrityMetadataSet m_integrityMetadata; |
| 106 | 104 |
| 107 CompressibleString m_script; | 105 AtomicString m_script; |
| 108 }; | 106 }; |
| 109 | 107 |
| 110 DEFINE_RESOURCE_TYPE_CASTS(Script); | 108 DEFINE_RESOURCE_TYPE_CASTS(Script); |
| 111 | 109 |
| 112 } // namespace blink | 110 } // namespace blink |
| 113 | 111 |
| 114 #endif | 112 #endif |
| OLD | NEW |