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) 2004, 2005, 2006 Apple Computer, Inc. | 4 Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 void incrementRequestCount(const CachedResource*); | 97 void incrementRequestCount(const CachedResource*); |
98 void decrementRequestCount(const CachedResource*); | 98 void decrementRequestCount(const CachedResource*); |
99 int requestCount(); | 99 int requestCount(); |
100 | 100 |
101 bool isPreloaded(const String& urlString) const; | 101 bool isPreloaded(const String& urlString) const; |
102 void clearPreloads(); | 102 void clearPreloads(); |
103 void clearPendingPreloads(); | 103 void clearPendingPreloads(); |
104 void preload(CachedResource::Type, ResourceRequest&, const String& charset,
bool referencedFromBody); | 104 void preload(CachedResource::Type, ResourceRequest&, const String& charset,
bool referencedFromBody); |
105 void checkForPendingPreloads(); | 105 void checkForPendingPreloads(); |
106 void printPreloadStats(); | 106 void printPreloadStats(); |
107 bool checkInsecureContent(CachedResource::Type, const KURL&) const; | 107 bool canRequest(CachedResource::Type, const KURL&, bool forPreload = false); |
108 | 108 |
109 private: | 109 private: |
110 CachedResource* requestResource(CachedResource::Type, ResourceRequest&, cons
t String& charset, ResourceLoadPriority = ResourceLoadPriorityUnresolved, bool i
sPreload = false); | 110 CachedResource* requestResource(CachedResource::Type, ResourceRequest&, cons
t String& charset, ResourceLoadPriority = ResourceLoadPriorityUnresolved, bool i
sPreload = false); |
111 CachedResource* revalidateResource(CachedResource*, ResourceLoadPriority pri
ority); | 111 CachedResource* revalidateResource(CachedResource*, ResourceLoadPriority pri
ority); |
112 CachedResource* loadResource(CachedResource::Type, ResourceRequest&, const S
tring& charset, ResourceLoadPriority); | 112 CachedResource* loadResource(CachedResource::Type, ResourceRequest&, const S
tring& charset, ResourceLoadPriority); |
113 void requestPreload(CachedResource::Type, ResourceRequest& url, const String
& charset); | 113 void requestPreload(CachedResource::Type, ResourceRequest& url, const String
& charset); |
114 | 114 |
115 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; | 115 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; |
116 RevalidationPolicy determineRevalidationPolicy(CachedResource::Type, Resourc
eRequest&, bool forPreload, CachedResource* existingResource) const; | 116 RevalidationPolicy determineRevalidationPolicy(CachedResource::Type, Resourc
eRequest&, bool forPreload, CachedResource* existingResource) const; |
117 | 117 |
118 void notifyLoadedFromMemoryCache(CachedResource*); | 118 void notifyLoadedFromMemoryCache(CachedResource*); |
119 bool canRequest(CachedResource::Type, const KURL&, bool forPreload = false); | 119 bool checkInsecureContent(CachedResource::Type, const KURL&) const; |
120 | 120 |
121 void garbageCollectDocumentResourcesTimerFired(Timer<CachedResourceLoader>*)
; | 121 void garbageCollectDocumentResourcesTimerFired(Timer<CachedResourceLoader>*)
; |
122 void performPostLoadActions(); | 122 void performPostLoadActions(); |
123 | 123 |
124 HashSet<String> m_validatedURLs; | 124 HashSet<String> m_validatedURLs; |
125 mutable DocumentResourceMap m_documentResources; | 125 mutable DocumentResourceMap m_documentResources; |
126 Document* m_document; | 126 Document* m_document; |
127 | 127 |
128 int m_requestCount; | 128 int m_requestCount; |
129 | 129 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 m_loader->m_allowStaleResources = m_previousState; | 162 m_loader->m_allowStaleResources = m_previousState; |
163 } | 163 } |
164 private: | 164 private: |
165 CachedResourceLoader* m_loader; | 165 CachedResourceLoader* m_loader; |
166 bool m_previousState; | 166 bool m_previousState; |
167 }; | 167 }; |
168 | 168 |
169 } // namespace WebCore | 169 } // namespace WebCore |
170 | 170 |
171 #endif | 171 #endif |
OLD | NEW |