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

Unified Diff: content/public/browser/download_url_parameters.cc

Issue 10232010: DownloadUrlParameters (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fixes Created 8 years, 8 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 | « content/public/browser/download_url_parameters.h ('k') | content/test/mock_download_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/download_url_parameters.cc
diff --git a/content/public/browser/download_url_parameters.cc b/content/public/browser/download_url_parameters.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ae0faeda11a01e5eb10c09acdaaeb4db445d3f09
--- /dev/null
+++ b/content/public/browser/download_url_parameters.cc
@@ -0,0 +1,53 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/browser/download_url_parameters.h"
+
+#include "base/callback.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/browser/download_save_info.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/resource_dispatcher_host.h"
+#include "content/public/browser/web_contents.h"
+#include "googleurl/src/gurl.h"
+
+namespace content {
+
+DownloadUrlParameters::DownloadUrlParameters(
+ const GURL& url,
+ int render_process_host_id,
+ int render_view_host_routing_id,
+ ResourceContext* resource_context,
+ const DownloadSaveInfo& save_info)
+ : load_flags_(0),
+ method_("GET"),
+ post_id_(-1),
+ prefer_cache_(false),
+ render_process_host_id_(render_process_host_id),
+ render_view_host_routing_id_(render_view_host_routing_id),
+ resource_context_(resource_context),
+ resource_dispatcher_host_(ResourceDispatcherHost::Get()),
+ save_info_(save_info),
+ url_(url) {
+ DCHECK(resource_dispatcher_host_);
+}
+
+DownloadUrlParameters::~DownloadUrlParameters() {
+}
+
+// static
+DownloadUrlParameters* DownloadUrlParameters::FromWebContents(
+ WebContents* web_contents,
+ const GURL& url,
+ const DownloadSaveInfo& save_info) {
+ return new DownloadUrlParameters(
+ url,
+ web_contents->GetRenderProcessHost()->GetID(),
+ web_contents->GetRenderViewHost()->GetRoutingID(),
+ web_contents->GetBrowserContext()->GetResourceContext(),
+ save_info);
+}
+
+} // namespace content
« no previous file with comments | « content/public/browser/download_url_parameters.h ('k') | content/test/mock_download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698