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

Unified Diff: chrome/browser/download/download_file.cc

Issue 258008: Move initialization of ChromeURLRequestContexts to the IO thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync again, just in case Created 11 years, 2 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/download/download_file.h ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_file.cc
===================================================================
--- chrome/browser/download/download_file.cc (revision 29872)
+++ chrome/browser/download/download_file.cc (working copy)
@@ -13,6 +13,7 @@
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_manager.h"
+#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/tab_contents/tab_util.h"
@@ -422,11 +423,13 @@
RemoveDownloadFromUIProgress(id);
}
-void DownloadFileManager::DownloadUrl(const GURL& url,
- const GURL& referrer,
- int render_process_host_id,
- int render_view_id,
- URLRequestContext* request_context) {
+void DownloadFileManager::DownloadUrl(
+ const GURL& url,
+ const GURL& referrer,
+ const std::string& referrer_charset,
+ int render_process_host_id,
+ int render_view_id,
+ URLRequestContextGetter* request_context_getter) {
DCHECK(MessageLoop::current() == ui_loop_);
base::Thread* thread = g_browser_process->io_thread();
if (thread) {
@@ -435,9 +438,10 @@
&DownloadFileManager::OnDownloadUrl,
url,
referrer,
+ referrer_charset,
render_process_host_id,
render_view_id,
- request_context));
+ request_context_getter));
}
}
@@ -516,17 +520,23 @@
// Notifications from the UI thread and run on the IO thread
// Initiate a request for URL to be downloaded.
-void DownloadFileManager::OnDownloadUrl(const GURL& url,
- const GURL& referrer,
- int render_process_host_id,
- int render_view_id,
- URLRequestContext* request_context) {
+void DownloadFileManager::OnDownloadUrl(
+ const GURL& url,
+ const GURL& referrer,
+ const std::string& referrer_charset,
+ int render_process_host_id,
+ int render_view_id,
+ URLRequestContextGetter* request_context_getter) {
DCHECK(MessageLoop::current() == io_loop_);
+
+ URLRequestContext* context = request_context_getter->GetURLRequestContext();
+ context->set_referrer_charset(referrer_charset);
+
resource_dispatcher_host_->BeginDownload(url,
referrer,
render_process_host_id,
render_view_id,
- request_context);
+ context);
}
// Actions from the UI thread and run on the download thread
« no previous file with comments | « chrome/browser/download/download_file.h ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698