mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
43
Libraries/LibCore/CNetworkJob.cpp
Normal file
43
Libraries/LibCore/CNetworkJob.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include <LibCore/CNetworkJob.h>
|
||||
#include <LibCore/CNetworkResponse.h>
|
||||
#include <stdio.h>
|
||||
|
||||
CNetworkJob::CNetworkJob()
|
||||
{
|
||||
}
|
||||
|
||||
CNetworkJob::~CNetworkJob()
|
||||
{
|
||||
}
|
||||
|
||||
void CNetworkJob::did_finish(NonnullRefPtr<CNetworkResponse>&& response)
|
||||
{
|
||||
m_response = move(response);
|
||||
printf("%s{%p} job did_finish!\n", class_name(), this);
|
||||
ASSERT(on_finish);
|
||||
on_finish(true);
|
||||
delete_later();
|
||||
}
|
||||
|
||||
void CNetworkJob::did_fail(Error error)
|
||||
{
|
||||
m_error = error;
|
||||
dbgprintf("%s{%p} job did_fail! error: %u (%s)\n", class_name(), this, (unsigned)error, to_string(error));
|
||||
ASSERT(on_finish);
|
||||
on_finish(false);
|
||||
delete_later();
|
||||
}
|
||||
|
||||
const char* to_string(CNetworkJob::Error error)
|
||||
{
|
||||
switch (error) {
|
||||
case CNetworkJob::Error::ProtocolFailed:
|
||||
return "ProtocolFailed";
|
||||
case CNetworkJob::Error::ConnectionFailed:
|
||||
return "ConnectionFailed";
|
||||
case CNetworkJob::Error::TransmissionFailed:
|
||||
return "TransmissionFailed";
|
||||
default:
|
||||
return "(Unknown error)";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue