Index: chromecast/browser/cast_browser_process.cc |
diff --git a/chromecast/browser/cast_browser_process.cc b/chromecast/browser/cast_browser_process.cc |
index cf7101aab315a05cd2c52005d003c15de9ff24af..4775cf2181c03c76e2676d40aa1e32c9311ba72a 100644 |
--- a/chromecast/browser/cast_browser_process.cc |
+++ b/chromecast/browser/cast_browser_process.cc |
@@ -4,8 +4,10 @@ |
#include "chromecast/browser/cast_browser_process.h" |
+#include <string> |
#include <utility> |
+#include "base/command_line.h" |
#include "base/logging.h" |
#include "build/build_config.h" |
#include "chromecast/base/metrics/cast_metrics_helper.h" |
@@ -16,6 +18,7 @@ |
#include "chromecast/net/connectivity_checker.h" |
#include "chromecast/service/cast_service.h" |
#include "components/prefs/pref_service.h" |
+#include "net/proxy/proxy_config.h" |
#if defined(OS_ANDROID) |
#include "components/crash/content/browser/crash_dump_manager_android.h" |
@@ -42,6 +45,7 @@ CastBrowserProcess::CastBrowserProcess() |
: cast_content_browser_client_(nullptr), |
net_log_(nullptr) { |
DCHECK(!g_instance); |
+ |
g_instance = this; |
} |
@@ -94,6 +98,17 @@ void CastBrowserProcess::SetPrefService( |
std::unique_ptr<PrefService> pref_service) { |
DCHECK(!pref_service_); |
pref_service_.swap(pref_service); |
+ std::string proxy_server = pref_service_->GetString("proxy-server"); |
almasrymina
2017/01/25 02:52:56
the string constants are defined in chromecast/int
almasrymina
2017/01/25 02:52:56
I'm not too sure about this part. Essentially I us
wzhong
2017/01/25 03:03:45
In ChromecastSevice, you might load preference and
|
+ |
+ std::string proxy_bypass = pref_service_->GetString("proxy-bypass-list"); |
+ |
+ LOG(INFO) << "Setting proxy-server: " << proxy_server; |
+ LOG(INFO) << "Setting proxy-bypass-list: " << proxy_bypass; |
+ |
+ proxy_config_.reset(new net::ProxyConfig()); |
+ |
+ proxy_config_->proxy_rules().ParseFromString(proxy_server); |
+ proxy_config_->proxy_rules().bypass_rules.ParseFromString(proxy_bypass); |
} |
void CastBrowserProcess::SetRemoteDebuggingServer( |
@@ -122,6 +137,11 @@ void CastBrowserProcess::SetConnectivityChecker( |
connectivity_checker_.swap(connectivity_checker); |
} |
+net::ProxyConfig* CastBrowserProcess::proxy_config() { |
+ DCHECK(proxy_config_->is_valid()); |
+ return proxy_config_.get(); |
+} |
+ |
void CastBrowserProcess::SetNetLog(net::NetLog* net_log) { |
DCHECK(!net_log_); |
net_log_ = net_log; |