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

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

Issue 11150027: Handle the case where IAttachmentExecute::Save() deletes a downloaded file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Address comments + Update strings 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
« no previous file with comments | « content/browser/download/base_file.h ('k') | content/browser/download/base_file_linux.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/base_file.h" 5 #include "content/browser/download/base_file.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
207 207
208 if (calculate_hash_) 208 if (calculate_hash_)
209 secure_hash_->Finish(sha256_hash_, kSha256HashLen); 209 secure_hash_->Finish(sha256_hash_, kSha256HashLen);
210 210
211 Close(); 211 Close();
212 } 212 }
213 213
214 // OS_WIN, OS_MACOSX and OS_LINUX have specialized implementations. 214 // OS_WIN, OS_MACOSX and OS_LINUX have specialized implementations.
215 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_LINUX) 215 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_LINUX)
216 void BaseFile::AnnotateWithSourceInformation() { 216 DownloadInterruptReason BaseFile::AnnotateWithSourceInformation() {
217 return DOWNLOAD_INTERRUPT_REASON_NONE;
217 } 218 }
218 #endif 219 #endif
219 220
220 int64 BaseFile::CurrentSpeed() const { 221 int64 BaseFile::CurrentSpeed() const {
221 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 222 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
222 return CurrentSpeedAtTime(base::TimeTicks::Now()); 223 return CurrentSpeedAtTime(base::TimeTicks::Now());
223 } 224 }
224 225
225 bool BaseFile::GetHash(std::string* hash) { 226 bool BaseFile::GetHash(std::string* hash) {
226 DCHECK(!detached_); 227 DCHECK(!detached_);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 const char* operation, 352 const char* operation,
352 int os_error, 353 int os_error,
353 DownloadInterruptReason reason) { 354 DownloadInterruptReason reason) {
354 bound_net_log_.AddEvent( 355 bound_net_log_.AddEvent(
355 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR, 356 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR,
356 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); 357 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason));
357 return reason; 358 return reason;
358 } 359 }
359 360
360 } // namespace content 361 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/base_file.h ('k') | content/browser/download/base_file_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698