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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 BrowserThread::IO, FROM_HERE, | 68 BrowserThread::IO, FROM_HERE, |
69 base::Bind(&DownloadResourceHandler::ResumeRequest, handler_)); | 69 base::Bind(&DownloadResourceHandler::ResumeRequest, handler_)); |
70 } | 70 } |
71 | 71 |
72 void DownloadRequestHandle::CancelRequest() const { | 72 void DownloadRequestHandle::CancelRequest() const { |
73 BrowserThread::PostTask( | 73 BrowserThread::PostTask( |
74 BrowserThread::IO, FROM_HERE, | 74 BrowserThread::IO, FROM_HERE, |
75 base::Bind(&DownloadResourceHandler::CancelRequest, handler_)); | 75 base::Bind(&DownloadResourceHandler::CancelRequest, handler_)); |
76 } | 76 } |
77 | 77 |
| 78 void DownloadRequestHandle::SetRequestId(int new_request_id) { |
| 79 request_id_ = new_request_id; |
| 80 } |
| 81 |
| 82 int DownloadRequestHandle::RequestId() const { |
| 83 return request_id_; |
| 84 } |
| 85 |
78 std::string DownloadRequestHandle::DebugString() const { | 86 std::string DownloadRequestHandle::DebugString() const { |
79 return base::StringPrintf("{" | 87 return base::StringPrintf("{" |
80 " child_id = %d" | 88 " child_id = %d" |
81 " render_view_id = %d" | 89 " render_view_id = %d" |
82 " request_id = %d" | 90 " request_id = %d" |
83 "}", | 91 "}", |
84 child_id_, | 92 child_id_, |
85 render_view_id_, | 93 render_view_id_, |
86 request_id_); | 94 request_id_); |
87 } | 95 } |
88 | 96 |
89 } // namespace content | 97 } // namespace content |
OLD | NEW |