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

Unified Diff: net/proxy/proxy_script_fetcher.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 | « net/net_lib.scons ('k') | net/url_request/mime_sniffer_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_script_fetcher.cc
===================================================================
--- net/proxy/proxy_script_fetcher.cc (revision 8565)
+++ net/proxy/proxy_script_fetcher.cc (working copy)
@@ -6,7 +6,9 @@
#include "base/compiler_specific.h"
#include "base/message_loop.h"
+#include "base/ref_counted.h"
#include "base/string_util.h"
+#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request.h"
@@ -77,7 +79,7 @@
// Buffer that URLRequest writes into.
enum { kBufSize = 4096 };
- char buf_[kBufSize];
+ scoped_refptr<net::IOBuffer> buf_;
// The next ID to use for |cur_request_| (monotonically increasing).
int next_id_;
@@ -105,6 +107,7 @@
URLRequestContext* url_request_context)
: ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)),
url_request_context_(url_request_context),
+ buf_(new net::IOBuffer(kBufSize)),
next_id_(0),
cur_request_(NULL),
cur_request_id_(0),
@@ -217,7 +220,7 @@
request->Cancel();
return;
}
- result_bytes_->append(buf_, num_bytes);
+ result_bytes_->append(buf_->data(), num_bytes);
ReadBody(request);
} else { // Error while reading, or EOF
OnResponseCompleted(request);
« no previous file with comments | « net/net_lib.scons ('k') | net/url_request/mime_sniffer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698