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

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: Rebase Created 4 years, 5 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 enum AccessControlLoggingDecision { 122 enum AccessControlLoggingDecision {
123 ShouldLogAccessControlErrors, 123 ShouldLogAccessControlErrors,
124 ShouldNotLogAccessControlErrors 124 ShouldNotLogAccessControlErrors
125 }; 125 };
126 bool canAccessResource(Resource*, SecurityOrigin*, const KURL&, AccessContro lLoggingDecision) const; 126 bool canAccessResource(Resource*, SecurityOrigin*, const KURL&, AccessContro lLoggingDecision) const;
127 bool isControlledByServiceWorker() const; 127 bool isControlledByServiceWorker() const;
128 128
129 void acceptDataFromThreadedReceiver(unsigned long identifier, const char* da ta, int dataLength, int encodedDataLength); 129 void acceptDataFromThreadedReceiver(unsigned long identifier, const char* da ta, int dataLength, int encodedDataLength);
130 130
131 ResourceLoadPriority loadPriority(Resource::Type, const FetchRequest&, Resou rcePriority::VisibilityStatus = ResourcePriority::NotVisible);
132
133 enum ResourceLoadStartType { 131 enum ResourceLoadStartType {
134 ResourceLoadingFromNetwork, 132 ResourceLoadingFromNetwork,
135 ResourceLoadingFromCache 133 ResourceLoadingFromCache
136 }; 134 };
137 void requestLoadStarted(unsigned long identifier, Resource*, const FetchRequ est&, ResourceLoadStartType, bool isStaticData = false); 135 void requestLoadStarted(unsigned long identifier, Resource*, const FetchRequ est&, ResourceLoadStartType, bool isStaticData = false);
138 static const ResourceLoaderOptions& defaultResourceOptions(); 136 static const ResourceLoaderOptions& defaultResourceOptions();
139 137
140 String getCacheIdentifier() const; 138 String getCacheIdentifier() const;
141 139
142 static void determineRequestContext(ResourceRequest&, Resource::Type, bool i sMainFrame); 140 static void determineRequestContext(ResourceRequest&, Resource::Type, bool i sMainFrame);
143 void determineRequestContext(ResourceRequest&, Resource::Type); 141 void determineRequestContext(ResourceRequest&, Resource::Type);
144 142
145 void updateAllImageResourcePriorities(); 143 void updateAllImageResourcePriorities();
146 144
147 void reloadLoFiImages(); 145 void reloadLoFiImages();
148 146
149 // This is only exposed for testing purposes. 147 // This is only exposed for testing purposes.
150 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); } 148 HeapListHashSet<Member<Resource>>* preloads() { return m_preloads.get(); }
151 149
152 private: 150 private:
153 friend class ResourceCacheValidationSuppressor; 151 friend class ResourceCacheValidationSuppressor;
154 152
155 explicit ResourceFetcher(FetchContext*); 153 explicit ResourceFetcher(FetchContext*);
156 154
157 void initializeRevalidation(ResourceRequest&, Resource*); 155 void initializeRevalidation(ResourceRequest&, Resource*);
158 Resource* createResourceForLoading(FetchRequest&, const String& charset, con st ResourceFactory&); 156 Resource* createResourceForLoading(FetchRequest&, const String& charset, con st ResourceFactory&);
159 void storeResourceTimingInitiatorInformation(Resource*); 157 void storeResourceTimingInitiatorInformation(Resource*);
158 ResourceLoadPriority computeLoadPriority(Resource::Type, const FetchRequest& , ResourcePriority::VisibilityStatus);
160 159
161 Resource* resourceForStaticData(const FetchRequest&, const ResourceFactory&, const SubstituteData&); 160 Resource* resourceForStaticData(const FetchRequest&, const ResourceFactory&, const SubstituteData&);
162 161
163 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496. 162 // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496.
164 enum RevalidationPolicy { Use, Revalidate, Reload, Load }; 163 enum RevalidationPolicy { Use, Revalidate, Reload, Load };
165 RevalidationPolicy determineRevalidationPolicy(Resource::Type, const FetchRe quest&, Resource* existingResource, bool isStaticData) const; 164 RevalidationPolicy determineRevalidationPolicy(Resource::Type, const FetchRe quest&, Resource* existingResource, bool isStaticData) const;
166 165
167 void moveCachedNonBlockingResourceToBlocking(Resource*, const FetchRequest&) ; 166 void moveCachedNonBlockingResourceToBlocking(Resource*, const FetchRequest&) ;
168 void moveResourceLoaderToNonBlocking(ResourceLoader*); 167 void moveResourceLoaderToNonBlocking(ResourceLoader*);
169 void removeResourceLoader(ResourceLoader*); 168 void removeResourceLoader(ResourceLoader*);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 m_loader->m_allowStaleResources = m_previousState; 239 m_loader->m_allowStaleResources = m_previousState;
241 } 240 }
242 private: 241 private:
243 Member<ResourceFetcher> m_loader; 242 Member<ResourceFetcher> m_loader;
244 bool m_previousState; 243 bool m_previousState;
245 }; 244 };
246 245
247 } // namespace blink 246 } // namespace blink
248 247
249 #endif // ResourceFetcher_h 248 #endif // ResourceFetcher_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/RawResource.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