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

Side by Side Diff: download_action.h

Issue 3215006: AU: Implement exponential back off for 500 and 503 HTTP response codes. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: elaborate on the CHECK Created 10 years, 3 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
« no previous file with comments | « SConstruct ('k') | main.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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 typedef ActionTraits<DownloadAction>::InputObjectType InputObjectType; 69 typedef ActionTraits<DownloadAction>::InputObjectType InputObjectType;
70 typedef ActionTraits<DownloadAction>::OutputObjectType OutputObjectType; 70 typedef ActionTraits<DownloadAction>::OutputObjectType OutputObjectType;
71 void PerformAction(); 71 void PerformAction();
72 void TerminateProcessing(); 72 void TerminateProcessing();
73 73
74 // Testing 74 // Testing
75 void SetTestFileWriter(FileWriter* writer) { 75 void SetTestFileWriter(FileWriter* writer) {
76 writer_ = writer; 76 writer_ = writer;
77 } 77 }
78 78
79 int GetHTTPResponseCode() { return http_fetcher_->http_response_code(); }
80
79 // Debugging/logging 81 // Debugging/logging
80 static std::string StaticType() { return "DownloadAction"; } 82 static std::string StaticType() { return "DownloadAction"; }
81 std::string Type() const { return StaticType(); } 83 std::string Type() const { return StaticType(); }
82 84
83 // HttpFetcherDelegate methods (see http_fetcher.h) 85 // HttpFetcherDelegate methods (see http_fetcher.h)
84 virtual void ReceivedBytes(HttpFetcher *fetcher, 86 virtual void ReceivedBytes(HttpFetcher *fetcher,
85 const char* bytes, int length); 87 const char* bytes, int length);
86 virtual void TransferComplete(HttpFetcher *fetcher, bool successful); 88 virtual void TransferComplete(HttpFetcher *fetcher, bool successful);
87 89
88 void set_delegate(DownloadActionDelegate* delegate) { 90 void set_delegate(DownloadActionDelegate* delegate) {
(...skipping 30 matching lines...) Expand all
119 DISALLOW_COPY_AND_ASSIGN(DownloadAction); 121 DISALLOW_COPY_AND_ASSIGN(DownloadAction);
120 }; 122 };
121 123
122 // We want to be sure that we're compiled with large file support on linux, 124 // We want to be sure that we're compiled with large file support on linux,
123 // just in case we find ourselves downloading large images. 125 // just in case we find ourselves downloading large images.
124 COMPILE_ASSERT(8 == sizeof(off_t), off_t_not_64_bit); 126 COMPILE_ASSERT(8 == sizeof(off_t), off_t_not_64_bit);
125 127
126 } // namespace chromeos_update_engine 128 } // namespace chromeos_update_engine
127 129
128 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ 130 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__
OLDNEW
« no previous file with comments | « SConstruct ('k') | main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698