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

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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Calling this method before main resource is fetched is invalid.
168 ResourceTimingInfo* getMainResourceTimingInfo();
169
167 // This is only exposed for testing purposes. 170 // This is only exposed for testing purposes.
168 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); } 171 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); }
169 172
170 private: 173 private:
171 friend class ResourceCacheValidationSuppressor; 174 friend class ResourceCacheValidationSuppressor;
172 175
173 explicit ResourceFetcher(FetchContext*); 176 explicit ResourceFetcher(FetchContext*);
174 177
175 void initializeRevalidation(ResourceRequest&, Resource*); 178 void initializeRevalidation(ResourceRequest&, Resource*);
176 Resource* createResourceForLoading(FetchRequest&, 179 Resource* createResourceForLoading(FetchRequest&,
177 const String& charset, 180 const String& charset,
178 const ResourceFactory&); 181 const ResourceFactory&);
179 void storeResourceTimingInitiatorInformation(Resource*); 182 void storePerformanceTimingInitiatorInformation(Resource*);
180 ResourceLoadPriority computeLoadPriority(Resource::Type, 183 ResourceLoadPriority computeLoadPriority(Resource::Type,
181 const FetchRequest&, 184 const FetchRequest&,
182 ResourcePriority::VisibilityStatus); 185 ResourcePriority::VisibilityStatus);
183 186
184 Resource* resourceForStaticData(const FetchRequest&, 187 Resource* resourceForStaticData(const FetchRequest&,
185 const ResourceFactory&, 188 const ResourceFactory&,
186 const SubstituteData&); 189 const SubstituteData&);
187 Resource* resourceForBlockedRequest(const FetchRequest&, 190 Resource* resourceForBlockedRequest(const FetchRequest&,
188 const ResourceFactory&); 191 const ResourceFactory&);
189 192
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 230
228 Member<HeapListHashSet<Member<Resource>>> m_preloads; 231 Member<HeapListHashSet<Member<Resource>>> m_preloads;
229 Member<MHTMLArchive> m_archive; 232 Member<MHTMLArchive> m_archive;
230 233
231 Timer<ResourceFetcher> m_resourceTimingReportTimer; 234 Timer<ResourceFetcher> m_resourceTimingReportTimer;
232 235
233 using ResourceTimingInfoMap = 236 using ResourceTimingInfoMap =
234 HeapHashMap<Member<Resource>, std::unique_ptr<ResourceTimingInfo>>; 237 HeapHashMap<Member<Resource>, std::unique_ptr<ResourceTimingInfo>>;
235 ResourceTimingInfoMap m_resourceTimingInfoMap; 238 ResourceTimingInfoMap m_resourceTimingInfoMap;
236 239
240 unsigned long m_mainResourceIdentifier;
241 std::unique_ptr<ResourceTimingInfo> m_mainResourceTimingInfo;
242
237 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports; 243 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports;
238 244
239 HeapHashSet<Member<ResourceLoader>> m_loaders; 245 HeapHashSet<Member<ResourceLoader>> m_loaders;
240 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders; 246 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders;
241 247
242 // Used in hit rate histograms. 248 // Used in hit rate histograms.
243 class DeadResourceStatsRecorder { 249 class DeadResourceStatsRecorder {
244 DISALLOW_NEW(); 250 DISALLOW_NEW();
245 251
246 public: 252 public:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 289 }
284 290
285 private: 291 private:
286 Member<ResourceFetcher> m_loader; 292 Member<ResourceFetcher> m_loader;
287 bool m_previousState; 293 bool m_previousState;
288 }; 294 };
289 295
290 } // namespace blink 296 } // namespace blink
291 297
292 #endif // ResourceFetcher_h 298 #endif // ResourceFetcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698