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

Unified Diff: chrome_proxy_resolver.h

Issue 5151005: AU: Proxy Resolver classes (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: tests 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
Index: chrome_proxy_resolver.h
diff --git a/chrome_proxy_resolver.h b/chrome_proxy_resolver.h
new file mode 100644
index 0000000000000000000000000000000000000000..11b5f012a5719ff2255e12c5be3fe05d1294b153
--- /dev/null
+++ b/chrome_proxy_resolver.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
petkov 2010/11/18 23:26:46 Chromium OS Authors
adlr 2010/11/19 00:41:06 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_CHROME_PROXY_RESOLVER_H__
+#define CHROMEOS_PLATFORM_UPDATE_ENGINE_CHROME_PROXY_RESOLVER_H__
+
+#include <string>
+#include <vector>
+
+#include <curl/curl.h>
+
petkov 2010/11/18 23:26:46 remove blank line
adlr 2010/11/19 00:41:06 Done.
+#include "gtest/gtest_prod.h" // for FRIEND_TEST
petkov 2010/11/18 23:26:46 <gtest/gtest_prod.h>
adlr 2010/11/19 00:41:06 Done.
+
+#include "update_engine/dbus_interface.h"
+#include "update_engine/proxy_resolver.h"
+
+namespace chromeos_update_engine {
+
+extern const char kSessionManagerService[];
+extern const char kSessionManagerPath[];
+extern const char kSessionManagerInterface[];
+extern const char kSessionManagerRetreivePropertyMethod[];
petkov 2010/11/18 23:26:46 typo: Retrieve
adlr 2010/11/19 00:41:06 Done.
+extern const char kSessionManagerProxySettingsKey[];
+
+// Class to resolve proxy for a url based on Chrome's proxy settings.
+
+// Currently only supports manual settings, not PAC files or autodetected
+// settings.
+
+class ChromeProxyResolver : public ProxyResolver {
+ public:
+ explicit ChromeProxyResolver(DbusGlibInterface* dbus) : dbus_(dbus) {}
+ virtual ~ChromeProxyResolver() {}
+
+ virtual bool ProxyForUrl(const std::string& url,
+ std::vector<std::string>* out_proxies);
+
+ // Get the curl proxy type for a given proxy url. Returns true on success.
+ // Note: if proxy is kNoProxy, this will return false.
+ static bool ProxyTypeForProxy(const std::string& proxy,
petkov 2010/11/18 23:26:46 GetProxyTypeForProxy
adlr 2010/11/19 00:41:06 Done.
+ curl_proxytype* out_type);
+
+ private:
+ FRIEND_TEST(ChromeProxyResolverTest, ProxyForUrlWithSettingsTest);
petkov 2010/11/18 23:26:46 add an empty line after
adlr 2010/11/19 00:41:06 Done.
+ // Fetches a dbus proxy to session manager. Returns true on success.
+ bool DbusProxy(DBusGProxy** out_proxy);
petkov 2010/11/18 23:26:46 Maybe simplify the prototype to: DBusGProxy* GetD
adlr 2010/11/19 00:41:06 Done.
+
+ // Fetches the json-encoded proxy settings string from the session manager.
+ bool JsonProxySettings(DBusGProxy* proxy, std::string* out_json);
petkov 2010/11/18 23:26:46 GetJsonProxySettings
adlr 2010/11/19 00:41:06 Done.
+
+ // Given a |url| and the json encoded settings |json_settings|,
+ // returns the proper proxy server.
petkov 2010/11/18 23:26:46 It returns a list of servers, right?
adlr 2010/11/19 00:41:06 yes, fixed.
+ bool ProxyForUrlWithSettings(const std::string& url,
petkov 2010/11/18 23:26:46 GetProxyForURLWithSettings?
adlr 2010/11/19 00:41:06 GetProxiesForUrlWithSettings
+ const std::string& json_settings,
+ std::vector<std::string>* out_proxies);
+
+ DbusGlibInterface* dbus_;
+};
petkov 2010/11/18 23:26:46 DISALLOW_COPY_AND_ASSIGN?
adlr 2010/11/19 00:41:06 Done.
+
+} // namespace chromeos_update_engine
+
+#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_CHROME_PROXY_RESOLVER_H__
« no previous file with comments | « SConstruct ('k') | chrome_proxy_resolver.cc » ('j') | chrome_proxy_resolver.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698