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

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

Issue 12213066: Use base namespace for FilePath in content/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | 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_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
7 7
8 #include "content/browser/download/download_file.h" 8 #include "content/browser/download/download_file.h"
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 18 matching lines...) Expand all
29 // Takes ownership of the object pointed to by |request_handle|. 29 // Takes ownership of the object pointed to by |request_handle|.
30 // |bound_net_log| will be used for logging the download file's events. 30 // |bound_net_log| will be used for logging the download file's events.
31 // May be constructed on any thread. All methods besides the constructor 31 // May be constructed on any thread. All methods besides the constructor
32 // (including destruction) must occur on the FILE thread. 32 // (including destruction) must occur on the FILE thread.
33 // 33 //
34 // Note that the DownloadFileImpl automatically reads from the passed in 34 // Note that the DownloadFileImpl automatically reads from the passed in
35 // stream, and sends updates and status of those reads to the 35 // stream, and sends updates and status of those reads to the
36 // DownloadDestinationObserver. 36 // DownloadDestinationObserver.
37 DownloadFileImpl( 37 DownloadFileImpl(
38 scoped_ptr<DownloadSaveInfo> save_info, 38 scoped_ptr<DownloadSaveInfo> save_info,
39 const FilePath& default_downloads_directory, 39 const base::FilePath& default_downloads_directory,
40 const GURL& url, 40 const GURL& url,
41 const GURL& referrer_url, 41 const GURL& referrer_url,
42 bool calculate_hash, 42 bool calculate_hash,
43 scoped_ptr<ByteStreamReader> stream, 43 scoped_ptr<ByteStreamReader> stream,
44 const net::BoundNetLog& bound_net_log, 44 const net::BoundNetLog& bound_net_log,
45 scoped_ptr<PowerSaveBlocker> power_save_blocker, 45 scoped_ptr<PowerSaveBlocker> power_save_blocker,
46 base::WeakPtr<DownloadDestinationObserver> observer); 46 base::WeakPtr<DownloadDestinationObserver> observer);
47 47
48 virtual ~DownloadFileImpl(); 48 virtual ~DownloadFileImpl();
49 49
50 // DownloadFile functions. 50 // DownloadFile functions.
51 virtual void Initialize(const InitializeCallback& callback) OVERRIDE; 51 virtual void Initialize(const InitializeCallback& callback) OVERRIDE;
52 virtual void RenameAndUniquify( 52 virtual void RenameAndUniquify(
53 const FilePath& full_path, 53 const base::FilePath& full_path,
54 const RenameCompletionCallback& callback) OVERRIDE; 54 const RenameCompletionCallback& callback) OVERRIDE;
55 virtual void RenameAndAnnotate( 55 virtual void RenameAndAnnotate(
56 const FilePath& full_path, 56 const base::FilePath& full_path,
57 const RenameCompletionCallback& callback) OVERRIDE; 57 const RenameCompletionCallback& callback) OVERRIDE;
58 virtual void Detach() OVERRIDE; 58 virtual void Detach() OVERRIDE;
59 virtual void Cancel() OVERRIDE; 59 virtual void Cancel() OVERRIDE;
60 virtual FilePath FullPath() const OVERRIDE; 60 virtual base::FilePath FullPath() const OVERRIDE;
61 virtual bool InProgress() const OVERRIDE; 61 virtual bool InProgress() const OVERRIDE;
62 virtual int64 BytesSoFar() const OVERRIDE; 62 virtual int64 BytesSoFar() const OVERRIDE;
63 virtual int64 CurrentSpeed() const OVERRIDE; 63 virtual int64 CurrentSpeed() const OVERRIDE;
64 virtual bool GetHash(std::string* hash) OVERRIDE; 64 virtual bool GetHash(std::string* hash) OVERRIDE;
65 virtual std::string GetHashState() OVERRIDE; 65 virtual std::string GetHashState() OVERRIDE;
66 66
67 protected: 67 protected:
68 // For test class overrides. 68 // For test class overrides.
69 virtual DownloadInterruptReason AppendDataToFile( 69 virtual DownloadInterruptReason AppendDataToFile(
70 const char* data, size_t data_len); 70 const char* data, size_t data_len);
71 71
72 private: 72 private:
73 // Send an update on our progress. 73 // Send an update on our progress.
74 void SendUpdate(); 74 void SendUpdate();
75 75
76 // Called when there's some activity on stream_reader_ that needs to be 76 // Called when there's some activity on stream_reader_ that needs to be
77 // handled. 77 // handled.
78 void StreamActive(); 78 void StreamActive();
79 79
80 // The base file instance. 80 // The base file instance.
81 BaseFile file_; 81 BaseFile file_;
82 82
83 // The default directory for creating the download file. 83 // The default directory for creating the download file.
84 FilePath default_download_directory_; 84 base::FilePath default_download_directory_;
85 85
86 // The stream through which data comes. 86 // The stream through which data comes.
87 // TODO(rdsmith): Move this into BaseFile; requires using the same 87 // TODO(rdsmith): Move this into BaseFile; requires using the same
88 // stream semantics in SavePackage. Alternatively, replace SaveFile 88 // stream semantics in SavePackage. Alternatively, replace SaveFile
89 // with DownloadFile and get rid of BaseFile. 89 // with DownloadFile and get rid of BaseFile.
90 scoped_ptr<ByteStreamReader> stream_reader_; 90 scoped_ptr<ByteStreamReader> stream_reader_;
91 91
92 // Used to trigger progress updates. 92 // Used to trigger progress updates.
93 scoped_ptr<base::RepeatingTimer<DownloadFileImpl> > update_timer_; 93 scoped_ptr<base::RepeatingTimer<DownloadFileImpl> > update_timer_;
94 94
(...skipping 10 matching lines...) Expand all
105 105
106 // RAII handle to keep the system from sleeping while we're downloading. 106 // RAII handle to keep the system from sleeping while we're downloading.
107 scoped_ptr<PowerSaveBlocker> power_save_blocker_; 107 scoped_ptr<PowerSaveBlocker> power_save_blocker_;
108 108
109 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); 109 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl);
110 }; 110 };
111 111
112 } // namespace content 112 } // namespace content
113 113
114 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ 114 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_file_factory.cc ('k') | content/browser/download/download_file_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698