diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/loader/SubstituteResource.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/loader/SubstituteResource.h')
-rw-r--r-- | Source/WebCore/loader/SubstituteResource.h | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/Source/WebCore/loader/SubstituteResource.h b/Source/WebCore/loader/SubstituteResource.h index 98c87a235..0e8dd35e2 100644 --- a/Source/WebCore/loader/SubstituteResource.h +++ b/Source/WebCore/loader/SubstituteResource.h @@ -23,17 +23,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SubstituteResource_h -#define SubstituteResource_h +#pragma once -#include <wtf/RefCounted.h> - -#include "URL.h" +#include "ResourceLoader.h" #include "ResourceResponse.h" #include "SharedBuffer.h" -#include <wtf/RefPtr.h> - namespace WebCore { class SubstituteResource : public RefCounted<SubstituteResource> { @@ -42,23 +37,22 @@ public: const URL& url() const { return m_url; } const ResourceResponse& response() const { return m_response; } - SharedBuffer* data() const { return m_data.get(); } + SharedBuffer& data() const { return static_reference_cast<SharedBuffer>(m_data); } + + virtual void deliver(ResourceLoader& loader) { loader.deliverResponseAndData(m_response, m_data->copy()); } protected: - SubstituteResource(const URL& url, const ResourceResponse& response, PassRefPtr<SharedBuffer> data) + SubstituteResource(const URL& url, const ResourceResponse& response, Ref<SharedBuffer>&& data) : m_url(url) , m_response(response) - , m_data(data) + , m_data(WTFMove(data)) { - ASSERT(m_data); } - + private: URL m_url; ResourceResponse m_response; - RefPtr<SharedBuffer> m_data; + Ref<SharedBuffer> m_data; }; - -} -#endif // SubstituteResource_h +} // namespace WebCore |