summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 00:30:47 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 00:30:47 +0000
commit9dea9e1fea04be579e34c634cb3be1b6654ef506 (patch)
tree6615f05d4b92199300d63cb5f2203ca7345e2cff /chrome/browser/automation
parentd615ad7ae65beddc26c9833b7bfd1d7bdb6f3d7b (diff)
downloadchromium_src-9dea9e1fea04be579e34c634cb3be1b6654ef506.zip
chromium_src-9dea9e1fea04be579e34c634cb3be1b6654ef506.tar.gz
chromium_src-9dea9e1fea04be579e34c634cb3be1b6654ef506.tar.bz2
Change URLRequest to use a ref-counted buffer for actual IO.
This will re-land http://codereview.chromium.org/18390 BUG=5325 Review URL: http://codereview.chromium.org/19004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8847 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/url_request_slow_download_job.cc6
-rw-r--r--chrome/browser/automation/url_request_slow_download_job.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/automation/url_request_slow_download_job.cc b/chrome/browser/automation/url_request_slow_download_job.cc
index e1a2c84f0..71f71ca 100644
--- a/chrome/browser/automation/url_request_slow_download_job.cc
+++ b/chrome/browser/automation/url_request_slow_download_job.cc
@@ -72,7 +72,7 @@ void URLRequestSlowDownloadJob::StartAsync() {
NotifyHeadersComplete();
}
-bool URLRequestSlowDownloadJob::ReadRawData(char* buf, int buf_size,
+bool URLRequestSlowDownloadJob::ReadRawData(net::IOBuffer* buf, int buf_size,
int *bytes_read) {
if (LowerCaseEqualsASCII(kFinishDownloadUrl,
request_->url().spec().c_str())) {
@@ -83,7 +83,7 @@ bool URLRequestSlowDownloadJob::ReadRawData(char* buf, int buf_size,
if (should_send_second_chunk_) {
DCHECK(buf_size > kSecondDownloadSize);
for (int i = 0; i < kSecondDownloadSize; ++i) {
- buf[i] = '*';
+ buf->data()[i] = '*';
}
*bytes_read = kSecondDownloadSize;
should_send_second_chunk_ = false;
@@ -93,7 +93,7 @@ bool URLRequestSlowDownloadJob::ReadRawData(char* buf, int buf_size,
if (first_download_size_remaining_ > 0) {
int send_size = std::min(first_download_size_remaining_, buf_size);
for (int i = 0; i < send_size; ++i) {
- buf[i] = '*';
+ buf->data()[i] = '*';
}
*bytes_read = send_size;
first_download_size_remaining_ -= send_size;
diff --git a/chrome/browser/automation/url_request_slow_download_job.h b/chrome/browser/automation/url_request_slow_download_job.h
index cf0156d..847121e 100644
--- a/chrome/browser/automation/url_request_slow_download_job.h
+++ b/chrome/browser/automation/url_request_slow_download_job.h
@@ -25,7 +25,7 @@ class URLRequestSlowDownloadJob : public URLRequestJob {
virtual void Start();
virtual bool GetMimeType(std::string* mime_type);
virtual void GetResponseInfo(net::HttpResponseInfo* info);
- virtual bool ReadRawData(char* buf, int buf_size, int *bytes_read);
+ virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read);
static URLRequestJob* Factory(URLRequest* request,
const std::string& scheme);