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

Side by Side Diff: src/platform/update_engine/http_fetcher.h

Issue 466036: AU: Beginnings of delta support (Closed)
Patch Set: Created 11 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
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 UPDATE_ENGINE_HTTP_FETCHER_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_HTTP_FETCHER_H__
6 #define 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 <glib.h> 10 #include <glib.h>
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 12
12 // This class is a simple wrapper around an HTTP library (libcurl). We can 13 // This class is a simple wrapper around an HTTP library (libcurl). We can
13 // easily mock out this interface for testing. 14 // easily mock out this interface for testing.
14 15
15 // Implementations of this class should use asynchronous i/o. They can access 16 // Implementations of this class should use asynchronous i/o. They can access
16 // the glib main loop to request callbacks when timers or file descriptors 17 // the glib main loop to request callbacks when timers or file descriptors
17 // change. 18 // change.
18 19
19 namespace chromeos_update_engine { 20 namespace chromeos_update_engine {
20 21
21 class HttpFetcherDelegate; 22 class HttpFetcherDelegate;
22 23
23 class HttpFetcher { 24 class HttpFetcher {
24 public: 25 public:
25 HttpFetcher() : delegate_(NULL) {} 26 HttpFetcher() : post_data_set_(false), delegate_(NULL) {}
26 virtual ~HttpFetcher() {} 27 virtual ~HttpFetcher() {}
27 void set_delegate(HttpFetcherDelegate* delegate) { 28 void set_delegate(HttpFetcherDelegate* delegate) {
28 delegate_ = delegate; 29 delegate_ = delegate;
29 } 30 }
30 HttpFetcherDelegate* delegate() const { 31 HttpFetcherDelegate* delegate() const {
31 return delegate_; 32 return delegate_;
32 } 33 }
33 34
34 // Optional: Post data to the server. The HttpFetcher should make a copy 35 // Optional: Post data to the server. The HttpFetcher should make a copy
35 // of this data and upload it via HTTP POST during the transfer. 36 // of this data and upload it via HTTP POST during the transfer.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 const char* bytes, 81 const char* bytes,
81 int length) = 0; 82 int length) = 0;
82 83
83 // Called when the transfer has completed successfully or been somehow 84 // Called when the transfer has completed successfully or been somehow
84 // aborted. 85 // aborted.
85 virtual void TransferComplete(HttpFetcher* fetcher, bool successful) = 0; 86 virtual void TransferComplete(HttpFetcher* fetcher, bool successful) = 0;
86 }; 87 };
87 88
88 } // namespace chromeos_update_engine 89 } // namespace chromeos_update_engine
89 90
90 #endif // UPDATE_ENGINE_HTTP_FETCHER_H__ 91 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_HTTP_FETCHER_H__
OLDNEW
« no previous file with comments | « src/platform/update_engine/gen_coverage_html.sh ('k') | src/platform/update_engine/http_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698