| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void setImagesEnabled(bool); | 87 void setImagesEnabled(bool); |
| 88 | 88 |
| 89 FetchContext& context() const { return m_context ? *m_context.get() : FetchC
ontext::nullInstance(); } | 89 FetchContext& context() const { return m_context ? *m_context.get() : FetchC
ontext::nullInstance(); } |
| 90 void clearContext(); | 90 void clearContext(); |
| 91 | 91 |
| 92 int requestCount() const; | 92 int requestCount() const; |
| 93 bool hasPendingRequest() const; | 93 bool hasPendingRequest() const; |
| 94 | 94 |
| 95 enum ClearPreloadsPolicy { ClearAllPreloads, ClearSpeculativeMarkupPreloads
}; | 95 enum ClearPreloadsPolicy { ClearAllPreloads, ClearSpeculativeMarkupPreloads
}; |
| 96 | 96 |
| 97 bool isPreloaded(const KURL&) const; | 97 void enableIsPreloadedForTest(); |
| 98 bool isPreloadedForTest(const KURL&) const; |
| 99 |
| 98 int countPreloads() const { return m_preloads ? m_preloads->size() : 0; } | 100 int countPreloads() const { return m_preloads ? m_preloads->size() : 0; } |
| 99 void clearPreloads(ClearPreloadsPolicy = ClearAllPreloads); | 101 void clearPreloads(ClearPreloadsPolicy = ClearAllPreloads); |
| 100 void preloadStarted(Resource*); | 102 void preloadStarted(Resource*); |
| 101 void logPreloadStats(); | 103 void logPreloadStats(); |
| 102 | 104 |
| 103 MHTMLArchive* archive() const { return m_archive.get(); } | 105 MHTMLArchive* archive() const { return m_archive.get(); } |
| 104 ArchiveResource* createArchive(Resource*); | 106 ArchiveResource* createArchive(Resource*); |
| 105 | 107 |
| 106 void setDefersLoading(bool); | 108 void setDefersLoading(bool); |
| 107 void stopFetching(); | 109 void stopFetching(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 203 |
| 202 void update(RevalidationPolicy); | 204 void update(RevalidationPolicy); |
| 203 | 205 |
| 204 private: | 206 private: |
| 205 int m_useCount; | 207 int m_useCount; |
| 206 int m_revalidateCount; | 208 int m_revalidateCount; |
| 207 int m_loadCount; | 209 int m_loadCount; |
| 208 }; | 210 }; |
| 209 DeadResourceStatsRecorder m_deadStatsRecorder; | 211 DeadResourceStatsRecorder m_deadStatsRecorder; |
| 210 | 212 |
| 213 std::unique_ptr<HashSet<String>> m_preloadedURLsForTest; |
| 214 |
| 211 // 28 bits left | 215 // 28 bits left |
| 212 bool m_autoLoadImages : 1; | 216 bool m_autoLoadImages : 1; |
| 213 bool m_imagesEnabled : 1; | 217 bool m_imagesEnabled : 1; |
| 214 bool m_allowStaleResources : 1; | 218 bool m_allowStaleResources : 1; |
| 215 bool m_imageFetched : 1; | 219 bool m_imageFetched : 1; |
| 216 }; | 220 }; |
| 217 | 221 |
| 218 class ResourceCacheValidationSuppressor { | 222 class ResourceCacheValidationSuppressor { |
| 219 WTF_MAKE_NONCOPYABLE(ResourceCacheValidationSuppressor); | 223 WTF_MAKE_NONCOPYABLE(ResourceCacheValidationSuppressor); |
| 220 STACK_ALLOCATED(); | 224 STACK_ALLOCATED(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 234 m_loader->m_allowStaleResources = m_previousState; | 238 m_loader->m_allowStaleResources = m_previousState; |
| 235 } | 239 } |
| 236 private: | 240 private: |
| 237 Member<ResourceFetcher> m_loader; | 241 Member<ResourceFetcher> m_loader; |
| 238 bool m_previousState; | 242 bool m_previousState; |
| 239 }; | 243 }; |
| 240 | 244 |
| 241 } // namespace blink | 245 } // namespace blink |
| 242 | 246 |
| 243 #endif // ResourceFetcher_h | 247 #endif // ResourceFetcher_h |
| OLD | NEW |