src/chromium/policy.md
Chromium's Rust policy can be found here. Rust can be used for both first-party and third-party code.
Using Rust for pure first-party code looks like this:
"C++" Rust
.- - - - - - - - - -. .- - - - - - - - - - -.
: : : :
: Existing Chromium : : Chromium Rust :
: "C++" : : code :
: +---------------+ : : +----------------+ :
: | | : : | | :
: | o-----+-+-----------+-+-> | :
: | | : Language : | | :
: +---------------+ : boundary : +----------------+ :
: : : :
`- - - - - - - - - -' `- - - - - - - - - - -'
The third-party case is also common. You will typically also need a small amount of first-party glue code, because very few Rust libraries directly expose a C/C++ API.
"C++" Rust
.- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.
: : : :
: Existing Chromium : : Chromium Rust Existing Rust :
: "C++" : : "wrapper" crate :
: +---------------+ : : +----------------+ +-------------+ :
: | | : : | | | | :
: | o-----+-+-----------+-+-> o-+----------+--> | :
: | | : Language : | | Crate | | :
: +---------------+ : boundary : +----------------+ API +-------------+ :
: : : :
`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'
The scenario of using a third-party crate is the more complex one, so today's course will focus on: