This source file includes following definitions.
- OnDestruct
#include "net/url_request/url_request_context_getter.h"
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "net/url_request/url_request_context.h"
namespace net {
URLRequestContextGetter::URLRequestContextGetter() {}
URLRequestContextGetter::~URLRequestContextGetter() {}
void URLRequestContextGetter::OnDestruct() const {
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner =
GetNetworkTaskRunner();
DCHECK(network_task_runner.get());
if (network_task_runner.get()) {
if (network_task_runner->BelongsToCurrentThread()) {
delete this;
} else {
if (!network_task_runner->DeleteSoon(FROM_HERE, this)) {
DLOG(WARNING) << "URLRequestContextGetter leaking due to no owning"
<< " thread.";
}
}
}
}
}