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

Side by Side Diff: download_action.h

Issue 4131005: AU: Push seeks in http fetching to the progress percentage. (Closed) Base URL: http://git.chromium.org/git/update_engine.git
Patch Set: fix for review Created 10 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 | « no previous file | download_action.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) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS 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 CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__
7 7
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 #include <fcntl.h> 10 #include <fcntl.h>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 int GetHTTPResponseCode() { return http_fetcher_->http_response_code(); } 80 int GetHTTPResponseCode() { return http_fetcher_->http_response_code(); }
81 81
82 // Debugging/logging 82 // Debugging/logging
83 static std::string StaticType() { return "DownloadAction"; } 83 static std::string StaticType() { return "DownloadAction"; }
84 std::string Type() const { return StaticType(); } 84 std::string Type() const { return StaticType(); }
85 85
86 // HttpFetcherDelegate methods (see http_fetcher.h) 86 // HttpFetcherDelegate methods (see http_fetcher.h)
87 virtual void ReceivedBytes(HttpFetcher *fetcher, 87 virtual void ReceivedBytes(HttpFetcher *fetcher,
88 const char* bytes, int length); 88 const char* bytes, int length);
89 virtual void SeekToOffset(off_t offset);
89 virtual void TransferComplete(HttpFetcher *fetcher, bool successful); 90 virtual void TransferComplete(HttpFetcher *fetcher, bool successful);
90 91
91 DownloadActionDelegate* delegate() const { return delegate_; } 92 DownloadActionDelegate* delegate() const { return delegate_; }
92 void set_delegate(DownloadActionDelegate* delegate) { 93 void set_delegate(DownloadActionDelegate* delegate) {
93 delegate_ = delegate; 94 delegate_ = delegate;
94 } 95 }
95 96
96 HttpFetcher* http_fetcher() { return http_fetcher_.get(); } 97 HttpFetcher* http_fetcher() { return http_fetcher_.get(); }
97 98
98 private: 99 private:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 DISALLOW_COPY_AND_ASSIGN(DownloadAction); 131 DISALLOW_COPY_AND_ASSIGN(DownloadAction);
131 }; 132 };
132 133
133 // We want to be sure that we're compiled with large file support on linux, 134 // We want to be sure that we're compiled with large file support on linux,
134 // just in case we find ourselves downloading large images. 135 // just in case we find ourselves downloading large images.
135 COMPILE_ASSERT(8 == sizeof(off_t), off_t_not_64_bit); 136 COMPILE_ASSERT(8 == sizeof(off_t), off_t_not_64_bit);
136 137
137 } // namespace chromeos_update_engine 138 } // namespace chromeos_update_engine
138 139
139 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ 140 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__
OLDNEW
« no previous file with comments | « no previous file | download_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698