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

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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 static void determineRequestContext(ResourceRequest&, 148 static void determineRequestContext(ResourceRequest&,
149 Resource::Type, 149 Resource::Type,
150 bool isMainFrame); 150 bool isMainFrame);
151 void determineRequestContext(ResourceRequest&, Resource::Type); 151 void determineRequestContext(ResourceRequest&, Resource::Type);
152 152
153 void updateAllImageResourcePriorities(); 153 void updateAllImageResourcePriorities();
154 154
155 void reloadLoFiImages(); 155 void reloadLoFiImages();
156 156
157 // Calling this method before main document resource is fetched is invalid.
158 ResourceTimingInfo* getNavigationTimingInfo();
159
157 // This is only exposed for testing purposes. 160 // This is only exposed for testing purposes.
158 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); } 161 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); }
159 162
160 // Workaround for https://crbug.com/666214. 163 // Workaround for https://crbug.com/666214.
161 // TODO(hiroshige): Remove this hack. 164 // TODO(hiroshige): Remove this hack.
162 void emulateLoadStartedForInspector(Resource*, 165 void emulateLoadStartedForInspector(Resource*,
163 const KURL&, 166 const KURL&,
164 WebURLRequest::RequestContext, 167 WebURLRequest::RequestContext,
165 const AtomicString& initiatorName); 168 const AtomicString& initiatorName);
166 169
167 private: 170 private:
168 friend class ResourceCacheValidationSuppressor; 171 friend class ResourceCacheValidationSuppressor;
169 172
170 explicit ResourceFetcher(FetchContext*); 173 explicit ResourceFetcher(FetchContext*);
171 174
172 void initializeRevalidation(ResourceRequest&, Resource*); 175 void initializeRevalidation(ResourceRequest&, Resource*);
173 Resource* createResourceForLoading(FetchRequest&, 176 Resource* createResourceForLoading(FetchRequest&,
174 const String& charset, 177 const String& charset,
175 const ResourceFactory&); 178 const ResourceFactory&);
176 void storeResourceTimingInitiatorInformation(Resource*); 179 void storePerformanceTimingInitiatorInformation(Resource*);
177 ResourceLoadPriority computeLoadPriority(Resource::Type, 180 ResourceLoadPriority computeLoadPriority(Resource::Type,
178 const FetchRequest&, 181 const FetchRequest&,
179 ResourcePriority::VisibilityStatus); 182 ResourcePriority::VisibilityStatus);
180 183
181 Resource* resourceForStaticData(const FetchRequest&, 184 Resource* resourceForStaticData(const FetchRequest&,
182 const ResourceFactory&, 185 const ResourceFactory&,
183 const SubstituteData&); 186 const SubstituteData&);
184 Resource* resourceForBlockedRequest(const FetchRequest&, 187 Resource* resourceForBlockedRequest(const FetchRequest&,
185 const ResourceFactory&, 188 const ResourceFactory&,
186 ResourceRequestBlockedReason); 189 ResourceRequestBlockedReason);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 235
233 Member<HeapListHashSet<Member<Resource>>> m_preloads; 236 Member<HeapListHashSet<Member<Resource>>> m_preloads;
234 Member<MHTMLArchive> m_archive; 237 Member<MHTMLArchive> m_archive;
235 238
236 Timer<ResourceFetcher> m_resourceTimingReportTimer; 239 Timer<ResourceFetcher> m_resourceTimingReportTimer;
237 240
238 using ResourceTimingInfoMap = 241 using ResourceTimingInfoMap =
239 HeapHashMap<Member<Resource>, std::unique_ptr<ResourceTimingInfo>>; 242 HeapHashMap<Member<Resource>, std::unique_ptr<ResourceTimingInfo>>;
240 ResourceTimingInfoMap m_resourceTimingInfoMap; 243 ResourceTimingInfoMap m_resourceTimingInfoMap;
241 244
245 std::unique_ptr<ResourceTimingInfo> m_navigationTimingInfo;
246
242 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports; 247 Vector<std::unique_ptr<ResourceTimingInfo>> m_scheduledResourceTimingReports;
243 248
244 HeapHashSet<Member<ResourceLoader>> m_loaders; 249 HeapHashSet<Member<ResourceLoader>> m_loaders;
245 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders; 250 HeapHashSet<Member<ResourceLoader>> m_nonBlockingLoaders;
246 251
247 // Used in hit rate histograms. 252 // Used in hit rate histograms.
248 class DeadResourceStatsRecorder { 253 class DeadResourceStatsRecorder {
249 DISALLOW_NEW(); 254 DISALLOW_NEW();
250 255
251 public: 256 public:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 293 }
289 294
290 private: 295 private:
291 Member<ResourceFetcher> m_loader; 296 Member<ResourceFetcher> m_loader;
292 bool m_previousState; 297 bool m_previousState;
293 }; 298 };
294 299
295 } // namespace blink 300 } // namespace blink
296 301
297 #endif // ResourceFetcher_h 302 #endif // ResourceFetcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698