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

Unified Diff: net/proxy/proxy_config_service_android.cc

Issue 742023003: Enable using system proxy resolver for android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 6 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 | « net/proxy/proxy_config_service_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config_service_android.cc
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc
index f1a0b6cca54f702b924b969ba320d691b61b1108..aa94dcb5cc23ea7b9452d1b1bcde6f990f144c6e 100644
--- a/net/proxy/proxy_config_service_android.cc
+++ b/net/proxy/proxy_config_service_android.cc
@@ -197,7 +197,8 @@ class ProxyConfigServiceAndroid::Delegate
: jni_delegate_(this),
network_task_runner_(network_task_runner),
jni_task_runner_(jni_task_runner),
- get_property_callback_(get_property_callback) {
+ get_property_callback_(get_property_callback),
+ use_local_proxy_(false) {
}
void SetupJNI() {
@@ -271,13 +272,21 @@ class ProxyConfigServiceAndroid::Delegate
const std::vector<std::string>& exclusion_list) {
DCHECK(OnJNIThread());
ProxyConfig proxy_config;
- CreateStaticProxyConfig(host, port, pac_url, exclusion_list, &proxy_config);
+ if (use_local_proxy_)
mnaganov (inactive) 2014/11/20 21:58:35 nit: I think this "if" statement deserves braces f
sgurun-gerrit only 2014/11/20 23:38:19 Done.
+ CreateStaticProxyConfig(host, port, "", exclusion_list, &proxy_config);
+ else
+ CreateStaticProxyConfig(host, port, pac_url, exclusion_list,
+ &proxy_config);
network_task_runner_->PostTask(
FROM_HERE,
base::Bind(
&Delegate::SetNewConfigOnNetworkThread, this, proxy_config));
}
+ void set_use_local_proxy(bool enabled) {
+ use_local_proxy_ = enabled;
+ }
+
private:
friend class base::RefCountedThreadSafe<Delegate>;
@@ -344,6 +353,7 @@ class ProxyConfigServiceAndroid::Delegate
scoped_refptr<base::SequencedTaskRunner> jni_task_runner_;
GetPropertyCallback get_property_callback_;
ProxyConfig proxy_config_;
+ bool use_local_proxy_;
DISALLOW_COPY_AND_ASSIGN(Delegate);
};
@@ -366,6 +376,10 @@ bool ProxyConfigServiceAndroid::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
}
+void ProxyConfigServiceAndroid::set_use_local_proxy(bool enabled) {
+ delegate_->set_use_local_proxy(enabled);
+}
+
void ProxyConfigServiceAndroid::AddObserver(Observer* observer) {
delegate_->AddObserver(observer);
}
« no previous file with comments | « net/proxy/proxy_config_service_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698