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

Unified Diff: update_attempter.h

Issue 5205002: AU: Manual proxy support (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: missed one 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « proxy_resolver.cc ('k') | update_attempter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_attempter.h
diff --git a/update_attempter.h b/update_attempter.h
index 3a4ff49960b1b2bbc98a007b2b50d7e2fc4caa3a..ba0bd941c43133ab605069125c983961cca8df22 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -16,9 +16,11 @@
#include <gtest/gtest_prod.h> // for FRIEND_TEST
#include "update_engine/action_processor.h"
+#include "update_engine/chrome_proxy_resolver.h"
#include "update_engine/download_action.h"
#include "update_engine/omaha_request_params.h"
#include "update_engine/omaha_response_handler_action.h"
+#include "update_engine/proxy_resolver.h"
class MetricsLibraryInterface;
struct UpdateEngineService;
@@ -47,14 +49,19 @@ class UpdateAttempter : public ActionProcessorDelegate,
public:
static const int kMaxDeltaUpdateFailures;
- UpdateAttempter(PrefsInterface* prefs, MetricsLibraryInterface* metrics_lib);
+ UpdateAttempter(PrefsInterface* prefs,
+ MetricsLibraryInterface* metrics_lib,
+ DbusGlibInterface* dbus_iface);
virtual ~UpdateAttempter();
// Checks for update and, if a newer version is available, attempts
// to update the system. Non-empty |in_app_version| or
// |in_update_url| prevents automatic detection of the parameter.
+ // If |obey_proxies| is true, the update will likely respect Chrome's
+ // proxy setting. For security reasons, we may still not honor them.
virtual void Update(const std::string& app_version,
- const std::string& omaha_url);
+ const std::string& omaha_url,
+ bool obey_proxies);
// ActionProcessorDelegate methods:
void ProcessingDone(const ActionProcessor* processor, ActionExitCode code);
@@ -153,6 +160,12 @@ class UpdateAttempter : public ActionProcessorDelegate,
// If this was a delta update attempt that failed, count it so that a full
// update can be tried when needed.
void MarkDeltaUpdateFailure();
+
+ ProxyResolver* GetProxyResolver() {
+ return obeying_proxies_ ?
+ reinterpret_cast<ProxyResolver*>(&chrome_proxy_resolver_) :
+ reinterpret_cast<ProxyResolver*>(&direct_proxy_resolver_);
+ }
// Last status notification timestamp used for throttling. Use monotonic
// TimeTicks to ensure that notifications are sent even if the system clock is
@@ -208,6 +221,17 @@ class UpdateAttempter : public ActionProcessorDelegate,
// Device paramaters common to all Omaha requests.
OmahaRequestDeviceParams omaha_request_params_;
+ // Number of consecutive manual update checks we've had where we obeyed
+ // Chrome's proxy settings.
+ int proxy_manual_checks_;
+
+ // If true, this update cycle we are obeying proxies
+ bool obeying_proxies_;
+
+ // Our two proxy resolvers
+ DirectProxyResolver direct_proxy_resolver_;
+ ChromeProxyResolver chrome_proxy_resolver_;
+
DISALLOW_COPY_AND_ASSIGN(UpdateAttempter);
};
« no previous file with comments | « proxy_resolver.cc ('k') | update_attempter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698