ResourceHandleCFURLConnectionDelegateWithOperationQueue.h [plain text]
#pragma once
#if USE(CFURLCONNECTION)
#include "ResourceHandleCFURLConnectionDelegate.h"
#include <CFNetwork/CFNetwork.h>
#include <dispatch/queue.h>
#include <dispatch/semaphore.h>
namespace WebCore {
class ResourceHandleCFURLConnectionDelegateWithOperationQueue final : public ResourceHandleCFURLConnectionDelegate {
public:
ResourceHandleCFURLConnectionDelegateWithOperationQueue(ResourceHandle*);
virtual ~ResourceHandleCFURLConnectionDelegateWithOperationQueue();
private:
bool hasHandle() const;
void setupRequest(CFMutableURLRequestRef) override;
void setupConnectionScheduling(CFURLConnectionRef) override;
void releaseHandle() override;
CFURLRequestRef willSendRequest(CFURLRequestRef, CFURLResponseRef) override;
void didReceiveResponse(CFURLConnectionRef, CFURLResponseRef) override;
void didReceiveData(CFDataRef, CFIndex originalLength) override;
void didFinishLoading() override;
void didFail(CFErrorRef) override;
CFCachedURLResponseRef willCacheResponse(CFCachedURLResponseRef) override;
void didReceiveChallenge(CFURLAuthChallengeRef) override;
void didSendBodyData(CFIndex totalBytesWritten, CFIndex totalBytesExpectedToWrite) override;
Boolean shouldUseCredentialStorage() override;
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
Boolean canRespondToProtectionSpace(CFURLProtectionSpaceRef) override;
#endif // USE(PROTECTION_SPACE_AUTH_CALLBACK)
#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
void didReceiveDataArray(CFArrayRef dataArray) override;
#endif // USE(NETWORK_CFDATA_ARRAY_CALLBACK)
void continueWillSendRequest(CFURLRequestRef) override;
void continueDidReceiveResponse() override;
void continueWillCacheResponse(CFCachedURLResponseRef) override;
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
void continueCanAuthenticateAgainstProtectionSpace(bool) override;
#endif // USE(PROTECTION_SPACE_AUTH_CALLBACK)
dispatch_queue_t m_queue;
dispatch_semaphore_t m_semaphore;
RetainPtr<CFURLRequestRef> m_requestResult;
RetainPtr<CFCachedURLResponseRef> m_cachedResponseResult;
bool m_boolResult;
};
}
#endif // USE(CFURLCONNECTION)