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

Unified Diff: mojo/services/network/url_loader_impl.cc

Issue 407093011: Allow URLRequests from one context to have different NetworkDelegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new tests Created 6 years, 4 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 | « extensions/browser/extension_protocols_unittest.cc ('k') | net/ocsp/nss_ocsp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/url_loader_impl.cc
diff --git a/mojo/services/network/url_loader_impl.cc b/mojo/services/network/url_loader_impl.cc
index 52f61480ce629499dc5a92d897ee00520f3c0327..bbdfcb22c0a3b75465c9f7943f9f25fa60346125 100644
--- a/mojo/services/network/url_loader_impl.cc
+++ b/mojo/services/network/url_loader_impl.cc
@@ -14,6 +14,7 @@
#include "net/base/upload_data_stream.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/redirect_info.h"
+#include "net/url_request/url_request_context.h"
namespace mojo {
namespace {
@@ -83,7 +84,8 @@ class UploadDataPipeElementReader : public net::UploadElementReader {
int buf_length,
const net::CompletionCallback& callback) OVERRIDE {
uint32_t bytes_read =
- std::min(BytesRemaining(), static_cast<uint64>(buf_length));
+ std::min(static_cast<uint32_t>(BytesRemaining()),
+ static_cast<uint32_t>(buf_length));
if (bytes_read > 0) {
ReadDataRaw(pipe_.get(), buf->data(), &bytes_read,
MOJO_READ_DATA_FLAG_NONE);
@@ -178,11 +180,11 @@ void URLLoaderImpl::Start(URLRequestPtr request,
return;
}
- url_request_.reset(
- new net::URLRequest(GURL(request->url),
- net::DEFAULT_PRIORITY,
- this,
- context_->url_request_context()));
+ url_request_ = context_->url_request_context()->CreateRequest(
+ GURL(request->url),
+ net::DEFAULT_PRIORITY,
+ this,
+ NULL);
url_request_->set_method(request->method);
if (request->headers) {
net::HttpRequestHeaders headers;
« no previous file with comments | « extensions/browser/extension_protocols_unittest.cc ('k') | net/ocsp/nss_ocsp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698