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

Side by Side Diff: http_fetcher.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 | « download_action_unittest.cc ('k') | mock_http_fetcher.h » ('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_HTTP_FETCHER_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_HTTP_FETCHER_H__
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_HTTP_FETCHER_H__ 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_HTTP_FETCHER_H__
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <glib.h> 10 #include <glib.h>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 // The delegate; may be NULL. 83 // The delegate; may be NULL.
84 HttpFetcherDelegate* delegate_; 84 HttpFetcherDelegate* delegate_;
85 private: 85 private:
86 DISALLOW_COPY_AND_ASSIGN(HttpFetcher); 86 DISALLOW_COPY_AND_ASSIGN(HttpFetcher);
87 }; 87 };
88 88
89 // Interface for delegates 89 // Interface for delegates
90 class HttpFetcherDelegate { 90 class HttpFetcherDelegate {
91 public: 91 public:
92 // Called every time bytes are received, even if they are automatically 92 // Called every time bytes are received.
93 // delivered to an output file.
94 virtual void ReceivedBytes(HttpFetcher* fetcher, 93 virtual void ReceivedBytes(HttpFetcher* fetcher,
95 const char* bytes, 94 const char* bytes,
96 int length) = 0; 95 int length) = 0;
97 96
97 // Called if the fetcher seeks to a particular offset.
98 virtual void SeekToOffset(off_t offset) {}
99
98 // Called when the transfer has completed successfully or been somehow 100 // Called when the transfer has completed successfully or been somehow
99 // aborted. 101 // aborted.
100 virtual void TransferComplete(HttpFetcher* fetcher, bool successful) = 0; 102 virtual void TransferComplete(HttpFetcher* fetcher, bool successful) = 0;
101 }; 103 };
102 104
103 } // namespace chromeos_update_engine 105 } // namespace chromeos_update_engine
104 106
105 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_HTTP_FETCHER_H__ 107 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_HTTP_FETCHER_H__
OLDNEW
« no previous file with comments | « download_action_unittest.cc ('k') | mock_http_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698