Skip to content

Desktop: Update CEF#4048

Open
timon-schelling wants to merge 2 commits intorust-gpu-alphafrom
update-cef
Open

Desktop: Update CEF#4048
timon-schelling wants to merge 2 commits intorust-gpu-alphafrom
update-cef

Conversation

@timon-schelling
Copy link
Copy Markdown
Member

@timon-schelling timon-schelling commented Apr 24, 2026

Depends on #4033

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates major dependencies, including wgpu to v28, vello to v0.8, and cef to v146. The Nix configuration is refactored to define graphite-cef as a package, and the rendering pipeline is updated to use immediates instead of push_constants. The CEF integration is also cleaned up by simplifying CefString conversions. Feedback highlights opportunities to remove redundant string allocations, fix a potential bug when joining command-line feature flags, and improve the robustness of the application root path detection.

let cmd = self.args.as_cmd_line().unwrap();
let switch = CefString::from("type");
let process_type = CefString::from(&cmd.switch_value(Some(&switch)));
let process_type = CefString::from(&cmd.switch_value(Some(&"type".into())));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The wrapping of cmd.switch_value in CefString::from(&...) is redundant because switch_value already returns an owned CefString. You can use the returned value directly to avoid an unnecessary clone.

Suggested change
let process_type = CefString::from(&cmd.switch_value(Some(&"type".into())));
let process_type = cmd.switch_value(Some(&"type".into()));

@@ -103,7 +101,7 @@ impl<H: CefEventHandler> CefContextBuilder<H> {
let app_root = exe.parent().and_then(|p| p.parent()).expect("bad path structure").parent().expect("bad path structure");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This path calculation for app_root is brittle as it relies on a fixed directory depth. If the executable is launched from a different location or the bundle structure changes, this will panic. Consider using a more robust method to locate the application resources or handling the None cases more gracefully.

Comment on lines 55 to +61
let disabled_features: String = CefString::from(&cmd.switch_value(disabled_features_switch))
.to_string()
.split(',')
.chain(extra_disabled_features)
.collect::<Vec<_>>()
.join(",");
cmd.append_switch_with_value(disabled_features_switch, Some(&CefString::from(disabled_features.as_str())));
cmd.append_switch_with_value(disabled_features_switch, Some(&disabled_features.as_str().into()));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The CefString::from(&...) wrapping is redundant here as well. Additionally, if the existing disable-features switch is empty, split(',') will produce an empty string, resulting in a leading comma in the final list. It is better to filter out empty strings before joining.

Suggested change
let disabled_features: String = CefString::from(&cmd.switch_value(disabled_features_switch))
.to_string()
.split(',')
.chain(extra_disabled_features)
.collect::<Vec<_>>()
.join(",");
cmd.append_switch_with_value(disabled_features_switch, Some(&CefString::from(disabled_features.as_str())));
cmd.append_switch_with_value(disabled_features_switch, Some(&disabled_features.as_str().into()));
let disabled_features: String = cmd.switch_value(disabled_features_switch)
.to_string()
.split(',')
.filter(|s| !s.is_empty())
.chain(extra_disabled_features)
.collect::<Vec<_>>()
.join(",");
cmd.append_switch_with_value(disabled_features_switch, Some(&disabled_features.into()));

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 23 files

Confidence score: 2/5

  • There is a high-confidence security concern in desktop/src/cef/internal/browser_process_app.rs: enabling no-sandbox unconditionally disables Chromium’s sandbox protections and weakens process isolation at runtime.
  • Given the 8/10 severity and direct impact on defense-in-depth, this is higher merge risk than a typical minor fix and should be addressed before merging.
  • Pay close attention to desktop/src/cef/internal/browser_process_app.rs - avoid unconditional no-sandbox so sandboxing remains enabled except for explicitly justified cases.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="desktop/src/cef/internal/browser_process_app.rs">

<violation number="1" location="desktop/src/cef/internal/browser_process_app.rs:36">
P1: Avoid enabling `no-sandbox` unconditionally; it disables Chromium's process sandbox and weakens runtime isolation.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread desktop/src/cef/internal/browser_process_app.rs
@timon-schelling timon-schelling changed the title Update cef Desktop: Update CEF Apr 24, 2026
@timon-schelling
Copy link
Copy Markdown
Member Author

timon-schelling commented Apr 24, 2026

!build desktop (Run ID 24908464514)

@github-actions
Copy link
Copy Markdown

📦 Mac Build Complete for 3c04c2b
Download binary

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

📦 Linux Build Complete for 3c04c2b
Download binary
Download Flatpak

@github-actions
Copy link
Copy Markdown

📦 Windows Build Complete for 3c04c2b
Download binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant