#pragma once
#include "WebKit.h"
#include <WebCore/ResourceResponse.h>
class WebURLResponse : public IWebHTTPURLResponse, IWebURLResponsePrivate
{
public:
static WebURLResponse* createInstance();
static WebURLResponse* createInstance(const WebCore::ResourceResponse& response);
protected:
WebURLResponse();
~WebURLResponse();
public:
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
virtual ULONG STDMETHODCALLTYPE AddRef();
virtual ULONG STDMETHODCALLTYPE Release();
virtual HRESULT STDMETHODCALLTYPE expectedContentLength(_Out_ long long*);
virtual HRESULT STDMETHODCALLTYPE initWithURL(_In_ BSTR url, _In_ BSTR mimeType, int expectedContentLength, _In_ BSTR textEncodingName);
virtual HRESULT STDMETHODCALLTYPE MIMEType(__deref_opt_out BSTR* result);
virtual HRESULT STDMETHODCALLTYPE suggestedFilename(__deref_opt_out BSTR* result);
virtual HRESULT STDMETHODCALLTYPE textEncodingName(__deref_opt_out BSTR* result);
virtual HRESULT STDMETHODCALLTYPE URL(__deref_opt_out BSTR* result);
virtual HRESULT STDMETHODCALLTYPE allHeaderFields(_COM_Outptr_opt_ IPropertyBag** headerFields);
virtual HRESULT STDMETHODCALLTYPE localizedStringForStatusCode(int statusCode, __deref_opt_out BSTR* statusString);
virtual HRESULT STDMETHODCALLTYPE statusCode(_Out_ int*);
virtual HRESULT STDMETHODCALLTYPE isAttachment(_Out_ BOOL*);
virtual HRESULT STDMETHODCALLTYPE sslPeerCertificate(_Out_ ULONG_PTR* result);
const WebCore::ResourceResponse& resourceResponse() const;
protected:
HRESULT suggestedFileExtension(BSTR* result);
#if USE(CFURLCONNECTION)
CFDictionaryRef certificateDictionary() const;
#endif
protected:
ULONG m_refCount { 0 };
WebCore::ResourceResponse m_response;
#if USE(CFURLCONNECTION)
mutable RetainPtr<CFDictionaryRef> m_SSLCertificateInfo; #endif
};