xxfxxf / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 0 forks source link

Add an interface to allow consumers to resolve proxy information #389

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If the system is setup to use a proxy autoconfig script, the net library uses a 
proxy resolver to obtain proxy information.  CEF uses a WinHTTP-based proxy 
resolver under most circumstances (no proxy resolver under others.)  This 
differs from Chrome which uses a v8-based proxy resolver under most 
circumstances.

Because of some limitations with WinHTTP and knowing the v8 resolver isn't 
feasible in a single-process architecture, I've added an interface that allows 
the consumer to handle proxy resolution.  This gives me the flexibilty to use a 
thridparty library that works for my needs.

I've added a CefProxyHandler interface.  Anytime the system needs to resolve 
proxy info, it will call CefProxyHandler::GetProxyForUrl.  Most of the code in 
the diff is boiler plate; see cef.h and browser_request_context.cc for the core 
changes.

The resolver is needed to construct a BrowserRequestContext when setting up the 
IO thread.  If you can think of a way to pass this information in without 
having to touch CefInitialize, I'm all ears.  Please let me know if there is 
anything else I should take into consideration.  Thanks!

Original issue reported on code.google.com by mikeyk...@gmail.com on 25 Oct 2011 at 8:44

Attachments:

GoogleCodeExporter commented 9 years ago
The idea of being able to provide a custom proxy resolver is fine. I think a 
more generic solution for handlers that need to be provided at CefInitialize() 
time would be better. For example, we could create a CefApp interface modeled 
on CefClient that gets passed to CefInitialize() and provides handlers for 
things like proxy resolution.

Original comment by magreenb...@gmail.com on 31 Oct 2011 at 6:08

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 31 Oct 2011 at 6:10

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 23 Nov 2011 at 7:11

GoogleCodeExporter commented 9 years ago
Thanks for the patch. Revision 394 adds a new CefProxyHandler interface to 
allow applications to resolve proxy information.

We may want to support asynchronous continuation of proxy resolution at some 
point in the future.

Original comment by magreenb...@gmail.com on 23 Nov 2011 at 10:50