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

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

Issue 2533983003: Move hacks for Inspector in restoreCachedResourceIfNeeded() to ResourceFetcher (Closed)
Patch Set: Rebase 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 void acceptDataFromThreadedReceiver(unsigned long identifier, 140 void acceptDataFromThreadedReceiver(unsigned long identifier,
141 const char* data, 141 const char* data,
142 int dataLength, 142 int dataLength,
143 int encodedDataLength); 143 int encodedDataLength);
144 144
145 enum ResourceLoadStartType { 145 enum ResourceLoadStartType {
146 ResourceLoadingFromNetwork, 146 ResourceLoadingFromNetwork,
147 ResourceLoadingFromCache 147 ResourceLoadingFromCache
148 }; 148 };
149 void requestLoadStarted(unsigned long identifier,
150 Resource*,
151 const FetchRequest&,
152 ResourceLoadStartType,
153 bool isStaticData = false);
154 static const ResourceLoaderOptions& defaultResourceOptions(); 149 static const ResourceLoaderOptions& defaultResourceOptions();
155 150
156 String getCacheIdentifier() const; 151 String getCacheIdentifier() const;
157 152
158 static void determineRequestContext(ResourceRequest&, 153 static void determineRequestContext(ResourceRequest&,
159 Resource::Type, 154 Resource::Type,
160 bool isMainFrame); 155 bool isMainFrame);
161 void determineRequestContext(ResourceRequest&, Resource::Type); 156 void determineRequestContext(ResourceRequest&, Resource::Type);
162 157
163 void updateAllImageResourcePriorities(); 158 void updateAllImageResourcePriorities();
164 159
165 void reloadLoFiImages(); 160 void reloadLoFiImages();
166 161
167 // This is only exposed for testing purposes. 162 // This is only exposed for testing purposes.
168 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); } 163 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); }
169 164
165 // Workaround for https://crbug.com/666214.
166 // TODO(hiroshige): Remove this hack.
167 void emulateLoadStartedForInspector(Resource*,
168 const KURL&,
169 WebURLRequest::RequestContext,
170 const AtomicString& initiatorName);
171
170 private: 172 private:
171 friend class ResourceCacheValidationSuppressor; 173 friend class ResourceCacheValidationSuppressor;
172 174
173 explicit ResourceFetcher(FetchContext*); 175 explicit ResourceFetcher(FetchContext*);
174 176
175 void initializeRevalidation(ResourceRequest&, Resource*); 177 void initializeRevalidation(ResourceRequest&, Resource*);
176 Resource* createResourceForLoading(FetchRequest&, 178 Resource* createResourceForLoading(FetchRequest&,
177 const String& charset, 179 const String& charset,
178 const ResourceFactory&); 180 const ResourceFactory&);
179 void storeResourceTimingInitiatorInformation(Resource*); 181 void storeResourceTimingInitiatorInformation(Resource*);
(...skipping 20 matching lines...) Expand all
200 202
201 void initializeResourceRequest(ResourceRequest&, 203 void initializeResourceRequest(ResourceRequest&,
202 Resource::Type, 204 Resource::Type,
203 FetchRequest::DeferOption); 205 FetchRequest::DeferOption);
204 void willSendRequest(unsigned long identifier, 206 void willSendRequest(unsigned long identifier,
205 ResourceRequest&, 207 ResourceRequest&,
206 const ResourceResponse&, 208 const ResourceResponse&,
207 const ResourceLoaderOptions&); 209 const ResourceLoaderOptions&);
208 bool canAccessResponse(Resource*, const ResourceResponse&) const; 210 bool canAccessResponse(Resource*, const ResourceResponse&) const;
209 211
212 void requestLoadStarted(unsigned long identifier,
213 Resource*,
214 const FetchRequest&,
215 ResourceLoadStartType,
216 bool isStaticData = false);
217
210 bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPolicy); 218 bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPolicy);
211 bool shouldDeferImageLoad(const KURL&) const; 219 bool shouldDeferImageLoad(const KURL&) const;
212 220
213 void resourceTimingReportTimerFired(TimerBase*); 221 void resourceTimingReportTimerFired(TimerBase*);
214 222
215 void reloadImagesIfNotDeferred(); 223 void reloadImagesIfNotDeferred();
216 224
217 void updateMemoryCacheStats(Resource*, 225 void updateMemoryCacheStats(Resource*,
218 RevalidationPolicy, 226 RevalidationPolicy,
219 const FetchRequest&, 227 const FetchRequest&,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 291 }
284 292
285 private: 293 private:
286 Member<ResourceFetcher> m_loader; 294 Member<ResourceFetcher> m_loader;
287 bool m_previousState; 295 bool m_previousState;
288 }; 296 };
289 297
290 } // namespace blink 298 } // namespace blink
291 299
292 #endif // ResourceFetcher_h 300 #endif // ResourceFetcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698