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

Unified Diff: libcurl_http_fetcher.h

Issue 4004004: AU: Restrict to HTTPS for official builds. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « http_fetcher_unittest.cc ('k') | libcurl_http_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libcurl_http_fetcher.h
diff --git a/libcurl_http_fetcher.h b/libcurl_http_fetcher.h
index 2628eccc23669d6d39989d8f47f2bb385b9eb714..25c4e4975a9595aaa40abd719b349edeee7cda65 100644
--- a/libcurl_http_fetcher.h
+++ b/libcurl_http_fetcher.h
@@ -35,6 +35,8 @@ class LibcurlHttpFetcher : public HttpFetcher {
idle_seconds_(1),
force_connection_type_(false),
forced_expensive_connection_(false),
+ force_build_type_(false),
+ forced_official_build_(false),
in_write_callback_(false),
terminate_requested_(false) {}
@@ -69,12 +71,17 @@ class LibcurlHttpFetcher : public HttpFetcher {
// Sets the retry timeout. Useful for testing.
void set_retry_seconds(int seconds) { retry_seconds_ = seconds; }
-
+
void SetConnectionAsExpensive(bool is_expensive) {
force_connection_type_ = true;
forced_expensive_connection_ = is_expensive;
}
+ void SetBuildType(bool is_official) {
+ force_build_type_ = true;
+ forced_official_build_ = is_official;
+ }
+
private:
// Asks libcurl for the http response code and stores it in the object.
void GetHttpResponseCode();
@@ -133,6 +140,9 @@ class LibcurlHttpFetcher : public HttpFetcher {
// expensive.
bool ConnectionIsExpensive() const;
+ // Returns whether or not the current build is official.
+ bool IsOfficialBuild() const;
+
// Handles for the libcurl library
CURLM *curl_multi_handle_;
CURL *curl_handle_;
@@ -168,15 +178,20 @@ class LibcurlHttpFetcher : public HttpFetcher {
// Seconds to wait before asking libcurl to "perform".
int idle_seconds_;
-
+
// If true, assume the network is expensive or not, according to
// forced_expensive_connection_. (Useful for testing).
bool force_connection_type_;
bool forced_expensive_connection_;
+ // If true, assume the build is official or not, according to
+ // forced_official_build_. Useful for testing.
+ bool force_build_type_;
+ bool forced_official_build_;
+
// If true, we are currently performing a write callback on the delegate.
bool in_write_callback_;
-
+
// We can't clean everything up while we're in a write callback, so
// if we get a terminate request, queue it until we can handle it.
bool terminate_requested_;
« no previous file with comments | « http_fetcher_unittest.cc ('k') | libcurl_http_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698