| 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/save_file.h" | 5 #include "content/browser/download/save_file.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 // TODO(asanka): SaveFile should use the target directory of the save package as | 12 // TODO(asanka): SaveFile should use the target directory of the save package as |
| 13 // the default download directory when initializing |file_|. | 13 // the default download directory when initializing |file_|. |
| 14 // Unfortunately, as it is, constructors of SaveFile don't always | 14 // Unfortunately, as it is, constructors of SaveFile don't always |
| 15 // have access to the SavePackage at this point. | 15 // have access to the SavePackage at this point. |
| 16 SaveFile::SaveFile(const SaveFileCreateInfo* info, bool calculate_hash) | 16 SaveFile::SaveFile(const SaveFileCreateInfo* info, bool calculate_hash) |
| 17 : file_(net::BoundNetLog()), info_(info) { | 17 : file_(net::NetLogWithSource()), info_(info) { |
| 18 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 18 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 19 | 19 |
| 20 DCHECK(info); | 20 DCHECK(info); |
| 21 DCHECK(info->path.empty()); | 21 DCHECK(info->path.empty()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 SaveFile::~SaveFile() { | 24 SaveFile::~SaveFile() { |
| 25 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 25 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 int64_t SaveFile::BytesSoFar() const { | 68 int64_t SaveFile::BytesSoFar() const { |
| 69 return file_.bytes_so_far(); | 69 return file_.bytes_so_far(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 std::string SaveFile::DebugString() const { | 72 std::string SaveFile::DebugString() const { |
| 73 return file_.DebugString(); | 73 return file_.DebugString(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace content | 76 } // namespace content |
| OLD | NEW |