@@ -54,32 +54,52 @@ pub fn initialize(event_tx: Sender<Event>) {
5454
5555 let mut settings = unsafe { std:: mem:: zeroed :: < cef_sys:: cef_settings_t > ( ) } ;
5656
57- let cache_path = crate :: utils:: documents_path ( ) ;
57+ // let cache_path = crate::utils::documents_path();
5858 let cef_dir = crate :: utils:: cef_dir ( ) ;
59+ let cache_path = cef_dir. join ( "cache" ) ;
5960
60- log:: trace!( "cache_path: {:?}" , cache_path) ;
61+ // log::trace!("cache_path: {:?}", cache_path);
6162 log:: trace!( "cef_dir: {:?}" , cef_dir) ;
6263
63- let path = CefString :: new ( & cef_dir. join ( "renderer.exe" ) . to_string_lossy ( ) ) ;
64- let cache_path = CefString :: new ( & cache_path. to_string_lossy ( ) ) ;
65- let locales_dir_path = CefString :: new ( & cef_dir. join ( "locales" ) . to_string_lossy ( ) ) ;
66- let resources_dir_path = CefString :: new ( & cef_dir. to_string_lossy ( ) ) ;
64+ // let path = CefString::new(&cef_dir.join("renderer.exe").to_string_lossy());
65+ // let cache_path = CefString::new(&cache_path.to_string_lossy());
66+ // let locales_dir_path = CefString::new(&cef_dir.join("locales").to_string_lossy());
67+ // let resources_dir_path = CefString::new(&cef_dir.to_string_lossy());
68+ // let root_cache_path = CefString::new(&cef_dir.to_string_lossy());
69+ // let log_file = CefString::new(&cef_dir.join("cef.log").to_string_lossy());
70+
71+ let path = cef:: types:: string:: into_cef_string ( & cef_dir. join ( "renderer.exe" ) . to_string_lossy ( ) ) ;
72+ let cache_path = cef:: types:: string:: into_cef_string ( & cache_path. to_string_lossy ( ) ) ;
73+ let locales_dir_path =
74+ cef:: types:: string:: into_cef_string ( & cef_dir. join ( "locales" ) . to_string_lossy ( ) ) ;
75+ let resources_dir_path = cef:: types:: string:: into_cef_string ( & cef_dir. to_string_lossy ( ) ) ;
76+ let root_cache_path = cef:: types:: string:: into_cef_string ( & cef_dir. to_string_lossy ( ) ) ;
77+ let log_file = cef:: types:: string:: into_cef_string ( & cef_dir. join ( "cef.log" ) . to_string_lossy ( ) ) ;
78+ let user_data =
79+ cef:: types:: string:: into_cef_string ( & cef_dir. join ( "user_data" ) . to_string_lossy ( ) ) ;
80+
81+ log:: trace!( "{:?}" , cef_dir. join( "cef.log" ) ) ;
6782
6883 settings. size = std:: mem:: size_of :: < cef_sys:: cef_settings_t > ( ) ;
6984 settings. no_sandbox = 1 ;
70- settings. browser_subprocess_path = path. to_cef_string ( ) ;
85+ settings. browser_subprocess_path = path;
7186 settings. windowless_rendering_enabled = 1 ;
7287 settings. multi_threaded_message_loop = 1 ;
7388 settings. log_severity = 0 ;
74- settings. cache_path = cache_path. to_cef_string ( ) ;
75- settings. locales_dir_path = locales_dir_path. to_cef_string ( ) ;
76- settings. resources_dir_path = resources_dir_path. to_cef_string ( ) ;
89+ settings. cache_path = cache_path;
90+ settings. locales_dir_path = locales_dir_path;
91+ settings. resources_dir_path = resources_dir_path;
92+ settings. ignore_certificate_errors = 1 ;
93+ settings. command_line_args_disabled = 1 ;
94+ settings. log_file = log_file;
95+ settings. user_data_path = user_data;
7796
7897 let app = Arc :: new ( DefaultApp { event_tx } ) ;
7998
8099 log:: trace!( "PRE cef::initialize" ) ;
81- // cef::initialize(None, &settings, Some(app));
100+
82101 cef:: initialize ( Some ( & main_args) , & settings, Some ( app) ) ;
102+
83103 log:: trace!( "POST cef::initialize" ) ;
84104}
85105
0 commit comments