File tree Expand file tree Collapse file tree 3 files changed +30
-6
lines changed
org.eclipse.set.browser.lib/src/org/eclipse/set/browser/lib
org.eclipse.set.browser/src/org/eclipse/set/browser/cef/handlers Expand file tree Collapse file tree 3 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ public class cef_command_line_t {
18
18
*
19
19
* @param command_line
20
20
* the command line
21
+ * @param cmdSwitch
22
+ * the switch to append
23
+ * @param value
24
+ * switch value (or null if no value)
21
25
*/
22
- public static native void cefswt_disable_component_update (
23
- final long command_line );
26
+ public static native void cefswt_append_switch (
27
+ final long command_line , final String cmdSwitch , String value );
24
28
}
Original file line number Diff line number Diff line change 8
8
*/
9
9
package org .eclipse .set .browser .cef .handlers ;
10
10
11
+ import org .eclipse .set .browser .cef .ChromiumStatic ;
11
12
import org .eclipse .set .browser .lib .ChromiumLib ;
12
13
import org .eclipse .set .browser .lib .cef_command_line_t ;
13
14
@@ -42,6 +43,13 @@ private long get_browser_process_handler(final long app) {
42
43
43
44
@ SuppressWarnings ({ "unused" , "static-method" }) // Called via JNI
44
45
private void on_before_command_line_processing (final long app , final long process_type , final long command_line ) {
45
- cef_command_line_t .cefswt_disable_component_update (command_line );
46
+ // Disable updating Chromium components from Google servers
47
+ cef_command_line_t .cefswt_append_switch (command_line , "disable-component-update" , null );
48
+
49
+ // If debugging is enabled, allow remote debugging
50
+ if (ChromiumStatic .getCEFConfiguration ().DebugPort != 0 )
51
+ {
52
+ cef_command_line_t .cefswt_append_switch (command_line , "remote-allow-origins" , "*" );
53
+ }
46
54
}
47
55
}
Original file line number Diff line number Diff line change @@ -333,7 +333,19 @@ pub fn cefswt_request_to_java(request: *mut chromium::cef::_cef_request_t) -> *m
333
333
}
334
334
335
335
#[ jni_wrapper( "org.eclipse.set.browser.lib.cef_command_line_t" ) ]
336
- pub fn cefswt_disable_component_update ( command_line : * mut chromium:: cef:: _cef_command_line_t ) {
337
- let switch = chromium:: utils:: cef_string ( "disable-component-update" ) ;
338
- unsafe { ( ( * command_line) . append_switch . unwrap ( ) ) ( command_line, & switch) }
336
+ pub fn cefswt_append_switch (
337
+ command_line : * mut chromium:: cef:: _cef_command_line_t ,
338
+ switch : * const c_char ,
339
+ value : * const c_char ,
340
+ ) {
341
+ let switch = chromium:: utils:: cef_string_from_c ( switch) ;
342
+
343
+ if !value. is_null ( ) {
344
+ let value = chromium:: utils:: cef_string_from_c ( value) ;
345
+ unsafe {
346
+ ( ( * command_line) . append_switch_with_value . unwrap ( ) ) ( command_line, & switch, & value)
347
+ }
348
+ } else {
349
+ unsafe { ( ( * command_line) . append_switch . unwrap ( ) ) ( command_line, & switch) }
350
+ }
339
351
}
You can’t perform that action at this time.
0 commit comments