OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/download/download_file.h" | 5 #include "chrome/browser/download/download_file.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
10 #include "chrome/browser/download/download_manager.h" | 10 #include "chrome/browser/download/download_manager.h" |
11 #include "chrome/browser/download/download_util.h" | 11 #include "chrome/browser/download/download_util.h" |
12 #include "chrome/browser/history/download_types.h" | 12 #include "chrome/browser/history/download_types.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 | 14 |
15 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
16 #include "app/win_util.h" | |
17 #include "chrome/common/win_safe_util.h" | 16 #include "chrome/common/win_safe_util.h" |
18 #elif defined(OS_MACOSX) | 17 #elif defined(OS_MACOSX) |
19 #include "chrome/browser/cocoa/file_metadata.h" | 18 #include "chrome/browser/cocoa/file_metadata.h" |
20 #endif | 19 #endif |
21 | 20 |
22 DownloadFile::DownloadFile(const DownloadCreateInfo* info) | 21 DownloadFile::DownloadFile(const DownloadCreateInfo* info) |
23 : file_stream_(info->save_info.file_stream), | 22 : file_stream_(info->save_info.file_stream), |
24 source_url_(info->url), | 23 source_url_(info->url), |
25 referrer_url_(info->referrer_url), | 24 referrer_url_(info->referrer_url), |
26 id_(info->download_id), | 25 id_(info->download_id), |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 193 |
195 void DownloadFile::CancelDownloadRequest(ResourceDispatcherHost* rdh) { | 194 void DownloadFile::CancelDownloadRequest(ResourceDispatcherHost* rdh) { |
196 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); | 195 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); |
197 ChromeThread::PostTask( | 196 ChromeThread::PostTask( |
198 ChromeThread::IO, FROM_HERE, | 197 ChromeThread::IO, FROM_HERE, |
199 NewRunnableFunction(&download_util::CancelDownloadRequest, | 198 NewRunnableFunction(&download_util::CancelDownloadRequest, |
200 rdh, | 199 rdh, |
201 child_id_, | 200 child_id_, |
202 request_id_)); | 201 request_id_)); |
203 } | 202 } |
OLD | NEW |