OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/download/download_request_handle.h" | 5 #include "content/browser/download/download_request_handle.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 DownloadRequestHandle::DownloadRequestHandle( | 25 DownloadRequestHandle::DownloadRequestHandle( |
26 const base::WeakPtr<DownloadResourceHandler>& handler, | 26 const base::WeakPtr<DownloadResourceHandler>& handler, |
27 int child_id, | 27 int child_id, |
28 int render_view_id, | 28 int render_view_id, |
29 int request_id) | 29 int request_id) |
30 : handler_(handler), | 30 : handler_(handler), |
31 child_id_(child_id), | 31 child_id_(child_id), |
32 render_view_id_(render_view_id), | 32 render_view_id_(render_view_id), |
33 request_id_(request_id) { | 33 request_id_(request_id) { |
34 DCHECK(handler_); | 34 DCHECK(handler_.get()); |
35 } | 35 } |
36 | 36 |
37 WebContents* DownloadRequestHandle::GetWebContents() const { | 37 WebContents* DownloadRequestHandle::GetWebContents() const { |
38 RenderViewHostImpl* render_view_host = | 38 RenderViewHostImpl* render_view_host = |
39 RenderViewHostImpl::FromID(child_id_, render_view_id_); | 39 RenderViewHostImpl::FromID(child_id_, render_view_id_); |
40 if (!render_view_host) | 40 if (!render_view_host) |
41 return NULL; | 41 return NULL; |
42 | 42 |
43 return render_view_host->GetDelegate()->GetAsWebContents(); | 43 return render_view_host->GetDelegate()->GetAsWebContents(); |
44 } | 44 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 " child_id = %d" | 80 " child_id = %d" |
81 " render_view_id = %d" | 81 " render_view_id = %d" |
82 " request_id = %d" | 82 " request_id = %d" |
83 "}", | 83 "}", |
84 child_id_, | 84 child_id_, |
85 render_view_id_, | 85 render_view_id_, |
86 request_id_); | 86 request_id_); |
87 } | 87 } |
88 | 88 |
89 } // namespace content | 89 } // namespace content |
OLD | NEW |