mirror of
https://gitee.com/energye/energy.git
synced 2024-11-30 10:47:57 +08:00
优化&修复 tag -> v13
This commit is contained in:
parent
37c0134ac8
commit
a3efd214f3
@ -33,7 +33,7 @@ func init() {
|
||||
senderPtr := getPtr(0)
|
||||
browser = &ICefBrowser{instance: getPtr(1)}
|
||||
frame = &ICefFrame{instance: getPtr(2)}
|
||||
cefRequest := (*rICefRequest)(getPtr(3))
|
||||
cefRequest := (*iCefRequestPtr)(getPtr(3))
|
||||
request = &ICefRequest{
|
||||
instance: common.GetInstancePtr(cefRequest.Instance),
|
||||
Url: api.GoStr(cefRequest.Url),
|
||||
@ -47,7 +47,7 @@ func init() {
|
||||
Identifier: *(*uint64)(common.GetParamPtr(cefRequest.Identifier, 0)),
|
||||
}
|
||||
if resp {
|
||||
cefResponse := (*iCefResponse)(getPtr(4))
|
||||
cefResponse := (*iCefResponsePtr)(getPtr(4))
|
||||
instance = common.GetInstancePtr(cefResponse.Instance)
|
||||
response = &ICefResponse{
|
||||
instance: instance,
|
||||
@ -62,11 +62,6 @@ func init() {
|
||||
return lcl.AsObject(senderPtr), browser, frame, request, response
|
||||
}
|
||||
lcl.RegisterExtEventCallback(func(fn interface{}, getVal func(idx int) uintptr) bool {
|
||||
//defer func() {
|
||||
// if err := recover(); err != nil {
|
||||
// logger.Error("CEF Events Error:", err)
|
||||
// }
|
||||
//}()
|
||||
var (
|
||||
instance unsafe.Pointer
|
||||
)
|
||||
|
@ -18,34 +18,6 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// ICefRequest 实例
|
||||
type ICefRequest struct {
|
||||
instance unsafe.Pointer
|
||||
Url string
|
||||
Method string
|
||||
ReferrerUrl string
|
||||
ReferrerPolicy TCefReferrerPolicy
|
||||
Flags TCefUrlRequestFlags
|
||||
FirstPartyForCookies string
|
||||
ResourceType TCefResourceType
|
||||
TransitionType TCefTransitionType
|
||||
Identifier uint64
|
||||
}
|
||||
|
||||
// ICefRequest 指针实例
|
||||
type rICefRequest struct {
|
||||
Instance uintptr
|
||||
Url uintptr //string
|
||||
Method uintptr //string
|
||||
ReferrerUrl uintptr //string
|
||||
ReferrerPolicy uintptr //int32
|
||||
Flags uintptr //int32
|
||||
FirstPartyForCookies uintptr //string
|
||||
ResourceType uintptr //int32
|
||||
TransitionType uintptr //int32
|
||||
Identifier uintptr //uint64
|
||||
}
|
||||
|
||||
func (m *ICefRequest) Instance() uintptr {
|
||||
return uintptr(m.instance)
|
||||
}
|
||||
|
@ -18,28 +18,6 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// ICefResponse 实例
|
||||
type ICefResponse struct {
|
||||
instance unsafe.Pointer
|
||||
Status int32
|
||||
StatusText string
|
||||
MimeType string
|
||||
Charset string
|
||||
Error TCefErrorCode
|
||||
URL string
|
||||
}
|
||||
|
||||
// ICefResponse 指针实例
|
||||
type iCefResponse struct {
|
||||
Instance uintptr
|
||||
Status uintptr //int32
|
||||
StatusText uintptr //string
|
||||
MimeType uintptr //string
|
||||
Charset uintptr //string
|
||||
Error uintptr //int32
|
||||
URL uintptr //string
|
||||
}
|
||||
|
||||
// IsReadOnly 是否只读
|
||||
func (m *ICefResponse) IsReadOnly() bool {
|
||||
return api.GoBool(cefResponse_IsReadOnly(uintptr(m.instance)))
|
||||
|
@ -17,11 +17,29 @@ import (
|
||||
"github.com/energye/golcl/lcl/api"
|
||||
)
|
||||
|
||||
type iCefV8ContextPtr struct {
|
||||
V8Context uintptr //ptr
|
||||
Browse uintptr //ptr
|
||||
Frame uintptr //ptr
|
||||
Global uintptr //ptr
|
||||
// ICefRequest 指针实例
|
||||
type iCefRequestPtr struct {
|
||||
Instance uintptr
|
||||
Url uintptr //string
|
||||
Method uintptr //string
|
||||
ReferrerUrl uintptr //string
|
||||
ReferrerPolicy uintptr //int32
|
||||
Flags uintptr //int32
|
||||
FirstPartyForCookies uintptr //string
|
||||
ResourceType uintptr //int32
|
||||
TransitionType uintptr //int32
|
||||
Identifier uintptr //uint64
|
||||
}
|
||||
|
||||
// ICefResponse 指针实例
|
||||
type iCefResponsePtr struct {
|
||||
Instance uintptr
|
||||
Status uintptr //int32
|
||||
StatusText uintptr //string
|
||||
MimeType uintptr //string
|
||||
Charset uintptr //string
|
||||
Error uintptr //int32
|
||||
URL uintptr //string
|
||||
}
|
||||
|
||||
type iCefCookiePtr struct {
|
||||
|
@ -221,6 +221,31 @@ type ICefWindow struct {
|
||||
instance unsafe.Pointer
|
||||
}
|
||||
|
||||
// ICefRequest
|
||||
type ICefRequest struct {
|
||||
instance unsafe.Pointer
|
||||
Url string
|
||||
Method string
|
||||
ReferrerUrl string
|
||||
ReferrerPolicy TCefReferrerPolicy
|
||||
Flags TCefUrlRequestFlags
|
||||
FirstPartyForCookies string
|
||||
ResourceType TCefResourceType
|
||||
TransitionType TCefTransitionType
|
||||
Identifier uint64
|
||||
}
|
||||
|
||||
// ICefResponse 实例
|
||||
type ICefResponse struct {
|
||||
instance unsafe.Pointer
|
||||
Status int32
|
||||
StatusText string
|
||||
MimeType string
|
||||
Charset string
|
||||
Error TCefErrorCode
|
||||
URL string
|
||||
}
|
||||
|
||||
// ICefView
|
||||
type ICefView struct {
|
||||
instance unsafe.Pointer
|
||||
@ -244,9 +269,6 @@ type ICefV8Exception struct {
|
||||
// ICefV8Context
|
||||
type ICefV8Context struct {
|
||||
instance unsafe.Pointer
|
||||
//Browser *ICefBrowser
|
||||
//Frame *ICefFrame
|
||||
//Global *ICefV8Value
|
||||
}
|
||||
|
||||
// ICefV8Value
|
||||
|
Loading…
Reference in New Issue
Block a user