chore(deps): bump purego-cef to v0.14.1
v0.14.0 pinned the CEF API 15000 contract and fixed the struct ABI corruption that made BrowserSettings.BackgroundColor land on chrome_status_bubble (transparent windowless canvas). v0.14.1 restores the global function bindings dropped by that regeneration (DictionaryValueCreate, V8ContextGetCurrentContext, all *Create factories) and fixes global factory ownership so created objects are adopted without a leaked reference. This makes the white-canvas fix in this branch effective: the opaque white BrowserSettings.BackgroundColor now actually reaches libcef.
- commit
- 902c404508da47722a324d2f14b2a4cfc04a2812
- author
- brice · · 2026-07-21 19:07 UTC
- parent
- 1dc7dd4
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
75 files · +1836 -1983
M go.mod +1 -1
| @@ -6,7 +6,7 @@ require ( | |||
| 6 | 6 | github.com/a-h/templ v0.3.1020 | |
| 7 | 7 | github.com/andybalholm/brotli v1.2.2 | |
| 8 | 8 | github.com/bnema/purego v0.11.0-bnema.4 | |
| 9 | - | github.com/bnema/purego-cef v0.13.4 | |
| 9 | + | github.com/bnema/purego-cef v0.14.1 | |
| 10 | 10 | github.com/bnema/purego-cef2gtk v0.8.5 | |
| 11 | 11 | github.com/bnema/purego-pipewire v0.1.5 | |
| 12 | 12 | github.com/bnema/purego-sqlite v0.1.4 | |
| @@ -6,7 +6,7 @@ require ( | |||||
| 6 | github.com/a-h/templ v0.3.1020 | 6 | github.com/a-h/templ v0.3.1020 | ||
| 7 | github.com/andybalholm/brotli v1.2.2 | 7 | github.com/andybalholm/brotli v1.2.2 | ||
| 8 | github.com/bnema/purego v0.11.0-bnema.4 | 8 | github.com/bnema/purego v0.11.0-bnema.4 | ||
| 9 | - | github.com/bnema/purego-cef v0.13.4 | 9 | + | github.com/bnema/purego-cef v0.14.1 |
| 10 | github.com/bnema/purego-cef2gtk v0.8.5 | 10 | github.com/bnema/purego-cef2gtk v0.8.5 | ||
| 11 | github.com/bnema/purego-pipewire v0.1.5 | 11 | github.com/bnema/purego-pipewire v0.1.5 | ||
| 12 | github.com/bnema/purego-sqlite v0.1.4 | 12 | github.com/bnema/purego-sqlite v0.1.4 | ||
M go.sum +2 -2 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_browser_gen.go +15 -2 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_command_line_gen.go +15 -2 generated file: collapsed
A vendor/github.com/bnema/purego-cef/cef/cef_component_updater_gen.go +323 -0 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_cookie_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_drag_data_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_image_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_media_router_gen.go +24 -41 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_menu_model_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_parser_gen.go +10 -4 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_preference_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_print_settings_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_process_message_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_request_context_gen.go +16 -3 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_request_gen.go +42 -3 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_resource_bundle_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_response_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_shared_memory_region_gen.go +3 -3 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_shared_process_message_builder_gen.go +20 -4 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_stream_gen.go +34 -5 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_task_gen.go +15 -2 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_task_manager_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_thread_gen.go +14 -1 generated file: collapsed
A vendor/github.com/bnema/purego-cef/cef/cef_types_component_gen.go +45 -0 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_types_content_settings_gen.go +72 -79 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_types_gen.go +59 -52 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_urlrequest_gen.go +14 -1 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_v8_gen.go +166 -19 generated file: collapsed
M vendor/github.com/bnema/purego-cef/cef/cef_values_gen.go +62 -7
| @@ -269,6 +269,19 @@ func wrapValue(ptr unsafe.Pointer) Value { | |||
| 269 | 269 | return impl | |
| 270 | 270 | } | |
| 271 | 271 | ||
| 272 | + | // takeValue adopts a CEF Value pointer whose reference is already owned by | |
| 273 | + | // the caller (as returned by a global factory function). Unlike wrapValue it | |
| 274 | + | // does NOT call AddRef, because the C API already transferred one reference to us. | |
| 275 | + | func takeValue(ptr unsafe.Pointer) Value { | |
| 276 | + | if ptr == nil { | |
| 277 | + | return nil | |
| 278 | + | } | |
| 279 | + | r := (*capi.CEFValueT)(ptr) | |
| 280 | + | impl := &valueImpl{rawPtr: r} | |
| 281 | + | runtime.SetFinalizer(impl, (*valueImpl).Release) | |
| 282 | + | return impl | |
| 283 | + | } | |
| 284 | + | ||
| 272 | 285 | // BinaryValue Structure representing a binary value. Can be used on any process and thread. | |
| 273 | 286 | type BinaryValue = portin.BinaryValue | |
| 274 | 287 | ||
| @@ -325,13 +338,13 @@ func (obj *binaryValueImpl) Copy() BinaryValue { | |||
| 325 | 338 | return wrapBinaryValue(unsafe.Pointer(ret)) | |
| 326 | 339 | } | |
| 327 | 340 | ||
| 328 | - | func (obj *binaryValueImpl) GetRawData() unsafe.Pointer { | |
| 341 | + | func (obj *binaryValueImpl) GetRawData() uintptr { | |
| 329 | 342 | if obj == nil || obj.rawPtr == nil { | |
| 330 | - | return nil | |
| 343 | + | return 0 | |
| 331 | 344 | } | |
| 332 | 345 | rawPtr := obj.rawPtr | |
| 333 | 346 | ret := rawPtr.CallGetRawData() | |
| 334 | - | return unsafe.Pointer(ret) | |
| 347 | + | return uintptr(ret) | |
| 335 | 348 | } | |
| 336 | 349 | ||
| 337 | 350 | func (obj *binaryValueImpl) GetSize() int { | |
| @@ -388,6 +401,19 @@ func wrapBinaryValue(ptr unsafe.Pointer) BinaryValue { | |||
| 388 | 401 | return impl | |
| 389 | 402 | } | |
| 390 | 403 | ||
| 404 | + | // takeBinaryValue adopts a CEF BinaryValue pointer whose reference is already owned by | |
| 405 | + | // the caller (as returned by a global factory function). Unlike wrapBinaryValue it | |
| 406 | + | // does NOT call AddRef, because the C API already transferred one reference to us. | |
| 407 | + | func takeBinaryValue(ptr unsafe.Pointer) BinaryValue { | |
| 408 | + | if ptr == nil { | |
| 409 | + | return nil | |
| 410 | + | } | |
| 411 | + | r := (*capi.CEFBinaryValueT)(ptr) | |
| 412 | + | impl := &binaryValueImpl{rawPtr: r} | |
| 413 | + | runtime.SetFinalizer(impl, (*binaryValueImpl).Release) | |
| 414 | + | return impl | |
| 415 | + | } | |
| 416 | + | ||
| 391 | 417 | // DictionaryValue Structure representing a dictionary value. Can be used on any process and thread. | |
| 392 | 418 | type DictionaryValue = portin.DictionaryValue | |
| 393 | 419 | ||
| @@ -748,6 +774,19 @@ func wrapDictionaryValue(ptr unsafe.Pointer) DictionaryValue { | |||
| 748 | 774 | return impl | |
| 749 | 775 | } | |
| 750 | 776 | ||
| 777 | + | // takeDictionaryValue adopts a CEF DictionaryValue pointer whose reference is already owned by | |
| 778 | + | // the caller (as returned by a global factory function). Unlike wrapDictionaryValue it | |
| 779 | + | // does NOT call AddRef, because the C API already transferred one reference to us. | |
| 780 | + | func takeDictionaryValue(ptr unsafe.Pointer) DictionaryValue { | |
| 781 | + | if ptr == nil { | |
| 782 | + | return nil | |
| 783 | + | } | |
| 784 | + | r := (*capi.CEFDictionaryValueT)(ptr) | |
| 785 | + | impl := &dictionaryValueImpl{rawPtr: r} | |
| 786 | + | runtime.SetFinalizer(impl, (*dictionaryValueImpl).Release) | |
| 787 | + | return impl | |
| 788 | + | } | |
| 789 | + | ||
| 751 | 790 | // ListValue Structure representing a list value. Can be used on any process and thread. | |
| 752 | 791 | type ListValue = portin.ListValue | |
| 753 | 792 | ||
| @@ -1059,26 +1098,42 @@ func wrapListValue(ptr unsafe.Pointer) ListValue { | |||
| 1059 | 1098 | return impl | |
| 1060 | 1099 | } | |
| 1061 | 1100 | ||
| 1101 | + | // takeListValue adopts a CEF ListValue pointer whose reference is already owned by | |
| 1102 | + | // the caller (as returned by a global factory function). Unlike wrapListValue it | |
| 1103 | + | // does NOT call AddRef, because the C API already transferred one reference to us. | |
| 1104 | + | func takeListValue(ptr unsafe.Pointer) ListValue { | |
| 1105 | + | if ptr == nil { | |
| 1106 | + | return nil | |
| 1107 | + | } | |
| 1108 | + | r := (*capi.CEFListValueT)(ptr) | |
| 1109 | + | impl := &listValueImpl{rawPtr: r} | |
| 1110 | + | runtime.SetFinalizer(impl, (*listValueImpl).Release) | |
| 1111 | + | return impl | |
| 1112 | + | } | |
| 1113 | + | ||
| 1062 | 1114 | // ValueCreate Creates a new object. | |
| 1063 | 1115 | func ValueCreate() Value { | |
| 1064 | 1116 | ret := capi.CEFValueCreate() | |
| 1065 | - | return wrapValue(ret) | |
| 1117 | + | return takeValue(ret) | |
| 1066 | 1118 | } | |
| 1067 | 1119 | ||
| 1068 | 1120 | // BinaryValueCreate Creates a new object that is not owned by any other object. The specified |data| will be copied. | |
| 1069 | 1121 | func BinaryValueCreate(data unsafe.Pointer, dataSize int) BinaryValue { | |
| 1122 | + | if dataSize < 0 { | |
| 1123 | + | return nil | |
| 1124 | + | } | |
| 1070 | 1125 | ret := capi.CEFBinaryValueCreate(data, uintptr(dataSize)) | |
| 1071 | - | return wrapBinaryValue(ret) | |
| 1126 | + | return takeBinaryValue(ret) | |
| 1072 | 1127 | } | |
| 1073 | 1128 | ||
| 1074 | 1129 | // DictionaryValueCreate Creates a new object that is not owned by any other object. | |
| 1075 | 1130 | func DictionaryValueCreate() DictionaryValue { | |
| 1076 | 1131 | ret := capi.CEFDictionaryValueCreate() | |
| 1077 | - | return wrapDictionaryValue(ret) | |
| 1132 | + | return takeDictionaryValue(ret) | |
| 1078 | 1133 | } | |
| 1079 | 1134 | ||
| 1080 | 1135 | // ListValueCreate Creates a new object that is not owned by any other object. | |
| 1081 | 1136 | func ListValueCreate() ListValue { | |
| 1082 | 1137 | ret := capi.CEFListValueCreate() | |
| 1083 | - | return wrapListValue(ret) | |
| 1138 | + | return takeListValue(ret) | |
| 1084 | 1139 | } | |
| @@ -269,6 +269,19 @@ func wrapValue(ptr unsafe.Pointer) Value { | |||||
| 269 | return impl | 269 | return impl | ||
| 270 | } | 270 | } | ||
| 271 | 271 | ||||
| 272 | + | // takeValue adopts a CEF Value pointer whose reference is already owned by | |||
| 273 | + | // the caller (as returned by a global factory function). Unlike wrapValue it | |||
| 274 | + | // does NOT call AddRef, because the C API already transferred one reference to us. | |||
| 275 | + | func takeValue(ptr unsafe.Pointer) Value { | |||
| 276 | + | if ptr == nil { | |||
| 277 | + | return nil | |||
| 278 | + | } | |||
| 279 | + | r := (*capi.CEFValueT)(ptr) | |||
| 280 | + | impl := &valueImpl{rawPtr: r} | |||
| 281 | + | runtime.SetFinalizer(impl, (*valueImpl).Release) | |||
| 282 | + | return impl | |||
| 283 | + | } | |||
| 284 | + | ||||
| 272 | // BinaryValue Structure representing a binary value. Can be used on any process and thread. | 285 | // BinaryValue Structure representing a binary value. Can be used on any process and thread. | ||
| 273 | type BinaryValue = portin.BinaryValue | 286 | type BinaryValue = portin.BinaryValue | ||
| 274 | 287 | ||||
| @@ -325,13 +338,13 @@ func (obj *binaryValueImpl) Copy() BinaryValue { | |||||
| 325 | return wrapBinaryValue(unsafe.Pointer(ret)) | 338 | return wrapBinaryValue(unsafe.Pointer(ret)) | ||
| 326 | } | 339 | } | ||
| 327 | 340 | ||||
| 328 | - | func (obj *binaryValueImpl) GetRawData() unsafe.Pointer { | 341 | + | func (obj *binaryValueImpl) GetRawData() uintptr { |
| 329 | if obj == nil || obj.rawPtr == nil { | 342 | if obj == nil || obj.rawPtr == nil { | ||
| 330 | - | return nil | 343 | + | return 0 |
| 331 | } | 344 | } | ||
| 332 | rawPtr := obj.rawPtr | 345 | rawPtr := obj.rawPtr | ||
| 333 | ret := rawPtr.CallGetRawData() | 346 | ret := rawPtr.CallGetRawData() | ||
| 334 | - | return unsafe.Pointer(ret) | 347 | + | return uintptr(ret) |
| 335 | } | 348 | } | ||
| 336 | 349 | ||||
| 337 | func (obj *binaryValueImpl) GetSize() int { | 350 | func (obj *binaryValueImpl) GetSize() int { | ||
| @@ -388,6 +401,19 @@ func wrapBinaryValue(ptr unsafe.Pointer) BinaryValue { | |||||
| 388 | return impl | 401 | return impl | ||
| 389 | } | 402 | } | ||
| 390 | 403 | ||||
| 404 | + | // takeBinaryValue adopts a CEF BinaryValue pointer whose reference is already owned by | |||
| 405 | + | // the caller (as returned by a global factory function). Unlike wrapBinaryValue it | |||
| 406 | + | // does NOT call AddRef, because the C API already transferred one reference to us. | |||
| 407 | + | func takeBinaryValue(ptr unsafe.Pointer) BinaryValue { | |||
| 408 | + | if ptr == nil { | |||
| 409 | + | return nil | |||
| 410 | + | } | |||
| 411 | + | r := (*capi.CEFBinaryValueT)(ptr) | |||
| 412 | + | impl := &binaryValueImpl{rawPtr: r} | |||
| 413 | + | runtime.SetFinalizer(impl, (*binaryValueImpl).Release) | |||
| 414 | + | return impl | |||
| 415 | + | } | |||
| 416 | + | ||||
| 391 | // DictionaryValue Structure representing a dictionary value. Can be used on any process and thread. | 417 | // DictionaryValue Structure representing a dictionary value. Can be used on any process and thread. | ||
| 392 | type DictionaryValue = portin.DictionaryValue | 418 | type DictionaryValue = portin.DictionaryValue | ||
| 393 | 419 | ||||
| @@ -748,6 +774,19 @@ func wrapDictionaryValue(ptr unsafe.Pointer) DictionaryValue { | |||||
| 748 | return impl | 774 | return impl | ||
| 749 | } | 775 | } | ||
| 750 | 776 | ||||
| 777 | + | // takeDictionaryValue adopts a CEF DictionaryValue pointer whose reference is already owned by | |||
| 778 | + | // the caller (as returned by a global factory function). Unlike wrapDictionaryValue it | |||
| 779 | + | // does NOT call AddRef, because the C API already transferred one reference to us. | |||
| 780 | + | func takeDictionaryValue(ptr unsafe.Pointer) DictionaryValue { | |||
| 781 | + | if ptr == nil { | |||
| 782 | + | return nil | |||
| 783 | + | } | |||
| 784 | + | r := (*capi.CEFDictionaryValueT)(ptr) | |||
| 785 | + | impl := &dictionaryValueImpl{rawPtr: r} | |||
| 786 | + | runtime.SetFinalizer(impl, (*dictionaryValueImpl).Release) | |||
| 787 | + | return impl | |||
| 788 | + | } | |||
| 789 | + | ||||
| 751 | // ListValue Structure representing a list value. Can be used on any process and thread. | 790 | // ListValue Structure representing a list value. Can be used on any process and thread. | ||
| 752 | type ListValue = portin.ListValue | 791 | type ListValue = portin.ListValue | ||
| 753 | 792 | ||||
| @@ -1059,26 +1098,42 @@ func wrapListValue(ptr unsafe.Pointer) ListValue { | |||||
| 1059 | return impl | 1098 | return impl | ||
| 1060 | } | 1099 | } | ||
| 1061 | 1100 | ||||
| 1101 | + | // takeListValue adopts a CEF ListValue pointer whose reference is already owned by | |||
| 1102 | + | // the caller (as returned by a global factory function). Unlike wrapListValue it | |||
| 1103 | + | // does NOT call AddRef, because the C API already transferred one reference to us. | |||
| 1104 | + | func takeListValue(ptr unsafe.Pointer) ListValue { | |||
| 1105 | + | if ptr == nil { | |||
| 1106 | + | return nil | |||
| 1107 | + | } | |||
| 1108 | + | r := (*capi.CEFListValueT)(ptr) | |||
| 1109 | + | impl := &listValueImpl{rawPtr: r} | |||
| 1110 | + | runtime.SetFinalizer(impl, (*listValueImpl).Release) | |||
| 1111 | + | return impl | |||
| 1112 | + | } | |||
| 1113 | + | ||||
| 1062 | // ValueCreate Creates a new object. | 1114 | // ValueCreate Creates a new object. | ||
| 1063 | func ValueCreate() Value { | 1115 | func ValueCreate() Value { | ||
| 1064 | ret := capi.CEFValueCreate() | 1116 | ret := capi.CEFValueCreate() | ||
| 1065 | - | return wrapValue(ret) | 1117 | + | return takeValue(ret) |
| 1066 | } | 1118 | } | ||
| 1067 | 1119 | ||||
| 1068 | // BinaryValueCreate Creates a new object that is not owned by any other object. The specified |data| will be copied. | 1120 | // BinaryValueCreate Creates a new object that is not owned by any other object. The specified |data| will be copied. | ||
| 1069 | func BinaryValueCreate(data unsafe.Pointer, dataSize int) BinaryValue { | 1121 | func BinaryValueCreate(data unsafe.Pointer, dataSize int) BinaryValue { | ||
| 1122 | + | if dataSize < 0 { | |||
| 1123 | + | return nil | |||
| 1124 | + | } | |||
| 1070 | ret := capi.CEFBinaryValueCreate(data, uintptr(dataSize)) | 1125 | ret := capi.CEFBinaryValueCreate(data, uintptr(dataSize)) | ||
| 1071 | - | return wrapBinaryValue(ret) | 1126 | + | return takeBinaryValue(ret) |
| 1072 | } | 1127 | } | ||
| 1073 | 1128 | ||||
| 1074 | // DictionaryValueCreate Creates a new object that is not owned by any other object. | 1129 | // DictionaryValueCreate Creates a new object that is not owned by any other object. | ||
| 1075 | func DictionaryValueCreate() DictionaryValue { | 1130 | func DictionaryValueCreate() DictionaryValue { | ||
| 1076 | ret := capi.CEFDictionaryValueCreate() | 1131 | ret := capi.CEFDictionaryValueCreate() | ||
| 1077 | - | return wrapDictionaryValue(ret) | 1132 | + | return takeDictionaryValue(ret) |
| 1078 | } | 1133 | } | ||
| 1079 | 1134 | ||||
| 1080 | // ListValueCreate Creates a new object that is not owned by any other object. | 1135 | // ListValueCreate Creates a new object that is not owned by any other object. | ||
| 1081 | func ListValueCreate() ListValue { | 1136 | func ListValueCreate() ListValue { | ||
| 1082 | ret := capi.CEFListValueCreate() | 1137 | ret := capi.CEFListValueCreate() | ||
| 1083 | - | return wrapListValue(ret) | 1138 | + | return takeListValue(ret) |
| 1084 | } | 1139 | } | ||