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

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

Issue 2533683002: Move the code in ResourceFetcher handling calls from WebURLLoaderImpl to ResourceLoader (Closed)
Patch Set: Fix test 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 void logPreloadStats(ClearPreloadsPolicy); 108 void logPreloadStats(ClearPreloadsPolicy);
109 void warnUnusedPreloads(); 109 void warnUnusedPreloads();
110 110
111 MHTMLArchive* archive() const { return m_archive.get(); } 111 MHTMLArchive* archive() const { return m_archive.get(); }
112 ArchiveResource* createArchive(Resource*); 112 ArchiveResource* createArchive(Resource*);
113 113
114 void setDefersLoading(bool); 114 void setDefersLoading(bool);
115 void stopFetching(); 115 void stopFetching();
116 bool isFetching() const; 116 bool isFetching() const;
117 117
118 ResourceRequestBlockedReason willFollowRedirect(Resource*, 118 bool shouldDeferImageLoad(const KURL&) const;
119 ResourceRequest&, 119
120 const ResourceResponse&); 120 void recordResourceTimingOnRedirect(Resource*, const ResourceResponse&, bool);
121 enum DidFinishLoadingReason { 121
122 DidFinishLoading, 122 enum LoaderFinishType { DidFinishLoading, DidFinishFirstPartInMultipart };
123 DidFinishFirstPartInMultipart 123 void handleLoaderFinish(Resource*, double finishTime, LoaderFinishType);
124 }; 124 void handleLoaderError(Resource*, const ResourceError&);
125 void didFinishLoading(Resource*,
126 double finishTime,
127 DidFinishLoadingReason);
128 void didFailLoading(Resource*, const ResourceError&);
129 void didReceiveResponse(Resource*,
130 const ResourceResponse&,
131 std::unique_ptr<WebDataConsumerHandle>);
132 void didReceiveData(const Resource*, const char* data, int dataLength);
133 void didReceiveTransferSizeUpdate(const Resource*, int transferSizeDiff);
134 void didDownloadData(const Resource*, int dataLength, int encodedDataLength);
135 bool defersLoading() const;
136 bool isControlledByServiceWorker() const; 125 bool isControlledByServiceWorker() const;
137 126
138 enum ResourceLoadStartType { 127 enum ResourceLoadStartType {
139 ResourceLoadingFromNetwork, 128 ResourceLoadingFromNetwork,
140 ResourceLoadingFromCache 129 ResourceLoadingFromCache
141 }; 130 };
142 static const ResourceLoaderOptions& defaultResourceOptions(); 131 static const ResourceLoaderOptions& defaultResourceOptions();
143 132
144 String getCacheIdentifier() const; 133 String getCacheIdentifier() const;
145 134
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496. 178 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496.
190 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; 179 enum RevalidationPolicy { Use, Revalidate, Reload, Load };
191 RevalidationPolicy determineRevalidationPolicy(Resource::Type, 180 RevalidationPolicy determineRevalidationPolicy(Resource::Type,
192 const FetchRequest&, 181 const FetchRequest&,
193 Resource* existingResource, 182 Resource* existingResource,
194 bool isStaticData) const; 183 bool isStaticData) const;
195 184
196 void moveCachedNonBlockingResourceToBlocking(Resource*, const FetchRequest&); 185 void moveCachedNonBlockingResourceToBlocking(Resource*, const FetchRequest&);
197 void moveResourceLoaderToNonBlocking(ResourceLoader*); 186 void moveResourceLoaderToNonBlocking(ResourceLoader*);
198 void removeResourceLoader(ResourceLoader*); 187 void removeResourceLoader(ResourceLoader*);
188 void handleLoadCompletion(Resource*);
199 189
200 void initializeResourceRequest(ResourceRequest&, 190 void initializeResourceRequest(ResourceRequest&,
201 Resource::Type, 191 Resource::Type,
202 FetchRequest::DeferOption); 192 FetchRequest::DeferOption);
203 void willSendRequest(unsigned long identifier,
204 ResourceRequest&,
205 const ResourceResponse&,
206 const ResourceLoaderOptions&);
207 ResourceRequestBlockedReason canAccessResponse(Resource*,
208 const ResourceResponse&) const;
209
210 void requestLoadStarted(unsigned long identifier, 193 void requestLoadStarted(unsigned long identifier,
211 Resource*, 194 Resource*,
212 const FetchRequest&, 195 const FetchRequest&,
213 ResourceLoadStartType, 196 ResourceLoadStartType,
214 bool isStaticData = false); 197 bool isStaticData = false);
215 198
216 bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPolicy); 199 bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPolicy);
217 bool shouldDeferImageLoad(const KURL&) const;
218 200
219 void resourceTimingReportTimerFired(TimerBase*); 201 void resourceTimingReportTimerFired(TimerBase*);
220 202
221 void reloadImagesIfNotDeferred(); 203 void reloadImagesIfNotDeferred();
222 204
223 void updateMemoryCacheStats(Resource*, 205 void updateMemoryCacheStats(Resource*,
224 RevalidationPolicy, 206 RevalidationPolicy,
225 const FetchRequest&, 207 const FetchRequest&,
226 const ResourceFactory&, 208 const ResourceFactory&,
227 bool isStaticData) const; 209 bool isStaticData) const;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 273 }
292 274
293 private: 275 private:
294 Member<ResourceFetcher> m_loader; 276 Member<ResourceFetcher> m_loader;
295 bool m_previousState; 277 bool m_previousState;
296 }; 278 };
297 279
298 } // namespace blink 280 } // namespace blink
299 281
300 #endif // ResourceFetcher_h 282 #endif // ResourceFetcher_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchContext.h ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698