| 203 | |
| 204 | static hook::Hook<decltype(&cef_initialize)> CefInitialize; |
| 205 | static int Hooked_CefInitialize(const struct _cef_main_args_t* args, |
| 206 | const struct _cef_settings_t* settings, cef_app_t* app, void* windows_sandbox_info) |
| 207 | { |
| 208 | // Hook command line. |
| 209 | OnBeforeCommandLineProcessing = app->on_before_command_line_processing; |
| 210 | app->on_before_command_line_processing = Hooked_OnBeforeCommandLineProcessing; |
| 211 | |
| 212 | const_cast<cef_settings_t *>(settings)->cache_path |
| 213 | = CefStr::from_path(config::cache_dir()).forward(); |
| 214 | |
| 215 | const_cast<cef_settings_t *>(settings)->root_cache_path |
| 216 | = CefStr::from_path(config::cache_dir()).forward(); |
| 217 | |
| 218 | //static auto GetBrowserProcessHandler = app->get_browser_process_handler; |
| 219 | //app->get_browser_process_handler = [](cef_app_t *self) |
| 220 | //{ |
| 221 | // auto handler = GetBrowserProcessHandler(self); |
| 222 | // |
| 223 | // static auto OnContextIntialized = handler->on_context_initialized; |
| 224 | // handler->on_context_initialized = [](cef_browser_process_handler_t *self) |
| 225 | // { |
| 226 | // browser::register_plugins_domain(); |
| 227 | // browser::register_riotclient_domain(); |
| 228 | // OnContextIntialized(self); |
| 229 | // }; |
| 230 | |
| 231 | // return handler; |
| 232 | //}; |
| 233 | |
| 234 | return CefInitialize(args, settings, app, windows_sandbox_info); |
| 235 | } |
| 236 | |
| 237 | void HookBrowserProcess() |
| 238 | { |