| Index: net/url_request/url_request_simple_job.cc
|
| diff --git a/net/url_request/url_request_simple_job.cc b/net/url_request/url_request_simple_job.cc
|
| index f266e3b505d05ea37b7e237ce91e8dbc472c0937..cda324cfb514537d320f80c71a0abdc0ab9518e4 100644
|
| --- a/net/url_request/url_request_simple_job.cc
|
| +++ b/net/url_request/url_request_simple_job.cc
|
| @@ -17,11 +17,12 @@
|
|
|
| namespace net {
|
|
|
| -URLRequestSimpleJob::URLRequestSimpleJob(
|
| - URLRequest* request, NetworkDelegate* network_delegate)
|
| +URLRequestSimpleJob::URLRequestSimpleJob(URLRequest* request,
|
| + NetworkDelegate* network_delegate)
|
| : URLRangeRequestJob(request, network_delegate),
|
| data_offset_(0),
|
| - weak_factory_(this) {}
|
| + weak_factory_(this) {
|
| +}
|
|
|
| void URLRequestSimpleJob::Start() {
|
| // Start reading asynchronously so that all error reporting and data
|
| @@ -41,9 +42,11 @@ bool URLRequestSimpleJob::GetCharset(std::string* charset) {
|
| return true;
|
| }
|
|
|
| -URLRequestSimpleJob::~URLRequestSimpleJob() {}
|
| +URLRequestSimpleJob::~URLRequestSimpleJob() {
|
| +}
|
|
|
| -bool URLRequestSimpleJob::ReadRawData(IOBuffer* buf, int buf_size,
|
| +bool URLRequestSimpleJob::ReadRawData(IOBuffer* buf,
|
| + int buf_size,
|
| int* bytes_read) {
|
| DCHECK(bytes_read);
|
| int remaining = byte_range_.last_byte_position() - data_offset_ + 1;
|
| @@ -68,7 +71,9 @@ void URLRequestSimpleJob::StartAsync() {
|
| if (!ranges().empty() && range_parse_result() == OK)
|
| byte_range_ = ranges().front();
|
|
|
| - int result = GetData(&mime_type_, &charset_, &data_,
|
| + int result = GetData(&mime_type_,
|
| + &charset_,
|
| + &data_,
|
| base::Bind(&URLRequestSimpleJob::OnGetDataCompleted,
|
| weak_factory_.GetWeakPtr()));
|
| if (result != ERR_IO_PENDING)
|
| @@ -80,13 +85,13 @@ void URLRequestSimpleJob::OnGetDataCompleted(int result) {
|
| // Notify that the headers are complete
|
| if (!byte_range_.ComputeBounds(data_.size())) {
|
| NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
|
| - ERR_REQUEST_RANGE_NOT_SATISFIABLE));
|
| + ERR_REQUEST_RANGE_NOT_SATISFIABLE));
|
| return;
|
| }
|
|
|
| data_offset_ = byte_range_.first_byte_position();
|
| int remaining_bytes = byte_range_.last_byte_position() -
|
| - byte_range_.first_byte_position() + 1;
|
| + byte_range_.first_byte_position() + 1;
|
| set_expected_content_size(remaining_bytes);
|
| NotifyHeadersComplete();
|
| } else {
|
|
|