Make BUrlProtocolAsynchronousListener inherit BUrlProtocolListener
* With so long class names, there's no way I'm going to follow the 64 char limit on commit headlines. * The class share the same API, so having them separate is not very useful. * This makes it possible to use the same listener in either synchronous or asycnhronous mode (or both, for different requests)
This commit is contained in:
parent
8035a8406c
commit
f6f14c5d1c
@ -11,26 +11,13 @@
|
||||
#include <UrlProtocolDispatchingListener.h>
|
||||
|
||||
|
||||
class BUrlProtocolAsynchronousListener : public BHandler {
|
||||
class BUrlProtocolAsynchronousListener : public BHandler,
|
||||
public BUrlProtocolListener {
|
||||
public:
|
||||
BUrlProtocolAsynchronousListener(
|
||||
bool transparent = false);
|
||||
virtual ~BUrlProtocolAsynchronousListener();
|
||||
|
||||
virtual void ConnectionOpened(BUrlRequest* caller);
|
||||
virtual void HostnameResolved(BUrlRequest* caller,
|
||||
const char* ip);
|
||||
virtual void ResponseStarted(BUrlRequest* caller);
|
||||
virtual void HeadersReceived(BUrlRequest* caller);
|
||||
virtual void DataReceived(BUrlRequest* caller,
|
||||
const char* data, ssize_t size);
|
||||
virtual void DownloadProgress(BUrlRequest* caller,
|
||||
ssize_t bytesReceived, ssize_t bytesTotal);
|
||||
virtual void UploadProgress(BUrlRequest* caller,
|
||||
ssize_t bytesSent, ssize_t bytesTotal);
|
||||
virtual void RequestCompleted(BUrlRequest* caller,
|
||||
bool success);
|
||||
|
||||
// Synchronous listener access
|
||||
BUrlProtocolListener* SynchronousListener();
|
||||
|
||||
|
@ -20,6 +20,7 @@ BUrlProtocolAsynchronousListener::BUrlProtocolAsynchronousListener(
|
||||
bool transparent)
|
||||
:
|
||||
BHandler("UrlProtocolAsynchronousListener"),
|
||||
BUrlProtocolListener(),
|
||||
fSynchronousListener(NULL)
|
||||
{
|
||||
if (be_app->Lock()) {
|
||||
@ -45,57 +46,6 @@ BUrlProtocolAsynchronousListener::~BUrlProtocolAsynchronousListener()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BUrlProtocolAsynchronousListener::ConnectionOpened(BUrlRequest*)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BUrlProtocolAsynchronousListener::HostnameResolved(BUrlRequest*, const char*)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BUrlProtocolAsynchronousListener::ResponseStarted(BUrlRequest*)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BUrlProtocolAsynchronousListener::HeadersReceived(BUrlRequest*)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BUrlProtocolAsynchronousListener::DataReceived(BUrlRequest*, const char*,
|
||||
ssize_t)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BUrlProtocolAsynchronousListener::DownloadProgress(BUrlRequest*, ssize_t,
|
||||
ssize_t)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BUrlProtocolAsynchronousListener::UploadProgress(BUrlRequest*, ssize_t,
|
||||
ssize_t)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BUrlProtocolAsynchronousListener::RequestCompleted(BUrlRequest*, bool)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark Synchronous listener access
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user