Introduce chrome proxy implementation based on command-line flags (issue #600).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1080 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-02-06 20:41:54 +00:00
parent bccce6258f
commit 81d27df883
36 changed files with 165 additions and 672 deletions

View File

@@ -56,14 +56,6 @@ typedef struct _cef_browser_process_handler_t {
///
cef_base_t base;
///
// Return the handler for proxy events. If no handler is returned the default
// system handler will be used. This function is called on the browser process
// IO thread.
///
struct _cef_proxy_handler_t* (CEF_CALLBACK *get_proxy_handler)(
struct _cef_browser_process_handler_t* self);
///
// Called on the browser process UI thread immediately after the CEF context
// has been initialized.

View File

@@ -1,69 +0,0 @@
// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
///
// Implement this structure to handle proxy resolution events.
///
typedef struct _cef_proxy_handler_t {
///
// Base structure.
///
cef_base_t base;
///
// Called to retrieve proxy information for the specified |url|.
///
void (CEF_CALLBACK *get_proxy_for_url)(struct _cef_proxy_handler_t* self,
const cef_string_t* url, struct _cef_proxy_info_t* proxy_info);
} cef_proxy_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_

View File

@@ -40,7 +40,6 @@
#include "include/cef_base.h"
#include "include/cef_command_line.h"
#include "include/cef_proxy_handler.h"
#include "include/cef_values.h"
///
@@ -50,16 +49,6 @@
/*--cef(source=client)--*/
class CefBrowserProcessHandler : public virtual CefBase {
public:
///
// Return the handler for proxy events. If no handler is returned the default
// system handler will be used. This method is called on the browser process
// IO thread.
///
/*--cef()--*/
virtual CefRefPtr<CefProxyHandler> GetProxyHandler() {
return NULL;
}
///
// Called on the browser process UI thread immediately after the CEF context
// has been initialized.

View File

@@ -1,57 +0,0 @@
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// The contents of this file must follow a specific format in order to
// support the CEF translator tool. See the translator.README.txt file in the
// tools directory for more information.
//
#ifndef CEF_INCLUDE_CEF_PROXY_HANDLER_H_
#define CEF_INCLUDE_CEF_PROXY_HANDLER_H_
#pragma once
#include "include/cef_base.h"
///
// Implement this interface to handle proxy resolution events.
///
/*--cef(source=client)--*/
class CefProxyHandler : public virtual CefBase {
public:
///
// Called to retrieve proxy information for the specified |url|.
///
/*--cef()--*/
virtual void GetProxyForUrl(const CefString& url,
CefProxyInfo& proxy_info) {}
};
#endif // CEF_INCLUDE_CEF_PROXY_HANDLER_H_

View File

@@ -220,13 +220,6 @@ typedef struct _cef_settings_t {
///
cef_string_t javascript_flags;
///
// 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;
///
// The fully qualified path for the resources directory. If this value is
// empty the cef.pak and/or devtools_resources.pak files must be located in
@@ -1277,23 +1270,6 @@ typedef struct _cef_popup_features_t {
cef_string_list_t additionalFeatures;
} cef_popup_features_t;
///
// Proxy types.
///
enum cef_proxy_type_t {
CEF_PROXY_TYPE_DIRECT = 0,
CEF_PROXY_TYPE_NAMED,
CEF_PROXY_TYPE_PAC_STRING,
};
///
// Proxy information.
///
typedef struct _cef_proxy_info_t {
enum cef_proxy_type_t proxyType;
cef_string_t proxyList;
} cef_proxy_info_t;
///
// DOM document types.
///

View File

@@ -311,9 +311,6 @@ struct CefSettingsTraits {
cef_string_set(src->javascript_flags.str, src->javascript_flags.length,
&target->javascript_flags, copy);
target->auto_detect_proxy_settings_enabled =
src->auto_detect_proxy_settings_enabled;
cef_string_set(src->resources_dir_path.str, src->resources_dir_path.length,
&target->resources_dir_path, copy);
cef_string_set(src->locales_dir_path.str, src->locales_dir_path.length,
@@ -561,65 +558,6 @@ struct CefCookieTraits {
typedef CefStructBase<CefCookieTraits> CefCookie;
struct CefProxyInfoTraits {
typedef cef_proxy_info_t struct_type;
static inline void init(struct_type* s) {}
static inline void clear(struct_type* s) {
cef_string_clear(&s->proxyList);
}
static inline void set(const struct_type* src, struct_type* target,
bool copy) {
target->proxyType = src->proxyType;
cef_string_set(src->proxyList.str, src->proxyList.length,
&target->proxyList, copy);
}
};
///
// Class representing the results of proxy resolution.
///
class CefProxyInfo : public CefStructBase<CefProxyInfoTraits> {
public:
///
// Use a direction connection instead of a proxy.
///
void UseDirect() {
proxyType = CEF_PROXY_TYPE_DIRECT;
}
///
// Use one or more named proxy servers specified in WinHTTP format. Each proxy
// server is of the form:
//
// [<scheme>"://"]<server>[":"<port>]
//
// Multiple values may be separated by semicolons or whitespace. For example,
// "foo1:80;foo2:80".
///
void UseNamedProxy(const CefString& proxy_uri_list) {
proxyType = CEF_PROXY_TYPE_NAMED;
(CefString(&proxyList)) = proxy_uri_list;
}
///
// Use one or more named proxy servers specified in PAC script format. For
// example, "PROXY foobar:99; SOCKS fml:2; DIRECT".
///
void UsePacString(const CefString& pac_string) {
proxyType = CEF_PROXY_TYPE_PAC_STRING;
(CefString(&proxyList)) = pac_string;
}
bool IsDirect() const { return proxyType == CEF_PROXY_TYPE_DIRECT; }
bool IsNamedProxy() const { return proxyType == CEF_PROXY_TYPE_NAMED; }
bool IsPacString() const { return proxyType == CEF_PROXY_TYPE_PAC_STRING; }
CefString ProxyList() const { return CefString(&proxyList); }
};
struct CefGeopositionTraits {
typedef cef_geoposition_t struct_type;