Giter VIP home page Giter VIP logo

cefcapi's People

Contributors

cztomczak avatar jiri-janousek avatar perlun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cefcapi's Issues

Process does not exit when closing window on Windows

On Windows when window is closed application does not exist, the process is still running. This is because CEF message loop is still running. The cef_quit_message_loop function must be called. This func should be called when closing browser window. This can be accomplished by implemented cef_life_span_handler_t handler and its on_before_close callback.

Outdated API usage; not enough information.

  1. Example code appears to be not compatible with the latest CEF (e.g. initialize_cef_app does not exist anymore).
  2. There is really not enough information, especially for handler overriding or multi-threaded message pump (so far I only managed to cause a crash with multi-threaded option).

locale_file_path.empty problem

Hi man... in your example, after callback "on_register_custom_schemes", i'm having this error, what i missing?

on_register_custom_schemes
[0801/004832:WARNING:resource_bundle.cc(280)] locale_file_path.empty()
[0801/004832:FATAL:main_delegate.cc(499)] Check failed: !loaded_locale.empty(). Locale could not be found for en-US

Ihave the exactly same version of cefcapi requirements:
cef_binary_3.1750.1629_linux64_client

Please help me...

Exception code 80000003 in cef_execute_process on Windows

I am in the process of updating the cefcapi project to CEF branch 3029. On Linux everything went fine. However on Windows I am getting exception code 80000003 during a call to cef_execute_process. Here are the logs with backtrace:

Starting program: C:\github\cefcapi\Release/cefcapi.exe
[New Thread 5776.0x85c]
CEF version: 3.3029.1608.g27a32db
initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 36
cef_execute_process, argc=1
cef_base_ref_counted_t.add_ref

Program received signal SIGTRAP, Trace/breakpoint trap.
0x02152469 in ?? ()
(gdb) bt
#0  0x02152469 in ?? ()
#1  0x10b9534c in libcef!cef_execute_process () from C:\github\cefcapi\Release\libcef.dll
#2  0x00401a54 in main ()

Building with gcc on Windows. I've tried both mingw GCC (5.3.0) and TDM-gcc (5.1.0) and both end up with that same exception code. From what I know I can't use PDB files with gdb to get a meaningful stack trace.

On Linux it runs fine, but gcc version is 4.8.2, so it's different.

Can't make the gtk3 version work with latest CEF

Hi.
I'm trying to run the linux gtk3 example, but I get a blank window.
When I'm trying with latest cef (with the update to the version file), here's the output:

gcc -std=c99 -Wall -Werror -o Release/cefcapi-gtk3 -I. -I.. -Wl,-rpath,. -L./Release examples/main_linux.c -lX11 -lcef `pkg-config --libs --cflags gtk+-3.0`
cd Release/ && ./cefcapi-gtk3 && cd ../

Process args: none (Main process)

initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 72
cef_execute_process, argc=1
cef_base_ref_counted_t.add_ref
cef_base_ref_counted_t.release
cef_initialize
on_register_custom_schemes
get_resource_bundle_handler
get_render_process_handler

Process args: --type=zygote --log-file=/Source/cefcapi/Release/debug.log --log-severity=warning --lang=en-US 

initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 72
cef_execute_process, argc=5
cef_base_ref_counted_t.add_ref
cef_base_ref_counted_t.release
on_register_custom_schemes
get_resource_bundle_handler
get_browser_process_handler
initialize_gtk 3.24.10

Process args: --type=gpu-process --field-trial-handle=2712795478167384992,3790689281789308514,131072 --disable-features=NetworkService --log-file=/Source/cefcapi/Release/debug.log --log-severity=warning --lang=en-US --gpu-preferences=KAAAAAAAAAAgAAAgAQAAAAAAAAAAAGAAAAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAA --log-file=/Source/cefcapi/Release/debug.log --service-request-channel-token=8067843791169823745 

initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 72
cef_execute_process, argc=10
cef_base_ref_counted_t.add_ref
cef_base_ref_counted_t.release
on_register_custom_schemes
get_resource_bundle_handler
create_gtk_window
Window xid 39845890
initialize_client_handler
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 152
cef_browser_host_create_browser
get_request_handler
cef_run_message_loop
window_destroy_signal
cef_shutdown

When I try with the version specified in the readme, I get this error:

(cefcapi-gtk3:4837): Gtk-ERROR **: 13:17:04.138: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

(The gtk2 version works fine with the older cef version.)

I'm on ArchLinux and use gtk+ 3.24.

Thanks for your help.

Updates?

Any plans to update the project?

Life span handler.

I really dont know if people are using this. But heres how you register the missing life_span handler.

///
// Return the handler for browser life span events.
///
struct _cef_life_span_handler_t* CEF_CALLBACK get_life_span_handler(
        struct _cef_client_t* self) {
    DEBUG_CALLBACK("get_life_span_handler\n");

    cef_life_span_handler_t *life_span_handler = (cef_life_span_handler_t *)calloc(1, sizeof(cef_life_span_handler_t)); 
    initialize_cef_life_span_handler(life_span_handler);

    // Implemented!
    return life_span_handler;
}

I added a g_exit method in the initialise on do_close and now the application cleanly exits.
Hope this helps.

GTK+ 3.22 Port

gcc -std=c99 -Wall -Werror -o Release/cefcapi.out -I. -I.. -Wl,-rpath,. -L./Release examples/main_linux.c -lX11 -lcef `pkg-config --libs --cflags gtk+-3.0`
cd Release/ && ./cefcapi.out && cd ../

Process args: none (Main process)

initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 72
cef_execute_process, argc=1
cef_base_ref_counted_t.add_ref
cef_base_ref_counted_t.release
cef_initialize
on_before_command_line_processing
on_register_custom_schemes
get_browser_process_handler

Process args: --type=zygote --no-sandbox --lang=en-US --log-file=/home/fenryxo/dev/projects/cef/cefcapi/Release/debug.log --log-severity=warning 

initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 72
cef_execute_process, argc=6
cef_base_ref_counted_t.add_ref
cef_base_ref_counted_t.release
on_before_command_line_processing
on_register_custom_schemes
get_resource_bundle_handler
initialize_gtk
[1111/165611.209405:ERROR:nss_util.cc(747)] After loading Root Certs, loaded==false: NSS error code: -8018
create_gtk_window
initialize_client_handler
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 152
cef_browser_host_create_browser
cef_run_message_loop
X11 error: type=0, serial=200, code=8
X11 error: type=0, serial=202, code=3
X11 error: type=0, serial=203, code=3
X11 error: type=0, serial=204, code=3
X11 error: type=0, serial=205, code=3
X11 error: type=0, serial=206, code=3
X11 error: type=0, serial=207, code=3
X11 error: type=0, serial=208, code=3
X11 error: type=0, serial=219, code=3
X11 error: type=0, serial=221, code=3
X11 error: type=0, serial=222, code=3
X11 error: type=0, serial=223, code=3
X11 error: type=0, serial=224, code=3
X11 error: type=0, serial=228, code=3
X11 error: type=0, serial=229, code=3
Segmentation fault

It would be great if we managed to make CEF work with GTK+ 3. I'm afraid I don't have enough experience with CEF to do it on my own.

Reference counting

I might be wrong: But how can this example code work if reference counting is not really implemented?...

Segfault cefcapi.out Ubuntu 14.04

Hi
When i execute cefcapi.out i get a segfault.

./cefcapi.out 

Process args: none (Main process)

initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 72
cef_execute_process, argc=1
cef_base_ref_counted_t.add_ref
cef_base_ref_counted_t.release
cef_initialize
on_before_command_line_processing
on_register_custom_schemes
get_browser_process_handler

Process args: --type=zygote --no-sandbox --lang=en-US --log-file=debug.log --log-severity=warning 

initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 72
cef_execute_process, argc=6
cef_base_ref_counted_t.add_ref
cef_base_ref_counted_t.release
on_before_command_line_processing
on_register_custom_schemes
get_resource_bundle_handler
Erreur de segmentation (core dumped)

What can be the cause of this segfault ?

PS: See below the result with gdb

gdb ./cefcapi.out 
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./cefcapi.out...done.
(gdb) r
Starting program: cefcapi.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Process args: none (Main process)

initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 72
cef_execute_process, argc=1
cef_base_ref_counted_t.add_ref
cef_base_ref_counted_t.release
cef_initialize
on_before_command_line_processing
on_register_custom_schemes
[New Thread 0x7fffe5b92700 (LWP 25155)]
get_browser_process_handler

Process args: --type=zygote --no-sandbox --lang=en-US --log-file=debug.log --log-severity=warning 

initialize_cef_app
initialize_cef_base_ref_counted
cef_base_ref_counted_t.size = 72
cef_execute_process, argc=6
cef_base_ref_counted_t.add_ref
cef_base_ref_counted_t.release
on_before_command_line_processing
on_register_custom_schemes
[New Thread 0x7fffe5391700 (LWP 25161)]
[New Thread 0x7fffe4b90700 (LWP 25162)]
[New Thread 0x7fffd7fff700 (LWP 25163)]
[New Thread 0x7fffd77fe700 (LWP 25164)]
[New Thread 0x7fffd6ffd700 (LWP 25165)]
[New Thread 0x7fffd67fc700 (LWP 25166)]
[New Thread 0x7fffd5ffb700 (LWP 25167)]
[New Thread 0x7fffd57fa700 (LWP 25168)]
[New Thread 0x7fffd4ff9700 (LWP 25169)]
[New Thread 0x7fffb7fff700 (LWP 25170)]
[New Thread 0x7fffb77fe700 (LWP 25171)]
[New Thread 0x7fffb6ffd700 (LWP 25172)]
[New Thread 0x7fffb67fc700 (LWP 25173)]
[New Thread 0x7fffb5ffb700 (LWP 25174)]
[New Thread 0x7fffb57fa700 (LWP 25175)]
get_resource_bundle_handler

Program received signal SIGSEGV, Segmentation fault.
GetAsDictionary () at ../../base/values.cc:341
341	../../base/values.cc: Aucun fichier ou dossier de ce type.
(gdb) bt
#0  GetAsDictionary () at ../../base/values.cc:341
#1  0x00007ffff17df649 in AddServiceManifest () at ../../content/browser/service_manager/service_manager_context.cc:138
#2  0x00007ffff17de641 in ServiceManagerContext () at ../../content/browser/service_manager/service_manager_context.cc:272
#3  0x00007ffff15e367e in InitializeMojo () at ../../content/browser/browser_main_loop.cc:1695
#4  0x00007ffff15e25e4 in BrowserThreadsStarted () at ../../content/browser/browser_main_loop.cc:1411
#5  0x00007ffff186baf6 in Run () at ../../base/callback.h:85
#6  RunAllTasksNow () at ../../content/browser/startup_task_runner.cc:45
#7  0x00007ffff15e160b in CreateStartupTasks () at ../../content/browser/browser_main_loop.cc:974
#8  0x00007ffff15dce51 in Initialize () at ../../content/browser/browser_main_runner.cc:125
#9  0x00007ffff24c7d56 in RunProcess () at ../../cef/libcef/common/main_delegate.cc:562
#10 0x00007ffff2426d27 in RunNamedProcessTypeMain () at ../../content/app/content_main_runner.cc:478
#11 0x00007ffff242748c in Run () at ../../content/app/content_main_runner.cc:836
#12 0x00007ffff2454aa2 in Initialize () at ../../cef/libcef/browser/context.cc:384
#13 0x00007ffff24547e7 in CefInitialize () at ../../cef/libcef/browser/context.cc:222
#14 0x00007ffff11383d4 in cef_initialize () at ../../cef/libcef_dll/libcef_dll.cc:222
#15 0x0000000000401a91 in main (argc=1, argv=0x7fffffffdc88) at examples/main_linux.c:76
(gdb) info thread
  Id   Target Id         Frame 
  17   Thread 0x7fffb57fa700 (LWP 25175) "Chrome_IOThread" 0x00007fffef68ea13 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
  16   Thread 0x7fffb5ffb700 (LWP 25174) "Chrome_CacheThr" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  15   Thread 0x7fffb67fc700 (LWP 25173) "Chrome_ProcessL" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  14   Thread 0x7fffb6ffd700 (LWP 25172) "Chrome_FileUser" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  13   Thread 0x7fffb77fe700 (LWP 25171) "Chrome_FileThre" 0x00007fffef68ea13 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
  12   Thread 0x7fffb7fff700 (LWP 25170) "Chrome_DBThread" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  11   Thread 0x7fffd4ff9700 (LWP 25169) "TaskSchedulerFo" pthread_cond_timedwait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  10   Thread 0x7fffd57fa700 (LWP 25168) "TaskSchedulerFo" pthread_cond_timedwait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  9    Thread 0x7fffd5ffb700 (LWP 25167) "TaskSchedulerBa" pthread_cond_timedwait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  8    Thread 0x7fffd67fc700 (LWP 25166) "TaskSchedulerBa" pthread_cond_timedwait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  7    Thread 0x7fffd6ffd700 (LWP 25165) "TaskSchedulerSe" 0x00007fffef68ea13 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
  6    Thread 0x7fffd77fe700 (LWP 25164) "WorkerPool/2516" pthread_cond_timedwait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  5    Thread 0x7fffd7fff700 (LWP 25163) "WorkerPool/2516" pthread_cond_timedwait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
  4    Thread 0x7fffe4b90700 (LWP 25162) "inotify_reader" 0x00007fffef685c53 in select () at ../sysdeps/unix/syscall-template.S:81
  3    Thread 0x7fffe5391700 (LWP 25161) "NetworkChangeNo" 0x00007fffef68ea13 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
  2    Thread 0x7fffe5b92700 (LWP 25155) "sandbox_ipc_thr" 0x00007fffef680fdd in poll () at ../sysdeps/unix/syscall-template.S:81
* 1    Thread 0x7ffff7faea00 (LWP 25041) "cefcapi.out" GetAsDictionary () at ../../base/values.cc:341

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.