Changeset 228909 in webkit
- Timestamp:
- Feb 21, 2018 4:28:20 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r228908 r228909 1 2018-02-21 Youenn Fablet <youenn@apple.com> 2 3 Make SubstituteResource take a ResourceResponse r-value 4 https://bugs.webkit.org/show_bug.cgi?id=183020 5 6 Reviewed by Alex Christensen. 7 8 No change of behavior. 9 Make SubstituteResource take a ResourceResponse r-value. 10 Update ArchiveResource accordingly. 11 Take benefit of that in ApplicationCacheResource to set the response source to ApplicationCache 12 before passing it to SubstituteResource constructor. 13 14 * loader/SubstituteResource.h: 15 (WebCore::SubstituteResource::SubstituteResource): 16 (WebCore::SubstituteResource::resourceResponse): Deleted. 17 * loader/appcache/ApplicationCacheResource.cpp: 18 (WebCore::ApplicationCacheResource::create): 19 (WebCore::ApplicationCacheResource::ApplicationCacheResource): 20 * loader/appcache/ApplicationCacheResource.h: 21 (WebCore::ApplicationCacheResource::create): Deleted. 22 * loader/archive/ArchiveResource.cpp: 23 (WebCore::ArchiveResource::ArchiveResource): 24 1 25 2018-02-21 Zalan Bujtas <zalan@apple.com> 2 26 -
trunk/Source/WebCore/loader/SubstituteResource.h
r228901 r228909 43 43 44 44 protected: 45 SubstituteResource( const URL& url, const ResourceResponse& response, Ref<SharedBuffer>&& data)46 : m_url( url)47 , m_response( response)45 SubstituteResource(URL&& url, ResourceResponse&& response, Ref<SharedBuffer>&& data) 46 : m_url(WTFMove(url)) 47 , m_response(WTFMove(response)) 48 48 , m_data(WTFMove(data)) 49 49 { 50 50 } 51 52 ResourceResponse& resourceResponse() { return m_response; }53 51 54 52 private: -
trunk/Source/WebCore/loader/appcache/ApplicationCacheResource.cpp
r228901 r228909 30 30 namespace WebCore { 31 31 32 ApplicationCacheResource::ApplicationCacheResource(const URL& url, const ResourceResponse& response, unsigned type, Ref<SharedBuffer>&& data, const String& path) 33 : SubstituteResource(url, response, WTFMove(data)) 32 Ref<ApplicationCacheResource> ApplicationCacheResource::create(const URL& url, const ResourceResponse& response, unsigned type, RefPtr<SharedBuffer>&& buffer, const String& path) 33 { 34 ASSERT(!url.hasFragmentIdentifier()); 35 if (!buffer) 36 buffer = SharedBuffer::create(); 37 auto resourceResponse = response; 38 resourceResponse.setSource(ResourceResponse::Source::ApplicationCache); 39 40 return adoptRef(*new ApplicationCacheResource(URL { url }, WTFMove(resourceResponse), type, buffer.releaseNonNull(), path)); 41 } 42 43 ApplicationCacheResource::ApplicationCacheResource(URL&& url, ResourceResponse&& response, unsigned type, Ref<SharedBuffer>&& data, const String& path) 44 : SubstituteResource(WTFMove(url), WTFMove(response), WTFMove(data)) 34 45 , m_type(type) 35 46 , m_storageID(0) … … 37 48 , m_path(path) 38 49 { 39 resourceResponse().setSource(ResourceResponse::Source::ApplicationCache);40 50 } 41 51 -
trunk/Source/WebCore/loader/appcache/ApplicationCacheResource.h
r208646 r228909 39 39 Fallback = 1 << 4 40 40 }; 41 42 static Ref<ApplicationCacheResource> create(const URL& url, const ResourceResponse& response, unsigned type, RefPtr<SharedBuffer> buffer = SharedBuffer::create(), const String& path = String()) 43 { 44 ASSERT(!url.hasFragmentIdentifier()); 45 if (!buffer) 46 buffer = SharedBuffer::create(); 47 return adoptRef(*new ApplicationCacheResource(url, response, type, buffer.releaseNonNull(), path)); 48 } 41 42 static Ref<ApplicationCacheResource> create(const URL&, const ResourceResponse&, unsigned type, RefPtr<SharedBuffer>&& = SharedBuffer::create(), const String& path = String()); 49 43 50 44 unsigned type() const { return m_type; } … … 64 58 65 59 private: 66 ApplicationCacheResource( const URL&, const ResourceResponse&, unsigned type, Ref<SharedBuffer>&&, const String& path);60 ApplicationCacheResource(URL&&, ResourceResponse&&, unsigned type, Ref<SharedBuffer>&&, const String& path); 67 61 68 62 void deliver(ResourceLoader&) override; -
trunk/Source/WebCore/loader/archive/ArchiveResource.cpp
r198177 r228909 35 35 36 36 inline ArchiveResource::ArchiveResource(Ref<SharedBuffer>&& data, const URL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response) 37 : SubstituteResource( url, response, WTFMove(data))37 : SubstituteResource(URL { url }, ResourceResponse { response }, WTFMove(data)) 38 38 , m_mimeType(mimeType) 39 39 , m_textEncoding(textEncoding)
Note: See TracChangeset
for help on using the changeset viewer.