summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-24 02:39:54 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-24 02:39:54 +0000
commite993abfe81feaa374d476828a44942d296bdcc78 (patch)
tree201fffef0ba93ce41afaf2bd6e61e05b61c04028 /chrome/browser/net
parent0afe80d755b899c188313629ea3f45f0fe5be981 (diff)
downloadchromium_src-e993abfe81feaa374d476828a44942d296bdcc78.zip
chromium_src-e993abfe81feaa374d476828a44942d296bdcc78.tar.gz
chromium_src-e993abfe81feaa374d476828a44942d296bdcc78.tar.bz2
revert r8603
Review URL: http://codereview.chromium.org/18576 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/url_fetcher.cc10
-rw-r--r--chrome/browser/net/url_fetcher.h3
2 files changed, 4 insertions, 9 deletions
diff --git a/chrome/browser/net/url_fetcher.cc b/chrome/browser/net/url_fetcher.cc
index 9e41f22..b7ea8cd 100644
--- a/chrome/browser/net/url_fetcher.cc
+++ b/chrome/browser/net/url_fetcher.cc
@@ -11,9 +11,6 @@
#include "chrome/browser/chrome_thread.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
-#include "net/base/io_buffer.h"
-
-static const int kBufferSize = 4096;
URLFetcher::URLFetcher(const GURL& url,
RequestType request_type,
@@ -39,7 +36,6 @@ URLFetcher::Core::Core(URLFetcher* fetcher,
request_(NULL),
load_flags_(net::LOAD_NORMAL),
response_code_(-1),
- buffer_(new net::IOBuffer(kBufferSize)),
protect_entry_(URLFetcherProtectManager::GetInstance()->Register(
original_url_.host())),
num_retries_(0) {
@@ -75,7 +71,7 @@ void URLFetcher::Core::OnResponseStarted(URLRequest* request) {
// completed immediately, without trying to read any data back (all we care
// about is the response code and headers, which we already have).
if (request_->status().is_success() && (request_type_ != HEAD))
- request_->Read(buffer_, kBufferSize, &bytes_read);
+ request_->Read(buffer_, sizeof(buffer_), &bytes_read);
OnReadCompleted(request_, bytes_read);
}
@@ -88,8 +84,8 @@ void URLFetcher::Core::OnReadCompleted(URLRequest* request, int bytes_read) {
do {
if (!request_->status().is_success() || bytes_read <= 0)
break;
- data_.append(buffer_->data(), bytes_read);
- } while (request_->Read(buffer_, kBufferSize, &bytes_read));
+ data_.append(buffer_, bytes_read);
+ } while (request_->Read(buffer_, sizeof(buffer_), &bytes_read));
if (request_->status().is_success())
request_->GetResponseCookies(&cookies_);
diff --git a/chrome/browser/net/url_fetcher.h b/chrome/browser/net/url_fetcher.h
index 044e61b..7e4c132 100644
--- a/chrome/browser/net/url_fetcher.h
+++ b/chrome/browser/net/url_fetcher.h
@@ -185,8 +185,7 @@ class URLFetcher {
int load_flags_; // Flags for the load operation
int response_code_; // HTTP status code for the request
std::string data_; // Results of the request
- scoped_refptr<net::IOBuffer> buffer_;
- // Read buffer
+ char buffer_[4096]; // Read buffer
scoped_refptr<URLRequestContext> request_context_;
// Cookie/cache info for the request
ResponseCookies cookies_; // Response cookies