Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
63531610
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
63531610
编写于
3月 15, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
upgrade-dev v2.3.8
上级
a5bca173
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
5 deletion
+12
-5
cef/cef-application.go
cef/cef-application.go
+4
-1
cef/cef-events.go
cef/cef-events.go
+4
-1
cef/cef-ipc-value-convert.go
cef/cef-ipc-value-convert.go
+3
-0
cef/cef-types-v8-value.go
cef/cef-types-v8-value.go
+1
-1
example/dev-test/ipc-event/ipc-event.go
example/dev-test/ipc-event/ipc-event.go
+0
-2
未找到文件。
cef/cef-application.go
浏览文件 @
63531610
...
...
@@ -236,6 +236,7 @@ func (m *TCEFApplication) SetOnRenderLoadError(fn GlobalCEFAppEventOnRenderLoadE
}
func
init
()
{
//var renderLock sync.Mutex
lcl
.
RegisterExtEventCallback
(
func
(
fn
interface
{},
getVal
func
(
idx
int
)
uintptr
)
bool
{
getPtr
:=
func
(
i
int
)
unsafe
.
Pointer
{
return
unsafe
.
Pointer
(
getVal
(
i
))
...
...
@@ -350,6 +351,7 @@ func init() {
frame
:=
&
ICefFrame
{
instance
:
getPtr
(
1
)}
fn
.
(
GlobalCEFAppEventOnRenderLoadError
)(
browse
,
frame
,
TCefErrorCode
(
getVal
(
2
)),
api
.
GoStr
(
getVal
(
3
)),
api
.
GoStr
(
getVal
(
4
)))
case
RenderProcessMessageReceived
:
//renderLock.Lock()
browse
:=
&
ICefBrowser
{
instance
:
getPtr
(
0
)}
frame
:=
&
ICefFrame
{
instance
:
getPtr
(
1
)}
processId
:=
CefProcessId
(
getVal
(
2
))
...
...
@@ -360,8 +362,9 @@ func init() {
*
result
=
renderProcessMessageReceived
(
browse
,
frame
,
processId
,
message
)
}
frame
.
Free
()
//
browse.Free()
browse
.
Free
()
message
.
Free
()
//renderLock.Unlock()
default
:
return
false
}
...
...
cef/cef-events.go
浏览文件 @
63531610
...
...
@@ -22,6 +22,7 @@ import (
)
func
init
()
{
//var browserLock sync.Mutex
var
resourceEventGet
=
func
(
fn
interface
{},
getVal
func
(
idx
int
)
uintptr
,
resp
bool
)
(
sender
lcl
.
IObject
,
browser
*
ICefBrowser
,
frame
*
ICefFrame
,
request
*
ICefRequest
,
response
*
ICefResponse
)
{
var
(
instance
unsafe
.
Pointer
...
...
@@ -76,6 +77,7 @@ func init() {
fn
.
(
ChromiumEventOnFindResult
)(
lcl
.
AsObject
(
sender
),
browse
,
int32
(
getVal
(
2
)),
int32
(
getVal
(
3
)),
(
*
TCefRect
)(
getPtr
(
4
)),
int32
(
getVal
(
5
)),
api
.
GoBool
(
getVal
(
6
)))
//browse.Free()
case
BrowseProcessMessageReceived
:
//browserLock.Lock()
sender
:=
getPtr
(
0
)
browse
:=
&
ICefBrowser
{
instance
:
getPtr
(
1
)}
frame
:=
&
ICefFrame
{
instance
:
getPtr
(
2
)}
...
...
@@ -87,8 +89,9 @@ func init() {
*
result
=
browserProcessMessageReceived
(
browse
,
frame
,
processId
,
message
)
}
frame
.
Free
()
//
browse.Free()
browse
.
Free
()
message
.
Free
()
//browserLock.Unlock()
case
ChromiumEventOnResourceLoadComplete
:
sender
,
browse
,
frame
,
request
,
response
:=
resourceEventGet
(
fn
,
getVal
,
true
)
fn
.
(
ChromiumEventOnResourceLoadComplete
)(
sender
,
browse
,
frame
,
request
,
response
,
*
(
*
consts
.
TCefUrlRequestStatus
)(
getPtr
(
5
)),
*
(
*
int64
)(
getPtr
(
6
)))
...
...
cef/cef-ipc-value-convert.go
浏览文件 @
63531610
...
...
@@ -254,6 +254,9 @@ func (m *v8ValueProcessMessageConvert) JSONObjectToV8Value(object json.JSONObjec
// V8ValueToProcessMessageBytes ICefV8Value 转换 [[]byte] 进程消息
func
(
m
*
v8ValueProcessMessageConvert
)
V8ValueToProcessMessageBytes
(
v8value
*
ICefV8Value
)
[]
byte
{
if
!
v8value
.
IsValid
()
{
return
nil
}
if
v8value
.
IsArray
()
{
if
result
,
err
:=
m
.
V8valueArrayToSlice
(
v8value
);
err
==
nil
{
if
v
,
err
:=
jsoniter
.
Marshal
(
result
);
err
==
nil
{
...
...
cef/cef-types-v8-value.go
浏览文件 @
63531610
...
...
@@ -369,7 +369,7 @@ func (m *ICefV8Value) SetValueByKey(key string, value *ICefV8Value, attribute co
func
(
m
*
ICefV8Value
)
SetValueByIndex
(
index
int32
,
value
*
ICefV8Value
)
bool
{
if
m
.
valueByIndex
!=
nil
{
m
.
valueByIndex
=
append
(
m
.
valueByIndex
,
value
)
m
.
valueByIndex
[
index
]
=
value
}
r1
,
_
,
_
:=
imports
.
Proc
(
internale_CefV8Value_SetValueByIndex
)
.
Call
(
m
.
Instance
(),
uintptr
(
index
),
value
.
Instance
())
return
api
.
GoBool
(
r1
)
...
...
example/dev-test/ipc-event/ipc-event.go
浏览文件 @
63531610
...
...
@@ -97,12 +97,10 @@ func main() {
})
ipc
.
On
(
"testGoEmitAndCallback"
,
func
()
{
fmt
.
Println
(
"testGoEmitAndCallback"
)
//触发JS监听的函数,并传入参数
ipc
.
EmitAndCallback
(
"onTestName2"
,
[]
any
{
r0
,
r1
+
count
,
r2
,
r3
,
r4
,
r5
,
r6
,
r7
,
r8
,
r9
,
r10
},
func
(
r1
string
)
{
fmt
.
Println
(
"onTestName2 r1: "
,
r1
)
})
//ipc.EmitAndCallback("", func() {}, "aaaa")
})
ipc
.
On
(
"testResultArgs"
,
func
(
args1
int
)
(
string
,
int
,
float64
,
bool
,
*
MyError
,
[]
string
,
[]
*
src
.
StructVarDemo
,
[]
src
.
StructVarDemo
,
map
[
string
]
string
,
map
[
string
]
interface
{},
[]
map
[
string
]
interface
{})
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录