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

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

Issue 2511313002: transferSize implementation (Closed)
Patch Set: add nullptr checking against m_mainResource Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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&,
(...skipping 50 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 using MainResourceTimingInfoMap =
241 HashMap<unsigned long, std::unique_ptr<ResourceTimingInfo>>;
panicker 2016/11/22 02:17:42 HeapHashMap?
sunjian 2016/11/22 02:39:20 Talked offline. Agreed that no need to use a HeapH
242 MainResourceTimingInfoMap m_mainResourceTimingInfoMap;
243
238 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports; 244 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports;
239 245
240 HeapHashSet<Member<ResourceLoader>> m_loaders; 246 HeapHashSet<Member<ResourceLoader>> m_loaders;
241 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders; 247 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders;
242 248
243 // Used in hit rate histograms. 249 // Used in hit rate histograms.
244 class DeadResourceStatsRecorder { 250 class DeadResourceStatsRecorder {
245 DISALLOW_NEW(); 251 DISALLOW_NEW();
246 252
247 public: 253 public:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 290 }
285 291
286 private: 292 private:
287 Member<ResourceFetcher> m_loader; 293 Member<ResourceFetcher> m_loader;
288 bool m_previousState; 294 bool m_previousState;
289 }; 295 };
290 296
291 } // namespace blink 297 } // namespace blink
292 298
293 #endif // ResourceFetcher_h 299 #endif // ResourceFetcher_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698