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

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

Issue 1757633005: Don't duplicate ResourceRequests and ResourceLoaderOptions on ResourceLoader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make synchronousPolicy check higher priority in determineRevalidationPolicy Created 4 years, 9 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return false; } 116 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return false; }
117 117
118 const ResourceRequest& resourceRequest() const { return m_resourceRequest; } 118 const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
119 const ResourceRequest& lastResourceRequest() const; 119 const ResourceRequest& lastResourceRequest() const;
120 120
121 void setRevalidatingRequest(const ResourceRequest& request) { m_revalidating Request = request; } 121 void setRevalidatingRequest(const ResourceRequest& request) { m_revalidating Request = request; }
122 122
123 const KURL& url() const { return m_resourceRequest.url();} 123 const KURL& url() const { return m_resourceRequest.url();}
124 Type getType() const { return static_cast<Type>(m_type); } 124 Type getType() const { return static_cast<Type>(m_type); }
125 const ResourceLoaderOptions& options() const { return m_options; } 125 const ResourceLoaderOptions& options() const { return m_options; }
126 ResourceLoaderOptions& mutableOptions() { return m_options; }
126 void setOptions(const ResourceLoaderOptions& options) { m_options = options; } 127 void setOptions(const ResourceLoaderOptions& options) { m_options = options; }
127 128
128 void didChangePriority(ResourceLoadPriority, int intraPriorityValue); 129 void didChangePriority(ResourceLoadPriority, int intraPriorityValue);
129 ResourcePriority priorityFromClients(); 130 ResourcePriority priorityFromClients();
130 131
131 void addClient(ResourceClient*); 132 void addClient(ResourceClient*);
132 void removeClient(ResourceClient*); 133 void removeClient(ResourceClient*);
133 bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingC allback.isEmpty() || !m_finishedClients.isEmpty(); } 134 bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingC allback.isEmpty() || !m_finishedClients.isEmpty(); }
134 135
135 enum PreloadResult { 136 enum PreloadResult {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 178
178 bool isEligibleForIntegrityCheck(SecurityOrigin*) const; 179 bool isEligibleForIntegrityCheck(SecurityOrigin*) const;
179 180
180 void clearLoader(); 181 void clearLoader();
181 182
182 SharedBuffer* resourceBuffer() const { return m_data.get(); } 183 SharedBuffer* resourceBuffer() const { return m_data.get(); }
183 void setResourceBuffer(PassRefPtr<SharedBuffer>); 184 void setResourceBuffer(PassRefPtr<SharedBuffer>);
184 185
185 virtual void willFollowRedirect(ResourceRequest&, const ResourceResponse&); 186 virtual void willFollowRedirect(ResourceRequest&, const ResourceResponse&);
186 187
187 virtual void updateRequest(const ResourceRequest&) { }
188 virtual void responseReceived(const ResourceResponse&, PassOwnPtr<WebDataCon sumerHandle>); 188 virtual void responseReceived(const ResourceResponse&, PassOwnPtr<WebDataCon sumerHandle>);
189 void setResponse(const ResourceResponse& response) { m_response = response; } 189 void setResponse(const ResourceResponse& response) { m_response = response; }
190 const ResourceResponse& response() const { return m_response; } 190 const ResourceResponse& response() const { return m_response; }
191 191
192 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) { } 192 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) { }
193 193
194 // Sets the serialized metadata retrieved from the platform's cache. 194 // Sets the serialized metadata retrieved from the platform's cache.
195 virtual void setSerializedCachedMetadata(const char*, size_t); 195 virtual void setSerializedCachedMetadata(const char*, size_t);
196 196
197 // This may return nullptr when the resource isn't cacheable. 197 // This may return nullptr when the resource isn't cacheable.
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 Resource::Type m_type; 383 Resource::Type m_type;
384 }; 384 };
385 385
386 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 386 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
387 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); \ 387 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); \
388 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R esource>& ptr) { return to##typeName##Resource(ptr.get()); } 388 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R esource>& ptr) { return to##typeName##Resource(ptr.get()); }
389 389
390 } // namespace blink 390 } // namespace blink
391 391
392 #endif 392 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698