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

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

Issue 11238044: Refactor BaseFile methods to return a DownloadInterruptReason instead of a net::Error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove SHFILE_TO_REASON macro Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/download/save_file.h ('k') | content/browser/download/save_file_manager.cc » ('j') | 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/base/file_stream.h" 9 #include "net/base/file_stream.h"
10 10
(...skipping 16 matching lines...) Expand all
27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
28 28
29 DCHECK(info); 29 DCHECK(info);
30 DCHECK(info->path.empty()); 30 DCHECK(info->path.empty());
31 } 31 }
32 32
33 SaveFile::~SaveFile() { 33 SaveFile::~SaveFile() {
34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
35 } 35 }
36 36
37 net::Error SaveFile::Initialize() { 37 content::DownloadInterruptReason SaveFile::Initialize() {
38 return file_.Initialize(FilePath()); 38 return file_.Initialize(FilePath());
39 } 39 }
40 40
41 net::Error SaveFile::AppendDataToFile(const char* data, size_t data_len) { 41 content::DownloadInterruptReason SaveFile::AppendDataToFile(const char* data,
42 size_t data_len) {
42 return file_.AppendDataToFile(data, data_len); 43 return file_.AppendDataToFile(data, data_len);
43 } 44 }
44 45
45 net::Error SaveFile::Rename(const FilePath& full_path) { 46 content::DownloadInterruptReason SaveFile::Rename(const FilePath& full_path) {
46 return file_.Rename(full_path); 47 return file_.Rename(full_path);
47 } 48 }
48 49
49 void SaveFile::Detach() { 50 void SaveFile::Detach() {
50 file_.Detach(); 51 file_.Detach();
51 } 52 }
52 53
53 void SaveFile::Cancel() { 54 void SaveFile::Cancel() {
54 file_.Cancel(); 55 file_.Cancel();
55 } 56 }
(...skipping 18 matching lines...) Expand all
74 return file_.bytes_so_far(); 75 return file_.bytes_so_far();
75 } 76 }
76 77
77 bool SaveFile::GetHash(std::string* hash) { 78 bool SaveFile::GetHash(std::string* hash) {
78 return file_.GetHash(hash); 79 return file_.GetHash(hash);
79 } 80 }
80 81
81 std::string SaveFile::DebugString() const { 82 std::string SaveFile::DebugString() const {
82 return file_.DebugString(); 83 return file_.DebugString();
83 } 84 }
OLDNEW
« no previous file with comments | « content/browser/download/save_file.h ('k') | content/browser/download/save_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698