Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xavie_
Cef
提交
d4e937fc
C
Cef
项目概览
Xavie_
/
Cef
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cef
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d4e937fc
编写于
7月 23, 2019
作者:
R
Richard Wilkes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bad include of a C++ header into the C API from upstream
上级
222d999a
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
625 addition
and
445 deletion
+625
-445
.golangci.yml
.golangci.yml
+4
-0
cef/Browser_gen.go
cef/Browser_gen.go
+0
-8
cef/Client_gen.go
cef/Client_gen.go
+5
-5
cef/CookieManager_gen.go
cef/CookieManager_gen.go
+15
-31
cef/CookieVisitor_gen.go
cef/CookieVisitor_gen.go
+1
-1
cef/DragHandler_gen.go
cef/DragHandler_gen.go
+5
-5
cef/Frame_gen.go
cef/Frame_gen.go
+36
-0
cef/LifeSpanHandler_gen.go
cef/LifeSpanHandler_gen.go
+18
-9
cef/RenderProcessHandler_gen.go
cef/RenderProcessHandler_gen.go
+15
-11
cef/RequestCallback_gen.go
cef/RequestCallback_gen.go
+1
-1
cef/RequestContextHandler_gen.c
cef/RequestContextHandler_gen.c
+1
-1
cef/RequestContextHandler_gen.go
cef/RequestContextHandler_gen.go
+31
-17
cef/RequestContextSettings_gen.go
cef/RequestContextSettings_gen.go
+8
-6
cef/RequestContext_gen.go
cef/RequestContext_gen.go
+16
-10
cef/RequestHandler_gen.c
cef/RequestHandler_gen.c
+1
-9
cef/RequestHandler_gen.go
cef/RequestHandler_gen.go
+33
-171
cef/Request_gen.go
cef/Request_gen.go
+37
-2
cef/ResourceHandler_gen.c
cef/ResourceHandler_gen.c
+3
-2
cef/ResourceHandler_gen.go
cef/ResourceHandler_gen.go
+70
-33
cef/Response_gen.go
cef/Response_gen.go
+20
-0
cef/SchemeHandlerFactory_gen.go
cef/SchemeHandlerFactory_gen.go
+1
-1
cef/Settings_gen.go
cef/Settings_gen.go
+26
-6
cef/UrlrequestClient_gen.go
cef/UrlrequestClient_gen.go
+5
-3
cef/capi_gen.h
cef/capi_gen.h
+2
-0
cef/enums_gen.go
cef/enums_gen.go
+231
-60
cef/functions_gen.go
cef/functions_gen.go
+40
-53
未找到文件。
.golangci.yml
浏览文件 @
d4e937fc
...
...
@@ -100,6 +100,10 @@ issues:
linters
:
-
gocritic
text
:
"
paramTypeCombine:
"
-
path
:
_gen\.go
linters
:
-
gocritic
text
:
"
deprecatedComment:
"
-
path
:
_gen\.go
linters
:
-
staticcheck
...
...
cef/Browser_gen.go
浏览文件 @
d4e937fc
...
...
@@ -24,7 +24,6 @@ import (
// size_t gocef_browser_get_frame_count(cef_browser_t * self, size_t (CEF_CALLBACK *callback__)(cef_browser_t *)) { return callback__(self); }
// void gocef_browser_get_frame_identifiers(cef_browser_t * self, size_t * identifiersCount, int64 * identifiers, void (CEF_CALLBACK *callback__)(cef_browser_t *, size_t *, int64 *)) { return callback__(self, identifiersCount, identifiers); }
// void gocef_browser_get_frame_names(cef_browser_t * self, cef_string_list_t names, void (CEF_CALLBACK *callback__)(cef_browser_t *, cef_string_list_t)) { return callback__(self, names); }
// int gocef_browser_send_process_message(cef_browser_t * self, cef_process_id_t target_process, cef_process_message_t * message, int (CEF_CALLBACK *callback__)(cef_browser_t *, cef_process_id_t, cef_process_message_t *)) { return callback__(self, target_process, message); }
"C"
)
...
...
@@ -172,10 +171,3 @@ func (d *Browser) GetFrameIdentifiers(identifiersCount *uint64, identifiers *int
func
(
d
*
Browser
)
GetFrameNames
(
names
StringList
)
{
C
.
gocef_browser_get_frame_names
(
d
.
toNative
(),
C
.
cef_string_list_t
(
names
),
d
.
get_frame_names
)
}
// SendProcessMessage (send_process_message)
// Send a message to the specified |target_process|. Returns true (1) if the
// message was sent successfully.
func
(
d
*
Browser
)
SendProcessMessage
(
target_process
ProcessID
,
message
*
ProcessMessage
)
int32
{
return
int32
(
C
.
gocef_browser_send_process_message
(
d
.
toNative
(),
C
.
cef_process_id_t
(
target_process
),
message
.
toNative
(),
d
.
send_process_message
))
}
cef/Client_gen.go
浏览文件 @
d4e937fc
...
...
@@ -30,7 +30,7 @@ type ClientProxy interface {
GetLoadHandler
(
self
*
Client
)
*
LoadHandler
GetRenderHandler
(
self
*
Client
)
*
RenderHandler
GetRequestHandler
(
self
*
Client
)
*
RequestHandler
OnProcessMessageReceived
(
self
*
Client
,
browser
*
Browser
,
source_process
ProcessID
,
message
*
ProcessMessage
)
int32
OnProcessMessageReceived
(
self
*
Client
,
browser
*
Browser
,
frame
*
Frame
,
source_process
ProcessID
,
message
*
ProcessMessage
)
int32
}
// Client (cef_client_t from include/capi/cef_client_capi.h)
...
...
@@ -273,14 +273,14 @@ func gocef_client_get_request_handler(self *C.cef_client_t) *C.cef_request_handl
// Called when a new message is received from a different process. Return true
// (1) if the message was handled or false (0) otherwise. Do not keep a
// reference to or attempt to access the message outside of this callback.
func
(
d
*
Client
)
OnProcessMessageReceived
(
browser
*
Browser
,
source_process
ProcessID
,
message
*
ProcessMessage
)
int32
{
return
lookupClientProxy
(
d
.
Base
())
.
OnProcessMessageReceived
(
d
,
browser
,
source_process
,
message
)
func
(
d
*
Client
)
OnProcessMessageReceived
(
browser
*
Browser
,
frame
*
Frame
,
source_process
ProcessID
,
message
*
ProcessMessage
)
int32
{
return
lookupClientProxy
(
d
.
Base
())
.
OnProcessMessageReceived
(
d
,
browser
,
frame
,
source_process
,
message
)
}
//nolint:gocritic
//export gocef_client_on_process_message_received
func
gocef_client_on_process_message_received
(
self
*
C
.
cef_client_t
,
browser
*
C
.
cef_browser_t
,
source_process
C
.
cef_process_id_t
,
message
*
C
.
cef_process_message_t
)
C
.
int
{
func
gocef_client_on_process_message_received
(
self
*
C
.
cef_client_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
source_process
C
.
cef_process_id_t
,
message
*
C
.
cef_process_message_t
)
C
.
int
{
me__
:=
(
*
Client
)(
self
)
proxy__
:=
lookupClientProxy
(
me__
.
Base
())
return
C
.
int
(
proxy__
.
OnProcessMessageReceived
(
me__
,
(
*
Browser
)(
browser
),
ProcessID
(
source_process
),
(
*
ProcessMessage
)(
message
)))
return
C
.
int
(
proxy__
.
OnProcessMessageReceived
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
ProcessID
(
source_process
),
(
*
ProcessMessage
)(
message
)))
}
cef/CookieManager_gen.go
浏览文件 @
d4e937fc
...
...
@@ -4,12 +4,11 @@ package cef
import
(
// #include "capi_gen.h"
// void gocef_cookie_manager_set_supported_schemes(cef_cookie_manager_t * self, cef_string_list_t schemes,
cef_completion_callback_t * callback, void (CEF_CALLBACK *callback__)(cef_cookie_manager_t *, cef_string_list_t, cef_completion_callback_t *)) { return callback__(self, scheme
s, callback); }
// void gocef_cookie_manager_set_supported_schemes(cef_cookie_manager_t * self, cef_string_list_t schemes,
int include_defaults, cef_completion_callback_t * callback, void (CEF_CALLBACK *callback__)(cef_cookie_manager_t *, cef_string_list_t, int, cef_completion_callback_t *)) { return callback__(self, schemes, include_default
s, callback); }
// int gocef_cookie_manager_visit_all_cookies(cef_cookie_manager_t * self, cef_cookie_visitor_t * visitor, int (CEF_CALLBACK *callback__)(cef_cookie_manager_t *, cef_cookie_visitor_t *)) { return callback__(self, visitor); }
// int gocef_cookie_manager_visit_url_cookies(cef_cookie_manager_t * self, cef_string_t * url, int includeHttpOnly, cef_cookie_visitor_t * visitor, int (CEF_CALLBACK *callback__)(cef_cookie_manager_t *, cef_string_t *, int, cef_cookie_visitor_t *)) { return callback__(self, url, includeHttpOnly, visitor); }
// int gocef_cookie_manager_set_cookie(cef_cookie_manager_t * self, cef_string_t * url, cef_cookie_t * cookie, cef_set_cookie_callback_t * callback, int (CEF_CALLBACK *callback__)(cef_cookie_manager_t *, cef_string_t *, cef_cookie_t *, cef_set_cookie_callback_t *)) { return callback__(self, url, cookie, callback); }
// int gocef_cookie_manager_delete_cookies(cef_cookie_manager_t * self, cef_string_t * url, cef_string_t * cookie_name, cef_delete_cookies_callback_t * callback, int (CEF_CALLBACK *callback__)(cef_cookie_manager_t *, cef_string_t *, cef_string_t *, cef_delete_cookies_callback_t *)) { return callback__(self, url, cookie_name, callback); }
// int gocef_cookie_manager_set_storage_path(cef_cookie_manager_t * self, cef_string_t * path, int persist_session_cookies, cef_completion_callback_t * callback, int (CEF_CALLBACK *callback__)(cef_cookie_manager_t *, cef_string_t *, int, cef_completion_callback_t *)) { return callback__(self, path, persist_session_cookies, callback); }
// int gocef_cookie_manager_flush_store(cef_cookie_manager_t * self, cef_completion_callback_t * callback, int (CEF_CALLBACK *callback__)(cef_cookie_manager_t *, cef_completion_callback_t *)) { return callback__(self, callback); }
"C"
)
...
...
@@ -30,16 +29,19 @@ func (d *CookieManager) Base() *BaseRefCounted {
}
// SetSupportedSchemes (set_supported_schemes)
// Set the schemes supported by this manager. The default schemes ("http",
// "https", "ws" and "wss") will always be supported. If |callback| is non-
// NULL it will be executed asnychronously on the IO thread after the change
// has been applied. Must be called before any cookies are accessed.
func
(
d
*
CookieManager
)
SetSupportedSchemes
(
schemes
StringList
,
callback
*
CompletionCallback
)
{
C
.
gocef_cookie_manager_set_supported_schemes
(
d
.
toNative
(),
C
.
cef_string_list_t
(
schemes
),
callback
.
toNative
(),
d
.
set_supported_schemes
)
// Set the schemes supported by this manager. If |include_defaults| is true
// (1) the default schemes ("http", "https", "ws" and "wss") will also be
// supported. Calling this function with an NULL |schemes| value and
// |include_defaults| set to false (0) will disable all loading and saving of
// cookies for this manager. If |callback| is non-NULL it will be executed
// asnychronously on the UI thread after the change has been applied. Must be
// called before any cookies are accessed.
func
(
d
*
CookieManager
)
SetSupportedSchemes
(
schemes
StringList
,
include_defaults
int32
,
callback
*
CompletionCallback
)
{
C
.
gocef_cookie_manager_set_supported_schemes
(
d
.
toNative
(),
C
.
cef_string_list_t
(
schemes
),
C
.
int
(
include_defaults
),
callback
.
toNative
(),
d
.
set_supported_schemes
)
}
// VisitAllCookies (visit_all_cookies)
// Visit all cookies on the
IO
thread. The returned cookies are ordered by
// Visit all cookies on the
UI
thread. The returned cookies are ordered by
// longest path, then by earliest creation date. Returns false (0) if cookies
// cannot be accessed.
func
(
d
*
CookieManager
)
VisitAllCookies
(
visitor
*
CookieVisitor
)
int32
{
...
...
@@ -47,7 +49,7 @@ func (d *CookieManager) VisitAllCookies(visitor *CookieVisitor) int32 {
}
// VisitUrlCookies (visit_url_cookies)
// Visit a subset of cookies on the
IO
thread. The results are filtered by the
// Visit a subset of cookies on the
UI
thread. The results are filtered by the
// given url scheme, host, domain and path. If |includeHttpOnly| is true (1)
// HTTP-only cookies will also be included in the results. The returned
// cookies are ordered by longest path, then by earliest creation date.
...
...
@@ -67,7 +69,7 @@ func (d *CookieManager) VisitUrlCookies(url string, includeHttpOnly int32, visit
// check for disallowed characters (e.g. the ';' character is disallowed
// within the cookie value attribute) and fail without setting the cookie if
// such characters are found. If |callback| is non-NULL it will be executed
// asnychronously on the
IO
thread after the cookie has been set. Returns
// asnychronously on the
UI
thread after the cookie has been set. Returns
// false (0) if an invalid URL is specified or if cookies cannot be accessed.
func
(
d
*
CookieManager
)
SetCookie
(
url
string
,
cookie
*
Cookie
,
callback
*
SetCookieCallback
)
int32
{
url_
:=
C
.
cef_string_userfree_alloc
()
...
...
@@ -84,7 +86,7 @@ func (d *CookieManager) SetCookie(url string, cookie *Cookie, callback *SetCooki
// both will be deleted. If only |url| is specified all host cookies (but not
// domain cookies) irrespective of path will be deleted. If |url| is NULL all
// cookies for all hosts and domains will be deleted. If |callback| is non-
// NULL it will be executed asnychronously on the
IO
thread after the cookies
// NULL it will be executed asnychronously on the
UI
thread after the cookies
// have been deleted. Returns false (0) if a non-NULL invalid URL is specified
// or if cookies cannot be accessed. Cookies can alternately be deleted using
// the Visit*Cookies() functions.
...
...
@@ -102,27 +104,9 @@ func (d *CookieManager) DeleteCookies(url, cookie_name string, callback *DeleteC
return
int32
(
C
.
gocef_cookie_manager_delete_cookies
(
d
.
toNative
(),
(
*
C
.
cef_string_t
)(
url_
),
(
*
C
.
cef_string_t
)(
cookie_name_
),
callback
.
toNative
(),
d
.
delete_cookies
))
}
// SetStoragePath (set_storage_path)
// Sets the directory path that will be used for storing cookie data. If
// |path| is NULL data will be stored in memory only. Otherwise, data will be
// stored at the specified |path|. To persist session cookies (cookies without
// an expiry date or validity interval) set |persist_session_cookies| to true
// (1). Session cookies are generally intended to be transient and most Web
// browsers do not persist them. If |callback| is non-NULL it will be executed
// asnychronously on the IO thread after the manager's storage has been
// initialized. Returns false (0) if cookies cannot be accessed.
func
(
d
*
CookieManager
)
SetStoragePath
(
path
string
,
persist_session_cookies
int32
,
callback
*
CompletionCallback
)
int32
{
path_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
path
,
path_
)
defer
func
()
{
C
.
cef_string_userfree_free
(
path_
)
}()
return
int32
(
C
.
gocef_cookie_manager_set_storage_path
(
d
.
toNative
(),
(
*
C
.
cef_string_t
)(
path_
),
C
.
int
(
persist_session_cookies
),
callback
.
toNative
(),
d
.
set_storage_path
))
}
// FlushStore (flush_store)
// Flush the backing store (if any) to disk. If |callback| is non-NULL it will
// be executed asnychronously on the
IO
thread after the flush is complete.
// be executed asnychronously on the
UI
thread after the flush is complete.
// Returns false (0) if cookies cannot be accessed.
func
(
d
*
CookieManager
)
FlushStore
(
callback
*
CompletionCallback
)
int32
{
return
int32
(
C
.
gocef_cookie_manager_flush_store
(
d
.
toNative
(),
callback
.
toNative
(),
d
.
flush_store
))
...
...
cef/CookieVisitor_gen.go
浏览文件 @
d4e937fc
...
...
@@ -21,7 +21,7 @@ type CookieVisitorProxy interface {
// CookieVisitor (cef_cookie_visitor_t from include/capi/cef_cookie_capi.h)
// Structure to implement for visiting cookie values. The functions of this
// structure will always be called on the
IO
thread.
// structure will always be called on the
UI
thread.
type
CookieVisitor
C
.
cef_cookie_visitor_t
// NewCookieVisitor creates a new CookieVisitor with the specified proxy. Passing
...
...
cef/DragHandler_gen.go
浏览文件 @
d4e937fc
...
...
@@ -17,7 +17,7 @@ import (
// DragHandlerProxy defines methods required for using DragHandler.
type
DragHandlerProxy
interface
{
OnDragEnter
(
self
*
DragHandler
,
browser
*
Browser
,
dragData
*
DragData
,
mask
DragOperationsMask
)
int32
OnDraggableRegionsChanged
(
self
*
DragHandler
,
browser
*
Browser
,
regionsCount
uint64
,
regions
*
DraggableRegion
)
OnDraggableRegionsChanged
(
self
*
DragHandler
,
browser
*
Browser
,
frame
*
Frame
,
regionsCount
uint64
,
regions
*
DraggableRegion
)
}
// DragHandler (cef_drag_handler_t from include/capi/cef_drag_handler_capi.h)
...
...
@@ -80,15 +80,15 @@ func gocef_drag_handler_on_drag_enter(self *C.cef_drag_handler_t, browser *C.cef
// draggable regions are never defined in a document this function will also
// never be called. If the last draggable region is removed from a document
// this function will be called with an NULL vector.
func
(
d
*
DragHandler
)
OnDraggableRegionsChanged
(
browser
*
Browser
,
regionsCount
uint64
,
regions
*
DraggableRegion
)
{
lookupDragHandlerProxy
(
d
.
Base
())
.
OnDraggableRegionsChanged
(
d
,
browser
,
regionsCount
,
regions
)
func
(
d
*
DragHandler
)
OnDraggableRegionsChanged
(
browser
*
Browser
,
frame
*
Frame
,
regionsCount
uint64
,
regions
*
DraggableRegion
)
{
lookupDragHandlerProxy
(
d
.
Base
())
.
OnDraggableRegionsChanged
(
d
,
browser
,
frame
,
regionsCount
,
regions
)
}
//nolint:gocritic
//export gocef_drag_handler_on_draggable_regions_changed
func
gocef_drag_handler_on_draggable_regions_changed
(
self
*
C
.
cef_drag_handler_t
,
browser
*
C
.
cef_browser_t
,
regionsCount
C
.
size_t
,
regions
*
C
.
cef_draggable_region_t
)
{
func
gocef_drag_handler_on_draggable_regions_changed
(
self
*
C
.
cef_drag_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
regionsCount
C
.
size_t
,
regions
*
C
.
cef_draggable_region_t
)
{
me__
:=
(
*
DragHandler
)(
self
)
proxy__
:=
lookupDragHandlerProxy
(
me__
.
Base
())
regions_
:=
regions
.
toGo
()
proxy__
.
OnDraggableRegionsChanged
(
me__
,
(
*
Browser
)(
browser
),
uint64
(
regionsCount
),
regions_
)
proxy__
.
OnDraggableRegionsChanged
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
uint64
(
regionsCount
),
regions_
)
}
cef/Frame_gen.go
浏览文件 @
d4e937fc
...
...
@@ -28,6 +28,8 @@ import (
// cef_browser_t * gocef_frame_get_browser(cef_frame_t * self, cef_browser_t * (CEF_CALLBACK *callback__)(cef_frame_t *)) { return callback__(self); }
// cef_v8context_t * gocef_frame_get_v8context(cef_frame_t * self, cef_v8context_t * (CEF_CALLBACK *callback__)(cef_frame_t *)) { return callback__(self); }
// void gocef_frame_visit_dom(cef_frame_t * self, cef_domvisitor_t * visitor, void (CEF_CALLBACK *callback__)(cef_frame_t *, cef_domvisitor_t *)) { return callback__(self, visitor); }
// cef_urlrequest_t * gocef_frame_create_urlrequest(cef_frame_t * self, cef_request_t * request, cef_urlrequest_client_t * client, cef_urlrequest_t * (CEF_CALLBACK *callback__)(cef_frame_t *, cef_request_t *, cef_urlrequest_client_t *)) { return callback__(self, request, client); }
// void gocef_frame_send_process_message(cef_frame_t * self, cef_process_id_t target_process, cef_process_message_t * message, void (CEF_CALLBACK *callback__)(cef_frame_t *, cef_process_id_t, cef_process_message_t *)) { return callback__(self, target_process, message); }
"C"
)
...
...
@@ -236,3 +238,37 @@ func (d *Frame) GetV8context() *V8context {
func
(
d
*
Frame
)
VisitDom
(
visitor
*
Domvisitor
)
{
C
.
gocef_frame_visit_dom
(
d
.
toNative
(),
visitor
.
toNative
(),
d
.
visit_dom
)
}
// CreateUrlrequest (create_urlrequest)
// Create a new URL request that will be treated as originating from this
// frame and the associated browser. This request may be intercepted by the
// client via cef_resource_request_handler_t or cef_scheme_handler_factory_t.
// Use cef_urlrequest_t::Create instead if you do not want the request to have
// this association, in which case it may be handled differently (see
// documentation on that function). Requests may originate from both the
// browser process and the render process.
//
// For requests originating from the browser process:
// - POST data may only contain a single element of type PDE_TYPE_FILE or
// PDE_TYPE_BYTES.
// For requests originating from the render process:
// - POST data may only contain a single element of type PDE_TYPE_BYTES.
// - If the response contains Content-Disposition or Mime-Type header values
// that would not normally be rendered then the response may receive
// special handling inside the browser (for example, via the file download
// code path instead of the URL request code path).
//
// The |request| object will be marked as read-only after calling this
// function.
func
(
d
*
Frame
)
CreateUrlrequest
(
request
*
Request
,
client
*
UrlrequestClient
)
*
Urlrequest
{
return
(
*
Urlrequest
)(
C
.
gocef_frame_create_urlrequest
(
d
.
toNative
(),
request
.
toNative
(),
client
.
toNative
(),
d
.
create_urlrequest
))
}
// SendProcessMessage (send_process_message)
// Send a message to the specified |target_process|. Message delivery is not
// guaranteed in all cases (for example, if the browser is closing,
// navigating, or if the target process crashes). Send an ACK message back
// from the target process if confirmation is required.
func
(
d
*
Frame
)
SendProcessMessage
(
target_process
ProcessID
,
message
*
ProcessMessage
)
{
C
.
gocef_frame_send_process_message
(
d
.
toNative
(),
C
.
cef_process_id_t
(
target_process
),
message
.
toNative
(),
d
.
send_process_message
)
}
cef/LifeSpanHandler_gen.go
浏览文件 @
d4e937fc
...
...
@@ -16,7 +16,7 @@ import (
// LifeSpanHandlerProxy defines methods required for using LifeSpanHandler.
type
LifeSpanHandlerProxy
interface
{
OnBeforePopup
(
self
*
LifeSpanHandler
,
browser
*
Browser
,
frame
*
Frame
,
target_url
,
target_frame_name
string
,
target_disposition
WindowOpenDisposition
,
user_gesture
int32
,
popupFeatures
*
PopupFeatures
,
windowInfo
*
WindowInfo
,
client
**
Client
,
settings
*
BrowserSettings
,
no_javascript_access
*
int32
)
int32
OnBeforePopup
(
self
*
LifeSpanHandler
,
browser
*
Browser
,
frame
*
Frame
,
target_url
,
target_frame_name
string
,
target_disposition
WindowOpenDisposition
,
user_gesture
int32
,
popupFeatures
*
PopupFeatures
,
windowInfo
*
WindowInfo
,
client
**
Client
,
settings
*
BrowserSettings
,
extra_info
**
DictionaryValue
,
no_javascript_access
*
int32
)
int32
OnAfterCreated
(
self
*
LifeSpanHandler
,
browser
*
Browser
)
DoClose
(
self
*
LifeSpanHandler
,
browser
*
Browser
)
int32
OnBeforeClose
(
self
*
LifeSpanHandler
,
browser
*
Browser
)
...
...
@@ -80,14 +80,17 @@ func (d *LifeSpanHandler) Base() *BaseRefCounted {
// modifications to |windowInfo| will be ignored if the parent browser is
// wrapped in a cef_browser_view_t. Popup browser creation will be canceled if
// the parent browser is destroyed before the popup browser creation completes
// (indicated by a call to OnAfterCreated for the popup browser).
func
(
d
*
LifeSpanHandler
)
OnBeforePopup
(
browser
*
Browser
,
frame
*
Frame
,
target_url
,
target_frame_name
string
,
target_disposition
WindowOpenDisposition
,
user_gesture
int32
,
popupFeatures
*
PopupFeatures
,
windowInfo
*
WindowInfo
,
client
**
Client
,
settings
*
BrowserSettings
,
no_javascript_access
*
int32
)
int32
{
return
lookupLifeSpanHandlerProxy
(
d
.
Base
())
.
OnBeforePopup
(
d
,
browser
,
frame
,
target_url
,
target_frame_name
,
target_disposition
,
user_gesture
,
popupFeatures
,
windowInfo
,
client
,
settings
,
no_javascript_access
)
// (indicated by a call to OnAfterCreated for the popup browser). The
// |extra_info| parameter provides an opportunity to specify extra information
// specific to the created popup browser that will be passed to
// cef_render_process_handler_t::on_browser_created() in the render process.
func
(
d
*
LifeSpanHandler
)
OnBeforePopup
(
browser
*
Browser
,
frame
*
Frame
,
target_url
,
target_frame_name
string
,
target_disposition
WindowOpenDisposition
,
user_gesture
int32
,
popupFeatures
*
PopupFeatures
,
windowInfo
*
WindowInfo
,
client
**
Client
,
settings
*
BrowserSettings
,
extra_info
**
DictionaryValue
,
no_javascript_access
*
int32
)
int32
{
return
lookupLifeSpanHandlerProxy
(
d
.
Base
())
.
OnBeforePopup
(
d
,
browser
,
frame
,
target_url
,
target_frame_name
,
target_disposition
,
user_gesture
,
popupFeatures
,
windowInfo
,
client
,
settings
,
extra_info
,
no_javascript_access
)
}
//nolint:gocritic
//export gocef_life_span_handler_on_before_popup
func
gocef_life_span_handler_on_before_popup
(
self
*
C
.
cef_life_span_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
target_url
*
C
.
cef_string_t
,
target_frame_name
*
C
.
cef_string_t
,
target_disposition
C
.
cef_window_open_disposition_t
,
user_gesture
C
.
int
,
popupFeatures
*
C
.
cef_popup_features_t
,
windowInfo
*
C
.
cef_window_info_t
,
client
**
C
.
cef_client_t
,
settings
*
C
.
cef_browser_settings_t
,
no_javascript_access
*
C
.
int
)
C
.
int
{
func
gocef_life_span_handler_on_before_popup
(
self
*
C
.
cef_life_span_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
target_url
*
C
.
cef_string_t
,
target_frame_name
*
C
.
cef_string_t
,
target_disposition
C
.
cef_window_open_disposition_t
,
user_gesture
C
.
int
,
popupFeatures
*
C
.
cef_popup_features_t
,
windowInfo
*
C
.
cef_window_info_t
,
client
**
C
.
cef_client_t
,
settings
*
C
.
cef_browser_settings_t
,
extra_info
**
C
.
cef_dictionary_value_t
,
no_javascript_access
*
C
.
int
)
C
.
int
{
me__
:=
(
*
LifeSpanHandler
)(
self
)
proxy__
:=
lookupLifeSpanHandlerProxy
(
me__
.
Base
())
target_url_
:=
cefstrToString
(
target_url
)
...
...
@@ -97,7 +100,9 @@ func gocef_life_span_handler_on_before_popup(self *C.cef_life_span_handler_t, br
client_
:=
(
*
Client
)(
*
client
)
client__p
:=
&
client_
settings_
:=
settings
.
toGo
()
return
C
.
int
(
proxy__
.
OnBeforePopup
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
target_url_
,
target_frame_name_
,
WindowOpenDisposition
(
target_disposition
),
int32
(
user_gesture
),
popupFeatures_
,
windowInfo_
,
client__p
,
settings_
,
(
*
int32
)(
no_javascript_access
)))
extra_info_
:=
(
*
DictionaryValue
)(
*
extra_info
)
extra_info__p
:=
&
extra_info_
return
C
.
int
(
proxy__
.
OnBeforePopup
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
target_url_
,
target_frame_name_
,
WindowOpenDisposition
(
target_disposition
),
int32
(
user_gesture
),
popupFeatures_
,
windowInfo_
,
client__p
,
settings_
,
extra_info__p
,
(
*
int32
)(
no_javascript_access
)))
}
// OnAfterCreated (on_after_created)
...
...
@@ -218,9 +223,13 @@ func gocef_life_span_handler_do_close(self *C.cef_life_span_handler_t, browser *
// OnBeforeClose (on_before_close)
// Called just before a browser is destroyed. Release all references to the
// browser object and do not attempt to execute any functions on the browser
// object after this callback returns. This callback will be the last
// notification that references |browser|. See do_close() documentation for
// additional usage information.
// object (other than GetIdentifier or IsSame) after this callback returns.
// This callback will be the last notification that references |browser| on
// the UI thread. Any in-progress network requests associated with |browser|
// will be aborted when the browser is destroyed, and
// cef_resource_request_handler_t callbacks related to those requests may
// still arrive on the IO thread after this function is called. See do_close()
// documentation for additional usage information.
func
(
d
*
LifeSpanHandler
)
OnBeforeClose
(
browser
*
Browser
)
{
lookupLifeSpanHandlerProxy
(
d
.
Base
())
.
OnBeforeClose
(
d
,
browser
)
}
...
...
cef/RenderProcessHandler_gen.go
浏览文件 @
d4e937fc
...
...
@@ -18,14 +18,14 @@ import (
type
RenderProcessHandlerProxy
interface
{
OnRenderThreadCreated
(
self
*
RenderProcessHandler
,
extra_info
*
ListValue
)
OnWebKitInitialized
(
self
*
RenderProcessHandler
)
OnBrowserCreated
(
self
*
RenderProcessHandler
,
browser
*
Browser
)
OnBrowserCreated
(
self
*
RenderProcessHandler
,
browser
*
Browser
,
extra_info
*
DictionaryValue
)
OnBrowserDestroyed
(
self
*
RenderProcessHandler
,
browser
*
Browser
)
GetLoadHandler
(
self
*
RenderProcessHandler
)
*
LoadHandler
OnContextCreated
(
self
*
RenderProcessHandler
,
browser
*
Browser
,
frame
*
Frame
,
context
*
V8context
)
OnContextReleased
(
self
*
RenderProcessHandler
,
browser
*
Browser
,
frame
*
Frame
,
context
*
V8context
)
OnUncaughtException
(
self
*
RenderProcessHandler
,
browser
*
Browser
,
frame
*
Frame
,
context
*
V8context
,
exception
*
V8exception
,
stackTrace
*
V8stackTrace
)
OnFocusedNodeChanged
(
self
*
RenderProcessHandler
,
browser
*
Browser
,
frame
*
Frame
,
node
*
Domnode
)
OnProcessMessageReceived
(
self
*
RenderProcessHandler
,
browser
*
Browser
,
source_process
ProcessID
,
message
*
ProcessMessage
)
int32
OnProcessMessageReceived
(
self
*
RenderProcessHandler
,
browser
*
Browser
,
frame
*
Frame
,
source_process
ProcessID
,
message
*
ProcessMessage
)
int32
}
// RenderProcessHandler (cef_render_process_handler_t from include/capi/cef_render_process_handler_capi.h)
...
...
@@ -100,17 +100,21 @@ func gocef_render_process_handler_on_web_kit_initialized(self *C.cef_render_proc
// OnBrowserCreated (on_browser_created)
// Called after a browser has been created. When browsing cross-origin a new
// browser will be created before the old browser with the same identifier is
// destroyed.
func
(
d
*
RenderProcessHandler
)
OnBrowserCreated
(
browser
*
Browser
)
{
lookupRenderProcessHandlerProxy
(
d
.
Base
())
.
OnBrowserCreated
(
d
,
browser
)
// destroyed. |extra_info| is a read-only value originating from
// cef_browser_host_t::cef_browser_host_create_browser(),
// cef_browser_host_t::cef_browser_host_create_browser_sync(),
// cef_life_span_handler_t::on_before_popup() or
// cef_browser_view_t::cef_browser_view_create().
func
(
d
*
RenderProcessHandler
)
OnBrowserCreated
(
browser
*
Browser
,
extra_info
*
DictionaryValue
)
{
lookupRenderProcessHandlerProxy
(
d
.
Base
())
.
OnBrowserCreated
(
d
,
browser
,
extra_info
)
}
//nolint:gocritic
//export gocef_render_process_handler_on_browser_created
func
gocef_render_process_handler_on_browser_created
(
self
*
C
.
cef_render_process_handler_t
,
browser
*
C
.
cef_browser_t
)
{
func
gocef_render_process_handler_on_browser_created
(
self
*
C
.
cef_render_process_handler_t
,
browser
*
C
.
cef_browser_t
,
extra_info
*
C
.
cef_dictionary_value_t
)
{
me__
:=
(
*
RenderProcessHandler
)(
self
)
proxy__
:=
lookupRenderProcessHandlerProxy
(
me__
.
Base
())
proxy__
.
OnBrowserCreated
(
me__
,
(
*
Browser
)(
browser
))
proxy__
.
OnBrowserCreated
(
me__
,
(
*
Browser
)(
browser
)
,
(
*
DictionaryValue
)(
extra_info
)
)
}
// OnBrowserDestroyed (on_browser_destroyed)
...
...
@@ -214,14 +218,14 @@ func gocef_render_process_handler_on_focused_node_changed(self *C.cef_render_pro
// Called when a new message is received from a different process. Return true
// (1) if the message was handled or false (0) otherwise. Do not keep a
// reference to or attempt to access the message outside of this callback.
func
(
d
*
RenderProcessHandler
)
OnProcessMessageReceived
(
browser
*
Browser
,
source_process
ProcessID
,
message
*
ProcessMessage
)
int32
{
return
lookupRenderProcessHandlerProxy
(
d
.
Base
())
.
OnProcessMessageReceived
(
d
,
browser
,
source_process
,
message
)
func
(
d
*
RenderProcessHandler
)
OnProcessMessageReceived
(
browser
*
Browser
,
frame
*
Frame
,
source_process
ProcessID
,
message
*
ProcessMessage
)
int32
{
return
lookupRenderProcessHandlerProxy
(
d
.
Base
())
.
OnProcessMessageReceived
(
d
,
browser
,
frame
,
source_process
,
message
)
}
//nolint:gocritic
//export gocef_render_process_handler_on_process_message_received
func
gocef_render_process_handler_on_process_message_received
(
self
*
C
.
cef_render_process_handler_t
,
browser
*
C
.
cef_browser_t
,
source_process
C
.
cef_process_id_t
,
message
*
C
.
cef_process_message_t
)
C
.
int
{
func
gocef_render_process_handler_on_process_message_received
(
self
*
C
.
cef_render_process_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
source_process
C
.
cef_process_id_t
,
message
*
C
.
cef_process_message_t
)
C
.
int
{
me__
:=
(
*
RenderProcessHandler
)(
self
)
proxy__
:=
lookupRenderProcessHandlerProxy
(
me__
.
Base
())
return
C
.
int
(
proxy__
.
OnProcessMessageReceived
(
me__
,
(
*
Browser
)(
browser
),
ProcessID
(
source_process
),
(
*
ProcessMessage
)(
message
)))
return
C
.
int
(
proxy__
.
OnProcessMessageReceived
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
ProcessID
(
source_process
),
(
*
ProcessMessage
)(
message
)))
}
cef/RequestCallback_gen.go
浏览文件 @
d4e937fc
...
...
@@ -20,7 +20,7 @@ type RequestCallbackProxy interface {
Cancel
(
self
*
RequestCallback
)
}
// RequestCallback (cef_request_callback_t from include/capi/cef_request_
handler
_capi.h)
// RequestCallback (cef_request_callback_t from include/capi/cef_request_
callback
_capi.h)
// Callback structure used for asynchronous continuation of url requests.
type
RequestCallback
C
.
cef_request_callback_t
...
...
cef/RequestContextHandler_gen.c
浏览文件 @
d4e937fc
...
...
@@ -7,6 +7,6 @@ void gocef_set_request_context_handler_proxy(cef_request_context_handler_t *self
// Casts to (void *) added to avoid warnings since Go callbacks can't have
// some modifiers, such as 'const' applied to their parameter signatures.
self
->
on_request_context_initialized
=
(
void
*
)
&
gocef_request_context_handler_on_request_context_initialized
;
self
->
get_cookie_manager
=
(
void
*
)
&
gocef_request_context_handler_get_cookie_manager
;
self
->
on_before_plugin_load
=
(
void
*
)
&
gocef_request_context_handler_on_before_plugin_load
;
self
->
get_resource_request_handler
=
(
void
*
)
&
gocef_request_context_handler_get_resource_request_handler
;
}
cef/RequestContextHandler_gen.go
浏览文件 @
d4e937fc
...
...
@@ -17,8 +17,8 @@ import (
// RequestContextHandlerProxy defines methods required for using RequestContextHandler.
type
RequestContextHandlerProxy
interface
{
OnRequestContextInitialized
(
self
*
RequestContextHandler
,
request_context
*
RequestContext
)
GetCookieManager
(
self
*
RequestContextHandler
)
*
CookieManager
OnBeforePluginLoad
(
self
*
RequestContextHandler
,
mime_type
,
plugin_url
string
,
is_main_frame
int32
,
top_origin_url
string
,
plugin_info
*
WebPluginInfo
,
plugin_policy
*
PluginPolicy
)
int32
GetResourceRequestHandler
(
self
*
RequestContextHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
is_navigation
,
is_download
int32
,
request_initiator
string
,
disable_default_handling
*
int32
)
*
ResourceRequestHandler
}
// RequestContextHandler (cef_request_context_handler_t from include/capi/cef_request_context_handler_capi.h)
...
...
@@ -74,22 +74,6 @@ func gocef_request_context_handler_on_request_context_initialized(self *C.cef_re
proxy__
.
OnRequestContextInitialized
(
me__
,
(
*
RequestContext
)(
request_context
))
}
// GetCookieManager (get_cookie_manager)
// Called on the browser process IO thread to retrieve the cookie manager. If
// this function returns NULL the default cookie manager retrievable via
// cef_request_tContext::get_default_cookie_manager() will be used.
func
(
d
*
RequestContextHandler
)
GetCookieManager
()
*
CookieManager
{
return
lookupRequestContextHandlerProxy
(
d
.
Base
())
.
GetCookieManager
(
d
)
}
//nolint:gocritic
//export gocef_request_context_handler_get_cookie_manager
func
gocef_request_context_handler_get_cookie_manager
(
self
*
C
.
cef_request_context_handler_t
)
*
C
.
cef_cookie_manager_t
{
me__
:=
(
*
RequestContextHandler
)(
self
)
proxy__
:=
lookupRequestContextHandlerProxy
(
me__
.
Base
())
return
(
proxy__
.
GetCookieManager
(
me__
))
.
toNative
()
}
// OnBeforePluginLoad (on_before_plugin_load)
// Called on multiple browser process threads before a plugin instance is
// loaded. |mime_type| is the mime type of the plugin that will be loaded.
...
...
@@ -123,3 +107,33 @@ func gocef_request_context_handler_on_before_plugin_load(self *C.cef_request_con
plugin_policy_
:=
PluginPolicy
(
*
plugin_policy
)
return
C
.
int
(
proxy__
.
OnBeforePluginLoad
(
me__
,
mime_type_
,
plugin_url_
,
int32
(
is_main_frame
),
top_origin_url_
,
(
*
WebPluginInfo
)(
plugin_info
),
&
plugin_policy_
))
}
// GetResourceRequestHandler (get_resource_request_handler)
// Called on the browser process IO thread before a resource request is
// initiated. The |browser| and |frame| values represent the source of the
// request, and may be NULL for requests originating from service workers or
// cef_urlrequest_t. |request| represents the request contents and cannot be
// modified in this callback. |is_navigation| will be true (1) if the resource
// request is a navigation. |is_download| will be true (1) if the resource
// request is a download. |request_initiator| is the origin (scheme + domain)
// of the page that initiated the request. Set |disable_default_handling| to
// true (1) to disable default handling of the request, in which case it will
// need to be handled via cef_resource_request_handler_t::GetResourceHandler
// or it will be canceled. To allow the resource load to proceed with default
// handling return NULL. To specify a handler for the resource return a
// cef_resource_request_handler_t object. This function will not be called if
// the client associated with |browser| returns a non-NULL value from
// cef_request_tHandler::GetResourceRequestHandler for the same request
// (identified by cef_request_t::GetIdentifier).
func
(
d
*
RequestContextHandler
)
GetResourceRequestHandler
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
is_navigation
,
is_download
int32
,
request_initiator
string
,
disable_default_handling
*
int32
)
*
ResourceRequestHandler
{
return
lookupRequestContextHandlerProxy
(
d
.
Base
())
.
GetResourceRequestHandler
(
d
,
browser
,
frame
,
request
,
is_navigation
,
is_download
,
request_initiator
,
disable_default_handling
)
}
//nolint:gocritic
//export gocef_request_context_handler_get_resource_request_handler
func
gocef_request_context_handler_get_resource_request_handler
(
self
*
C
.
cef_request_context_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
,
is_navigation
C
.
int
,
is_download
C
.
int
,
request_initiator
*
C
.
cef_string_t
,
disable_default_handling
*
C
.
int
)
*
C
.
cef_resource_request_handler_t
{
me__
:=
(
*
RequestContextHandler
)(
self
)
proxy__
:=
lookupRequestContextHandlerProxy
(
me__
.
Base
())
request_initiator_
:=
cefstrToString
(
request_initiator
)
return
(
proxy__
.
GetResourceRequestHandler
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
),
int32
(
is_navigation
),
int32
(
is_download
),
request_initiator_
,
(
*
int32
)(
disable_default_handling
)))
.
toNative
()
}
cef/RequestContextSettings_gen.go
浏览文件 @
d4e937fc
...
...
@@ -15,12 +15,14 @@ type RequestContextSettings struct {
// Size of this structure.
Size
uint64
// CachePath (cache_path)
// The location where cache data will be stored on disk. If empty then
// browsers will be created in "incognito mode" where in-memory caches are
// used for storage and no data is persisted to disk. HTML5 databases such as
// localStorage will only persist across sessions if a cache path is
// specified. To share the global browser cache and related configuration set
// this value to match the CefSettings.cache_path value.
// The location where cache data for this request context will be stored on
// disk. If non-empty this must be either equal to or a child directory of
// CefSettings.root_cache_path. If empty then browsers will be created in
// "incognito mode" where in-memory caches are used for storage and no data is
// persisted to disk. HTML5 databases such as localStorage will only persist
// across sessions if a cache path is specified. To share the global browser
// cache and related configuration set this value to match the
// CefSettings.cache_path value.
CachePath
string
// PersistSessionCookies (persist_session_cookies)
// To persist session cookies (cookies without an expiry date or validity
...
...
cef/RequestContext_gen.go
浏览文件 @
d4e937fc
...
...
@@ -9,7 +9,7 @@ import (
// int gocef_request_context_is_global(cef_request_context_t * self, int (CEF_CALLBACK *callback__)(cef_request_context_t *)) { return callback__(self); }
// cef_request_context_handler_t * gocef_request_context_get_handler(cef_request_context_t * self, cef_request_context_handler_t * (CEF_CALLBACK *callback__)(cef_request_context_t *)) { return callback__(self); }
// cef_string_userfree_t gocef_request_context_get_cache_path(cef_request_context_t * self, cef_string_userfree_t (CEF_CALLBACK *callback__)(cef_request_context_t *)) { return callback__(self); }
// cef_cookie_manager_t * gocef_request_context_get_
default_
cookie_manager(cef_request_context_t * self, cef_completion_callback_t * callback, cef_cookie_manager_t * (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_completion_callback_t *)) { return callback__(self, callback); }
// cef_cookie_manager_t * gocef_request_context_get_cookie_manager(cef_request_context_t * self, cef_completion_callback_t * callback, cef_cookie_manager_t * (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_completion_callback_t *)) { return callback__(self, callback); }
// int gocef_request_context_register_scheme_handler_factory(cef_request_context_t * self, cef_string_t * scheme_name, cef_string_t * domain_name, cef_scheme_handler_factory_t * factory, int (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_string_t *, cef_string_t *, cef_scheme_handler_factory_t *)) { return callback__(self, scheme_name, domain_name, factory); }
// int gocef_request_context_clear_scheme_handler_factories(cef_request_context_t * self, int (CEF_CALLBACK *callback__)(cef_request_context_t *)) { return callback__(self); }
// void gocef_request_context_purge_plugin_list_cache(cef_request_context_t * self, int reload_pages, void (CEF_CALLBACK *callback__)(cef_request_context_t *, int)) { return callback__(self, reload_pages); }
...
...
@@ -19,6 +19,7 @@ import (
// int gocef_request_context_can_set_preference(cef_request_context_t * self, cef_string_t * name, int (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_string_t *)) { return callback__(self, name); }
// int gocef_request_context_set_preference(cef_request_context_t * self, cef_string_t * name, cef_value_t * value, cef_string_t * error_r, int (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_string_t *, cef_value_t *, cef_string_t *)) { return callback__(self, name, value, error_r); }
// void gocef_request_context_clear_certificate_exceptions(cef_request_context_t * self, cef_completion_callback_t * callback, void (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_completion_callback_t *)) { return callback__(self, callback); }
// void gocef_request_context_clear_http_auth_credentials(cef_request_context_t * self, cef_completion_callback_t * callback, void (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_completion_callback_t *)) { return callback__(self, callback); }
// void gocef_request_context_close_all_connections(cef_request_context_t * self, cef_completion_callback_t * callback, void (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_completion_callback_t *)) { return callback__(self, callback); }
// void gocef_request_context_resolve_host(cef_request_context_t * self, cef_string_t * origin, cef_resolve_callback_t * callback, void (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_string_t *, cef_resolve_callback_t *)) { return callback__(self, origin, callback); }
// void gocef_request_context_load_extension(cef_request_context_t * self, cef_string_t * root_directory, cef_dictionary_value_t * manifest, cef_extension_handler_t * handler, void (CEF_CALLBACK *callback__)(cef_request_context_t *, cef_string_t *, cef_dictionary_value_t *, cef_extension_handler_t *)) { return callback__(self, root_directory, manifest, handler); }
...
...
@@ -92,15 +93,12 @@ func (d *RequestContext) GetCachePath() string {
return
cefuserfreestrToString
(
C
.
gocef_request_context_get_cache_path
(
d
.
toNative
(),
d
.
get_cache_path
))
}
// GetDefaultCookieManager (get_default_cookie_manager)
// Returns the default cookie manager for this object. This will be the global
// cookie manager if this object is the global request context. Otherwise,
// this will be the default cookie manager used when this request context does
// not receive a value via cef_request_tContextHandler::get_cookie_manager().
// If |callback| is non-NULL it will be executed asnychronously on the IO
// thread after the manager's storage has been initialized.
func
(
d
*
RequestContext
)
GetDefaultCookieManager
(
callback
*
CompletionCallback
)
*
CookieManager
{
return
(
*
CookieManager
)(
C
.
gocef_request_context_get_default_cookie_manager
(
d
.
toNative
(),
callback
.
toNative
(),
d
.
get_default_cookie_manager
))
// GetCookieManager (get_cookie_manager)
// Returns the cookie manager for this object. If |callback| is non-NULL it
// will be executed asnychronously on the IO thread after the manager's
// storage has been initialized.
func
(
d
*
RequestContext
)
GetCookieManager
(
callback
*
CompletionCallback
)
*
CookieManager
{
return
(
*
CookieManager
)(
C
.
gocef_request_context_get_cookie_manager
(
d
.
toNative
(),
callback
.
toNative
(),
d
.
get_cookie_manager
))
}
// RegisterSchemeHandlerFactory (register_scheme_handler_factory)
...
...
@@ -230,6 +228,14 @@ func (d *RequestContext) ClearCertificateExceptions(callback *CompletionCallback
C
.
gocef_request_context_clear_certificate_exceptions
(
d
.
toNative
(),
callback
.
toNative
(),
d
.
clear_certificate_exceptions
)
}
// ClearHttpAuthCredentials (clear_http_auth_credentials)
// Clears all HTTP authentication credentials that were added as part of
// handling GetAuthCredentials. If |callback| is non-NULL it will be executed
// on the UI thread after completion.
func
(
d
*
RequestContext
)
ClearHttpAuthCredentials
(
callback
*
CompletionCallback
)
{
C
.
gocef_request_context_clear_http_auth_credentials
(
d
.
toNative
(),
callback
.
toNative
(),
d
.
clear_http_auth_credentials
)
}
// CloseAllConnections (close_all_connections)
// Clears all active and idle connections that Chromium currently has. This is
// only recommended if you have released all other CEF objects but don't yet
...
...
cef/RequestHandler_gen.c
浏览文件 @
d4e937fc
...
...
@@ -8,17 +8,9 @@ void gocef_set_request_handler_proxy(cef_request_handler_t *self) {
// some modifiers, such as 'const' applied to their parameter signatures.
self
->
on_before_browse
=
(
void
*
)
&
gocef_request_handler_on_before_browse
;
self
->
on_open_urlfrom_tab
=
(
void
*
)
&
gocef_request_handler_on_open_urlfrom_tab
;
self
->
on_before_resource_load
=
(
void
*
)
&
gocef_request_handler_on_before_resource_load
;
self
->
get_resource_handler
=
(
void
*
)
&
gocef_request_handler_get_resource_handler
;
self
->
on_resource_redirect
=
(
void
*
)
&
gocef_request_handler_on_resource_redirect
;
self
->
on_resource_response
=
(
void
*
)
&
gocef_request_handler_on_resource_response
;
self
->
get_resource_response_filter
=
(
void
*
)
&
gocef_request_handler_get_resource_response_filter
;
self
->
on_resource_load_complete
=
(
void
*
)
&
gocef_request_handler_on_resource_load_complete
;
self
->
get_resource_request_handler
=
(
void
*
)
&
gocef_request_handler_get_resource_request_handler
;
self
->
get_auth_credentials
=
(
void
*
)
&
gocef_request_handler_get_auth_credentials
;
self
->
can_get_cookies
=
(
void
*
)
&
gocef_request_handler_can_get_cookies
;
self
->
can_set_cookie
=
(
void
*
)
&
gocef_request_handler_can_set_cookie
;
self
->
on_quota_request
=
(
void
*
)
&
gocef_request_handler_on_quota_request
;
self
->
on_protocol_execution
=
(
void
*
)
&
gocef_request_handler_on_protocol_execution
;
self
->
on_certificate_error
=
(
void
*
)
&
gocef_request_handler_on_certificate_error
;
self
->
on_select_client_certificate
=
(
void
*
)
&
gocef_request_handler_on_select_client_certificate
;
self
->
on_plugin_crashed
=
(
void
*
)
&
gocef_request_handler_on_plugin_crashed
;
...
...
cef/RequestHandler_gen.go
浏览文件 @
d4e937fc
...
...
@@ -18,17 +18,9 @@ import (
type
RequestHandlerProxy
interface
{
OnBeforeBrowse
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
user_gesture
,
is_redirect
int32
)
int32
OnOpenUrlfromTab
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
target_url
string
,
target_disposition
WindowOpenDisposition
,
user_gesture
int32
)
int32
OnBeforeResourceLoad
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
callback
*
RequestCallback
)
ReturnValue
GetResourceHandler
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
)
*
ResourceHandler
OnResourceRedirect
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
response
*
Response
,
new_url
*
string
)
OnResourceResponse
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
response
*
Response
)
int32
GetResourceResponseFilter
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
response
*
Response
)
*
ResponseFilter
OnResourceLoadComplete
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
response
*
Response
,
status
UrlrequestStatus
,
received_content_length
int64
)
GetAuthCredentials
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
isProxy
int32
,
host
string
,
port
int32
,
realm
,
scheme
string
,
callback
*
AuthCallback
)
int32
CanGetCookies
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
)
int32
CanSetCookie
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
cookie
*
Cookie
)
int32
GetResourceRequestHandler
(
self
*
RequestHandler
,
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
is_navigation
,
is_download
int32
,
request_initiator
string
,
disable_default_handling
*
int32
)
*
ResourceRequestHandler
GetAuthCredentials
(
self
*
RequestHandler
,
browser
*
Browser
,
origin_url
string
,
isProxy
int32
,
host
string
,
port
int32
,
realm
,
scheme
string
,
callback
*
AuthCallback
)
int32
OnQuotaRequest
(
self
*
RequestHandler
,
browser
*
Browser
,
origin_url
string
,
new_size
int64
,
callback
*
RequestCallback
)
int32
OnProtocolExecution
(
self
*
RequestHandler
,
browser
*
Browser
,
url
string
,
allow_os_execution
*
int32
)
OnCertificateError
(
self
*
RequestHandler
,
browser
*
Browser
,
cert_error
Errorcode
,
request_url
string
,
ssl_info
*
Sslinfo
,
callback
*
RequestCallback
)
int32
OnSelectClientCertificate
(
self
*
RequestHandler
,
browser
*
Browser
,
isProxy
int32
,
host
string
,
port
int32
,
certificatesCount
uint64
,
certificates
**
X509certificate
,
callback
*
SelectClientCertificateCallback
)
int32
OnPluginCrashed
(
self
*
RequestHandler
,
browser
*
Browser
,
plugin_path
string
)
...
...
@@ -124,170 +116,59 @@ func gocef_request_handler_on_open_urlfrom_tab(self *C.cef_request_handler_t, br
return
C
.
int
(
proxy__
.
OnOpenUrlfromTab
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
target_url_
,
WindowOpenDisposition
(
target_disposition
),
int32
(
user_gesture
)))
}
// OnBeforeResourceLoad (on_before_resource_load)
// Called on the IO thread before a resource request is loaded. The |request|
// object may be modified. Return RV_CONTINUE to continue the request
// immediately. Return RV_CONTINUE_ASYNC and call cef_request_tCallback::
// cont() at a later time to continue or cancel the request asynchronously.
// Return RV_CANCEL to cancel the request immediately.
//
func
(
d
*
RequestHandler
)
OnBeforeResourceLoad
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
callback
*
RequestCallback
)
ReturnValue
{
return
lookupRequestHandlerProxy
(
d
.
Base
())
.
OnBeforeResourceLoad
(
d
,
browser
,
frame
,
request
,
callback
)
// GetResourceRequestHandler (get_resource_request_handler)
// Called on the browser process IO thread before a resource request is
// initiated. The |browser| and |frame| values represent the source of the
// request. |request| represents the request contents and cannot be modified
// in this callback. |is_navigation| will be true (1) if the resource request
// is a navigation. |is_download| will be true (1) if the resource request is
// a download. |request_initiator| is the origin (scheme + domain) of the page
// that initiated the request. Set |disable_default_handling| to true (1) to
// disable default handling of the request, in which case it will need to be
// handled via cef_resource_request_handler_t::GetResourceHandler or it will
// be canceled. To allow the resource load to proceed with default handling
// return NULL. To specify a handler for the resource return a
// cef_resource_request_handler_t object. If this callback returns NULL the
// same function will be called on the associated cef_request_tContextHandler,
// if any.
func
(
d
*
RequestHandler
)
GetResourceRequestHandler
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
is_navigation
,
is_download
int32
,
request_initiator
string
,
disable_default_handling
*
int32
)
*
ResourceRequestHandler
{
return
lookupRequestHandlerProxy
(
d
.
Base
())
.
GetResourceRequestHandler
(
d
,
browser
,
frame
,
request
,
is_navigation
,
is_download
,
request_initiator
,
disable_default_handling
)
}
//nolint:gocritic
//export gocef_request_handler_
on_before_resource_load
func
gocef_request_handler_
on_before_resource_load
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
,
callback
*
C
.
cef_request_callback_t
)
C
.
cef_return_value
_t
{
//export gocef_request_handler_
get_resource_request_handler
func
gocef_request_handler_
get_resource_request_handler
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
,
is_navigation
C
.
int
,
is_download
C
.
int
,
request_initiator
*
C
.
cef_string_t
,
disable_default_handling
*
C
.
int
)
*
C
.
cef_resource_request_handler
_t
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
return
C
.
cef_return_value_t
(
proxy__
.
OnBeforeResourceLoad
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
),
(
*
RequestCallback
)(
callback
)))
}
// GetResourceHandler (get_resource_handler)
// Called on the IO thread before a resource is loaded. To allow the resource
// to load normally return NULL. To specify a handler for the resource return
// a cef_resource_handler_t object. The |request| object should not be
// modified in this callback.
func
(
d
*
RequestHandler
)
GetResourceHandler
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
)
*
ResourceHandler
{
return
lookupRequestHandlerProxy
(
d
.
Base
())
.
GetResourceHandler
(
d
,
browser
,
frame
,
request
)
}
//nolint:gocritic
//export gocef_request_handler_get_resource_handler
func
gocef_request_handler_get_resource_handler
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
)
*
C
.
cef_resource_handler_t
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
return
(
proxy__
.
GetResourceHandler
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
)))
.
toNative
()
}
// OnResourceRedirect (on_resource_redirect)
// Called on the IO thread when a resource load is redirected. The |request|
// parameter will contain the old URL and other request-related information.
// The |response| parameter will contain the response that resulted in the
// redirect. The |new_url| parameter will contain the new URL and can be
// changed if desired. The |request| object cannot be modified in this
// callback.
func
(
d
*
RequestHandler
)
OnResourceRedirect
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
response
*
Response
,
new_url
*
string
)
{
lookupRequestHandlerProxy
(
d
.
Base
())
.
OnResourceRedirect
(
d
,
browser
,
frame
,
request
,
response
,
new_url
)
}
//nolint:gocritic
//export gocef_request_handler_on_resource_redirect
func
gocef_request_handler_on_resource_redirect
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
,
response
*
C
.
cef_response_t
,
new_url
*
C
.
cef_string_t
)
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
new_url_
:=
cefstrToString
(
new_url
)
proxy__
.
OnResourceRedirect
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
),
(
*
Response
)(
response
),
&
new_url_
)
}
// OnResourceResponse (on_resource_response)
// Called on the IO thread when a resource response is received. To allow the
// resource to load normally return false (0). To redirect or retry the
// resource modify |request| (url, headers or post body) and return true (1).
// The |response| object cannot be modified in this callback.
func
(
d
*
RequestHandler
)
OnResourceResponse
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
response
*
Response
)
int32
{
return
lookupRequestHandlerProxy
(
d
.
Base
())
.
OnResourceResponse
(
d
,
browser
,
frame
,
request
,
response
)
}
//nolint:gocritic
//export gocef_request_handler_on_resource_response
func
gocef_request_handler_on_resource_response
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
,
response
*
C
.
cef_response_t
)
C
.
int
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
return
C
.
int
(
proxy__
.
OnResourceResponse
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
),
(
*
Response
)(
response
)))
}
// GetResourceResponseFilter (get_resource_response_filter)
// Called on the IO thread to optionally filter resource response content.
// |request| and |response| represent the request and response respectively
// and cannot be modified in this callback.
func
(
d
*
RequestHandler
)
GetResourceResponseFilter
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
response
*
Response
)
*
ResponseFilter
{
return
lookupRequestHandlerProxy
(
d
.
Base
())
.
GetResourceResponseFilter
(
d
,
browser
,
frame
,
request
,
response
)
}
//nolint:gocritic
//export gocef_request_handler_get_resource_response_filter
func
gocef_request_handler_get_resource_response_filter
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
,
response
*
C
.
cef_response_t
)
*
C
.
cef_response_filter_t
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
return
(
proxy__
.
GetResourceResponseFilter
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
),
(
*
Response
)(
response
)))
.
toNative
()
}
// OnResourceLoadComplete (on_resource_load_complete)
// Called on the IO thread when a resource load has completed. |request| and
// |response| represent the request and response respectively and cannot be
// modified in this callback. |status| indicates the load completion status.
// |received_content_length| is the number of response bytes actually read.
func
(
d
*
RequestHandler
)
OnResourceLoadComplete
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
response
*
Response
,
status
UrlrequestStatus
,
received_content_length
int64
)
{
lookupRequestHandlerProxy
(
d
.
Base
())
.
OnResourceLoadComplete
(
d
,
browser
,
frame
,
request
,
response
,
status
,
received_content_length
)
}
//nolint:gocritic
//export gocef_request_handler_on_resource_load_complete
func
gocef_request_handler_on_resource_load_complete
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
,
response
*
C
.
cef_response_t
,
status
C
.
cef_urlrequest_status_t
,
received_content_length
C
.
int64
)
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
proxy__
.
OnResourceLoadComplete
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
),
(
*
Response
)(
response
),
UrlrequestStatus
(
status
),
int64
(
received_content_length
))
request_initiator_
:=
cefstrToString
(
request_initiator
)
return
(
proxy__
.
GetResourceRequestHandler
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
),
int32
(
is_navigation
),
int32
(
is_download
),
request_initiator_
,
(
*
int32
)(
disable_default_handling
)))
.
toNative
()
}
// GetAuthCredentials (get_auth_credentials)
// Called on the IO thread when the browser needs credentials from the user.
// |isProxy| indicates whether the host is a proxy server. |host| contains the
// hostname and |port| contains the port number. |realm| is the realm of the
// challenge and may be NULL. |scheme| is the authentication scheme used, such
// as "basic" or "digest", and will be NULL if the source of the request is an
// |origin_url| is the origin making this authentication request. |isProxy|
// indicates whether the host is a proxy server. |host| contains the hostname
// and |port| contains the port number. |realm| is the realm of the challenge
// and may be NULL. |scheme| is the authentication scheme used, such as
// "basic" or "digest", and will be NULL if the source of the request is an
// FTP server. Return true (1) to continue the request and call
// cef_auth_callback_t::cont() either in this function or at a later time when
// the authentication information is available. Return false (0) to cancel the
// request immediately.
func
(
d
*
RequestHandler
)
GetAuthCredentials
(
browser
*
Browser
,
frame
*
Frame
,
isProxy
int32
,
host
string
,
port
int32
,
realm
,
scheme
string
,
callback
*
AuthCallback
)
int32
{
return
lookupRequestHandlerProxy
(
d
.
Base
())
.
GetAuthCredentials
(
d
,
browser
,
frame
,
isProxy
,
host
,
port
,
realm
,
scheme
,
callback
)
func
(
d
*
RequestHandler
)
GetAuthCredentials
(
browser
*
Browser
,
origin_url
string
,
isProxy
int32
,
host
string
,
port
int32
,
realm
,
scheme
string
,
callback
*
AuthCallback
)
int32
{
return
lookupRequestHandlerProxy
(
d
.
Base
())
.
GetAuthCredentials
(
d
,
browser
,
origin_url
,
isProxy
,
host
,
port
,
realm
,
scheme
,
callback
)
}
//nolint:gocritic
//export gocef_request_handler_get_auth_credentials
func
gocef_request_handler_get_auth_credentials
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame
_t
,
isProxy
C
.
int
,
host
*
C
.
cef_string_t
,
port
C
.
int
,
realm
*
C
.
cef_string_t
,
scheme
*
C
.
cef_string_t
,
callback
*
C
.
cef_auth_callback_t
)
C
.
int
{
func
gocef_request_handler_get_auth_credentials
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
origin_url
*
C
.
cef_string
_t
,
isProxy
C
.
int
,
host
*
C
.
cef_string_t
,
port
C
.
int
,
realm
*
C
.
cef_string_t
,
scheme
*
C
.
cef_string_t
,
callback
*
C
.
cef_auth_callback_t
)
C
.
int
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
origin_url_
:=
cefstrToString
(
origin_url
)
host_
:=
cefstrToString
(
host
)
realm_
:=
cefstrToString
(
realm
)
scheme_
:=
cefstrToString
(
scheme
)
return
C
.
int
(
proxy__
.
GetAuthCredentials
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
int32
(
isProxy
),
host_
,
int32
(
port
),
realm_
,
scheme_
,
(
*
AuthCallback
)(
callback
)))
}
// CanGetCookies (can_get_cookies)
// Called on the IO thread before sending a network request with a "Cookie"
// request header. Return true (1) to allow cookies to be included in the
// network request or false (0) to block cookies. The |request| object should
// not be modified in this callback.
func
(
d
*
RequestHandler
)
CanGetCookies
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
)
int32
{
return
lookupRequestHandlerProxy
(
d
.
Base
())
.
CanGetCookies
(
d
,
browser
,
frame
,
request
)
}
//nolint:gocritic
//export gocef_request_handler_can_get_cookies
func
gocef_request_handler_can_get_cookies
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
)
C
.
int
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
return
C
.
int
(
proxy__
.
CanGetCookies
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
)))
}
// CanSetCookie (can_set_cookie)
// Called on the IO thread when receiving a network request with a "Set-
// Cookie" response header value represented by |cookie|. Return true (1) to
// allow the cookie to be stored or false (0) to block the cookie. The
// |request| object should not be modified in this callback.
func
(
d
*
RequestHandler
)
CanSetCookie
(
browser
*
Browser
,
frame
*
Frame
,
request
*
Request
,
cookie
*
Cookie
)
int32
{
return
lookupRequestHandlerProxy
(
d
.
Base
())
.
CanSetCookie
(
d
,
browser
,
frame
,
request
,
cookie
)
}
//nolint:gocritic
//export gocef_request_handler_can_set_cookie
func
gocef_request_handler_can_set_cookie
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
frame
*
C
.
cef_frame_t
,
request
*
C
.
cef_request_t
,
cookie
*
C
.
cef_cookie_t
)
C
.
int
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
cookie_
:=
cookie
.
toGo
()
return
C
.
int
(
proxy__
.
CanSetCookie
(
me__
,
(
*
Browser
)(
browser
),
(
*
Frame
)(
frame
),
(
*
Request
)(
request
),
cookie_
))
return
C
.
int
(
proxy__
.
GetAuthCredentials
(
me__
,
(
*
Browser
)(
browser
),
origin_url_
,
int32
(
isProxy
),
host_
,
int32
(
port
),
realm_
,
scheme_
,
(
*
AuthCallback
)(
callback
)))
}
// OnQuotaRequest (on_quota_request)
...
...
@@ -311,25 +192,6 @@ func gocef_request_handler_on_quota_request(self *C.cef_request_handler_t, brows
return
C
.
int
(
proxy__
.
OnQuotaRequest
(
me__
,
(
*
Browser
)(
browser
),
origin_url_
,
int64
(
new_size
),
(
*
RequestCallback
)(
callback
)))
}
// OnProtocolExecution (on_protocol_execution)
// Called on the UI thread to handle requests for URLs with an unknown
// protocol component. Set |allow_os_execution| to true (1) to attempt
// execution via the registered OS protocol handler, if any. SECURITY WARNING:
// YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR
// OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.
func
(
d
*
RequestHandler
)
OnProtocolExecution
(
browser
*
Browser
,
url
string
,
allow_os_execution
*
int32
)
{
lookupRequestHandlerProxy
(
d
.
Base
())
.
OnProtocolExecution
(
d
,
browser
,
url
,
allow_os_execution
)
}
//nolint:gocritic
//export gocef_request_handler_on_protocol_execution
func
gocef_request_handler_on_protocol_execution
(
self
*
C
.
cef_request_handler_t
,
browser
*
C
.
cef_browser_t
,
url
*
C
.
cef_string_t
,
allow_os_execution
*
C
.
int
)
{
me__
:=
(
*
RequestHandler
)(
self
)
proxy__
:=
lookupRequestHandlerProxy
(
me__
.
Base
())
url_
:=
cefstrToString
(
url
)
proxy__
.
OnProtocolExecution
(
me__
,
(
*
Browser
)(
browser
),
url_
,
(
*
int32
)(
allow_os_execution
))
}
// OnCertificateError (on_certificate_error)
// Called on the UI thread to handle requests for URLs with an invalid SSL
// certificate. Return true (1) and call cef_request_tCallback::cont() either
...
...
cef/Request_gen.go
浏览文件 @
d4e937fc
...
...
@@ -16,6 +16,8 @@ import (
// void gocef_request_set_post_data(cef_request_t * self, cef_post_data_t * postData, void (CEF_CALLBACK *callback__)(cef_request_t *, cef_post_data_t *)) { return callback__(self, postData); }
// void gocef_request_get_header_map(cef_request_t * self, cef_string_multimap_t headerMap, void (CEF_CALLBACK *callback__)(cef_request_t *, cef_string_multimap_t)) { return callback__(self, headerMap); }
// void gocef_request_set_header_map(cef_request_t * self, cef_string_multimap_t headerMap, void (CEF_CALLBACK *callback__)(cef_request_t *, cef_string_multimap_t)) { return callback__(self, headerMap); }
// cef_string_userfree_t gocef_request_get_header_by_name(cef_request_t * self, cef_string_t * name, cef_string_userfree_t (CEF_CALLBACK *callback__)(cef_request_t *, cef_string_t *)) { return callback__(self, name); }
// void gocef_request_set_header_by_name(cef_request_t * self, cef_string_t * name, cef_string_t * value, int overwrite, void (CEF_CALLBACK *callback__)(cef_request_t *, cef_string_t *, cef_string_t *, int)) { return callback__(self, name, value, overwrite); }
// void gocef_request_set(cef_request_t * self, cef_string_t * url, cef_string_t * method, cef_post_data_t * postData, cef_string_multimap_t headerMap, void (CEF_CALLBACK *callback__)(cef_request_t *, cef_string_t *, cef_string_t *, cef_post_data_t *, cef_string_multimap_t)) { return callback__(self, url, method, postData, headerMap); }
// int gocef_request_get_flags(cef_request_t * self, int (CEF_CALLBACK *callback__)(cef_request_t *)) { return callback__(self); }
// void gocef_request_set_flags(cef_request_t * self, int flags, void (CEF_CALLBACK *callback__)(cef_request_t *, int)) { return callback__(self, flags); }
...
...
@@ -136,6 +138,39 @@ func (d *Request) SetHeaderMap(headerMap StringMultimap) {
C
.
gocef_request_set_header_map
(
d
.
toNative
(),
C
.
cef_string_multimap_t
(
headerMap
),
d
.
set_header_map
)
}
// GetHeaderByName (get_header_by_name)
// Returns the first header value for |name| or an NULL string if not found.
// Will not return the Referer value if any. Use GetHeaderMap instead if
// |name| might have multiple values.
// The resulting string must be freed by calling cef_string_userfree_free().
func
(
d
*
Request
)
GetHeaderByName
(
name
string
)
string
{
name_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
name
,
name_
)
defer
func
()
{
C
.
cef_string_userfree_free
(
name_
)
}()
return
cefuserfreestrToString
(
C
.
gocef_request_get_header_by_name
(
d
.
toNative
(),
(
*
C
.
cef_string_t
)(
name_
),
d
.
get_header_by_name
))
}
// SetHeaderByName (set_header_by_name)
// Set the header |name| to |value|. If |overwrite| is true (1) any existing
// values will be replaced with the new value. If |overwrite| is false (0) any
// existing values will not be overwritten. The Referer value cannot be set
// using this function.
func
(
d
*
Request
)
SetHeaderByName
(
name
,
value
string
,
overwrite
int32
)
{
name_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
name
,
name_
)
defer
func
()
{
C
.
cef_string_userfree_free
(
name_
)
}()
value_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
value
,
value_
)
defer
func
()
{
C
.
cef_string_userfree_free
(
value_
)
}()
C
.
gocef_request_set_header_by_name
(
d
.
toNative
(),
(
*
C
.
cef_string_t
)(
name_
),
(
*
C
.
cef_string_t
)(
value_
),
C
.
int
(
overwrite
),
d
.
set_header_by_name
)
}
// Set (set)
// Set all values at one time.
func
(
d
*
Request
)
Set
(
url
,
method
string
,
postData
*
PostData
,
headerMap
StringMultimap
)
{
...
...
@@ -203,8 +238,8 @@ func (d *Request) GetTransitionType() TransitionType {
// GetIdentifier (get_identifier)
// Returns the globally unique identifier for this request or 0 if not
// specified. Can be used by cef_re
quest_tHandler implementations in the
// browser process to track a single request across multiple callbacks.
// specified. Can be used by cef_re
source_request_handler_t implementations in
//
the
browser process to track a single request across multiple callbacks.
func
(
d
*
Request
)
GetIdentifier
()
uint64
{
return
uint64
(
C
.
gocef_request_get_identifier
(
d
.
toNative
(),
d
.
get_identifier
))
}
cef/ResourceHandler_gen.c
浏览文件 @
d4e937fc
...
...
@@ -6,10 +6,11 @@
void
gocef_set_resource_handler_proxy
(
cef_resource_handler_t
*
self
)
{
// Casts to (void *) added to avoid warnings since Go callbacks can't have
// some modifiers, such as 'const' applied to their parameter signatures.
self
->
open
=
(
void
*
)
&
gocef_resource_handler_open
;
self
->
process_request
=
(
void
*
)
&
gocef_resource_handler_process_request
;
self
->
get_response_headers
=
(
void
*
)
&
gocef_resource_handler_get_response_headers
;
self
->
skip
=
(
void
*
)
&
gocef_resource_handler_skip
;
self
->
read
=
(
void
*
)
&
gocef_resource_handler_read
;
self
->
read_response
=
(
void
*
)
&
gocef_resource_handler_read_response
;
self
->
can_get_cookie
=
(
void
*
)
&
gocef_resource_handler_can_get_cookie
;
self
->
can_set_cookie
=
(
void
*
)
&
gocef_resource_handler_can_set_cookie
;
self
->
cancel
=
(
void
*
)
&
gocef_resource_handler_cancel
;
}
cef/ResourceHandler_gen.go
浏览文件 @
d4e937fc
...
...
@@ -16,17 +16,18 @@ import (
// ResourceHandlerProxy defines methods required for using ResourceHandler.
type
ResourceHandlerProxy
interface
{
Open
(
self
*
ResourceHandler
,
request
*
Request
,
handle_request
*
int32
,
callback
*
Callback
)
int32
ProcessRequest
(
self
*
ResourceHandler
,
request
*
Request
,
callback
*
Callback
)
int32
GetResponseHeaders
(
self
*
ResourceHandler
,
response
*
Response
,
response_length
*
int64
,
redirectUrl
*
string
)
Skip
(
self
*
ResourceHandler
,
bytes_to_skip
int64
,
bytes_skipped
*
int64
,
callback
*
ResourceSkipCallback
)
int32
Read
(
self
*
ResourceHandler
,
data_out
unsafe
.
Pointer
,
bytes_to_read
int32
,
bytes_read
*
int32
,
callback
*
ResourceReadCallback
)
int32
ReadResponse
(
self
*
ResourceHandler
,
data_out
unsafe
.
Pointer
,
bytes_to_read
int32
,
bytes_read
*
int32
,
callback
*
Callback
)
int32
CanGetCookie
(
self
*
ResourceHandler
,
cookie
*
Cookie
)
int32
CanSetCookie
(
self
*
ResourceHandler
,
cookie
*
Cookie
)
int32
Cancel
(
self
*
ResourceHandler
)
}
// ResourceHandler (cef_resource_handler_t from include/capi/cef_resource_handler_capi.h)
// Structure used to implement a custom request handler structure. The functions
// of this structure will
always be called on the IO threa
d.
// of this structure will
be called on the IO thread unless otherwise indicate
d.
type
ResourceHandler
C
.
cef_resource_handler_t
// NewResourceHandler creates a new ResourceHandler with the specified proxy. Passing
...
...
@@ -61,12 +62,35 @@ func (d *ResourceHandler) Base() *BaseRefCounted {
return
(
*
BaseRefCounted
)(
&
d
.
base
)
}
// Open (open)
// Open the response stream. To handle the request immediately set
// |handle_request| to true (1) and return true (1). To decide at a later time
// set |handle_request| to false (0), return true (1), and execute |callback|
// to continue or cancel the request. To cancel the request immediately set
// |handle_request| to true (1) and return false (0). This function will be
// called in sequence but not from a dedicated thread. For backwards
// compatibility set |handle_request| to false (0) and return false (0) and
// the ProcessRequest function will be called.
func
(
d
*
ResourceHandler
)
Open
(
request
*
Request
,
handle_request
*
int32
,
callback
*
Callback
)
int32
{
return
lookupResourceHandlerProxy
(
d
.
Base
())
.
Open
(
d
,
request
,
handle_request
,
callback
)
}
//nolint:gocritic
//export gocef_resource_handler_open
func
gocef_resource_handler_open
(
self
*
C
.
cef_resource_handler_t
,
request
*
C
.
cef_request_t
,
handle_request
*
C
.
int
,
callback
*
C
.
cef_callback_t
)
C
.
int
{
me__
:=
(
*
ResourceHandler
)(
self
)
proxy__
:=
lookupResourceHandlerProxy
(
me__
.
Base
())
return
C
.
int
(
proxy__
.
Open
(
me__
,
(
*
Request
)(
request
),
(
*
int32
)(
handle_request
),
(
*
Callback
)(
callback
)))
}
// ProcessRequest (process_request)
// Begin processing the request. To handle the request return true (1) and
// call cef_callback_t::cont() once the response header information is
// available (cef_callback_t::cont() can also be called from inside this
// function if header information is available immediately). To cancel the
// request return false (0).
//
// WARNING: This function is deprecated. Use Open instead.
func
(
d
*
ResourceHandler
)
ProcessRequest
(
request
*
Request
,
callback
*
Callback
)
int32
{
return
lookupResourceHandlerProxy
(
d
.
Base
())
.
ProcessRequest
(
d
,
request
,
callback
)
}
...
...
@@ -106,55 +130,68 @@ func gocef_resource_handler_get_response_headers(self *C.cef_resource_handler_t,
proxy__
.
GetResponseHeaders
(
me__
,
(
*
Response
)(
response
),
(
*
int64
)(
response_length
),
&
redirectUrl_
)
}
// ReadResponse (read_response)
// Read response data. If data is available immediately copy up to
// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
// bytes copied, and return true (1). To read the data at a later time set
// |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the
// data is available. To indicate response completion return false (0).
func
(
d
*
ResourceHandler
)
ReadResponse
(
data_out
unsafe
.
Pointer
,
bytes_to_read
int32
,
bytes_read
*
int32
,
callback
*
Callback
)
int32
{
return
lookupResourceHandlerProxy
(
d
.
Base
())
.
ReadResponse
(
d
,
data_out
,
bytes_to_read
,
bytes_read
,
callback
)
// Skip (skip)
// Skip response data when requested by a Range header. Skip over and discard
// |bytes_to_skip| bytes of response data. If data is available immediately
// set |bytes_skipped| to the number of of bytes skipped and return true (1).
// To read the data at a later time set |bytes_skipped| to 0, return true (1)
// and execute |callback| when the data is available. To indicate failure set
// |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
// function will be called in sequence but not from a dedicated thread.
func
(
d
*
ResourceHandler
)
Skip
(
bytes_to_skip
int64
,
bytes_skipped
*
int64
,
callback
*
ResourceSkipCallback
)
int32
{
return
lookupResourceHandlerProxy
(
d
.
Base
())
.
Skip
(
d
,
bytes_to_skip
,
bytes_skipped
,
callback
)
}
//nolint:gocritic
//export gocef_resource_handler_
read_response
func
gocef_resource_handler_
read_response
(
self
*
C
.
cef_resource_handler_t
,
data_out
unsafe
.
Pointer
,
bytes_to_read
C
.
int
,
bytes_read
*
C
.
int
,
callback
*
C
.
cef
_callback_t
)
C
.
int
{
//export gocef_resource_handler_
skip
func
gocef_resource_handler_
skip
(
self
*
C
.
cef_resource_handler_t
,
bytes_to_skip
C
.
int64
,
bytes_skipped
*
C
.
int64
,
callback
*
C
.
cef_resource_skip
_callback_t
)
C
.
int
{
me__
:=
(
*
ResourceHandler
)(
self
)
proxy__
:=
lookupResourceHandlerProxy
(
me__
.
Base
())
return
C
.
int
(
proxy__
.
ReadResponse
(
me__
,
data_out
,
int32
(
bytes_to_read
),
(
*
int32
)(
bytes_read
),
(
*
Callback
)(
callback
)))
return
C
.
int
(
proxy__
.
Skip
(
me__
,
int64
(
bytes_to_skip
),
(
*
int64
)(
bytes_skipped
),
(
*
ResourceSkip
Callback
)(
callback
)))
}
// CanGetCookie (can_get_cookie)
// Return true (1) if the specified cookie can be sent with the request or
// false (0) otherwise. If false (0) is returned for any cookie then no
// cookies will be sent with the request.
func
(
d
*
ResourceHandler
)
CanGetCookie
(
cookie
*
Cookie
)
int32
{
return
lookupResourceHandlerProxy
(
d
.
Base
())
.
CanGetCookie
(
d
,
cookie
)
// Read (read)
// Read response data. If data is available immediately copy up to
// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
// bytes copied, and return true (1). To read the data at a later time keep a
// pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute
// |callback| when the data is available (|data_out| will remain valid until
// the callback is executed). To indicate response completion set |bytes_read|
// to 0 and return false (0). To indicate failure set |bytes_read| to < 0
// (e.g. -2 for ERR_FAILED) and return false (0). This function will be called
// in sequence but not from a dedicated thread. For backwards compatibility
// set |bytes_read| to -1 and return false (0) and the ReadResponse function
// will be called.
func
(
d
*
ResourceHandler
)
Read
(
data_out
unsafe
.
Pointer
,
bytes_to_read
int32
,
bytes_read
*
int32
,
callback
*
ResourceReadCallback
)
int32
{
return
lookupResourceHandlerProxy
(
d
.
Base
())
.
Read
(
d
,
data_out
,
bytes_to_read
,
bytes_read
,
callback
)
}
//nolint:gocritic
//export gocef_resource_handler_
can_get_cookie
func
gocef_resource_handler_
can_get_cookie
(
self
*
C
.
cef_resource_handler_t
,
cookie
*
C
.
cef_cookie
_t
)
C
.
int
{
//export gocef_resource_handler_
read
func
gocef_resource_handler_
read
(
self
*
C
.
cef_resource_handler_t
,
data_out
unsafe
.
Pointer
,
bytes_to_read
C
.
int
,
bytes_read
*
C
.
int
,
callback
*
C
.
cef_resource_read_callback
_t
)
C
.
int
{
me__
:=
(
*
ResourceHandler
)(
self
)
proxy__
:=
lookupResourceHandlerProxy
(
me__
.
Base
())
cookie_
:=
cookie
.
toGo
()
return
C
.
int
(
proxy__
.
CanGetCookie
(
me__
,
cookie_
))
return
C
.
int
(
proxy__
.
Read
(
me__
,
data_out
,
int32
(
bytes_to_read
),
(
*
int32
)(
bytes_read
),
(
*
ResourceReadCallback
)(
callback
)))
}
// CanSetCookie (can_set_cookie)
// Return true (1) if the specified cookie returned with the response can be
// set or false (0) otherwise.
func
(
d
*
ResourceHandler
)
CanSetCookie
(
cookie
*
Cookie
)
int32
{
return
lookupResourceHandlerProxy
(
d
.
Base
())
.
CanSetCookie
(
d
,
cookie
)
// ReadResponse (read_response)
// Read response data. If data is available immediately copy up to
// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
// bytes copied, and return true (1). To read the data at a later time set
// |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the
// data is available. To indicate response completion return false (0).
//
// WARNING: This function is deprecated. Use Skip and Read instead.
func
(
d
*
ResourceHandler
)
ReadResponse
(
data_out
unsafe
.
Pointer
,
bytes_to_read
int32
,
bytes_read
*
int32
,
callback
*
Callback
)
int32
{
return
lookupResourceHandlerProxy
(
d
.
Base
())
.
ReadResponse
(
d
,
data_out
,
bytes_to_read
,
bytes_read
,
callback
)
}
//nolint:gocritic
//export gocef_resource_handler_
can_set_cooki
e
func
gocef_resource_handler_
can_set_cookie
(
self
*
C
.
cef_resource_handler_t
,
cookie
*
C
.
cef_cookie
_t
)
C
.
int
{
//export gocef_resource_handler_
read_respons
e
func
gocef_resource_handler_
read_response
(
self
*
C
.
cef_resource_handler_t
,
data_out
unsafe
.
Pointer
,
bytes_to_read
C
.
int
,
bytes_read
*
C
.
int
,
callback
*
C
.
cef_callback
_t
)
C
.
int
{
me__
:=
(
*
ResourceHandler
)(
self
)
proxy__
:=
lookupResourceHandlerProxy
(
me__
.
Base
())
cookie_
:=
cookie
.
toGo
()
return
C
.
int
(
proxy__
.
CanSetCookie
(
me__
,
cookie_
))
return
C
.
int
(
proxy__
.
ReadResponse
(
me__
,
data_out
,
int32
(
bytes_to_read
),
(
*
int32
)(
bytes_read
),
(
*
Callback
)(
callback
)))
}
// Cancel (cancel)
...
...
cef/Response_gen.go
浏览文件 @
d4e937fc
...
...
@@ -13,6 +13,8 @@ import (
// void gocef_response_set_status_text(cef_response_t * self, cef_string_t * statusText, void (CEF_CALLBACK *callback__)(cef_response_t *, cef_string_t *)) { return callback__(self, statusText); }
// cef_string_userfree_t gocef_response_get_mime_type(cef_response_t * self, cef_string_userfree_t (CEF_CALLBACK *callback__)(cef_response_t *)) { return callback__(self); }
// void gocef_response_set_mime_type(cef_response_t * self, cef_string_t * mimeType, void (CEF_CALLBACK *callback__)(cef_response_t *, cef_string_t *)) { return callback__(self, mimeType); }
// cef_string_userfree_t gocef_response_get_charset(cef_response_t * self, cef_string_userfree_t (CEF_CALLBACK *callback__)(cef_response_t *)) { return callback__(self); }
// void gocef_response_set_charset(cef_response_t * self, cef_string_t * charset, void (CEF_CALLBACK *callback__)(cef_response_t *, cef_string_t *)) { return callback__(self, charset); }
// cef_string_userfree_t gocef_response_get_header(cef_response_t * self, cef_string_t * name, cef_string_userfree_t (CEF_CALLBACK *callback__)(cef_response_t *, cef_string_t *)) { return callback__(self, name); }
// void gocef_response_get_header_map(cef_response_t * self, cef_string_multimap_t headerMap, void (CEF_CALLBACK *callback__)(cef_response_t *, cef_string_multimap_t)) { return callback__(self, headerMap); }
// void gocef_response_set_header_map(cef_response_t * self, cef_string_multimap_t headerMap, void (CEF_CALLBACK *callback__)(cef_response_t *, cef_string_multimap_t)) { return callback__(self, headerMap); }
...
...
@@ -103,6 +105,24 @@ func (d *Response) SetMimeType(mimeType string) {
C
.
gocef_response_set_mime_type
(
d
.
toNative
(),
(
*
C
.
cef_string_t
)(
mimeType_
),
d
.
set_mime_type
)
}
// GetCharset (get_charset)
// Get the response charset.
// The resulting string must be freed by calling cef_string_userfree_free().
func
(
d
*
Response
)
GetCharset
()
string
{
return
cefuserfreestrToString
(
C
.
gocef_response_get_charset
(
d
.
toNative
(),
d
.
get_charset
))
}
// SetCharset (set_charset)
// Set the response charset.
func
(
d
*
Response
)
SetCharset
(
charset
string
)
{
charset_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
charset
,
charset_
)
defer
func
()
{
C
.
cef_string_userfree_free
(
charset_
)
}()
C
.
gocef_response_set_charset
(
d
.
toNative
(),
(
*
C
.
cef_string_t
)(
charset_
),
d
.
set_charset
)
}
// GetHeader (get_header)
// Get the value for the specified response header field.
// The resulting string must be freed by calling cef_string_userfree_free().
...
...
cef/SchemeHandlerFactory_gen.go
浏览文件 @
d4e937fc
...
...
@@ -30,7 +30,7 @@ func (d *SchemeHandlerFactory) Base() *BaseRefCounted {
// will be the browser window and frame respectively that originated the
// request or NULL if the request did not originate from a browser window (for
// example, if the request came from cef_urlrequest_t). The |request| object
// passed to this function
will not contain cookie data
.
// passed to this function
cannot be modified
.
func
(
d
*
SchemeHandlerFactory
)
Create
(
browser
*
Browser
,
frame
*
Frame
,
scheme_name
string
,
request
*
Request
)
*
ResourceHandler
{
scheme_name_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
scheme_name
,
scheme_name_
)
...
...
cef/Settings_gen.go
浏览文件 @
d4e937fc
...
...
@@ -69,13 +69,23 @@ type Settings struct {
// CefApp::OnBeforeCommandLineProcessing() method.
CommandLineArgsDisabled
int32
// CachePath (cache_path)
// The location where cache data will be stored on disk. If empty then
// browsers will be created in "incognito mode" where in-memory caches are
// used for storage and no data is persisted to disk. HTML5 databases such as
// localStorage will only persist across sessions if a cache path is
// specified. Can be overridden for individual CefRequestContext instances via
// the CefRequestContextSettings.cache_path value.
// The location where data for the global browser cache will be stored on
// disk. In non-empty this must be either equal to or a child directory of
// CefSettings.root_cache_path. If empty then browsers will be created in
// "incognito mode" where in-memory caches are used for storage and no data is
// persisted to disk. HTML5 databases such as localStorage will only persist
// across sessions if a cache path is specified. Can be overridden for
// individual CefRequestContext instances via the
// CefRequestContextSettings.cache_path value.
CachePath
string
// RootCachePath (root_cache_path)
// The root directory that all CefSettings.cache_path and
// CefRequestContextSettings.cache_path values must have in common. If this
// value is empty and CefSettings.cache_path is non-empty then this value will
// default to the CefSettings.cache_path value. Failure to set this value
// correctly may result in the sandbox blocking read/write access to the
// cache_path directory.
RootCachePath
string
// UserDataPath (user_data_path)
// The location where user data such as spell checking dictionary files will
// be stored on disk. If empty then the default platform-specific user data
...
...
@@ -213,6 +223,12 @@ type Settings struct {
// for individual CefRequestContext instances via the
// CefRequestContextSettings.accept_language_list value.
AcceptLanguageList
string
// ApplicationClientIdForFileScanning (application_client_id_for_file_scanning)
// GUID string used for identifying the application. This is passed to the
// system AV function for scanning downloaded files. By default, the GUID
// will be an empty string and the file will be treated as an untrusted
// file when the GUID is empty.
ApplicationClientIdForFileScanning
string
}
// NewSettings creates a new Settings.
...
...
@@ -241,6 +257,7 @@ func (d *Settings) toNative(native *C.cef_settings_t) *C.cef_settings_t {
native
.
windowless_rendering_enabled
=
C
.
int
(
d
.
WindowlessRenderingEnabled
)
native
.
command_line_args_disabled
=
C
.
int
(
d
.
CommandLineArgsDisabled
)
setCEFStr
(
d
.
CachePath
,
&
native
.
cache_path
)
setCEFStr
(
d
.
RootCachePath
,
&
native
.
root_cache_path
)
setCEFStr
(
d
.
UserDataPath
,
&
native
.
user_data_path
)
native
.
persist_session_cookies
=
C
.
int
(
d
.
PersistSessionCookies
)
native
.
persist_user_preferences
=
C
.
int
(
d
.
PersistUserPreferences
)
...
...
@@ -259,6 +276,7 @@ func (d *Settings) toNative(native *C.cef_settings_t) *C.cef_settings_t {
native
.
enable_net_security_expiration
=
C
.
int
(
d
.
EnableNetSecurityExpiration
)
native
.
background_color
=
C
.
cef_color_t
(
d
.
BackgroundColor
)
setCEFStr
(
d
.
AcceptLanguageList
,
&
native
.
accept_language_list
)
setCEFStr
(
d
.
ApplicationClientIdForFileScanning
,
&
native
.
application_client_id_for_file_scanning
)
return
native
}
...
...
@@ -281,6 +299,7 @@ func (n *C.cef_settings_t) intoGo(d *Settings) {
d
.
WindowlessRenderingEnabled
=
int32
(
n
.
windowless_rendering_enabled
)
d
.
CommandLineArgsDisabled
=
int32
(
n
.
command_line_args_disabled
)
d
.
CachePath
=
cefstrToString
(
&
n
.
cache_path
)
d
.
RootCachePath
=
cefstrToString
(
&
n
.
root_cache_path
)
d
.
UserDataPath
=
cefstrToString
(
&
n
.
user_data_path
)
d
.
PersistSessionCookies
=
int32
(
n
.
persist_session_cookies
)
d
.
PersistUserPreferences
=
int32
(
n
.
persist_user_preferences
)
...
...
@@ -299,4 +318,5 @@ func (n *C.cef_settings_t) intoGo(d *Settings) {
d
.
EnableNetSecurityExpiration
=
int32
(
n
.
enable_net_security_expiration
)
d
.
BackgroundColor
=
Color
(
n
.
background_color
)
d
.
AcceptLanguageList
=
cefstrToString
(
&
n
.
accept_language_list
)
d
.
ApplicationClientIdForFileScanning
=
cefstrToString
(
&
n
.
application_client_id_for_file_scanning
)
}
cef/UrlrequestClient_gen.go
浏览文件 @
d4e937fc
...
...
@@ -131,9 +131,11 @@ func gocef_urlrequest_client_on_download_data(self *C.cef_urlrequest_client_t, r
// |isProxy| indicates whether the host is a proxy server. |host| contains the
// hostname and |port| contains the port number. Return true (1) to continue
// the request and call cef_auth_callback_t::cont() when the authentication
// information is available. Return false (0) to cancel the request. This
// function will only be called for requests initiated from the browser
// process.
// information is available. If the request has an associated browser/frame
// then returning false (0) will result in a call to GetAuthCredentials on the
// cef_request_tHandler associated with that browser, if any. Otherwise,
// returning false (0) will cancel the request immediately. This function will
// only be called for requests initiated from the browser process.
func
(
d
*
UrlrequestClient
)
GetAuthCredentials
(
isProxy
int32
,
host
string
,
port
int32
,
realm
,
scheme
string
,
callback
*
AuthCallback
)
int32
{
return
lookupUrlrequestClientProxy
(
d
.
Base
())
.
GetAuthCredentials
(
d
,
isProxy
,
host
,
port
,
realm
,
scheme
,
callback
)
}
...
...
cef/capi_gen.h
浏览文件 @
d4e937fc
...
...
@@ -43,6 +43,7 @@
#include "include/capi/cef_process_message_capi.h"
#include "include/capi/cef_render_handler_capi.h"
#include "include/capi/cef_render_process_handler_capi.h"
#include "include/capi/cef_request_callback_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_request_context_capi.h"
#include "include/capi/cef_request_context_handler_capi.h"
...
...
@@ -50,6 +51,7 @@
#include "include/capi/cef_resource_bundle_capi.h"
#include "include/capi/cef_resource_bundle_handler_capi.h"
#include "include/capi/cef_resource_handler_capi.h"
#include "include/capi/cef_resource_request_handler_capi.h"
#include "include/capi/cef_response_capi.h"
#include "include/capi/cef_response_filter_capi.h"
#include "include/capi/cef_scheme_capi.h"
...
...
cef/enums_gen.go
浏览文件 @
d4e937fc
...
...
@@ -491,68 +491,239 @@ const (
)
// Errorcode (cef_errorcode_t from include/internal/cef_types.h)
// Supported error code values. See net\base\net_error_list.h for complete
// descriptions of the error codes.
// Supported error code values.
type
Errorcode
int
// Possible values for Errorcode
const
(
ErrNone
Errorcode
=
0
// ERR_NONE
ErrFailed
Errorcode
=
-
2
// ERR_FAILED
ErrAborted
Errorcode
=
-
3
// ERR_ABORTED
ErrInvalidArgument
Errorcode
=
-
4
// ERR_INVALID_ARGUMENT
ErrInvalidHandle
Errorcode
=
-
5
// ERR_INVALID_HANDLE
ErrFileNotFound
Errorcode
=
-
6
// ERR_FILE_NOT_FOUND
ErrTimedOut
Errorcode
=
-
7
// ERR_TIMED_OUT
ErrFileTooBig
Errorcode
=
-
8
// ERR_FILE_TOO_BIG
ErrUnexpected
Errorcode
=
-
9
// ERR_UNEXPECTED
ErrAccessDenied
Errorcode
=
-
10
// ERR_ACCESS_DENIED
ErrNotImplemented
Errorcode
=
-
11
// ERR_NOT_IMPLEMENTED
ErrConnectionClosed
Errorcode
=
-
100
// ERR_CONNECTION_CLOSED
ErrConnectionReset
Errorcode
=
-
101
// ERR_CONNECTION_RESET
ErrConnectionRefused
Errorcode
=
-
102
// ERR_CONNECTION_REFUSED
ErrConnectionAborted
Errorcode
=
-
103
// ERR_CONNECTION_ABORTED
ErrConnectionFailed
Errorcode
=
-
104
// ERR_CONNECTION_FAILED
ErrNameNotResolved
Errorcode
=
-
105
// ERR_NAME_NOT_RESOLVED
ErrInternetDisconnected
Errorcode
=
-
106
// ERR_INTERNET_DISCONNECTED
ErrSSLProtocolError
Errorcode
=
-
107
// ERR_SSL_PROTOCOL_ERROR
ErrAddressInvalid
Errorcode
=
-
108
// ERR_ADDRESS_INVALID
ErrAddressUnreachable
Errorcode
=
-
109
// ERR_ADDRESS_UNREACHABLE
ErrSSLClientAuthCertNeeded
Errorcode
=
-
110
// ERR_SSL_CLIENT_AUTH_CERT_NEEDED
ErrTunnelConnectionFailed
Errorcode
=
-
111
// ERR_TUNNEL_CONNECTION_FAILED
ErrNoSSLVersionsEnabled
Errorcode
=
-
112
// ERR_NO_SSL_VERSIONS_ENABLED
ErrSSLVersionOrCipherMismatch
Errorcode
=
-
113
// ERR_SSL_VERSION_OR_CIPHER_MISMATCH
ErrSSLRenegotiationRequested
Errorcode
=
-
114
// ERR_SSL_RENEGOTIATION_REQUESTED
ErrCertCommonNameInvalid
Errorcode
=
-
200
// ERR_CERT_COMMON_NAME_INVALID
ErrCertBegin
Errorcode
=
ErrCertCommonNameInvalid
// ERR_CERT_BEGIN
ErrCertDateInvalid
Errorcode
=
-
201
// ERR_CERT_DATE_INVALID
ErrCertAuthorityInvalid
Errorcode
=
-
202
// ERR_CERT_AUTHORITY_INVALID
ErrCertContainsErrors
Errorcode
=
-
203
// ERR_CERT_CONTAINS_ERRORS
ErrCertNoRevocationMechanism
Errorcode
=
-
204
// ERR_CERT_NO_REVOCATION_MECHANISM
ErrCertUnableToCheckRevocation
Errorcode
=
-
205
// ERR_CERT_UNABLE_TO_CHECK_REVOCATION
ErrCertRevoked
Errorcode
=
-
206
// ERR_CERT_REVOKED
ErrCertInvalid
Errorcode
=
-
207
// ERR_CERT_INVALID
ErrCertWeakSignatureAlgorithm
Errorcode
=
-
208
// ERR_CERT_WEAK_SIGNATURE_ALGORITHM
// -209 is available: was ERR_CERT_NOT_IN_DNS.
ErrCertNonUniqueName
Errorcode
=
-
210
// ERR_CERT_NON_UNIQUE_NAME
ErrCertWeakKey
Errorcode
=
-
211
// ERR_CERT_WEAK_KEY
ErrCertNameConstraintViolation
Errorcode
=
-
212
// ERR_CERT_NAME_CONSTRAINT_VIOLATION
ErrCertValidityTooLong
Errorcode
=
-
213
// ERR_CERT_VALIDITY_TOO_LONG
ErrCertEnd
Errorcode
=
ErrCertValidityTooLong
// ERR_CERT_END
ErrInvalidURL
Errorcode
=
-
300
// ERR_INVALID_URL
ErrDisallowedURLScheme
Errorcode
=
-
301
// ERR_DISALLOWED_URL_SCHEME
ErrUnknownURLScheme
Errorcode
=
-
302
// ERR_UNKNOWN_URL_SCHEME
ErrTooManyRedirects
Errorcode
=
-
310
// ERR_TOO_MANY_REDIRECTS
ErrUnsafeRedirect
Errorcode
=
-
311
// ERR_UNSAFE_REDIRECT
ErrUnsafePort
Errorcode
=
-
312
// ERR_UNSAFE_PORT
ErrInvalidResponse
Errorcode
=
-
320
// ERR_INVALID_RESPONSE
ErrInvalidChunkedEncoding
Errorcode
=
-
321
// ERR_INVALID_CHUNKED_ENCODING
ErrMethodNotSupported
Errorcode
=
-
322
// ERR_METHOD_NOT_SUPPORTED
ErrUnexpectedProxyAuth
Errorcode
=
-
323
// ERR_UNEXPECTED_PROXY_AUTH
ErrEmptyResponse
Errorcode
=
-
324
// ERR_EMPTY_RESPONSE
ErrResponseHeadersTooBig
Errorcode
=
-
325
// ERR_RESPONSE_HEADERS_TOO_BIG
ErrCacheMiss
Errorcode
=
-
400
// ERR_CACHE_MISS
ErrInsecureResponse
Errorcode
=
-
501
// ERR_INSECURE_RESPONSE
// No error.
ErrNone
Errorcode
=
0
// ERR_NONE
ErrIOPending
Errorcode
=
1
// ERR_IO_PENDING
ErrFailed
Errorcode
=
2
// ERR_FAILED
ErrAborted
Errorcode
=
3
// ERR_ABORTED
ErrInvalidArgument
Errorcode
=
4
// ERR_INVALID_ARGUMENT
ErrInvalidHandle
Errorcode
=
5
// ERR_INVALID_HANDLE
ErrFileNotFound
Errorcode
=
6
// ERR_FILE_NOT_FOUND
ErrTimedOut
Errorcode
=
7
// ERR_TIMED_OUT
ErrFileTooBig
Errorcode
=
8
// ERR_FILE_TOO_BIG
ErrUnexpected
Errorcode
=
9
// ERR_UNEXPECTED
ErrAccessDenied
Errorcode
=
10
// ERR_ACCESS_DENIED
ErrNotImplemented
Errorcode
=
11
// ERR_NOT_IMPLEMENTED
ErrInsufficientResources
Errorcode
=
12
// ERR_INSUFFICIENT_RESOURCES
ErrOutOfMemory
Errorcode
=
13
// ERR_OUT_OF_MEMORY
ErrUploadFileChanged
Errorcode
=
14
// ERR_UPLOAD_FILE_CHANGED
ErrSocketNotConnected
Errorcode
=
15
// ERR_SOCKET_NOT_CONNECTED
ErrFileExists
Errorcode
=
16
// ERR_FILE_EXISTS
ErrFilePathTooLong
Errorcode
=
17
// ERR_FILE_PATH_TOO_LONG
ErrFileNoSpace
Errorcode
=
18
// ERR_FILE_NO_SPACE
ErrFileVirusInfected
Errorcode
=
19
// ERR_FILE_VIRUS_INFECTED
ErrBlockedByClient
Errorcode
=
20
// ERR_BLOCKED_BY_CLIENT
ErrNetworkChanged
Errorcode
=
21
// ERR_NETWORK_CHANGED
ErrBlockedByAdministrator
Errorcode
=
22
// ERR_BLOCKED_BY_ADMINISTRATOR
ErrSocketIsConnected
Errorcode
=
23
// ERR_SOCKET_IS_CONNECTED
ErrBlockedEnrollmentCheckPending
Errorcode
=
24
// ERR_BLOCKED_ENROLLMENT_CHECK_PENDING
ErrUploadStreamRewindNotSupported
Errorcode
=
25
// ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED
ErrContextShutDown
Errorcode
=
26
// ERR_CONTEXT_SHUT_DOWN
ErrBlockedByResponse
Errorcode
=
27
// ERR_BLOCKED_BY_RESPONSE
ErrBlockedByXssAuditor
Errorcode
=
28
// ERR_BLOCKED_BY_XSS_AUDITOR
ErrCleartextNotPermitted
Errorcode
=
29
// ERR_CLEARTEXT_NOT_PERMITTED
ErrConnectionClosed
Errorcode
=
30
// ERR_CONNECTION_CLOSED
ErrConnectionReset
Errorcode
=
31
// ERR_CONNECTION_RESET
ErrConnectionRefused
Errorcode
=
32
// ERR_CONNECTION_REFUSED
ErrConnectionAborted
Errorcode
=
33
// ERR_CONNECTION_ABORTED
ErrConnectionFailed
Errorcode
=
34
// ERR_CONNECTION_FAILED
ErrNameNotResolved
Errorcode
=
35
// ERR_NAME_NOT_RESOLVED
ErrInternetDisconnected
Errorcode
=
36
// ERR_INTERNET_DISCONNECTED
ErrSSLProtocolError
Errorcode
=
37
// ERR_SSL_PROTOCOL_ERROR
ErrAddressInvalid
Errorcode
=
38
// ERR_ADDRESS_INVALID
ErrAddressUnreachable
Errorcode
=
39
// ERR_ADDRESS_UNREACHABLE
ErrSSLClientAuthCertNeeded
Errorcode
=
40
// ERR_SSL_CLIENT_AUTH_CERT_NEEDED
ErrTunnelConnectionFailed
Errorcode
=
41
// ERR_TUNNEL_CONNECTION_FAILED
ErrNoSSLVersionsEnabled
Errorcode
=
42
// ERR_NO_SSL_VERSIONS_ENABLED
ErrSSLVersionOrCipherMismatch
Errorcode
=
43
// ERR_SSL_VERSION_OR_CIPHER_MISMATCH
ErrSSLRenegotiationRequested
Errorcode
=
44
// ERR_SSL_RENEGOTIATION_REQUESTED
ErrProxyAuthUnsupported
Errorcode
=
45
// ERR_PROXY_AUTH_UNSUPPORTED
ErrCertErrorInSSLRenegotiation
Errorcode
=
46
// ERR_CERT_ERROR_IN_SSL_RENEGOTIATION
ErrBadSSLClientAuthCert
Errorcode
=
47
// ERR_BAD_SSL_CLIENT_AUTH_CERT
ErrConnectionTimedOut
Errorcode
=
48
// ERR_CONNECTION_TIMED_OUT
ErrHostResolverQueueTooLarge
Errorcode
=
49
// ERR_HOST_RESOLVER_QUEUE_TOO_LARGE
ErrSocksConnectionFailed
Errorcode
=
50
// ERR_SOCKS_CONNECTION_FAILED
ErrSocksConnectionHostUnreachable
Errorcode
=
51
// ERR_SOCKS_CONNECTION_HOST_UNREACHABLE
ErrAlpnNegotiationFailed
Errorcode
=
52
// ERR_ALPN_NEGOTIATION_FAILED
ErrSSLNoRenegotiation
Errorcode
=
53
// ERR_SSL_NO_RENEGOTIATION
ErrWinsockUnexpectedWrittenBytes
Errorcode
=
54
// ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES
ErrSSLDecompressionFailureAlert
Errorcode
=
55
// ERR_SSL_DECOMPRESSION_FAILURE_ALERT
ErrSSLBadRecordMacAlert
Errorcode
=
56
// ERR_SSL_BAD_RECORD_MAC_ALERT
ErrProxyAuthRequested
Errorcode
=
57
// ERR_PROXY_AUTH_REQUESTED
ErrSSLWeakServerEphemeralDhKey
Errorcode
=
58
// ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY
ErrProxyConnectionFailed
Errorcode
=
59
// ERR_PROXY_CONNECTION_FAILED
ErrMandatoryProxyConfigurationFailed
Errorcode
=
60
// ERR_MANDATORY_PROXY_CONFIGURATION_FAILED
ErrPreconnectMaxSocketLimit
Errorcode
=
61
// ERR_PRECONNECT_MAX_SOCKET_LIMIT
ErrSSLClientAuthPrivateKeyAccessDenied
Errorcode
=
62
// ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED
ErrSSLClientAuthCertNoPrivateKey
Errorcode
=
63
// ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY
ErrProxyCertificateInvalid
Errorcode
=
64
// ERR_PROXY_CERTIFICATE_INVALID
ErrNameResolutionFailed
Errorcode
=
65
// ERR_NAME_RESOLUTION_FAILED
ErrNetworkAccessDenied
Errorcode
=
66
// ERR_NETWORK_ACCESS_DENIED
ErrTemporarilyThrottled
Errorcode
=
67
// ERR_TEMPORARILY_THROTTLED
ErrHttpsProxyTunnelResponseRedirect
Errorcode
=
68
// ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT
ErrSSLClientAuthSignatureFailed
Errorcode
=
69
// ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED
ErrMsgTooBig
Errorcode
=
70
// ERR_MSG_TOO_BIG
ErrSpdySessionAlreadyExists
Errorcode
=
71
// ERR_SPDY_SESSION_ALREADY_EXISTS
ErrWsProtocolError
Errorcode
=
72
// ERR_WS_PROTOCOL_ERROR
ErrAddressInUse
Errorcode
=
73
// ERR_ADDRESS_IN_USE
ErrSSLHandshakeNotCompleted
Errorcode
=
74
// ERR_SSL_HANDSHAKE_NOT_COMPLETED
ErrSSLBadPeerPublicKey
Errorcode
=
75
// ERR_SSL_BAD_PEER_PUBLIC_KEY
ErrSSLPinnedKeyNotInCertChain
Errorcode
=
76
// ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN
ErrClientAuthCertTypeUnsupported
Errorcode
=
77
// ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED
ErrOriginBoundCertGenerationTypeMismatch
Errorcode
=
78
// ERR_ORIGIN_BOUND_CERT_GENERATION_TYPE_MISMATCH
ErrSSLDecryptErrorAlert
Errorcode
=
79
// ERR_SSL_DECRYPT_ERROR_ALERT
ErrWsThrottleQueueTooLarge
Errorcode
=
80
// ERR_WS_THROTTLE_QUEUE_TOO_LARGE
ErrSSLServerCertChanged
Errorcode
=
81
// ERR_SSL_SERVER_CERT_CHANGED
ErrSSLUnrecognizedNameAlert
Errorcode
=
82
// ERR_SSL_UNRECOGNIZED_NAME_ALERT
ErrSocketSetReceiveBufferSizeError
Errorcode
=
83
// ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR
ErrSocketSetSendBufferSizeError
Errorcode
=
84
// ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR
ErrSocketReceiveBufferSizeUnchangeable
Errorcode
=
85
// ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE
ErrSocketSendBufferSizeUnchangeable
Errorcode
=
86
// ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE
ErrSSLClientAuthCertBadFormat
Errorcode
=
87
// ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT
ErrIcannNameCollision
Errorcode
=
88
// ERR_ICANN_NAME_COLLISION
ErrSSLServerCertBadFormat
Errorcode
=
89
// ERR_SSL_SERVER_CERT_BAD_FORMAT
ErrCTSthParsingFailed
Errorcode
=
90
// ERR_CT_STH_PARSING_FAILED
ErrCTSthIncomplete
Errorcode
=
91
// ERR_CT_STH_INCOMPLETE
ErrUnableToReuseConnectionForProxyAuth
Errorcode
=
92
// ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH
ErrCTConsistencyProofParsingFailed
Errorcode
=
93
// ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED
ErrSSLObsoleteCipher
Errorcode
=
94
// ERR_SSL_OBSOLETE_CIPHER
ErrWsUpgrade
Errorcode
=
95
// ERR_WS_UPGRADE
ErrReadIfReadyNotImplemented
Errorcode
=
96
// ERR_READ_IF_READY_NOT_IMPLEMENTED
ErrSSLVersionInterference
Errorcode
=
97
// ERR_SSL_VERSION_INTERFERENCE
ErrNoBufferSpace
Errorcode
=
98
// ERR_NO_BUFFER_SPACE
ErrSSLClientAuthNoCommonAlgorithms
Errorcode
=
99
// ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS
ErrEarlyDataRejected
Errorcode
=
100
// ERR_EARLY_DATA_REJECTED
ErrWrongVersionOnEarlyData
Errorcode
=
101
// ERR_WRONG_VERSION_ON_EARLY_DATA
ErrTls13DowngradeDetected
Errorcode
=
102
// ERR_TLS13_DOWNGRADE_DETECTED
ErrSSLKeyUsageIncompatible
Errorcode
=
103
// ERR_SSL_KEY_USAGE_INCOMPATIBLE
ErrCertCommonNameInvalid
Errorcode
=
104
// ERR_CERT_COMMON_NAME_INVALID
ErrCertDateInvalid
Errorcode
=
105
// ERR_CERT_DATE_INVALID
ErrCertAuthorityInvalid
Errorcode
=
106
// ERR_CERT_AUTHORITY_INVALID
ErrCertContainsErrors
Errorcode
=
107
// ERR_CERT_CONTAINS_ERRORS
ErrCertNoRevocationMechanism
Errorcode
=
108
// ERR_CERT_NO_REVOCATION_MECHANISM
ErrCertUnableToCheckRevocation
Errorcode
=
109
// ERR_CERT_UNABLE_TO_CHECK_REVOCATION
ErrCertRevoked
Errorcode
=
110
// ERR_CERT_REVOKED
ErrCertInvalid
Errorcode
=
111
// ERR_CERT_INVALID
ErrCertWeakSignatureAlgorithm
Errorcode
=
112
// ERR_CERT_WEAK_SIGNATURE_ALGORITHM
ErrCertNonUniqueName
Errorcode
=
113
// ERR_CERT_NON_UNIQUE_NAME
ErrCertWeakKey
Errorcode
=
114
// ERR_CERT_WEAK_KEY
ErrCertNameConstraintViolation
Errorcode
=
115
// ERR_CERT_NAME_CONSTRAINT_VIOLATION
ErrCertValidityTooLong
Errorcode
=
116
// ERR_CERT_VALIDITY_TOO_LONG
ErrCertificateTransparencyRequired
Errorcode
=
117
// ERR_CERTIFICATE_TRANSPARENCY_REQUIRED
ErrCertSymantecLegacy
Errorcode
=
118
// ERR_CERT_SYMANTEC_LEGACY
ErrCertEnd
Errorcode
=
119
// ERR_CERT_END
ErrInvalidURL
Errorcode
=
120
// ERR_INVALID_URL
ErrDisallowedURLScheme
Errorcode
=
121
// ERR_DISALLOWED_URL_SCHEME
ErrUnknownURLScheme
Errorcode
=
122
// ERR_UNKNOWN_URL_SCHEME
ErrInvalidRedirect
Errorcode
=
123
// ERR_INVALID_REDIRECT
ErrTooManyRedirects
Errorcode
=
124
// ERR_TOO_MANY_REDIRECTS
ErrUnsafeRedirect
Errorcode
=
125
// ERR_UNSAFE_REDIRECT
ErrUnsafePort
Errorcode
=
126
// ERR_UNSAFE_PORT
ErrInvalidResponse
Errorcode
=
127
// ERR_INVALID_RESPONSE
ErrInvalidChunkedEncoding
Errorcode
=
128
// ERR_INVALID_CHUNKED_ENCODING
ErrMethodNotSupported
Errorcode
=
129
// ERR_METHOD_NOT_SUPPORTED
ErrUnexpectedProxyAuth
Errorcode
=
130
// ERR_UNEXPECTED_PROXY_AUTH
ErrEmptyResponse
Errorcode
=
131
// ERR_EMPTY_RESPONSE
ErrResponseHeadersTooBig
Errorcode
=
132
// ERR_RESPONSE_HEADERS_TOO_BIG
ErrPacStatusNotOk
Errorcode
=
133
// ERR_PAC_STATUS_NOT_OK
ErrPacScriptFailed
Errorcode
=
134
// ERR_PAC_SCRIPT_FAILED
ErrRequestRangeNotSatisfiable
Errorcode
=
135
// ERR_REQUEST_RANGE_NOT_SATISFIABLE
ErrMalformedIdentity
Errorcode
=
136
// ERR_MALFORMED_IDENTITY
ErrContentDecodingFailed
Errorcode
=
137
// ERR_CONTENT_DECODING_FAILED
ErrNetworkIOSuspended
Errorcode
=
138
// ERR_NETWORK_IO_SUSPENDED
ErrSynReplyNotReceived
Errorcode
=
139
// ERR_SYN_REPLY_NOT_RECEIVED
ErrEncodingConversionFailed
Errorcode
=
140
// ERR_ENCODING_CONVERSION_FAILED
ErrUnrecognizedFtpDirectoryListingFormat
Errorcode
=
141
// ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT
ErrNoSupportedProxies
Errorcode
=
142
// ERR_NO_SUPPORTED_PROXIES
ErrSpdyProtocolError
Errorcode
=
143
// ERR_SPDY_PROTOCOL_ERROR
ErrInvalidAuthCredentials
Errorcode
=
144
// ERR_INVALID_AUTH_CREDENTIALS
ErrUnsupportedAuthScheme
Errorcode
=
145
// ERR_UNSUPPORTED_AUTH_SCHEME
ErrEncodingDetectionFailed
Errorcode
=
146
// ERR_ENCODING_DETECTION_FAILED
ErrMissingAuthCredentials
Errorcode
=
147
// ERR_MISSING_AUTH_CREDENTIALS
ErrUnexpectedSecurityLibraryStatus
Errorcode
=
148
// ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS
ErrMisconfiguredAuthEnvironment
Errorcode
=
149
// ERR_MISCONFIGURED_AUTH_ENVIRONMENT
ErrUndocumentedSecurityLibraryStatus
Errorcode
=
150
// ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS
ErrResponseBodyTooBigToDrain
Errorcode
=
151
// ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN
ErrResponseHeadersMultipleContentLength
Errorcode
=
152
// ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH
ErrIncompleteSpdyHeaders
Errorcode
=
153
// ERR_INCOMPLETE_SPDY_HEADERS
ErrPacNotInDhcp
Errorcode
=
154
// ERR_PAC_NOT_IN_DHCP
ErrResponseHeadersMultipleContentDisposition
Errorcode
=
155
// ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
ErrResponseHeadersMultipleLocation
Errorcode
=
156
// ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION
ErrSpdyServerRefusedStream
Errorcode
=
157
// ERR_SPDY_SERVER_REFUSED_STREAM
ErrSpdyPingFailed
Errorcode
=
158
// ERR_SPDY_PING_FAILED
ErrContentLengthMismatch
Errorcode
=
159
// ERR_CONTENT_LENGTH_MISMATCH
ErrIncompleteChunkedEncoding
Errorcode
=
160
// ERR_INCOMPLETE_CHUNKED_ENCODING
ErrQuicProtocolError
Errorcode
=
161
// ERR_QUIC_PROTOCOL_ERROR
ErrResponseHeadersTruncated
Errorcode
=
162
// ERR_RESPONSE_HEADERS_TRUNCATED
ErrQuicHandshakeFailed
Errorcode
=
163
// ERR_QUIC_HANDSHAKE_FAILED
ErrSpdyInadequateTransportSecurity
Errorcode
=
164
// ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY
ErrSpdyFlowControlError
Errorcode
=
165
// ERR_SPDY_FLOW_CONTROL_ERROR
ErrSpdyFrameSizeError
Errorcode
=
166
// ERR_SPDY_FRAME_SIZE_ERROR
ErrSpdyCompressionError
Errorcode
=
167
// ERR_SPDY_COMPRESSION_ERROR
ErrProxyAuthRequestedWithNoConnection
Errorcode
=
168
// ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION
ErrHTTP11Required
Errorcode
=
169
// ERR_HTTP_1_1_REQUIRED
ErrProxyHTTP11Required
Errorcode
=
170
// ERR_PROXY_HTTP_1_1_REQUIRED
ErrPacScriptTerminated
Errorcode
=
171
// ERR_PAC_SCRIPT_TERMINATED
ErrInvalidHTTPResponse
Errorcode
=
172
// ERR_INVALID_HTTP_RESPONSE
ErrContentDecodingInitFailed
Errorcode
=
173
// ERR_CONTENT_DECODING_INIT_FAILED
ErrSpdyRstStreamNoErrorReceived
Errorcode
=
174
// ERR_SPDY_RST_STREAM_NO_ERROR_RECEIVED
ErrSpdyPushedStreamNotAvailable
Errorcode
=
175
// ERR_SPDY_PUSHED_STREAM_NOT_AVAILABLE
ErrSpdyClaimedPushedStreamResetByServer
Errorcode
=
176
// ERR_SPDY_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER
ErrTooManyRetries
Errorcode
=
177
// ERR_TOO_MANY_RETRIES
ErrSpdyStreamClosed
Errorcode
=
178
// ERR_SPDY_STREAM_CLOSED
ErrSpdyClientRefusedStream
Errorcode
=
179
// ERR_SPDY_CLIENT_REFUSED_STREAM
ErrSpdyPushedResponseDoesNotMatch
Errorcode
=
180
// ERR_SPDY_PUSHED_RESPONSE_DOES_NOT_MATCH
ErrCacheMiss
Errorcode
=
181
// ERR_CACHE_MISS
ErrCacheReadFailure
Errorcode
=
182
// ERR_CACHE_READ_FAILURE
ErrCacheWriteFailure
Errorcode
=
183
// ERR_CACHE_WRITE_FAILURE
ErrCacheOperationNotSupported
Errorcode
=
184
// ERR_CACHE_OPERATION_NOT_SUPPORTED
ErrCacheOpenFailure
Errorcode
=
185
// ERR_CACHE_OPEN_FAILURE
ErrCacheCreateFailure
Errorcode
=
186
// ERR_CACHE_CREATE_FAILURE
ErrCacheRace
Errorcode
=
187
// ERR_CACHE_RACE
ErrCacheChecksumReadFailure
Errorcode
=
188
// ERR_CACHE_CHECKSUM_READ_FAILURE
ErrCacheChecksumMismatch
Errorcode
=
189
// ERR_CACHE_CHECKSUM_MISMATCH
ErrCacheLockTimeout
Errorcode
=
190
// ERR_CACHE_LOCK_TIMEOUT
ErrCacheAuthFailureAfterRead
Errorcode
=
191
// ERR_CACHE_AUTH_FAILURE_AFTER_READ
ErrCacheEntryNotSuitable
Errorcode
=
192
// ERR_CACHE_ENTRY_NOT_SUITABLE
ErrCacheDoomFailure
Errorcode
=
193
// ERR_CACHE_DOOM_FAILURE
ErrCacheOpenOrCreateFailure
Errorcode
=
194
// ERR_CACHE_OPEN_OR_CREATE_FAILURE
ErrInsecureResponse
Errorcode
=
195
// ERR_INSECURE_RESPONSE
ErrNoPrivateKeyForCert
Errorcode
=
196
// ERR_NO_PRIVATE_KEY_FOR_CERT
ErrAddUserCertFailed
Errorcode
=
197
// ERR_ADD_USER_CERT_FAILED
ErrInvalidSignedExchange
Errorcode
=
198
// ERR_INVALID_SIGNED_EXCHANGE
ErrFtpFailed
Errorcode
=
199
// ERR_FTP_FAILED
ErrFtpServiceUnavailable
Errorcode
=
200
// ERR_FTP_SERVICE_UNAVAILABLE
ErrFtpTransferAborted
Errorcode
=
201
// ERR_FTP_TRANSFER_ABORTED
ErrFtpFileBusy
Errorcode
=
202
// ERR_FTP_FILE_BUSY
ErrFtpSyntaxError
Errorcode
=
203
// ERR_FTP_SYNTAX_ERROR
ErrFtpCommandNotSupported
Errorcode
=
204
// ERR_FTP_COMMAND_NOT_SUPPORTED
ErrFtpBadCommandSequence
Errorcode
=
205
// ERR_FTP_BAD_COMMAND_SEQUENCE
ErrPkcs12ImportBadPassword
Errorcode
=
206
// ERR_PKCS12_IMPORT_BAD_PASSWORD
ErrPkcs12ImportFailed
Errorcode
=
207
// ERR_PKCS12_IMPORT_FAILED
ErrImportCaCertNotCa
Errorcode
=
208
// ERR_IMPORT_CA_CERT_NOT_CA
ErrImportCertAlreadyExists
Errorcode
=
209
// ERR_IMPORT_CERT_ALREADY_EXISTS
ErrImportCaCertFailed
Errorcode
=
210
// ERR_IMPORT_CA_CERT_FAILED
ErrImportServerCertFailed
Errorcode
=
211
// ERR_IMPORT_SERVER_CERT_FAILED
ErrPkcs12ImportInvalidMac
Errorcode
=
212
// ERR_PKCS12_IMPORT_INVALID_MAC
ErrPkcs12ImportInvalidFile
Errorcode
=
213
// ERR_PKCS12_IMPORT_INVALID_FILE
ErrPkcs12ImportUnsupported
Errorcode
=
214
// ERR_PKCS12_IMPORT_UNSUPPORTED
ErrKeyGenerationFailed
Errorcode
=
215
// ERR_KEY_GENERATION_FAILED
ErrPrivateKeyExportFailed
Errorcode
=
216
// ERR_PRIVATE_KEY_EXPORT_FAILED
ErrSelfSignedCertGenerationFailed
Errorcode
=
217
// ERR_SELF_SIGNED_CERT_GENERATION_FAILED
ErrCertDatabaseChanged
Errorcode
=
218
// ERR_CERT_DATABASE_CHANGED
ErrDnsMalformedResponse
Errorcode
=
219
// ERR_DNS_MALFORMED_RESPONSE
ErrDnsServerRequiresTcp
Errorcode
=
220
// ERR_DNS_SERVER_REQUIRES_TCP
ErrDnsServerFailed
Errorcode
=
221
// ERR_DNS_SERVER_FAILED
ErrDnsTimedOut
Errorcode
=
222
// ERR_DNS_TIMED_OUT
ErrDnsCacheMiss
Errorcode
=
223
// ERR_DNS_CACHE_MISS
ErrDnsSearchEmpty
Errorcode
=
224
// ERR_DNS_SEARCH_EMPTY
ErrDnsSortError
Errorcode
=
225
// ERR_DNS_SORT_ERROR
ErrDnsHTTPFailed
Errorcode
=
226
// ERR_DNS_HTTP_FAILED
)
// EventFlags (cef_event_flags_t from include/internal/cef_types.h)
...
...
@@ -1212,8 +1383,8 @@ const (
SSLConnectionVersionTLS1
SSLVersion
=
3
// SSL_CONNECTION_VERSION_TLS1
SSLConnectionVersionTLS11
SSLVersion
=
4
// SSL_CONNECTION_VERSION_TLS1_1
SSLConnectionVersionTLS12
SSLVersion
=
5
// SSL_CONNECTION_VERSION_TLS1_2
// Reserve 6 for TLS 1.3.
SSLConnectionVersionQuic
SSLVersion
=
7
// SSL_CONNECTION_VERSION_QUIC
SSLConnectionVersionTLS13
SSLVersion
=
6
// SSL_CONNECTION_VERSION_TLS1_3
SSLConnectionVersionQuic
SSLVersion
=
7
// SSL_CONNECTION_VERSION_QUIC
)
// State (cef_state_t from include/internal/cef_types.h)
...
...
cef/functions_gen.go
浏览文件 @
d4e937fc
...
...
@@ -75,33 +75,42 @@ func BinaryValueCreate(data unsafe.Pointer, data_size uint64) *BinaryValue {
// |windowInfo|. All values will be copied internally and the actual window will
// be created on the UI thread. If |request_context| is NULL the global request
// context will be used. This function can be called on any browser process
// thread and will not block.
func
BrowserHostCreateBrowser
(
windowInfo
*
WindowInfo
,
client
*
Client
,
url
string
,
settings
*
BrowserSettings
,
request_context
*
RequestContext
)
int32
{
// thread and will not block. The optional |extra_info| parameter provides an
// opportunity to specify extra information specific to the created browser that
// will be passed to cef_render_process_handler_t::on_browser_created() in the
// render process.
func
BrowserHostCreateBrowser
(
windowInfo
*
WindowInfo
,
client
*
Client
,
url
string
,
settings
*
BrowserSettings
,
extra_info
*
DictionaryValue
,
request_context
*
RequestContext
)
int32
{
url_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
url
,
url_
)
defer
func
()
{
C
.
cef_string_userfree_free
(
url_
)
}()
return
int32
(
C
.
cef_browser_host_create_browser
(
windowInfo
.
toNative
(
&
C
.
cef_window_info_t
{}),
client
.
toNative
(),
(
*
C
.
cef_string_t
)(
url_
),
settings
.
toNative
(
&
C
.
cef_browser_settings_t
{}),
request_context
.
toNative
()))
return
int32
(
C
.
cef_browser_host_create_browser
(
windowInfo
.
toNative
(
&
C
.
cef_window_info_t
{}),
client
.
toNative
(),
(
*
C
.
cef_string_t
)(
url_
),
settings
.
toNative
(
&
C
.
cef_browser_settings_t
{}),
extra_info
.
toNative
(),
request_context
.
toNative
()))
}
// BrowserHostCreateBrowserSync (cef_browser_host_create_browser_sync from include/capi/cef_browser_capi.h)
// Create a new browser window using the window parameters specified by
// |windowInfo|. If |request_context| is NULL the global request context will be
// used. This function can only be called on the browser process UI thread.
func
BrowserHostCreateBrowserSync
(
windowInfo
*
WindowInfo
,
client
*
Client
,
url
string
,
settings
*
BrowserSettings
,
request_context
*
RequestContext
)
*
Browser
{
// used. This function can only be called on the browser process UI thread. The
// optional |extra_info| parameter provides an opportunity to specify extra
// information specific to the created browser that will be passed to
// cef_render_process_handler_t::on_browser_created() in the render process.
func
BrowserHostCreateBrowserSync
(
windowInfo
*
WindowInfo
,
client
*
Client
,
url
string
,
settings
*
BrowserSettings
,
extra_info
*
DictionaryValue
,
request_context
*
RequestContext
)
*
Browser
{
url_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
url
,
url_
)
defer
func
()
{
C
.
cef_string_userfree_free
(
url_
)
}()
return
(
*
Browser
)(
C
.
cef_browser_host_create_browser_sync
(
windowInfo
.
toNative
(
&
C
.
cef_window_info_t
{}),
client
.
toNative
(),
(
*
C
.
cef_string_t
)(
url_
),
settings
.
toNative
(
&
C
.
cef_browser_settings_t
{}),
request_context
.
toNative
()))
return
(
*
Browser
)(
C
.
cef_browser_host_create_browser_sync
(
windowInfo
.
toNative
(
&
C
.
cef_window_info_t
{}),
client
.
toNative
(),
(
*
C
.
cef_string_t
)(
url_
),
settings
.
toNative
(
&
C
.
cef_browser_settings_t
{}),
extra_info
.
toNative
(),
request_context
.
toNative
()))
}
// BrowserViewCreate (cef_browser_view_create from include/capi/views/cef_browser_view_capi.h)
// Create a new BrowserView. The underlying cef_browser_t will not be created
// until this view is added to the views hierarchy.
func
BrowserViewCreate
(
client
*
Client
,
url
string
,
settings
*
BrowserSettings
,
request_context
*
RequestContext
,
delegate
*
BrowserViewDelegate
)
*
BrowserView
{
// until this view is added to the views hierarchy. The optional |extra_info|
// parameter provides an opportunity to specify extra information specific to
// the created browser that will be passed to
// cef_render_process_handler_t::on_browser_created() in the render process.
func
BrowserViewCreate
(
client
*
Client
,
url
string
,
settings
*
BrowserSettings
,
extra_info
*
DictionaryValue
,
request_context
*
RequestContext
,
delegate
*
BrowserViewDelegate
)
*
BrowserView
{
url_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
url
,
url_
)
defer
func
()
{
...
...
@@ -111,7 +120,7 @@ func BrowserViewCreate(client *Client, url string, settings *BrowserSettings, re
if
delegate
!=
nil
{
delegate_
=
delegate
.
toNative
()
}
return
(
*
BrowserView
)(
C
.
cef_browser_view_create
(
client
.
toNative
(),
(
*
C
.
cef_string_t
)(
url_
),
settings
.
toNative
(
&
C
.
cef_browser_settings_t
{}),
request_context
.
toNative
(),
delegate_
))
return
(
*
BrowserView
)(
C
.
cef_browser_view_create
(
client
.
toNative
(),
(
*
C
.
cef_string_t
)(
url_
),
settings
.
toNative
(
&
C
.
cef_browser_settings_t
{}),
extra_info
.
toNative
(),
request_context
.
toNative
(),
delegate_
))
}
// BrowserViewGetForBrowser (cef_browser_view_get_for_browser from include/capi/views/cef_browser_view_capi.h)
...
...
@@ -150,41 +159,13 @@ func CommandLineGetGlobal() *CommandLine {
return
(
*
CommandLine
)(
C
.
cef_command_line_get_global
())
}
// CookieManagerCreateManager (cef_cookie_manager_create_manager from include/capi/cef_cookie_capi.h)
// Creates a new cookie manager. If |path| is NULL data will be stored in memory
// only. Otherwise, data will be stored at the specified |path|. To persist
// session cookies (cookies without an expiry date or validity interval) set
// |persist_session_cookies| to true (1). Session cookies are generally intended
// to be transient and most Web browsers do not persist them. If |callback| is
// non-NULL it will be executed asnychronously on the IO thread after the
// manager's storage has been initialized.
func
CookieManagerCreateManager
(
path
string
,
persist_session_cookies
int32
,
callback
*
CompletionCallback
)
*
CookieManager
{
path_
:=
C
.
cef_string_userfree_alloc
()
setCEFStr
(
path
,
path_
)
defer
func
()
{
C
.
cef_string_userfree_free
(
path_
)
}()
return
(
*
CookieManager
)(
C
.
cef_cookie_manager_create_manager
((
*
C
.
cef_string_t
)(
path_
),
C
.
int
(
persist_session_cookies
),
callback
.
toNative
()))
}
// CookieManagerGetBlockingManager (cef_cookie_manager_get_blocking_manager from include/capi/cef_cookie_capi.h)
// Returns a cookie manager that neither stores nor retrieves cookies. All usage
// of cookies will be blocked including cookies accessed via the network
// (request/response headers), via JavaScript (document.cookie), and via
// cef_cookie_manager_t functions. No cookies will be displayed in DevTools. If
// you wish to only block cookies sent via the network use the
// cef_request_tHandler CanGetCookies and CanSetCookie functions instead.
func
CookieManagerGetBlockingManager
()
*
CookieManager
{
return
(
*
CookieManager
)(
C
.
cef_cookie_manager_get_blocking_manager
())
}
// CookieManagerGetGlobalManager (cef_cookie_manager_get_global_manager from include/capi/cef_cookie_capi.h)
// Returns the global cookie manager. By default data will be stored at
// CefSettings.cache_path if specified or in memory otherwise. If |callback| is
// non-NULL it will be executed asnychronously on the
IO
thread after the
// non-NULL it will be executed asnychronously on the
UI
thread after the
// manager's storage has been initialized. Using this function is equivalent to
// calling cef_request_tContext::cef_request_context_get_global_context()->
get_d
//
efault_cookie_m
anager().
// calling cef_request_tContext::cef_request_context_get_global_context()->
GetDe
//
faultCookieM
anager().
func
CookieManagerGetGlobalManager
(
callback
*
CompletionCallback
)
*
CookieManager
{
return
(
*
CookieManager
)(
C
.
cef_cookie_manager_get_global_manager
(
callback
.
toNative
()))
}
...
...
@@ -1076,19 +1057,25 @@ func UnregisterInternalWebPlugin(path string) {
}
// UrlrequestCreate (cef_urlrequest_create from include/capi/cef_urlrequest_capi.h)
// Create a new URL request. Only GET, POST, HEAD, DELETE and PUT request
// functions are supported. Multiple post data elements are not supported and
// elements of type PDE_TYPE_FILE are only supported for requests originating
// from the browser process. Requests originating from the render process will
// receive the same handling as requests originating from Web content -- if the
// response contains Content-Disposition or Mime-Type header values that would
// not normally be rendered then the response may receive special handling
// inside the browser (for example, via the file download code path instead of
// the URL request code path). The |request| object will be marked as read-only
// after calling this function. In the browser process if |request_context| is
// NULL the global request context will be used. In the render process
// |request_context| must be NULL and the context associated with the current
// renderer process' browser will be used.
// Create a new URL request that is not associated with a specific browser or
// frame. Use cef_frame_t::CreateURLRequest instead if you want the request to
// have this association, in which case it may be handled differently (see
// documentation on that function). Requests may originate from the both browser
// process and the render process.
//
// For requests originating from the browser process:
// - It may be intercepted by the client via CefResourceRequestHandler or
// CefSchemeHandlerFactory.
// - POST data may only contain only a single element of type PDE_TYPE_FILE
// or PDE_TYPE_BYTES.
// - If |request_context| is empty the global request context will be used.
// For requests originating from the render process:
// - It cannot be intercepted by the client so only http(s) and blob schemes
// are supported.
// - POST data may only contain a single element of type PDE_TYPE_BYTES.
// - The |request_context| parameter must be NULL.
//
// The |request| object will be marked as read-only after calling this function.
func
UrlrequestCreate
(
request
*
Request
,
client
*
UrlrequestClient
,
request_context
*
RequestContext
)
*
Urlrequest
{
return
(
*
Urlrequest
)(
C
.
cef_urlrequest_create
(
request
.
toNative
(),
client
.
toNative
(),
request_context
.
toNative
()))
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录