Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5283)

Unified Diff: chrome/browser/automation/url_request_slow_download_job.cc

Issue 18390: Change URLRequest to use a ref-counted buffer for actual IO.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/automation/url_request_slow_download_job.h ('k') | chrome/browser/chrome_plugin_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/url_request_slow_download_job.cc
===================================================================
--- chrome/browser/automation/url_request_slow_download_job.cc (revision 8565)
+++ chrome/browser/automation/url_request_slow_download_job.cc (working copy)
@@ -72,7 +72,7 @@
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 @@
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 @@
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;
« no previous file with comments | « chrome/browser/automation/url_request_slow_download_job.h ('k') | chrome/browser/chrome_plugin_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698