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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 static bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPo
licy); | 166 static bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPo
licy); |
167 | 167 |
168 void garbageCollectDocumentResourcesTimerFired(Timer<ResourceFetcher>*); | 168 void garbageCollectDocumentResourcesTimerFired(Timer<ResourceFetcher>*); |
169 | 169 |
170 void resourceTimingReportTimerFired(Timer<ResourceFetcher>*); | 170 void resourceTimingReportTimerFired(Timer<ResourceFetcher>*); |
171 | 171 |
172 void reloadImagesIfNotDeferred(); | 172 void reloadImagesIfNotDeferred(); |
173 | 173 |
174 void willTerminateResourceLoader(ResourceLoader*); | 174 void willTerminateResourceLoader(ResourceLoader*); |
175 | 175 |
| 176 ResourceLoadPriority modifyPriorityForExperiments(ResourceLoadPriority, Reso
urce::Type, const FetchRequest&); |
| 177 |
176 Member<FetchContext> m_context; | 178 Member<FetchContext> m_context; |
177 | 179 |
178 HashSet<String> m_validatedURLs; | 180 HashSet<String> m_validatedURLs; |
179 mutable DocumentResourceMap m_documentResources; | 181 mutable DocumentResourceMap m_documentResources; |
180 | 182 |
181 // We intentionally use a Member instead of a ResourcePtr. | 183 // We intentionally use a Member instead of a ResourcePtr. |
182 // Using a ResourcePtrs can lead to a wrong behavior because | 184 // Using a ResourcePtrs can lead to a wrong behavior because |
183 // the underlying Resource of the ResourcePtr is updated when the Resource | 185 // the underlying Resource of the ResourcePtr is updated when the Resource |
184 // is revalidated. What we really want to hold here is not the ResourcePtr | 186 // is revalidated. What we really want to hold here is not the ResourcePtr |
185 // but the underlying Resource. | 187 // but the underlying Resource. |
(...skipping 26 matching lines...) Expand all Loading... |
212 int m_useCount; | 214 int m_useCount; |
213 int m_revalidateCount; | 215 int m_revalidateCount; |
214 int m_loadCount; | 216 int m_loadCount; |
215 }; | 217 }; |
216 DeadResourceStatsRecorder m_deadStatsRecorder; | 218 DeadResourceStatsRecorder m_deadStatsRecorder; |
217 | 219 |
218 // 28 bits left | 220 // 28 bits left |
219 bool m_autoLoadImages : 1; | 221 bool m_autoLoadImages : 1; |
220 bool m_imagesEnabled : 1; | 222 bool m_imagesEnabled : 1; |
221 bool m_allowStaleResources : 1; | 223 bool m_allowStaleResources : 1; |
222 bool m_imageFetched : 1; | |
223 }; | 224 }; |
224 | 225 |
225 class ResourceCacheValidationSuppressor { | 226 class ResourceCacheValidationSuppressor { |
226 WTF_MAKE_NONCOPYABLE(ResourceCacheValidationSuppressor); | 227 WTF_MAKE_NONCOPYABLE(ResourceCacheValidationSuppressor); |
227 STACK_ALLOCATED(); | 228 STACK_ALLOCATED(); |
228 public: | 229 public: |
229 ResourceCacheValidationSuppressor(ResourceFetcher* loader) | 230 ResourceCacheValidationSuppressor(ResourceFetcher* loader) |
230 : m_loader(loader) | 231 : m_loader(loader) |
231 , m_previousState(false) | 232 , m_previousState(false) |
232 { | 233 { |
233 if (m_loader) { | 234 if (m_loader) { |
234 m_previousState = m_loader->m_allowStaleResources; | 235 m_previousState = m_loader->m_allowStaleResources; |
235 m_loader->m_allowStaleResources = true; | 236 m_loader->m_allowStaleResources = true; |
236 } | 237 } |
237 } | 238 } |
238 ~ResourceCacheValidationSuppressor() | 239 ~ResourceCacheValidationSuppressor() |
239 { | 240 { |
240 if (m_loader) | 241 if (m_loader) |
241 m_loader->m_allowStaleResources = m_previousState; | 242 m_loader->m_allowStaleResources = m_previousState; |
242 } | 243 } |
243 private: | 244 private: |
244 Member<ResourceFetcher> m_loader; | 245 Member<ResourceFetcher> m_loader; |
245 bool m_previousState; | 246 bool m_previousState; |
246 }; | 247 }; |
247 | 248 |
248 } // namespace blink | 249 } // namespace blink |
249 | 250 |
250 #endif // ResourceFetcher_h | 251 #endif // ResourceFetcher_h |
OLD | NEW |