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

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: address mnaganov's nit 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
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..18f878312ad02e3a2a3c30775769df49b737a860 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,22 @@ 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_) {
+ 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) {
eroman 2014/11/21 01:55:15 Something like "exclude_pac_url" seems like it wou
sgurun-gerrit only 2014/11/21 02:13:37 Acknowledged. I actually think that we are relyin
+ use_local_proxy_ = enabled;
+ }
+
private:
friend class base::RefCountedThreadSafe<Delegate>;
@@ -344,6 +354,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 +377,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);
}
« net/proxy/proxy_config_service_android.h ('K') | « 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