Re-enable index-basics-workers test to see if still times
[chromium-blink-merge.git] / content / public / browser / download_url_parameters.cc
blob7ec85083be9d1fc238a5d891d0168056a3029877
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/public/browser/download_url_parameters.h"
7 #include "base/callback.h"
8 #include "content/public/browser/browser_context.h"
9 #include "content/public/browser/download_save_info.h"
10 #include "content/public/browser/render_process_host.h"
11 #include "content/public/browser/render_view_host.h"
12 #include "content/public/browser/resource_dispatcher_host.h"
13 #include "content/public/browser/web_contents.h"
14 #include "googleurl/src/gurl.h"
16 namespace content {
18 DownloadUrlParameters::DownloadUrlParameters(
19 const GURL& url,
20 int render_process_host_id,
21 int render_view_host_routing_id,
22 ResourceContext* resource_context)
23 : content_initiated_(false),
24 load_flags_(0),
25 method_("GET"),
26 post_id_(-1),
27 prefer_cache_(false),
28 render_process_host_id_(render_process_host_id),
29 render_view_host_routing_id_(render_view_host_routing_id),
30 resource_context_(resource_context),
31 resource_dispatcher_host_(ResourceDispatcherHost::Get()),
32 url_(url) {
33 DCHECK(resource_dispatcher_host_);
36 DownloadUrlParameters::~DownloadUrlParameters() {
39 // static
40 DownloadUrlParameters* DownloadUrlParameters::FromWebContents(
41 WebContents* web_contents,
42 const GURL& url) {
43 return new DownloadUrlParameters(
44 url,
45 web_contents->GetRenderProcessHost()->GetID(),
46 web_contents->GetRenderViewHost()->GetRoutingID(),
47 web_contents->GetBrowserContext()->GetResourceContext());
50 } // namespace content