0
Files
src/gin
François Doray 12292a5967 Reland "[base] Prevent access to feature state before FeatureList registration."
This is a reland of commit 033319ab36

This should be safe to land now that this other CL
https://crrev.com/c/4002288 fixed an incorrect early feature access.

As an extra precaution, the CHECK was changed to a DCHECK:
https://crrev.com/c/4006674/1..2/base/feature_list.cc
A DumpWithoutCrashing was added to get error reports from the field
without making Chrome unusable.

Original change's description:
> [base] Prevent access to feature state before FeatureList registration.
>
> With this CL, we CHECK that no feature state was accessed previously
> when registering a FeatureList. This is to prevent accessing feature
> state too early in processes where we expect to find a FeatureList,
> while tolerating accesses in processes that never create a
> FeatureList.
>
> To keep this CL small, the CHECK is only enabled on Windows, Mac and
> Linux for now. Enabling this on Android, iOS and ChromeOS requires
> fixing many more accesses throughout the codebase.
>
> Bug: 1358639
> Change-Id: I2cbf3e2e1ac46ca0a14679fd438ecf0a774f9148
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3867967
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Jian Li <jianli@chromium.org>
> Reviewed-by: Olga Sharonova <olka@chromium.org>
> Reviewed-by: Charlie Reis <creis@chromium.org>
> Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
> Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1066783}

Bug: 1358639
Change-Id: I9932f25272e95b2ae132ba19e76b6a6365e28a17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4006674
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Olga Sharonova <olka@chromium.org>
Reviewed-by: Jian Li <jianli@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Auto-Submit: Francois Pierre Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1070450}
2022-11-11 20:11:57 +00:00
..
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-11-07 13:55:18 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00
2022-09-13 20:47:01 +00:00

Gin - Lightweight bindings for V8

This directory contains Gin, a set of utilities to make working with V8 easier.

Here are some of the key bits:

  • converter.h: Templatized JS ↔ C++ conversion routines for many common C++ types. You can define your own by specializing Converter.

  • function_template.h: Create JavaScript functions that dispatch to any C++ function, member function pointer, or base::RepeatingCallback.

  • object_template_builder.h: A handy utility for creation of v8::ObjectTemplate.

  • wrappable.h: Base class for C++ classes that want to be owned by the V8 GC. Wrappable objects are automatically deleted when GC discovers that nothing in the V8 heap refers to them. This is also an easy way to expose C++ objects to JavaScript.

  • runner.h: Create script contexts and run code in them.

  • module_runner_delegate.h: A delegate for runner that implements a subset of the AMD module specification. Also see modules/ with some example modules.