2019-04-10 23:28:10 +03:00
|
|
|
#include <LibCore/CNetworkJob.h>
|
|
|
|
#include <LibCore/CNetworkResponse.h>
|
2019-04-07 15:36:10 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2019-04-10 23:28:10 +03:00
|
|
|
CNetworkJob::CNetworkJob()
|
2019-04-07 15:36:10 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-04-10 23:28:10 +03:00
|
|
|
CNetworkJob::~CNetworkJob()
|
2019-04-07 15:36:10 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-06-21 19:37:47 +03:00
|
|
|
void CNetworkJob::did_finish(NonnullRefPtr<CNetworkResponse>&& response)
|
2019-04-07 15:36:10 +03:00
|
|
|
{
|
|
|
|
m_response = move(response);
|
|
|
|
printf("%s{%p} job did_finish!\n", class_name(), this);
|
|
|
|
ASSERT(on_finish);
|
|
|
|
on_finish(true);
|
|
|
|
}
|
|
|
|
|
2019-04-10 23:28:10 +03:00
|
|
|
void CNetworkJob::did_fail(Error error)
|
2019-04-07 15:36:10 +03:00
|
|
|
{
|
|
|
|
m_error = error;
|
2019-04-07 20:35:07 +03:00
|
|
|
dbgprintf("%s{%p} job did_fail! error=%u\n", class_name(), this, (unsigned)error);
|
2019-04-07 15:36:10 +03:00
|
|
|
ASSERT(on_finish);
|
|
|
|
on_finish(false);
|
|
|
|
}
|