OLD | NEW |
1 // Copyright (c) 2010 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 "chrome/browser/download/base_file.h" | 5 #include "chrome/browser/download/base_file.h" |
6 | 6 |
7 #include "base/crypto/secure_hash.h" | 7 #include "base/crypto/secure_hash.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
11 #include "net/base/file_stream.h" | 11 #include "net/base/file_stream.h" |
12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
13 #include "chrome/browser/browser_thread.h" | 13 #include "chrome/browser/browser_thread.h" |
14 #include "chrome/browser/download/download_util.h" | 14 #include "chrome/browser/download/download_util.h" |
15 | 15 |
16 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
17 #include "app/win/win_util.h" | |
18 #include "chrome/common/win_safe_util.h" | 17 #include "chrome/common/win_safe_util.h" |
19 #elif defined(OS_MACOSX) | 18 #elif defined(OS_MACOSX) |
20 #include "chrome/browser/ui/cocoa/file_metadata.h" | 19 #include "chrome/browser/ui/cocoa/file_metadata.h" |
21 #endif | 20 #endif |
22 | 21 |
23 BaseFile::BaseFile(const FilePath& full_path, | 22 BaseFile::BaseFile(const FilePath& full_path, |
24 const GURL& source_url, | 23 const GURL& source_url, |
25 const GURL& referrer_url, | 24 const GURL& referrer_url, |
26 int64 received_bytes, | 25 int64 received_bytes, |
27 const linked_ptr<net::FileStream>& file_stream) | 26 const linked_ptr<net::FileStream>& file_stream) |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 file_stream_->Close(); | 220 file_stream_->Close(); |
222 file_stream_.reset(); | 221 file_stream_.reset(); |
223 } | 222 } |
224 } | 223 } |
225 | 224 |
226 std::string BaseFile::DebugString() const { | 225 std::string BaseFile::DebugString() const { |
227 return base::StringPrintf("{ source_url_ = \"%s\" full_path_ = \"%s\" }", | 226 return base::StringPrintf("{ source_url_ = \"%s\" full_path_ = \"%s\" }", |
228 source_url_.spec().c_str(), | 227 source_url_.spec().c_str(), |
229 full_path_.value().c_str()); | 228 full_path_.value().c_str()); |
230 } | 229 } |
OLD | NEW |