0
Go to file
Andrew Grieve 8ca1e5e224 ObservableSupplier: Remove addObserverAndCall()
When trying to roll NullAway, ObservableSupplier started to be properly
null-checked. This lead to the realization that:

For an ObservableSupplier<@NonNull Foo>:
1) addObserver*() takes a Callback<@NonNull Foo>
2) except "addObserverAndCall()", which takes Callback<@Nullable Foo>

This means that within the class, all callbacks should probably be
Callback<@Nullable>, but it's not actually valid to cast a
Callback<@NonNull> to Callback<@Nullable> since a callback expected a
non-null should not receive a null.

Since there are not yet any uses of addObserverAndCall(), I'm removing
it for now. If we find compelling use-cases for it, we can add it back,
and likely just mark the entire class as @NullUnmarked.

I also realized that "addObserverAndCallIfSet()" is poor wording for
@Nullable ObservableSuppliers, because they could be explicitly set
to null. Rather than support "null" meaning "hasValue()=true", this
renames the method to "addObserverAndCallIfNonNull()"

Finally, this fixes an innocuous bug where UnwrapObservableSupplier
observers were being called before a value was set.

Bug: 389129271, 394598049
Change-Id: Idf82bb88255ead37f9f20ee2c13b215c1c497be4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6323286
Reviewed-by: Sky Malice <skym@chromium.org>
Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: Fiaz Muhammad <mfiaz@google.com>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1428580}
2025-03-05 14:19:21 -08:00
2025-03-05 13:53:42 -08:00
2025-03-05 14:07:43 -08:00
2025-03-03 15:05:17 -08:00
2025-02-24 12:44:08 -08:00
2025-03-05 12:29:30 -08:00
2025-03-04 09:08:59 -08:00
2025-03-05 13:48:44 -08:00
2025-03-05 12:43:46 -08:00
2025-03-05 12:37:57 -08: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%