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_manager_impl.h" | 5 #include "content/browser/download/download_manager_impl.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 for (content::DownloadUrlParameters::RequestHeadersType::const_iterator iter | 77 for (content::DownloadUrlParameters::RequestHeadersType::const_iterator iter |
78 = params->request_headers_begin(); | 78 = params->request_headers_begin(); |
79 iter != params->request_headers_end(); | 79 iter != params->request_headers_end(); |
80 ++iter) { | 80 ++iter) { |
81 request->SetExtraRequestHeaderByName( | 81 request->SetExtraRequestHeaderByName( |
82 iter->first, iter->second, false/*overwrite*/); | 82 iter->first, iter->second, false/*overwrite*/); |
83 } | 83 } |
84 resource_dispatcher_host->BeginDownload( | 84 resource_dispatcher_host->BeginDownload( |
85 request.Pass(), | 85 request.Pass(), |
| 86 params->content_initiated(), |
86 params->resource_context(), | 87 params->resource_context(), |
87 params->render_process_host_id(), | 88 params->render_process_host_id(), |
88 params->render_view_host_routing_id(), | 89 params->render_view_host_routing_id(), |
89 params->prefer_cache(), | 90 params->prefer_cache(), |
90 params->save_info(), | 91 params->save_info(), |
91 params->callback()); | 92 params->callback()); |
92 } | 93 } |
93 | 94 |
94 class MapValueIteratorAdapter { | 95 class MapValueIteratorAdapter { |
95 public: | 96 public: |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 if (it->second->IsComplete() && !it->second->GetOpened()) | 1170 if (it->second->IsComplete() && !it->second->GetOpened()) |
1170 ++num_unopened; | 1171 ++num_unopened; |
1171 } | 1172 } |
1172 download_stats::RecordOpensOutstanding(num_unopened); | 1173 download_stats::RecordOpensOutstanding(num_unopened); |
1173 } | 1174 } |
1174 | 1175 |
1175 void DownloadManagerImpl::SetFileManagerForTesting( | 1176 void DownloadManagerImpl::SetFileManagerForTesting( |
1176 DownloadFileManager* file_manager) { | 1177 DownloadFileManager* file_manager) { |
1177 file_manager_ = file_manager; | 1178 file_manager_ = file_manager; |
1178 } | 1179 } |
OLD | NEW |