| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 ResourceLoadingFromNetwork, | 164 ResourceLoadingFromNetwork, |
| 165 ResourceLoadingFromCache | 165 ResourceLoadingFromCache |
| 166 }; | 166 }; |
| 167 void maybeNotifyInsecureContent(const Resource*) const; | 167 void maybeNotifyInsecureContent(const Resource*) const; |
| 168 void requestLoadStarted(Resource*, const FetchRequest&, ResourceLoadStartTyp
e); | 168 void requestLoadStarted(Resource*, const FetchRequest&, ResourceLoadStartTyp
e); |
| 169 static const ResourceLoaderOptions& defaultResourceOptions(); | 169 static const ResourceLoaderOptions& defaultResourceOptions(); |
| 170 | 170 |
| 171 String getCacheIdentifier() const; | 171 String getCacheIdentifier() const; |
| 172 | 172 |
| 173 private: | 173 private: |
| 174 friend class ResourceFetcherTest; |
| 175 |
| 174 explicit ResourceFetcher(DocumentLoader*); | 176 explicit ResourceFetcher(DocumentLoader*); |
| 175 | 177 |
| 176 bool shouldLoadNewResource(Resource::Type) const; | 178 bool shouldLoadNewResource(Resource::Type) const; |
| 177 | 179 |
| 178 ResourcePtr<Resource> requestResource(Resource::Type, FetchRequest&); | 180 ResourcePtr<Resource> requestResource(Resource::Type, FetchRequest&); |
| 179 ResourcePtr<Resource> createResourceForRevalidation(const FetchRequest&, Res
ource*); | 181 ResourcePtr<Resource> createResourceForRevalidation(const FetchRequest&, Res
ource*); |
| 180 ResourcePtr<Resource> createResourceForLoading(Resource::Type, FetchRequest&
, const String& charset); | 182 ResourcePtr<Resource> createResourceForLoading(Resource::Type, FetchRequest&
, const String& charset); |
| 181 void preCacheDataURIImage(const FetchRequest&); | 183 void preCacheDataURIImage(const FetchRequest&); |
| 182 void preCacheSubstituteDataForMainResource(const FetchRequest&, const Substi
tuteData&); | 184 void preCacheSubstituteDataForMainResource(const FetchRequest&, const Substi
tuteData&); |
| 183 void storeResourceTimingInitiatorInformation(Resource*); | 185 void storeResourceTimingInitiatorInformation(Resource*); |
| 184 | 186 |
| 185 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; | 187 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; |
| 186 RevalidationPolicy determineRevalidationPolicy(Resource::Type, const FetchRe
quest&, Resource* existingResource) const; | 188 RevalidationPolicy determineRevalidationPolicy(Resource::Type, const FetchRe
quest&, Resource* existingResource) const; |
| 187 | 189 |
| 188 void determineRequestContext(ResourceRequest&, Resource::Type); | 190 void determineRequestContext(ResourceRequest&, Resource::Type); |
| 189 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest&
, Resource::Type); | 191 ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest&
, Resource::Type); |
| 190 void addAdditionalRequestHeaders(ResourceRequest&, Resource::Type); | 192 void addAdditionalRequestHeaders(ResourceRequest&, Resource::Type); |
| 193 void maybeUpgradeInsecureRequestURL(FetchRequest&); |
| 191 | 194 |
| 192 bool canRequest(Resource::Type, const ResourceRequest&, const KURL&, const R
esourceLoaderOptions&, bool forPreload, FetchRequest::OriginRestriction) const; | 195 bool canRequest(Resource::Type, const ResourceRequest&, const KURL&, const R
esourceLoaderOptions&, bool forPreload, FetchRequest::OriginRestriction) const; |
| 193 | 196 |
| 194 static bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPo
licy); | 197 static bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPo
licy); |
| 195 | 198 |
| 196 void notifyLoadedFromMemoryCache(Resource*); | 199 void notifyLoadedFromMemoryCache(Resource*); |
| 197 | 200 |
| 198 void garbageCollectDocumentResourcesTimerFired(Timer<ResourceFetcher>*); | 201 void garbageCollectDocumentResourcesTimerFired(Timer<ResourceFetcher>*); |
| 199 void scheduleDocumentResourcesGC(); | 202 void scheduleDocumentResourcesGC(); |
| 200 | 203 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 m_loader->m_allowStaleResources = m_previousState; | 269 m_loader->m_allowStaleResources = m_previousState; |
| 267 } | 270 } |
| 268 private: | 271 private: |
| 269 ResourceFetcher* m_loader; | 272 ResourceFetcher* m_loader; |
| 270 bool m_previousState; | 273 bool m_previousState; |
| 271 }; | 274 }; |
| 272 | 275 |
| 273 } // namespace blink | 276 } // namespace blink |
| 274 | 277 |
| 275 #endif | 278 #endif |
| OLD | NEW |