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

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

Issue 2676163002: Refactor the forPreload flag to mean speculative preload. (Closed)
Patch Set: Renamed ReportingPolicy and moved comments Created 3 years, 10 months 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void initializeRevalidation(ResourceRequest&, Resource*); 162 void initializeRevalidation(ResourceRequest&, Resource*);
163 Resource* createResourceForLoading(FetchRequest&, 163 Resource* createResourceForLoading(FetchRequest&,
164 const String& charset, 164 const String& charset,
165 const ResourceFactory&); 165 const ResourceFactory&);
166 void storePerformanceTimingInitiatorInformation(Resource*); 166 void storePerformanceTimingInitiatorInformation(Resource*);
167 ResourceLoadPriority computeLoadPriority( 167 ResourceLoadPriority computeLoadPriority(
168 Resource::Type, 168 Resource::Type,
169 const ResourceRequest&, 169 const ResourceRequest&,
170 ResourcePriority::VisibilityStatus, 170 ResourcePriority::VisibilityStatus,
171 FetchRequest::DeferOption = FetchRequest::NoDefer, 171 FetchRequest::DeferOption = FetchRequest::NoDefer,
172 bool forPreload = false); 172 bool speculativePreload = false);
173 173
174 enum PrepareRequestResult { Abort, Continue, Block }; 174 enum PrepareRequestResult { Abort, Continue, Block };
175 175
176 PrepareRequestResult prepareRequest(FetchRequest&, 176 PrepareRequestResult prepareRequest(FetchRequest&,
177 const ResourceFactory&, 177 const ResourceFactory&,
178 const SubstituteData&, 178 const SubstituteData&,
179 unsigned long identifier, 179 unsigned long identifier,
180 ResourceRequestBlockedReason&); 180 ResourceRequestBlockedReason&);
181 181
182 Resource* resourceForStaticData(const FetchRequest&, 182 Resource* resourceForStaticData(const FetchRequest&,
183 const ResourceFactory&, 183 const ResourceFactory&,
184 const SubstituteData&); 184 const SubstituteData&);
185 Resource* resourceForBlockedRequest(const FetchRequest&, 185 Resource* resourceForBlockedRequest(const FetchRequest&,
186 const ResourceFactory&, 186 const ResourceFactory&,
187 ResourceRequestBlockedReason); 187 ResourceRequestBlockedReason);
188 188
189 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496. 189 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496.
190 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; 190 enum RevalidationPolicy { Use, Revalidate, Reload, Load };
191 RevalidationPolicy determineRevalidationPolicy(Resource::Type, 191 RevalidationPolicy determineRevalidationPolicy(Resource::Type,
192 const FetchRequest&, 192 const FetchRequest&,
193 Resource* existingResource, 193 Resource* existingResource,
194 bool isStaticData) const; 194 bool isStaticData) const;
195 195
196 void moveCachedNonBlockingResourceToBlocking(Resource*, const FetchRequest&); 196 void makePreloadedResourceBlockOnloadIfNeeded(Resource*, const FetchRequest&);
197 void moveResourceLoaderToNonBlocking(ResourceLoader*); 197 void moveResourceLoaderToNonBlocking(ResourceLoader*);
198 void removeResourceLoader(ResourceLoader*); 198 void removeResourceLoader(ResourceLoader*);
199 void handleLoadCompletion(Resource*); 199 void handleLoadCompletion(Resource*);
200 200
201 void initializeResourceRequest(ResourceRequest&, 201 void initializeResourceRequest(ResourceRequest&,
202 Resource::Type, 202 Resource::Type,
203 FetchRequest::DeferOption); 203 FetchRequest::DeferOption);
204 void requestLoadStarted(unsigned long identifier, 204 void requestLoadStarted(unsigned long identifier,
205 Resource*, 205 Resource*,
206 const FetchRequest&, 206 const FetchRequest&,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 285
286 private: 286 private:
287 Member<ResourceFetcher> m_loader; 287 Member<ResourceFetcher> m_loader;
288 bool m_previousState; 288 bool m_previousState;
289 }; 289 };
290 290
291 } // namespace blink 291 } // namespace blink
292 292
293 #endif // ResourceFetcher_h 293 #endif // ResourceFetcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698