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 // FIXME: The default value for ResourceLoaderOptions will always be used cu
rrently. | 110 // FIXME: The default value for ResourceLoaderOptions will always be used cu
rrently. |
111 // It is plumbed for http://bugs.webkit.org/show_bug.cgi?id=61225 . | 111 // It is plumbed for http://bugs.webkit.org/show_bug.cgi?id=61225 . |
112 CachedResource* requestResource(CachedResource::Type, ResourceRequest&, cons
t String& charset, ResourceLoadPriority = ResourceLoadPriorityUnresolved, bool i
sPreload = false, const ResourceLoaderOptions& = ResourceLoaderOptions(SendCallb
acks, SniffContent, BufferData, AllowStoredCredentials)); | 112 CachedResource* requestResource(CachedResource::Type, ResourceRequest&, cons
t String& charset, ResourceLoadPriority = ResourceLoadPriorityUnresolved, bool i
sPreload = false, const ResourceLoaderOptions& = ResourceLoaderOptions(SendCallb
acks, SniffContent, BufferData, AllowStoredCredentials)); |
113 CachedResource* revalidateResource(CachedResource*, ResourceLoadPriority); | 113 CachedResource* revalidateResource(CachedResource*, ResourceLoadPriority); |
114 CachedResource* loadResource(CachedResource::Type, ResourceRequest&, const S
tring& charset, ResourceLoadPriority, const ResourceLoaderOptions&); | 114 CachedResource* loadResource(CachedResource::Type, ResourceRequest&, const S
tring& charset, ResourceLoadPriority, const ResourceLoaderOptions&); |
115 void requestPreload(CachedResource::Type, ResourceRequest&, const String& ch
arset); | 115 void requestPreload(CachedResource::Type, ResourceRequest&, const String& ch
arset); |
116 | 116 |
117 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; | 117 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; |
118 RevalidationPolicy determineRevalidationPolicy(CachedResource::Type, Resourc
eRequest&, bool forPreload, CachedResource* existingResource) const; | 118 RevalidationPolicy determineRevalidationPolicy(CachedResource::Type, Resourc
eRequest&, bool forPreload, CachedResource* existingResource) const; |
119 | 119 |
120 void notifyLoadedFromMemoryCache(CachedResource*); | 120 void notifyLoadedFromMemoryCache(CachedResource*); |
121 bool canRequest(CachedResource::Type, const KURL&, bool forPreload = false); | 121 bool checkInsecureContent(CachedResource::Type, const KURL&) const; |
122 | 122 |
123 void garbageCollectDocumentResourcesTimerFired(Timer<CachedResourceLoader>*)
; | 123 void garbageCollectDocumentResourcesTimerFired(Timer<CachedResourceLoader>*)
; |
124 void performPostLoadActions(); | 124 void performPostLoadActions(); |
125 | 125 |
126 HashSet<String> m_validatedURLs; | 126 HashSet<String> m_validatedURLs; |
127 mutable DocumentResourceMap m_documentResources; | 127 mutable DocumentResourceMap m_documentResources; |
128 Document* m_document; | 128 Document* m_document; |
129 | 129 |
130 int m_requestCount; | 130 int m_requestCount; |
131 | 131 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 m_loader->m_allowStaleResources = m_previousState; | 164 m_loader->m_allowStaleResources = m_previousState; |
165 } | 165 } |
166 private: | 166 private: |
167 CachedResourceLoader* m_loader; | 167 CachedResourceLoader* m_loader; |
168 bool m_previousState; | 168 bool m_previousState; |
169 }; | 169 }; |
170 | 170 |
171 } // namespace WebCore | 171 } // namespace WebCore |
172 | 172 |
173 #endif | 173 #endif |
OLD | NEW |