| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 int NonblockingRequestCount() const; | 97 int NonblockingRequestCount() const; |
| 98 | 98 |
| 99 enum ClearPreloadsPolicy { | 99 enum ClearPreloadsPolicy { |
| 100 kClearAllPreloads, | 100 kClearAllPreloads, |
| 101 kClearSpeculativeMarkupPreloads | 101 kClearSpeculativeMarkupPreloads |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 void EnableIsPreloadedForTest(); | 104 void EnableIsPreloadedForTest(); |
| 105 bool IsPreloadedForTest(const KURL&) const; | 105 bool IsPreloadedForTest(const KURL&) const; |
| 106 | 106 |
| 107 int CountPreloads() const { return preloads_ ? preloads_->size() : 0; } | 107 int CountPreloads() const { return preloads_.size(); } |
| 108 void ClearPreloads(ClearPreloadsPolicy = kClearAllPreloads); | 108 void ClearPreloads(ClearPreloadsPolicy = kClearAllPreloads); |
| 109 void PreloadStarted(Resource*); | 109 void PreloadStarted(Resource*); |
| 110 void LogPreloadStats(ClearPreloadsPolicy); | 110 void LogPreloadStats(ClearPreloadsPolicy); |
| 111 void WarnUnusedPreloads(); | 111 void WarnUnusedPreloads(); |
| 112 | 112 |
| 113 MHTMLArchive* Archive() const { return archive_.Get(); } | 113 MHTMLArchive* Archive() const { return archive_.Get(); } |
| 114 ArchiveResource* CreateArchive(Resource*); | 114 ArchiveResource* CreateArchive(Resource*); |
| 115 | 115 |
| 116 void SetDefersLoading(bool); | 116 void SetDefersLoading(bool); |
| 117 void StopFetching(); | 117 void StopFetching(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 136 Resource::Type) const; | 136 Resource::Type) const; |
| 137 | 137 |
| 138 void UpdateAllImageResourcePriorities(); | 138 void UpdateAllImageResourcePriorities(); |
| 139 | 139 |
| 140 void ReloadLoFiImages(); | 140 void ReloadLoFiImages(); |
| 141 | 141 |
| 142 // Calling this method before main document resource is fetched is invalid. | 142 // Calling this method before main document resource is fetched is invalid. |
| 143 ResourceTimingInfo* GetNavigationTimingInfo(); | 143 ResourceTimingInfo* GetNavigationTimingInfo(); |
| 144 | 144 |
| 145 bool ContainsAsPreloadForTesting(Resource* resource) const { | 145 bool ContainsAsPreloadForTesting(Resource* resource) const { |
| 146 return preloads_ && preloads_->Contains(resource); | 146 return preloads_.Contains(resource); |
| 147 } | 147 } |
| 148 | 148 |
| 149 // Workaround for https://crbug.com/666214. | 149 // Workaround for https://crbug.com/666214. |
| 150 // TODO(hiroshige): Remove this hack. | 150 // TODO(hiroshige): Remove this hack. |
| 151 void EmulateLoadStartedForInspector(Resource*, | 151 void EmulateLoadStartedForInspector(Resource*, |
| 152 const KURL&, | 152 const KURL&, |
| 153 WebURLRequest::RequestContext, | 153 WebURLRequest::RequestContext, |
| 154 const AtomicString& initiator_name); | 154 const AtomicString& initiator_name); |
| 155 | 155 |
| 156 private: | 156 private: |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 RevalidationPolicy, | 222 RevalidationPolicy, |
| 223 const FetchParameters&, | 223 const FetchParameters&, |
| 224 const ResourceFactory&, | 224 const ResourceFactory&, |
| 225 bool is_static_data) const; | 225 bool is_static_data) const; |
| 226 | 226 |
| 227 Member<FetchContext> context_; | 227 Member<FetchContext> context_; |
| 228 | 228 |
| 229 HashSet<String> validated_urls_; | 229 HashSet<String> validated_urls_; |
| 230 mutable DocumentResourceMap document_resources_; | 230 mutable DocumentResourceMap document_resources_; |
| 231 | 231 |
| 232 Member<HeapListHashSet<Member<Resource>>> preloads_; | 232 HeapListHashSet<Member<Resource>> preloads_; |
| 233 Member<MHTMLArchive> archive_; | 233 Member<MHTMLArchive> archive_; |
| 234 | 234 |
| 235 TaskRunnerTimer<ResourceFetcher> resource_timing_report_timer_; | 235 TaskRunnerTimer<ResourceFetcher> resource_timing_report_timer_; |
| 236 | 236 |
| 237 using ResourceTimingInfoMap = | 237 using ResourceTimingInfoMap = |
| 238 HeapHashMap<Member<Resource>, RefPtr<ResourceTimingInfo>>; | 238 HeapHashMap<Member<Resource>, RefPtr<ResourceTimingInfo>>; |
| 239 ResourceTimingInfoMap resource_timing_info_map_; | 239 ResourceTimingInfoMap resource_timing_info_map_; |
| 240 | 240 |
| 241 RefPtr<ResourceTimingInfo> navigation_timing_info_; | 241 RefPtr<ResourceTimingInfo> navigation_timing_info_; |
| 242 | 242 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 289 } |
| 290 | 290 |
| 291 private: | 291 private: |
| 292 Member<ResourceFetcher> loader_; | 292 Member<ResourceFetcher> loader_; |
| 293 bool previous_state_; | 293 bool previous_state_; |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 } // namespace blink | 296 } // namespace blink |
| 297 | 297 |
| 298 #endif // ResourceFetcher_h | 298 #endif // ResourceFetcher_h |
| OLD | NEW |