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

Side by Side Diff: content/browser/download/base_file.h

Issue 11150027: Handle the case where IAttachmentExecute::Save() deletes a downloaded file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android Created 8 years, 1 month 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
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 #ifndef CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_
6 #define CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 // Detach the file so it is not deleted on destruction. 66 // Detach the file so it is not deleted on destruction.
67 virtual void Detach(); 67 virtual void Detach();
68 68
69 // Abort the download and automatically close the file. 69 // Abort the download and automatically close the file.
70 void Cancel(); 70 void Cancel();
71 71
72 // Indicate that the download has finished. No new data will be received. 72 // Indicate that the download has finished. No new data will be received.
73 void Finish(); 73 void Finish();
74 74
75 // Informs the OS that this file came from the internet. 75 // Informs the OS that this file came from the internet. Returns a
76 void AnnotateWithSourceInformation(); 76 // DownloadInterruptReason indicating the result of the operation.
77 content::DownloadInterruptReason AnnotateWithSourceInformation();
77 78
78 // Calculate and return the current speed in bytes per second. 79 // Calculate and return the current speed in bytes per second.
79 int64 CurrentSpeed() const; 80 int64 CurrentSpeed() const;
80 81
81 FilePath full_path() const { return full_path_; } 82 FilePath full_path() const { return full_path_; }
82 bool in_progress() const { return file_stream_.get() != NULL; } 83 bool in_progress() const { return file_stream_.get() != NULL; }
83 int64 bytes_so_far() const { return bytes_so_far_; } 84 int64 bytes_so_far() const { return bytes_so_far_; }
84 85
85 // Fills |hash| with the hash digest for the file. 86 // Fills |hash| with the hash digest for the file.
86 // Returns true if digest is successfully calculated. 87 // Returns true if digest is successfully calculated.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Indicates that this class no longer owns the associated file, and so 171 // Indicates that this class no longer owns the associated file, and so
171 // won't delete it on destruction. 172 // won't delete it on destruction.
172 bool detached_; 173 bool detached_;
173 174
174 net::BoundNetLog bound_net_log_; 175 net::BoundNetLog bound_net_log_;
175 176
176 DISALLOW_COPY_AND_ASSIGN(BaseFile); 177 DISALLOW_COPY_AND_ASSIGN(BaseFile);
177 }; 178 };
178 179
179 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ 180 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698