0
Go to file
David Bertoni 9cfed26659 [Extensions] Clean up LazyContextId issues.
The CL cleans up issues within LazyContextId and how it's used.

1. LazyContextId currently stores the service worker scope for
instances created for a service worker-based extension. Since we
only ever register the extension's script at the root scope, there's
no need to store this, since it can be inferred from the extension's
ID.

2. ServiceWorkerTaskQueue::SequencedContextId is a std::pair
containing a LazyContextId and a base::UnguessableToken that's
generated when the queue tries to activate the service worker. This
CL changes this to a struct with named fields for clarity. It also
only stores the extension's ID and the BrowserContext from the
LazyContextId, since that's all that's needed.

3. There are places where LazyContextId instances are created and the
type of the instance (for and EventPage-based extension or a service
worker-based extension) is inferred from the constructor used. Since
the scope is no longer saved, there is no longer a need for unique
constructors and the type cannot be inferred. This CL adds static
member functions that are clearly named and create the expected
type of LazyContextId. There is also an option to create one for
an extension where the function determines the type of LazyContextId
based on the extension. This is the safest and clearest way, so many
call sites are migrated to use this static member function.

Bug: None
Change-Id: If40c9a7fa9fa0148bb2d1b0faa7f988a18dfe654
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5050418
Reviewed-by: Fabian Sommer <fabiansommer@chromium.org>
Reviewed-by: Ben Reich <benreich@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Auto-Submit: David Bertoni <dbertoni@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1236662}
2023-12-12 23:33:32 +00:00
2023-12-12 23:28:31 +00:00
2023-12-12 22:26:47 +00:00
2023-12-12 17:44:37 +00:00
2023-12-12 18:36:24 +00:00
2023-12-12 17:44:37 +00:00
2023-11-27 02:27:38 +00:00
2023-12-11 15:04:03 +00:00
2023-12-06 17:33:36 +00:00
2023-11-27 02:27:38 +00:00
2023-12-12 17:44:37 +00:00

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure .

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.

If you found a bug, please file it at https://crbug.com/new.

Description
Chromium是一个开源浏览器项目,提供了一种安全、快速、稳定的方法来体验Web。该浏览器可以在多个平台上下载,包括Mac、Windows、Linux和ChromiumOS。项目原始地址: https://chromium.googlesource.com/chromium/src.git
https://www.mobibrw.com/gitea-mirrors/chromium/src.git
Readme BSD-3-Clause 89 GiB
Languages
C++ 74.4%
Java 8.2%
Objective-C++ 4.6%
TypeScript 4%
Python 2.5%
Other 6.1%