This source file includes following definitions.
- GetData
#include "net/url_request/url_request_data_job.h"
#include "net/base/data_url.h"
#include "net/base/net_errors.h"
namespace net {
URLRequestDataJob::URLRequestDataJob(
URLRequest* request, NetworkDelegate* network_delegate)
: URLRequestSimpleJob(request, network_delegate) {
}
int URLRequestDataJob::GetData(std::string* mime_type,
std::string* charset,
std::string* data,
const CompletionCallback& callback) const {
const GURL& url = request_->url();
if (!url.is_valid())
return ERR_INVALID_URL;
return DataURL::Parse(url, mime_type, charset, data)? OK: ERR_INVALID_URL;
}
URLRequestDataJob::~URLRequestDataJob() {
}
}