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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 7237034: sql::MetaTable.next_download_id, DownloadManager::GetNextId() (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: MSVC requires operator< for hash_map Created 9 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
« chrome/browser/profiles/profile_io_data.h ('K') | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/resource_dispatcher_host.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index 24ef6825bfd520b7177f8b5f97cb61a6294aaa40..10c5821d407265e96e3b38e717a9500c0e53a6be 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -34,7 +34,6 @@
#include "content/browser/download/save_file_resource_handler.h"
#include "content/browser/in_process_webkit/webkit_thread.h"
#include "content/browser/plugin_service.h"
-#include "content/browser/resource_context.h"
#include "content/browser/renderer_host/async_resource_handler.h"
#include "content/browser/renderer_host/buffered_resource_handler.h"
#include "content/browser/renderer_host/cross_site_resource_handler.h"
@@ -50,6 +49,7 @@
#include "content/browser/renderer_host/resource_queue.h"
#include "content/browser/renderer_host/resource_request_details.h"
#include "content/browser/renderer_host/sync_resource_handler.h"
+#include "content/browser/resource_context.h"
#include "content/browser/ssl/ssl_client_auth_handler.h"
#include "content/browser/ssl/ssl_manager.h"
#include "content/browser/worker_host/worker_service.h"
@@ -726,12 +726,28 @@ void ResourceDispatcherHost::BeginDownload(
request_id_--;
+ // TODO(benjhayden) next_download_id_thunk can be a field in ResourceContext
+ // when DownloadManager is moved to content.
+ DownloadManager::GetNextIdThunkType* next_download_id_thunk =
+ reinterpret_cast<DownloadManager::GetNextIdThunkType*>(context
+ .GetUserData(reinterpret_cast<void*>(BASE_HASH_NAMESPACE::
+#if defined(COMPILER_GCC)
+ hash<std::string>()
+#elif defined(COMPILER_MSVC)
+ hash_value
+#endif
+ ("next_download_id_thunk"))));
+ CHECK(next_download_id_thunk);
+ CHECK(!next_download_id_thunk->is_null());
+ DownloadId dl_id = next_download_id_thunk->Run();
+
scoped_refptr<ResourceHandler> handler(
new DownloadResourceHandler(this,
child_id,
route_id,
request_id_,
url,
+ dl_id,
download_file_manager_.get(),
request,
prompt_for_save_location,
@@ -752,7 +768,7 @@ void ResourceDispatcherHost::BeginDownload(
request->set_method("GET");
request->set_referrer(MaybeStripReferrer(referrer).spec());
- request->set_context(context.request_context());
+ request->set_context(request_context);
request->set_load_flags(request->load_flags() |
net::LOAD_IS_DOWNLOAD);
« chrome/browser/profiles/profile_io_data.h ('K') | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698