Skip to content
Snippets Groups Projects
Commit 499fefa8 authored by Pascal Stücker's avatar Pascal Stücker
Browse files

Fix remote debugging not working

parent 56ff5e3e
No related branches found
No related tags found
1 merge request!37Fix remote debugging not working
Pipeline #19202 failed
......@@ -18,7 +18,11 @@ public class cef_command_line_t {
*
* @param command_line
* the command line
* @param cmdSwitch
* the switch to append
* @param value
* switch value (or null if no value)
*/
public static native void cefswt_disable_component_update(
final long command_line);
public static native void cefswt_append_switch(
final long command_line, final String cmdSwitch, String value);
}
\ No newline at end of file
......@@ -8,6 +8,7 @@
*/
package org.eclipse.set.browser.cef.handlers;
import org.eclipse.set.browser.cef.ChromiumStatic;
import org.eclipse.set.browser.lib.ChromiumLib;
import org.eclipse.set.browser.lib.cef_command_line_t;
......@@ -42,6 +43,13 @@ public class AppHandler {
@SuppressWarnings({ "unused", "static-method" }) // Called via JNI
private void on_before_command_line_processing(final long app, final long process_type, final long command_line) {
cef_command_line_t.cefswt_disable_component_update(command_line);
// Disable updating Chromium components from Google servers
cef_command_line_t.cefswt_append_switch(command_line, "disable-component-update", null);
// If debugging is enabled, allow remote debugging
if(ChromiumStatic.getCEFConfiguration().DebugPort != 0)
{
cef_command_line_t.cefswt_append_switch(command_line, "remote-allow-origins", "*");
}
}
}
......@@ -333,7 +333,19 @@ pub fn cefswt_request_to_java(request: *mut chromium::cef::_cef_request_t) -> *m
}
#[jni_wrapper("org.eclipse.set.browser.lib.cef_command_line_t")]
pub fn cefswt_disable_component_update(command_line: *mut chromium::cef::_cef_command_line_t) {
let switch = chromium::utils::cef_string("disable-component-update");
unsafe { ((*command_line).append_switch.unwrap())(command_line, &switch) }
pub fn cefswt_append_switch(
command_line: *mut chromium::cef::_cef_command_line_t,
switch: *const c_char,
value: *const c_char,
) {
let switch = chromium::utils::cef_string_from_c(switch);
if !value.is_null() {
let value = chromium::utils::cef_string_from_c(value);
unsafe {
((*command_line).append_switch_with_value.unwrap())(command_line, &switch, &value)
}
} else {
unsafe { ((*command_line).append_switch.unwrap())(command_line, &switch) }
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment