Chromium Code Reviews| 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 | 4 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 5 rights reserved. | 5 rights reserved. |
| 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 | 157 |
| 158 static void determineRequestContext(ResourceRequest&, | 158 static void determineRequestContext(ResourceRequest&, |
| 159 Resource::Type, | 159 Resource::Type, |
| 160 bool isMainFrame); | 160 bool isMainFrame); |
| 161 void determineRequestContext(ResourceRequest&, Resource::Type); | 161 void determineRequestContext(ResourceRequest&, Resource::Type); |
| 162 | 162 |
| 163 void updateAllImageResourcePriorities(); | 163 void updateAllImageResourcePriorities(); |
| 164 | 164 |
| 165 void reloadLoFiImages(); | 165 void reloadLoFiImages(); |
| 166 | 166 |
| 167 ResourceTimingInfo* getMainResourceTimingInfo(unsigned long identifier); | |
| 168 | |
| 167 // This is only exposed for testing purposes. | 169 // This is only exposed for testing purposes. |
| 168 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); } | 170 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); } |
| 169 | 171 |
| 170 private: | 172 private: |
| 171 friend class ResourceCacheValidationSuppressor; | 173 friend class ResourceCacheValidationSuppressor; |
| 172 | 174 |
| 173 explicit ResourceFetcher(FetchContext*); | 175 explicit ResourceFetcher(FetchContext*); |
| 174 | 176 |
| 175 void initializeRevalidation(ResourceRequest&, Resource*); | 177 void initializeRevalidation(ResourceRequest&, Resource*); |
| 176 Resource* createResourceForLoading(FetchRequest&, | 178 Resource* createResourceForLoading(FetchRequest&, |
| 177 const String& charset, | 179 const String& charset, |
| 178 const ResourceFactory&); | 180 const ResourceFactory&); |
| 179 void storeResourceTimingInitiatorInformation(Resource*); | 181 void storePerformanceTimingInitiatorInformation(Resource*); |
| 180 ResourceLoadPriority computeLoadPriority(Resource::Type, | 182 ResourceLoadPriority computeLoadPriority(Resource::Type, |
| 181 const FetchRequest&, | 183 const FetchRequest&, |
| 182 ResourcePriority::VisibilityStatus); | 184 ResourcePriority::VisibilityStatus); |
| 183 | 185 |
| 184 Resource* resourceForStaticData(const FetchRequest&, | 186 Resource* resourceForStaticData(const FetchRequest&, |
| 185 const ResourceFactory&, | 187 const ResourceFactory&, |
| 186 const SubstituteData&); | 188 const SubstituteData&); |
| 187 Resource* resourceForBlockedRequest(const FetchRequest&, | 189 Resource* resourceForBlockedRequest(const FetchRequest&, |
| 188 const ResourceFactory&); | 190 const ResourceFactory&); |
| 189 | 191 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 | 229 |
| 228 Member<HeapListHashSet<Member<Resource>>> m_preloads; | 230 Member<HeapListHashSet<Member<Resource>>> m_preloads; |
| 229 Member<MHTMLArchive> m_archive; | 231 Member<MHTMLArchive> m_archive; |
| 230 | 232 |
| 231 Timer<ResourceFetcher> m_resourceTimingReportTimer; | 233 Timer<ResourceFetcher> m_resourceTimingReportTimer; |
| 232 | 234 |
| 233 using ResourceTimingInfoMap = | 235 using ResourceTimingInfoMap = |
| 234 HeapHashMap<Member<Resource>, std::unique_ptr<ResourceTimingInfo>>; | 236 HeapHashMap<Member<Resource>, std::unique_ptr<ResourceTimingInfo>>; |
| 235 ResourceTimingInfoMap m_resourceTimingInfoMap; | 237 ResourceTimingInfoMap m_resourceTimingInfoMap; |
| 236 | 238 |
| 239 unsigned long m_mainResourceIdentifier; | |
|
Yoav Weiss
2016/12/01 21:53:55
This should be initialized
sunjian
2016/12/01 23:28:42
Done.
| |
| 240 std::unique_ptr<ResourceTimingInfo> m_mainResourceTimingInfo; | |
| 241 | |
| 237 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports; | 242 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports; |
| 238 | 243 |
| 239 HeapHashSet<Member<ResourceLoader>> m_loaders; | 244 HeapHashSet<Member<ResourceLoader>> m_loaders; |
| 240 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders; | 245 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders; |
| 241 | 246 |
| 242 // Used in hit rate histograms. | 247 // Used in hit rate histograms. |
| 243 class DeadResourceStatsRecorder { | 248 class DeadResourceStatsRecorder { |
| 244 DISALLOW_NEW(); | 249 DISALLOW_NEW(); |
| 245 | 250 |
| 246 public: | 251 public: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 } | 288 } |
| 284 | 289 |
| 285 private: | 290 private: |
| 286 Member<ResourceFetcher> m_loader; | 291 Member<ResourceFetcher> m_loader; |
| 287 bool m_previousState; | 292 bool m_previousState; |
| 288 }; | 293 }; |
| 289 | 294 |
| 290 } // namespace blink | 295 } // namespace blink |
| 291 | 296 |
| 292 #endif // ResourceFetcher_h | 297 #endif // ResourceFetcher_h |
| OLD | NEW |