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

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

Issue 8404049: Added member data to classes to support download resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_MOCK_DOWNLOAD_FILE_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_
6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <map> 10 #include <map>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 StatisticsMap map_; 55 StatisticsMap map_;
56 }; 56 };
57 57
58 MockDownloadFile(const DownloadCreateInfo* info, 58 MockDownloadFile(const DownloadCreateInfo* info,
59 const DownloadRequestHandle& request_handle, 59 const DownloadRequestHandle& request_handle,
60 content::DownloadManager* download_manager, 60 content::DownloadManager* download_manager,
61 StatisticsRecorder* recorder); 61 StatisticsRecorder* recorder);
62 virtual ~MockDownloadFile(); 62 virtual ~MockDownloadFile();
63 63
64 // DownloadFile functions. 64 // DownloadFile functions.
65 virtual net::Error Initialize(bool calculate_hash) OVERRIDE; 65 virtual net::Error Initialize() OVERRIDE;
66 virtual net::Error AppendDataToFile(const char* data, 66 virtual net::Error AppendDataToFile(const char* data,
67 size_t data_len) OVERRIDE; 67 size_t data_len) OVERRIDE;
68 virtual net::Error Rename(const FilePath& full_path) OVERRIDE; 68 virtual net::Error Rename(const FilePath& full_path) OVERRIDE;
69 virtual void Detach() OVERRIDE; 69 virtual void Detach() OVERRIDE;
70 virtual void Cancel() OVERRIDE; 70 virtual void Cancel() OVERRIDE;
71 virtual void Finish() OVERRIDE; 71 virtual void Finish() OVERRIDE;
72 virtual void AnnotateWithSourceInformation() OVERRIDE; 72 virtual void AnnotateWithSourceInformation() OVERRIDE;
73 virtual FilePath FullPath() const OVERRIDE; 73 virtual FilePath FullPath() const OVERRIDE;
74 virtual bool InProgress() const OVERRIDE; 74 virtual bool InProgress() const OVERRIDE;
75 virtual int64 BytesSoFar() const OVERRIDE; 75 virtual int64 BytesSoFar() const OVERRIDE;
76 virtual int64 CurrentSpeed() const OVERRIDE; 76 virtual int64 CurrentSpeed() const OVERRIDE;
77 virtual bool GetSha256Hash(std::string* hash) OVERRIDE; 77 virtual bool GetHash(std::string* hash) OVERRIDE;
78 virtual std::string GetHashState() OVERRIDE;
78 virtual void CancelDownloadRequest() OVERRIDE; 79 virtual void CancelDownloadRequest() OVERRIDE;
79 virtual int Id() const OVERRIDE; 80 virtual int Id() const OVERRIDE;
80 virtual content::DownloadManager* GetDownloadManager() OVERRIDE; 81 virtual content::DownloadManager* GetDownloadManager() OVERRIDE;
81 virtual const DownloadId& GlobalId() const OVERRIDE; 82 virtual const DownloadId& GlobalId() const OVERRIDE;
82 virtual std::string DebugString() const OVERRIDE; 83 virtual std::string DebugString() const OVERRIDE;
83 84
84 // Functions relating to setting and checking expectations. 85 // Functions relating to setting and checking expectations.
85 size_t rename_count() const { return rename_count_; } 86 size_t rename_count() const { return rename_count_; }
86 void SetExpectedPath(size_t index, const FilePath& path); 87 void SetExpectedPath(size_t index, const FilePath& path);
87 88
(...skipping 20 matching lines...) Expand all
108 std::vector<FilePath> expected_rename_path_list_; 109 std::vector<FilePath> expected_rename_path_list_;
109 110
110 // A buffer to hold the data we write. 111 // A buffer to hold the data we write.
111 std::string data_; 112 std::string data_;
112 113
113 // Dummy in-progress flag. 114 // Dummy in-progress flag.
114 bool in_progress_; 115 bool in_progress_;
115 }; 116 };
116 117
117 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ 118 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_types.cc ('k') | content/browser/download/mock_download_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698