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) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 | 7 |
8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 void CachedScript::destroyDecodedData() | 96 void CachedScript::destroyDecodedData() |
97 { | 97 { |
98 m_script = String(); | 98 m_script = String(); |
99 setDecodedSize(0); | 99 setDecodedSize(0); |
100 if (!MemoryCache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePur
geable()) | 100 if (!MemoryCache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePur
geable()) |
101 makePurgeable(true); | 101 makePurgeable(true); |
102 } | 102 } |
103 | 103 |
104 #if ENABLE(NOSNIFF) | |
105 bool CachedScript::mimeTypeAllowedByNosniff() const | 104 bool CachedScript::mimeTypeAllowedByNosniff() const |
106 { | 105 { |
107 return !parseContentTypeOptionsHeader(m_response.httpHeaderField("X-Content-
Type-Options")) == ContentTypeOptionsNosniff || MIMETypeRegistry::isSupportedJav
aScriptMIMEType(mimeType()); | 106 return !parseContentTypeOptionsHeader(m_response.httpHeaderField("X-Content-
Type-Options")) == ContentTypeOptionsNosniff || MIMETypeRegistry::isSupportedJav
aScriptMIMEType(mimeType()); |
108 } | 107 } |
109 #endif | |
110 | 108 |
111 void CachedScript::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | 109 void CachedScript::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const |
112 { | 110 { |
113 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceScript); | 111 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceScript); |
114 CachedResource::reportMemoryUsage(memoryObjectInfo); | 112 CachedResource::reportMemoryUsage(memoryObjectInfo); |
115 info.addMember(m_script, "script"); | 113 info.addMember(m_script, "script"); |
116 info.addMember(m_decoder, "decoder"); | 114 info.addMember(m_decoder, "decoder"); |
117 } | 115 } |
118 | 116 |
119 } // namespace WebCore | 117 } // namespace WebCore |
OLD | NEW |