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

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

Issue 2535383003: Collapse images disallowed by the Safe Browsing Subresource Filter. (Closed)
Patch Set: Initial draft. 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void logPreloadStats(ClearPreloadsPolicy); 110 void logPreloadStats(ClearPreloadsPolicy);
111 void warnUnusedPreloads(); 111 void warnUnusedPreloads();
112 112
113 MHTMLArchive* archive() const { return m_archive.get(); } 113 MHTMLArchive* archive() const { return m_archive.get(); }
114 ArchiveResource* createArchive(Resource*); 114 ArchiveResource* createArchive(Resource*);
115 115
116 void setDefersLoading(bool); 116 void setDefersLoading(bool);
117 void stopFetching(); 117 void stopFetching();
118 bool isFetching() const; 118 bool isFetching() const;
119 119
120 bool willFollowRedirect(Resource*, ResourceRequest&, const ResourceResponse&); 120 ResourceRequestBlockedReason willFollowRedirect(Resource*,
121 ResourceRequest&,
122 const ResourceResponse&);
121 enum DidFinishLoadingReason { 123 enum DidFinishLoadingReason {
122 DidFinishLoading, 124 DidFinishLoading,
123 DidFinishFirstPartInMultipart 125 DidFinishFirstPartInMultipart
124 }; 126 };
125 void didFinishLoading(Resource*, 127 void didFinishLoading(Resource*,
126 double finishTime, 128 double finishTime,
127 DidFinishLoadingReason); 129 DidFinishLoadingReason);
128 void didFailLoading(Resource*, const ResourceError&); 130 void didFailLoading(Resource*, const ResourceError&);
129 void didReceiveResponse(Resource*, 131 void didReceiveResponse(Resource*,
130 const ResourceResponse&, 132 const ResourceResponse&,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 const ResourceFactory&); 180 const ResourceFactory&);
179 void storeResourceTimingInitiatorInformation(Resource*); 181 void storeResourceTimingInitiatorInformation(Resource*);
180 ResourceLoadPriority computeLoadPriority(Resource::Type, 182 ResourceLoadPriority computeLoadPriority(Resource::Type,
181 const FetchRequest&, 183 const FetchRequest&,
182 ResourcePriority::VisibilityStatus); 184 ResourcePriority::VisibilityStatus);
183 185
184 Resource* resourceForStaticData(const FetchRequest&, 186 Resource* resourceForStaticData(const FetchRequest&,
185 const ResourceFactory&, 187 const ResourceFactory&,
186 const SubstituteData&); 188 const SubstituteData&);
187 Resource* resourceForBlockedRequest(const FetchRequest&, 189 Resource* resourceForBlockedRequest(const FetchRequest&,
188 const ResourceFactory&); 190 const ResourceFactory&,
191 ResourceRequestBlockedReason);
189 192
190 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496. 193 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496.
191 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; 194 enum RevalidationPolicy { Use, Revalidate, Reload, Load };
192 RevalidationPolicy determineRevalidationPolicy(Resource::Type, 195 RevalidationPolicy determineRevalidationPolicy(Resource::Type,
193 const FetchRequest&, 196 const FetchRequest&,
194 Resource* existingResource, 197 Resource* existingResource,
195 bool isStaticData) const; 198 bool isStaticData) const;
196 199
197 void moveCachedNonBlockingResourceToBlocking(Resource*, const FetchRequest&); 200 void moveCachedNonBlockingResourceToBlocking(Resource*, const FetchRequest&);
198 void moveResourceLoaderToNonBlocking(ResourceLoader*); 201 void moveResourceLoaderToNonBlocking(ResourceLoader*);
199 void removeResourceLoader(ResourceLoader*); 202 void removeResourceLoader(ResourceLoader*);
200 203
201 void initializeResourceRequest(ResourceRequest&, 204 void initializeResourceRequest(ResourceRequest&,
202 Resource::Type, 205 Resource::Type,
203 FetchRequest::DeferOption); 206 FetchRequest::DeferOption);
204 void willSendRequest(unsigned long identifier, 207 void willSendRequest(unsigned long identifier,
205 ResourceRequest&, 208 ResourceRequest&,
206 const ResourceResponse&, 209 const ResourceResponse&,
207 const ResourceLoaderOptions&); 210 const ResourceLoaderOptions&);
208 bool canAccessResponse(Resource*, const ResourceResponse&) const; 211 ResourceRequestBlockedReason canAccessResponse(Resource*,
212 const ResourceResponse&) const;
209 213
210 bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPolicy); 214 bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPolicy);
211 bool shouldDeferImageLoad(const KURL&) const; 215 bool shouldDeferImageLoad(const KURL&) const;
212 216
213 void resourceTimingReportTimerFired(TimerBase*); 217 void resourceTimingReportTimerFired(TimerBase*);
214 218
215 void reloadImagesIfNotDeferred(); 219 void reloadImagesIfNotDeferred();
216 220
217 void updateMemoryCacheStats(Resource*, 221 void updateMemoryCacheStats(Resource*,
218 RevalidationPolicy, 222 RevalidationPolicy,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 287 }
284 288
285 private: 289 private:
286 Member<ResourceFetcher> m_loader; 290 Member<ResourceFetcher> m_loader;
287 bool m_previousState; 291 bool m_previousState;
288 }; 292 };
289 293
290 } // namespace blink 294 } // namespace blink
291 295
292 #endif // ResourceFetcher_h 296 #endif // ResourceFetcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698