Exemplo n.º 1
0
// create the underlying C structure for an App Handler.
func NewAppHandlerT(handler AppHandler) AppHandlerT {

	var a AppHandlerT
	a.CStruct = (*C.cef_app_t)(
		C.calloc(1, C.sizeof_cef_app_t))
	C.initialize_app_handler(a.CStruct)
	Logger.Infof("_AppHandler: %x", unsafe.Pointer(a.CStruct))

	knownAppHandlers[unsafe.Pointer(a.CStruct)] = handler
	return a
}
Exemplo n.º 2
0
Arquivo: cef.go Projeto: mmatey/cef2go
func _InitializeGlobalCStructures() {
	_MainArgs = (*C.struct__cef_main_args_t)(C.calloc(1, C.sizeof_struct__cef_main_args_t))
	go_AddRef(unsafe.Pointer(_MainArgs))

	_AppHandler = (*C.cef_app_t)(C.calloc(1, C.sizeof_cef_app_t))
	go_AddRef(unsafe.Pointer(_AppHandler))
	C.initialize_app_handler(_AppHandler)

	_ClientHandler = (*C.struct__cef_client_t)(C.calloc(1, C.sizeof_struct__cef_client_t))
	go_AddRef(unsafe.Pointer(_ClientHandler))
	C.initialize_client_handler(_ClientHandler)
}
Exemplo n.º 3
0
Arquivo: cef.go Projeto: hernad/cef2go
func _InitializeGlobalCStructures() {
	_MainArgs = (*C.struct__cef_main_args_t)(
		C.calloc(1, C.sizeof_struct__cef_main_args_t))

	// Some bug in Go on Windows: "unexpected fault address 0xffffffff".
	// Happens in cef_execute_process() when initialize_app_handler()
	// or initialize_client_handler() are called here. This same code
	// works perfectly fine on Linux and OS X. From the logs:
	// [cef] cef.go:88: ExecuteProcess, args= [cef2go.exe]
	// initialize_app_handler
	// initialize_cef_base
	// cef_base_t.size = 36
	// initialize_client_handler
	// initialize_cef_base
	// cef_base_t.size = 72
	// [cef] cef_windows.go:19: FillMainArgs
	// cef_base_t.add_ref
	// unexpected fault address 0xffffffff
	// fatal error: fault
	// So it looks like the problem occurs after the first call to
	// add_ref made by CEF.
	// Maybe that's the bug - some problem during linking:
	// "cmd/ld: order of files in archives matters on Windows"
	// https://code.google.com/p/go/issues/detail?id=2601

	_AppHandler = (*C.cef_app_t)(
		C.calloc(1, C.sizeof_cef_app_t))
	if runtime.GOOS != "windows" {
		C.initialize_app_handler(_AppHandler)
	}

	_ClientHandler = (*C.struct__cef_client_t)(
		C.calloc(1, C.sizeof_struct__cef_client_t))
	if runtime.GOOS != "windows" {
		C.initialize_client_handler(_ClientHandler)
	}
}