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

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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 int dataLength, 132 int dataLength,
133 int encodedDataLength); 133 int encodedDataLength);
134 void didDownloadData(const Resource*, int dataLength, int encodedDataLength); 134 void didDownloadData(const Resource*, int dataLength, int encodedDataLength);
135 bool defersLoading() const; 135 bool defersLoading() const;
136 bool isControlledByServiceWorker() const; 136 bool isControlledByServiceWorker() const;
137 137
138 enum ResourceLoadStartType { 138 enum ResourceLoadStartType {
139 ResourceLoadingFromNetwork, 139 ResourceLoadingFromNetwork,
140 ResourceLoadingFromCache 140 ResourceLoadingFromCache
141 }; 141 };
142 void requestLoadStarted(unsigned long identifier,
143 Resource*,
144 const FetchRequest&,
145 ResourceLoadStartType,
146 bool isStaticData = false);
147 static const ResourceLoaderOptions& defaultResourceOptions(); 142 static const ResourceLoaderOptions& defaultResourceOptions();
148 143
149 String getCacheIdentifier() const; 144 String getCacheIdentifier() const;
150 145
151 static void determineRequestContext(ResourceRequest&, 146 static void determineRequestContext(ResourceRequest&,
152 Resource::Type, 147 Resource::Type,
153 bool isMainFrame); 148 bool isMainFrame);
154 void determineRequestContext(ResourceRequest&, Resource::Type); 149 void determineRequestContext(ResourceRequest&, Resource::Type);
155 150
156 void updateAllImageResourcePriorities(); 151 void updateAllImageResourcePriorities();
157 152
158 void reloadLoFiImages(); 153 void reloadLoFiImages();
159 154
160 // This is only exposed for testing purposes. 155 // This is only exposed for testing purposes.
161 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); } 156 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); }
162 157
158 // Workaround for https://crbug.com/666214.
159 // TODO(hiroshige): Remove this hack.
160 void emulateLoadStartedForInspector(Resource*,
161 const KURL&,
162 WebURLRequest::RequestContext,
163 const AtomicString& initiatorName);
164
163 private: 165 private:
164 friend class ResourceCacheValidationSuppressor; 166 friend class ResourceCacheValidationSuppressor;
165 167
166 explicit ResourceFetcher(FetchContext*); 168 explicit ResourceFetcher(FetchContext*);
167 169
168 void initializeRevalidation(ResourceRequest&, Resource*); 170 void initializeRevalidation(ResourceRequest&, Resource*);
169 Resource* createResourceForLoading(FetchRequest&, 171 Resource* createResourceForLoading(FetchRequest&,
170 const String& charset, 172 const String& charset,
171 const ResourceFactory&); 173 const ResourceFactory&);
172 void storeResourceTimingInitiatorInformation(Resource*); 174 void storeResourceTimingInitiatorInformation(Resource*);
(...skipping 20 matching lines...) Expand all
193 195
194 void initializeResourceRequest(ResourceRequest&, 196 void initializeResourceRequest(ResourceRequest&,
195 Resource::Type, 197 Resource::Type,
196 FetchRequest::DeferOption); 198 FetchRequest::DeferOption);
197 void willSendRequest(unsigned long identifier, 199 void willSendRequest(unsigned long identifier,
198 ResourceRequest&, 200 ResourceRequest&,
199 const ResourceResponse&, 201 const ResourceResponse&,
200 const ResourceLoaderOptions&); 202 const ResourceLoaderOptions&);
201 bool canAccessResponse(Resource*, const ResourceResponse&) const; 203 bool canAccessResponse(Resource*, const ResourceResponse&) const;
202 204
205 void requestLoadStarted(unsigned long identifier,
206 Resource*,
207 const FetchRequest&,
208 ResourceLoadStartType,
209 bool isStaticData = false);
210
203 bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPolicy); 211 bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPolicy);
204 bool shouldDeferImageLoad(const KURL&) const; 212 bool shouldDeferImageLoad(const KURL&) const;
205 213
206 void resourceTimingReportTimerFired(TimerBase*); 214 void resourceTimingReportTimerFired(TimerBase*);
207 215
208 void reloadImagesIfNotDeferred(); 216 void reloadImagesIfNotDeferred();
209 217
210 void updateMemoryCacheStats(Resource*, 218 void updateMemoryCacheStats(Resource*,
211 RevalidationPolicy, 219 RevalidationPolicy,
212 const FetchRequest&, 220 const FetchRequest&,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 284 }
277 285
278 private: 286 private:
279 Member<ResourceFetcher> m_loader; 287 Member<ResourceFetcher> m_loader;
280 bool m_previousState; 288 bool m_previousState;
281 }; 289 };
282 290
283 } // namespace blink 291 } // namespace blink
284 292
285 #endif // ResourceFetcher_h 293 #endif // ResourceFetcher_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageValue.cpp ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698