OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base_file.h" | 5 #include "content/browser/download/base_file.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "crypto/secure_hash.h" | 12 #include "crypto/secure_hash.h" |
13 #include "net/base/file_stream.h" | 13 #include "net/base/file_stream.h" |
14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
15 #include "chrome/browser/download/download_util.h" | 15 #include "chrome/browser/download/download_util.h" |
16 #include "content/browser/browser_thread.h" | 16 #include "content/browser/browser_thread.h" |
17 | 17 |
18 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
19 #include "chrome/common/win_safe_util.h" | 19 #include "content/browser/safe_util_win.h" |
20 #elif defined(OS_MACOSX) | 20 #elif defined(OS_MACOSX) |
21 #include "chrome/browser/mac/file_metadata.h" | 21 #include "content/browser/file_metadata_mac.h" |
22 #endif | 22 #endif |
23 | 23 |
24 BaseFile::BaseFile(const FilePath& full_path, | 24 BaseFile::BaseFile(const FilePath& full_path, |
25 const GURL& source_url, | 25 const GURL& source_url, |
26 const GURL& referrer_url, | 26 const GURL& referrer_url, |
27 int64 received_bytes, | 27 int64 received_bytes, |
28 const linked_ptr<net::FileStream>& file_stream) | 28 const linked_ptr<net::FileStream>& file_stream) |
29 : full_path_(full_path), | 29 : full_path_(full_path), |
30 source_url_(source_url), | 30 source_url_(source_url), |
31 referrer_url_(referrer_url), | 31 referrer_url_(referrer_url), |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 std::string BaseFile::DebugString() const { | 240 std::string BaseFile::DebugString() const { |
241 return base::StringPrintf("{ source_url_ = \"%s\"" | 241 return base::StringPrintf("{ source_url_ = \"%s\"" |
242 " full_path_ = \"%" PRFilePath "\"" | 242 " full_path_ = \"%" PRFilePath "\"" |
243 " bytes_so_far_ = %" PRId64 " detached_ = %c }", | 243 " bytes_so_far_ = %" PRId64 " detached_ = %c }", |
244 source_url_.spec().c_str(), | 244 source_url_.spec().c_str(), |
245 full_path_.value().c_str(), | 245 full_path_.value().c_str(), |
246 bytes_so_far_, | 246 bytes_so_far_, |
247 detached_ ? 'T' : 'F'); | 247 detached_ ? 'T' : 'F'); |
248 } | 248 } |
OLD | NEW |