Removed calls to URLRequest::URLRequest in favor of URLRequestContext::CreateRequest

This patch is by departed intern [email protected], but it failed to pass the CQ for reasons unrelated to the patch.

Original review at http://codereview.chromium.org/10870060/ .

[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
BUG=142945

Review URL: https://chromiumcodereview.appspot.com/10910044

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154550 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index 8f2b1755..5b0319a 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -41,6 +41,7 @@
 #include "content/public/browser/web_contents_delegate.h"
 #include "net/base/load_flags.h"
 #include "net/base/upload_data.h"
+#include "net/url_request/url_request_context.h"
 #include "webkit/glue/webkit_glue.h"
 
 using content::BrowserThread;
@@ -79,10 +80,9 @@
   // ResourceDispatcherHost{Base} is-not-a URLRequest::Delegate, and
   // DownloadUrlParameters can-not include resource_dispatcher_host_impl.h, so
   // we must down cast. RDHI is the only subclass of RDH as of 2012 May 4.
-  scoped_ptr<net::URLRequest> request(new net::URLRequest(
-      params->url(),
-      NULL,
-      params->resource_context()->GetRequestContext()));
+  scoped_ptr<net::URLRequest> request(
+      params->resource_context()->GetRequestContext()->CreateRequest(
+          params->url(), NULL));
   request->set_referrer(params->referrer().url.spec());
   webkit_glue::ConfigureURLRequestForReferrerPolicy(
       request.get(), params->referrer().policy);