| 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, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 4 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 friend class ImageLoader; | 74 friend class ImageLoader; |
| 75 friend class ResourceCacheValidationSuppressor; | 75 friend class ResourceCacheValidationSuppressor; |
| 76 | 76 |
| 77 public: | 77 public: |
| 78 static PassRefPtr<ResourceFetcher> create(DocumentLoader* documentLoader) {
return adoptRef(new ResourceFetcher(documentLoader)); } | 78 static PassRefPtr<ResourceFetcher> create(DocumentLoader* documentLoader) {
return adoptRef(new ResourceFetcher(documentLoader)); } |
| 79 virtual ~ResourceFetcher(); | 79 virtual ~ResourceFetcher(); |
| 80 | 80 |
| 81 using RefCounted<ResourceFetcher>::ref; | 81 using RefCounted<ResourceFetcher>::ref; |
| 82 using RefCounted<ResourceFetcher>::deref; | 82 using RefCounted<ResourceFetcher>::deref; |
| 83 | 83 |
| 84 unsigned long fetchSynchronously(const ResourceRequest&, StoredCredentials,
ResourceError&, ResourceResponse&, Vector<char>&); | 84 ResourcePtr<Resource> fetchSynchronously(FetchRequest&); |
| 85 | |
| 86 ResourcePtr<ImageResource> fetchImage(FetchRequest&); | 85 ResourcePtr<ImageResource> fetchImage(FetchRequest&); |
| 87 ResourcePtr<CSSStyleSheetResource> fetchCSSStyleSheet(FetchRequest&); | 86 ResourcePtr<CSSStyleSheetResource> fetchCSSStyleSheet(FetchRequest&); |
| 88 ResourcePtr<CSSStyleSheetResource> fetchUserCSSStyleSheet(FetchRequest&); | 87 ResourcePtr<CSSStyleSheetResource> fetchUserCSSStyleSheet(FetchRequest&); |
| 89 ResourcePtr<ScriptResource> fetchScript(FetchRequest&); | 88 ResourcePtr<ScriptResource> fetchScript(FetchRequest&); |
| 90 ResourcePtr<FontResource> fetchFont(FetchRequest&); | 89 ResourcePtr<FontResource> fetchFont(FetchRequest&); |
| 91 ResourcePtr<RawResource> fetchRawResource(FetchRequest&); | 90 ResourcePtr<RawResource> fetchRawResource(FetchRequest&); |
| 92 ResourcePtr<RawResource> fetchMainResource(FetchRequest&); | 91 ResourcePtr<RawResource> fetchMainResource(FetchRequest&); |
| 93 ResourcePtr<DocumentResource> fetchSVGDocument(FetchRequest&); | 92 ResourcePtr<DocumentResource> fetchSVGDocument(FetchRequest&); |
| 94 ResourcePtr<XSLStyleSheetResource> fetchXSLStyleSheet(FetchRequest&); | 93 ResourcePtr<XSLStyleSheetResource> fetchXSLStyleSheet(FetchRequest&); |
| 95 ResourcePtr<Resource> fetchLinkResource(Resource::Type, FetchRequest&); | 94 ResourcePtr<Resource> fetchLinkResource(Resource::Type, FetchRequest&); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 124 void garbageCollectDocumentResources(); | 123 void garbageCollectDocumentResources(); |
| 125 | 124 |
| 126 int requestCount() const { return m_requestCount; } | 125 int requestCount() const { return m_requestCount; } |
| 127 | 126 |
| 128 bool isPreloaded(const String& urlString) const; | 127 bool isPreloaded(const String& urlString) const; |
| 129 void clearPreloads(); | 128 void clearPreloads(); |
| 130 void clearPendingPreloads(); | 129 void clearPendingPreloads(); |
| 131 void preload(Resource::Type, FetchRequest&, const String& charset); | 130 void preload(Resource::Type, FetchRequest&, const String& charset); |
| 132 void checkForPendingPreloads(); | 131 void checkForPendingPreloads(); |
| 133 void printPreloadStats(); | 132 void printPreloadStats(); |
| 134 bool canRequest(Resource::Type, const KURL&, const ResourceLoaderOptions&, b
ool forPreload = false); | |
| 135 bool canAccess(Resource*); | 133 bool canAccess(Resource*); |
| 136 bool checkInsecureContent(Resource::Type, const KURL&, MixedContentBlockingT
reatment) const; | |
| 137 | 134 |
| 138 void setDefersLoading(bool); | 135 void setDefersLoading(bool); |
| 139 void stopFetching(); | 136 void stopFetching(); |
| 140 bool isFetching() const; | 137 bool isFetching() const; |
| 141 | 138 |
| 142 // ResourceLoaderHost | 139 // ResourceLoaderHost |
| 143 virtual void incrementRequestCount(const Resource*) OVERRIDE; | 140 virtual void incrementRequestCount(const Resource*) OVERRIDE; |
| 144 virtual void decrementRequestCount(const Resource*) OVERRIDE; | 141 virtual void decrementRequestCount(const Resource*) OVERRIDE; |
| 145 virtual void didLoadResource(Resource*) OVERRIDE; | 142 virtual void didLoadResource(Resource*) OVERRIDE; |
| 146 virtual void redirectReceived(Resource*, const ResourceResponse&) OVERRIDE; | 143 virtual void redirectReceived(Resource*, const ResourceResponse&) OVERRIDE; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 174 void storeResourceTimingInitiatorInformation(const ResourcePtr<Resource>&, c
onst FetchRequest&); | 171 void storeResourceTimingInitiatorInformation(const ResourcePtr<Resource>&, c
onst FetchRequest&); |
| 175 void requestPreload(Resource::Type, FetchRequest&, const String& charset); | 172 void requestPreload(Resource::Type, FetchRequest&, const String& charset); |
| 176 | 173 |
| 177 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; | 174 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; |
| 178 RevalidationPolicy determineRevalidationPolicy(Resource::Type, ResourceReque
st&, bool forPreload, Resource* existingResource, FetchRequest::DeferOption) con
st; | 175 RevalidationPolicy determineRevalidationPolicy(Resource::Type, ResourceReque
st&, bool forPreload, Resource* existingResource, FetchRequest::DeferOption) con
st; |
| 179 | 176 |
| 180 void determineTargetType(ResourceRequest&, Resource::Type); | 177 void determineTargetType(ResourceRequest&, Resource::Type); |
| 181 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest&
, Resource::Type); | 178 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest&
, Resource::Type); |
| 182 void addAdditionalRequestHeaders(ResourceRequest&, Resource::Type); | 179 void addAdditionalRequestHeaders(ResourceRequest&, Resource::Type); |
| 183 | 180 |
| 181 bool canRequest(Resource::Type, const KURL&, const ResourceLoaderOptions&, b
ool forPreload = false); |
| 182 bool checkInsecureContent(Resource::Type, const KURL&, MixedContentBlockingT
reatment) const; |
| 183 |
| 184 void notifyLoadedFromMemoryCache(Resource*); | 184 void notifyLoadedFromMemoryCache(Resource*); |
| 185 | 185 |
| 186 void garbageCollectDocumentResourcesTimerFired(Timer<ResourceFetcher>*); | 186 void garbageCollectDocumentResourcesTimerFired(Timer<ResourceFetcher>*); |
| 187 void performPostLoadActions(); | 187 void performPostLoadActions(); |
| 188 | 188 |
| 189 bool clientDefersImage(const KURL&) const; | 189 bool clientDefersImage(const KURL&) const; |
| 190 void reloadImagesIfNotDeferred(); | 190 void reloadImagesIfNotDeferred(); |
| 191 | 191 |
| 192 HashSet<String> m_validatedURLs; | 192 HashSet<String> m_validatedURLs; |
| 193 mutable DocumentResourceMap m_documentResources; | 193 mutable DocumentResourceMap m_documentResources; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 m_loader->m_allowStaleResources = m_previousState; | 237 m_loader->m_allowStaleResources = m_previousState; |
| 238 } | 238 } |
| 239 private: | 239 private: |
| 240 ResourceFetcher* m_loader; | 240 ResourceFetcher* m_loader; |
| 241 bool m_previousState; | 241 bool m_previousState; |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 } // namespace WebCore | 244 } // namespace WebCore |
| 245 | 245 |
| 246 #endif | 246 #endif |
| OLD | NEW |