session: add proxyBypassRules option to setProxy api

This commit is contained in:
deepak1556 2016-07-21 10:01:08 +05:30
parent a0c5749ac1
commit aa6d79a3d8
3 changed files with 69 additions and 1 deletions

View file

@ -133,7 +133,7 @@ struct Converter<net::ProxyConfig> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
net::ProxyConfig* out) {
std::string proxy_rules;
std::string proxy_rules, proxy_bypass_rules;
GURL pac_url;
mate::Dictionary options;
// Fallback to previous API when passed String.
@ -143,6 +143,7 @@ struct Converter<net::ProxyConfig> {
} else if (ConvertFromV8(isolate, val, &options)) {
options.Get("pacScript", &pac_url);
options.Get("proxyRules", &proxy_rules);
options.Get("proxyBypassRules", &proxy_bypass_rules);
} else {
return false;
}
@ -152,6 +153,7 @@ struct Converter<net::ProxyConfig> {
out->set_pac_url(pac_url);
} else {
out->proxy_rules().ParseFromString(proxy_rules);
out->proxy_rules().bypass_rules.ParseFromString(proxy_bypass_rules);
}
return true;
}