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

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

Issue 10696043: Shifted DownloadFile to exporting DownloadInterruptReasons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to TOT. Created 8 years, 5 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
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_DOWNLOAD_FILE_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "content/public/browser/download_id.h" 14 #include "content/public/browser/download_id.h"
15 #include "net/base/net_errors.h" 15 #include "content/public/browser/download_interrupt_reasons.h"
16 16
17 namespace content { 17 namespace content {
18 18
19 class DownloadManager; 19 class DownloadManager;
20 20
21 // These objects live exclusively on the file thread and handle the writing 21 // These objects live exclusively on the file thread and handle the writing
22 // operations for one download. These objects live only for the duration that 22 // operations for one download. These objects live only for the duration that
23 // the download is 'in progress': once the download has been completed or 23 // the download is 'in progress': once the download has been completed or
24 // cancelled, the DownloadFile is destroyed. 24 // cancelled, the DownloadFile is destroyed.
25 class CONTENT_EXPORT DownloadFile { 25 class CONTENT_EXPORT DownloadFile {
26 public: 26 public:
27 virtual ~DownloadFile() {} 27 virtual ~DownloadFile() {}
28 28
29 // If calculate_hash is true, sha256 hash will be calculated. 29 // If calculate_hash is true, sha256 hash will be calculated.
30 // Returns net::OK on success, or a network error code on failure. 30 // Returns DOWNLOAD_INTERRUPT_REASON_NONE on success, or a network
31 virtual net::Error Initialize() = 0; 31 // error code on failure.
32 virtual DownloadInterruptReason Initialize() = 0;
32 33
33 // Rename the download file. 34 // Rename the download file.
34 // Returns net::OK on success, or a network error code on failure. 35 // Returns net::OK on success, or a network error code on failure.
35 virtual net::Error Rename(const FilePath& full_path) = 0; 36 virtual DownloadInterruptReason Rename(const FilePath& full_path) = 0;
36 37
37 // Detach the file so it is not deleted on destruction. 38 // Detach the file so it is not deleted on destruction.
38 virtual void Detach() = 0; 39 virtual void Detach() = 0;
39 40
40 // Abort the download and automatically close the file. 41 // Abort the download and automatically close the file.
41 virtual void Cancel() = 0; 42 virtual void Cancel() = 0;
42 43
43 // Informs the OS that this file came from the internet. 44 // Informs the OS that this file came from the internet.
44 virtual void AnnotateWithSourceInformation() = 0; 45 virtual void AnnotateWithSourceInformation() = 0;
45 46
(...skipping 15 matching lines...) Expand all
61 virtual int Id() const = 0; 62 virtual int Id() const = 0;
62 virtual DownloadManager* GetDownloadManager() = 0; 63 virtual DownloadManager* GetDownloadManager() = 0;
63 virtual const DownloadId& GlobalId() const = 0; 64 virtual const DownloadId& GlobalId() const = 0;
64 65
65 virtual std::string DebugString() const = 0; 66 virtual std::string DebugString() const = 0;
66 }; 67 };
67 68
68 } // namespace content 69 } // namespace content
69 70
70 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ 71 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | content/browser/download/download_file_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698