| 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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 // The null times make the date range unbounded. | 826 // The null times make the date range unbounded. |
| 827 return RemoveDownloadsBetween(base::Time(), base::Time()); | 827 return RemoveDownloadsBetween(base::Time(), base::Time()); |
| 828 } | 828 } |
| 829 | 829 |
| 830 // Initiate a download of a specific URL. We send the request to the | 830 // Initiate a download of a specific URL. We send the request to the |
| 831 // ResourceDispatcherHost, and let it send us responses like a regular | 831 // ResourceDispatcherHost, and let it send us responses like a regular |
| 832 // download. | 832 // download. |
| 833 void DownloadManagerImpl::DownloadUrl( | 833 void DownloadManagerImpl::DownloadUrl( |
| 834 const GURL& url, | 834 const GURL& url, |
| 835 const GURL& referrer, | 835 const GURL& referrer, |
| 836 const std::string& referrer_charset, | 836 const std::string& default_charset, |
| 837 bool prefer_cache, | 837 bool prefer_cache, |
| 838 const DownloadSaveInfo& save_info, | 838 const DownloadSaveInfo& save_info, |
| 839 WebContents* web_contents) { | 839 WebContents* web_contents) { |
| 840 ResourceDispatcherHost* resource_dispatcher_host = | 840 ResourceDispatcherHost* resource_dispatcher_host = |
| 841 ResourceDispatcherHost::Get(); | 841 ResourceDispatcherHost::Get(); |
| 842 | 842 |
| 843 // We send a pointer to content::ResourceContext, instead of the usual | 843 // We send a pointer to content::ResourceContext, instead of the usual |
| 844 // reference, so that a copy of the object isn't made. | 844 // reference, so that a copy of the object isn't made. |
| 845 // base::Bind can't handle 7 args, so we use URLParams and RenderParams. | 845 // base::Bind can't handle 7 args, so we use URLParams and RenderParams. |
| 846 BrowserThread::PostTask( | 846 BrowserThread::PostTask( |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 it != history_downloads_.end(); ++it) { | 1207 it != history_downloads_.end(); ++it) { |
| 1208 if (it->second->IsComplete() && !it->second->GetOpened()) | 1208 if (it->second->IsComplete() && !it->second->GetOpened()) |
| 1209 ++num_unopened; | 1209 ++num_unopened; |
| 1210 } | 1210 } |
| 1211 download_stats::RecordOpensOutstanding(num_unopened); | 1211 download_stats::RecordOpensOutstanding(num_unopened); |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 void DownloadManagerImpl::SetFileManager(DownloadFileManager* file_manager) { | 1214 void DownloadManagerImpl::SetFileManager(DownloadFileManager* file_manager) { |
| 1215 file_manager_ = file_manager; | 1215 file_manager_ = file_manager; |
| 1216 } | 1216 } |
| OLD | NEW |