Add CefSettings.auto_detect_proxy_settings_enabled option for enabling automatic proxy detection on Windows (issue #332).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@337 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-10-21 21:14:50 +00:00
parent c422ab5aa8
commit becadcfd16
3 changed files with 39 additions and 19 deletions

View File

@@ -151,6 +151,15 @@ typedef struct _cef_settings_t
// Quota limit for sessionStorage data per namespace. Default size is 5MB. // Quota limit for sessionStorage data per namespace. Default size is 5MB.
/// ///
unsigned int session_storage_quota; unsigned int session_storage_quota;
#if defined(OS_WIN)
///
// Set to true (1) to use the system proxy resolver on Windows when
// "Automatically detect settings" is checked. This setting is disabled
// by default for performance reasons.
///
bool auto_detect_proxy_settings_enabled;
#endif
} cef_settings_t; } cef_settings_t;
/// ///

View File

@@ -281,6 +281,13 @@ struct CefSettingsTraits {
copy); copy);
target->log_severity = src->log_severity; target->log_severity = src->log_severity;
target->graphics_implementation = src->graphics_implementation; target->graphics_implementation = src->graphics_implementation;
target->local_storage_quota = src->local_storage_quota;
target->session_storage_quota = src->session_storage_quota;
#if defined(OS_WIN)
target->auto_detect_proxy_settings_enabled =
src->auto_detect_proxy_settings_enabled;
#endif
} }
}; };

View File

@@ -7,6 +7,7 @@
#include "browser_file_system.h" #include "browser_file_system.h"
#include "browser_persistent_cookie_store.h" #include "browser_persistent_cookie_store.h"
#include "browser_resource_loader_bridge.h" #include "browser_resource_loader_bridge.h"
#include "cef_context.h"
#include "cef_thread.h" #include "cef_thread.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
@@ -101,9 +102,11 @@ void BrowserRequestContext::Init(
set_accept_charset("iso-8859-1,*,utf-8"); set_accept_charset("iso-8859-1,*,utf-8");
#if defined(OS_WIN) #if defined(OS_WIN)
const CefSettings& settings = _Context->settings();
if (!settings.auto_detect_proxy_settings_enabled) {
// Using the system proxy resolver on Windows when "Automatically detect // Using the system proxy resolver on Windows when "Automatically detect
// settings" (auto-detection) is checked under LAN Settings can hurt resource // settings" (auto-detection) is checked under LAN Settings can hurt
// loading performance because the call to WinHttpGetProxyForUrl in // resource loading performance because the call to WinHttpGetProxyForUrl in
// proxy_resolver_winhttp.cc will block the IO thread. This is especially // proxy_resolver_winhttp.cc will block the IO thread. This is especially
// true for Windows 7 where auto-detection is checked by default. To avoid // true for Windows 7 where auto-detection is checked by default. To avoid
// slow resource loading on Windows we only use the system proxy resolver if // slow resource loading on Windows we only use the system proxy resolver if
@@ -122,6 +125,7 @@ void BrowserRequestContext::Init(
if (ie_config.lpszProxyBypass) if (ie_config.lpszProxyBypass)
GlobalFree(ie_config.lpszProxyBypass); GlobalFree(ie_config.lpszProxyBypass);
} }
}
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
if (!proxy_service()) { if (!proxy_service()) {