Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: content/browser/download/save_file.cc

Issue 2695153002: Refactor BaseFile class to support sparse files (Closed)
Patch Set: remove the while loop around write Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/log/net_log_with_source.h" 9 #include "net/log/net_log_with_source.h"
10 10
(...skipping 10 matching lines...) Expand all
21 DCHECK(info); 21 DCHECK(info);
22 DCHECK(info->path.empty()); 22 DCHECK(info->path.empty());
23 } 23 }
24 24
25 SaveFile::~SaveFile() { 25 SaveFile::~SaveFile() {
26 DCHECK_CURRENTLY_ON(BrowserThread::FILE); 26 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
27 } 27 }
28 28
29 DownloadInterruptReason SaveFile::Initialize() { 29 DownloadInterruptReason SaveFile::Initialize() {
30 return file_.Initialize(base::FilePath(), base::FilePath(), base::File(), 0, 30 return file_.Initialize(base::FilePath(), base::FilePath(), base::File(), 0,
31 std::string(), std::unique_ptr<crypto::SecureHash>()); 31 std::string(), std::unique_ptr<crypto::SecureHash>(),
32 false);
32 } 33 }
33 34
34 DownloadInterruptReason SaveFile::AppendDataToFile(const char* data, 35 DownloadInterruptReason SaveFile::AppendDataToFile(const char* data,
35 size_t data_len) { 36 size_t data_len) {
36 return file_.AppendDataToFile(data, data_len); 37 return file_.AppendDataToFile(data, data_len);
37 } 38 }
38 39
39 DownloadInterruptReason SaveFile::Rename(const base::FilePath& full_path) { 40 DownloadInterruptReason SaveFile::Rename(const base::FilePath& full_path) {
40 return file_.Rename(full_path); 41 return file_.Rename(full_path);
41 } 42 }
(...skipping 26 matching lines...) Expand all
68 69
69 int64_t SaveFile::BytesSoFar() const { 70 int64_t SaveFile::BytesSoFar() const {
70 return file_.bytes_so_far(); 71 return file_.bytes_so_far();
71 } 72 }
72 73
73 std::string SaveFile::DebugString() const { 74 std::string SaveFile::DebugString() const {
74 return file_.DebugString(); 75 return file_.DebugString();
75 } 76 }
76 77
77 } // namespace content 78 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698