| 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/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 "base/pickle.h" |
| 8 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 9 #include "net/base/file_stream.h" | 10 #include "net/base/file_stream.h" |
| 10 | 11 |
| 11 using content::BrowserThread; | 12 using content::BrowserThread; |
| 12 | 13 |
| 13 SaveFile::SaveFile(const SaveFileCreateInfo* info) | 14 SaveFile::SaveFile(const SaveFileCreateInfo* info) |
| 14 : file_(FilePath(), info->url, GURL(), 0, linked_ptr<net::FileStream>()), | 15 : file_(FilePath(), |
| 16 info->url, |
| 17 GURL(), |
| 18 0, |
| 19 Pickle(), |
| 20 linked_ptr<net::FileStream>()), |
| 15 info_(info) { | 21 info_(info) { |
| 16 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 22 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 17 | 23 |
| 18 DCHECK(info); | 24 DCHECK(info); |
| 19 DCHECK(info->path.empty()); | 25 DCHECK(info->path.empty()); |
| 20 } | 26 } |
| 21 | 27 |
| 22 SaveFile::~SaveFile() { | 28 SaveFile::~SaveFile() { |
| 23 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 29 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 24 } | 30 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return file_.bytes_so_far(); | 69 return file_.bytes_so_far(); |
| 64 } | 70 } |
| 65 | 71 |
| 66 bool SaveFile::GetSha256Hash(std::string* hash) { | 72 bool SaveFile::GetSha256Hash(std::string* hash) { |
| 67 return file_.GetSha256Hash(hash); | 73 return file_.GetSha256Hash(hash); |
| 68 } | 74 } |
| 69 | 75 |
| 70 std::string SaveFile::DebugString() const { | 76 std::string SaveFile::DebugString() const { |
| 71 return file_.DebugString(); | 77 return file_.DebugString(); |
| 72 } | 78 } |
| OLD | NEW |