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

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

Issue 2072613002: Make ResourceLoadPriority calculation simpler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop a default arg Created 4 years, 6 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 rights reserved. 4 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 enum AccessControlLoggingDecision { 121 enum AccessControlLoggingDecision {
122 ShouldLogAccessControlErrors, 122 ShouldLogAccessControlErrors,
123 ShouldNotLogAccessControlErrors 123 ShouldNotLogAccessControlErrors
124 }; 124 };
125 bool canAccessResource(Resource*, SecurityOrigin*, const KURL&, AccessContro lLoggingDecision) const; 125 bool canAccessResource(Resource*, SecurityOrigin*, const KURL&, AccessContro lLoggingDecision) const;
126 bool isControlledByServiceWorker() const; 126 bool isControlledByServiceWorker() const;
127 127
128 void acceptDataFromThreadedReceiver(unsigned long identifier, const char* da ta, int dataLength, int encodedDataLength); 128 void acceptDataFromThreadedReceiver(unsigned long identifier, const char* da ta, int dataLength, int encodedDataLength);
129 129
130 ResourceLoadPriority loadPriority(Resource::Type, const FetchRequest&, Resou rcePriority::VisibilityStatus = ResourcePriority::NotVisible);
131
132 enum ResourceLoadStartType { 130 enum ResourceLoadStartType {
133 ResourceLoadingFromNetwork, 131 ResourceLoadingFromNetwork,
134 ResourceLoadingFromCache 132 ResourceLoadingFromCache
135 }; 133 };
136 void requestLoadStarted(unsigned long identifier, Resource*, const FetchRequ est&, ResourceLoadStartType, bool isStaticData = false); 134 void requestLoadStarted(unsigned long identifier, Resource*, const FetchRequ est&, ResourceLoadStartType, bool isStaticData = false);
137 static const ResourceLoaderOptions& defaultResourceOptions(); 135 static const ResourceLoaderOptions& defaultResourceOptions();
138 136
139 String getCacheIdentifier() const; 137 String getCacheIdentifier() const;
140 138
141 static void determineRequestContext(ResourceRequest&, Resource::Type, bool i sMainFrame); 139 static void determineRequestContext(ResourceRequest&, Resource::Type, bool i sMainFrame);
142 void determineRequestContext(ResourceRequest&, Resource::Type); 140 void determineRequestContext(ResourceRequest&, Resource::Type);
143 141
144 void updateAllImageResourcePriorities(); 142 void updateAllImageResourcePriorities();
145 143
146 void reloadLoFiImages(); 144 void reloadLoFiImages();
147 145
148 // This is only exposed for testing purposes. 146 // This is only exposed for testing purposes.
149 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); } 147 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); }
150 148
151 private: 149 private:
152 friend class ResourceCacheValidationSuppressor; 150 friend class ResourceCacheValidationSuppressor;
153 151
154 explicit ResourceFetcher(FetchContext*); 152 explicit ResourceFetcher(FetchContext*);
155 153
156 void initializeRevalidation(ResourceRequest&, Resource*); 154 void initializeRevalidation(ResourceRequest&, Resource*);
157 Resource* createResourceForLoading(FetchRequest&, const String& charset, con st ResourceFactory&); 155 Resource* createResourceForLoading(FetchRequest&, const String& charset, con st ResourceFactory&);
158 void storeResourceTimingInitiatorInformation(Resource*); 156 void storeResourceTimingInitiatorInformation(Resource*);
157 ResourceLoadPriority loadPriority(Resource::Type, const FetchRequest&, Resou rcePriority::VisibilityStatus);
kinuko 2016/06/17 05:40:47 nit: while you're here can we rename this to compu
Nate Chapin 2016/06/17 18:38:16 load is a noun here, I think. The name reads like
159 158
160 Resource* resourceForStaticData(const FetchRequest&, const ResourceFactory&, const SubstituteData&); 159 Resource* resourceForStaticData(const FetchRequest&, const ResourceFactory&, const SubstituteData&);
161 160
162 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496. 161 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496.
163 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; 162 enum RevalidationPolicy { Use, Revalidate, Reload, Load };
164 RevalidationPolicy determineRevalidationPolicy(Resource::Type, const FetchRe quest&, Resource* existingResource, bool isStaticData) const; 163 RevalidationPolicy determineRevalidationPolicy(Resource::Type, const FetchRe quest&, Resource* existingResource, bool isStaticData) const;
165 164
166 void moveCachedNonBlockingResourceToBlocking(Resource*, const FetchRequest&) ; 165 void moveCachedNonBlockingResourceToBlocking(Resource*, const FetchRequest&) ;
167 void moveResourceLoaderToNonBlocking(ResourceLoader*); 166 void moveResourceLoaderToNonBlocking(ResourceLoader*);
168 void removeResourceLoader(ResourceLoader*); 167 void removeResourceLoader(ResourceLoader*);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 m_loader->m_allowStaleResources = m_previousState; 238 m_loader->m_allowStaleResources = m_previousState;
240 } 239 }
241 private: 240 private:
242 Member<ResourceFetcher> m_loader; 241 Member<ResourceFetcher> m_loader;
243 bool m_previousState; 242 bool m_previousState;
244 }; 243 };
245 244
246 } // namespace blink 245 } // namespace blink
247 246
248 #endif // ResourceFetcher_h 247 #endif // ResourceFetcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698