blob: 7b3fef566ba4e909cbbfe4827dfb7f6451d1fc87 [file] [log] [blame] [view]
zpeng8d6f584a2016-12-16 20:50:281# Adding third_party Libraries
2
3[TOC]
4
5Using third party code can save time and is consistent with our values - no need
6to reinvent the wheel! We put all code that isn't written by Chromium developers
Rachael Newittcc7ede62025-05-09 00:36:327into `//third_party`. We do this to make it easy to track license compliance,
8security patches, and supply the right credit and attributions. It also makes it
9a lot easier for other projects that embed our code to track what is Chromium
10licensed and what is covered by other licenses.
zpeng8d6f584a2016-12-16 20:50:2811
Dirk Pranke568e95c2018-11-01 23:41:5012## Put the code in //third_party
zpeng8d6f584a2016-12-16 20:50:2813
Lei Zhangf1c73922024-05-13 19:17:4414By default, all third party code should be checked into
Dirk Pranke53e12c32024-09-12 20:55:1815[//third_party](../third_party/), for the reasons given above.
16
17There is one primary exception to this, which is that if a third_party
18dependency has its own dependencies *and* it can be built on its own (without
19Chromium), you can check its dependencies into its third_party. For example,
20Dawn is a project that is developed independently of Chromium, and
21it has a dependency on GLFW (which Chromium does not have). Dawn
22can check that dependency into its `//third_party/glfw`, and in a Chromium
23checkout, that will show up at `//third_party/dawn/third_party/glfw`.
24That is okay, but it'd be better if we could add GLFW to a Chromium
25checkout (in chromium/src's `third_party/glfw`) and configure Dawn
26to use that location when it is being built as part of Chromium.
27
28However, if that dependency is also needed by Chromium or another
29of Chromium's dependencies, then it must be checked out into Chromium's
30//third_party (i.e., now you have to use `//third_party/glfw`). This
31prevents us from possibly needing to use two different versions of a
32dependency.
33
34Apart from that, other locations are only appropriate in a few
Dirk Pranke568e95c2018-11-01 23:41:5035situations and need explicit approval; don't assume that because there's some
36other directory with third_party in the name it's okay to put new things
37there.
zpeng8d6f584a2016-12-16 20:50:2838
Rachael Newittcc7ede62025-05-09 00:36:3239Regardless of where you add a third party dependency, you should use the
40[recommended directory structure](#standard-dep-structure).
41
Tim van der Lippe5870ac32019-10-18 11:46:5442## Before you start
43
44To make sure the inclusion of a new third_party project makes sense for the
Alex Mineer55764332022-02-25 18:05:1945Chromium project, you should first obtain
John Abd-El-Malek704bca02022-12-14 18:47:5946[Chrome ATL](../ATL_OWNERS) approval. Please include the following information in an
John Abd-El-Malekf44dc07b2023-02-07 02:39:1147email to chrome-atls-discuss@google.com:
Yaron Friedmane34271392022-04-29 16:45:5348* Motivation of your project
49* Design docs
50* Additional checkout size
John Abd-El-Malekdde7f232022-12-14 23:41:5051 * If the increase is significant (e.g., 20+ MB), can we consider limiting the
52 files to be checked in?
Yaron Friedmane34271392022-04-29 16:45:5353* Build time increase
Erik Staab6e341e82024-08-26 15:13:3554 * This refers to building `chrome` or test targets in the critical
Erik Staab933b35e2025-03-01 02:29:5455 development path. The [compile-size](speed/binary_size/compile_size_builder.md)
56 builder in CQ is a good proxy for the whether the delta is acceptable
57 (caveat that it measures just `chrome` on Linux).
John Abd-El-Malekdde7f232022-12-14 23:41:5058 * If the increase is significant (e.g., 30+ seconds), can we consider making
59 this an optional build target?
60* Binary size increase on Android ([official](https://www.chromium.org/developers/gn-build-configuration) builds)
Lei Zhangf1c73922024-05-13 19:17:4461 * Any increase of 16 KB or more on Android is flagged on the build bots and
John Abd-El-Malekdde7f232022-12-14 23:41:5062 justification is needed.
Yaron Friedmane34271392022-04-29 16:45:5363* Binary size increase on Windows
John Abd-El-Malekdde7f232022-12-14 23:41:5064* Is this library maintained on all platforms that we will use it on?
65 * If not, will the Chrome org be expected to maintain this for some or all
66 platforms?
67* Does it have any performance / memory implications (esp. on Android)? Was the
68library designed with intended use on Android?
69* Do we really need the library? Is there any alternative such as an existing
70library already in Chromium? If introducing a library with similar functionality
71as existing, will it be easy for another developer to understand which should be
72used where? Will you commit to consolidating uses in Chromium and remove the
73alternative libraries?
74* For desktop (Win/Mac/Linux/ChromeOS), does the dependency introduce closed
75source components (e.g., binaries, WASM binaries, obfuscated code)? If yes,
76please reach out to Chrome ATLs.
77
Yaron Friedmane34271392022-04-29 16:45:5378
John Abd-El-Malek704bca02022-12-14 18:47:5979Googlers can access [go/chrome-atls](https://goto.google.com/chrome-atls) and review
80existing topics in g/chrome-atls, and can also come to office hours to ask
Alex Mineer55764332022-02-25 18:05:1981questions.
82
Scott Violet50a02e42022-11-29 20:02:3483### Rust
84
David Adriand8918692024-12-12 22:02:5085Rust is allowed for third party libraries. Unlike C++ libraries, Rust third
86party libraries are [regularly rolled to updated versions by a
87rotation](https://chromium.googlesource.com/chromium/src/tools/+/HEAD/crates/create_update_cl.md)
88and can be audited for unsafety. The process for adding a Googler adding new Rust third-party
89dependencies is documented at go/chrome-rust. External contributors adding a new
90third party Rust dependency will be shepherded through the process as part of
91their ATL review.
Scott Violet50a02e42022-11-29 20:02:3492
David Adriand8918692024-12-12 22:02:5093Email rust-dev@chromium.org with any questions about the Rust toolchain.
Scott Violet50a02e42022-11-29 20:02:3494
Yaron Friedmane34271392022-04-29 16:45:5395### A note on size constraints
96
97The size of Chromium derived executables can impact overall performance of those binaries as they
98need to run on a wide range of devices including those with extremely limited RAM. Additionally, we
99have experience from Windows of the binary size impacting successful patch rate of updates as well
100as constraints from the Android Ecosystem where APKs included in the system image have hard
101limits on their size due to allocation size of the system partition. For more details and
102guidelines on size increases see
Michael Cui5d517752022-11-01 14:11:32103[//docs/speed/binary_size/binary_size_explainer.md](speed/binary_size/binary_size_explainer.md) and Googlers can
104additionally check [go/chrome-binary-size](https://goto.google.com/chrome-binary-size)
Tim van der Lippe5870ac32019-10-18 11:46:54105
Rachael Newitt15546992023-09-17 22:13:09106### Binaries, obfuscated or minified code
107
108The addition of third-party dependencies that contain binaries, obfuscated
109code, or minified code is strongly discouraged. Code review is an important
110part of reducing risk to Chromium and a reviewer asked to approve a change
111that contains any of these has no way to determine the legitimacy of what
112they are approving. Minification for performance optimization is
113[usually not necessary](speed/binary_size/optimization_advice.md), and the
114trade-off in terms of understandability and security is rarely worth
115it.
116
117Where your dependency will form part of a release binary where size is a concern,
118there are existing tools which handle [compression for distribution](speed/binary_size/optimization_advice.md).
119
120You should not check in any pre-built binaries where there is an alternate,
121supported solution for getting them. If you need to compile from source,
122consider using [CIPD](cipd_and_3pp.md) instead.
123
Dirk Pranke4038090a2024-05-09 01:51:37124This is accessible to Googlers only. Non-Googlers can email one of the people
125in third_party/OWNERS for help.
Rachael Newitt15546992023-09-17 22:13:09126
127See [Chrome Code Policy](https://goto.google.com/chrome-code-policy)
128
129
Dirk Pranke568e95c2018-11-01 23:41:50130## Get the code
zpeng8d6f584a2016-12-16 20:50:28131
Dirk Pranke568e95c2018-11-01 23:41:50132There are two common ways to depend on third-party code: you can reference a
Jason D. Clintonb21e99b2021-09-30 19:19:58133Git repo directly (via entries in the DEPS file) or you can check in a
134snapshot. The former is preferable in most cases:
135
1361. If you are actively developing in the upstream repo, then having the DEPS
Filipa Senra06109cce2025-05-29 09:19:02137 file include the upstream (that's been mirrored to GoB, see [here](/docs/dependencies.md#adding-to-GoB))
138 can be a way to include those changes into Chromium at a particular revision.
139 The DEPS file will be updated to a new revision when you are ready to "roll"
140 the new version into Chromium. This also avoids duplicate copies of the code
Jason D. Clintonb21e99b2021-09-30 19:19:58141 showing up in multiple repos leading to contributor confusion.
1421. This interacts favorably with our upstream tracking automation. We
143 automatically consume the upstream Git hashes and match them against a
144 database of known upstreams to tracking drift between Chromium and upstream
145 sources.
1461. This makes adding deps that don't need local changes easier. E.g. some of
147 our automation automatically converts non-GN build rules into GN build rules
148 without any additional CLs.
149
150Checking in a snapshot is useful if this is effectively taking on maintenance
151of an unmaintained project (e.g. an ancient library that we're going to GN-ify
152that hasn't been updated in years). And, of course, if the code you need isn't
153in a Git repo, then you have to snapshot.
zpeng8d6f584a2016-12-16 20:50:28154
Tim van der Lippe5870ac32019-10-18 11:46:54155### Node packages
156
157To include a Node package, add the dependency to the
158[Node package.json](../third_party/node/package.json). Make sure to update
159the corresponding [`npm_exclude.txt`](../third_party/node/npm_exclude.txt)
160and [`npm_include.txt`](../third_party/node/npm_include.txt) to make the code
161available during checkout.
162
Dirk Pranke568e95c2018-11-01 23:41:50163### Pulling the code via DEPS
164
Victor Hugo Vianna Silvad1e16052025-05-23 16:33:18165See [here](/docs/dependencies.md#adding-dependencies).
Dirk Pranke568e95c2018-11-01 23:41:50166
167### Checking in the code directly
168
Rachael Newittcc7ede62025-05-09 00:36:32169If you are checking in a snapshot, you should follow the [standard directory structure](#standard-dep-structure).
170For security reasons, please retrieve the code as securely as you can, using
171HTTPS and GPG signatures if available.
Dirk Pranke568e95c2018-11-01 23:41:50172If retrieving a tarball, please do not check the tarball itself into the tree,
173but do list the source and the SHA-512 hash (for verification) in the
174README.chromium and Change List. The SHA-512 hash can be computed via
175`sha512sum` or `openssl dgst -sha512`. If retrieving from a git
Rachael Newittcc7ede62025-05-09 00:36:32176repository, please list the upstream URL and revision that the code was pulled
177from.
Dirk Pranke568e95c2018-11-01 23:41:50178
179If you are checking the files in directly, you do not need an entry in DEPS
David Dorwin7fde299b2020-09-25 02:10:34180and do not need to modify `//third_party/.gitignore`.
Dirk Pranke568e95c2018-11-01 23:41:50181
182### Checking in large files
183
Dirk Pranke4038090a2024-05-09 01:51:37184This is accessible to Googlers only. Non-Googlers can email one of the people
185in third_party/OWNERS for help.
Dirk Pranke568e95c2018-11-01 23:41:50186
187See [Moving large files to Google Storage](https://goto.google.com/checking-in-large-files)
188
Rachael Newittcc7ede62025-05-09 00:36:32189## Standard directory structure for dependencies {standard-dep-structure}
190
191Regardless of how you import a dependency, you should use the following
192directory structure. This folder layout enforces separation between first and
193third party code, making it easier to manage updates and dependency hygiene
194long term.
195
196Any first party code or files you need for dependency management or
197interoperability should be added to the top level dependency directory, and the
198dependency source imported into the child src directory.
199
200**Recommended directory structure:**
201```
202❯ //third_party/<dependency-name>
203├── BUILD.gn
204├── README.chromium
205├── OWNERS
206├── src <-- import third party code here
207│ ├── LICENSE
208│ ├── a.h
209│ └── b.cc
210```
211
212**What constitutes a dependency:**
213
214* A dependency should be sourced from a single upstream location. Putting code
215 from multiple upstream sources in a single `//third_party` directory makes it
216 difficult to reason about the origin of files and perform automated updates.
217* If your dependency has its own vendored dependencies, it's not necessary to
218 split these into additional directories.
219
220**Formatting:**
221
222Do not reformat or apply Chromium-style formatting to any code within the
223dependency `src` directory. Maintaining the original formatting is essential
224for generating clean diffs against upstream versions. This simplifies
225reviewing upstream changes, applying security patches, and performing updates.
226
227If you experience issues with submitting a CL due to Chromium formatting
228requirements which need to be disabled, or you need to format first party code
229in your top level dependency folder, you can add a language appropriate
230formatting config (e.g [.clang-format-ignore](https://clang.llvm.org/docs/ClangFormat.html#clang-format-ignore))
231to your top level dependency directory. Ensure it does not format the third
232party code.
233
234
Dirk Pranke568e95c2018-11-01 23:41:50235## Document the code's context
zpeng8d6f584a2016-12-16 20:50:28236
237### Add OWNERS
238
Dirk Pranke6d3bb8e2024-05-09 00:54:33239Your OWNERS file must either list the email addresses of two Chromium
240committers on the first two lines or include a `file:` directive to an OWNERS
241file within the `third_party` directory that itself conforms to this criterion.
242This will ensure accountability for maintenance of the code over time. While
243there isn't always an ideal or obvious set of people that should go in OWNERS,
244this is critical for first-line triage of any issues that crop up in the code.
zpeng8d6f584a2016-12-16 20:50:28245
246As an OWNER, you're expected to:
247
248* Remove the dependency when/if it is no longer needed
249* Update the dependency when a security or stability bug is fixed upstream
250* Help ensure the Chrome feature that uses the dependency continues to use the
251 dependency in the best way, as the feature and the dependency change over
252 time.
253
254### Add a README.chromium
255
256You need a README.chromium file with information about the project from which
257you're re-using code. See
Dirk Pranke568e95c2018-11-01 23:41:50258[//third_party/README.chromium.template](../third_party/README.chromium.template)
zpeng8d6f584a2016-12-16 20:50:28259for a list of fields to include. A presubmit check will check this has the right
260format.
261
Dirk Pranke568e95c2018-11-01 23:41:50262README.chromium files contain a field indicating whether the package is
263security-critical or not. A package is security-critical if it is compiled
264into the product and does any of the following:
265
266* Accepts untrustworthy inputs from the internet
267* Parses or interprets complex input formats
268* Sends data to internet servers
269* Collects new data
270* Influences or sets security-related policy (including the user experience)
271
Jordan9709bae2025-05-22 05:46:45272**Update Mechanism** {#update-mechanism}
273
274We aim to autoroll as many dependencies as is feasible, and track those
275that can't with an exception.
276
277The `Update Mechanism:` field specifies how this dependency is kept
278up-to-date. You will use one of the exact string formats listed below,
279replacing `(crbug.com/BUG_ID)` with the actual bug link where required.
280The format is `Primary[.SubsetSpecifier] (crbug.com/BUG_ID)`.
281
282**Accepted Values:**
283* `Autoroll`
284* `Manual (crbug.com/BUG_ID)`
285* `Static (crbug.com/BUG_ID)`
286* `Static.HardFork (crbug.com/BUG_ID)`
287
288See below for the meaning of each primary mechanism and subset specifier.
289
290**Primary Mechanisms:**
291
292* **`Autoroll`**
293 * Updated automatically by a service (e.g., Skia Autoroller,
294 Copybara).
295* **`Manual`**
296 * Updated manually by OWNERS (e.g., using `roll_deps`).
297* **`Static`**
298 * Changes are authored by Chromium Authors.
299 * **Security:** Some dependencies will lack vulnerability coverage. If sufficient
300 metadata is provided (e.g. closest point of divergence from an upstream,
301 or a cpe), vulnerabilities will still be filed.
302
303**Subset Specifiers**
304
305* **`Static`** (With no SubsetSpecifier)
306 * Origin: Not git or package manager upstream.
307 E.g. Blog post, [USENET](https://crsrc.org/c/third_party/webrtc/common_audio/third_party/spl_sqrt_floor/README.chromium;l=12) group.
308 * **`Static.HardFork`**
309 * Originated externally (git or package manager), but now updated and maintained
310 *internally by Chromium committers*, diverging from the original
311 upstream.
312
313**Bug Link Format and Purpose:**
314* **Format:** `(crbug.com/BUG_ID)`.
315* **Location:** File bugs using the linked template in [Autoroll Exceptions](#autoroll-exceptions).
316* **Purpose:** The bug is the official record for:
317 * **Manual:**
318 * Justification for not autorolling; *or*
319 * Tracking the work to enable autorolling.
320 * **Static**:
321 * Rationale for the static classification.
322 * Approval from ATL, and `chrome-security@` review outcome.
323
324#### Autoroll Exceptions
325
326If a dependency can't be autorolled, it needs an exception. OWNERS
327should file a bug using the template in
328[`Chromium > ThirdParty > Autoroll Exceptions`](https://issues.chromium.org/issues/new?component=1801247&template=2135097).
329This component has auto-assignment and will help you track the exception.
330
Rachael Newittfc2e3342023-07-04 23:07:31331**CPE Prefix**
Adrian Taylor0a06ec32020-03-03 05:00:07332One of the fields is CPEPrefix. This is used by Chromium and Google systems to
333spot known upstream security vulnerabilities, and ensure we merge the fixes
334into our third-party copy. These systems are not foolproof, so as the OWNER,
335it's up to you to keep an eye out rather than solely relying on these
336automated systems. But, adding CPEs decreases the chances of us missing
337vulnerabilities, so they should always be added if possible.
338
339The CPE is a common format shared across the industry; you can look up the CPE
Anne Redulla04f91972023-08-31 04:09:19340for your package [here](https://nvd.nist.gov/products/cpe/search).
341* Use CPE format 2.3 (preferred) or CPE format 2.2 (supported).
342* If the CPE uses the 2.3 URI binding or 2.2 format (i.e. starts with "cpe:/"),
343and no version is explicitly specified within the `CPEPrefix`, the `Version`
344in the `README.chromium` file will be appended to the `CPEPrefix`, if available.
345 * Note: if the `Version` field is set to a git hash value, version matching
346 for vulnerabilities will fail.
347
348When searching for a CPE, you may find that there is not yet a CPE for the
349specific upstream version you're using. This is normal, as CPEs are typically
350allocated only when a vulnerability is found. You should follow the version
351number convention such that, when that does occur in future, we'll be notified.
352If no CPE is available, please specify "unknown".
Adrian Taylor0a06ec32020-03-03 05:00:07353
Adrian Taylor8e0d3fd2020-04-17 20:14:25354If you're using a patched or modified version which is halfway between two
355public versions, please "round downwards" to the lower of the public versions
356(it's better for us to be notified of false-positive vulnerabilities than
357false-negatives).
Adrian Taylor0a06ec32020-03-03 05:00:07358
Rachael Newittfc2e3342023-07-04 23:07:31359
360**Shipped**
361Your README.chromium should also specify whether your third party dependency
362will be shipped as part of a final binary. The "Shipped" field replaces the now
363deprecated special value of "NOT_SHIPPED" which was previously allowed in the
Rachael Newittf3531fd2024-09-26 03:37:41364"License File" field. This use is no longer supported and all third party
365dependencies must include a valid license regardless of whether it is shipped
366or not.
Rachael Newittfc2e3342023-07-04 23:07:31367
368
Anne Redullab75419e2023-09-12 03:34:01369**Multiple packages**
Rachael Newittcc7ede62025-05-09 00:36:32370Adding multiple packages in a single third party directory is not recommended,
371because it does not follow the best practices for [third party dependency structure](#standard-dep-structure)
372and complicates vulnerability scanning.
373
374Each dependency should have its own third party directory with a few very
375limited exceptions:
376* A package manager is used to manage dependencies in the directory via a lockfile.
377* Your third party dependency has its own vendored transitive dependencies
378
379If your dependency is covered by one of the above exceptions and the information
380for multiple packages must be placed in a single README.chromium, use the below
381line to separate the data for each package:
Anne Redullab75419e2023-09-12 03:34:01382```
383-------------------- DEPENDENCY DIVIDER --------------------
384```
385
386
zpeng8d6f584a2016-12-16 20:50:28387### Add a LICENSE file and run related checks
388
389You need a LICENSE file. Example:
Rachael Newittf3531fd2024-09-26 03:37:41390[//third_party/libjpeg/LICENSE](../third_party/libjpeg/LICENSE). Dependencies
391should not be added without a license file and license type, even if they are
392not shipped in a final product. Existing dependencies without a license file or
393license type are currently being cleaned up as part of the metadata uplift
394effort. If you are an OWNER of a dependency missing license fields, there will
395soon be a bug filed to fix it.
zpeng8d6f584a2016-12-16 20:50:28396
Andrew Mellen2be00b92022-11-11 16:38:42397Run `//tools/licenses/licenses.py scan`; this will complain about incomplete or missing
Dirk Pranke568e95c2018-11-01 23:41:50398data for third_party checkins. We use `licenses.py credits` to generate the
399about:credits page in Google Chrome builds.
zpeng8d6f584a2016-12-16 20:50:28400
401If the library will never be shipped as a part of Chrome (e.g. build-time tools,
Rachael Newittfc2e3342023-07-04 23:07:31402testing tools), make sure to set the "Shipped" field to "no" so that the license
Rachael Newitt15546992023-09-17 22:13:09403is not included in about:credits page ([more on this below](#credits)).
zpeng8d6f584a2016-12-16 20:50:28404
Jordan Brown77ce40f2024-12-10 00:31:13405When a dependency allows a choice of license, OWNERS should choose the least
406restrictive license that meets Chromium's needs and document only the chosen
407license(s) in the README.chromium file.
408
409Multiple licenses apply when there are dependencies bundled together, or
410different parts have different restrictions, these are inherently 'and'. This is
411very different to a project allowing multiple license options.
412
Jordan Browne9acbe72025-01-12 22:07:34413The `License:` field in README.chromium must use a _comma-separated list_ of licenses
Jordan Brown77ce40f2024-12-10 00:31:13414that are actively in use. Complex license expressions are not allowed or
415supported.
416
Jordan Browne9acbe72025-01-12 22:07:34417Use SPDX license identifiers (https://spdx.org/licenses/) when possible e.g.
418['Apache-2.0'](https://spdx.org/licenses/Apache-2.0.html). You can find the full
419allowlist in
420[depot_tools/+/main:metadata/fields/custom/license_allowlist.py](https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:metadata/fields/custom/license_allowlist.py).
421If the dependency uses a license that is not in the allowlist, you will need to
422add it to the
423[allowlist](https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:metadata/fields/custom/license_allowlist.py).
424This requires approval from the ATLs who will check that the license
425classification is one of [unencumbered/permissive/notice/reciprocal]. If the
426license is more restrictive than reciprocal, engage with the ATLs to determine
427if the dependency is appropriate for Chromium. The license identifier will still
428need to be added to the restricted list
429['WITH_PERMISSION_ONLY'](https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:metadata/fields/custom/license_allowlist.py).
430Do not use a license on that list without approval from the ATLs.
431
432#### License Classifications
433
434Licenses used in our codebase fall into several categories of increasing
435restrictiveness, with notice-level and less restrictive licenses being allowed
436in all projects:
437
438* **Public Domain/Unencumbered/Permissive Licenses** - These licenses allow
439 you to do almost anything with the code, they may require attribution e.g.:
440 * [CC0-1.0](https://spdx.org/licenses/CC0-1.0.html).
441 * [Unlicense](https://spdx.org/licenses/Unlicense.html).
442* **Notice Licenses** - (Most open source licenses fall into this category)
443 These licenses are similar to permissive but have additional notice
444 requirements e.g.:
445 * [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html): [`Any modified files
446 must carry prominent notices stating that you changed the
447 files`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/catapult/third_party/coverage/LICENSE.txt;l=98).
448 * [BSD-3-Clause](https://spdx.org/licenses/BSD-3-Clause): [`3. Neither the
449 name of the copyright holder nor the names of its contributors may be
450 used to endorse or promote products derived from this software without
451 specific prior written
452 permission.`](https://source.chromium.org/chromium/chromium/src/+/main:ios/third_party/fishhook/LICENSE;drc=1308ce89bbb959047a73145a0ca4a2f5f7dde894;l=10).
453
454Additionally, open source projects like Chromium are also allowed to use reciprocal licenses:
455
456* **Reciprocal Licenses** - These licenses require sharing modifications under
457 the same terms:
458
459 * [MPL-1.1](https://spdx.org/licenses/MPL-1.1.html).
460 * [APSL-2.0](https://spdx.org/licenses/APSL-2.0.html).
461
462* **Restricted Licenses !Case-by-case Approval Required!** - These licenses
463 have stricter requirements but are allowed in some circumstances. These
464 licenses may require you to publish the code under the same terms and
465 conditions:
466
467 * [LGPL-2.1](https://spdx.org/licenses/LGPL-2.1.html).
468 * [GPL-2.0](https://spdx.org/licenses/GPL-2.0.html).
469
470Make sure you understand the license terms before checking in a dependency, and
471when making any local modifications or forks.
472
Jordan Brown09c138a2025-02-05 03:42:27473The following restricted licenses are allowed under the following circumstances
474(this is not a definitive list):
475
476* GPL licenses are allowed for all non-shipped dependencies.
477* LGPLv2.1 is always okay as long as it is part of the Chromium binary.
478
Dirk Pranke568e95c2018-11-01 23:41:50479## Get a review
zpeng8d6f584a2016-12-16 20:50:28480
Aaron Gablefc8cdad2018-01-16 21:02:40481All third party additions and substantive changes like re-licensing need the
Dirk Pranke568e95c2018-11-01 23:41:50482following sign-offs. Some of these are accessible to Googlers only.
483Non-Googlers can email one of the people in
484[//third_party/OWNERS](../third_party/OWNERS) for help.
zpeng8d6f584a2016-12-16 20:50:28485
John Abd-El-Malek704bca02022-12-14 18:47:59486* Make sure you have the approval from Chrome ATLs as mentioned
Tim van der Lippe8c7498392019-10-28 12:21:04487 [above](#before-you-start).
Alex Rudenkof712a7f2022-02-23 17:55:36488* Get security@chromium.org (or chrome-security@google.com, Google-only)
Jordan Browna376e322024-12-23 00:25:27489 approval. Document all security considerations, concerns, and risks in the
490 `Description:` field of the README.chromium. Third party code is a hot spot
491 for security vulnerabilities. Help people make informed decisions about
492 relying on this package by highlighting security considerations.
Dirk Pranke6fb90c02018-10-17 02:02:20493* Add chromium-third-party@google.com as a reviewer on your change. This
Adam Langley88658b32018-11-20 22:12:47494 will trigger an automatic round-robin assignment to a reviewer who will check
495 licensing matters. These reviewers may not be able to +1 a change so look for
496 verbal approval in the comments. (This list does not receive or deliver
497 email, so only use it as a reviewer, not for other communication. Internally,
Michael Cui5d517752022-11-01 14:11:32498 see [cl/221704656](http://cl/221704656) for details about how
Dirk Prankef7432812020-06-10 22:38:20499 this is configured.). If you have questions about the third-party process,
500 ask one of the [//third_party/OWNERS](../third_party/OWNERS) instead.
Adam Langley88658b32018-11-20 22:12:47501* Lastly, if all other steps are complete, get a positive code review from a
502 member of [//third_party/OWNERS](../third_party/OWNERS) to land the change.
zpeng8d6f584a2016-12-16 20:50:28503
John Abd-El-Malek704bca02022-12-14 18:47:59504Please send separate emails to the ATLs and security@chromium.org.
505You can skip the ATL review and security@chromium.org when you are only moving
Kentaro Haracd328342022-02-25 08:25:44506existing directories in Chromium to //third_party/.
jochen893d5182017-01-31 22:01:49507
Dirk Pranke568e95c2018-11-01 23:41:50508Subsequent changes don't normally require third-party-owners or security
509approval; you can modify the code as much as you want. When you update code, be
510mindful of security-related mailing lists for the project and relevant CVE to
511update your package.
Dirk Prankebf4136b2018-09-20 22:48:43512
513## How we ensure that the right credits are displayed {#credits}
514
515As we said at the beginning, it is important that Chrome displays the
516right credit and attributions for all of the third_party code we use.
517
518To view this in chrome, you can open chrome://credits.
519
520That page displays a resource embedded in the browser as part of the
521[//components/resources/components_resources.grd](../components/resources/components_resource.grd)
522GRIT file; the actual HTML text is generated in the
523[//components/resources:about_credits](../components/resources/BUILD.gn)
524build target using a template from the output of the
Rachael Newittfc2e3342023-07-04 23:07:31525[//tools/licenses/licenses.py](../tools/licenses/licenses.py) script. Assuming
526you‘ve followed the rules above to ensure that you have the proper path to the
527LICENSE file and set the Shipped value, if it passes the checks, it’ll be
528included automatically.