Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.h

Issue 2511313002: transferSize implementation (Closed)
Patch Set: addressed comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 static void determineRequestContext(ResourceRequest&, 159 static void determineRequestContext(ResourceRequest&,
160 Resource::Type, 160 Resource::Type,
161 bool isMainFrame); 161 bool isMainFrame);
162 void determineRequestContext(ResourceRequest&, Resource::Type); 162 void determineRequestContext(ResourceRequest&, Resource::Type);
163 163
164 void updateAllImageResourcePriorities(); 164 void updateAllImageResourcePriorities();
165 165
166 void reloadLoFiImages(); 166 void reloadLoFiImages();
167 167
168 ResourceTimingInfo* getMainResourceTimingInfo(unsigned long identifier);
169
168 // This is only exposed for testing purposes. 170 // This is only exposed for testing purposes.
169 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); } 171 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); }
170 172
171 private: 173 private:
172 friend class ResourceCacheValidationSuppressor; 174 friend class ResourceCacheValidationSuppressor;
173 175
174 explicit ResourceFetcher(FetchContext*); 176 explicit ResourceFetcher(FetchContext*);
175 177
176 void initializeRevalidation(ResourceRequest&, Resource*); 178 void initializeRevalidation(ResourceRequest&, Resource*);
177 Resource* createResourceForLoading(FetchRequest&, 179 Resource* createResourceForLoading(FetchRequest&,
178 const String& charset, 180 const String& charset,
179 const ResourceFactory&); 181 const ResourceFactory&);
180 void storeResourceTimingInitiatorInformation(Resource*); 182 void storePerformanceTimingInitiatorInformation(Resource*);
181 ResourceLoadPriority computeLoadPriority(Resource::Type, 183 ResourceLoadPriority computeLoadPriority(Resource::Type,
182 const FetchRequest&, 184 const FetchRequest&,
183 ResourcePriority::VisibilityStatus); 185 ResourcePriority::VisibilityStatus);
184 186
185 Resource* resourceForStaticData(const FetchRequest&, 187 Resource* resourceForStaticData(const FetchRequest&,
186 const ResourceFactory&, 188 const ResourceFactory&,
187 const SubstituteData&); 189 const SubstituteData&);
188 Resource* resourceForBlockedRequest(const FetchRequest&, 190 Resource* resourceForBlockedRequest(const FetchRequest&,
189 const ResourceFactory&); 191 const ResourceFactory&);
190 192
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 230
229 Member<HeapListHashSet<Member<Resource>>> m_preloads; 231 Member<HeapListHashSet<Member<Resource>>> m_preloads;
230 Member<MHTMLArchive> m_archive; 232 Member<MHTMLArchive> m_archive;
231 233
232 Timer<ResourceFetcher> m_resourceTimingReportTimer; 234 Timer<ResourceFetcher> m_resourceTimingReportTimer;
233 235
234 using ResourceTimingInfoMap = 236 using ResourceTimingInfoMap =
235 HeapHashMap<Member<Resource>, std::unique_ptr<ResourceTimingInfo>>; 237 HeapHashMap<Member<Resource>, std::unique_ptr<ResourceTimingInfo>>;
236 ResourceTimingInfoMap m_resourceTimingInfoMap; 238 ResourceTimingInfoMap m_resourceTimingInfoMap;
237 239
240 // Find out whether a map is an overkill in here, crbugs/669300.
241 using MainResourceTimingInfoMap =
242 HashMap<unsigned long, std::unique_ptr<ResourceTimingInfo>>;
243 MainResourceTimingInfoMap m_mainResourceTimingInfoMap;
kinuko 2016/11/30 07:34:54 Again my gut feeling is we probably wouldn't need
sunjian 2016/12/01 21:21:59 Done.
244
238 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports; 245 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports;
239 246
240 HeapHashSet<Member<ResourceLoader>> m_loaders; 247 HeapHashSet<Member<ResourceLoader>> m_loaders;
241 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders; 248 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders;
242 249
243 // Used in hit rate histograms. 250 // Used in hit rate histograms.
244 class DeadResourceStatsRecorder { 251 class DeadResourceStatsRecorder {
245 DISALLOW_NEW(); 252 DISALLOW_NEW();
246 253
247 public: 254 public:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 291 }
285 292
286 private: 293 private:
287 Member<ResourceFetcher> m_loader; 294 Member<ResourceFetcher> m_loader;
288 bool m_previousState; 295 bool m_previousState;
289 }; 296 };
290 297
291 } // namespace blink 298 } // namespace blink
292 299
293 #endif // ResourceFetcher_h 300 #endif // ResourceFetcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698