| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/url_request/url_request_simple_job.h" | 5 #include "net/url_request/url_request_simple_job.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/url_request/url_request_status.h" | 10 #include "net/url_request/url_request_status.h" |
| 11 | 11 |
| 12 URLRequestSimpleJob::URLRequestSimpleJob(URLRequest* request) | 12 URLRequestSimpleJob::URLRequestSimpleJob(net::URLRequest* request) |
| 13 : URLRequestJob(request), | 13 : URLRequestJob(request), |
| 14 data_offset_(0) { | 14 data_offset_(0) { |
| 15 } | 15 } |
| 16 | 16 |
| 17 void URLRequestSimpleJob::Start() { | 17 void URLRequestSimpleJob::Start() { |
| 18 // Start reading asynchronously so that all error reporting and data | 18 // Start reading asynchronously so that all error reporting and data |
| 19 // callbacks happen as they would for network requests. | 19 // callbacks happen as they would for network requests. |
| 20 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 20 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
| 21 this, &URLRequestSimpleJob::StartAsync)); | 21 this, &URLRequestSimpleJob::StartAsync)); |
| 22 } | 22 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 49 | 49 |
| 50 if (GetData(&mime_type_, &charset_, &data_)) { | 50 if (GetData(&mime_type_, &charset_, &data_)) { |
| 51 // Notify that the headers are complete | 51 // Notify that the headers are complete |
| 52 NotifyHeadersComplete(); | 52 NotifyHeadersComplete(); |
| 53 } else { | 53 } else { |
| 54 // what should the error code be? | 54 // what should the error code be? |
| 55 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, | 55 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, |
| 56 net::ERR_INVALID_URL)); | 56 net::ERR_INVALID_URL)); |
| 57 } | 57 } |
| 58 } | 58 } |
| OLD | NEW |