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

Unified Diff: net/proxy/proxy_resolver_v8.cc

Issue 149525: Remove the concept of threading from ProxyService, and move it into the Proxy... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Add missing header for mac Created 11 years, 5 months 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_resolver_v8.h ('k') | net/proxy/proxy_resolver_v8_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_v8.cc
===================================================================
--- net/proxy/proxy_resolver_v8.cc (revision 21630)
+++ net/proxy/proxy_resolver_v8.cc (working copy)
@@ -344,16 +344,19 @@
ProxyResolverV8::ProxyResolverV8(
ProxyResolverV8::JSBindings* custom_js_bindings)
- : ProxyResolver(false), js_bindings_(custom_js_bindings) {
+ : ProxyResolver(true /*expects_pac_bytes*/),
+ js_bindings_(custom_js_bindings) {
}
ProxyResolverV8::~ProxyResolverV8() {}
int ProxyResolverV8::GetProxyForURL(const GURL& query_url,
- const GURL& /*pac_url*/,
- ProxyInfo* results) {
- // If the V8 instance has not been initialized (either because SetPacScript()
- // wasn't called yet, or because it was called with empty string).
+ ProxyInfo* results,
+ CompletionCallback* /*callback*/,
+ RequestHandle* /*request*/) {
+ // If the V8 instance has not been initialized (either because
+ // SetPacScriptByData() wasn't called yet, or because it was called with
+ // empty string).
if (!context_.get())
return ERR_FAILED;
@@ -361,10 +364,9 @@
return context_->ResolveProxy(query_url, results);
}
-void ProxyResolverV8::SetPacScript(const std::string& data) {
- context_.reset();
- if (!data.empty())
- context_.reset(new Context(js_bindings_.get(), data));
+void ProxyResolverV8::CancelRequest(RequestHandle request) {
+ // This is a synchronous ProxyResolver; no possibility for async requests.
+ NOTREACHED();
}
// static
@@ -373,4 +375,10 @@
return new DefaultJSBindings(host_resolver, host_resolver_loop);
}
+void ProxyResolverV8::SetPacScriptByDataInternal(const std::string& data) {
+ context_.reset();
+ if (!data.empty())
+ context_.reset(new Context(js_bindings_.get(), data));
+}
+
} // namespace net
« no previous file with comments | « net/proxy/proxy_resolver_v8.h ('k') | net/proxy/proxy_resolver_v8_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698