| OLD | NEW |
| 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_LIBCURL_HTTP_FETCHER_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_LIBCURL_HTTP_FETCHER_H__ |
| 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_LIBCURL_HTTP_FETCHER_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_LIBCURL_HTTP_FETCHER_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <curl/curl.h> | 10 #include <curl/curl.h> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 force_connection_type_ = true; | 84 force_connection_type_ = true; |
| 85 forced_expensive_connection_ = is_expensive; | 85 forced_expensive_connection_ = is_expensive; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void SetBuildType(bool is_official) { | 88 void SetBuildType(bool is_official) { |
| 89 force_build_type_ = true; | 89 force_build_type_ = true; |
| 90 forced_official_build_ = is_official; | 90 forced_official_build_ = is_official; |
| 91 } | 91 } |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 // Callback for when proxy resolution has completed. This begins the |
| 95 // transfer. |
| 96 void ProxiesResolved(); |
| 97 |
| 94 // Asks libcurl for the http response code and stores it in the object. | 98 // Asks libcurl for the http response code and stores it in the object. |
| 95 void GetHttpResponseCode(); | 99 void GetHttpResponseCode(); |
| 96 | 100 |
| 97 // Resumes a transfer where it left off. This will use the | 101 // Resumes a transfer where it left off. This will use the |
| 98 // HTTP Range: header to make a new connection from where the last | 102 // HTTP Range: header to make a new connection from where the last |
| 99 // left off. | 103 // left off. |
| 100 virtual void ResumeTransfer(const std::string& url); | 104 virtual void ResumeTransfer(const std::string& url); |
| 101 | 105 |
| 102 // These two methods are for glib main loop callbacks. They are called | 106 // These two methods are for glib main loop callbacks. They are called |
| 103 // when either a file descriptor is ready for work or when a timer | 107 // when either a file descriptor is ready for work or when a timer |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // We can't clean everything up while we're in a write callback, so | 222 // We can't clean everything up while we're in a write callback, so |
| 219 // if we get a terminate request, queue it until we can handle it. | 223 // if we get a terminate request, queue it until we can handle it. |
| 220 bool terminate_requested_; | 224 bool terminate_requested_; |
| 221 | 225 |
| 222 DISALLOW_COPY_AND_ASSIGN(LibcurlHttpFetcher); | 226 DISALLOW_COPY_AND_ASSIGN(LibcurlHttpFetcher); |
| 223 }; | 227 }; |
| 224 | 228 |
| 225 } // namespace chromeos_update_engine | 229 } // namespace chromeos_update_engine |
| 226 | 230 |
| 227 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_LIBCURL_HTTP_FETCHER_H__ | 231 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_LIBCURL_HTTP_FETCHER_H__ |
| OLD | NEW |