| 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/text/CompressibleString.h" | 
| 33 | 34 | 
| 34 namespace blink { | 35 namespace blink { | 
| 35 | 36 | 
| 36 class FetchRequest; | 37 class FetchRequest; | 
| 37 class ScriptResource; | 38 class ScriptResource; | 
| 38 | 39 | 
| 39 class CORE_EXPORT ScriptResourceClient : public ResourceClient { | 40 class CORE_EXPORT ScriptResourceClient : public ResourceClient { | 
| 40 public: | 41 public: | 
| 41     ~ScriptResourceClient() override {} | 42     ~ScriptResourceClient() override {} | 
| 42     static ResourceClientType expectedType() { return ScriptType; } | 43     static ResourceClientType expectedType() { return ScriptType; } | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 55 | 56 | 
| 56     ~ScriptResource() override; | 57     ~ScriptResource() override; | 
| 57 | 58 | 
| 58     void didAddClient(ResourceClient*) override; | 59     void didAddClient(ResourceClient*) override; | 
| 59     void appendData(const char*, size_t) override; | 60     void appendData(const char*, size_t) override; | 
| 60 | 61 | 
| 61     void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) const o
     verride; | 62     void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) const o
     verride; | 
| 62 | 63 | 
| 63     void destroyDecodedDataForFailedRevalidation() override; | 64     void destroyDecodedDataForFailedRevalidation() override; | 
| 64 | 65 | 
| 65     const String& script(); | 66     const CompressibleString& script(); | 
| 66 | 67 | 
| 67     AtomicString mimeType() const; | 68     AtomicString mimeType() const; | 
| 68 | 69 | 
| 69     bool mimeTypeAllowedByNosniff() const; | 70     bool mimeTypeAllowedByNosniff() const; | 
| 70 | 71 | 
| 71     void setIntegrityMetadata(const IntegrityMetadataSet& metadata) { m_integrit
     yMetadata = metadata; } | 72     void setIntegrityMetadata(const IntegrityMetadataSet& metadata) { m_integrit
     yMetadata = metadata; } | 
| 72     const IntegrityMetadataSet& integrityMetadata() const { return m_integrityMe
     tadata; } | 73     const IntegrityMetadataSet& integrityMetadata() const { return m_integrityMe
     tadata; } | 
| 73     void setIntegrityAlreadyChecked(bool checked) { m_integrityChecked = checked
     ; } | 74     void setIntegrityAlreadyChecked(bool checked) { m_integrityChecked = checked
     ; } | 
| 74     bool integrityAlreadyChecked() { return m_integrityChecked; } | 75     bool integrityAlreadyChecked() { return m_integrityChecked; } | 
| 75     bool mustRefetchDueToIntegrityMetadata(const FetchRequest&) const override; | 76     bool mustRefetchDueToIntegrityMetadata(const FetchRequest&) const override; | 
| 76 | 77 | 
| 77 private: | 78 private: | 
| 78     class ScriptResourceFactory : public ResourceFactory { | 79     class ScriptResourceFactory : public ResourceFactory { | 
| 79     public: | 80     public: | 
| 80         ScriptResourceFactory() | 81         ScriptResourceFactory() | 
| 81             : ResourceFactory(Resource::Script) { } | 82             : ResourceFactory(Resource::Script) { } | 
| 82 | 83 | 
| 83         Resource* create(const ResourceRequest& request, const String& charset) 
     const override | 84         Resource* create(const ResourceRequest& request, const String& charset) 
     const override | 
| 84         { | 85         { | 
| 85             return new ScriptResource(request, charset); | 86             return new ScriptResource(request, charset); | 
| 86         } | 87         } | 
| 87     }; | 88     }; | 
| 88 | 89 | 
| 89     bool m_integrityChecked; | 90     bool m_integrityChecked; | 
| 90     IntegrityMetadataSet m_integrityMetadata; | 91     IntegrityMetadataSet m_integrityMetadata; | 
| 91 | 92 | 
| 92     AtomicString m_script; | 93     CompressibleString m_script; | 
| 93 }; | 94 }; | 
| 94 | 95 | 
| 95 DEFINE_RESOURCE_TYPE_CASTS(Script); | 96 DEFINE_RESOURCE_TYPE_CASTS(Script); | 
| 96 | 97 | 
| 97 } | 98 } | 
| 98 | 99 | 
| 99 #endif | 100 #endif | 
| OLD | NEW | 
|---|