mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -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;
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@@ -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
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -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,26 +102,29 @@ 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)
|
||||||
// Using the system proxy resolver on Windows when "Automatically detect
|
const CefSettings& settings = _Context->settings();
|
||||||
// settings" (auto-detection) is checked under LAN Settings can hurt resource
|
if (!settings.auto_detect_proxy_settings_enabled) {
|
||||||
// loading performance because the call to WinHttpGetProxyForUrl in
|
// Using the system proxy resolver on Windows when "Automatically detect
|
||||||
// proxy_resolver_winhttp.cc will block the IO thread. This is especially
|
// settings" (auto-detection) is checked under LAN Settings can hurt
|
||||||
// true for Windows 7 where auto-detection is checked by default. To avoid
|
// resource loading performance because the call to WinHttpGetProxyForUrl in
|
||||||
// slow resource loading on Windows we only use the system proxy resolver if
|
// proxy_resolver_winhttp.cc will block the IO thread. This is especially
|
||||||
// auto-detection is unchecked.
|
// true for Windows 7 where auto-detection is checked by default. To avoid
|
||||||
WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_config = {0};
|
// slow resource loading on Windows we only use the system proxy resolver if
|
||||||
if (WinHttpGetIEProxyConfigForCurrentUser(&ie_config)) {
|
// auto-detection is unchecked.
|
||||||
if (ie_config.fAutoDetect == TRUE) {
|
WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_config = {0};
|
||||||
storage_.set_proxy_service(net::ProxyService::CreateWithoutProxyResolver(
|
if (WinHttpGetIEProxyConfigForCurrentUser(&ie_config)) {
|
||||||
new ProxyConfigServiceNull(), NULL));
|
if (ie_config.fAutoDetect == TRUE) {
|
||||||
}
|
storage_.set_proxy_service(net::ProxyService::CreateWithoutProxyResolver(
|
||||||
|
new ProxyConfigServiceNull(), NULL));
|
||||||
|
}
|
||||||
|
|
||||||
if (ie_config.lpszAutoConfigUrl)
|
if (ie_config.lpszAutoConfigUrl)
|
||||||
GlobalFree(ie_config.lpszAutoConfigUrl);
|
GlobalFree(ie_config.lpszAutoConfigUrl);
|
||||||
if (ie_config.lpszProxy)
|
if (ie_config.lpszProxy)
|
||||||
GlobalFree(ie_config.lpszProxy);
|
GlobalFree(ie_config.lpszProxy);
|
||||||
if (ie_config.lpszProxyBypass)
|
if (ie_config.lpszProxyBypass)
|
||||||
GlobalFree(ie_config.lpszProxyBypass);
|
GlobalFree(ie_config.lpszProxyBypass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif // defined(OS_WIN)
|
#endif // defined(OS_WIN)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user