Changeset 31916 in webkit
- Timestamp:
- Apr 15, 2008 12:44:40 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31915 r31916 1 2008-04-15 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Adam. 4 5 Move the URL, response and data to SubstituteResource. 6 7 * loader/SubstituteResource.h: 8 (WebCore::SubstituteResource::url): 9 (WebCore::SubstituteResource::response): 10 (WebCore::SubstituteResource::data): 11 (WebCore::SubstituteResource::SubstituteResource): 12 * loader/archive/ArchiveResource.cpp: 13 (WebCore::ArchiveResource::ArchiveResource): 14 * loader/archive/ArchiveResource.h: 15 (WebCore::ArchiveResource::frameName): 16 1 17 2008-04-15 David Hyatt <hyatt@apple.com> 2 18 -
trunk/WebCore/loader/SubstituteResource.h
r31914 r31916 29 29 #include <wtf/RefCounted.h> 30 30 31 #include "KURL.h" 32 #include "ResourceResponse.h" 33 #include "SharedBuffer.h" 34 35 #include <wtf/RefPtr.h> 36 31 37 namespace WebCore { 32 38 33 39 class SubstituteResource : public RefCounted<SubstituteResource> { 40 public: 41 const KURL& url() const { return m_url; } 42 const ResourceResponse& response() const { return m_response; } 43 SharedBuffer* data() const { return m_data.get(); } 44 45 protected: 46 SubstituteResource(const KURL& url, const ResourceResponse& response, PassRefPtr<SharedBuffer> data) 47 : m_url(url) 48 , m_response(response) 49 , m_data(data) 50 { 51 } 52 53 private: 54 KURL m_url; 55 ResourceResponse m_response; 56 RefPtr<SharedBuffer> m_data; 34 57 }; 35 58 -
trunk/WebCore/loader/archive/ArchiveResource.cpp
r31826 r31916 50 50 51 51 ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response) 52 : m_data(data) 53 , m_url(url) 52 : SubstituteResource(url, response, data) 54 53 , m_mimeType(response.mimeType()) 55 54 , m_textEncoding(response.textEncodingName()) 56 , m_response(response)57 55 , m_shouldIgnoreWhenUnarchiving(false) 58 56 { … … 60 58 61 59 ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName) 62 : m_data(data) 63 , m_url(url) 60 : SubstituteResource(url, ResourceResponse(url, mimeType, data ? data->size() : 0, textEncoding, String()), data) 64 61 , m_mimeType(mimeType) 65 62 , m_textEncoding(textEncoding) 66 63 , m_frameName(frameName) 67 , m_response(ResourceResponse(m_url, m_mimeType, m_data ? m_data->size() : 0, m_textEncoding, String()))68 64 , m_shouldIgnoreWhenUnarchiving(false) 69 65 { … … 71 67 72 68 ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response) 73 : m_data(data) 74 , m_url(url) 69 : SubstituteResource(url, response.isNull() ? ResourceResponse(url, mimeType, data ? data->size() : 0, textEncoding, String()) : response, data) 75 70 , m_mimeType(mimeType) 76 71 , m_textEncoding(textEncoding) 77 72 , m_frameName(frameName) 78 , m_response(response.isNull() ? ResourceResponse(m_url, m_mimeType, m_data ? m_data->size() : 0, m_textEncoding, String()) : response)79 73 , m_shouldIgnoreWhenUnarchiving(false) 80 74 { -
trunk/WebCore/loader/archive/ArchiveResource.h
r31914 r31916 32 32 #include "SubstituteResource.h" 33 33 34 #include "KURL.h"35 34 #include "PlatformString.h" 36 #include "ResourceResponse.h"37 #include "SharedBuffer.h"38 35 39 36 namespace WebCore { … … 45 42 static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&); 46 43 47 SharedBuffer* data() { return m_data.get(); }48 49 const KURL& url() const { return m_url; }50 44 const String& mimeType() const { return m_mimeType; } 51 45 const String& textEncoding() const { return m_textEncoding; } 52 46 const String& frameName() const { return m_frameName; } 53 const ResourceResponse& response() const { return m_response; }54 47 55 48 void ignoreWhenUnarchiving() { m_shouldIgnoreWhenUnarchiving = true; } … … 61 54 ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&); 62 55 63 RefPtr<SharedBuffer> m_data;64 KURL m_url;65 56 String m_mimeType; 66 57 String m_textEncoding; 67 58 String m_frameName; 68 69 ResourceResponse m_response;70 59 71 60 bool m_shouldIgnoreWhenUnarchiving;
Note: See TracChangeset
for help on using the changeset viewer.