diff --git a/DEPS b/DEPS index 028c506..beef03ef 100644 --- a/DEPS +++ b/DEPS
@@ -280,7 +280,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'e0114876f8a048dc5f1577938a03c14836d78763', + 'skia_revision': '1c9c95eb6f4341cca53936b4caddcb2d9546ed0d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -288,7 +288,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '501f07a6dd53937d83dfad11928a75d0c0c88f73', + 'angle_revision': '711b2c32641521c9e60a903b85c7367755c6448a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -312,7 +312,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling googletest # and whatever else without interference from each other. - 'googletest_revision': 'f3c355f9dd382bc2c323be2713e351a578b68c61', + 'googletest_revision': 'e54519b09463cec3aea77a1739e02c97ca766da5', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling lighttpd # and whatever else without interference from each other. @@ -372,7 +372,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': 'c7ac38777ac61afd51fcf85ca72a659d660908a8', + 'devtools_frontend_revision': '4b49feedc865853b923b36a7efde5605aaa2d065', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -396,7 +396,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '63466f66842cd912b81dbc7c496f76d96794a877', + 'dawn_revision': '07d1526700e024fd5826ddbab7f79e0c49e7707d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -460,7 +460,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'cros_components_revision': 'a155e2d0d2827dcbcbbe2751d98851f75705585e', + 'cros_components_revision': '59dd6e3d06e111c6a3d323a92e6478b9bbf15915', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -1304,7 +1304,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - 'bf9cb3c0d3d3c0bb540a67a3072f4c5483728f2b', + '658e1c22f9848f261a9400329bffd2b896be057c', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1389,7 +1389,7 @@ }, 'src/media/cdm/api': - Var('chromium_git') + '/chromium/cdm.git' + '@' + '82340ffad5f88d6c2efd458da85d9e5f243eabb3', + Var('chromium_git') + '/chromium/cdm.git' + '@' + '05d4084d7d5a65a422b36da4fa78f1d1740911c0', 'src/native_client': { 'url': Var('chromium_git') + '/native_client/src/native_client.git' + '@' + Var('nacl_revision'), @@ -1808,7 +1808,7 @@ Var('chromium_git') + '/chromium/dom-distiller/dist.git' + '@' + '199de96b345ada7c6e7e6ba3d2fa7a6911b8767d', 'src/third_party/eigen3/src': - Var('chromium_git') + '/external/gitlab.com/libeigen/eigen.git' + '@' + 'a32db4396635c706d9e862824bdf4e0ec0c3b257', + Var('chromium_git') + '/external/gitlab.com/libeigen/eigen.git' + '@' + '24e0c2a125d2b37b35719124d1f758777c150ca8', 'src/third_party/emoji-metadata/src': { 'url': Var('chromium_git') + '/external/github.com/googlefonts/emoji-metadata' + '@' + '045f146fca682a836e01cd265171312bfb300e06', @@ -2275,7 +2275,7 @@ Var('chromium_git') + '/external/github.com/cisco/openh264' + '@' + '478e5ab3eca30e600006d5a0a08b176fd34d3bd1', 'src/third_party/openscreen/src': - Var('chromium_git') + '/openscreen' + '@' + 'c5c06e0cd66bd3f1ecc1c99fea31004c89f131de', + Var('chromium_git') + '/openscreen' + '@' + 'abbaa2e7439e91d6a38014302d31feeca66f4193', 'src/third_party/openxr/src': { 'url': Var('chromium_git') + '/external/github.com/KhronosGroup/OpenXR-SDK' + '@' + '781f2eab3698d653c804ecbd11e0aed47eaad1c6', @@ -2669,7 +2669,7 @@ Var('chromium_git') + '/webpagereplay.git' + '@' + Var('webpagereplay_revision'), 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'd243359901730e1c46e4b0bdf35baa0eb4b0198e', + Var('webrtc_git') + '/src.git' + '@' + 'bee41a113add6a533f07d3bf77588e66fc39b4a0', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -2784,7 +2784,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/eche_app/app', - 'version': 'LmlIDNgYeKOXhaOkrf0-yFz8fZLBqPf7FU5jLlEUTjQC', + 'version': 'M_1CfMKq6XUN4t8wGbaliKqNzQVXvu1-UM01udITNy0C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4189,7 +4189,7 @@ # Dependencies from src_internal 'src/chromeos/ash/resources/internal': { 'url': Var('chrome_git') + '/chrome/chromeos/ash/resources/internal.git' + '@' + - '576e40d7e0a7aa51d16bc211db51ab4331399233', + 'dd3d2b0c1e780a13f6716cdbd20b2489811f0218', 'condition': 'checkout_src_internal and checkout_chromeos', }, @@ -4431,7 +4431,7 @@ 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - 'bfb00333807212903408145b1b2fd0e3f43d2237', + 'cf67ed8d9eb55e6befedfce5fc6beb0bc5200a63', 'condition': 'checkout_src_internal', }, @@ -4497,7 +4497,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '78e59ed0707683eaf1ed43101be35d3f03ff675e', + '0974809b07dbf79af4b2fcf0ba0cd10ea4818306', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/ash/birch/birch_weather_provider.cc b/ash/birch/birch_weather_provider.cc index f816415..6aa2f7a 100644 --- a/ash/birch/birch_weather_provider.cc +++ b/ash/birch/birch_weather_provider.cc
@@ -44,6 +44,12 @@ Shell::Get()->birch_model()->SetWeatherItems({}); return; } + if (!Shell::Get()->session_controller()->IsActiveUserSessionStarted() || + Shell::Get()->session_controller()->IsActiveAccountManaged()) { + // Weather not allowed for managed accounts. + Shell::Get()->birch_model()->SetWeatherItems({}); + return; + } const auto* pref_service = Shell::Get()->session_controller()->GetLastActiveUserPrefService(); if (!pref_service ||
diff --git a/ash/birch/birch_weather_provider_unittest.cc b/ash/birch/birch_weather_provider_unittest.cc index 45c0192a..f23e6488 100644 --- a/ash/birch/birch_weather_provider_unittest.cc +++ b/ash/birch/birch_weather_provider_unittest.cc
@@ -519,5 +519,26 @@ EXPECT_EQ(ambient_backend_controller_->fetch_weather_count(), 1); } +TEST_F(BirchWeatherProviderTest, WeatherManagedUser) { + auto* birch_model = Shell::Get()->birch_model(); + BirchWeatherProvider provider(birch_model); + + provider.RequestBirchDataFetch(); + EXPECT_EQ(ambient_backend_controller_->fetch_weather_count(), 1); + + // Add and switch to a managed user account. + const AccountId& account_id = AccountId::FromUserEmail("primary@test"); + TestSessionControllerClient* const session = GetSessionControllerClient(); + session->AddUserSession("primary@test", user_manager::UserType::kRegular, + /*provide_pref_service=*/false, + /*is_new_profile=*/true, std::string(), + /*is_account_managed=*/true); + session->SwitchActiveUser(account_id); + + // Weather should not be fetched when the active account is managed. + provider.RequestBirchDataFetch(); + EXPECT_EQ(ambient_backend_controller_->fetch_weather_count(), 1); +} + } // namespace } // namespace ash
diff --git a/ash/drag_drop/tab_drag_drop_delegate.cc b/ash/drag_drop/tab_drag_drop_delegate.cc index 236b24f..f192b36 100644 --- a/ash/drag_drop/tab_drag_drop_delegate.cc +++ b/ash/drag_drop/tab_drag_drop_delegate.cc
@@ -22,7 +22,6 @@ #include "ash/wm/wm_metrics.h" #include "base/pickle.h" #include "base/strings/utf_string_conversions.h" -#include "chromeos/crosapi/cpp/lacros_startup_state.h" #include "chromeos/ui/base/window_properties.h" #include "ui/base/clipboard/clipboard_format_type.h" #include "ui/base/clipboard/custom_data_helper.h"
diff --git a/ash/scanner/scanner_action_view_model.cc b/ash/scanner/scanner_action_view_model.cc index 82b34bae..2e52928 100644 --- a/ash/scanner/scanner_action_view_model.cc +++ b/ash/scanner/scanner_action_view_model.cc
@@ -252,6 +252,11 @@ } } +manta::proto::ScannerAction::ActionCase ScannerActionViewModel::GetActionCase() + const { + return unpopulated_action_.action_case(); +} + void ScannerActionViewModel::ExecuteAction( ScannerCommandCallback action_finished_callback) const { unpopulated_action_.PopulateToVariant(base::BindOnce(
diff --git a/ash/scanner/scanner_action_view_model.h b/ash/scanner/scanner_action_view_model.h index e48fcbb..c6e7c87 100644 --- a/ash/scanner/scanner_action_view_model.h +++ b/ash/scanner/scanner_action_view_model.h
@@ -12,6 +12,7 @@ #include "ash/scanner/scanner_unpopulated_action.h" #include "base/functional/callback_helpers.h" #include "base/memory/weak_ptr.h" +#include "components/manta/proto/scanner.pb.h" namespace gfx { struct VectorIcon; @@ -38,6 +39,7 @@ // This may crash if this action has been previously moved. std::u16string GetText() const; const gfx::VectorIcon& GetIcon() const; + manta::proto::ScannerAction::ActionCase GetActionCase() const; // Executes this action, running the provided callback with a success value // when the execution finishes.
diff --git a/ash/scanner/scanner_controller.cc b/ash/scanner/scanner_controller.cc index a04bbdbd..926303e 100644 --- a/ash/scanner/scanner_controller.cc +++ b/ash/scanner/scanner_controller.cc
@@ -21,6 +21,7 @@ #include "base/memory/ref_counted_memory.h" #include "base/memory/scoped_refptr.h" #include "components/account_id/account_id.h" +#include "components/manta/proto/scanner.pb.h" #include "ui/message_center/message_center.h" #include "ui/message_center/public/cpp/notification.h" #include "ui/message_center/public/cpp/notifier_id.h" @@ -37,7 +38,8 @@ // Shows an action progress notification. Note that this will remove the // previous action notification if there is one. -void ShowActionProgressNotification() { +void ShowActionProgressNotification( + manta::proto::ScannerAction::ActionCase action_case) { message_center::RichNotificationData optional_fields; // Show an infinite loading progress bar. optional_fields.progress = -1; @@ -48,10 +50,11 @@ /*by_user=*/false); // TODO: crbug.com/375967525 - Finalize the action notification strings and // icon. - constexpr char16_t kPlaceholderActionProgressTitle[] = u"Creating..."; message_center->AddNotification(CreateSystemNotificationPtr( message_center::NOTIFICATION_TYPE_PROGRESS, kScannerActionNotificationId, - kPlaceholderActionProgressTitle, + action_case == manta::proto::ScannerAction::kCopyToClipboard + ? u"Copying text..." + : u"Creating...", /*message=*/u"", /*display_source=*/u"", GURL(), message_center::NotifierId(message_center::NotifierType::SYSTEM_COMPONENT, @@ -62,22 +65,24 @@ } // Should be called when an action finishes execution. -void OnActionFinished(bool success) { +void OnActionFinished(manta::proto::ScannerAction::ActionCase action_case, + bool success) { // Remove the action progress notification. message_center::MessageCenter::Get()->RemoveNotification( kScannerActionNotificationId, /*by_user=*/false); if (success) { - // TODO: crbug.com/382182688 - The action success text should depend on the - // type of action executed. - constexpr char16_t kPlaceholderActionSuccessText[] = u"Action Finished"; - // TODO: crbug.com/383925780 - Add feedback mechanism to the toast. - ToastManager::Get()->Show(ToastData(kScannerActionSuccessToastId, - ToastCatalogName::kScannerActionSuccess, - kPlaceholderActionSuccessText)); + // TODO: crbug.com/375967525 - Finalize the action toast string. + if (action_case == manta::proto::ScannerAction::kCopyToClipboard) { + ToastManager::Get()->Show(ToastData( + kScannerActionSuccessToastId, ToastCatalogName::kScannerActionSuccess, + u"Text copied to clipboard")); + } + // TODO: crbug.com/383925780 - We should also show a toast for other action + // cases once the feedback mechanism is ready. } else { - // TODO: crbug.com/378582420 - The action failure text should depend on the + // TODO: crbug.com/383926250 - The action failure text should depend on the // type of action attempted. constexpr char16_t kPlaceholderActionFailureText[] = u"Action Failed"; ToastManager::Get()->Show(ToastData(kScannerActionFailureToastId, @@ -147,8 +152,10 @@ void ScannerController::ExecuteAction( const ScannerActionViewModel& scanner_action) { - scanner_action.ExecuteAction(base::BindOnce(&OnActionFinished)); - ShowActionProgressNotification(); + const manta::proto::ScannerAction::ActionCase action_case = + scanner_action.GetActionCase(); + scanner_action.ExecuteAction(base::BindOnce(&OnActionFinished, action_case)); + ShowActionProgressNotification(action_case); } bool ScannerController::HasActiveSessionForTesting() const {
diff --git a/ash/scanner/scanner_controller_unittest.cc b/ash/scanner/scanner_controller_unittest.cc index c112ff9..7d99b24c 100644 --- a/ash/scanner/scanner_controller_unittest.cc +++ b/ash/scanner/scanner_controller_unittest.cc
@@ -172,8 +172,10 @@ ASSERT_TRUE(scanner_controller); EXPECT_TRUE(scanner_controller->StartNewSession()); manta::proto::ScannerOutput output; - output.add_objects()->add_actions()->mutable_new_event()->set_title( - "Event title"); + output.add_objects() + ->add_actions() + ->mutable_copy_to_clipboard() + ->set_html_text("<b>Hello</b>"); FakeScannerProfileScopedDelegate& fake_profile_scoped_delegate = *GetFakeScannerProfileScopedDelegate(*scanner_controller); // Mock a successful action.
diff --git a/ash/webui/BUILD.gn b/ash/webui/BUILD.gn index 577f487..8fc90271 100644 --- a/ash/webui/BUILD.gn +++ b/ash/webui/BUILD.gn
@@ -73,7 +73,6 @@ "//ash/webui/demo_mode_app_ui:closure_compile", "//ash/webui/eche_app_ui:closure_compile", "//ash/webui/file_manager/untrusted_resources:closure_compile", - "//ash/webui/files_internals:closure_compile", "//ash/webui/media_app_ui:closure_compile", "//ash/webui/multidevice_debug/resources:closure_compile", "//ash/webui/projector_app/resources:closure_compile",
diff --git a/ash/webui/boca_ui/boca_ui.cc b/ash/webui/boca_ui/boca_ui.cc index 0938849..de6d67d 100644 --- a/ash/webui/boca_ui/boca_ui.cc +++ b/ash/webui/boca_ui/boca_ui.cc
@@ -60,6 +60,11 @@ network::mojom::CSPDirectiveName::StyleSrc, "style-src 'self' 'unsafe-inline' chrome-untrusted://theme;"); + // Need to explicitly set |worker-src| because CSP falls back to |child-src| + // which is none. + host_source->OverrideContentSecurityPolicy( + network::mojom::CSPDirectiveName::WorkerSrc, "worker-src 'self';"); + host_source->OverrideContentSecurityPolicy( network::mojom::CSPDirectiveName::TrustedTypes, "trusted-types polymer_resin lit-html goog#html polymer-html-literal "
diff --git a/ash/webui/file_manager/mojom/BUILD.gn b/ash/webui/file_manager/mojom/BUILD.gn index e6162951..346ed97 100644 --- a/ash/webui/file_manager/mojom/BUILD.gn +++ b/ash/webui/file_manager/mojom/BUILD.gn
@@ -9,8 +9,4 @@ mojom("mojom") { sources = [ "file_manager.mojom" ] - webui_module_path = "/" - - # Generate WebUI bindings in JavaScript instead of TypeScript. - generate_webui_js_bindings = true }
diff --git a/ash/webui/files_internals/BUILD.gn b/ash/webui/files_internals/BUILD.gn index 3e4ad99..6054904 100644 --- a/ash/webui/files_internals/BUILD.gn +++ b/ash/webui/files_internals/BUILD.gn
@@ -2,9 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/chromeos/ui_mode.gni") -import("//third_party/closure_compiler/compile_js.gni") +import("//tools/typescript/webui_ts_library.gni") import("//ui/webui/resources/tools/generate_grd.gni") +import("//tools/grit/preprocess_if_expr.gni") assert(is_chromeos_ash, "Files Internals is ash-chrome only") @@ -28,33 +28,39 @@ ] } -js_type_check("closure_compile") { - deps = [ ":js" ] - closure_flags = default_closure_args + mojom_js_args -} - -js_library("js") { - sources = [ "resources/index.js" ] - deps = [ "//ash/webui/files_internals/mojom:mojom_webui_js" ] -} - grd_prefix = "ash_files_internals" mojo_grdp = "$target_gen_dir/files_internals_mojo_resources.grdp" +preprocess_if_expr("copy_mojo_ts") { + visibility = [ ":build_ts" ] + in_folder = root_gen_dir + in_files = [ "ash/webui/files_internals/mojom/files_internals.mojom-webui.ts" ] + deps = [ "//ash/webui/files_internals/mojom:mojom_ts__generator" ] + out_folder = "$target_gen_dir/preprocessed" +} + +webui_ts_library("build_ts") { + root_dir = "$target_gen_dir/preprocessed" + out_dir = "$target_gen_dir/tsc" + composite = true + + in_files = [ "ash/webui/files_internals/mojom/files_internals.mojom-webui.ts" ] + + deps = [ "//ui/webui/resources/mojo:build_ts" ] + extra_deps = [ ":copy_mojo_ts" ] +} + generate_grd("build_mojo_grdp") { grd_prefix = grd_prefix out_grd = mojo_grdp - deps = [ "//ash/webui/files_internals/mojom:mojom_webui_js" ] + deps = [ ":build_ts" ] # Flatten out the dependency tree of your mojom and add generated bindings # file here. - input_files = - [ "ash/webui/files_internals/mojom/files_internals.mojom-webui.js" ] - - input_files_base_dir = - rebase_path("$root_gen_dir/mojom-webui", "$root_build_dir") + input_files = [ "ash/webui/files_internals/mojom/files_internals.mojom-webui.js" ] + input_files_base_dir = rebase_path("$target_gen_dir/tsc", root_build_dir) } generate_grd("build_grd") {
diff --git a/ash/webui/files_internals/mojom/BUILD.gn b/ash/webui/files_internals/mojom/BUILD.gn index 2ade612b..8c7a1d0 100644 --- a/ash/webui/files_internals/mojom/BUILD.gn +++ b/ash/webui/files_internals/mojom/BUILD.gn
@@ -11,7 +11,4 @@ sources = [ "files_internals.mojom" ] webui_module_path = "/ash/webui/files_internals/mojom/" - - # This page is still using JS + Closure Compiler. - generate_webui_js_bindings = true }
diff --git a/ash/webui/shortcut_customization_ui/backend/BUILD.gn b/ash/webui/shortcut_customization_ui/backend/BUILD.gn index 98f2b34..6ae182b 100644 --- a/ash/webui/shortcut_customization_ui/backend/BUILD.gn +++ b/ash/webui/shortcut_customization_ui/backend/BUILD.gn
@@ -32,11 +32,10 @@ "//ash/webui/shortcut_customization_ui/mojom", "//base", "//chromeos/ash/components/local_search_service:local_search_service", - "//chromeos/ash/components/local_search_service/public/cpp:cpp", + "//chromeos/ash/components/local_search_service/public/cpp", "//chromeos/ash/components/local_search_service/public/mojom", - "//chromeos/crosapi/cpp:cpp", "//chromeos/strings", - "//components/prefs:prefs", + "//components/prefs", "//ui/base/ime/ash", "//ui/events/ash", "//ui/events/devices",
diff --git a/ash/webui/shortcut_customization_ui/backend/accelerator_configuration_provider.cc b/ash/webui/shortcut_customization_ui/backend/accelerator_configuration_provider.cc index 6f8a796f..03323d7 100644 --- a/ash/webui/shortcut_customization_ui/backend/accelerator_configuration_provider.cc +++ b/ash/webui/shortcut_customization_ui/backend/accelerator_configuration_provider.cc
@@ -444,10 +444,6 @@ // or specific device property. bool ShouldExcludeItem(const AcceleratorLayoutDetails& details) { switch (details.action_id) { - // Hide user switching shortcuts for lacros builds. - case kSwitchToNextUser: - case kSwitchToPreviousUser: - return crosapi::lacros_startup_state::IsLacrosEnabled(); case kPrivacyScreenToggle: return !accelerators::CanTogglePrivacyScreen(); case kTilingWindowResizeLeft:
diff --git a/ash/webui/shortcut_customization_ui/backend/accelerator_configuration_provider.h b/ash/webui/shortcut_customization_ui/backend/accelerator_configuration_provider.h index d6bbafdea4..9eab831 100644 --- a/ash/webui/shortcut_customization_ui/backend/accelerator_configuration_provider.h +++ b/ash/webui/shortcut_customization_ui/backend/accelerator_configuration_provider.h
@@ -23,7 +23,6 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/task/sequenced_task_runner.h" -#include "chromeos/crosapi/cpp/lacros_startup_state.h" #include "components/prefs/pref_member.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h"
diff --git a/base/test/android/javatests/src/org/chromium/base/test/transit/ViewSpec.java b/base/test/android/javatests/src/org/chromium/base/test/transit/ViewSpec.java index 43f637c..422f1dd 100644 --- a/base/test/android/javatests/src/org/chromium/base/test/transit/ViewSpec.java +++ b/base/test/android/javatests/src/org/chromium/base/test/transit/ViewSpec.java
@@ -4,6 +4,8 @@ package org.chromium.base.test.transit; +import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA; + import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.Matchers.allOf; @@ -21,6 +23,8 @@ import org.chromium.base.test.util.ForgivingClickAction; import org.chromium.base.test.util.ViewPrinter; +import java.util.Arrays; + /** A spec to generate ViewElements representing a view characteristic of a ConditionalState. */ public class ViewSpec { @@ -38,6 +42,32 @@ return new ViewSpec(allOf(viewMatchers)); } + /** Create a ViewSpec for a descendant of this ViewSpec. */ + public final ViewSpec descendant(Matcher<View> viewMatcher) { + return viewSpec(viewMatcher, isDescendantOfA(mViewMatcher)); + } + + /** Create a ViewSpec for a descendant of this ViewSpec that matches multiple Matchers<View>. */ + @SafeVarargs + public final ViewSpec descendant(Matcher<View>... viewMatchers) { + Matcher<View>[] allViewMatchers = Arrays.copyOf(viewMatchers, viewMatchers.length + 1); + allViewMatchers[viewMatchers.length] = isDescendantOfA(mViewMatcher); + return viewSpec(allViewMatchers); + } + + /** Creates a ViewSpec that matches this ViewSpec _and_ another Matcher<View>. */ + public final ViewSpec and(Matcher<View> viewMatcher) { + return viewSpec(viewMatcher, mViewMatcher); + } + + /** Creates a ViewSpec that matches this ViewSpec _and_ multiple other Matchers<View>. */ + @SafeVarargs + public final ViewSpec and(Matcher<View>... viewMatchers) { + Matcher<View>[] allViewMatchers = Arrays.copyOf(viewMatchers, viewMatchers.length + 1); + allViewMatchers[viewMatchers.length] = mViewMatcher; + return viewSpec(allViewMatchers); + } + private ViewSpec(Matcher<View> viewMatcher) { mViewMatcher = viewMatcher;
diff --git a/build/android/pylib/base/environment_factory.py b/build/android/pylib/base/environment_factory.py index 377e0f7..05e41b1d 100644 --- a/build/android/pylib/base/environment_factory.py +++ b/build/android/pylib/base/environment_factory.py
@@ -2,9 +2,12 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import os from pylib import constants from pylib.local.device import local_device_environment +from pylib.local.device import skylab_environment + from pylib.local.machine import local_machine_environment try: @@ -26,6 +29,18 @@ raise RuntimeError('error_func must call exit inside.') return local_emulator_environment.LocalEmulatorEnvironment( args, output_manager, error_func) + + if args.connect_over_ethernet: + swarming_server = os.environ.get('SWARMING_SERVER', '') + if skylab_environment.SWARMING_SERVER not in swarming_server: + error_func( + 'connect-over-ethernet is only supported for tasks running on ' + f'{skylab_environment.SWARMING_SERVER}. ' + f'SWARMING_SERVER={swarming_server}') + raise RuntimeError('error_func must call exit inside.') + return skylab_environment.SkylabEnvironment(args, output_manager, + error_func) + return local_device_environment.LocalDeviceEnvironment( args, output_manager, error_func) return local_machine_environment.LocalMachineEnvironment(
diff --git a/build/android/pylib/local/device/local_device_ethernet_environment.py b/build/android/pylib/local/device/local_device_ethernet_environment.py new file mode 100644 index 0000000..6977f05 --- /dev/null +++ b/build/android/pylib/local/device/local_device_ethernet_environment.py
@@ -0,0 +1,28 @@ +# Copyright 2024 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import logging + +from devil.android.sdk import adb_wrapper + +from pylib.local.device import local_device_environment + + +class LocalDeviceEthernetEnvironment( + local_device_environment.LocalDeviceEnvironment): + """ + A subclass of LocalDeviceEnvironment for devices connected over ethernet. + + This class cannot be instantiated. Subclasses should implement the + GetDeviceHostname method, as this is specific to each environment. + """ + + def __init__(self, args, output_manager, error_func): + super().__init__(args, output_manager, error_func) + hostname = self.GetDeviceHostname() + logging.info('connecting to %s', hostname) + adb_wrapper.AdbWrapper.Connect(hostname) + + def GetDeviceHostname(self): + raise NotImplementedError
diff --git a/build/android/pylib/local/device/skylab_environment.py b/build/android/pylib/local/device/skylab_environment.py new file mode 100644 index 0000000..22b892e --- /dev/null +++ b/build/android/pylib/local/device/skylab_environment.py
@@ -0,0 +1,31 @@ +# Copyright 2024 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os + +from pylib.local.device import local_device_ethernet_environment + +SWARMING_SERVER = 'chromeos-swarming.appspot.com' + + +class SkylabEnvironment( + local_device_ethernet_environment.LocalDeviceEthernetEnvironment): + """ + A subclass of LocalDeviceEthernetEnvironment for Skylab devices. + """ + + def GetDeviceHostname(self): + """Return the hostname based on the bot id. + + Strips the first component of the bot id, e.g. 'cros-clank1' -> 'clank1'. + + Gets the bot id from the SWARMING_BOT_ID envvar, see + https://chromium.googlesource.com/infra/luci/luci-py/+/HEAD/appengine/swarming/doc/Magic-Values.md#bot-environment-variables. + """ + bot_id = os.environ.get('SWARMING_BOT_ID') + if not bot_id: + raise ValueError( + "device_arg is 'swarming' but SWARMING_BOT_ID is not set") + + return bot_id[bot_id.index("-") + 1:]
diff --git a/build/android/test_runner.py b/build/android/test_runner.py index a9394dd..a8c9d62 100755 --- a/build/android/test_runner.py +++ b/build/android/test_runner.py
@@ -360,6 +360,12 @@ 'to the id of the main user on device. Only use when the main user is a ' 'secondary user, e.g. Android Automotive OS.') + parser.add_argument( + '--connect-over-ethernet', + action='store_true', + help='Connect to devices over the network using "adb connect". Only ' + 'supported when running on chromeos-swarming') + def AddEmulatorOptions(parser): """Adds emulator-specific options to |parser|."""
diff --git a/build/android/test_runner.pydeps b/build/android/test_runner.pydeps index 2361f9e..4b09da6f 100644 --- a/build/android/test_runner.pydeps +++ b/build/android/test_runner.pydeps
@@ -181,10 +181,12 @@ pylib/local/__init__.py pylib/local/device/__init__.py pylib/local/device/local_device_environment.py +pylib/local/device/local_device_ethernet_environment.py pylib/local/device/local_device_gtest_run.py pylib/local/device/local_device_instrumentation_test_run.py pylib/local/device/local_device_monkey_test_run.py pylib/local/device/local_device_test_run.py +pylib/local/device/skylab_environment.py pylib/local/emulator/__init__.py pylib/local/emulator/avd.py pylib/local/emulator/ini.py
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 01ebb46a..c7a7bbe6 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc
@@ -451,21 +451,8 @@ DCHECK(IsMainThread()); if (commit_completion_event_) { TRACE_EVENT0("cc", "LayerTreeHost::WaitForCommitCompletion"); - base::ElapsedTimer timer; commit_completion_event_->Wait(); commit_completion_event_ = nullptr; - if (for_protected_sequence) { - waited_for_protected_sequence_ = true; - auto elapsed = timer.Elapsed(); - base::UmaHistogramMicrosecondsTimes( - "Compositing.MainThreadBlockedDuringCommitTime", elapsed); - if (in_apply_compositor_changes_) { - base::UmaHistogramMicrosecondsTimes( - "Compositing.MainThreadBlockedDuringCommitTime." - "ApplyCompositorChanges", - elapsed); - } - } } } @@ -507,11 +494,6 @@ client_->DidCompletePageScaleAnimation(source_frame_number); did_complete_scale_animation_ = false; } - if (compositor_mode_ == CompositorMode::THREADED) { - UMA_HISTOGRAM_BOOLEAN("Compositing.DidMainThreadBlockDuringCommit", - waited_for_protected_sequence_); - } - waited_for_protected_sequence_ = false; } void LayerTreeHost::NotifyImageDecodeFinished(int request_id, @@ -1143,9 +1125,6 @@ DCHECK(commit_data); TRACE_EVENT0("cc", "LayerTreeHost::ApplyCompositorChanges"); - DCHECK(!in_apply_compositor_changes_); - base::AutoReset<bool> in_apply_changes(&in_apply_compositor_changes_, true); - using perfetto::protos::pbzero::TrackEvent; for (auto& swap_promise : commit_data->swap_promises) {
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index a81d69ce..86e95b6 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h
@@ -824,6 +824,10 @@ // commit is finished. void WaitForProtectedSequenceCompletion() const override; + bool MustWaitForCommitForTesting() const { + return !!commit_completion_event_; + } + // MutatorHostClient implementation. bool IsElementInPropertyTrees(ElementId element_id, ElementListType list_type) const override; @@ -925,10 +929,6 @@ return base::AutoReset<bool>(&syncing_deltas_for_test_, true); } - bool WaitedForCommitForTesting() const { - return waited_for_protected_sequence_; - } - // See CommitState::scrollers_clobbering_active_value_. void DropActiveScrollDeltaNextCommit(ElementId scroll_element); @@ -1085,8 +1085,6 @@ bool in_paint_layer_contents_ = false; - bool in_apply_compositor_changes_ = false; - // This is true if atleast one layer in the layer tree has a copy request. We // use this bool to decide whether we need to compute subtree has copy request // for every layer during property tree building. @@ -1118,10 +1116,6 @@ base::flat_map<uint32_t, ViewTransitionRequest::ViewTransitionCaptureCallback> view_transition_callbacks_; - // Set if WaitForCommitCompletion() was called before commit completes. Used - // for histograms. - mutable bool waited_for_protected_sequence_ = false; - bool in_composite_for_test_ = false; bool syncing_deltas_for_test_ = false;
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 5b08ed55..1198cdc 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc
@@ -10917,8 +10917,8 @@ void BeginTest() override { PostSetNeedsCommitToMainThread(); } void WillBeginMainFrame() override { ++main_frame_num_; } void DidBeginMainFrame() override { - EXPECT_EQ(main_frame_num_ % 2 == 0, - layer_tree_host()->WaitedForCommitForTesting()); + EXPECT_EQ(main_frame_num_ % 2 != 0, + layer_tree_host()->MustWaitForCommitForTesting()); } void DidCommit() override { if (main_frame_num_ < 5) {
diff --git a/chrome/VERSION b/chrome/VERSION index fe5fdbc..032f97cdb 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=133 MINOR=0 -BUILD=6915 +BUILD=6916 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index d4be85fc..a45e8e2 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -739,6 +739,7 @@ "//third_party/androidx:androidx_viewpager_viewpager_java", "//third_party/blink/public:blink_headers_java", "//third_party/blink/public/mojom:android_mojo_bindings_java", + "//third_party/blink/public/mojom:mojom_core_java", "//third_party/blink/public/mojom:mojom_platform_java", "//third_party/gif_player:gif_player_java", "//third_party/jni_zero:jni_zero_java", @@ -2817,6 +2818,7 @@ "$google_play_services_package:google_play_services_cast_framework_java", "//components/background_task_scheduler:background_task_scheduler_java", "//components/payments/content/android:service_java", + "//third_party/androidx:androidx_annotation_annotation_experimental_java", "//third_party/androidx:androidx_browser_browser_java", ]
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java index cf2f787..6747c85 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
@@ -26,7 +26,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.jni_zero.JNINamespace; import org.jni_zero.JniType; @@ -39,6 +38,7 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.browser.app.tabmodel.AsyncTabParamsManagerSingleton; import org.chromium.chrome.browser.browserservices.SessionDataHolder; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.intents.WebappConstants; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.chrome.browser.document.ChromeLauncherActivity; @@ -573,17 +573,16 @@ /** * Extracts referrer URL string. The extra is used if we received it from a first party app or * if the referrer_extra is specified as android-app://package style URL. + * * @param intent The intent from which to extract the URL. * @return The URL string or null if none should be used. */ private static String getReferrerUrl(Intent intent) { Uri referrerExtra = getReferrer(intent); - CustomTabsSessionToken customTabsSession = - CustomTabsSessionToken.getSessionTokenFromIntent(intent); - if (referrerExtra == null && customTabsSession != null) { + SessionHolder<?> session = SessionHolder.getSessionHolderFromIntent(intent); + if (referrerExtra == null && session != null) { Referrer referrer = - CustomTabsConnection.getInstance() - .getDefaultReferrerForSession(customTabsSession); + CustomTabsConnection.getInstance().getDefaultReferrerForSession(session); if (referrer != null) { referrerExtra = Uri.parse(referrer.getUrl()); } @@ -594,7 +593,7 @@ return referrerExtra.toString(); } else if (IntentHandler.notSecureIsIntentChromeOrFirstParty(intent) || SessionDataHolder.getInstance() - .canActiveHandlerUseReferrer(customTabsSession, referrerExtra)) { + .canActiveHandlerUseReferrer(session, referrerExtra)) { return referrerExtra.toString(); } return null;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java index 053448c..7a15ae3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
@@ -22,7 +22,6 @@ import androidx.annotation.OptIn; import androidx.browser.auth.ExperimentalAuthTab; import androidx.browser.customtabs.CustomTabsIntent; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.browser.customtabs.TrustedWebUtils; import androidx.core.os.BuildCompat; @@ -34,6 +33,7 @@ import org.chromium.base.PackageManagerUtils; import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.browser.browserservices.SessionDataHolder; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.ui.splashscreen.trustedwebactivity.TwaSplashController; import org.chromium.chrome.browser.customtabs.AuthTabIntentDataProvider; import org.chromium.chrome.browser.customtabs.CustomTabActivity; @@ -367,8 +367,7 @@ */ private boolean launchCustomTabActivity() { CustomTabsConnection.getInstance() - .onHandledIntent( - CustomTabsSessionToken.getSessionTokenFromIntent(mIntent), mIntent); + .onHandledIntent(SessionHolder.getSessionHolderFromIntent(mIntent), mIntent); boolean isCustomTab = true; if (IntentHandler.shouldIgnoreIntent(mIntent, mActivity, isCustomTab)) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/base/SplitCompatCustomTabsService.java b/chrome/android/java/src/org/chromium/chrome/browser/base/SplitCompatCustomTabsService.java index d7ee892b..9c27083 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/base/SplitCompatCustomTabsService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/base/SplitCompatCustomTabsService.java
@@ -10,6 +10,10 @@ import android.os.Bundle; import android.os.IBinder; +import androidx.annotation.NonNull; +import androidx.annotation.OptIn; +import androidx.browser.auth.AuthTabSessionToken; +import androidx.browser.auth.ExperimentalAuthTab; import androidx.browser.customtabs.CustomTabsService; import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.browser.customtabs.EngagementSignalsCallback; @@ -24,6 +28,7 @@ * CustomTabsService base class which will call through to the given {@link Impl}. This class must * be present in the base module, while the Impl can be in the chrome module. */ +@OptIn(markerClass = ExperimentalAuthTab.class) public class SplitCompatCustomTabsService extends CustomTabsService { private String mServiceClassName; private Impl mImpl; @@ -164,6 +169,17 @@ return mImpl.isEphemeralBrowsingSupported(extras); } + @Override + protected boolean cleanUpSession(@NonNull AuthTabSessionToken sessionToken) { + mImpl.cleanUpSession(sessionToken); + return super.cleanUpSession(sessionToken); + } + + @Override + protected boolean newAuthTabSession(@NonNull AuthTabSessionToken sessionToken) { + return mImpl.newAuthTabSession(sessionToken); + } + /** * Holds the implementation of service logic. Will be called by {@link * SplitCompatCustomTabsService}. @@ -231,5 +247,9 @@ Bundle extras); protected abstract boolean isEphemeralBrowsingSupported(Bundle extras); + + protected abstract void cleanUpSession(@NonNull AuthTabSessionToken sessionToken); + + protected abstract boolean newAuthTabSession(@NonNull AuthTabSessionToken sessionToken); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ManageTrustedWebActivityDataActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ManageTrustedWebActivityDataActivity.java index 93dd019..5940cf5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ManageTrustedWebActivityDataActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ManageTrustedWebActivityDataActivity.java
@@ -12,6 +12,7 @@ import org.chromium.base.Log; import org.chromium.base.ResettersForTesting; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.metrics.TrustedWebActivityUmaRecorder; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.webapk.lib.common.WebApkConstants; @@ -72,8 +73,7 @@ : getCallingPackage(); } - CustomTabsSessionToken session = - CustomTabsSessionToken.getSessionTokenFromIntent(getIntent()); + SessionHolder<?> session = SessionHolder.getSessionHolderFromIntent(getIntent()); if (session == null) { return null; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/SessionDataHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/SessionDataHolder.java index d5367e4..60f662c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/SessionDataHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/SessionDataHolder.java
@@ -17,6 +17,7 @@ import org.chromium.base.Callback; import org.chromium.base.ResettersForTesting; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; /** @@ -29,7 +30,7 @@ @Nullable private SessionHandler mActiveSessionHandler; - @Nullable private Callback<CustomTabsSessionToken> mSessionDisconnectCallback; + @Nullable private Callback<SessionHolder<?>> mSessionDisconnectCallback; private static SessionDataHolder sInstance = new SessionDataHolder(); @@ -48,14 +49,13 @@ /** Data associated with a {@link SessionHandler} necessary to pass new intents to it. */ private static class SessionData { - public final CustomTabsSessionToken session; + public final SessionHolder<?> session; // Session handlers can reside in Activities of different types, so we need to store the // Activity class to be able to route new intents into it. public final Class<? extends Activity> activityClass; - private SessionData( - CustomTabsSessionToken session, Class<? extends Activity> activityClass) { + private SessionData(SessionHolder<?> session, Class<? extends Activity> activityClass) { this.session = session; this.activityClass = activityClass; } @@ -63,11 +63,12 @@ /** * Sets the currently active {@link SessionHandler} in focus. + * * @param sessionHandler {@link SessionHandler} to set. */ public void setActiveHandler(@NonNull SessionHandler sessionHandler) { mActiveSessionHandler = sessionHandler; - CustomTabsSessionToken session = sessionHandler.getSession(); + SessionHolder<?> session = sessionHandler.getSession(); if (session == null) return; mTaskIdToSessionData.append( @@ -99,7 +100,7 @@ SessionData handlerDataInCurrentTask = mTaskIdToSessionData.get(taskId); if (handlerDataInCurrentTask == null || !handlerDataInCurrentTask.session.equals( - CustomTabsSessionToken.getSessionTokenFromIntent(intent))) { + SessionHolder.getSessionHolderFromIntent(intent))) { return null; } return handlerDataInCurrentTask.activityClass; @@ -119,22 +120,22 @@ } /** Returns whether the given session is the currently active session. */ - public boolean isActiveSession(@Nullable CustomTabsSessionToken session) { + public boolean isActiveSession(@Nullable SessionHolder<?> session) { return getActiveHandler(session) != null; } /** * Returns the active session handler if it is associated with given session, null otherwise. */ - public @Nullable SessionHandler getActiveHandler(@Nullable CustomTabsSessionToken session) { + public @Nullable SessionHandler getActiveHandler(@Nullable SessionHolder<?> session) { if (mActiveSessionHandler == null) return null; - CustomTabsSessionToken activeSession = mActiveSessionHandler.getSession(); + SessionHolder<?> activeSession = mActiveSessionHandler.getSession(); if (activeSession == null || !activeSession.equals(session)) return null; return mActiveSessionHandler; } private @Nullable SessionHandler getActiveHandlerForIntent(Intent intent) { - return getActiveHandler(CustomTabsSessionToken.getSessionTokenFromIntent(intent)); + return getActiveHandler(SessionHolder.getSessionHolderFromIntent(intent)); } /** @@ -143,14 +144,14 @@ * currently in focus custom tab and also the related client should have a verified relationship * with the referrer origin. This can only be true for https:// origins. * - * @param token The session token specified in the activity launch intent. + * @param session The {@link SessionHolder} holding the session token specified in the activity + * launch intent. * @param referrer The referrer url that is to be used. - * @return Whether the given referrer is a valid first party url to the client that launched - * the activity. + * @return Whether the given referrer is a valid first party url to the client that launched the + * activity. */ - public boolean canActiveHandlerUseReferrer( - @Nullable CustomTabsSessionToken token, Uri referrer) { - SessionHandler handler = getActiveHandler(token); + public boolean canActiveHandlerUseReferrer(@Nullable SessionHolder<?> session, Uri referrer) { + SessionHandler handler = getActiveHandler(session); return handler != null && handler.canUseReferrer(referrer); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/SessionHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/SessionHandler.java index 8d84cda..9d48f359 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/SessionHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/SessionHandler.java
@@ -12,23 +12,24 @@ import android.widget.RemoteViews; import androidx.annotation.Nullable; -import androidx.browser.customtabs.CustomTabsSessionToken; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.tab.Tab; /** - * Interface to handle browser services calls whenever the session id matched. - * TODO(yusufo): Add a way to handle mayLaunchUrl as well. + * Interface to handle browser services calls whenever the session id matched. TODO(yusufo): Add a + * way to handle mayLaunchUrl as well. */ public interface SessionHandler { /** * @return The session this {@link SessionHandler} is associated with. */ - CustomTabsSessionToken getSession(); + SessionHolder<?> getSession(); /** * Finds the action button with the given id, and updates it with the new content. + * * @return Whether the action button has been updated. */ boolean updateCustomButton(int id, Bitmap bitmap, String description);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/splashscreen/trustedwebactivity/SplashImageHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/splashscreen/trustedwebactivity/SplashImageHolder.java index a8da021..a0f3069 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/splashscreen/trustedwebactivity/SplashImageHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/splashscreen/trustedwebactivity/SplashImageHolder.java
@@ -8,7 +8,8 @@ import android.util.ArrayMap; import androidx.annotation.Nullable; -import androidx.browser.customtabs.CustomTabsSessionToken; + +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import java.util.Collections; import java.util.Map; @@ -21,7 +22,7 @@ * <p>This class is thread-safe. */ public class SplashImageHolder { - private final Map<CustomTabsSessionToken, Bitmap> mBitmaps = + private final Map<SessionHolder<?>, Bitmap> mBitmaps = Collections.synchronizedMap(new ArrayMap<>()); private static SplashImageHolder sInstance; @@ -37,12 +38,12 @@ * Puts the bitmap into cache. It is expected to be retrieved shortly thereafter using {@link * #takeImage}. */ - public void putImage(CustomTabsSessionToken token, Bitmap bitmap) { + public void putImage(SessionHolder<?> token, Bitmap bitmap) { mBitmaps.put(token, bitmap); } /** Takes the bitmap out of the cache. */ - public @Nullable Bitmap takeImage(CustomTabsSessionToken token) { + public @Nullable Bitmap takeImage(SessionHolder<?> token) { return mBitmaps.remove(token); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/AuthTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/AuthTabIntentDataProvider.java index d639e84..8e292b6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/AuthTabIntentDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/AuthTabIntentDataProvider.java
@@ -12,6 +12,7 @@ import androidx.annotation.Nullable; import androidx.annotation.OptIn; import androidx.browser.auth.AuthTabIntent; +import androidx.browser.auth.AuthTabSessionToken; import androidx.browser.auth.ExperimentalAuthTab; import androidx.browser.customtabs.CustomTabsIntent; @@ -20,6 +21,7 @@ import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; import org.chromium.chrome.browser.browserservices.intents.ColorProvider; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.flags.ActivityType; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.components.browser_ui.widget.TintedDrawable; @@ -37,6 +39,7 @@ public class AuthTabIntentDataProvider extends BrowserServicesIntentDataProvider { private final @NonNull Intent mIntent; private final @Nullable String mClientPackageName; + private final SessionHolder<AuthTabSessionToken> mSession; private final @NonNull ColorProvider mColorProvider; private final @NonNull Drawable mCloseButtonIcon; private final @Nullable String mRedirectScheme; @@ -62,6 +65,8 @@ Intent intent, Context context, @CustomTabsIntent.ColorScheme int colorScheme) { assert intent != null; mIntent = intent; + AuthTabSessionToken token = AuthTabSessionToken.getSessionTokenFromIntent(intent); + mSession = token != null ? new SessionHolder<>(token) : null; mClientPackageName = IntentUtils.safeGetStringExtra( intent, IntentHandler.EXTRA_CALLING_ACTIVITY_PACKAGE); @@ -114,6 +119,12 @@ return mIntent; } + @Nullable + @Override + public SessionHolder<AuthTabSessionToken> getSession() { + return mSession; + } + @Override public String getClientPackageName() { return mClientPackageName;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java index d865302..8c3db4da8d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
@@ -18,11 +18,12 @@ import androidx.annotation.IntDef; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.OptIn; import androidx.annotation.VisibleForTesting; +import androidx.browser.auth.ExperimentalAuthTab; import androidx.browser.customtabs.CustomTabsCallback; import androidx.browser.customtabs.CustomTabsService; import androidx.browser.customtabs.CustomTabsService.Relation; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.browser.customtabs.EngagementSignalsCallback; import androidx.browser.customtabs.PostMessageServiceConnection; @@ -34,6 +35,8 @@ import org.chromium.base.task.TaskTraits; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.browserservices.PostMessageHandler; +import org.chromium.chrome.browser.browserservices.intents.BrowserCallbackWrapper; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifier; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifierFactory; import org.chromium.chrome.browser.customtabs.content.EngagementSignalsHandler; @@ -57,6 +60,7 @@ import java.util.Set; /** Manages the clients' state for Custom Tabs. This class is threadsafe. */ +@OptIn(markerClass = ExperimentalAuthTab.class) class ClientManager { // Values for the "CustomTabs.MayLaunchUrlType" UMA histogram. Append-only. @IntDef({ @@ -136,7 +140,7 @@ /** To be called when a client gets disconnected. */ public interface DisconnectCallback { - public void run(CustomTabsSessionToken session); + public void run(SessionHolder<?> session); } private static class KeepAliveServiceConnection implements ServiceConnection { @@ -199,7 +203,7 @@ /** Per-session values. */ private static class SessionParams { public final int uid; - private CustomTabsCallback mCustomTabsCallback; + private BrowserCallbackWrapper mCallback; private EngagementSignalsCallback mEngagementSignalsCallback; public final DisconnectCallback disconnectCallback; public final PostMessageHandler postMessageHandler; @@ -228,15 +232,15 @@ public SessionParams( Context context, int uid, - CustomTabsCallback customTabsCallback, - DisconnectCallback callback, + BrowserCallbackWrapper callback, + DisconnectCallback disconnectCallback, PostMessageHandler postMessageHandler, PostMessageServiceConnection serviceConnection, EngagementSignalsHandler engagementSignalsHandler) { this.uid = uid; mPackageName = getPackageName(context, uid); - mCustomTabsCallback = customTabsCallback; - disconnectCallback = callback; + mCallback = callback; + this.disconnectCallback = disconnectCallback; this.postMessageHandler = postMessageHandler; this.serviceConnection = serviceConnection; if (postMessageHandler != null) this.serviceConnection.setPackageName(mPackageName); @@ -297,12 +301,12 @@ return !mIgnoreFragments && !mShouldSpeculateLoadOnCellular; } - public CustomTabsCallback getCustomTabsCallback() { - return mCustomTabsCallback; + public BrowserCallbackWrapper getCallback() { + return mCallback; } - public void setCustomTabsCallback(CustomTabsCallback customTabsCallback) { - mCustomTabsCallback = customTabsCallback; + public void setCallback(BrowserCallbackWrapper callback) { + mCallback = callback; } public EngagementSignalsCallback getEngagementSignalsCallback() { @@ -344,7 +348,7 @@ private final InstalledAppProviderWrapper mInstalledAppProviderWrapper; - private final Map<CustomTabsSessionToken, SessionParams> mSessionParams = new HashMap<>(); + private final Map<SessionHolder<?>, SessionParams> mSessionParams = new HashMap<>(); private final SparseBooleanArray mUidHasCalledWarmup = new SparseBooleanArray(); private boolean mWarmupHasBeenCalled; @@ -368,23 +372,38 @@ * @return true for success. */ public synchronized boolean newSession( - CustomTabsSessionToken session, + @NonNull SessionHolder<?> session, int uid, DisconnectCallback onDisconnect, - @NonNull PostMessageHandler postMessageHandler, - @NonNull PostMessageServiceConnection serviceConnection, - @NonNull EngagementSignalsHandler engagementSignalsHandler) { - if (session == null || session.getCallback() == null) return false; + @Nullable PostMessageHandler postMessageHandler, + @Nullable PostMessageServiceConnection serviceConnection, + @Nullable EngagementSignalsHandler engagementSignalsHandler) { + assert !session.isCustomTab() + || (postMessageHandler != null + && serviceConnection != null + && engagementSignalsHandler != null); + + BrowserCallbackWrapper callbackWrapper; + if (session.isAuthTab()) { + var callback = session.getSessionAsAuthTab().getCallback(); + if (callback == null) return false; + callbackWrapper = new BrowserCallbackWrapper(callback); + } else { + var callback = session.getSessionAsCustomTab().getCallback(); + if (callback == null) return false; + callbackWrapper = new BrowserCallbackWrapper(callback); + } + if (mSessionParams.containsKey(session)) { SessionParams params = mSessionParams.get(session); - params.setCustomTabsCallback(session.getCallback()); + params.setCallback(callbackWrapper); params.mWasSessionDisconnectStatusLogged = false; } else { SessionParams params = new SessionParams( ContextUtils.getApplicationContext(), uid, - session.getCallback(), + callbackWrapper, onDisconnect, postMessageHandler, serviceConnection, @@ -406,17 +425,18 @@ /** * @return all the sessions originating from a given {@code uid}. */ - public synchronized List<CustomTabsSessionToken> uidToSessions(int uid) { - List<CustomTabsSessionToken> sessions = new ArrayList<>(); - for (Map.Entry<CustomTabsSessionToken, SessionParams> entry : mSessionParams.entrySet()) { + public synchronized List<SessionHolder<?>> uidToSessions(int uid) { + List<SessionHolder<?>> sessions = new ArrayList<>(); + for (Map.Entry<SessionHolder<?>, SessionParams> entry : mSessionParams.entrySet()) { if (entry.getValue().uid == uid) sessions.add(entry.getKey()); } return sessions; } - /** Updates the client behavior stats and returns whether speculation is allowed. + /** + * Updates the client behavior stats and returns whether speculation is allowed. * - * The first call to the "low priority" mode is not throttled. Subsequent ones are. + * <p>The first call to the "low priority" mode is not throttled. Subsequent ones are. * * @param session Client session. * @param uid As returned by Binder.getCallingUid(). @@ -425,7 +445,7 @@ * @return true if speculation is allowed. */ public synchronized boolean updateStatsAndReturnWhetherAllowed( - CustomTabsSessionToken session, int uid, String url, boolean lowConfidence) { + SessionHolder<?> session, int uid, String url, boolean lowConfidence) { SessionParams params = mSessionParams.get(session); if (params == null || params.uid != uid) return false; boolean firstLowConfidencePrediction = @@ -437,7 +457,7 @@ } @VisibleForTesting - synchronized @CalledWarmup int getWarmupState(CustomTabsSessionToken session) { + synchronized @CalledWarmup int getWarmupState(SessionHolder<?> session) { SessionParams params = mSessionParams.get(session); boolean hasValidSession = params != null; boolean hasUidCalledWarmup = hasValidSession && mUidHasCalledWarmup.get(params.uid); @@ -460,11 +480,10 @@ /** * @return the prediction outcome. PredictionStatus.NONE if mSessionParams.get(session) returns - * null. + * null. */ @VisibleForTesting - synchronized @PredictionStatus int getPredictionOutcome( - CustomTabsSessionToken session, String url) { + synchronized @PredictionStatus int getPredictionOutcome(SessionHolder<?> session, String url) { SessionParams params = mSessionParams.get(session); if (params == null) return PredictionStatus.NONE; @@ -479,7 +498,7 @@ } /** Registers that a client has launched a URL inside a Custom Tab. */ - public synchronized void registerLaunch(CustomTabsSessionToken session, String url) { + public synchronized void registerLaunch(SessionHolder<?> session, String url) { @PredictionStatus int outcome = getPredictionOutcome(session, url); SessionParams params = mSessionParams.get(session); @@ -508,7 +527,7 @@ params.resetPredictionMetrics(); } - public int postMessage(CustomTabsSessionToken session, String message) { + public int postMessage(SessionHolder<?> session, String message) { return callOnSession( session, CustomTabsService.RESULT_FAILURE_MESSAGING_ERROR, @@ -518,7 +537,7 @@ /** * See {@link PostMessageServiceConnection#bindSessionToPostMessageService(Context, String)}. */ - public boolean bindToPostMessageServiceForSession(CustomTabsSessionToken session) { + public boolean bindToPostMessageServiceForSession(SessionHolder<?> session) { return callOnSession( session, false, @@ -529,7 +548,7 @@ /** See {@link PostMessageHandler#initializeWithPostMessageUri(Uri, Uri)}. */ public void initializeWithPostMessageOriginForSession( - CustomTabsSessionToken session, Uri origin, Uri targetOrigin) { + SessionHolder<?> session, Uri origin, Uri targetOrigin) { callOnSession( session, params -> @@ -538,16 +557,13 @@ } public synchronized boolean validateRelationship( - CustomTabsSessionToken session, int relation, Origin origin, Bundle extras) { + SessionHolder<?> session, int relation, Origin origin, Bundle extras) { return validateRelationshipInternal(session, relation, origin, null, false, null); } /** Validates the link between the client and the origin. */ public synchronized void verifyAndInitializeWithPostMessageOriginForSession( - CustomTabsSessionToken session, - Origin origin, - Origin targetOrigin, - @Relation int relation) { + SessionHolder<?> session, Origin origin, Origin targetOrigin, @Relation int relation) { validateRelationshipInternal(session, relation, origin, targetOrigin, true, null); } @@ -560,7 +576,7 @@ * @param callback callback to be called after verification is finished. */ public synchronized void validateSourceOriginOfPrefetch( - CustomTabsSessionToken session, Origin sourceOrigin, Runnable callback) { + SessionHolder<?> session, Origin sourceOrigin, Runnable callback) { validateRelationshipInternal( session, CustomTabsService.RELATION_USE_AS_ORIGIN, @@ -572,7 +588,7 @@ /** Can't be called on UI Thread. */ private synchronized boolean validateRelationshipInternal( - CustomTabsSessionToken session, + SessionHolder<?> session, int relation, Origin origin, @Nullable Origin targetOrigin, @@ -585,7 +601,7 @@ (packageName, verifiedOrigin, verified, online) -> { assert origin.equals(verifiedOrigin); - CustomTabsCallback callback = getCallbackForSession(session); + BrowserCallbackWrapper callback = getCallbackForSession(session); if (callback != null) { Bundle extras = null; if (verified && online != null) { @@ -632,7 +648,7 @@ /** * @return The postMessage origin for the given session. */ - Uri getPostMessageOriginForSessionForTesting(CustomTabsSessionToken session) { + Uri getPostMessageOriginForSessionForTesting(SessionHolder<?> session) { return callOnSession( session, null, @@ -643,7 +659,7 @@ /** * @return The postMessage target origin for the given session. */ - Uri getPostMessageTargetOriginForSessionForTesting(CustomTabsSessionToken session) { + Uri getPostMessageTargetOriginForSessionForTesting(SessionHolder<?> session) { return callOnSession( session, null, @@ -653,73 +669,72 @@ /** See {@link PostMessageHandler#reset(WebContents)}. */ public void resetPostMessageHandlerForSession( - CustomTabsSessionToken session, WebContents webContents) { + SessionHolder<?> session, WebContents webContents) { callOnSession(session, params -> params.postMessageHandler.reset(webContents)); } /** * @return The referrer that is associated with the client owning given session. */ - public synchronized Referrer getDefaultReferrerForSession(CustomTabsSessionToken session) { + public synchronized Referrer getDefaultReferrerForSession(SessionHolder<?> sessionHolder) { return IntentHandler.constructValidReferrerForAuthority( - getClientPackageNameForSession(session)); + getClientPackageNameForSession(sessionHolder)); } /** * @return The package name associated with the client owning the given session. */ - public String getClientPackageNameForSession(CustomTabsSessionToken session) { + public String getClientPackageNameForSession(SessionHolder<?> session) { return callOnSession(session, null, params -> params.getPackageName()); } /** - * Overrides the package name for the given session to be the given package name. To be used - * for testing only. + * Overrides the package name for the given session to be the given package name. To be used for + * testing only. */ public void overridePackageNameForSessionForTesting( - CustomTabsSessionToken session, String packageName) { + SessionHolder<?> session, String packageName) { callOnSession( session, params -> params.overridePackageNameForTesting(packageName) // IN-TEST ); } /** - * @return The callback {@link CustomTabsSessionToken} for the given session. + * @return The callback {@link SessionHolder<?>} for the given session. */ - public CustomTabsCallback getCallbackForSession(CustomTabsSessionToken session) { - return callOnSession(session, null, params -> params.getCustomTabsCallback()); + public BrowserCallbackWrapper getCallbackForSession(SessionHolder<?> session) { + return callOnSession(session, null, params -> params.getCallback()); } /** * @return Whether the urlbar should be hidden for the session on first page load. Urls are - * foced to show up after the user navigates away. + * foced to show up after the user navigates away. */ - public boolean shouldHideDomainForSession(CustomTabsSessionToken session) { + public boolean shouldHideDomainForSession(SessionHolder<?> session) { return callOnSession(session, false, params -> params.mShouldHideDomain); } /** Sets whether the urlbar should be hidden for a given session. */ - public void setHideDomainForSession(CustomTabsSessionToken session, boolean hide) { + public void setHideDomainForSession(SessionHolder<?> session, boolean hide) { callOnSession(session, params -> params.mShouldHideDomain = hide); } /** * @return Whether bottom bar scrolling state should be recorded and shared for the session. */ - public boolean shouldSendBottomBarScrollStateForSession(CustomTabsSessionToken session) { + public boolean shouldSendBottomBarScrollStateForSession(SessionHolder<?> session) { return callOnSession(session, false, params -> params.mShouldSendBottomBarScrollState); } /** Sets whether bottom bar scrolling state should be recorded and shared for the session. */ - public void setSendBottomBarScrollingStateForSessionn( - CustomTabsSessionToken session, boolean send) { + public void setSendBottomBarScrollingStateForSessionn(SessionHolder<?> session, boolean send) { callOnSession(session, params -> params.mShouldSendBottomBarScrollState = send); } /** * @return Whether navigation info should be recorded and shared for the session. */ - public boolean shouldSendNavigationInfoForSession(CustomTabsSessionToken session) { + public boolean shouldSendNavigationInfoForSession(SessionHolder<?> session) { return callOnSession(session, false, params -> params.mShouldSendNavigationInfo); } @@ -727,43 +742,43 @@ * Sets whether navigation info should be recorded and shared for the current navigation in this * session. */ - public void setSendNavigationInfoForSession(CustomTabsSessionToken session, boolean send) { + public void setSendNavigationInfoForSession(SessionHolder<?> session, boolean send) { callOnSession(session, params -> params.mShouldSendNavigationInfo = send); } /** * @return Whether the fragment should be ignored for speculation matching. */ - public boolean getIgnoreFragmentsForSession(CustomTabsSessionToken session) { + public boolean getIgnoreFragmentsForSession(SessionHolder<?> session) { return callOnSession(session, false, params -> params.mIgnoreFragments); } /** Sets whether the fragment should be ignored for speculation matching. */ - public void setIgnoreFragmentsForSession(CustomTabsSessionToken session, boolean value) { + public void setIgnoreFragmentsForSession(SessionHolder<?> session, boolean value) { callOnSession(session, params -> params.mIgnoreFragments = value); } /** * @return Whether load speculation should be turned on for cellular networks for given session. */ - public boolean shouldSpeculateLoadOnCellularForSession(CustomTabsSessionToken session) { + public boolean shouldSpeculateLoadOnCellularForSession(SessionHolder<?> session) { return callOnSession(session, false, params -> params.mShouldSpeculateLoadOnCellular); } /** - * @return Whether the session is using the default parameters (that is, don't ignore - * fragments and don't speculate loads on cellular connections). + * @return Whether the session is using the default parameters (that is, don't ignore fragments + * and don't speculate loads on cellular connections). */ - public boolean usesDefaultSessionParameters(CustomTabsSessionToken session) { + public boolean usesDefaultSessionParameters(SessionHolder<?> session) { return callOnSession(session, true, params -> params.isDefault()); } /** - * Sets whether speculation should be turned on for mobile networks for given session. - * If it is turned on, hidden tab speculation is turned on as well. + * Sets whether speculation should be turned on for mobile networks for given session. If it is + * turned on, hidden tab speculation is turned on as well. */ public void setSpeculateLoadOnCellularForSession( - CustomTabsSessionToken session, boolean shouldSpeculate) { + SessionHolder<?> session, boolean shouldSpeculate) { callOnSession( session, params -> { @@ -773,43 +788,41 @@ } /** Sets whether hidden tab speculation can be used. */ - public void setCanUseHiddenTab(CustomTabsSessionToken session, boolean canUseHiddenTab) { + public void setCanUseHiddenTab(SessionHolder<?> session, boolean canUseHiddenTab) { callOnSession(session, params -> params.mCanUseHiddenTab = canUseHiddenTab); } /** Get whether hidden tab speculation can be used. The default is false. */ - public boolean getCanUseHiddenTab(CustomTabsSessionToken session) { + public boolean getCanUseHiddenTab(SessionHolder<?> session) { return callOnSession(session, false, params -> params.mCanUseHiddenTab); } - public void setAllowParallelRequestForSession(CustomTabsSessionToken session, boolean allowed) { + public void setAllowParallelRequestForSession(SessionHolder<?> session, boolean allowed) { callOnSession(session, params -> params.mAllowParallelRequest = allowed); } - public boolean getAllowParallelRequestForSession(CustomTabsSessionToken session) { + public boolean getAllowParallelRequestForSession(SessionHolder<?> session) { return callOnSession(session, false, params -> params.mAllowParallelRequest); } - public void setAllowResourcePrefetchForSession( - CustomTabsSessionToken session, boolean allowed) { + public void setAllowResourcePrefetchForSession(SessionHolder<?> session, boolean allowed) { callOnSession(session, params -> params.mAllowResourcePrefetch = allowed); } - public boolean getAllowResourcePrefetchForSession(CustomTabsSessionToken session) { + public boolean getAllowResourcePrefetchForSession(SessionHolder<?> session) { return callOnSession(session, false, params -> params.mAllowResourcePrefetch); } - public void setShouldGetPageLoadMetricsForSession( - CustomTabsSessionToken session, boolean allowed) { + public void setShouldGetPageLoadMetricsForSession(SessionHolder<?> session, boolean allowed) { callOnSession(session, params -> params.mShouldGetPageLoadMetrics = allowed); } - public boolean shouldGetPageLoadMetrics(CustomTabsSessionToken session) { + public boolean shouldGetPageLoadMetrics(SessionHolder<?> session) { return callOnSession(session, false, params -> params.mShouldGetPageLoadMetrics); } /** Returns the uid associated with the session, {@code -1} if there is no matching session. */ - public int getUidForSession(CustomTabsSessionToken session) { + public int getUidForSession(SessionHolder<?> session) { return callOnSession(session, -1, params -> params.uid); } @@ -822,7 +835,7 @@ * @param origin Origin to verify */ public synchronized boolean isFirstPartyOriginForSession( - CustomTabsSessionToken session, Origin origin) { + SessionHolder<?> session, Origin origin) { return ChromeOriginVerifier.wasPreviouslyVerified( getClientPackageNameForSession(session), origin, @@ -830,7 +843,7 @@ } /** Tries to bind to a client to keep it alive, and returns true for success. */ - public synchronized boolean keepAliveForSession(CustomTabsSessionToken session, Intent intent) { + public synchronized boolean keepAliveForSession(SessionHolder<?> session, Intent intent) { // When an application is bound to a service, its priority is raised to // be at least equal to the application's one. This binds to a placeholder // service (no calls to this service are made). @@ -859,7 +872,7 @@ } /** Unbind from the KeepAlive service for a client. */ - public void dontKeepAliveForSession(CustomTabsSessionToken session) { + public void dontKeepAliveForSession(SessionHolder<?> session) { callOnSession( session, params -> { @@ -893,15 +906,16 @@ /** Cleans up all data associated with all sessions. */ public synchronized void cleanupAll() { // cleanupSessionInternal modifies mSessionParams therefore we need a copy - List<CustomTabsSessionToken> sessions = new ArrayList<>(mSessionParams.keySet()); - for (CustomTabsSessionToken session : sessions) cleanupSession(session); + List<SessionHolder<?>> sessions = new ArrayList<>(mSessionParams.keySet()); + for (SessionHolder<?> session : sessions) cleanupSession(session); } /** * Handle any clean up left after a session is destroyed. + * * @param session The session that has been destroyed. */ - private void cleanupSessionInternal(CustomTabsSessionToken session) { + private void cleanupSessionInternal(SessionHolder<?> session) { callOnSession( session, params -> { @@ -921,7 +935,7 @@ * * @param session The session with invalid callback. */ - public synchronized void cleanupSession(CustomTabsSessionToken session) { + public synchronized void cleanupSession(SessionHolder<?> session) { if (session.hasId() && mSessionParams.containsKey(session)) { SessionParams params = mSessionParams.get(session); // Logging as soon as we know a session has been disconnected. @@ -929,7 +943,7 @@ // Leave session parameters, so client might update callback later. // The session will be completely removed when system runs low on memory. // {@see #cleanupUnusedSessions} - params.setCustomTabsCallback(null); + params.setCallback(null); } else { cleanupSessionInternal(session); } @@ -938,16 +952,16 @@ /** Clean up all sessions which are not currently used. */ public synchronized void cleanupUnusedSessions() { // cleanupSessionInternal modifies mSessionParams therefore we need a copy - List<CustomTabsSessionToken> sessions = new ArrayList<>(mSessionParams.keySet()); - for (CustomTabsSessionToken session : sessions) { - if (mSessionParams.get(session).getCustomTabsCallback() == null) { + List<SessionHolder<?>> sessions = new ArrayList<>(mSessionParams.keySet()); + for (SessionHolder<?> session : sessions) { + if (mSessionParams.get(session).getCallback() == null) { cleanupSessionInternal(session); } } } public void setCustomTabIsInForeground( - @Nullable CustomTabsSessionToken session, boolean isInForeground) { + @Nullable SessionHolder<?> session, boolean isInForeground) { callOnSession( session, params -> { @@ -956,27 +970,27 @@ } public void setEngagementSignalsCallbackForSession( - CustomTabsSessionToken session, EngagementSignalsCallback callback) { + SessionHolder<?> session, EngagementSignalsCallback callback) { callOnSession(session, params -> params.setEngagementSignalsCallback(callback)); } public @Nullable EngagementSignalsCallback getEngagementSignalsCallbackForSession( - CustomTabsSessionToken session) { + SessionHolder<?> session) { return callOnSession(session, null, SessionParams::getEngagementSignalsCallback); } public void setEngagementSignalsAvailableSupplierForSession( - CustomTabsSessionToken session, Supplier<Boolean> supplier) { + SessionHolder<?> session, Supplier<Boolean> supplier) { callOnSession(session, params -> params.setEngagementSignalsAvailableSupplier(supplier)); } public @Nullable Supplier<Boolean> getEngagementSignalsAvailableSupplierForSession( - CustomTabsSessionToken session) { + SessionHolder<?> session) { return callOnSession(session, null, SessionParams::getEngagementSignalsAvailableSupplier); } public @Nullable EngagementSignalsHandler getEngagementSignalsHandlerForSession( - CustomTabsSessionToken session) { + SessionHolder<?> session) { return callOnSession(session, null, SessionParams::getEngagementSignalsHandler); } @@ -1017,7 +1031,7 @@ } private synchronized <T> T callOnSession( - CustomTabsSessionToken session, T fallback, SessionParamsCallback<T> callback) { + SessionHolder<?> session, T fallback, SessionParamsCallback<T> callback) { SessionParams params = mSessionParams.get(session); if (params == null) return fallback; return callback.run(params); @@ -1028,7 +1042,7 @@ } private synchronized void callOnSession( - CustomTabsSessionToken session, SessionParamsRunnable runnable) { + SessionHolder<?> session, SessionParamsRunnable runnable) { SessionParams params = mSessionParams.get(session); if (params == null) return; runnable.run(params);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java index a9a66aa..5dc71c9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -27,7 +27,6 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.browser.customtabs.CustomTabsIntent; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.ActivityState; import org.chromium.base.ApplicationStatus; @@ -41,6 +40,7 @@ import org.chromium.chrome.browser.LaunchIntentDispatcher; import org.chromium.chrome.browser.app.metrics.LaunchCauseMetrics; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider.CustomTabsUiType; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabProvider; import org.chromium.chrome.browser.customtabs.features.CustomTabNavigationBarController; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabHistoryIphController; @@ -65,7 +65,7 @@ /** The activity for custom tabs. It will be launched on top of a client's task. */ public class CustomTabActivity extends BaseCustomTabActivity { - private CustomTabsSessionToken mSession; + private SessionHolder<?> mSession; private final CustomTabsConnection mConnection = CustomTabsConnection.getInstance(); private int mNumOmniboxNavigationEventsPerSession;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java index 74c243c..3f20edd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java
@@ -5,10 +5,10 @@ package org.chromium.chrome.browser.customtabs; import androidx.annotation.IntDef; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabProvider; import org.chromium.chrome.browser.gsa.GSAUtils; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; @@ -75,7 +75,7 @@ String packageName = tab == null ? null : TabAssociatedApp.getAppId(tab); if (packageName == null) return; // No associated package - CustomTabsSessionToken session = mIntentDataProvider.getSession(); + SessionHolder<?> session = mIntentDataProvider.getSession(); boolean isConnected = packageName.equals( CustomTabsConnection.getInstance().getClientPackageNameForSession(session));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java index 7b32b6d..8184667 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
@@ -73,6 +73,7 @@ import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; import org.chromium.chrome.browser.browserservices.intents.ColorProvider; import org.chromium.chrome.browser.browserservices.intents.CustomButtonParams; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.CustomTabsFeatureUsage.CustomTabsFeature; import org.chromium.chrome.browser.flags.ActivityType; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -273,7 +274,7 @@ public static final String EXTRA_NETWORK = "androidx.browser.customtabs.extra.NETWORK"; private final Intent mIntent; - private final CustomTabsSessionToken mSession; + private final SessionHolder<CustomTabsSessionToken> mSession; private final boolean mIsTrustedIntent; private final Intent mKeepAliveServiceIntent; private Bundle mAnimationBundle; @@ -343,22 +344,21 @@ } /** - * Evaluates whether the passed Intent and/or CustomTabsSessionToken are - * from a trusted source. Trusted in this case means from the app itself or - * via a first-party application. + * Evaluates whether the passed Intent and/or CustomTabsSessionToken are from a trusted source. + * Trusted in this case means from the app itself or via a first-party application. * * @param intent The Intent used to start the custom tabs activity, or null. * @param session The connected session for the custom tabs activity, or null. * @return True if the intent or session are trusted. */ - public static boolean isTrustedCustomTab(Intent intent, CustomTabsSessionToken session) { + public static boolean isTrustedCustomTab(Intent intent, SessionHolder<?> session) { if (IntentHandler.wasIntentSenderChrome(intent)) return true; String packageName = getClientPackageNameFromSessionOrCallingActivity(intent, session); return CustomTabsConnection.getInstance().isFirstParty(packageName); } static @Nullable String getClientPackageNameFromSessionOrCallingActivity( - Intent intent, CustomTabsSessionToken session) { + Intent intent, SessionHolder<?> session) { String packageNameFromSession = CustomTabsConnection.getInstance().getClientPackageNameForSession(session); if (!TextUtils.isEmpty(packageNameFromSession)) return packageNameFromSession; @@ -372,7 +372,7 @@ } public static void configureIntentForResizableCustomTab(Context context, Intent intent) { - CustomTabsSessionToken session = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + SessionHolder<?> session = SessionHolder.getSessionHolderFromIntent(intent); boolean isTrustedCustomTab = isTrustedCustomTab(intent, session); String packageName = getClientPackageNameFromSessionOrCallingActivity(intent, session); @Px @@ -489,7 +489,8 @@ if (intent == null) assert false; mIntent = intent; - mSession = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + mSession = token != null ? new SessionHolder<>(token) : null; mIsTrustedIntent = isTrustedCustomTab(intent, mSession); mAnimationBundle = @@ -1158,7 +1159,7 @@ } @Override - public @Nullable CustomTabsSessionToken getSession() { + public @Nullable SessionHolder<CustomTabsSessionToken> getSession() { return mSession; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabNavigationEventObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabNavigationEventObserver.java index 94dbba3..1c8ec72 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabNavigationEventObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabNavigationEventObserver.java
@@ -5,9 +5,9 @@ package org.chromium.chrome.browser.customtabs; import androidx.browser.customtabs.CustomTabsCallback; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; @@ -23,7 +23,7 @@ // An operation was aborted (due to user action). Should match the value in net_error_list.h. private static final int NET_ERROR_ABORTED = -3; - private final CustomTabsSessionToken mSessionToken; + private final SessionHolder<?> mSessionToken; private final CustomTabsConnection mConnection; private boolean mIsPrerender; @@ -32,7 +32,7 @@ private boolean mPageLoadFinished; private Integer mPageLoadFailed; - public CustomTabNavigationEventObserver(CustomTabsSessionToken session, boolean forPrerender) { + public CustomTabNavigationEventObserver(SessionHolder<?> session, boolean forPrerender) { mSessionToken = session; mConnection = CustomTabsConnection.getInstance(); // Kill-switch for reporting events for prerendered navigations.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java index 003a381c..684994d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java
@@ -13,10 +13,10 @@ import androidx.annotation.IntDef; import androidx.annotation.Nullable; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.browser.base.ColdStartTracker; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.ClientManager.CalledWarmup; import org.chromium.chrome.browser.customtabs.features.TabInteractionRecorder; import org.chromium.chrome.browser.intents.BrowserIntentUtils; @@ -38,7 +38,7 @@ /** A {@link TabObserver} that also handles custom tabs specific logging and messaging. */ public class CustomTabObserver extends EmptyTabObserver { private final CustomTabsConnection mCustomTabsConnection; - private final CustomTabsSessionToken mSession; + private final SessionHolder<?> mSession; private final boolean mOpenedByChrome; private final NavigationInfoCaptureTrigger mNavigationInfoCaptureTrigger = new NavigationInfoCaptureTrigger(this::captureNavigationInfo); @@ -93,7 +93,7 @@ } } - public CustomTabObserver(boolean openedByChrome, CustomTabsSessionToken token) { + public CustomTabObserver(boolean openedByChrome, SessionHolder<?> token) { mOpenedByChrome = openedByChrome; mCustomTabsConnection = mOpenedByChrome ? null : CustomTabsConnection.getInstance(); mSession = token;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabSessionHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabSessionHandler.java index 0e479d8..31a09f73 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabSessionHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabSessionHandler.java
@@ -15,7 +15,6 @@ import androidx.annotation.Nullable; import androidx.browser.customtabs.CustomTabsIntent; import androidx.browser.customtabs.CustomTabsService; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.Log; import org.chromium.base.supplier.Supplier; @@ -23,6 +22,7 @@ import org.chromium.chrome.browser.browserservices.SessionHandler; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; import org.chromium.chrome.browser.browserservices.intents.CustomButtonParams; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifier; import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabProvider; import org.chromium.chrome.browser.customtabs.content.CustomTabIntentHandler; @@ -81,7 +81,7 @@ } @Override - public CustomTabsSessionToken getSession() { + public SessionHolder<?> getSession() { return mIntentDataProvider.getSession(); } @@ -155,7 +155,7 @@ @Override public boolean canUseReferrer(Uri referrer) { - CustomTabsSessionToken session = mIntentDataProvider.getSession(); + SessionHolder<?> session = mIntentDataProvider.getSession(); String packageName = CustomTabsConnection.getInstance().getClientPackageNameForSession(session); if (TextUtils.isEmpty(packageName)) return false;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsClientFileProcessor.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsClientFileProcessor.java index 100015b..22709a15 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsClientFileProcessor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsClientFileProcessor.java
@@ -8,13 +8,14 @@ import android.net.Uri; import android.os.Bundle; +import androidx.annotation.NonNull; import androidx.annotation.WorkerThread; import androidx.browser.customtabs.CustomTabsService; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.ContextUtils; import org.chromium.base.FileUtils; import org.chromium.base.Log; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.ui.splashscreen.trustedwebactivity.SplashImageHolder; /** Processes the files received via Custom Tab connection from client apps. */ @@ -39,8 +40,7 @@ * @return {@code true} if successful. */ @WorkerThread - public boolean processFile( - CustomTabsSessionToken session, Uri uri, int purpose, Bundle extras) { + public boolean processFile(SessionHolder<?> session, Uri uri, int purpose, Bundle extras) { if (uri == null) { Log.w(TAG, "Received a null uri"); return false; @@ -53,7 +53,7 @@ return false; } - private boolean receiveTwaSplashImage(CustomTabsSessionToken sessionToken, Uri uri) { + private boolean receiveTwaSplashImage(SessionHolder<?> sessionToken, Uri uri) { Bitmap bitmap = FileUtils.queryBitmapFromContentProvider(ContextUtils.getApplicationContext(), uri); if (bitmap == null) return false; @@ -64,8 +64,8 @@ } /** Cleans up files associated with the session that has been disconnected. */ - public void onSessionDisconnected(CustomTabsSessionToken session) { - if (mTwaSplashImageHolderCreated) { + public void onSessionDisconnected(@NonNull SessionHolder<?> session) { + if (mTwaSplashImageHolderCreated && session.isCustomTab()) { // If the image still hasn't been claimed, delete it. SplashImageHolder.getInstance().takeImage(session); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java index 38349012..0717c26 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
@@ -7,6 +7,7 @@ import static org.chromium.components.content_settings.PrefNames.COOKIE_CONTROLS_MODE; import android.app.PendingIntent; +import android.content.ComponentCallbacks2; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; @@ -20,15 +21,19 @@ import android.widget.RemoteViews; import androidx.annotation.IntDef; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.OptIn; import androidx.annotation.VisibleForTesting; +import androidx.browser.auth.AuthTabSessionToken; +import androidx.browser.auth.ExperimentalAuthTab; import androidx.browser.customtabs.CustomTabsCallback; import androidx.browser.customtabs.CustomTabsIntent; import androidx.browser.customtabs.CustomTabsService; import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.browser.customtabs.EngagementSignalsCallback; import androidx.browser.customtabs.ExperimentalMinimizationCallback; +import androidx.browser.customtabs.ExperimentalPrefetch; import androidx.browser.customtabs.PostMessageServiceConnection; import androidx.browser.customtabs.PrefetchOptions; @@ -62,7 +67,9 @@ import org.chromium.chrome.browser.browserservices.PostMessageHandler; import org.chromium.chrome.browser.browserservices.SessionDataHolder; import org.chromium.chrome.browser.browserservices.SessionHandler; +import org.chromium.chrome.browser.browserservices.intents.BrowserCallbackWrapper; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.content.WebContentsFactory; import org.chromium.chrome.browser.customtabs.ClientManager.CalledWarmup; import org.chromium.chrome.browser.customtabs.content.EngagementSignalsHandler; @@ -117,6 +124,7 @@ */ @JNINamespace("customtabs") @MockedInTests +@OptIn(markerClass = ExperimentalAuthTab.class) public class CustomTabsConnection { private static final String TAG = "ChromeConnection"; private static final String LOG_SERVICE_REQUESTS = "custom-tabs-log-service-requests"; @@ -229,7 +237,7 @@ private final AtomicBoolean mWarmupHasBeenCalled = new AtomicBoolean(); private final AtomicBoolean mWarmupHasBeenFinished = new AtomicBoolean(); - @Nullable private Callback<CustomTabsSessionToken> mDisconnectCallback; + @Nullable private Callback<SessionHolder<?>> mDisconnectCallback; private volatile ChainedTasks mWarmupTasks; @@ -349,22 +357,25 @@ } /** Sets a callback to be triggered when a service connection is terminated. */ - public void setDisconnectCallback(@Nullable Callback<CustomTabsSessionToken> callback) { + public void setDisconnectCallback(@Nullable Callback<SessionHolder<?>> callback) { mDisconnectCallback = callback; } public boolean newSession(CustomTabsSessionToken session) { - boolean success = newSessionInternal(session); + boolean success = false; + if (session != null) { + SessionHolder<CustomTabsSessionToken> holder = new SessionHolder<>(session); + success = newSessionInternal(holder); + } logCall("newSession()", success); return success; } - private boolean newSessionInternal(CustomTabsSessionToken session) { - if (session == null) return false; + private boolean newSessionInternal(@NonNull SessionHolder<?> session) { ClientManager.DisconnectCallback onDisconnect = new ClientManager.DisconnectCallback() { @Override - public void run(CustomTabsSessionToken session) { + public void run(SessionHolder<?> session) { cancelSpeculation(session); if (mDisconnectCallback != null) { mDisconnectCallback.onResult(session); @@ -376,17 +387,23 @@ } }; - // TODO(peconn): Make this not an anonymous class once PostMessageServiceConnection is made - // non-abstract in AndroidX. - PostMessageServiceConnection serviceConnection = - new PostMessageServiceConnection(session) {}; - PostMessageHandler handler = new PostMessageHandler(serviceConnection); - var engagementSignalsHandler = new EngagementSignalsHandler(session); + PostMessageServiceConnection serviceConnection = null; + PostMessageHandler postMessageHandler = null; + EngagementSignalsHandler engagementSignalsHandler = null; + if (session.isCustomTab()) { + var customTabSession = session.getSessionAsCustomTab(); + // TODO(peconn): Make this not an anonymous class once PostMessageServiceConnection is + // made + // non-abstract in AndroidX. + serviceConnection = new PostMessageServiceConnection(customTabSession) {}; + postMessageHandler = new PostMessageHandler(serviceConnection); + engagementSignalsHandler = new EngagementSignalsHandler(customTabSession); + } return mClientManager.newSession( session, Binder.getCallingUid(), onDisconnect, - handler, + postMessageHandler, serviceConnection, engagementSignalsHandler); } @@ -394,11 +411,12 @@ /** * Overrides the given session's packageName if it is generated by Chrome. To be used for * testing only. To be called before the session given is associated with a tab. + * * @param session The session for which the package name should be overridden. * @param packageName The new package name to set. */ public void overridePackageNameForSessionForTesting( - CustomTabsSessionToken session, String packageName) { + SessionHolder<?> session, String packageName) { String originalPackage = getClientPackageNameForSession(session); String selfPackage = ContextUtils.getApplicationContext().getPackageName(); if (TextUtils.isEmpty(originalPackage) || !selfPackage.equals(originalPackage)) return; @@ -539,10 +557,7 @@ * URL cancels the current prerender if any. - Start a spare renderer if necessary. */ private void highConfidenceMayLaunchUrl( - CustomTabsSessionToken session, - String url, - Bundle extras, - List<Bundle> otherLikelyBundles) { + SessionHolder<?> session, String url, Bundle extras, List<Bundle> otherLikelyBundles) { ThreadUtils.assertOnUiThread(); if (TextUtils.isEmpty(url)) { cancelSpeculation(session); @@ -619,14 +634,16 @@ Bundle extras, List<Bundle> otherLikelyBundles) { try (TraceEvent e = TraceEvent.scoped("CustomTabsConnection.mayLaunchUrl")) { - boolean success = mayLaunchUrlInternal(session, url, extras, otherLikelyBundles); + boolean success = + mayLaunchUrlInternal( + new SessionHolder<>(session), url, extras, otherLikelyBundles); logCall("mayLaunchUrl(" + url + ")", success); return success; } } private boolean mayLaunchUrlInternal( - final CustomTabsSessionToken session, + final SessionHolder<?> session, final Uri url, final Bundle extras, final List<Bundle> otherLikelyBundles) { @@ -669,7 +686,7 @@ return true; } - @androidx.browser.customtabs.ExperimentalPrefetch + @ExperimentalPrefetch public void prefetch( CustomTabsSessionToken session, List<Uri> urls, @Nullable PrefetchOptions options) { try (TraceEvent e = TraceEvent.scoped("CustomTabsConnection.prefetch")) { @@ -681,13 +698,13 @@ + " CCTNavigationalPrefetch is not enabled."); return; } - prefetchInternal(session, urls, options); + prefetchInternal(new SessionHolder<>(session), urls, options); } } - @androidx.browser.customtabs.ExperimentalPrefetch + @ExperimentalPrefetch private void prefetchInternal( - CustomTabsSessionToken session, List<Uri> urls, PrefetchOptions options) { + SessionHolder<?> session, List<Uri> urls, PrefetchOptions options) { boolean usePrefetchProxy = options.requiresAnonymousIpWhenCrossOrigin; Origin sourceOrigin = options.sourceOrigin != null @@ -739,9 +756,8 @@ } @VisibleForTesting - @androidx.browser.customtabs.ExperimentalPrefetch - boolean isValidForPrefetchSourceOrigin( - CustomTabsSessionToken session, @Nullable Origin origin) { + @ExperimentalPrefetch + boolean isValidForPrefetchSourceOrigin(SessionHolder<?> session, @Nullable Origin origin) { return origin != null && mClientManager.isFirstPartyOriginForSession(session, origin); } @@ -758,7 +774,7 @@ private void doMayLaunchUrlOnUiThread( final boolean lowConfidence, - final CustomTabsSessionToken session, + final SessionHolder<?> session, final int uid, final String urlString, final Bundle extras, @@ -826,7 +842,7 @@ public boolean updateVisuals(final CustomTabsSessionToken session, Bundle bundle) { if (mLogRequests) Log.w(TAG, "updateVisuals: %s", bundleToJson(bundle)); - SessionHandler handler = mSessionDataHolder.getActiveHandler(session); + SessionHandler handler = mSessionDataHolder.getActiveHandler(new SessionHolder<>(session)); if (handler == null) return false; final Bundle actionButtonBundle = @@ -941,7 +957,9 @@ @Nullable Origin postMessageTargetOrigin) { boolean success = requestPostMessageChannelInternal( - session, postMessageSourceOrigin, postMessageTargetOrigin); + new SessionHolder<>(session), + postMessageSourceOrigin, + postMessageTargetOrigin); logCall( "requestPostMessageChannel() with origin " + (postMessageSourceOrigin != null @@ -952,7 +970,7 @@ } private boolean requestPostMessageChannelInternal( - final CustomTabsSessionToken session, + final SessionHolder<?> session, final Origin postMessageOrigin, @Nullable Origin postMessageTargetOrigin) { if (!mWarmupHasBeenCalled.get()) return false; @@ -988,14 +1006,14 @@ /** * Acquire the origin for the client that owns the given session. + * * @param session The session to use for getting client information. * @param clientUid The UID for the client controlling the session. * @param origin The origin that is suggested by the client. The validated origin may be this or - * a derivative of this. + * a derivative of this. * @return The validated origin {@link Uri} for the given session's client. */ - protected Uri verifyOriginForSession( - CustomTabsSessionToken session, int clientUid, Origin origin) { + protected Uri verifyOriginForSession(SessionHolder<?> session, int clientUid, Origin origin) { if (clientUid == Process.myUid()) return Uri.EMPTY; return null; } @@ -1007,7 +1025,7 @@ * @param intent The intent to verify. */ public boolean isFirstPartyOriginForIntent(Intent intent) { - CustomTabsSessionToken session = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + SessionHolder<?> session = SessionHolder.getSessionHolderFromIntent(intent); if (session == null) return false; Origin origin = Origin.create(intent.getData()); @@ -1017,48 +1035,47 @@ } public int postMessage(CustomTabsSessionToken session, String message, Bundle extras) { + var sessionHolder = new SessionHolder<>(session); int result; if (!mWarmupHasBeenCalled.get()) result = CustomTabsService.RESULT_FAILURE_DISALLOWED; - if (!isCallerForegroundOrSelf() && !mSessionDataHolder.isActiveSession(session)) { + if (!isCallerForegroundOrSelf() && !mSessionDataHolder.isActiveSession(sessionHolder)) { result = CustomTabsService.RESULT_FAILURE_DISALLOWED; } // If called before a validatePostMessageOrigin, the post message origin will be invalid and // will return a failure result here. - result = mClientManager.postMessage(session, message); + result = mClientManager.postMessage(sessionHolder, message); logCall("postMessage", result); return result; } public boolean validateRelationship( CustomTabsSessionToken sessionToken, int relation, Origin origin, Bundle extras) { + var session = new SessionHolder<>(sessionToken); // Essential parts of the verification will depend on native code and will be run sync on UI // thread. Make sure the client has called warmup() beforehand. if (!mWarmupHasBeenCalled.get()) { Log.d(TAG, "Verification failed due to warmup not having been previously called."); mClientManager - .getCallbackForSession(sessionToken) + .getCallbackForSession(session) .onRelationshipValidationResult( relation, Uri.parse(origin.toString()), false, null); return false; } - return mClientManager.validateRelationship(sessionToken, relation, origin, extras); + return mClientManager.validateRelationship(session, relation, origin, extras); } - /** - * See - * {@link ClientManager#resetPostMessageHandlerForSession(CustomTabsSessionToken, WebContents)}. - */ + /** See {@link ClientManager#resetPostMessageHandlerForSession(SessionHolder, WebContents)}. */ public void resetPostMessageHandlerForSession( - CustomTabsSessionToken session, WebContents webContents) { + SessionHolder<?> session, WebContents webContents) { mClientManager.resetPostMessageHandlerForSession(session, webContents); } /** * Registers a launch of a |url| for a given |session|. * - * This is used for accounting. + * <p>This is used for accounting. */ - void registerLaunch(CustomTabsSessionToken session, String url) { + void registerLaunch(SessionHolder<?> session, String url) { mClientManager.registerLaunch(session, url); } @@ -1072,7 +1089,7 @@ * @return The hidden tab, or null. */ public @Nullable HiddenTabHolder.HiddenTab takeHiddenTab( - @Nullable CustomTabsSessionToken session, String url, @Nullable String referrer) { + @Nullable SessionHolder<?> session, String url, @Nullable String referrer) { return mHiddenTabHolder.takeHiddenTab( session, mClientManager.getIgnoreFragmentsForSession(session), url, referrer); } @@ -1083,7 +1100,7 @@ * @param session Session extracted from the intent. * @param intent incoming intent. */ - public void onHandledIntent(CustomTabsSessionToken session, Intent intent) { + public void onHandledIntent(SessionHolder<?> session, Intent intent) { String url = IntentHandler.getUrlFromIntent(intent); if (TextUtils.isEmpty(url)) { return; @@ -1109,11 +1126,11 @@ /** * Called each time a CCT tab is created to check if a client data header was set and if so * forward it along to the native side. + * * @param session Session identifier. * @param webContents the WebContents of the new tab. */ - public void setClientDataHeaderForNewTab( - CustomTabsSessionToken session, WebContents webContents) {} + public void setClientDataHeaderForNewTab(SessionHolder<?> session, WebContents webContents) {} protected void setClientDataHeader(WebContents webContents, String header) { if (TextUtils.isEmpty(header)) return; @@ -1122,7 +1139,7 @@ } private void maybePreconnectToRedirectEndpoint( - CustomTabsSessionToken session, String url, Intent intent) { + SessionHolder<?> session, String url, Intent intent) { // For the preconnection to not be a no-op, we need more than just the native library. if (!ChromeBrowserInitializer.getInstance().isFullBrowserInitialized()) { return; @@ -1145,7 +1162,7 @@ @VisibleForTesting @ParallelRequestStatus - int handleParallelRequest(CustomTabsSessionToken session, Intent intent) { + int handleParallelRequest(SessionHolder<?> session, Intent intent) { int status = maybeStartParallelRequest(session, intent); RecordHistogram.recordEnumeratedHistogram( "CustomTabs.ParallelRequestStatusOnStart", @@ -1182,7 +1199,7 @@ * @return Whether the request was started, with reason in case of failure. */ private @ParallelRequestStatus int maybeStartParallelRequest( - CustomTabsSessionToken session, Intent intent) { + SessionHolder<?> session, Intent intent) { ThreadUtils.assertOnUiThread(); if (!intent.hasExtra(PARALLEL_REQUEST_URL_KEY)) return ParallelRequestStatus.NO_REQUEST; @@ -1236,7 +1253,7 @@ * @return Number of prefetch requests that have been sent. */ @VisibleForTesting - int maybePrefetchResources(CustomTabsSessionToken session, Intent intent) { + int maybePrefetchResources(SessionHolder<?> session, Intent intent) { ThreadUtils.assertOnUiThread(); if (!mClientManager.getAllowResourcePrefetchForSession(session)) return 0; @@ -1279,44 +1296,53 @@ } /** - * @return Whether {@code session} can create a parallel request for a given - * {@code referrer}. + * @return Whether {@code session} can create a parallel request for a given {@code referrer}. */ @VisibleForTesting - boolean canDoParallelRequest(CustomTabsSessionToken session, Uri referrer) { + boolean canDoParallelRequest(SessionHolder<?> session, Uri referrer) { ThreadUtils.assertOnUiThread(); Origin origin = Origin.create(referrer); if (origin == null) return false; return mClientManager.isFirstPartyOriginForSession(session, origin); } - /** @see ClientManager#shouldHideDomainForSession(CustomTabsSessionToken) */ - public boolean shouldHideDomainForSession(CustomTabsSessionToken session) { + /** + * @see ClientManager#shouldHideDomainForSession(SessionHolder) + */ + public boolean shouldHideDomainForSession(SessionHolder<?> session) { return mClientManager.shouldHideDomainForSession(session); } - /** @see ClientManager#shouldSpeculateLoadOnCellularForSession(CustomTabsSessionToken) */ - public boolean shouldSpeculateLoadOnCellularForSession(CustomTabsSessionToken session) { + /** + * @see ClientManager#shouldSpeculateLoadOnCellularForSession(SessionHolder) + */ + public boolean shouldSpeculateLoadOnCellularForSession(SessionHolder<?> session) { return mClientManager.shouldSpeculateLoadOnCellularForSession(session); } - /** @see ClientManager#getCanUseHiddenTab(CustomTabsSessionToken) */ - public boolean canUseHiddenTabForSession(CustomTabsSessionToken session) { + /** + * @see ClientManager#getCanUseHiddenTab(SessionHolder) + */ + public boolean canUseHiddenTabForSession(SessionHolder<?> session) { return mClientManager.getCanUseHiddenTab(session); } - /** @see ClientManager#shouldSendNavigationInfoForSession(CustomTabsSessionToken) */ - public boolean shouldSendNavigationInfoForSession(CustomTabsSessionToken session) { + /** + * @see ClientManager#shouldSendNavigationInfoForSession(SessionHolder) + */ + public boolean shouldSendNavigationInfoForSession(SessionHolder<?> session) { return mClientManager.shouldSendNavigationInfoForSession(session); } - /** @see ClientManager#shouldSendBottomBarScrollStateForSession(CustomTabsSessionToken) */ - public boolean shouldSendBottomBarScrollStateForSession(CustomTabsSessionToken session) { + /** + * @see ClientManager#shouldSendBottomBarScrollStateForSession(SessionHolder) + */ + public boolean shouldSendBottomBarScrollStateForSession(SessionHolder<?> session) { return mClientManager.shouldSendBottomBarScrollStateForSession(session); } - /** See {@link ClientManager#getClientPackageNameForSession(CustomTabsSessionToken)} */ - public String getClientPackageNameForSession(CustomTabsSessionToken session) { + /** See {@link ClientManager#getClientPackageNameForSession(SessionHolder)} */ + public String getClientPackageNameForSession(SessionHolder<?> session) { return mClientManager.getClientPackageNameForSession(session); } @@ -1328,29 +1354,27 @@ return ExternalAuthUtils.getInstance().isGoogleSigned(packageName); } - void setIgnoreUrlFragmentsForSession(CustomTabsSessionToken session, boolean value) { + void setIgnoreUrlFragmentsForSession(SessionHolder<?> session, boolean value) { mClientManager.setIgnoreFragmentsForSession(session, value); } @VisibleForTesting - boolean getIgnoreUrlFragmentsForSession(CustomTabsSessionToken session) { + boolean getIgnoreUrlFragmentsForSession(SessionHolder<?> session) { return mClientManager.getIgnoreFragmentsForSession(session); } @VisibleForTesting - void setShouldSpeculateLoadOnCellularForSession(CustomTabsSessionToken session, boolean value) { + void setShouldSpeculateLoadOnCellularForSession(SessionHolder<?> session, boolean value) { mClientManager.setSpeculateLoadOnCellularForSession(session, value); } @VisibleForTesting - public void setCanUseHiddenTabForSession(CustomTabsSessionToken session, boolean value) { + public void setCanUseHiddenTabForSession(SessionHolder<?> session, boolean value) { mClientManager.setCanUseHiddenTab(session, value); } - /** - * See {@link ClientManager#setSendNavigationInfoForSession(CustomTabsSessionToken, boolean)}. - */ - void setSendNavigationInfoForSession(CustomTabsSessionToken session, boolean send) { + /** See {@link ClientManager#setSendNavigationInfoForSession(SessionHolder, boolean)}. */ + void setSendNavigationInfoForSession(SessionHolder<?> session, boolean send) { mClientManager.setSendNavigationInfoForSession(session, send); } @@ -1362,7 +1386,7 @@ * @param profileProviderSupplier The supplier of the current profile. */ void showSignInToastIfNecessary( - CustomTabsSessionToken session, + SessionHolder<?> session, Intent intent, Supplier<ProfileProvider> profileProviderSupplier) {} @@ -1413,14 +1437,15 @@ /** * Sends the navigation info that was captured to the client callback. + * * @param session The session to use for getting client callback. * @param url The current url for the tab. * @param title The current title for the tab. * @param snapshotPath Uri location for screenshot of the tab contents which is publicly - * available for sharing. + * available for sharing. */ public void sendNavigationInfo( - CustomTabsSessionToken session, String url, String title, Uri snapshotPath) {} + SessionHolder<?> session, String url, String title, Uri snapshotPath) {} /** * Called when the bottom bar for the custom tab has been hidden or shown completely by user @@ -1429,7 +1454,7 @@ * @param session The session that is linked with the custom tab. * @param hidden Whether the bottom bar is hidden or shown. */ - public void onBottomBarScrollStateChanged(CustomTabsSessionToken session, boolean hidden) { + public void onBottomBarScrollStateChanged(SessionHolder<?> session, boolean hidden) { Bundle args = new Bundle(); args.putBoolean("hidden", hidden); @@ -1439,7 +1464,7 @@ } /** Called when a resizable Custom Tab is resized. */ - public void onResized(@Nullable CustomTabsSessionToken session, int height, int width) { + public void onResized(@Nullable SessionHolder<?> session, int height, int width) { Bundle args = new Bundle(); if (height != mPrevHeight) { args.putInt(ON_RESIZED_SIZE_EXTRA, height); @@ -1451,7 +1476,7 @@ mPrevHeight = height; } - CustomTabsCallback callback = mClientManager.getCallbackForSession(session); + BrowserCallbackWrapper callback = mClientManager.getCallbackForSession(session); if (callback == null) return; try { callback.onActivityResized(height, width, args); @@ -1466,10 +1491,10 @@ /** Called when a Custom Tab is unminimized. */ @OptIn(markerClass = ExperimentalMinimizationCallback.class) - public void onUnminimized(@Nullable CustomTabsSessionToken session) { + public void onUnminimized(@Nullable SessionHolder<?> session) { Bundle args = new Bundle(); - CustomTabsCallback callback = mClientManager.getCallbackForSession(session); + BrowserCallbackWrapper callback = mClientManager.getCallbackForSession(session); if (callback == null) return; try { callback.onUnminimized(args); @@ -1484,10 +1509,10 @@ /** Called when a Custom Tab is minimized. */ @OptIn(markerClass = ExperimentalMinimizationCallback.class) - public void onMinimized(@Nullable CustomTabsSessionToken session) { + public void onMinimized(@Nullable SessionHolder<?> session) { Bundle args = new Bundle(); - CustomTabsCallback callback = mClientManager.getCallbackForSession(session); + BrowserCallbackWrapper callback = mClientManager.getCallbackForSession(session); if (callback == null) return; try { callback.onMinimized(args); @@ -1510,7 +1535,7 @@ * @param state The current layout state in which the Custom Tab is displayed. */ public void onActivityLayout( - @Nullable CustomTabsSessionToken session, + @Nullable SessionHolder<?> session, int left, int top, int right, @@ -1527,7 +1552,7 @@ logCallback("extraCallback(" + ON_ACTIVITY_LAYOUT_CALLBACK + ")", args); } - CustomTabsCallback callback = mClientManager.getCallbackForSession(session); + BrowserCallbackWrapper callback = mClientManager.getCallbackForSession(session); if (callback == null) return; try { callback.onActivityLayout(left, top, right, bottom, state, Bundle.EMPTY); @@ -1540,9 +1565,9 @@ } /** - * @see {@link notifyNavigationEvent(CustomTabsSessionToken, int, Optional<int>)} + * @see {@link notifyNavigationEvent(SessionHolder, int, Optional<int>)} */ - public boolean notifyNavigationEvent(CustomTabsSessionToken session, int navigationEvent) { + public boolean notifyNavigationEvent(SessionHolder<?> session, int navigationEvent) { return notifyNavigationEvent(session, navigationEvent, Optional.empty()); } @@ -1558,8 +1583,8 @@ * @return true for success. */ public boolean notifyNavigationEvent( - CustomTabsSessionToken session, int navigationEvent, Optional<Integer> errorCode) { - CustomTabsCallback callback = mClientManager.getCallbackForSession(session); + SessionHolder<?> session, int navigationEvent, Optional<Integer> errorCode) { + BrowserCallbackWrapper callback = mClientManager.getCallbackForSession(session); if (callback == null) return false; try { Bundle extra = getExtrasBundleForNavigationEventForSession(session); @@ -1589,7 +1614,7 @@ * @return Whether the setup will actually change the active feature set. */ boolean setupDynamicFeatures(Intent intent) { - CustomTabsSessionToken session = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + SessionHolder<?> session = SessionHolder.getSessionHolderFromIntent(intent); if (!mIsDynamicIntentFeatureOverridesEnabled || (!CustomTabIntentDataProvider.isTrustedCustomTab(intent, session) && !CommandLine.getInstance() @@ -1679,10 +1704,10 @@ } /** - * @return The {@link Bundle} to use as extra to - * {@link CustomTabsCallback#onNavigationEvent(int, Bundle)} + * @return The {@link Bundle} to use as extra to {@link + * CustomTabsCallback#onNavigationEvent(int, Bundle)} */ - protected Bundle getExtrasBundleForNavigationEventForSession(CustomTabsSessionToken session) { + protected Bundle getExtrasBundleForNavigationEventForSession(SessionHolder<?> session) { // SystemClock.uptimeMillis() is used here as it (as of June 2017) uses the same system call // as all the native side of Chrome, and this is the same clock used for page load metrics. Bundle extras = new Bundle(); @@ -1695,11 +1720,11 @@ final Bundle args = new Bundle(); // Empty one - safe to reuse for all the callbacks. // Notifies all the sessions, as warmup() is tied to a UID, not a session. - for (CustomTabsSessionToken session : mClientManager.uidToSessions(uid)) { + for (SessionHolder<?> session : mClientManager.uidToSessions(uid)) { // TODO(crbug.com/40932858): Remove extra callback after its usage dwindles down. safeExtraCallback(session, ON_WARMUP_COMPLETED, null); - CustomTabsCallback callback = mClientManager.getCallbackForSession(session); + BrowserCallbackWrapper callback = mClientManager.getCallbackForSession(session); if (callback == null) continue; try { callback.onWarmupCompleted(args); @@ -1741,14 +1766,13 @@ * * @param session Session identifier. * @param metricName Name of the page load metric. - * @param navigationStartMicros Absolute navigation start time, in microseconds, in - * {@link SystemClock#uptimeMillis()} timebase. + * @param navigationStartMicros Absolute navigation start time, in microseconds, in {@link + * SystemClock#uptimeMillis()} timebase. * @param offsetMs Offset in ms from navigationStart for the page load metric. - * * @return Whether the metric has been dispatched to the client. */ boolean notifySinglePageLoadMetric( - CustomTabsSessionToken session, + SessionHolder<?> session, String metricName, long navigationStartMicros, long offsetMs) { @@ -1761,14 +1785,14 @@ /** * Notifies the application of a general page load metrics. * - * TODD(lizeb): Move this to a proper method in {@link CustomTabsCallback} once one is + * <p>TODD(lizeb): Move this to a proper method in {@link CustomTabsCallback} once one is * available. * * @param session Session identifier. - * @param args Bundle containing metric information to update. Each item in the bundle - * should be a key specifying the metric name and the metric value as the value. + * @param args Bundle containing metric information to update. Each item in the bundle should be + * a key specifying the metric name and the metric value as the value. */ - boolean notifyPageLoadMetrics(CustomTabsSessionToken session, Bundle args) { + boolean notifyPageLoadMetrics(SessionHolder<?> session, Bundle args) { if (!mClientManager.shouldGetPageLoadMetrics(session)) return false; if (safeExtraCallback(session, PAGE_LOAD_METRICS_CALLBACK, args)) { logPageLoadMetricsCallback(args); @@ -1786,7 +1810,7 @@ * @return true if application was successfully notified. To protect Chrome exceptions in the * client application are swallowed and false is returned. */ - public boolean notifyOpenInBrowser(CustomTabsSessionToken session, Tab tab) { + public boolean notifyOpenInBrowser(SessionHolder<?> session, Tab tab) { EngagementSignalsHandler engagementSignalsHandler = getEngagementSignalsHandler(session); if (tab != null && engagementSignalsHandler != null) { engagementSignalsHandler.notifyOpenInBrowser(tab); @@ -1808,8 +1832,8 @@ // The string passed is safe since it is a method name. @SuppressWarnings("NoDynamicStringsInTraceEventCheck") protected boolean safeExtraCallback( - CustomTabsSessionToken session, String callbackName, @Nullable Bundle args) { - CustomTabsCallback callback = mClientManager.getCallbackForSession(session); + SessionHolder<?> session, String callbackName, @Nullable Bundle args) { + BrowserCallbackWrapper callback = mClientManager.getCallbackForSession(session); if (callback == null) return false; try (TraceEvent te = @@ -1822,16 +1846,16 @@ } /** - * Calls {@link CustomTabsCallback#extraCallbackWithResult)}. - * Wraps calling sendExtraCallbackWithResult in a try/catch so that exceptions thrown by the - * host app don't crash Chrome. + * Calls {@link CustomTabsCallback#extraCallbackWithResult)}. Wraps calling + * sendExtraCallbackWithResult in a try/catch so that exceptions thrown by the host app don't + * crash Chrome. */ @Nullable // The string passed is safe since it is a method name. @SuppressWarnings("NoDynamicStringsInTraceEventCheck") public Bundle sendExtraCallbackWithResult( - CustomTabsSessionToken session, String callbackName, @Nullable Bundle args) { - CustomTabsCallback callback = mClientManager.getCallbackForSession(session); + SessionHolder session, String callbackName, @Nullable Bundle args) { + BrowserCallbackWrapper callback = mClientManager.getCallbackForSession(session); if (callback == null) return null; try (TraceEvent te = @@ -1846,25 +1870,25 @@ /** * Keeps the application linked with a given session alive. * - * The application is kept alive (that is, raised to at least the current process priority + * <p>The application is kept alive (that is, raised to at least the current process priority * level) until {@link #dontKeepAliveForSession} is called. * * @param session The Binder object identifying the session. * @param intent Intent describing the service to bind to. * @return true for success. */ - boolean keepAliveForSession(CustomTabsSessionToken session, Intent intent) { + boolean keepAliveForSession(SessionHolder<?> session, Intent intent) { return mClientManager.keepAliveForSession(session, intent); } /** * Lets the lifetime of the process linked to a given sessionId be managed normally. * - * Without a matching call to {@link #keepAliveForSession}, this is a no-op. + * <p>Without a matching call to {@link #keepAliveForSession}, this is a no-op. * * @param session The Binder object identifying the session. */ - void dontKeepAliveForSession(CustomTabsSessionToken session) { + void dontKeepAliveForSession(SessionHolder<?> session) { mClientManager.dontKeepAliveForSession(session); } @@ -1936,17 +1960,20 @@ /** * Handle any clean up left after a session is destroyed. + * * @param session The session that has been destroyed. */ @VisibleForTesting void cleanUpSession(final CustomTabsSessionToken session) { - PostTask.runOrPostTask(TaskTraits.UI_DEFAULT, () -> mClientManager.cleanupSession(session)); + PostTask.runOrPostTask( + TaskTraits.UI_DEFAULT, + () -> mClientManager.cleanupSession(new SessionHolder<>(session))); } /** * Discards substantial objects that are not currently in use. * - * @param level The type of signal as defined in {@link android.content.ComponentCallbacks2}. + * @param level The type of signal as defined in {@link ComponentCallbacks2}. */ public static void onTrimMemory(int level) { if (!hasInstance()) return; @@ -1956,7 +1983,7 @@ } } - boolean maySpeculate(CustomTabsSessionToken session) { + boolean maySpeculate(SessionHolder<?> session) { if (!DeviceClassManager.enablePrerendering()) { return false; } @@ -1972,7 +1999,7 @@ } /** Cancels the speculation for a given session, or any session if null. */ - public void cancelSpeculation(@Nullable CustomTabsSessionToken session) { + public void cancelSpeculation(@Nullable SessionHolder<?> session) { ThreadUtils.assertOnUiThread(); mHiddenTabHolder.destroyHiddenTab(session); } @@ -1983,7 +2010,7 @@ * and starting a spare renderer. */ private void startSpeculation( - CustomTabsSessionToken session, + SessionHolder<?> session, String url, boolean useHiddenTab, Bundle extras, @@ -2005,7 +2032,7 @@ /** Creates a hidden tab and initiates a navigation. */ private void launchUrlInHiddenTab( - CustomTabsSessionToken session, + SessionHolder<?> session, Profile profile, String url, @Nullable Bundle extras, @@ -2043,7 +2070,7 @@ /** * @return The referrer that is associated with the client owning the given session. */ - public Referrer getDefaultReferrerForSession(CustomTabsSessionToken session) { + public Referrer getDefaultReferrerForSession(SessionHolder<?> session) { return mClientManager.getDefaultReferrerForSession(session); } @@ -2068,16 +2095,17 @@ public void setEngagementSignalsAvailableSupplier( CustomTabsSessionToken session, Supplier<Boolean> supplier) { - mClientManager.setEngagementSignalsAvailableSupplierForSession(session, supplier); + mClientManager.setEngagementSignalsAvailableSupplierForSession( + new SessionHolder<>(session), supplier); } - public EngagementSignalsHandler getEngagementSignalsHandler(CustomTabsSessionToken session) { + public EngagementSignalsHandler getEngagementSignalsHandler(SessionHolder<?> session) { return mClientManager.getEngagementSignalsHandlerForSession(session); } @CalledByNative public static void notifyClientOfDetachedRequestCompletion( - CustomTabsSessionToken session, @JniType("std::string") String url, int status) { + SessionHolder<?> session, @JniType("std::string") String url, int status) { if (!ChromeFeatureList.isEnabled(ChromeFeatureList.CCT_REPORT_PARALLEL_REQUEST_STATUS)) { return; } @@ -2110,44 +2138,45 @@ public boolean receiveFile( CustomTabsSessionToken sessionToken, Uri uri, int purpose, Bundle extras) { return CustomTabsClientFileProcessor.getInstance() - .processFile(sessionToken, uri, purpose, extras); + .processFile(new SessionHolder<>(sessionToken), uri, purpose, extras); } public void setCustomTabIsInForeground( - @Nullable CustomTabsSessionToken session, boolean isInForeground) { + @Nullable SessionHolder<?> session, boolean isInForeground) { mClientManager.setCustomTabIsInForeground(session, isInForeground); } public boolean isEngagementSignalsApiAvailable( CustomTabsSessionToken sessionToken, Bundle extras) { - return isEngagementSignalsApiAvailableInternal(sessionToken); + return isEngagementSignalsApiAvailableInternal(new SessionHolder<>(sessionToken)); } public boolean setEngagementSignalsCallback( CustomTabsSessionToken sessionToken, EngagementSignalsCallback callback, Bundle extras) { - if (!isEngagementSignalsApiAvailableInternal(sessionToken)) return false; + var session = new SessionHolder<>(sessionToken); + if (!isEngagementSignalsApiAvailableInternal(session)) return false; var engagementSignalsHandler = - mClientManager.getEngagementSignalsHandlerForSession(sessionToken); + mClientManager.getEngagementSignalsHandlerForSession(session); if (engagementSignalsHandler == null) return false; - mClientManager.setEngagementSignalsCallbackForSession(sessionToken, callback); + mClientManager.setEngagementSignalsCallbackForSession(session, callback); PostTask.postTask( TaskTraits.UI_DEFAULT, () -> engagementSignalsHandler.setEngagementSignalsCallback(callback)); return true; } - private boolean isEngagementSignalsApiAvailableInternal(CustomTabsSessionToken session) { + private boolean isEngagementSignalsApiAvailableInternal(SessionHolder<?> session) { var supplier = mClientManager.getEngagementSignalsAvailableSupplierForSession(session); return supplier != null ? supplier.get() : PrivacyPreferencesManagerImpl.getInstance().isUsageAndCrashReportingPermitted(); } - public boolean hasEngagementSignalsCallback(CustomTabsSessionToken session) { + public boolean hasEngagementSignalsCallback(SessionHolder<?> session) { return mClientManager.getEngagementSignalsCallbackForSession(session) != null; } @@ -2226,7 +2255,7 @@ */ @CalledByNative private static void notifyClientOfTextFragmentLookupCompletion( - CustomTabsSessionToken session, + SessionHolder<?> session, @JniType("std::string") String stateKey, String[] foundTextFragments) { getInstance() @@ -2235,14 +2264,12 @@ } protected void notifyClientOfTextFragmentLookupCompletionReportApp( - CustomTabsSessionToken session, - String stateKey, - ArrayList<String> foundTextFragments) {} + SessionHolder<?> session, String stateKey, ArrayList<String> foundTextFragments) {} /** * @return The CalledWarmup state for the session. */ - public @CalledWarmup int getWarmupState(CustomTabsSessionToken session) { + public @CalledWarmup int getWarmupState(SessionHolder<?> session) { return mClientManager.getWarmupState(session); } @@ -2251,6 +2278,19 @@ return mHiddenTabHolder.startEarlynavigation(profile, intent); } + void cleanUpSession(AuthTabSessionToken session) { + PostTask.runOrPostTask( + TaskTraits.UI_DEFAULT, + () -> mClientManager.cleanupSession(new SessionHolder<>(session))); + } + + public boolean newAuthTabSession(@NonNull AuthTabSessionToken session) { + SessionHolder<AuthTabSessionToken> holder = new SessionHolder<>(session); + boolean success = newSessionInternal(holder); + logCall("newSession()", success); + return success; + } + public static void setInstanceForTesting(CustomTabsConnection connection) { var oldValue = sInstance; sInstance = connection; @@ -2261,7 +2301,7 @@ interface Natives { void createAndStartDetachedResourceRequest( @JniType("Profile*") Profile profile, - CustomTabsSessionToken session, + SessionHolder<?> session, @JniType("std::string") String packageName, @JniType("std::string") String url, @JniType("std::string") String origin, @@ -2271,13 +2311,13 @@ void setClientDataHeader(WebContents webContents, @JniType("std::string") String header); void textFragmentLookup( - CustomTabsSessionToken session, + SessionHolder<?> session, WebContents webContents, @JniType("std::string") String stateKey, String[] textFragment); void textFragmentFindScrollAndHighlight( - CustomTabsSessionToken session, + SessionHolder<?> session, WebContents webContents, @JniType("std::string") String textFragment); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionServiceImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionServiceImpl.java index 76d5e7f..f26987b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionServiceImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionServiceImpl.java
@@ -10,6 +10,9 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.OptIn; +import androidx.browser.auth.AuthTabSessionToken; +import androidx.browser.auth.ExperimentalAuthTab; import androidx.browser.customtabs.CustomTabsService; import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.browser.customtabs.EngagementSignalsCallback; @@ -22,6 +25,7 @@ import java.util.List; /** Custom tabs connection service, used by the embedded Chrome activities. */ +@OptIn(markerClass = ExperimentalAuthTab.class) public class CustomTabsConnectionServiceImpl extends CustomTabsConnectionService.Impl { private CustomTabsConnection mConnection; private Intent mBindIntent; @@ -146,6 +150,16 @@ return mConnection.isEphemeralBrowsingSupported(extras); } + @Override + protected void cleanUpSession(@NonNull AuthTabSessionToken sessionToken) { + mConnection.cleanUpSession(sessionToken); + } + + @Override + protected boolean newAuthTabSession(@NonNull AuthTabSessionToken sessionToken) { + return mConnection.newAuthTabSession(sessionToken); + } + private boolean isFirstRunDone() { if (mBindIntent == null) return true; boolean firstRunNecessary = FirstRunFlowSequencer.checkIfFirstRunIsNecessary(false, true);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/HiddenTabHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/HiddenTabHolder.java index 1cf2c1b..93f993a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/HiddenTabHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/HiddenTabHolder.java
@@ -19,6 +19,7 @@ import org.chromium.base.TraceEvent; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.WarmupManager; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabController; import org.chromium.chrome.browser.customtabs.content.TabObserverRegistrar; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -48,12 +49,12 @@ /** Holds the parameters for the current hidden tab speculation. */ @VisibleForTesting static final class SpeculationParams { - public final CustomTabsSessionToken session; + public final SessionHolder<?> session; public final HiddenTab hiddenTab; public final String referrer; private SpeculationParams( - CustomTabsSessionToken session, + SessionHolder<?> session, String url, Tab tab, String referrer, @@ -124,7 +125,7 @@ */ void launchUrlInHiddenTab( Callback<Tab> tabCreatedCallback, - CustomTabsSessionToken session, + SessionHolder<?> session, Profile profile, ClientManager clientManager, String url, @@ -210,7 +211,7 @@ */ @Nullable HiddenTab takeHiddenTab( - @Nullable CustomTabsSessionToken session, + @Nullable SessionHolder<?> session, boolean ignoreFragments, String url, @Nullable String referrer) { @@ -241,7 +242,7 @@ } /** Cancels the speculation for a given session, or any session if null. */ - void destroyHiddenTab(@Nullable CustomTabsSessionToken session) { + void destroyHiddenTab(@Nullable SessionHolder<?> session) { if (mSpeculation == null) return; if (session != null && !session.equals(mSpeculation.session)) return; @@ -289,7 +290,7 @@ if (referrer == null) referrer = ""; TabObserverRegistrar registrar = new TabObserverRegistrar(); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + SessionHolder<?> token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabObserver customTabObserver = new CustomTabObserver(/* openedByChrome= */ false, token); CustomTabNavigationEventObserver customTabNavigationEventObserver =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java index e1f6d870..8db94bd1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java
@@ -31,6 +31,7 @@ import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; import org.chromium.chrome.browser.browserservices.intents.ColorProvider; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.CustomTabsFeatureUsage.CustomTabsFeature; import org.chromium.chrome.browser.flags.ActivityType; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -50,7 +51,7 @@ public class IncognitoCustomTabIntentDataProvider extends BrowserServicesIntentDataProvider { private static final int MAX_CUSTOM_MENU_ITEMS = 7; private final Intent mIntent; - private final CustomTabsSessionToken mSession; + private final SessionHolder<CustomTabsSessionToken> mSession; private final boolean mIsTrustedIntent; private final Bundle mAnimationBundle; private final ColorProvider mColorProvider; @@ -72,7 +73,8 @@ assert intent != null; mIntent = intent; mUrlToLoad = resolveUrlToLoad(intent); - mSession = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + mSession = token != null ? new SessionHolder<>(token) : null; mSendersPackageName = getClientPackageNameFromSessionOrCallingActivity(intent, mSession); mIsTrustedIntent = isTrustedCustomTab(intent, mSession); assert isOffTheRecord(); @@ -216,7 +218,7 @@ public static boolean isValidIncognitoIntent(Intent intent, boolean recordMetrics) { if (!isIncognitoRequested(intent)) return false; - var session = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var session = SessionHolder.getSessionHolderFromIntent(intent); if (isIntentFromThirdPartyAllowed() && getClientPackageNameFromSessionOrCallingActivity(intent, session) != null) { return true; @@ -248,7 +250,7 @@ } @Override - public @Nullable CustomTabsSessionToken getSession() { + public @Nullable SessionHolder<?> getSession() { return mSession; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PageLoadMetricsObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PageLoadMetricsObserver.java index 99f0544f4..980af29 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PageLoadMetricsObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PageLoadMetricsObserver.java
@@ -6,8 +6,7 @@ import android.os.Bundle; -import androidx.browser.customtabs.CustomTabsSessionToken; - +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.page_load_metrics.PageLoadMetrics; import org.chromium.chrome.browser.tab.Tab; import org.chromium.content_public.browser.WebContents; @@ -17,11 +16,11 @@ * contentful paint. */ public class PageLoadMetricsObserver implements PageLoadMetrics.Observer { - private final CustomTabsSessionToken mSession; + private final SessionHolder<?> mSession; private final Tab mTab; private Long mNavigationId; - public PageLoadMetricsObserver(CustomTabsSessionToken session, Tab tab) { + public PageLoadMetricsObserver(SessionHolder<?> session, Tab tab) { mSession = session; mTab = tab; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityTabController.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityTabController.java index cbdb00be..1a3d35c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityTabController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityTabController.java
@@ -12,7 +12,6 @@ import androidx.annotation.IntDef; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.Callback; import org.chromium.base.lifetime.Destroyable; @@ -29,6 +28,7 @@ import org.chromium.chrome.browser.app.tabmodel.AsyncTabParamsManagerSingleton; import org.chromium.chrome.browser.app.tabmodel.TabModelOrchestrator; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.compositor.CompositorViewHolder; import org.chromium.chrome.browser.content.WebContentsFactory; import org.chromium.chrome.browser.cookies.CookiesFetcher; @@ -105,7 +105,7 @@ private final TabModelInitializer mTabModelInitializer; private final CipherFactory mCipherFactory; - @Nullable private final CustomTabsSessionToken mSession; + @Nullable private final SessionHolder<?> mSession; private final Intent mIntent; private CookiesFetcher mCookiesFetcher; @@ -391,7 +391,7 @@ String url = intentDataProvider.getUrlToLoad(); String referrerUrl = IntentHandler.getReferrerUrlIncludingExtraHeaders(intentDataProvider.getIntent()); - CustomTabsSessionToken token = intentDataProvider.getSession(); + SessionHolder<?> token = intentDataProvider.getSession(); HiddenTab hiddenTab = CustomTabsConnection.getInstance().takeHiddenTab(token, url, referrerUrl); if (hiddenTab == null) return null; @@ -546,7 +546,7 @@ CustomTabObserver customTabObserver, CustomTabNavigationEventObserver customTabNavigationEventObserver, Tab tab, - CustomTabsSessionToken token) { + SessionHolder<?> token) { registrar.registerTabObserver(customTabObserver); registrar.registerTabObserver(customTabNavigationEventObserver); registrar.registerPageLoadMetricsObserver(new PageLoadMetricsObserver(token, tab));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabIntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabIntentHandler.java index 026b837..f66c655 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabIntentHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabIntentHandler.java
@@ -9,11 +9,11 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.intents.WebappExtras; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.chrome.browser.customtabs.features.minimizedcustomtab.CustomTabMinimizationManagerHolder; @@ -83,13 +83,13 @@ /** * Called from Activity#onNewIntent. * - * @param intentDataProvider Data provider built from the new intent. It's different from - * the injectable instance of {@link BrowserServicesIntentDataProvider} - that one is always - * built from the initial intent. + * @param intentDataProvider Data provider built from the new intent. It's different from the + * injectable instance of {@link BrowserServicesIntentDataProvider} - that one is always + * built from the initial intent. */ public boolean onNewIntent(BrowserServicesIntentDataProvider intentDataProvider) { Intent intent = intentDataProvider.getIntent(); - CustomTabsSessionToken session = intentDataProvider.getSession(); + SessionHolder<?> session = intentDataProvider.getSession(); WebappExtras webappExtras = intentDataProvider.getWebappExtras(); if (webappExtras != null) { // Don't navigate if the purpose of the intent was to bring the webapp to the
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/partialcustomtab/CustomTabHeightStrategy.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/partialcustomtab/CustomTabHeightStrategy.java index 91eba9e..0386425a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/partialcustomtab/CustomTabHeightStrategy.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/partialcustomtab/CustomTabHeightStrategy.java
@@ -9,10 +9,10 @@ import androidx.annotation.Px; import androidx.browser.customtabs.CustomTabsCallback; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar; import org.chromium.chrome.browser.findinpage.FindToolbarObserver; @@ -55,7 +55,7 @@ return new CustomTabHeightStrategy(); } - CustomTabsSessionToken session = intentData.getSession(); + SessionHolder<?> session = intentData.getSession(); OnResizedCallback resizeCallback = (height, width) -> CustomTabsConnection.getInstance().onResized(session, height, width);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/display_cutout/DisplayCutoutTabHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/display_cutout/DisplayCutoutTabHelper.java index 8c5cb02..ad2ed26 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/display_cutout/DisplayCutoutTabHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/display_cutout/DisplayCutoutTabHelper.java
@@ -147,6 +147,15 @@ mCutoutController.setViewportFit(value); } + /** + * Set whether there are safe area constraint on the current web page. + * + * @param hasConstraint Whether there are safe area constraint for the page. + */ + public void setSafeAreaConstraint(boolean hasConstraint) { + mCutoutController.setSafeAreaConstraint(hasConstraint); + } + @Override public void destroy() { mTab.removeObserver(mTabObserver);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabLauncher.java index 5284b22..7212765 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabLauncher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabLauncher.java
@@ -14,7 +14,6 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.chromium.base.ContextUtils; import org.chromium.base.IntentUtils; @@ -24,6 +23,7 @@ import org.chromium.base.task.TaskTraits; import org.chromium.base.version_info.VersionInfo; import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.profiles.Profile; @@ -74,8 +74,7 @@ * process. We extract the package name from the SESSION_TOKEN and store the value in new * intent. */ - CustomTabsSessionToken sessionToken = - CustomTabsSessionToken.getSessionTokenFromIntent(getIntent()); + var sessionToken = SessionHolder.getSessionHolderFromIntent(getIntent()); String sendersPackageName = CustomTabsConnection.getInstance().getClientPackageNameForSession(sessionToken);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java index e113daa..29fe604 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java
@@ -19,6 +19,7 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.task.PostTask; import org.chromium.base.task.TaskTraits; +import org.chromium.blink.mojom.ViewportFit; import org.chromium.chrome.R; import org.chromium.chrome.browser.SwipeRefreshHandler; import org.chromium.chrome.browser.app.bluetooth.BluetoothNotificationService; @@ -358,6 +359,11 @@ @Override public void viewportFitChanged(@WebContentsObserver.ViewportFitType int value) { DisplayCutoutTabHelper.from(mTab).setViewportFit(value); + // TODO(wenyufu): Create a setSafeAreaConstraint method. + if (ChromeFeatureList.sEdgeToEdgeSafeAreaConstraint.isEnabled()) { + DisplayCutoutTabHelper.from(mTab) + .setSafeAreaConstraint(value == ViewportFit.CONTAIN); + } } @Override
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/IntentHandlerNativeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/IntentHandlerNativeTest.java index 1fd8da0..4ca4aca3 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/IntentHandlerNativeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/IntentHandlerNativeTest.java
@@ -14,7 +14,6 @@ import android.provider.Browser; import androidx.browser.customtabs.CustomTabsService; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.test.annotation.UiThreadTest; import androidx.test.core.app.ApplicationProvider; import androidx.test.filters.SmallTest; @@ -32,6 +31,7 @@ import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifier; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.chrome.browser.customtabs.CustomTabsIntentTestUtils; @@ -178,11 +178,10 @@ headers.putString("redirect-url", "https://www.google.com"); headersIntent.putExtra(Browser.EXTRA_HEADERS, headers); - CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(headersIntent); + var sessionHolder = SessionHolder.getSessionHolderFromIntent(headersIntent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); - connection.overridePackageNameForSessionForTesting(token, "app1"); + connection.newSession(sessionHolder.getSessionAsCustomTab()); + connection.overridePackageNameForSessionForTesting(sessionHolder, "app1"); ThreadUtils.runOnUiThreadBlocking( () -> ChromeOriginVerifier.addVerificationOverride( @@ -212,11 +211,10 @@ headers.putString("redirect-url", "https://www.google.com"); headersIntent.putExtra(Browser.EXTRA_HEADERS, headers); - CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(headersIntent); + var sessionHolder = SessionHolder.getSessionHolderFromIntent(headersIntent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); - connection.overridePackageNameForSessionForTesting(token, "app1"); + connection.newSession(sessionHolder.getSessionAsCustomTab()); + connection.overridePackageNameForSessionForTesting(sessionHolder, "app1"); ThreadUtils.runOnUiThreadBlocking( () -> ChromeOriginVerifier.addVerificationOverride(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java index 68057b19..2fcb41a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java
@@ -35,12 +35,9 @@ import org.chromium.base.test.util.DisableIf; import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; -import org.chromium.base.test.util.HistogramWatcher; import org.chromium.base.test.util.Restriction; import org.chromium.base.test.util.UrlUtils; -import org.chromium.chrome.browser.back_press.BackPressManager; import org.chromium.chrome.browser.flags.ChromeSwitches; -import org.chromium.chrome.browser.layouts.LayoutType; import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.Tab.LoadUrlResult; @@ -49,7 +46,6 @@ import org.chromium.chrome.browser.tab.TabUtils.UseDesktopUserAgentCaller; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelUtils; -import org.chromium.chrome.browser.tasks.tab_management.TabUiTestHelper; import org.chromium.chrome.browser.toolbar.ToolbarManager; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; @@ -57,7 +53,6 @@ import org.chromium.chrome.test.util.ChromeTabUtils; import org.chromium.chrome.test.util.OmniboxTestUtils; import org.chromium.chrome.test.util.browser.TabLoadObserver; -import org.chromium.components.browser_ui.widget.gesture.BackPressHandler; import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.test.util.DOMUtils; @@ -562,65 +557,6 @@ onView(withId(R.id.back_button)).check(matches(Matchers.not(isEnabled()))); } - /** Test back with tab switcher. */ - @Test - @MediumTest - @Feature({"Navigation"}) - @DisabledTest(message = "https://crbug.com/1410635") - public void testNavigateBackWithTabSwitcher() throws Exception { - // Disable iph - ThreadUtils.runOnUiThreadBlocking( - () -> { - BackPressManager backPressManager = - mActivityTestRule.getActivity().getBackPressManagerForTesting(); - backPressManager.removeHandler(BackPressHandler.Type.TEXT_BUBBLE); - }); - final String[] urls = { - mTestServer.getURL("/chrome/test/data/android/navigate/one.html"), - mTestServer.getURL("/chrome/test/data/android/navigate/two.html"), - mTestServer.getURL("/chrome/test/data/android/navigate/three.html") - }; - - for (String url : urls) { - navigateAndObserve(url); - } - - String histogram = BackPressManager.getHistogramForTesting(); - - HistogramWatcher startSurfaceHistogram = - HistogramWatcher.newSingleRecordWatcher( - histogram, - BackPressManager.getHistogramValue(BackPressHandler.Type.START_SURFACE)); - HistogramWatcher tabSwitcherHistogram = - HistogramWatcher.newSingleRecordWatcher( - histogram, - BackPressManager.getHistogramValue(BackPressHandler.Type.TAB_SWITCHER)); - - ChromeTabbedActivity cta = mActivityTestRule.getActivity(); - TabUiTestHelper.enterTabSwitcher(cta); - Assert.assertTrue(cta.getLayoutManager().isLayoutVisible(LayoutType.TAB_SWITCHER)); - ThreadUtils.runOnUiThreadBlocking( - () -> { - mActivityTestRule.getActivity().getOnBackPressedDispatcher().onBackPressed(); - }); - CriteriaHelper.pollInstrumentationThread( - () -> { - int type = - mActivityTestRule - .getActivity() - .getLayoutManager() - .getActiveLayoutType(); - Assert.assertEquals(LayoutType.BROWSING, type); - }); - - try { - startSurfaceHistogram.assertExpected(); - } catch (AssertionError e) { - tabSwitcherHistogram.assertExpected( - "Either start surface or tab switcher handles back press."); - } - } - @Test @DisableIf.Build(hardware_is = "sprout", message = "fails on android-one: crbug.com/540723") @MediumTest
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlagsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlagsTest.java index 0d3f48f..30a1fa7 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlagsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlagsTest.java
@@ -58,7 +58,6 @@ ChromeFeatureList.sSafetyHubMagicStack, ChromeFeatureList.sTabGroupPaneAndroid, ChromeFeatureList.sTabResumptionModuleAndroid, - ChromeFeatureList.sTabStateFlatBuffer, ChromeFeatureList.sTraceBinderIpc, OmniboxFeatures.sAndroidHubSearch);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityTestUtil.java b/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityTestUtil.java index 95b9aee..394f9d4 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityTestUtil.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityTestUtil.java
@@ -7,13 +7,13 @@ import android.content.Intent; import androidx.browser.customtabs.CustomTabsService; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.browser.customtabs.TrustedWebUtils; import androidx.test.core.app.ApplicationProvider; import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.CallbackHelper; import org.chromium.cc.input.BrowserControlsState; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.ui.controller.CurrentPageVerifier; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifier; import org.chromium.chrome.browser.customtabs.CustomTabActivity; @@ -82,9 +82,9 @@ /** Creates a Custom Tabs Session from the Intent, specifying the |packageName|. */ public static void createSession(Intent intent, String packageName) throws TimeoutException { - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); - connection.newSession(token); + connection.newSession(token.getSessionAsCustomTab()); connection.overridePackageNameForSessionForTesting(token, packageName); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityEphemeralTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityEphemeralTest.java index 26a63525..c01d727 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityEphemeralTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityEphemeralTest.java
@@ -27,7 +27,6 @@ import android.net.Uri; import androidx.browser.customtabs.CustomTabsIntent; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.test.core.app.ApplicationProvider; import androidx.test.filters.MediumTest; @@ -54,6 +53,7 @@ import org.chromium.base.test.util.Features.EnableFeatures; import org.chromium.base.test.util.HistogramWatcher; import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar; import org.chromium.chrome.browser.firstrun.FirstRunStatus; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -145,7 +145,7 @@ }); } - private void setCanUseHiddenTabForSession(CustomTabsSessionToken token, boolean useHiddenTab) { + private void setCanUseHiddenTabForSession(SessionHolder<?> token, boolean useHiddenTab) { // Save the connection. In case the hidden tab is not consumed by the test, ensure that it // is properly cleaned up after the test. CustomTabsConnection.getInstance().mClientManager.setHideDomainForSession(token, true); @@ -269,11 +269,11 @@ // allowed in OTR profiles. (crbug.com/1106757) Intent intent = createEphemeralCustomTabIntent(); final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); - final CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(intent); + final var sessionHolder = SessionHolder.getSessionHolderFromIntent(intent); + final var token = sessionHolder.getSessionAsCustomTab(); Assert.assertTrue(connection.newSession(token)); // Passes the launch intent to the connection. - setCanUseHiddenTabForSession(token, true); + setCanUseHiddenTabForSession(sessionHolder, true); Assert.assertFalse( connection.mayLaunchUrl(token, Uri.parse(mTestPage), intent.getExtras(), null)); CriteriaHelper.pollUiThread(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoTest.java index 6cec745..c414602 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoTest.java
@@ -36,7 +36,6 @@ import androidx.annotation.DrawableRes; import androidx.appcompat.content.res.AppCompatResources; import androidx.browser.customtabs.CustomTabsIntent; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.test.core.app.ApplicationProvider; import androidx.test.filters.MediumTest; @@ -61,6 +60,7 @@ import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.DisableIf; import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.CustomTabsIntentTestUtils.OnFinishedForTest; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar; import org.chromium.chrome.browser.firstrun.FirstRunStatus; @@ -489,12 +489,15 @@ // allowed in incognito. (crbug.com/1106757) Intent intent = createTestCustomTabIntent(); final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); - final CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(intent); + final var token = SessionHolder.getSessionHolderFromIntent(intent); // Passes the launch intent to the connection. mCustomTabActivityTestRule.buildSessionWithHiddenTab(token); Assert.assertFalse( - connection.mayLaunchUrl(token, Uri.parse(mTestPage), intent.getExtras(), null)); + connection.mayLaunchUrl( + token.getSessionAsCustomTab(), + Uri.parse(mTestPage), + intent.getExtras(), + null)); CriteriaHelper.pollUiThread( () -> { Criteria.checkThat( @@ -517,11 +520,12 @@ // allowed in incognito. (crbug.com/1190971) Intent intent = createTestCustomTabIntent(); final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); - final CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(intent); + final var token = SessionHolder.getSessionHolderFromIntent(intent); // Passes null intent here to mimic not having incognito extra in intent at the connection. mCustomTabActivityTestRule.buildSessionWithHiddenTab(token); - Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(mTestPage), null, null)); + Assert.assertTrue( + connection.mayLaunchUrl( + token.getSessionAsCustomTab(), Uri.parse(mTestPage), null, null)); CriteriaHelper.pollUiThread( () -> { Criteria.checkThat( @@ -535,7 +539,7 @@ connection.getSpeculationParamsForTesting().hiddenTab.tab, mTestPage); mCustomTabActivityTestRule.setCustomSessionInitiatedForIntent(); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - connection.cleanUpSession(token); + connection.cleanUpSession(token.getSessionAsCustomTab()); } /** Regression test for crbug.com/1325331. */
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java index d5801cd..28b2c3f 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -129,6 +129,7 @@ import org.chromium.chrome.browser.WarmupManager; import org.chromium.chrome.browser.browserservices.SessionDataHolder; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifier; import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.contextmenu.ContextMenuCoordinator; @@ -338,9 +339,9 @@ headers.putString("redirect-url", "https://www.google.com"); intent.putExtra(Browser.EXTRA_HEADERS, headers); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); + connection.newSession(token.getSessionAsCustomTab()); connection.overridePackageNameForSessionForTesting(token, "app1"); ThreadUtils.runOnUiThreadBlocking( () -> @@ -349,7 +350,7 @@ Origin.create(intent.getData()), CustomTabsService.RELATION_USE_AS_ORIGIN)); - final CustomTabsSessionToken session = warmUpAndLaunchUrlWithSession(intent); + final var session = warmUpAndLaunchUrlWithSession(intent); assertEquals(getActivity().getIntentDataProvider().getSession(), session); final Tab tab = getActivity().getActivityTab(); @@ -426,7 +427,7 @@ return bitmap; } - private void setCanUseHiddenTabForSession(CustomTabsSessionToken token, boolean useHiddenTab) { + private void setCanUseHiddenTabForSession(SessionHolder<?> token, boolean useHiddenTab) { CustomTabsConnection.getInstance().setCanUseHiddenTabForSession(token, useHiddenTab); } @@ -810,7 +811,7 @@ @Test @SmallTest public void testLaunchWithSession() throws Exception { - CustomTabsSessionToken session = warmUpAndLaunchUrlWithSession(); + var session = warmUpAndLaunchUrlWithSession(); assertEquals(getActivity().getIntentDataProvider().getSession(), session); } @@ -908,8 +909,7 @@ final Context context = ApplicationProvider.getApplicationContext(); final Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, mTestPage); - CustomTabsSessionToken session = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - warmUpAndLaunchUrlWithSession(intent); + var session = warmUpAndLaunchUrlWithSession(intent); assertEquals(getActivity().getIntentDataProvider().getSession(), session); Assert.assertFalse( "CustomTabContentHandler handled intent with wrong session", @@ -996,7 +996,7 @@ final Context context = getInstrumentation().getTargetContext().getApplicationContext(); final Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, mTestPage2); - final CustomTabsSessionToken session = warmUpAndLaunchUrlWithSession(intent); + final var session = warmUpAndLaunchUrlWithSession(intent); assertEquals(getActivity().getIntentDataProvider().getSession(), session); CustomTabsConnection connection = CustomTabsConnection.getInstance(); String packageName = context.getPackageName(); @@ -1039,9 +1039,9 @@ CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, mTestPage2); String referrer = "https://example.com"; intent.putExtra(Intent.EXTRA_REFERRER_NAME, referrer); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); + connection.newSession(token.getSessionAsCustomTab()); connection.overridePackageNameForSessionForTesting(token, "app1"); ThreadUtils.runOnUiThreadBlocking( () -> @@ -1050,7 +1050,7 @@ Origin.create(referrer), CustomTabsService.RELATION_USE_AS_ORIGIN)); - final CustomTabsSessionToken session = warmUpAndLaunchUrlWithSession(intent); + final var session = warmUpAndLaunchUrlWithSession(intent); assertEquals(getActivity().getIntentDataProvider().getSession(), session); final Tab tab = getActivity().getActivityTab(); @@ -1225,14 +1225,15 @@ Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, url); intent.putExtra( CustomTabsIntent.EXTRA_TITLE_VISIBILITY_STATE, CustomTabsIntent.SHOW_PAGE_TITLE); - final CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(intent); - Assert.assertTrue(connection.newSession(token)); + final var token = SessionHolder.getSessionHolderFromIntent(intent); + Assert.assertTrue(connection.newSession(token.getSessionAsCustomTab())); connection.mClientManager.setHideDomainForSession(token, true); if (useHiddenTab) { setCanUseHiddenTabForSession(token, true); - Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(url), null, null)); + Assert.assertTrue( + connection.mayLaunchUrl( + token.getSessionAsCustomTab(), Uri.parse(url), null, null)); CustomTabsTestUtils.ensureCompletedSpeculationForUrl(url); } @@ -1270,11 +1271,13 @@ CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); Context context = ApplicationProvider.getApplicationContext(); Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, mTestPage); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - Assert.assertTrue(connection.newSession(token)); + final var token = SessionHolder.getSessionHolderFromIntent(intent); + Assert.assertTrue(connection.newSession(token.getSessionAsCustomTab())); // Forcing no hidden tab implies falling back to simply creating a spare WebContents. setCanUseHiddenTabForSession(token, false); - Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(mTestPage), null, null)); + Assert.assertTrue( + connection.mayLaunchUrl( + token.getSessionAsCustomTab(), Uri.parse(mTestPage), null, null)); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); CriteriaHelper.pollInstrumentationThread( () -> { @@ -1505,13 +1508,12 @@ final Context context = ApplicationProvider.getApplicationContext(); Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, url); - final CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(intent); + final var token = SessionHolder.getSessionHolderFromIntent(intent); // warmup(), create session, allow parallel requests, allow origin. CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); final Origin origin = Origin.create(requestUri); - Assert.assertTrue(connection.newSession(token)); + Assert.assertTrue(connection.newSession(token.getSessionAsCustomTab())); connection.mClientManager.setAllowParallelRequestForSession(token, true); ThreadUtils.runOnUiThreadBlocking( () -> { @@ -1555,11 +1557,13 @@ CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, urlWithFragment); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - connection.newSession(token); + final var token = SessionHolder.getSessionHolderFromIntent(intent); + connection.newSession(token.getSessionAsCustomTab()); connection.setIgnoreUrlFragmentsForSession(token, ignoreFragments); setCanUseHiddenTabForSession(token, true); - Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(initialUrl), null, null)); + Assert.assertTrue( + connection.mayLaunchUrl( + token.getSessionAsCustomTab(), Uri.parse(initialUrl), null, null)); if (wait) { CustomTabsTestUtils.ensureCompletedSpeculationForUrl(initialUrl); @@ -1609,8 +1613,9 @@ Context context = getInstrumentation().getTargetContext().getApplicationContext(); final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); connection.newSession(token); - setCanUseHiddenTabForSession(token, true); + setCanUseHiddenTabForSession(sessionHolder, true); Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(mTestPage), null, null)); CustomTabsTestUtils.ensureCompletedSpeculationForUrl(mTestPage); @@ -1630,8 +1635,9 @@ final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); final CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); connection.newSession(token); - setCanUseHiddenTabForSession(token, true); + setCanUseHiddenTabForSession(sessionHolder, true); connection.warmup(0); // Needs the browser process to be initialized. @@ -1640,9 +1646,9 @@ PrefService prefs = UserPrefs.get(ProfileManager.getLastUsedRegularProfile()); int old_block_pref = prefs.getInteger(COOKIE_CONTROLS_MODE); prefs.setInteger(COOKIE_CONTROLS_MODE, CookieControlsMode.OFF); - Assert.assertTrue(connection.maySpeculate(token)); + Assert.assertTrue(connection.maySpeculate(sessionHolder)); prefs.setInteger(COOKIE_CONTROLS_MODE, CookieControlsMode.BLOCK_THIRD_PARTY); - Assert.assertFalse(connection.maySpeculate(token)); + Assert.assertFalse(connection.maySpeculate(sessionHolder)); prefs.setInteger(COOKIE_CONTROLS_MODE, old_block_pref); }); } @@ -1654,8 +1660,9 @@ public void testHiddenTabInvalidUrl() throws Exception { final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); connection.newSession(token); - setCanUseHiddenTabForSession(token, true); + setCanUseHiddenTabForSession(sessionHolder, true); Assert.assertFalse( connection.mayLaunchUrl(token, Uri.parse("chrome://version"), null, null)); } @@ -1707,8 +1714,9 @@ Context context = getInstrumentation().getTargetContext().getApplicationContext(); final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); connection.newSession(token); - setCanUseHiddenTabForSession(token, true); + setCanUseHiddenTabForSession(sessionHolder, true); Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(mTestPage), null, null)); mCustomTabActivityTestRule.startCustomTabActivityWithIntent( CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, mTestPage)); @@ -1905,15 +1913,17 @@ Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, url); if (useHiddenTab) { CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - connection.newSession(token); + var token = SessionHolder.getSessionHolderFromIntent(intent); + connection.newSession(token.getSessionAsCustomTab()); setCanUseHiddenTabForSession(token, true); Bundle extras = null; if (speculationReferrer != null) { extras = new Bundle(); extras.putParcelable(Intent.EXTRA_REFERRER, Uri.parse(speculationReferrer)); } - Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(url), extras, null)); + Assert.assertTrue( + connection.mayLaunchUrl( + token.getSessionAsCustomTab(), Uri.parse(url), extras, null)); CustomTabsTestUtils.ensureCompletedSpeculationForUrl(url); } @@ -2027,9 +2037,9 @@ intent.setData(Uri.parse(mTestPage)); int[] ids = {101}; intent.putExtra(CustomTabIntentDataProvider.EXPERIMENT_IDS, ids); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); + connection.newSession(token.getSessionAsCustomTab()); connection.overridePackageNameForSessionForTesting( token, "com.google.android.googlequicksearchbox"); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); @@ -2058,9 +2068,9 @@ .session; Intent intent = new CustomTabsIntent.Builder(session).build().intent; intent.setData(Uri.parse(mTestPage)); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); + connection.newSession(token.getSessionAsCustomTab()); connection.overridePackageNameForSessionForTesting( token, "com.google.android.googlequicksearchbox"); Bundle extrasBundle = new Bundle(); @@ -2068,7 +2078,10 @@ extrasBundle.putIntArray(CustomTabIntentDataProvider.EXPERIMENT_IDS, ids); Assert.assertTrue( connection.mayLaunchUrl( - token, Uri.parse("https://www.google.com"), extrasBundle, null)); + token.getSessionAsCustomTab(), + Uri.parse("https://www.google.com"), + extrasBundle, + null)); ThreadUtils.runOnUiThreadBlocking( () -> { assertTrue(CustomTabsTestUtils.hasVariationId(101)); @@ -2098,17 +2111,18 @@ new CustomTabsConnection() { @Override public void setClientDataHeaderForNewTab( - CustomTabsSessionToken session, WebContents webContents) { + SessionHolder<?> session, WebContents webContents) { setClientDataHeader(webContents, expectedHeader); } }); CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); Context context = getInstrumentation().getTargetContext().getApplicationContext(); Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, url); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - connection.newSession(token); + var token = SessionHolder.getSessionHolderFromIntent(intent); + connection.newSession(token.getSessionAsCustomTab()); setCanUseHiddenTabForSession(token, true); - Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(url), null, null)); + Assert.assertTrue( + connection.mayLaunchUrl(token.getSessionAsCustomTab(), Uri.parse(url), null, null)); CriteriaHelper.pollUiThread( () -> { Criteria.checkThat( @@ -2128,7 +2142,7 @@ @Test @SmallTest public void testCanHideBrowserControls_notPartial() throws Exception { - CustomTabsSessionToken session = warmUpAndLaunchUrlWithSession(); + var session = warmUpAndLaunchUrlWithSession(); assertEquals(getActivity().getIntentDataProvider().getSession(), session); assertOverlayPanelCanHideAndroidBrowserControls(true); } @@ -2143,9 +2157,9 @@ private void doTestLaunchPartialCustomTabWithInitialHeight() throws Exception { Intent intent = createMinimalCustomTabIntent(); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); + connection.newSession(token.getSessionAsCustomTab()); connection.overridePackageNameForSessionForTesting(token, "org.chromium.testapp"); intent.putExtra(EXTRA_INITIAL_ACTIVITY_HEIGHT_PX, 50); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); @@ -2204,9 +2218,9 @@ @DisableIf.Device(DeviceFormFactor.TABLET) public void testLaunchPartialCustomTabActivity_SideSheet() throws Exception { Intent intent = createMinimalCustomTabIntent(); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); + connection.newSession(token.getSessionAsCustomTab()); connection.overridePackageNameForSessionForTesting(token, "org.chromium.testapp"); intent.putExtra(EXTRA_ACTIVITY_SIDE_SHEET_BREAKPOINT_DP, 100); intent.putExtra(EXTRA_INITIAL_ACTIVITY_WIDTH_PX, 300); @@ -2261,9 +2275,9 @@ // https://issuetracker.google.com/issues/68427483 public void testLaunchPartialCustomTabActivity_Transition() throws Exception { Intent intent = createMinimalCustomTabIntent(); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); + connection.newSession(token.getSessionAsCustomTab()); connection.overridePackageNameForSessionForTesting(token, "org.chromium.testapp"); intent.putExtra(EXTRA_ACTIVITY_SIDE_SHEET_BREAKPOINT_DP, 600); intent.putExtra(EXTRA_INITIAL_ACTIVITY_HEIGHT_PX, 300); @@ -2302,9 +2316,9 @@ @EnableFeatures({ChromeFeatureList.CCT_RESIZABLE_FOR_THIRD_PARTIES}) public void testLaunchPartialCustomTabActivity_FullSize() throws Exception { Intent intent = createMinimalCustomTabIntent(); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); + connection.newSession(token.getSessionAsCustomTab()); connection.overridePackageNameForSessionForTesting(token, "org.chromium.testapp"); intent.putExtra(EXTRA_INITIAL_ACTIVITY_HEIGHT_PX, 300); MultiWindowUtils.getInstance().setIsInMultiWindowModeForTesting(true); @@ -2385,12 +2399,14 @@ CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); Context context = getInstrumentation().getTargetContext().getApplicationContext(); Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, url); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - connection.newSession(token); + var token = SessionHolder.getSessionHolderFromIntent(intent); + connection.newSession(token.getSessionAsCustomTab()); if (prefetch) { setCanUseHiddenTabForSession(token, true); - Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(url), null, null)); + Assert.assertTrue( + connection.mayLaunchUrl( + token.getSessionAsCustomTab(), Uri.parse(url), null, null)); CriteriaHelper.pollUiThread( () -> { Criteria.checkThat( @@ -2444,11 +2460,13 @@ Context context = getInstrumentation().getTargetContext().getApplicationContext(); Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, navigationUrl); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - connection.newSession(token); + var token = SessionHolder.getSessionHolderFromIntent(intent); + connection.newSession(token.getSessionAsCustomTab()); setCanUseHiddenTabForSession(token, true); - Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(speculationUrl), null, null)); + Assert.assertTrue( + connection.mayLaunchUrl( + token.getSessionAsCustomTab(), Uri.parse(speculationUrl), null, null)); CustomTabsTestUtils.ensureCompletedSpeculationForUrl(speculationUrl); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); @@ -2465,9 +2483,10 @@ Context context = getInstrumentation().getTargetContext().getApplicationContext(); CustomTabsConnection connection = CustomTabsTestUtils.setUpConnection(); CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); connection.newSession(token); Bundle extras = null; - setCanUseHiddenTabForSession(token, useHiddenTab); + setCanUseHiddenTabForSession(sessionHolder, useHiddenTab); Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(mTestPage), extras, null)); mCustomTabActivityTestRule.startCustomTabActivityWithIntent( CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, mTestPage)); @@ -2549,7 +2568,7 @@ Intent intent = new CustomTabsIntent.Builder(session).build().intent; if (allowMetrics) { - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var token = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); connection.mClientManager.setShouldGetPageLoadMetricsForSession(token, true); } @@ -2607,18 +2626,17 @@ } } - private CustomTabsSessionToken warmUpAndLaunchUrlWithSession(Intent intentWithSession) + private SessionHolder<?> warmUpAndLaunchUrlWithSession(Intent intentWithSession) throws Exception { CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); - CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(intentWithSession); - connection.newSession(token); + var token = SessionHolder.getSessionHolderFromIntent(intentWithSession); + connection.newSession(token.getSessionAsCustomTab()); intentWithSession.setData(Uri.parse(mTestPage)); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intentWithSession); return token; } - private CustomTabsSessionToken warmUpAndLaunchUrlWithSession() throws Exception { + private SessionHolder<?> warmUpAndLaunchUrlWithSession() throws Exception { return warmUpAndLaunchUrlWithSession( CustomTabsIntentTestUtils.createMinimalCustomTabIntent( ApplicationProvider.getApplicationContext(), mTestPage));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabPostMessageTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabPostMessageTest.java index d9a27df0..40d8fa2 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabPostMessageTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabPostMessageTest.java
@@ -43,6 +43,7 @@ import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Restriction; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.tab.Tab; @@ -117,8 +118,10 @@ ChromeTabUtils.waitForTitle(currentTab, newTitle); } - private void setCanUseHiddenTabForSession(CustomTabsSessionToken token, boolean useHiddenTab) { - CustomTabsConnection.getInstance().setCanUseHiddenTabForSession(token, useHiddenTab); + private void setCanUseHiddenTabForSession( + SessionHolder<?> sessionHolder, boolean useHiddenTab) { + CustomTabsConnection.getInstance() + .setCanUseHiddenTabForSession(sessionHolder, useHiddenTab); } private static void ensureCompletedSpeculationForUrl(final String url) { @@ -427,7 +430,7 @@ new ComponentName( ApplicationProvider.getApplicationContext(), ChromeLauncherActivity.class)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var sessionHolder = SessionHolder.getSessionHolderFromIntent(intent); boolean channelRequested = false; String titleString = ""; @@ -438,7 +441,7 @@ Assert.assertTrue(channelRequested); } - setCanUseHiddenTabForSession(token, true); + setCanUseHiddenTabForSession(sessionHolder, true); session.mayLaunchUrl(Uri.parse(url), null, null); ensureCompletedSpeculationForUrl(url);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabPrivacySandboxDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabPrivacySandboxDialogTest.java index 3fd1e7d..2b81192 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabPrivacySandboxDialogTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabPrivacySandboxDialogTest.java
@@ -20,7 +20,6 @@ import android.os.Build; import androidx.browser.customtabs.CustomTabsIntent; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.test.core.app.ApplicationProvider; import androidx.test.filters.SmallTest; import androidx.test.runner.lifecycle.Stage; @@ -42,6 +41,7 @@ import org.chromium.base.test.util.Features.EnableFeatures; import org.chromium.base.test.util.HistogramWatcher; import org.chromium.base.test.util.Restriction; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.firstrun.FirstRunStatus; import org.chromium.chrome.browser.flags.ActivityType; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -178,10 +178,10 @@ private void doTestLaunchPartialCustomTabWithInitialHeight() throws Exception { Intent intent = createMinimalCustomTabIntent(); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var sessionHolder = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); - connection.overridePackageNameForSessionForTesting(token, "org.chromium.testapp"); + connection.newSession(sessionHolder.getSessionAsCustomTab()); + connection.overridePackageNameForSessionForTesting(sessionHolder, "org.chromium.testapp"); intent.putExtra(EXTRA_INITIAL_ACTIVITY_HEIGHT_PX, 50); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java index 83f4b931..75eec6b 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java
@@ -43,6 +43,7 @@ import org.chromium.base.test.util.HistogramWatcher; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.WarmupManager; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifier; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; @@ -185,8 +186,9 @@ public void testHiddenTabTakessSpareRenderer() throws Exception { final CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); mCustomTabsConnection.newSession(token); - mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(token, true); + mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(sessionHolder, true); assertWarmupAndMayLaunchUrl(token, URL, true); ThreadUtils.runOnUiThreadBlocking( () -> { @@ -216,10 +218,11 @@ CustomTabsTestUtils.warmUpAndWait(); final CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue(mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(token, true); - mCustomTabsConnection.setCanUseHiddenTabForSession(token, false); + mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(sessionHolder, true); + mCustomTabsConnection.setCanUseHiddenTabForSession(sessionHolder, false); Assert.assertTrue(mCustomTabsConnection.mayLaunchUrl(token, Uri.parse(URL), null, null)); ThreadUtils.runOnUiThreadBlocking(() -> assertSpareWebContentsNotNullAndDestroy()); @@ -241,8 +244,9 @@ public void testOnlyOneHiddenTab() throws Exception { Assert.assertTrue("Failed warmup()", mCustomTabsConnection.warmup(0)); CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue("Failed newSession()", mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.setCanUseHiddenTabForSession(token, true); + mCustomTabsConnection.setCanUseHiddenTabForSession(sessionHolder, true); // First hidden tab, add an observer to check that it's destroyed. Assert.assertTrue( @@ -299,8 +303,9 @@ public void testKillHiddenTabRenderer() throws Exception { Assert.assertTrue("Failed warmup()", mCustomTabsConnection.warmup(0)); CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue("Failed newSession()", mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(token, true); + mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(sessionHolder, true); Assert.assertTrue( "Failed first mayLaunchUrl()", mCustomTabsConnection.mayLaunchUrl(token, Uri.parse(URL), null, null)); @@ -390,8 +395,9 @@ public void testStillHighConfidenceMayLaunchUrlWithSeveralUrls() { final CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue(mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(token, true); + mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(sessionHolder, true); List<Bundle> urls = new ArrayList<>(); Bundle urlBundle = new Bundle(); urlBundle.putParcelable(CustomTabsService.KEY_URL, Uri.parse(URL)); @@ -466,13 +472,19 @@ Assert.assertTrue("Failed warmup()", mCustomTabsConnection.warmup(0)); Intent intent2 = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, mTestPageUrl); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent2); - Assert.assertTrue("Failed newSession()", mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.setCanUseHiddenTabForSession(token, true); + var sessionHolder = SessionHolder.getSessionHolderFromIntent(intent2); + Assert.assertTrue( + "Failed newSession()", + mCustomTabsConnection.newSession(sessionHolder.getSessionAsCustomTab())); + mCustomTabsConnection.setCanUseHiddenTabForSession(sessionHolder, true); Assert.assertTrue( "Failed first mayLaunchUrl()", - mCustomTabsConnection.mayLaunchUrl(token, Uri.parse(mTestPageUrl), null, null)); + mCustomTabsConnection.mayLaunchUrl( + sessionHolder.getSessionAsCustomTab(), + Uri.parse(mTestPageUrl), + null, + null)); CriteriaHelper.pollUiThread( () -> @@ -505,7 +517,11 @@ mCustomTabsConnection.resetThrottling(Process.myUid()); Assert.assertTrue( "Failed second mayLaunchUrl()", - mCustomTabsConnection.mayLaunchUrl(token, Uri.parse(mTestPageUrl), null, null)); + mCustomTabsConnection.mayLaunchUrl( + sessionHolder.getSessionAsCustomTab(), + Uri.parse(mTestPageUrl), + null, + null)); CriteriaHelper.pollUiThread( () -> @@ -754,8 +770,9 @@ mCustomTabsConnection.ban(Process.myUid()); final CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue(mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(token, true); + mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(sessionHolder, true); Assert.assertTrue(mCustomTabsConnection.mayLaunchUrl(token, Uri.parse(URL), null, null)); ThreadUtils.runOnUiThreadBlocking( @@ -773,8 +790,9 @@ @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) public void testCellularPrerenderingDoesntOverrideSettings() throws Exception { CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue(mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(token, true); + mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(sessionHolder, true); CustomTabsTestUtils.warmUpAndWait(); // Needs the browser process to be initialized. @@ -807,8 +825,9 @@ @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) public void testHiddenTabTakesSpareRenderer() throws Exception { CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue(mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(token, true); + mCustomTabsConnection.setShouldSpeculateLoadOnCellularForSession(sessionHolder, true); CustomTabsTestUtils.warmUpAndWait(); if (ChromeFeatureList.isEnabled(ChromeFeatureList.CCT_PREWARM_TAB)) { ThreadUtils.runOnUiThreadBlocking( @@ -961,8 +980,9 @@ String packageName = "app"; CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue(mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.overridePackageNameForSessionForTesting(token, packageName); + mCustomTabsConnection.overridePackageNameForSessionForTesting(sessionHolder, packageName); ThreadUtils.runOnUiThreadBlocking( () -> ChromeOriginVerifier.addVerificationOverride( @@ -977,14 +997,15 @@ .setSourceOrigin(Uri.parse(invalidSourceOrigin)) .build(); - Assert.assertFalse(mCustomTabsConnection.isValidForPrefetchSourceOrigin(token, null)); + Assert.assertFalse( + mCustomTabsConnection.isValidForPrefetchSourceOrigin(sessionHolder, null)); Assert.assertTrue( mCustomTabsConnection.isValidForPrefetchSourceOrigin( - token, + sessionHolder, Origin.create(prefetchOptionsValidSourceOrigin.sourceOrigin.toString()))); Assert.assertFalse( mCustomTabsConnection.isValidForPrefetchSourceOrigin( - token, + sessionHolder, Origin.create(prefetchOptionsInvalidSourceOrigin.sourceOrigin.toString()))); } @@ -1005,8 +1026,9 @@ String packageName = "app"; CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue(mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.overridePackageNameForSessionForTesting(token, packageName); + mCustomTabsConnection.overridePackageNameForSessionForTesting(sessionHolder, packageName); ThreadUtils.runOnUiThreadBlocking( () -> ChromeOriginVerifier.addVerificationOverride( @@ -1036,8 +1058,9 @@ String packageName = "app"; CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); Assert.assertTrue(mCustomTabsConnection.newSession(token)); - mCustomTabsConnection.overridePackageNameForSessionForTesting(token, packageName); + mCustomTabsConnection.overridePackageNameForSessionForTesting(sessionHolder, packageName); mCustomTabsConnection.prefetch( token, List.of(Uri.parse(prefetchUrl)),
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/DetachedResourceRequestTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/DetachedResourceRequestTest.java index 6b7ec72..0905003 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/DetachedResourceRequestTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/DetachedResourceRequestTest.java
@@ -37,6 +37,7 @@ import org.chromium.base.test.util.Features.EnableFeatures; import org.chromium.base.test.util.HistogramWatcher; import org.chromium.chrome.browser.MockSafeBrowsingApiHandler; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifier; import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.firstrun.FirstRunStatus; @@ -94,9 +95,10 @@ @SmallTest public void testCanDoParallelRequest() { CustomTabsSessionToken session = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(session); Assert.assertTrue(mConnection.newSession(session)); ThreadUtils.runOnUiThreadBlocking( - () -> Assert.assertFalse(mConnection.canDoParallelRequest(session, ORIGIN))); + () -> Assert.assertFalse(mConnection.canDoParallelRequest(sessionHolder, ORIGIN))); ThreadUtils.runOnUiThreadBlocking( () -> { String packageName = mContext.getPackageName(); @@ -104,7 +106,7 @@ packageName, Origin.create(ORIGIN.toString()), CustomTabsService.RELATION_USE_AS_ORIGIN); - Assert.assertTrue(mConnection.canDoParallelRequest(session, ORIGIN)); + Assert.assertTrue(mConnection.canDoParallelRequest(sessionHolder, ORIGIN)); }); } @@ -112,6 +114,7 @@ @SmallTest public void testCanDoResourcePrefetch() throws Exception { CustomTabsSessionToken session = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(session); Assert.assertTrue(mConnection.newSession(session)); ThreadUtils.runOnUiThreadBlocking( () -> { @@ -125,21 +128,27 @@ prepareIntentForResourcePrefetch( Arrays.asList(Uri.parse("https://foo.bar")), ORIGIN); ThreadUtils.runOnUiThreadBlocking( - () -> Assert.assertEquals(0, mConnection.maybePrefetchResources(session, intent))); + () -> + Assert.assertEquals( + 0, mConnection.maybePrefetchResources(sessionHolder, intent))); CustomTabsTestUtils.warmUpAndWait(); ThreadUtils.runOnUiThreadBlocking( - () -> Assert.assertEquals(0, mConnection.maybePrefetchResources(session, intent))); + () -> + Assert.assertEquals( + 0, mConnection.maybePrefetchResources(sessionHolder, intent))); - mConnection.mClientManager.setAllowResourcePrefetchForSession(session, true); + mConnection.mClientManager.setAllowResourcePrefetchForSession(sessionHolder, true); ThreadUtils.runOnUiThreadBlocking( - () -> Assert.assertEquals(1, mConnection.maybePrefetchResources(session, intent))); + () -> + Assert.assertEquals( + 1, mConnection.maybePrefetchResources(sessionHolder, intent))); } @Test @SmallTest public void testStartParallelRequestValidation() throws Exception { - CustomTabsSessionToken session = prepareSession(); + var sessionHolder = prepareSession(); CustomTabsTestUtils.warmUpAndWait(); ThreadUtils.runOnUiThreadBlocking( @@ -149,7 +158,8 @@ HistogramWatcher.newSingleRecordWatcher( "CustomTabs.ParallelRequestStatusOnStart", expected); Assert.assertEquals( - expected, mConnection.handleParallelRequest(session, new Intent())); + expected, + mConnection.handleParallelRequest(sessionHolder, new Intent())); histogram.assertExpected(); expected = CustomTabsConnection.ParallelRequestStatus.FAILURE_INVALID_URL; @@ -162,7 +172,7 @@ Assert.assertEquals( "Should not allow android-app:// scheme", expected, - mConnection.handleParallelRequest(session, intent)); + mConnection.handleParallelRequest(sessionHolder, intent)); histogram.assertExpected(); expected = CustomTabsConnection.ParallelRequestStatus.FAILURE_INVALID_URL; @@ -173,7 +183,7 @@ Assert.assertEquals( "Should not allow an empty URL", expected, - mConnection.handleParallelRequest(session, intent)); + mConnection.handleParallelRequest(sessionHolder, intent)); histogram.assertExpected(); expected = @@ -188,7 +198,7 @@ Assert.assertEquals( "Should not allow an arbitrary origin", expected, - mConnection.handleParallelRequest(session, intent)); + mConnection.handleParallelRequest(sessionHolder, intent)); histogram.assertExpected(); expected = CustomTabsConnection.ParallelRequestStatus.SUCCESS; @@ -197,7 +207,7 @@ "CustomTabs.ParallelRequestStatusOnStart", expected); intent = prepareIntent(Uri.parse("HTTPS://foo.bar"), ORIGIN); Assert.assertEquals( - expected, mConnection.handleParallelRequest(session, intent)); + expected, mConnection.handleParallelRequest(sessionHolder, intent)); histogram.assertExpected(); }); } @@ -205,36 +215,42 @@ @Test @SmallTest public void testStartResourcePrefetchUrlsValidation() throws Exception { - CustomTabsSessionToken session = prepareSession(); + var sessionHolder = prepareSession(); CustomTabsTestUtils.warmUpAndWait(); ThreadUtils.runOnUiThreadBlocking( () -> { Assert.assertEquals( - 0, mConnection.maybePrefetchResources(session, new Intent())); + 0, mConnection.maybePrefetchResources(sessionHolder, new Intent())); ArrayList<Uri> urls = new ArrayList<>(); Intent intent = prepareIntentForResourcePrefetch(urls, ORIGIN); - Assert.assertEquals(0, mConnection.maybePrefetchResources(session, intent)); + Assert.assertEquals( + 0, mConnection.maybePrefetchResources(sessionHolder, intent)); urls.add(Uri.parse("android-app://this.is.an.android.app")); intent = prepareIntentForResourcePrefetch(urls, ORIGIN); - Assert.assertEquals(0, mConnection.maybePrefetchResources(session, intent)); + Assert.assertEquals( + 0, mConnection.maybePrefetchResources(sessionHolder, intent)); urls.add(Uri.parse("")); intent = prepareIntentForResourcePrefetch(urls, ORIGIN); - Assert.assertEquals(0, mConnection.maybePrefetchResources(session, intent)); + Assert.assertEquals( + 0, mConnection.maybePrefetchResources(sessionHolder, intent)); urls.add(Uri.parse("https://foo.bar")); intent = prepareIntentForResourcePrefetch(urls, ORIGIN); - Assert.assertEquals(1, mConnection.maybePrefetchResources(session, intent)); + Assert.assertEquals( + 1, mConnection.maybePrefetchResources(sessionHolder, intent)); urls.add(Uri.parse("https://bar.foo")); intent = prepareIntentForResourcePrefetch(urls, ORIGIN); - Assert.assertEquals(2, mConnection.maybePrefetchResources(session, intent)); + Assert.assertEquals( + 2, mConnection.maybePrefetchResources(sessionHolder, intent)); intent = prepareIntentForResourcePrefetch(urls, Uri.parse("wrong://origin")); - Assert.assertEquals(0, mConnection.maybePrefetchResources(session, intent)); + Assert.assertEquals( + 0, mConnection.maybePrefetchResources(sessionHolder, intent)); }); } @@ -261,7 +277,7 @@ CustomTabsConnection.ParallelRequestStatus.FAILURE_INVALID_REFERRER_FOR_SESSION; DetachedResourceRequestCheckCallback customTabsCallback = new DetachedResourceRequestCheckCallback(url, status, 0); - CustomTabsSessionToken session = prepareSession(ORIGIN, customTabsCallback); + var sessionHolder = prepareSession(ORIGIN, customTabsCallback); CustomTabsTestUtils.warmUpAndWait(); PostTask.runOrPostTask( @@ -270,7 +286,7 @@ Assert.assertEquals( status, mConnection.handleParallelRequest( - session, + sessionHolder, prepareIntent(url, Uri.parse("http://not-the-right-origin")))); }); customTabsCallback.waitForRequest(0, 1); @@ -295,11 +311,11 @@ url, CustomTabsConnection.ParallelRequestStatus.SUCCESS, Math.abs(NetError.ERR_EMPTY_RESPONSE)); - CustomTabsSessionToken session = prepareSession(ORIGIN, customTabsCallback); + var sessionHolder = prepareSession(ORIGIN, customTabsCallback); PostTask.runOrPostTask( TaskTraits.UI_DEFAULT, - () -> mConnection.onHandledIntent(session, prepareIntent(url, ORIGIN))); + () -> mConnection.onHandledIntent(sessionHolder, prepareIntent(url, ORIGIN))); CustomTabsTestUtils.warmUpAndWait(); customTabsCallback.waitForRequest(0, 1); cb.waitForCallback(0, 1); @@ -309,7 +325,7 @@ @Test @SmallTest public void testCanStartResourcePrefetch() throws Exception { - CustomTabsSessionToken session = prepareSession(); + var sessionHolder = prepareSession(); CustomTabsTestUtils.warmUpAndWait(); final CallbackHelper cb = new CallbackHelper(); @@ -333,7 +349,7 @@ Assert.assertEquals( urls.size(), mConnection.maybePrefetchResources( - session, prepareIntentForResourcePrefetch(urls, ORIGIN))); + sessionHolder, prepareIntentForResourcePrefetch(urls, ORIGIN))); }); cb.waitForCallback(0, urls.size()); } @@ -408,12 +424,13 @@ DetachedResourceRequestCheckCallback customTabsCallback = new DetachedResourceRequestCheckCallback( url, CustomTabsConnection.ParallelRequestStatus.SUCCESS, NET_OK); - CustomTabsSessionToken session = prepareSession(ORIGIN, customTabsCallback); + var sessionHolder = prepareSession(ORIGIN, customTabsCallback); ThreadUtils.runOnUiThreadBlocking( () -> { Assert.assertEquals( CustomTabsConnection.ParallelRequestStatus.SUCCESS, - mConnection.handleParallelRequest(session, prepareIntent(url, ORIGIN))); + mConnection.handleParallelRequest( + sessionHolder, prepareIntent(url, ORIGIN))); }); customTabsCallback.waitForRequest(0, 1); customTabsCallback.waitForCompletion(0, 1); @@ -459,12 +476,13 @@ DetachedResourceRequestCheckCallback customTabsCallback = new DetachedResourceRequestCheckCallback( url, CustomTabsConnection.ParallelRequestStatus.SUCCESS, NET_OK); - CustomTabsSessionToken session = prepareSession(ORIGIN, customTabsCallback); + var sessionHolder = prepareSession(ORIGIN, customTabsCallback); ThreadUtils.runOnUiThreadBlocking( () -> { Assert.assertEquals( CustomTabsConnection.ParallelRequestStatus.SUCCESS, - mConnection.handleParallelRequest(session, prepareIntent(url, ORIGIN))); + mConnection.handleParallelRequest( + sessionHolder, prepareIntent(url, ORIGIN))); }); customTabsCallback.waitForRequest(0, 1); customTabsCallback.waitForCompletion(0, 1); @@ -499,13 +517,14 @@ DetachedResourceRequestCheckCallback customTabsCallback = new DetachedResourceRequestCheckCallback( url, CustomTabsConnection.ParallelRequestStatus.SUCCESS, NET_OK); - CustomTabsSessionToken session = prepareSession(origin, customTabsCallback); + var sessionHolder = prepareSession(origin, customTabsCallback); ThreadUtils.runOnUiThreadBlocking( () -> { Assert.assertEquals( CustomTabsConnection.ParallelRequestStatus.SUCCESS, - mConnection.handleParallelRequest(session, prepareIntent(url, origin))); + mConnection.handleParallelRequest( + sessionHolder, prepareIntent(url, origin))); }); customTabsCallback.waitForRequest(0, 1); customTabsCallback.waitForCompletion(0, 1); @@ -542,16 +561,16 @@ intent.putExtra(CustomTabsConnection.PARALLEL_REQUEST_URL_KEY, url); intent.putExtra(CustomTabsConnection.PARALLEL_REQUEST_REFERRER_KEY, ORIGIN); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - Assert.assertTrue(mConnection.newSession(token)); - mConnection.mClientManager.setAllowParallelRequestForSession(token, true); + var sessionHolder = SessionHolder.getSessionHolderFromIntent(intent); + Assert.assertTrue(mConnection.newSession(sessionHolder.getSessionAsCustomTab())); + mConnection.mClientManager.setAllowParallelRequestForSession(sessionHolder, true); ThreadUtils.runOnUiThreadBlocking( () -> { ChromeOriginVerifier.addVerificationOverride( mContext.getPackageName(), Origin.create(ORIGIN.toString()), CustomTabsService.RELATION_USE_AS_ORIGIN); - Assert.assertTrue(mConnection.canDoParallelRequest(token, ORIGIN)); + Assert.assertTrue(mConnection.canDoParallelRequest(sessionHolder, ORIGIN)); }); // Launching a CCT and loading a URL takes more time than usual. Gives a longer timeout. @@ -579,12 +598,12 @@ DetachedResourceRequestCheckCallback customTabsCallback = new DetachedResourceRequestCheckCallback( url, CustomTabsConnection.ParallelRequestStatus.SUCCESS, NET_OK); - CustomTabsSessionToken session = prepareSession(ORIGIN, customTabsCallback); + var sessionHolder = prepareSession(ORIGIN, customTabsCallback); if (afterNative) CustomTabsTestUtils.warmUpAndWait(); PostTask.runOrPostTask( TaskTraits.UI_DEFAULT, - () -> mConnection.onHandledIntent(session, prepareIntent(url, ORIGIN))); + () -> mConnection.onHandledIntent(sessionHolder, prepareIntent(url, ORIGIN))); if (!afterNative) CustomTabsTestUtils.warmUpAndWait(); customTabsCallback.waitForRequest(0, 1); @@ -599,11 +618,11 @@ DetachedResourceRequestCheckCallback customTabsCallback = new DetachedResourceRequestCheckCallback( url, CustomTabsConnection.ParallelRequestStatus.SUCCESS, NET_OK); - CustomTabsSessionToken session = prepareSession(ORIGIN, customTabsCallback); + var sessionHolder = prepareSession(ORIGIN, customTabsCallback); if (afterNative) CustomTabsTestUtils.warmUpAndWait(); ThreadUtils.runOnUiThreadBlocking( - () -> mConnection.onHandledIntent(session, prepareIntent(url, ORIGIN))); + () -> mConnection.onHandledIntent(sessionHolder, prepareIntent(url, ORIGIN))); if (!afterNative) CustomTabsTestUtils.warmUpAndWait(); customTabsCallback.waitForRequest(0, 1); @@ -623,11 +642,11 @@ private void testSafeBrowsingMainResource(boolean afterNative, boolean splitCacheEnabled) throws Exception { SafeBrowsingApiBridge.setSafeBrowsingApiHandler(new MockSafeBrowsingApiHandler()); - CustomTabsSessionToken session = prepareSession(); + var sessionHolder = prepareSession(); String cacheable = "/cachetime"; CallbackHelper readFromSocketCallback = - waitForDetachedRequest(session, cacheable, afterNative); + waitForDetachedRequest(sessionHolder, cacheable, afterNative); Uri url = Uri.parse(mServer.getURL(cacheable)); try { @@ -666,27 +685,27 @@ } } - private CustomTabsSessionToken prepareSession() throws Exception { + private SessionHolder<?> prepareSession() throws Exception { return prepareSession(ORIGIN, null); } - private CustomTabsSessionToken prepareSession(Uri origin, CustomTabsCallback callback) + private SessionHolder<?> prepareSession(Uri origin, CustomTabsCallback callback) throws Exception { CustomTabsSession session = CustomTabsTestUtils.bindWithCallback(callback).session; Intent intent = new CustomTabsIntent.Builder(session).build().intent; - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - Assert.assertTrue(mConnection.newSession(token)); - mConnection.mClientManager.setAllowParallelRequestForSession(token, true); - mConnection.mClientManager.setAllowResourcePrefetchForSession(token, true); + var sessionHolder = SessionHolder.getSessionHolderFromIntent(intent); + Assert.assertTrue(mConnection.newSession(sessionHolder.getSessionAsCustomTab())); + mConnection.mClientManager.setAllowParallelRequestForSession(sessionHolder, true); + mConnection.mClientManager.setAllowResourcePrefetchForSession(sessionHolder, true); ThreadUtils.runOnUiThreadBlocking( () -> { ChromeOriginVerifier.addVerificationOverride( mContext.getPackageName(), Origin.create(origin.toString()), CustomTabsService.RELATION_USE_AS_ORIGIN); - Assert.assertTrue(mConnection.canDoParallelRequest(token, origin)); + Assert.assertTrue(mConnection.canDoParallelRequest(sessionHolder, origin)); }); - return token; + return sessionHolder; } private void setUpTestServerWithListener(EmbeddedTestServer.ConnectionListener listener) { @@ -698,7 +717,7 @@ } private CallbackHelper waitForDetachedRequest( - CustomTabsSessionToken session, String relativeUrl, boolean afterNative) + SessionHolder<?> session, String relativeUrl, boolean afterNative) throws TimeoutException { // Count the number of times data is read from the socket. // We expect 1 for the detached request.
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabActivityTestRule.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabActivityTestRule.java index 3ec1996..0b6ad9b 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabActivityTestRule.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabActivityTestRule.java
@@ -15,6 +15,7 @@ import org.mockito.Mockito; import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.components.externalauth.ExternalAuthUtils; import java.util.concurrent.TimeoutException; @@ -59,8 +60,9 @@ mCustomSessionInitiatedForIntent = true; } - public void buildSessionWithHiddenTab(CustomTabsSessionToken token) { - Assert.assertTrue(CustomTabsConnection.getInstance().newSession(token)); + public void buildSessionWithHiddenTab(SessionHolder<?> token) { + Assert.assertTrue( + CustomTabsConnection.getInstance().newSession(token.getSessionAsCustomTab())); // Need to set params to reach |CustomTabsConnection#doMayLaunchUrlOnUiThread|. CustomTabsConnection.getInstance().mClientManager.setHideDomainForSession(token, true); CustomTabsConnection.getInstance().setCanUseHiddenTabForSession(token, true);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/TrustedCdnPublisherUrlTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/TrustedCdnPublisherUrlTest.java index 9bc8f1f6..f8c2e60 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/TrustedCdnPublisherUrlTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/TrustedCdnPublisherUrlTest.java
@@ -28,7 +28,6 @@ import androidx.annotation.Nullable; import androidx.appcompat.content.res.AppCompatResources; import androidx.browser.customtabs.CustomTabsIntent; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.core.widget.ImageViewCompat; import androidx.test.core.app.ApplicationProvider; import androidx.test.filters.SmallTest; @@ -58,6 +57,7 @@ import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.app.ChromeActivity; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar.CustomTabLocationBar; import org.chromium.chrome.browser.firstrun.FirstRunStatus; @@ -419,10 +419,10 @@ CustomTabsIntentTestUtils.createMinimalCustomTabIntent(targetContext, testUrl); intent.putExtra( CustomTabsIntent.EXTRA_TITLE_VISIBILITY_STATE, CustomTabsIntent.SHOW_PAGE_TITLE); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + var sessionHolder = SessionHolder.getSessionHolderFromIntent(intent); CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); - connection.newSession(token); - connection.overridePackageNameForSessionForTesting(token, clientPackage); + connection.newSession(sessionHolder.getSessionAsCustomTab()); + connection.overridePackageNameForSessionForTesting(sessionHolder, clientPackage); connection.setTrustedPublisherUrlPackageForTest("com.example.test"); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/UrlOverridingTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/UrlOverridingTest.java index 6e8fe49..82b0cf2 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/UrlOverridingTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/UrlOverridingTest.java
@@ -30,7 +30,6 @@ import android.widget.TextView; import androidx.annotation.IntDef; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.test.core.app.ApplicationProvider; import androidx.test.espresso.Espresso; import androidx.test.filters.LargeTest; @@ -73,6 +72,7 @@ import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.LaunchIntentDispatcher; import org.chromium.chrome.browser.app.ChromeActivity; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.chrome.browser.customtabs.CustomTabsIntentTestUtils; @@ -1709,12 +1709,13 @@ final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); Context context = ContextUtils.getApplicationContext(); Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, url); - final CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(intent); - Assert.assertTrue(connection.newSession(token)); + final var sessionHolder = SessionHolder.getSessionHolderFromIntent(intent); + Assert.assertTrue(connection.newSession(sessionHolder.getSessionAsCustomTab())); - connection.setCanUseHiddenTabForSession(token, true); - Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(url), null, null)); + connection.setCanUseHiddenTabForSession(sessionHolder, true); + Assert.assertTrue( + connection.mayLaunchUrl( + sessionHolder.getSessionAsCustomTab(), Uri.parse(url), null, null)); CustomTabsTestUtils.ensureCompletedSpeculationForUrl(url); // Can't wait for Activity startup as we close so fast the polling is flaky. @@ -1735,10 +1736,9 @@ final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); Context context = ContextUtils.getApplicationContext(); Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, url); - final CustomTabsSessionToken token = - CustomTabsSessionToken.getSessionTokenFromIntent(intent); - Assert.assertTrue(connection.newSession(token)); - connection.overridePackageNameForSessionForTesting(token, TRUSTED_CCT_PACKAGE); + final var sessionHolder = SessionHolder.getSessionHolderFromIntent(intent); + Assert.assertTrue(connection.newSession(sessionHolder.getSessionAsCustomTab())); + connection.overridePackageNameForSessionForTesting(sessionHolder, TRUSTED_CCT_PACKAGE); mCustomTabActivityRule.startCustomTabActivityWithIntent(intent);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/StartupLoadingMetricsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/StartupLoadingMetricsTest.java index 365cc70..2b399b8 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/StartupLoadingMetricsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/StartupLoadingMetricsTest.java
@@ -33,6 +33,7 @@ import org.chromium.base.test.util.MinAndroidSdkLevel; import org.chromium.chrome.browser.LauncherShortcutActivity; import org.chromium.chrome.browser.base.ColdStartTracker; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.chrome.browser.customtabs.CustomTabsIntentTestUtils; @@ -518,8 +519,9 @@ CustomTabsConnection connection = CustomTabsTestUtils.setUpConnection(); mConnectionToCleanup = connection; CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); + var sessionHolder = new SessionHolder<>(token); connection.newSession(token); - connection.setCanUseHiddenTabForSession(token, false); + connection.setCanUseHiddenTabForSession(sessionHolder, false); Intent intent = CustomTabsIntentTestUtils.createMinimalCustomTabIntent(context, getTestPage());
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/SessionDataHolderTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/SessionDataHolderTest.java index b7ecb52..48a6450f 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/SessionDataHolderTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/SessionDataHolderTest.java
@@ -7,6 +7,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.when; import android.app.Activity; @@ -14,7 +15,6 @@ import android.content.Intent; import androidx.browser.customtabs.CustomTabsIntent; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.junit.Before; import org.junit.Test; @@ -28,6 +28,7 @@ import org.chromium.base.Callback; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.CustomTabActivity; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.chrome.browser.customtabs.TranslucentCustomTabActivity; @@ -42,26 +43,26 @@ private Intent mIntent1; private Intent mIntent2; - private CustomTabsSessionToken mSession1; - private CustomTabsSessionToken mSession2; + private SessionHolder<?> mSession1; + private SessionHolder<?> mSession2; @Mock CustomTabsConnection mConnection; @Mock SessionHandler mHandler1; @Mock SessionHandler mHandler2; @Mock Activity mActivityInTask1; @Mock Activity mActivityInTask2; - @Captor ArgumentCaptor<Callback<CustomTabsSessionToken>> mDisconnectCallbackCaptor; + @Captor ArgumentCaptor<Callback<SessionHolder<?>>> mDisconnectCallbackCaptor; @Before public void setUp() { MockitoAnnotations.initMocks(this); CustomTabsConnection.setInstanceForTesting(mConnection); mIntent1 = createIntentWithSessionId(1); - mSession1 = CustomTabsSessionToken.getSessionTokenFromIntent(mIntent1); + mSession1 = SessionHolder.getSessionHolderFromIntent(mIntent1); mIntent2 = createIntentWithSessionId(2); - mSession2 = CustomTabsSessionToken.getSessionTokenFromIntent(mIntent2); - when(mHandler1.getSession()).thenReturn(mSession1); - when(mHandler2.getSession()).thenReturn(mSession2); + mSession2 = SessionHolder.getSessionHolderFromIntent(mIntent2); + doReturn(mSession1).when(mHandler1).getSession(); + doReturn(mSession2).when(mHandler2).getSession(); when(mHandler1.getActivityClass()).thenReturn((Class) CustomTabActivity.class); when(mHandler2.getActivityClass()).thenReturn((Class) TranslucentCustomTabActivity.class); when(mActivityInTask1.getTaskId()).thenReturn(TASK_ID_1); @@ -179,8 +180,8 @@ assertNull(activity); } - private void disconnect(CustomTabsSessionToken session) { - Callback<CustomTabsSessionToken> callback = mDisconnectCallbackCaptor.getValue(); + private void disconnect(SessionHolder<?> session) { + Callback<SessionHolder<?>> callback = mDisconnectCallbackCaptor.getValue(); if (callback != null) { callback.onResult(session); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java index 92a8f8c4..0f4cbc7f 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java
@@ -42,8 +42,11 @@ import org.chromium.base.metrics.UmaRecorderHolder; import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.Batch; +import org.chromium.chrome.browser.browserservices.PostMessageHandler; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifier; import org.chromium.chrome.browser.browserservices.verification.ChromeOriginVerifierJni; +import org.chromium.chrome.browser.customtabs.content.EngagementSignalsHandler; import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.profiles.Profile; @@ -79,10 +82,14 @@ private static final String PACKAGE_NAME = "org.chromium.chrome"; private ClientManager mClientManager; - private CustomTabsSessionToken mSession = - CustomTabsSessionToken.createMockSessionTokenForTesting(); + private final SessionHolder<?> mSession = + new SessionHolder<>(CustomTabsSessionToken.createMockSessionTokenForTesting()); private int mUid = Process.myUid(); + private EngagementSignalsHandler mEngagementSignalsHandler; + private PostMessageServiceConnection mPostMessageServiceConnection; + private PostMessageHandler mPostMessageHandler; + @Mock private ClientManager.InstalledAppProviderWrapper mInstalledAppProviderWrapper; @Mock private OriginVerifier.Natives mMockOriginVerifierJni; @@ -144,6 +151,11 @@ return url1.equals(url2); } }); + + mPostMessageServiceConnection = + new PostMessageServiceConnection(mSession.getSessionAsCustomTab()) {}; + mPostMessageHandler = new PostMessageHandler(mPostMessageServiceConnection); + mEngagementSignalsHandler = new EngagementSignalsHandler(mSession.getSessionAsCustomTab()); } @Test @@ -182,7 +194,13 @@ @Test @SmallTest public void testValidSessionNoWarmup() { - mClientManager.newSession(mSession, mUid, null, null, null, null); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler); Assert.assertEquals( ClientManager.CalledWarmup.SESSION_NO_WARMUP_NOT_CALLED, mClientManager.getWarmupState(mSession)); @@ -192,7 +210,13 @@ @SmallTest public void testValidSessionOtherWarmup() { mClientManager.recordUidHasCalledWarmup(mUid + 1); - mClientManager.newSession(mSession, mUid, null, null, null, null); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler); Assert.assertEquals( ClientManager.CalledWarmup.SESSION_NO_WARMUP_ALREADY_CALLED, mClientManager.getWarmupState(mSession)); @@ -202,7 +226,13 @@ @SmallTest public void testValidSessionWarmup() { mClientManager.recordUidHasCalledWarmup(mUid); - mClientManager.newSession(mSession, mUid, null, null, null, null); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler); Assert.assertEquals( ClientManager.CalledWarmup.SESSION_WARMUP, mClientManager.getWarmupState(mSession)); } @@ -211,20 +241,41 @@ @SmallTest public void testValidSessionWarmupSeveralCalls() { mClientManager.recordUidHasCalledWarmup(mUid); - mClientManager.newSession(mSession, mUid, null, null, null, null); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler); Assert.assertEquals( ClientManager.CalledWarmup.SESSION_WARMUP, mClientManager.getWarmupState(mSession)); - CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); - mClientManager.newSession(token, mUid, null, null, null, null); + SessionHolder<?> sessionHolder = + new SessionHolder<>(CustomTabsSessionToken.createMockSessionTokenForTesting()); + mClientManager.newSession( + sessionHolder, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler); Assert.assertEquals( - ClientManager.CalledWarmup.SESSION_WARMUP, mClientManager.getWarmupState(token)); + ClientManager.CalledWarmup.SESSION_WARMUP, + mClientManager.getWarmupState(sessionHolder)); } @Test @SmallTest public void testPredictionOutcomeSuccess() { - Assert.assertTrue(mClientManager.newSession(mSession, mUid, null, null, null, null)); + Assert.assertTrue( + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); Assert.assertTrue( mClientManager.updateStatsAndReturnWhetherAllowed(mSession, mUid, URL, false)); Assert.assertEquals( @@ -235,7 +286,14 @@ @Test @SmallTest public void testPredictionOutcomeNoPrediction() { - Assert.assertTrue(mClientManager.newSession(mSession, mUid, null, null, null, null)); + Assert.assertTrue( + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.recordUidHasCalledWarmup(mUid); Assert.assertEquals( ClientManager.PredictionStatus.NONE, @@ -245,7 +303,14 @@ @Test @SmallTest public void testPredictionOutcomeBadPrediction() { - Assert.assertTrue(mClientManager.newSession(mSession, mUid, null, null, null, null)); + Assert.assertTrue( + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); Assert.assertTrue( mClientManager.updateStatsAndReturnWhetherAllowed(mSession, mUid, URL, false)); Assert.assertEquals( @@ -256,7 +321,14 @@ @Test @SmallTest public void testPredictionOutcomeIgnoreFragment() { - Assert.assertTrue(mClientManager.newSession(mSession, mUid, null, null, null, null)); + Assert.assertTrue( + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); Assert.assertTrue( mClientManager.updateStatsAndReturnWhetherAllowed(mSession, mUid, URL, false)); mClientManager.setIgnoreFragmentsForSession(mSession, true); @@ -273,7 +345,7 @@ // TODO(peconn): Get rid of this anonymous class once PostMessageServiceConnection is made // non-abstract. Same with the other occurrences below. PostMessageServiceConnection serviceConnection = - new PostMessageServiceConnection(mSession) {}; + new PostMessageServiceConnection(mSession.getSessionAsCustomTab()) {}; Assert.assertTrue( cm.newSession( mSession, @@ -281,7 +353,7 @@ null, MockPostMessageHandler.create(), serviceConnection, - null)); + mEngagementSignalsHandler)); // Should always start with no origin. Assert.assertNull(cm.getPostMessageOriginForSessionForTesting(mSession)); @@ -314,7 +386,7 @@ public void testPostMessageOriginDifferentRelations() { final ClientManager cm = mClientManager; PostMessageServiceConnection serviceConnection = - new PostMessageServiceConnection(mSession) {}; + new PostMessageServiceConnection(mSession.getSessionAsCustomTab()) {}; Assert.assertTrue( cm.newSession( mSession, @@ -322,7 +394,7 @@ null, MockPostMessageHandler.create(), serviceConnection, - null)); + mEngagementSignalsHandler)); Origin origin = Origin.create(URL); when(mInstalledAppProviderWrapper.isAppInstalledAndAssociatedWithOrigin(any(), eq(origin))) @@ -357,7 +429,14 @@ @Test @SmallTest public void testFirstLowConfidencePredictionIsNotThrottled() { - Assert.assertTrue(mClientManager.newSession(mSession, mUid, null, null, null, null)); + Assert.assertTrue( + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); // Two low confidence in a row is OK. Assert.assertTrue( @@ -387,7 +466,14 @@ @SmallTest public void testMayLaunchUrlAccounting() { String name = "CustomTabs.MayLaunchUrlType"; - Assert.assertTrue(mClientManager.newSession(mSession, mUid, null, null, null, null)); + Assert.assertTrue( + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); // No prediction; mClientManager.registerLaunch(mSession, URL); @@ -446,7 +532,7 @@ final ClientManager cm = mClientManager; PostMessageServiceConnection serviceConnection = - new PostMessageServiceConnection(mSession) {}; + new PostMessageServiceConnection(mSession.getSessionAsCustomTab()) {}; Assert.assertTrue( cm.newSession( mSession, @@ -454,7 +540,7 @@ null, MockPostMessageHandler.create(), serviceConnection, - null)); + mEngagementSignalsHandler)); // Should always start with no origin. Assert.assertNull(cm.getPostMessageOriginForSessionForTesting(mSession)); Assert.assertNull(cm.getPostMessageTargetOriginForSessionForTesting(mSession)); @@ -486,7 +572,13 @@ Assert.assertTrue( "A new session should have been created.", - mClientManager.newSession(mSession, mUid, null, null, null, null)); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.setCustomTabIsInForeground(mSession, true); mClientManager.dontKeepAliveForSession(mSession); @@ -513,7 +605,13 @@ Assert.assertTrue( "A new session should have been created.", - mClientManager.newSession(mSession, mUid, null, null, null, null)); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.setCustomTabIsInForeground(mSession, true); mClientManager.keepAliveForSession(mSession, intent); @@ -535,7 +633,13 @@ Assert.assertTrue( "A new session should have been created.", - mClientManager.newSession(mSession, mUid, null, null, null, null)); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.setCustomTabIsInForeground(mSession, false); mClientManager.dontKeepAliveForSession(mSession); @@ -562,7 +666,13 @@ Assert.assertTrue( "A new session should have been created.", - mClientManager.newSession(mSession, mUid, null, null, null, null)); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.setCustomTabIsInForeground(mSession, false); mClientManager.keepAliveForSession(mSession, intent); @@ -584,7 +694,13 @@ Assert.assertTrue( "A new session should have been created.", - mClientManager.newSession(mSession, mUid, null, null, null, null)); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.setCustomTabIsInForeground(mSession, true); mClientManager.dontKeepAliveForSession(mSession); @@ -612,7 +728,13 @@ Assert.assertTrue( "A new session should have been created.", - mClientManager.newSession(mSession, mUid, null, null, null, null)); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.setCustomTabIsInForeground(mSession, true); mClientManager.keepAliveForSession(mSession, intent); @@ -634,7 +756,13 @@ Assert.assertTrue( "A new session should have been created.", - mClientManager.newSession(mSession, mUid, null, null, null, null)); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.setCustomTabIsInForeground(mSession, false); mClientManager.dontKeepAliveForSession(mSession); @@ -662,7 +790,13 @@ Assert.assertTrue( "A new session should have been created.", - mClientManager.newSession(mSession, mUid, null, null, null, null)); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.setCustomTabIsInForeground(mSession, false); mClientManager.keepAliveForSession(mSession, intent); @@ -684,7 +818,13 @@ Assert.assertTrue( "A new session should have been created.", - mClientManager.newSession(mSession, mUid, null, null, null, null)); + mClientManager.newSession( + mSession, + mUid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + mEngagementSignalsHandler)); mClientManager.setCustomTabIsInForeground(mSession, true); mClientManager.dontKeepAliveForSession(mSession);
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabNavigationEventObserverUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabNavigationEventObserverUnitTest.java index 9d3d6428..36988ce 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabNavigationEventObserverUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabNavigationEventObserverUnitTest.java
@@ -11,7 +11,6 @@ import static org.mockito.Mockito.verify; import androidx.browser.customtabs.CustomTabsCallback; -import androidx.browser.customtabs.CustomTabsSessionToken; import org.junit.Before; import org.junit.Test; @@ -24,6 +23,7 @@ import org.chromium.base.test.util.Features.DisableFeatures; import org.chromium.base.test.util.Features.EnableFeatures; import org.chromium.base.test.util.HistogramWatcher; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.net.NetError; @@ -34,7 +34,7 @@ @Batch(Batch.UNIT_TESTS) public class CustomTabNavigationEventObserverUnitTest { @Mock private CustomTabsConnection mConnection; - @Mock private CustomTabsSessionToken mToken; + @Mock private SessionHolder<?> mSessionHolder; @Before public void setup() { @@ -46,7 +46,7 @@ @EnableFeatures(ChromeFeatureList.CCT_REPORT_PRERENDER_EVENTS) public void histogramAndfilteredErrorCodes() { CustomTabNavigationEventObserver observer = - new CustomTabNavigationEventObserver(mToken, /* forPrerender= */ false); + new CustomTabNavigationEventObserver(mSessionHolder, /* forPrerender= */ false); // Only these 3 error codes are passed to callback. int err = NetError.ERR_INTERNET_DISCONNECTED; var histogramWatcher = buildHistogramWatcher(err); @@ -80,7 +80,7 @@ @DisableFeatures(ChromeFeatureList.CCT_REPORT_PRERENDER_EVENTS) public void navigationEventsSentWhenUsed() { CustomTabNavigationEventObserver observer = - new CustomTabNavigationEventObserver(mToken, /* forPrerender= */ true); + new CustomTabNavigationEventObserver(mSessionHolder, /* forPrerender= */ true); observer.onPageLoadStarted(null, null); verify(mConnection, never()) .notifyNavigationEvent(any(), eq(CustomTabsCallback.NAVIGATION_STARTED));
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionUnitTest.java index cd12f49..06da01c 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionUnitTest.java
@@ -14,7 +14,9 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.refEq; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.robolectric.Shadows.shadowOf; @@ -32,6 +34,7 @@ import androidx.browser.customtabs.CustomTabsCallback; import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.browser.customtabs.EngagementSignalsCallback; +import androidx.browser.customtabs.PostMessageServiceConnection; import org.junit.After; import org.junit.Before; @@ -53,8 +56,10 @@ import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Features.DisableFeatures; import org.chromium.base.test.util.Features.EnableFeatures; +import org.chromium.chrome.browser.browserservices.PostMessageHandler; import org.chromium.chrome.browser.browserservices.SessionDataHolder; import org.chromium.chrome.browser.browserservices.SessionHandler; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.customtabs.content.EngagementSignalsHandler; import org.chromium.chrome.browser.firstrun.FirstRunStatus; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -69,13 +74,17 @@ public class CustomTabsConnectionUnitTest { @Mock private SessionHandler mSessionHandler; - @Mock private CustomTabsSessionToken mSession; + @Mock private CustomTabsCallback mCallback; @Mock private PrivacyPreferencesManagerImpl mPrivacyPreferencesManager; @Mock private EngagementSignalsCallback mEngagementSignalsCallback; @Mock private Tab mTab; private CustomTabsConnection mConnection; + private SessionHolder<?> mSessionHolder; + private CustomTabsSessionToken mSession; + private PostMessageServiceConnection mPostMessageServiceConnection; + private PostMessageHandler mPostMessageHandler; @Implements(UmaSessionStats.class) public static class ShadowUmaSessionStats { @@ -104,10 +113,14 @@ CustomTabsConnection.setInstanceForTesting(null); mConnection = CustomTabsConnection.getInstance(); mConnection.setIsDynamicFeaturesEnabled(true); + mSession = spy(CustomTabsSessionToken.createMockSessionTokenForTesting()); + mSessionHolder = new SessionHolder<>(mSession); when(mSession.getCallback()).thenReturn(mCallback); - when(mSessionHandler.getSession()).thenReturn(mSession); + doReturn(mSessionHolder).when(mSessionHandler).getSession(); SessionDataHolder.getInstance().setActiveHandler(mSessionHandler); PrivacyPreferencesManagerImpl.setInstanceForTesting(mPrivacyPreferencesManager); + mPostMessageServiceConnection = new PostMessageServiceConnection(mSession) {}; + mPostMessageHandler = new PostMessageHandler(mPostMessageServiceConnection); } @After @@ -146,7 +159,7 @@ initSession(); mConnection.onActivityLayout( - mSession, left, top, right, bottom, ACTIVITY_LAYOUT_STATE_BOTTOM_SHEET); + mSessionHolder, left, top, right, bottom, ACTIVITY_LAYOUT_STATE_BOTTOM_SHEET); verify(mCallback).extraCallback(eq(ON_ACTIVITY_LAYOUT_CALLBACK), refEq(bundle)); } @@ -180,7 +193,7 @@ mSession, mEngagementSignalsCallback, Bundle.EMPTY)); assertEquals( mEngagementSignalsCallback, - mConnection.mClientManager.getEngagementSignalsCallbackForSession(mSession)); + mConnection.mClientManager.getEngagementSignalsCallbackForSession(mSessionHolder)); } @Test @@ -190,20 +203,21 @@ assertFalse( mConnection.setEngagementSignalsCallback( mSession, mEngagementSignalsCallback, Bundle.EMPTY)); - assertNull(mConnection.mClientManager.getEngagementSignalsCallbackForSession(mSession)); + assertNull( + mConnection.mClientManager.getEngagementSignalsCallbackForSession(mSessionHolder)); } @Test public void testOnMinimized() { initSession(); - mConnection.onMinimized(mSession); + mConnection.onMinimized(mSessionHolder); verify(mCallback).onMinimized(any(Bundle.class)); } @Test public void testOnUnminimized() { initSession(); - mConnection.onUnminimized(mSession); + mConnection.onUnminimized(mSessionHolder); verify(mCallback).onUnminimized(any(Bundle.class)); } @@ -213,7 +227,13 @@ shadowOf(RuntimeEnvironment.getApplication().getApplicationContext().getPackageManager()) .setPackagesForUid(uid, "test.package.name"); var handler = new EngagementSignalsHandler(mSession); - mConnection.mClientManager.newSession(mSession, uid, null, null, null, handler); + mConnection.mClientManager.newSession( + mSessionHolder, + uid, + null, + mPostMessageHandler, + mPostMessageServiceConnection, + handler); } @Test @@ -273,7 +293,7 @@ public void notifyOpenInBrowser() { initSession(); - mConnection.notifyOpenInBrowser(mSession, mTab); + mConnection.notifyOpenInBrowser(mSessionHolder, mTab); verify(mCallback) .extraCallback(
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityContentTestEnvironment.java b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityContentTestEnvironment.java index 490460bf..2821d31 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityContentTestEnvironment.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityContentTestEnvironment.java
@@ -35,6 +35,7 @@ import org.chromium.chrome.browser.app.tabmodel.AsyncTabParamsManagerSingleton; import org.chromium.chrome.browser.app.tabmodel.CustomTabsTabModelOrchestrator; import org.chromium.chrome.browser.browserservices.intents.ColorProvider; +import org.chromium.chrome.browser.browserservices.intents.SessionHolder; import org.chromium.chrome.browser.compositor.CompositorViewHolder; import org.chromium.chrome.browser.crypto.CipherFactory; import org.chromium.chrome.browser.customtabs.BaseCustomTabActivity; @@ -87,7 +88,7 @@ @Mock public CustomTabObserver customTabObserver; @Mock public ActivityTabProvider activityTabProvider; @Mock public ActivityLifecycleDispatcher lifecycleDispatcher; - @Mock public CustomTabsSessionToken session; + @Mock public SessionHolder<CustomTabsSessionToken> session; @Mock public TabModelSelectorImpl tabModelSelector; @Mock public TabModel tabModel; @Mock public ReparentingTask reparentingTask;
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/content/RealtimeEngagementSignalObserverUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/content/RealtimeEngagementSignalObserverUnitTest.java index 463f4a1..ff715ec7 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/content/RealtimeEngagementSignalObserverUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/content/RealtimeEngagementSignalObserverUnitTest.java
@@ -928,7 +928,7 @@ mEngagementSignalObserver = new RealtimeEngagementSignalObserver( env.tabObserverRegistrar, - env.session, + env.session.getSessionAsCustomTab(), mEngagementSignalsCallback, hadScrollDown); verify(env.tabObserverRegistrar).registerActivityTabObserver(mEngagementSignalObserver);
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/display_cutout/DisplayCutoutControllerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/display_cutout/DisplayCutoutControllerTest.java index 877e75d8..ed5892a 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/display_cutout/DisplayCutoutControllerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/display_cutout/DisplayCutoutControllerTest.java
@@ -304,6 +304,22 @@ } @Test + public void testSafeAreaConstraint() { + mDisplayCutoutTabHelper.setSafeAreaConstraint(true); + DisplayCutoutController.SafeAreaInsetsTracker tracker = + DisplayCutoutController.getSafeAreaInsetsTracker(mTab); + Assert.assertNotNull(tracker); + Assert.assertTrue( + "SafeAreaConstrain did not pass through to the safe area insets tracker.", + tracker.hasSafeAreaConstraint()); + + mDisplayCutoutTabHelper.setSafeAreaConstraint(false); + Assert.assertFalse( + "SafeAreaConstrain did not pass through to the safe area insets tracker.", + tracker.hasSafeAreaConstraint()); + } + + @Test public void testObserverUpdateOnContentChange() { // First, make sure observer is attached at the beginning. verify(mWebContents, atLeastOnce()).addObserver(mWebContentObserverCaptor.capture());
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index 3eb5c8dd4..f1fae91 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -1333,55 +1333,13 @@ <message name="IDS_LOGIN_SYNC_CONSENT_SCREEN_DECLINE2" desc="Alternate label on the button that closes the dialog while not agreeing to sync."> No thanks </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_TITLE" desc="Title of the screen that explains Chrome Sync and privacy options."> - Back up and restore your apps and settings - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SUBTITLE" desc="Subtitle of the dialog that explains Chrome Sync and privacy options."> - Turn on device sync to restore your apps, settings, Wi-Fi networks, and wallpaper from your previous Chromebook. Make changes anytime in Settings > Accounts. - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_ADDITIONAL_SUBTITLE" desc="Additional subtitle of the dialog that explains Chrome Sync and privacy options."> - New to Chromebook? Turn on sync so your preferences will be backed up. - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SYNC_OPTIONS" desc="The label on the button that displays the manage sync option screen."> - Manage sync options - </message> <!-- Strings for OS sync consent screen options --> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_TITLE" desc="Title of the os sync screen option Apps."> - Apps - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_SUBTITLE" desc="Subtitle of the os sync screen option Apps."> - Apps installed from the Play Store and web apps from Chrome browser - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_TITLE" desc="Title of the os sync screen option Settings."> - Settings - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_SUBTITLE" desc="Subtitle of the os sync screen option Settings."> - Keyboard and mouse behavior, language preferences, and more - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_TITLE" desc="Title of the os sync screen option Wifi networks."> - Wi-Fi networks - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_SUBTITLE" desc="Subtitle of the os sync screen option Wifi networks."> - Saved networks and passwords so you can connect instantly - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_TITLE" desc="Title of the os sync screen option Wallpaper."> - Wallpaper - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_SUBTITLE" desc="Subtitle of the os sync screen option Wallpaper."> - Remember your desktop background across devices - </message> <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_TOOLTIP_TEXT" desc="Text of the disclaimer to the toggle of the Apps item in sync screen option." > Once turned on, your apps will be available on any ChromeOS devices after you sign in with your Google Account. Web apps installed from Chrome browser will be synced even if browser sync is turned off. </message> <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_TOOLTIP_ADDITIONAL_TEXT" desc="Additional text of the disclaimer to the toggle of the Apps item in sync screen option."> If you also chose to send diagnostic and usage data in the previous step, this data will be collected for installed apps. </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_TITLE" desc="Title of the screen that displays sync options and allows user to control them."> - Manage sync options - </message> - <message name="IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_SUBTITLE" desc="Subtitle of the dialog that displays sync options and allows user to control them."> - Selected items will be available on this Chromebook. If you're new to Chromebook, sync all items so your preferences will be backed up. Make changes anytime in Settings > Accounts. - </message> <!-- Strings for categories selection screen--> <message name="IDS_LOGIN_CATEGORIES_SCREEN_LOADING" desc="Message shown while the categories are being fetched for the server."> Please wait...
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_ADDITIONAL_SUBTITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_ADDITIONAL_SUBTITLE.png.sha1 deleted file mode 100644 index a9c34ad..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_ADDITIONAL_SUBTITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -3f4f4b6efce363858a7422c36dd53dbb8a123983 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_SUBTITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_SUBTITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_SUBTITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_TITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_TITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_SUBTITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_SUBTITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_SUBTITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_TITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_TITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_SUBTITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_SUBTITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_SUBTITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_TITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_TITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_SUBTITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_SUBTITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_SUBTITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_TITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_TITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_SUBTITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_SUBTITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_SUBTITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_TITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_TITLE.png.sha1 deleted file mode 100644 index 06136031..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -7a1cab106ed582c3950a83600c5fd701c4e49a69 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SUBTITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SUBTITLE.png.sha1 deleted file mode 100644 index a9c34ad..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SUBTITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -3f4f4b6efce363858a7422c36dd53dbb8a123983 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SYNC_OPTIONS.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SYNC_OPTIONS.png.sha1 deleted file mode 100644 index a9c34ad..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SYNC_OPTIONS.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -3f4f4b6efce363858a7422c36dd53dbb8a123983 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_TITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_TITLE.png.sha1 deleted file mode 100644 index a9c34ad..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -3f4f4b6efce363858a7422c36dd53dbb8a123983 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings.grdp b/chrome/app/os_settings_strings.grdp index 2741d45..92fe7cb6 100644 --- a/chrome/app/os_settings_strings.grdp +++ b/chrome/app/os_settings_strings.grdp
@@ -2901,7 +2901,7 @@ <message name="IDS_SETTINGS_CROSTINI_LABEL" desc="The text associated with the primary section setting. This contains settings for a Linux container running in a virtual machine for use by software developers."> Linux development environment </message> - <message name="IDS_OS_SETTINGS_REVAMP_CROSTINI_SET_UP" desc="The label for the button that, when clicked, opens the Crostini setup flow."> + <message name="IDS_OS_SETTINGS_CROSTINI_SET_UP" desc="The label for the button that, when clicked, opens the Crostini setup flow."> Set up </message> <message name="IDS_SETTINGS_CROSTINI_SHARED_PATHS_INSTRUCTIONS_LOCATE" desc="Instructions for how to locate shared folders in Crostini."> @@ -3165,7 +3165,7 @@ <message name="IDS_SETTINGS_CROSTINI_ARC_ADB_CONFIRMATION_MESSAGE_DISABLE" desc="Describes what will happen if the user disables ADB Sideloading."> Disabling ADB debugging will reset this <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> to factory settings. All user accounts and local data will be erased. </message> - <message name="IDS_OS_SETTINGS_REVAMP_CROSTINI_SUBTEXT" desc="Description for the section for enabling and managing Crostini."> + <message name="IDS_OS_SETTINGS_CROSTINI_SUBTEXT" desc="Description for the section for enabling and managing Crostini."> Run developer tools, IDEs, and editors. <ph name="LINK_BEGIN"><a target="_blank" href="$1<ex>https://google.com/</ex>"></ph>Learn more<ph name="LINK_END"></a></ph> </message> <message name="IDS_SETTINGS_CROSTINI_SUBTEXT_NOT_SUPPORTED" desc="Description for the Developers section when crostini is not supported due to hardware limitation or account restrictions.">
diff --git a/chrome/app/os_settings_strings_grdp/IDS_OS_SETTINGS_REVAMP_CROSTINI_SET_UP.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_OS_SETTINGS_CROSTINI_SET_UP.png.sha1 similarity index 100% rename from chrome/app/os_settings_strings_grdp/IDS_OS_SETTINGS_REVAMP_CROSTINI_SET_UP.png.sha1 rename to chrome/app/os_settings_strings_grdp/IDS_OS_SETTINGS_CROSTINI_SET_UP.png.sha1
diff --git a/chrome/app/os_settings_strings_grdp/IDS_OS_SETTINGS_REVAMP_CROSTINI_SUBTEXT.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_OS_SETTINGS_CROSTINI_SUBTEXT.png.sha1 similarity index 100% rename from chrome/app/os_settings_strings_grdp/IDS_OS_SETTINGS_REVAMP_CROSTINI_SUBTEXT.png.sha1 rename to chrome/app/os_settings_strings_grdp/IDS_OS_SETTINGS_CROSTINI_SUBTEXT.png.sha1
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index f76de44..b9193ec0 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -5610,6 +5610,10 @@ {"edge-to-edge-everywhere", flag_descriptions::kEdgeToEdgeEverywhereName, flag_descriptions::kEdgeToEdgeEverywhereDescription, kOsAndroid, FEATURE_VALUE_TYPE(chrome::android::kEdgeToEdgeEverywhere)}, + {"edge-to-edge-safe-area-constraint", + flag_descriptions::kEdgeToEdgeSafeAreaConstraintName, + flag_descriptions::kEdgeToEdgeSafeAreaConstraintDescription, kOsAndroid, + FEATURE_VALUE_TYPE(chrome::android::kEdgeToEdgeSafeAreaConstraint)}, {"edge-to-edge-web-opt-in", flag_descriptions::kEdgeToEdgeWebOptInName, flag_descriptions::kEdgeToEdgeWebOptInDescription, kOsAndroid, FEATURE_VALUE_TYPE(chrome::android::kEdgeToEdgeWebOptIn)},
diff --git a/chrome/browser/accessibility/accessibility_extension_api_ash.cc b/chrome/browser/accessibility/accessibility_extension_api_ash.cc index c99ad68e..2f9ad93 100644 --- a/chrome/browser/accessibility/accessibility_extension_api_ash.cc +++ b/chrome/browser/accessibility/accessibility_extension_api_ash.cc
@@ -28,9 +28,6 @@ #include "chrome/browser/ash/accessibility/accessibility_manager.h" #include "chrome/browser/ash/accessibility/magnification_manager.h" #include "chrome/browser/ash/arc/accessibility/arc_accessibility_helper_bridge.h" -#include "chrome/browser/ash/crosapi/crosapi_ash.h" -#include "chrome/browser/ash/crosapi/crosapi_manager.h" -#include "chrome/browser/ash/crosapi/embedded_accessibility_helper_client_ash.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_tab_util.h" @@ -39,7 +36,6 @@ #include "chrome/common/extensions/api/accessibility_private.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/webui_url_constants.h" -#include "chromeos/crosapi/cpp/lacros_startup_state.h" #include "components/infobars/content/content_infobar_manager.h" #include "components/infobars/core/confirm_infobar_delegate.h" #include "components/infobars/core/infobar.h" @@ -201,18 +197,6 @@ } // namespace ExtensionFunction::ResponseAction -AccessibilityPrivateClipboardCopyInActiveLacrosGoogleDocFunction::Run() { - EXTENSION_FUNCTION_VALIDATE(args().size() >= 1); - EXTENSION_FUNCTION_VALIDATE(args()[0].is_string()); - std::string url = args()[0].GetString(); - crosapi::CrosapiManager::Get() - ->crosapi_ash() - ->embedded_accessibility_helper_client_ash() - ->ClipboardCopyInActiveGoogleDoc(url); - return RespondNow(NoArguments()); -} - -ExtensionFunction::ResponseAction AccessibilityPrivateDarkenScreenFunction::Run() { EXTENSION_FUNCTION_VALIDATE(args().size() >= 1); EXTENSION_FUNCTION_VALIDATE(args()[0].is_bool()); @@ -1269,9 +1253,3 @@ actions_to_show); return RespondNow(NoArguments()); } - -ExtensionFunction::ResponseAction -AccessibilityPrivateIsLacrosPrimaryFunction::Run() { - return RespondNow( - WithArguments(crosapi::lacros_startup_state::IsLacrosEnabled())); -}
diff --git a/chrome/browser/accessibility/accessibility_extension_api_ash.h b/chrome/browser/accessibility/accessibility_extension_api_ash.h index 9d4a58a..f7576ef 100644 --- a/chrome/browser/accessibility/accessibility_extension_api_ash.h +++ b/chrome/browser/accessibility/accessibility_extension_api_ash.h
@@ -10,22 +10,9 @@ #include <optional> -#include "build/chromeos_buildflags.h" #include "chrome/common/extensions/api/accessibility_private.h" #include "extensions/browser/extension_function.h" -// API function that is called when the Select-to-Speak wants to perform a -// clipboard copy in a Lacros Google Doc. -class AccessibilityPrivateClipboardCopyInActiveLacrosGoogleDocFunction - : public ExtensionFunction { - ~AccessibilityPrivateClipboardCopyInActiveLacrosGoogleDocFunction() override = - default; - ResponseAction Run() override; - DECLARE_EXTENSION_FUNCTION( - "accessibilityPrivate.clipboardCopyInActiveLacrosGoogleDoc", - ACCESSIBILITY_PRIVATE_CLIPBOARDCOPYINACTIVELACROSGOOGLEDOC) -}; - // API function that darkens or undarkens the screen. class AccessibilityPrivateDarkenScreenFunction : public ExtensionFunction { ~AccessibilityPrivateDarkenScreenFunction() override = default; @@ -418,11 +405,4 @@ ACCESSIBILITY_PRIVATE_UPDATESWITCHACCESSBUBBLE) }; -class AccessibilityPrivateIsLacrosPrimaryFunction : public ExtensionFunction { - ~AccessibilityPrivateIsLacrosPrimaryFunction() override = default; - ResponseAction Run() override; - DECLARE_EXTENSION_FUNCTION("accessibilityPrivate.isLacrosPrimary", - ACCESSIBILITY_PRIVATE_ISLACROSPRIMARY) -}; - #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_ASH_H_
diff --git a/chrome/browser/android/browserservices/intents/BUILD.gn b/chrome/browser/android/browserservices/intents/BUILD.gn index 21cefa4..869d1c1 100644 --- a/chrome/browser/android/browserservices/intents/BUILD.gn +++ b/chrome/browser/android/browserservices/intents/BUILD.gn
@@ -7,10 +7,12 @@ android_library("java") { sources = [ "java/src/org/chromium/chrome/browser/browserservices/intents/BitmapHelper.java", + "java/src/org/chromium/chrome/browser/browserservices/intents/BrowserCallbackWrapper.java", "java/src/org/chromium/chrome/browser/browserservices/intents/BrowserServicesIntentDataProvider.java", "java/src/org/chromium/chrome/browser/browserservices/intents/ColorProvider.java", "java/src/org/chromium/chrome/browser/browserservices/intents/CustomButtonParams.java", "java/src/org/chromium/chrome/browser/browserservices/intents/MergedWebappInfo.java", + "java/src/org/chromium/chrome/browser/browserservices/intents/SessionHolder.java", "java/src/org/chromium/chrome/browser/browserservices/intents/WebApkExtras.java", "java/src/org/chromium/chrome/browser/browserservices/intents/WebApkShareTarget.java", "java/src/org/chromium/chrome/browser/browserservices/intents/WebappConstants.java", @@ -30,6 +32,7 @@ "//content/public/android:content_main_dex_java", "//net/android:net_java", "//services/device/public/mojom:mojom_java", + "//third_party/androidx:androidx_annotation_annotation_experimental_java", "//third_party/androidx:androidx_annotation_annotation_java", "//third_party/androidx:androidx_browser_browser_java", "//third_party/blink/public/mojom:mojom_platform_java",
diff --git a/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/BrowserCallbackWrapper.java b/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/BrowserCallbackWrapper.java new file mode 100644 index 0000000..372b6b8c --- /dev/null +++ b/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/BrowserCallbackWrapper.java
@@ -0,0 +1,119 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.browserservices.intents; + +import android.net.Uri; +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.OptIn; +import androidx.browser.auth.AuthTabCallback; +import androidx.browser.auth.AuthTabSessionToken; +import androidx.browser.auth.ExperimentalAuthTab; +import androidx.browser.customtabs.CustomTabsCallback; +import androidx.browser.customtabs.CustomTabsSessionToken; +import androidx.browser.customtabs.ExperimentalMinimizationCallback; + +/** Class that holds either a {@link CustomTabsSessionToken} or {@link AuthTabSessionToken}. */ +@OptIn(markerClass = {ExperimentalAuthTab.class, ExperimentalMinimizationCallback.class}) +public class BrowserCallbackWrapper { + private final CustomTabsCallback mCustomTabsCallback; + private final AuthTabCallback mAuthTabCallback; + + public BrowserCallbackWrapper(@NonNull CustomTabsCallback callback) { + mCustomTabsCallback = callback; + mAuthTabCallback = null; + } + + public BrowserCallbackWrapper(@NonNull AuthTabCallback callback) { + mAuthTabCallback = callback; + mCustomTabsCallback = null; + } + + public void onNavigationEvent(int navigationEvent, @Nullable Bundle extras) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.onNavigationEvent(navigationEvent, extras); + } else { + assert mAuthTabCallback != null; + mAuthTabCallback.onNavigationEvent( + navigationEvent, extras != null ? extras : Bundle.EMPTY); + } + } + + public void extraCallback(@NonNull String callbackName, @Nullable Bundle args) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.extraCallback(callbackName, args); + } else { + assert mAuthTabCallback != null; + mAuthTabCallback.onExtraCallback(callbackName, args != null ? args : Bundle.EMPTY); + } + } + + @Nullable + public Bundle extraCallbackWithResult(@NonNull String callbackName, @Nullable Bundle args) { + if (mCustomTabsCallback != null) { + return mCustomTabsCallback.extraCallbackWithResult(callbackName, args); + } else { + assert mAuthTabCallback != null; + return mAuthTabCallback.onExtraCallbackWithResult( + callbackName, args != null ? args : Bundle.EMPTY); + } + } + + public void onMessageChannelReady(@Nullable Bundle extras) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.onMessageChannelReady(extras); + } + } + + public void onPostMessage(@NonNull String message, @Nullable Bundle extras) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.onPostMessage(message, extras); + } + } + + public void onRelationshipValidationResult( + int relation, @NonNull Uri requestedOrigin, boolean result, @Nullable Bundle extras) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.onRelationshipValidationResult( + relation, requestedOrigin, result, extras); + } + } + + public void onActivityResized(int height, int width, @NonNull Bundle extras) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.onActivityResized(height, width, extras); + } + } + + public void onWarmupCompleted(@NonNull Bundle extras) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.onWarmupCompleted(extras); + } else { + assert mAuthTabCallback != null; + mAuthTabCallback.onWarmupCompleted(extras); + } + } + + public void onActivityLayout( + int left, int top, int right, int bottom, int state, @NonNull Bundle extras) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.onActivityLayout(left, top, right, bottom, state, extras); + } + } + + public void onMinimized(@NonNull Bundle extras) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.onMinimized(extras); + } + } + + public void onUnminimized(@NonNull Bundle extras) { + if (mCustomTabsCallback != null) { + mCustomTabsCallback.onUnminimized(extras); + } + } +}
diff --git a/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/BrowserServicesIntentDataProvider.java b/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/BrowserServicesIntentDataProvider.java index bb82fe48..0283e90 100644 --- a/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/BrowserServicesIntentDataProvider.java +++ b/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/BrowserServicesIntentDataProvider.java
@@ -21,7 +21,6 @@ import androidx.annotation.Px; import androidx.browser.customtabs.CustomTabsIntent; import androidx.browser.customtabs.CustomTabsIntent.CloseButtonPosition; -import androidx.browser.customtabs.CustomTabsSessionToken; import androidx.browser.trusted.TrustedWebActivityDisplayMode; import androidx.browser.trusted.sharing.ShareData; import androidx.browser.trusted.sharing.ShareTarget; @@ -127,7 +126,7 @@ /** * @return The session specified in the intent, or null. */ - public @Nullable CustomTabsSessionToken getSession() { + public @Nullable SessionHolder<?> getSession() { return null; }
diff --git a/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/SessionHolder.java b/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/SessionHolder.java new file mode 100644 index 0000000..b131812b --- /dev/null +++ b/chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/SessionHolder.java
@@ -0,0 +1,102 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.browserservices.intents; + +import android.content.Intent; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.OptIn; +import androidx.browser.auth.AuthTabIntent; +import androidx.browser.auth.AuthTabSessionToken; +import androidx.browser.auth.ExperimentalAuthTab; +import androidx.browser.customtabs.CustomTabsSessionToken; + +import org.chromium.base.IntentUtils; + +/** + * Class that holds either a {@link CustomTabsSessionToken} or {@link AuthTabSessionToken}. + * + * @param <T> The type of the session; either {@link CustomTabsSessionToken} or {@link + * AuthTabSessionToken}. + */ +@OptIn(markerClass = ExperimentalAuthTab.class) +public class SessionHolder<T> { + @NonNull private final T mSession; + + public SessionHolder(@NonNull T session) { + mSession = session; + assert isCustomTab() || isAuthTab(); + } + + @Nullable + public static SessionHolder<?> getSessionHolderFromIntent(Intent intent) { + boolean isAuthTab = + IntentUtils.safeGetBooleanExtra(intent, AuthTabIntent.EXTRA_LAUNCH_AUTH_TAB, false); + if (isAuthTab) { + AuthTabSessionToken token = AuthTabSessionToken.getSessionTokenFromIntent(intent); + if (token != null) { + return new SessionHolder<>(token); + } + } else { + CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + if (token != null) { + return new SessionHolder<>(token); + } + } + return null; + } + + /** Returns the session held by this object. */ + @NonNull + public T getSession() { + return mSession; + } + + /** Returns the session as a {@link CustomTabsSessionToken}. */ + @NonNull + public CustomTabsSessionToken getSessionAsCustomTab() { + return (CustomTabsSessionToken) mSession; + } + + /** Returns the session as an {@link AuthTabSessionToken}. */ + @NonNull + public AuthTabSessionToken getSessionAsAuthTab() { + return (AuthTabSessionToken) mSession; + } + + /** Whether the session has an id. */ + public boolean hasId() { + if (mSession instanceof AuthTabSessionToken session) { + return session.hasId(); + } else if (mSession instanceof CustomTabsSessionToken session) { + return session.hasId(); + } + return false; + } + + @Override + public int hashCode() { + return mSession.hashCode(); + } + + @Override + public boolean equals(@Nullable Object obj) { + if (obj instanceof SessionHolder<?> holder) { + return mSession.equals(holder.mSession); + } + return false; + } + + /** Returns whether the session is a {@link CustomTabsSessionToken}. */ + public boolean isCustomTab() { + return mSession instanceof CustomTabsSessionToken; + } + + /** Returns whether the session is an {@link AuthTabSessionToken}. */ + public boolean isAuthTab() { + return mSession instanceof AuthTabSessionToken; + } +}
diff --git a/chrome/browser/ash/app_restore/full_restore_service.cc b/chrome/browser/ash/app_restore/full_restore_service.cc index 82531a0..dd9151b 100644 --- a/chrome/browser/ash/app_restore/full_restore_service.cc +++ b/chrome/browser/ash/app_restore/full_restore_service.cc
@@ -613,15 +613,17 @@ return; } - if (base::CommandLine::ForCurrentProcess()->HasSwitch( + const bool last_session_crashed = + dialog_type == InformedRestoreContentsData::DialogType::kCrash; + + if (last_session_crashed && + base::CommandLine::ForCurrentProcess()->HasSwitch( kForceFullRestoreAndSessionRestoreAfterCrash)) { LOG(WARNING) << "Full session restore was forced by a debug flag."; Restore(); return; } - const bool last_session_crashed = - dialog_type == InformedRestoreContentsData::DialogType::kCrash; const std::string id = last_session_crashed ? kRestoreForCrashNotificationId : kRestoreNotificationId; if (!app_launch_handler_->HasRestoreData()) {
diff --git a/chrome/browser/ash/crosapi/browser_manager.cc b/chrome/browser/ash/crosapi/browser_manager.cc index 8f6f101..17267f89 100644 --- a/chrome/browser/ash/crosapi/browser_manager.cc +++ b/chrome/browser/ash/crosapi/browser_manager.cc
@@ -71,7 +71,6 @@ #include "chromeos/ash/components/browser_context_helper/browser_context_helper.h" #include "chromeos/ash/components/standalone_browser/channel_util.h" #include "chromeos/crosapi/cpp/crosapi_constants.h" -#include "chromeos/crosapi/cpp/lacros_startup_state.h" #include "chromeos/crosapi/mojom/crosapi.mojom-shared.h" #include "components/account_id/account_id.h" #include "components/component_updater/ash/component_manager_ash.h" @@ -152,7 +151,6 @@ // Ensure this isn't run multiple times. session_manager::SessionManager::Get()->RemoveObserver(this); - crosapi::lacros_startup_state::SetLacrosStartupState(false); SetState(State::UNAVAILABLE); ClearLacrosData(); }
diff --git a/chrome/browser/back_press/android/java/src/org/chromium/chrome/browser/back_press/BackPressManager.java b/chrome/browser/back_press/android/java/src/org/chromium/chrome/browser/back_press/BackPressManager.java index 43ea5c6..40bc04e 100644 --- a/chrome/browser/back_press/android/java/src/org/chromium/chrome/browser/back_press/BackPressManager.java +++ b/chrome/browser/back_press/android/java/src/org/chromium/chrome/browser/back_press/BackPressManager.java
@@ -46,13 +46,13 @@ // map.put(Type.VR_DELEGATE, 1); // map.put(Type.AR_DELEGATE, 2); map.put(Type.SCENE_OVERLAY, 3); - map.put(Type.START_SURFACE, 4); + // map.put(Type.START_SURFACE, 4); map.put(Type.SELECTION_POPUP, 5); map.put(Type.MANUAL_FILLING, 6); map.put(Type.FULLSCREEN, 7); map.put(Type.BOTTOM_SHEET, 8); map.put(Type.TAB_MODAL_HANDLER, 9); - map.put(Type.TAB_SWITCHER, 10); + // map.put(Type.TAB_SWITCHER, 10); map.put(Type.CLOSE_WATCHER, 11); map.put(Type.TAB_HISTORY, 12); // map.put(Type.TAB_RETURN_TO_CHROME_START_SURFACE, 13);
diff --git a/chrome/browser/data_sharing/android/java/src/org/chromium/chrome/browser/data_sharing/DataSharingTabManager.java b/chrome/browser/data_sharing/android/java/src/org/chromium/chrome/browser/data_sharing/DataSharingTabManager.java index a87bed4..0b9f8547 100644 --- a/chrome/browser/data_sharing/android/java/src/org/chromium/chrome/browser/data_sharing/DataSharingTabManager.java +++ b/chrome/browser/data_sharing/android/java/src/org/chromium/chrome/browser/data_sharing/DataSharingTabManager.java
@@ -55,7 +55,6 @@ import org.chromium.components.data_sharing.configs.DataSharingUiConfig; import org.chromium.components.tab_group_sync.LocalTabGroupId; import org.chromium.components.tab_group_sync.SavedTabGroup; -import org.chromium.components.tab_group_sync.SavedTabGroupTab; import org.chromium.components.tab_group_sync.TabGroupSyncService; import org.chromium.components.tab_group_sync.TabGroupUiActionHandler; import org.chromium.components.tab_group_sync.TriggerSource; @@ -469,17 +468,18 @@ mDataSharingService.getUiDelegate().updateRuntimeData(sessionId, runtimeConfig); } - private List<TabPreview> convertToTabsPreviewList( - List<SavedTabGroupTab> savedTabs, int maxTabs) { - int tabsCount = Math.min(maxTabs, savedTabs.size()); - List<TabPreview> preview = new ArrayList<>(); - for (int i = 0; i < tabsCount; ++i) { - // displayUrl field is not used in the create or manage UI where local tab group is - // available. - preview.add(new TabPreview(savedTabs.get(i).url, /* displayUrl= */ "")); - } - return preview; - } + // private List<TabPreview> convertToTabsPreviewList( + // List<SavedTabGroupTab> savedTabs, int maxTabs) { + // int tabsCount = Math.min(maxTabs, savedTabs.size()); + // List<TabPreview> preview = new ArrayList<>(); + // for (int i = 0; i < tabsCount; ++i) { + // // displayUrl field is not used in the create or manage UI where local tab group + // is + // // available. + // preview.add(new TabPreview(savedTabs.get(i).url, /* displayUrl= */ "")); + // } + // return preview; + // } private void showInvitationFailureDialog() { @Nullable ModalDialogManager modalDialogManager = mWindowAndroid.getModalDialogManager(); @@ -641,16 +641,16 @@ GroupToken tokenSecret, Callback<String> url) {} }; - String sessionId = - uiDelegate.showCreateFlow( - new DataSharingCreateUiConfig.Builder() - .setCommonConfig( - getCommonConfig( - activity, tabGroupDisplayName, stringConfig)) - .setCreateCallback(createCallback) - .build()); - fetchFavicons( - activity, sessionId, convertToTabsPreviewList(existingGroup.savedTabs, 4)); + // TODO (ritikagup@) : Uncomment this, after necessary changes are merged. + // String sessionId = + uiDelegate.showCreateFlow( + new DataSharingCreateUiConfig.Builder() + .setCommonConfig( + getCommonConfig(activity, tabGroupDisplayName, stringConfig)) + .setCreateCallback(createCallback) + .build()); + // fetchFavicons( + // activity, sessionId, convertToTabsPreviewList(existingGroup.savedTabs, 4)); return; }
diff --git a/chrome/browser/educational_tip/BUILD.gn b/chrome/browser/educational_tip/BUILD.gn index 9b28ca5..b247e626 100644 --- a/chrome/browser/educational_tip/BUILD.gn +++ b/chrome/browser/educational_tip/BUILD.gn
@@ -33,12 +33,15 @@ "//chrome/browser/magic_stack/android:java", "//chrome/browser/profiles/android:java", "//chrome/browser/segmentation_platform:factory_java", + "//chrome/browser/tab_group_sync:factory_java", + "//chrome/browser/tab_group_sync:features_java", "//chrome/browser/tab_ui/android:java", "//chrome/browser/tabmodel:java", "//chrome/browser/ui/android/default_browser_promo:java", "//components/browser_ui/bottomsheet/android:java", "//components/cached_flags:java", "//components/feature_engagement/public:public_java", + "//components/saved_tab_groups/public:java", "//components/segmentation_platform/public:public_java", "//third_party/androidx:androidx_annotation_annotation_java", "//third_party/androidx:androidx_annotation_annotation_java", @@ -94,11 +97,14 @@ "//chrome/browser/hub:java", "//chrome/browser/magic_stack/android:java", "//chrome/browser/profiles/android:java", + "//chrome/browser/tab_group_sync:factory_java", + "//chrome/browser/tab_group_sync:features_java", "//chrome/browser/tab_ui/android:java", "//chrome/browser/tabmodel:java", "//chrome/browser/ui/android/default_browser_promo:java", "//components/browser_ui/bottomsheet/android:java", "//components/feature_engagement/public:public_java", + "//components/saved_tab_groups/public:java", "//components/segmentation_platform/public:public_java", "//third_party/androidx:androidx_annotation_annotation_java", "//third_party/androidx:androidx_test_core_java",
diff --git a/chrome/browser/educational_tip/java/src/org/chromium/chrome/browser/educational_tip/EducationalTipCardProviderSignalHandler.java b/chrome/browser/educational_tip/java/src/org/chromium/chrome/browser/educational_tip/EducationalTipCardProviderSignalHandler.java index 2a01a39..66bb9e2 100644 --- a/chrome/browser/educational_tip/java/src/org/chromium/chrome/browser/educational_tip/EducationalTipCardProviderSignalHandler.java +++ b/chrome/browser/educational_tip/java/src/org/chromium/chrome/browser/educational_tip/EducationalTipCardProviderSignalHandler.java
@@ -4,9 +4,14 @@ package org.chromium.chrome.browser.educational_tip; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import org.chromium.chrome.browser.educational_tip.EducationalTipCardProvider.EducationalTipCardType; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncFeatures; +import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncServiceFactory; import org.chromium.chrome.browser.tabmodel.TabGroupModelFilter; import org.chromium.chrome.browser.tabmodel.TabGroupModelFilterProvider; import org.chromium.chrome.browser.tabmodel.TabModel; @@ -16,6 +21,7 @@ import org.chromium.components.feature_engagement.Tracker; import org.chromium.components.segmentation_platform.InputContext; import org.chromium.components.segmentation_platform.ProcessedValue; +import org.chromium.components.tab_group_sync.TabGroupSyncService; /** Provides information about the signals of cards in the educational tip module. */ public class EducationalTipCardProviderSignalHandler { @@ -24,6 +30,7 @@ static InputContext createInputContext( @EducationalTipCardType int cardType, EducationTipModuleActionDelegate actionDelegate, + @NonNull Profile profile, Tracker tracker) { InputContext inputContext = new InputContext(); switch (cardType) { @@ -46,6 +53,9 @@ ProcessedValue.fromFloat(getCurrentTabCount(actionDelegate))); return inputContext; case EducationalTipCardType.TAB_GROUP_SYNC: + inputContext.addEntry( + "synced_tab_group_exists", + ProcessedValue.fromFloat(syncedTabGroupExists(profile))); return inputContext; case EducationalTipCardType.QUICK_DELETE: return inputContext; @@ -102,4 +112,19 @@ TabModel incognitoModel = tabModelSelector.getModel(/* incognito= */ true); return normalModel.getCount() + incognitoModel.getCount(); } + + /** Returns a value of 1.0f if a synced tab group exists. Otherwise, it returns 0.0f. */ + private static float syncedTabGroupExists(Profile profile) { + @Nullable TabGroupSyncService tabGroupSyncService = null; + if (TabGroupSyncFeatures.isTabGroupSyncEnabled(profile)) { + tabGroupSyncService = TabGroupSyncServiceFactory.getForProfile(profile); + } + + if (tabGroupSyncService == null) { + return 0.0f; + } + + int syncedGroupCount = tabGroupSyncService.getAllGroupIds().length; + return syncedGroupCount > 0 ? 1.0f : 0.0f; + } }
diff --git a/chrome/browser/educational_tip/java/src/org/chromium/chrome/browser/educational_tip/EducationalTipModuleBuilder.java b/chrome/browser/educational_tip/java/src/org/chromium/chrome/browser/educational_tip/EducationalTipModuleBuilder.java index 244514e3..fa5a81f 100644 --- a/chrome/browser/educational_tip/java/src/org/chromium/chrome/browser/educational_tip/EducationalTipModuleBuilder.java +++ b/chrome/browser/educational_tip/java/src/org/chromium/chrome/browser/educational_tip/EducationalTipModuleBuilder.java
@@ -85,15 +85,14 @@ @Override public InputContext createInputContext() { int cardType = EducationalTipModuleUtils.getCardType(mModuleType); - Tracker tracker = - TrackerFactory.getTrackerForProfile( - getRegularProfile(mActionDelegate.getProfileSupplier())); + Profile profile = getRegularProfile(mActionDelegate.getProfileSupplier()); + Tracker tracker = TrackerFactory.getTrackerForProfile(profile); return EducationalTipCardProviderSignalHandler.createInputContext( - cardType, mActionDelegate, tracker); + cardType, mActionDelegate, profile, tracker); } /** Gets the regular profile if exists. */ - private Profile getRegularProfile(ObservableSupplier<Profile> profileSupplier) { + private Profile getRegularProfile(@NonNull ObservableSupplier<Profile> profileSupplier) { if (mProfile != null) { return mProfile; }
diff --git a/chrome/browser/educational_tip/junit/src/org/chromium/chrome/browser/educational_tip/EducationalTipCardProviderSignalHandlerUnitTest.java b/chrome/browser/educational_tip/junit/src/org/chromium/chrome/browser/educational_tip/EducationalTipCardProviderSignalHandlerUnitTest.java index ddc27b4..f3953318 100644 --- a/chrome/browser/educational_tip/junit/src/org/chromium/chrome/browser/educational_tip/EducationalTipCardProviderSignalHandlerUnitTest.java +++ b/chrome/browser/educational_tip/junit/src/org/chromium/chrome/browser/educational_tip/EducationalTipCardProviderSignalHandlerUnitTest.java
@@ -27,6 +27,10 @@ import org.chromium.chrome.browser.educational_tip.EducationalTipCardProvider.EducationalTipCardType; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncFeatures; +import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncFeaturesJni; +import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncServiceFactory; import org.chromium.chrome.browser.tabmodel.TabGroupModelFilter; import org.chromium.chrome.browser.tabmodel.TabGroupModelFilterProvider; import org.chromium.chrome.browser.tabmodel.TabModel; @@ -35,11 +39,14 @@ import org.chromium.components.feature_engagement.FeatureConstants; import org.chromium.components.feature_engagement.Tracker; import org.chromium.components.segmentation_platform.InputContext; +import org.chromium.components.tab_group_sync.TabGroupSyncService; /** Unit tests for {@link EducationalTipCardProviderSignalHandler}. */ @RunWith(BaseRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class EducationalTipCardProviderSignalHandlerUnitTest { + private static final String SYNC_ID = "sync_id"; + @Rule public MockitoRule mMockitoRule = MockitoJUnit.rule(); @Mock private EducationTipModuleActionDelegate mActionDelegate; @@ -51,6 +58,9 @@ @Mock private TabModel mNormalModel; @Mock private TabModel mIncognitoModel; @Mock private TabGroupModelFilterProvider mProvider; + @Mock private Profile mProfile; + @Mock private TabGroupSyncService mMockTabGroupSyncService; + @Mock private TabGroupSyncFeatures.Natives mTabGroupSyncFeaturesJniMock; private Context mContext; @@ -66,7 +76,10 @@ when(mTabModelSelector.getModel(/* incognito= */ false)).thenReturn(mNormalModel); when(mTabModelSelector.getModel(/* incognito= */ true)).thenReturn(mIncognitoModel); DefaultBrowserPromoUtils.setInstanceForTesting(mMockDefaultBrowserPromoUtils); + TabGroupSyncServiceFactory.setForTesting(mMockTabGroupSyncService); TrackerFactory.setTrackerForTests(mTracker); + TabGroupSyncFeaturesJni.setInstanceForTesting(mTabGroupSyncFeaturesJniMock); + when(mTabGroupSyncFeaturesJniMock.isTabGroupSyncEnabled(mProfile)).thenReturn(true); } @Test @@ -77,7 +90,10 @@ InputContext inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.DEFAULT_BROWSER_PROMO, mActionDelegate, mTracker); + EducationalTipCardType.DEFAULT_BROWSER_PROMO, + mActionDelegate, + mProfile, + mTracker); assertEquals(2, inputContext.getSizeForTesting()); // Test signal "should_show_non_role_manager_default_browser_promo". @@ -85,7 +101,10 @@ .thenReturn(true); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.DEFAULT_BROWSER_PROMO, mActionDelegate, mTracker); + EducationalTipCardType.DEFAULT_BROWSER_PROMO, + mActionDelegate, + mProfile, + mTracker); assertEquals( 1, inputContext.getEntryForTesting( @@ -97,7 +116,10 @@ .thenReturn(false); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.DEFAULT_BROWSER_PROMO, mActionDelegate, mTracker); + EducationalTipCardType.DEFAULT_BROWSER_PROMO, + mActionDelegate, + mProfile, + mTracker); assertEquals( 0, inputContext.getEntryForTesting( @@ -110,7 +132,10 @@ .thenReturn(true); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.DEFAULT_BROWSER_PROMO, mActionDelegate, mTracker); + EducationalTipCardType.DEFAULT_BROWSER_PROMO, + mActionDelegate, + mProfile, + mTracker); assertEquals( 0, inputContext.getEntryForTesting("has_default_browser_promo_shown_in_other_surface") @@ -121,7 +146,10 @@ .thenReturn(false); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.DEFAULT_BROWSER_PROMO, mActionDelegate, mTracker); + EducationalTipCardType.DEFAULT_BROWSER_PROMO, + mActionDelegate, + mProfile, + mTracker); assertEquals( 1, inputContext.getEntryForTesting("has_default_browser_promo_shown_in_other_surface") @@ -137,7 +165,7 @@ InputContext inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.TAB_GROUP, mActionDelegate, mTracker); + EducationalTipCardType.TAB_GROUP, mActionDelegate, mProfile, mTracker); assertEquals(2, inputContext.getSizeForTesting()); // Test signal "tab_group_exists". @@ -145,14 +173,14 @@ when(mIncognitoFilter.getTabGroupCount()).thenReturn(0); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.TAB_GROUP, mActionDelegate, mTracker); + EducationalTipCardType.TAB_GROUP, mActionDelegate, mProfile, mTracker); assertEquals(0, inputContext.getEntryForTesting("tab_group_exists").floatValue, 0.01); when(mNormalFilter.getTabGroupCount()).thenReturn(5); when(mIncognitoFilter.getTabGroupCount()).thenReturn(6); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.TAB_GROUP, mActionDelegate, mTracker); + EducationalTipCardType.TAB_GROUP, mActionDelegate, mProfile, mTracker); assertEquals(1, inputContext.getEntryForTesting("tab_group_exists").floatValue, 0.01); // Test signal "number_of_tabs". @@ -160,28 +188,65 @@ when(mIncognitoModel.getCount()).thenReturn(0); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.TAB_GROUP, mActionDelegate, mTracker); + EducationalTipCardType.TAB_GROUP, mActionDelegate, mProfile, mTracker); assertEquals(0, inputContext.getEntryForTesting("number_of_tabs").floatValue, 0.01); when(mNormalModel.getCount()).thenReturn(5); when(mIncognitoModel.getCount()).thenReturn(0); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.TAB_GROUP, mActionDelegate, mTracker); + EducationalTipCardType.TAB_GROUP, mActionDelegate, mProfile, mTracker); assertEquals(5, inputContext.getEntryForTesting("number_of_tabs").floatValue, 0.01); when(mNormalModel.getCount()).thenReturn(0); when(mIncognitoModel.getCount()).thenReturn(10); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.TAB_GROUP, mActionDelegate, mTracker); + EducationalTipCardType.TAB_GROUP, mActionDelegate, mProfile, mTracker); assertEquals(10, inputContext.getEntryForTesting("number_of_tabs").floatValue, 0.01); when(mNormalModel.getCount()).thenReturn(10); when(mIncognitoModel.getCount()).thenReturn(10); inputContext = EducationalTipCardProviderSignalHandler.createInputContext( - EducationalTipCardType.TAB_GROUP, mActionDelegate, mTracker); + EducationalTipCardType.TAB_GROUP, mActionDelegate, mProfile, mTracker); assertEquals(20, inputContext.getEntryForTesting("number_of_tabs").floatValue, 0.01); } + + @Test + @SmallTest + @EnableFeatures({ChromeFeatureList.EDUCATIONAL_TIP_MODULE}) + public void testCreateInputContext_TabGroupSyncPromoCard() { + assertTrue(ChromeFeatureList.sEducationalTipModule.isEnabled()); + when(mMockTabGroupSyncService.getAllGroupIds()).thenReturn(new String[] {}); + + InputContext inputContext = + EducationalTipCardProviderSignalHandler.createInputContext( + EducationalTipCardType.TAB_GROUP_SYNC, mActionDelegate, mProfile, mTracker); + assertEquals(1, inputContext.getSizeForTesting()); + + // Test signal "synced_tab_group_exists". + when(mProfile.isOffTheRecord()).thenReturn(false); + when(mMockTabGroupSyncService.getAllGroupIds()).thenReturn(new String[] {SYNC_ID}); + inputContext = + EducationalTipCardProviderSignalHandler.createInputContext( + EducationalTipCardType.TAB_GROUP_SYNC, mActionDelegate, mProfile, mTracker); + assertEquals( + 1, inputContext.getEntryForTesting("synced_tab_group_exists").floatValue, 0.01); + + when(mMockTabGroupSyncService.getAllGroupIds()).thenReturn(new String[] {}); + inputContext = + EducationalTipCardProviderSignalHandler.createInputContext( + EducationalTipCardType.TAB_GROUP_SYNC, mActionDelegate, mProfile, mTracker); + assertEquals( + 0, inputContext.getEntryForTesting("synced_tab_group_exists").floatValue, 0.01); + + when(mProfile.isOffTheRecord()).thenReturn(true); + when(mMockTabGroupSyncService.getAllGroupIds()).thenReturn(new String[] {SYNC_ID}); + inputContext = + EducationalTipCardProviderSignalHandler.createInputContext( + EducationalTipCardType.TAB_GROUP_SYNC, mActionDelegate, mProfile, mTracker); + assertEquals( + 0, inputContext.getEntryForTesting("synced_tab_group_exists").floatValue, 0.01); + } }
diff --git a/chrome/browser/educational_tip/junit/src/org/chromium/chrome/browser/educational_tip/EducationalTipModuleBuilderUnitTest.java b/chrome/browser/educational_tip/junit/src/org/chromium/chrome/browser/educational_tip/EducationalTipModuleBuilderUnitTest.java index fcf9b1b8..76d86dd 100644 --- a/chrome/browser/educational_tip/junit/src/org/chromium/chrome/browser/educational_tip/EducationalTipModuleBuilderUnitTest.java +++ b/chrome/browser/educational_tip/junit/src/org/chromium/chrome/browser/educational_tip/EducationalTipModuleBuilderUnitTest.java
@@ -13,9 +13,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import android.content.Context; - -import androidx.test.core.app.ApplicationProvider; import androidx.test.filters.SmallTest; import org.junit.Before; @@ -71,11 +68,9 @@ @Mock private TabModel mIncognitoModel; private EducationalTipModuleBuilder mModuleBuilder; - private Context mContext; @Before public void setUp() { - mContext = ApplicationProvider.getApplicationContext(); when(mActionDelegate.getProfileSupplier()).thenReturn(mProfileSupplier); when(mProfileSupplier.hasValue()).thenReturn(true); when(mProfileSupplier.get()).thenReturn(mProfile);
diff --git a/chrome/browser/extensions/api/user_scripts/user_scripts_apitest.cc b/chrome/browser/extensions/api/user_scripts/user_scripts_apitest.cc index 61e9fbf..6155bf7 100644 --- a/chrome/browser/extensions/api/user_scripts/user_scripts_apitest.cc +++ b/chrome/browser/extensions/api/user_scripts/user_scripts_apitest.cc
@@ -90,6 +90,10 @@ ASSERT_TRUE(RunExtensionTest("user_scripts/update")) << message_; } +IN_PROC_BROWSER_TEST_F(UserScriptsAPITest, ExecuteUserScripts) { + ASSERT_TRUE(RunExtensionTest("user_scripts/execute")) << message_; +} + // TODO(crbug.com/335421977): Flaky on "Linux ChromiumOS MSan Tests". #if BUILDFLAG(IS_CHROMEOS) && defined(MEMORY_SANITIZER) #define MAYBE_ConfigureWorld DISABLED_ConfigureWorld
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index c7b096c..e1b05ee5 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -2292,6 +2292,11 @@ "expiry_milestone": 145 }, { + "name": "edge-to-edge-safe-area-constraint", + "owners": ["wenyufu@chromium.org", "clhager@google.com", "twellington@chromium.org", "edge-to-edge@chromium.org"], + "expiry_milestone": 145 + }, + { "name": "edge-to-edge-web-opt-in", "owners": ["clhager@google.com", "wenyufu@chromium.org","twellington@chromium.org", "edge-to-edge@chromium.org"], "expiry_milestone": 142 @@ -5712,6 +5717,11 @@ "expiry_milestone": 135 }, { + "name": "lens-overlay-enable-location-bar-entrypoint-on-srp", + "owners": ["christianxu@google.com", "stkhapugin@chromium.org"], + "expiry_milestone": 135 + }, + { "name": "lens-overlay-enable-same-tab-navigation", "owners": ["christianxu@google.com", "stkhapugin@chromium.org"], "expiry_milestone": 135
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 32cd09b9..48507be 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -4517,6 +4517,11 @@ "to facilitate the transition to edge-to-edge being enforced at the system " "level."; +const char kEdgeToEdgeSafeAreaConstraintName[] = "EdgeToEdgeSafeAreaConstraint"; +const char kEdgeToEdgeSafeAreaConstraintDescription[] = + "Ensure web content is constrained to within the safe area if safe area " + "constraint is presents on a given web page."; + const char kEdgeToEdgeWebOptInName[] = "EdgeToEdgeWebOptIn"; const char kEdgeToEdgeWebOptInDescription[] = "Enables Chrome to draw below the Nav Bar on websites that have explicitly "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index a5cda21f..e64d94f97 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -2635,6 +2635,9 @@ extern const char kEdgeToEdgeEverywhereName[]; extern const char kEdgeToEdgeEverywhereDescription[]; +extern const char kEdgeToEdgeSafeAreaConstraintName[]; +extern const char kEdgeToEdgeSafeAreaConstraintDescription[]; + extern const char kEdgeToEdgeWebOptInName[]; extern const char kEdgeToEdgeWebOptInDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index afc254b..b4976ae 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -261,6 +261,7 @@ &kDrawNativeEdgeToEdge, &kEdgeToEdgeBottomChin, &kEdgeToEdgeEverywhere, + &kEdgeToEdgeSafeAreaConstraint, &kEdgeToEdgeWebOptIn, &kEmptyTabListAnimationKillSwitch, &kEnableXAxisActivityTransition, @@ -776,6 +777,10 @@ "EdgeToEdgeEverywhere", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kEdgeToEdgeSafeAreaConstraint, + "EdgeToEdgeSafeAreaConstraint", + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kEdgeToEdgeWebOptIn, "EdgeToEdgeWebOptIn", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h index 1877e0f..0a2cf7b 100644 --- a/chrome/browser/flags/android/chrome_feature_list.h +++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -101,6 +101,7 @@ BASE_DECLARE_FEATURE(kEdgeToEdgeBottomChin); BASE_DECLARE_FEATURE(kEdgeToEdgeEverywhere); BASE_DECLARE_FEATURE(kEdgeToEdgeWebOptIn); +BASE_DECLARE_FEATURE(kEdgeToEdgeSafeAreaConstraint); BASE_DECLARE_FEATURE(kEmptyTabListAnimationKillSwitch); BASE_DECLARE_FEATURE(kEnableXAxisActivityTransition); BASE_DECLARE_FEATURE(kDragDropTabTearing);
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java index 56e02f0e..16e7e01 100644 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -326,6 +326,7 @@ public static final String DYNAMIC_SAFE_AREA_INSETS = "DynamicSafeAreaInsets"; public static final String EDGE_TO_EDGE_BOTTOM_CHIN = "EdgeToEdgeBottomChin"; public static final String EDGE_TO_EDGE_EVERYWHERE = "EdgeToEdgeEverywhere"; + public static final String EDGE_TO_EDGE_SAFE_AREA_CONSTRAINT = "EdgeToEdgeSafeAreaConstraint"; public static final String EDGE_TO_EDGE_WEB_OPT_IN = "EdgeToEdgeWebOptIn"; public static final String EDUCATIONAL_TIP_MODULE = "EducationalTipModule"; public static final String EMPTY_TAB_LIST_ANIMATION_KILL_SWITCH = @@ -762,7 +763,10 @@ public static final CachedFlag sTabResumptionModuleAndroid = newCachedFlag(TAB_RESUMPTION_MODULE_ANDROID, false); public static final CachedFlag sTabStateFlatBuffer = - newCachedFlag(TAB_STATE_FLAT_BUFFER, false); + newCachedFlag( + TAB_STATE_FLAT_BUFFER, + /* defaultValue= */ false, + /* defaultValueInTests= */ true); public static final CachedFlag sTabStripIncognitoMigration = newCachedFlag( TAB_STRIP_INCOGNITO_MIGRATION, @@ -939,6 +943,8 @@ newMutableFlagWithSafeDefault(CONTROLS_VISIBILITY_FROM_NAVIGATIONS, true); public static final MutableFlagWithSafeDefault sDynamicSafeAreaInsets = newMutableFlagWithSafeDefault(DYNAMIC_SAFE_AREA_INSETS, false); + public static final MutableFlagWithSafeDefault sEdgeToEdgeSafeAreaConstraint = + newMutableFlagWithSafeDefault(EDGE_TO_EDGE_SAFE_AREA_CONSTRAINT, false); // Defaulted to true in native, but since it is being used as a kill switch set the default // value pre-native to false as it is safer if the feature needs to be killed via Finch config. public static final MutableFlagWithSafeDefault sEmptyTabListAnimationKillSwitch =
diff --git a/chrome/browser/glic/glic_window_controller.cc b/chrome/browser/glic/glic_window_controller.cc index bb131c7..f54465d 100644 --- a/chrome/browser/glic/glic_window_controller.cc +++ b/chrome/browser/glic/glic_window_controller.cc
@@ -12,7 +12,7 @@ #include "chrome/browser/ui/views/frame/tab_strip_region_view.h" #include "chrome/browser/ui/views/glic/glic_view.h" #include "chrome/browser/ui/views/tabs/glic_button.h" -#include "chrome/browser/ui/views/tabs/tab_glic_container.h" +#include "chrome/browser/ui/views/tabs/tab_strip_action_container.h" #include "chrome/browser/ui/webui/glic/glic.mojom.h" #include "ui/display/screen.h" #include "ui/events/event_observer.h"
diff --git a/chrome/browser/media/router/chrome_media_router_factory_unittest.cc b/chrome/browser/media/router/chrome_media_router_factory_unittest.cc index 34561762..230c9de 100644 --- a/chrome/browser/media/router/chrome_media_router_factory_unittest.cc +++ b/chrome/browser/media/router/chrome_media_router_factory_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/media/router/chrome_media_router_factory.h" + #include "base/functional/bind.h" #include "chrome/browser/profiles/profile.h" #include "chrome/test/base/testing_profile.h"
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_constants.cc b/chrome/browser/media/router/discovery/access_code/access_code_cast_constants.cc index 361e21de..09cb0d02 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_constants.cc +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_constants.cc
@@ -14,8 +14,9 @@ namespace media_router { bool IsCommandLineSwitchSupported() { - if (command_line_enabled_for_testing) + if (command_line_enabled_for_testing) { return true; + } version_info::Channel channel = chrome::GetChannel(); return channel != version_info::Channel::STABLE && channel != version_info::Channel::BETA;
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h b/chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h index 039873c..1a5c1d7 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h
@@ -19,7 +19,7 @@ BASE_DECLARE_FEATURE(kAccessCodeCastRememberDevices); BASE_DECLARE_FEATURE(kAccessCodeCastTabSwitchingUI); BASE_DECLARE_FEATURE(kAccessCodeCastFreezeUI); -} +} // namespace features namespace media_router {
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc index 271140f09..92b2ee67 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc
@@ -53,8 +53,9 @@ bool IsAccessCodeCastEnabled() { Profile* profile = ProfileManager::GetLastUsedProfileIfLoaded(); - if (!profile) + if (!profile) { return false; + } return GetAccessCodeCastEnabledPref(profile); } @@ -215,8 +216,9 @@ } // No routes were removed. - if (removed_routes.empty()) + if (removed_routes.empty()) { return; + } // There should only be 1 element in the |removed_routes| set. DCHECK(removed_routes.size() < 2) @@ -253,8 +255,9 @@ const MediaSinkInternal* sink) { // The route Id did not correspond to a sink for some reason. Return to // avoid nullptr issues. - if (!sink || !sink->is_cast_sink()) + if (!sink || !sink->is_cast_sink()) { return false; + } // Check to see if route was created by an access code sink. CastDiscoveryType type = sink->cast_data().discovery_type; @@ -289,8 +292,9 @@ const bool is_route_local, const MediaSource media_source, const MediaSinkInternal* sink) { - if (!IsSinkValidAccessCodeSink(sink)) + if (!IsSinkValidAccessCodeSink(sink)) { return; + } if (is_route_local) { current_route_start_times_[route_id] = base::Time::Now(); @@ -324,8 +328,9 @@ // If there is no active route, check manually if the device should be // instantly expired. - if (!route.has_value()) + if (!route.has_value()) { CheckMediaSinkForExpiration(sink->id()); + } } void AccessCodeCastSinkService::DiscoverSink(const std::string& access_code, @@ -488,13 +493,15 @@ std::optional<const MediaRoute> AccessCodeCastSinkService::GetActiveRoute( const MediaSink::Id& sink_id) { - if (!media_router_) + if (!media_router_) { return std::nullopt; + } auto routes = media_router_->GetCurrentRoutes(); auto route_it = base::ranges::find(routes, sink_id, &MediaRoute::media_sink_id); - if (route_it == routes.end()) + if (route_it == routes.end()) { return std::nullopt; + } return *route_it; } @@ -917,8 +924,9 @@ // AddOrUpdate takes time, so avoid calling it if we can if (existing_sink->sink().name() == new_sink.sink().name() && existing_sink->cast_data().capabilities == - new_sink.cast_data().capabilities) + new_sink.cast_data().capabilities) { return; + } MediaSinkInternal existing_sink_copy = *existing_sink; existing_sink_copy.sink().set_name(new_sink.sink().name()); @@ -998,8 +1006,9 @@ void AccessCodeCastSinkService::LogInfo(const std::string& log_message, const std::string& sink_id) { - if (!media_router_ || !media_router_->GetLogger()) + if (!media_router_ || !media_router_->GetLogger()) { return; + } media_router_->GetLogger()->LogInfo(mojom::LogCategory::kDiscovery, kLoggerComponent, log_message, sink_id, "", ""); @@ -1007,8 +1016,9 @@ void AccessCodeCastSinkService::LogWarning(const std::string& log_message, const std::string& sink_id) { - if (!media_router_ || !media_router_->GetLogger()) + if (!media_router_ || !media_router_->GetLogger()) { return; + } media_router_->GetLogger()->LogWarning(mojom::LogCategory::kDiscovery, kLoggerComponent, log_message, sink_id, "", ""); @@ -1016,8 +1026,9 @@ void AccessCodeCastSinkService::LogError(const std::string& log_message, const std::string& sink_id) { - if (!media_router_ || !media_router_->GetLogger()) + if (!media_router_ || !media_router_->GetLogger()) { return; + } media_router_->GetLogger()->LogError(mojom::LogCategory::kDiscovery, kLoggerComponent, log_message, sink_id, "", ""); @@ -1066,8 +1077,9 @@ // dtor. Since MediaRouter and |this| are both KeyedServices, we must not // access MediaRouter in the dtor of |this|, so we do it here. media_routes_observer_.reset(); - if (user_prefs_registrar_) + if (user_prefs_registrar_) { user_prefs_registrar_->RemoveAll(); + } user_prefs_registrar_.reset(); media_router_ = nullptr; ResetExpirationTimers();
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_browsertest.cc b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_browsertest.cc index 5503da14..cdbb3764 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_browsertest.cc +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_browsertest.cc
@@ -2,13 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/test/media_router/access_code_cast/access_code_cast_integration_browsertest.h" - #include "base/test/scoped_mock_time_message_loop_task_runner.h" #include "chrome/browser/media/router/discovery/access_code/access_code_cast_constants.h" #include "chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h" #include "chrome/browser/media/router/discovery/access_code/access_code_media_sink_util.h" #include "chrome/browser/media/router/discovery/access_code/access_code_test_util.h" +#include "chrome/test/media_router/access_code_cast/access_code_cast_integration_browsertest.h" #include "components/sessions/content/session_tab_helper.h" #include "content/public/browser/browser_thread.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_factory_unittest.cc b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_factory_unittest.cc index b8dce08..e75ccb4 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_factory_unittest.cc +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_factory_unittest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_factory.h" + #include <memory> #include "base/functional/bind.h" @@ -10,7 +12,6 @@ #include "chrome/browser/media/router/chrome_media_router_factory.h" #include "chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h" #include "chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h" -#include "chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_factory.h" #include "chrome/browser/media/router/discovery/access_code/access_code_test_util.h" #include "chrome/browser/prefs/browser_prefs.h" #include "chrome/test/base/testing_profile.h"
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_media_sink_util.cc b/chrome/browser/media/router/discovery/access_code/access_code_media_sink_util.cc index 449432a1..361e9b7 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_media_sink_util.cc +++ b/chrome/browser/media/router/discovery/access_code/access_code_media_sink_util.cc
@@ -40,16 +40,21 @@ CastDeviceCapabilitySet ConvertDeviceCapabilities( chrome_browser_media::proto::DeviceCapabilities proto) { CastDeviceCapabilitySet capabilities; - if (proto.video_out()) + if (proto.video_out()) { capabilities.Put(CastDeviceCapability::kVideoOut); - if (proto.video_in()) + } + if (proto.video_in()) { capabilities.Put(CastDeviceCapability::kVideoIn); - if (proto.audio_out()) + } + if (proto.audio_out()) { capabilities.Put(CastDeviceCapability::kAudioOut); - if (proto.audio_in()) + } + if (proto.audio_in()) { capabilities.Put(CastDeviceCapability::kAudioIn); - if (proto.dev_mode()) + } + if (proto.dev_mode()) { capabilities.Put(CastDeviceCapability::kDevMode); + } return capabilities; } @@ -173,24 +178,29 @@ std::optional<MediaSinkInternal> ParseValueDictIntoMediaSinkInternal( const base::Value::Dict& value_dict) { const auto* extra_data_dict = value_dict.FindDict(kExtraDataDictKey); - if (!extra_data_dict) + if (!extra_data_dict) { return std::nullopt; + } net::IPAddress ip_address; const std::string* ip_address_string = extra_data_dict->FindString(kIpAddressKey); - if (!ip_address_string) + if (!ip_address_string) { return std::nullopt; - if (!ip_address.AssignFromIPLiteral(*ip_address_string)) + } + if (!ip_address.AssignFromIPLiteral(*ip_address_string)) { return std::nullopt; + } std::optional<int> port = extra_data_dict->FindInt(kPortKey); - if (!port.has_value()) + if (!port.has_value()) { return std::nullopt; + } std::optional<int> capabilities = extra_data_dict->FindInt(kCapabilitiesKey); - if (!capabilities.has_value()) + if (!capabilities.has_value()) { return std::nullopt; + } CastSinkExtraData extra_data; extra_data.ip_endpoint = net::IPEndPoint(ip_address, port.value()); @@ -202,14 +212,17 @@ model_name ? *model_name : kDefaultAccessCodeModelName; const auto* sink_dict = value_dict.FindDict(kSinkDictKey); - if (!sink_dict) + if (!sink_dict) { return std::nullopt; + } const std::string* sink_id = sink_dict->FindString(kSinkIdKey); - if (!sink_id) + if (!sink_id) { return std::nullopt; + } const std::string* display_name = sink_dict->FindString(kDisplayNameKey); - if (!display_name) + if (!display_name) { return std::nullopt; + } MediaSink sink(*sink_id, *display_name, GetCastSinkIconType(extra_data.capabilities),
diff --git a/chrome/browser/media/router/discovery/dial/device_description_fetcher_unittest.cc b/chrome/browser/media/router/discovery/dial/device_description_fetcher_unittest.cc index b6cc2be..dd7cf03 100644 --- a/chrome/browser/media/router/discovery/dial/device_description_fetcher_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/device_description_fetcher_unittest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media/router/discovery/dial/device_description_fetcher.h" + #include <memory> #include <string> #include <utility> @@ -12,7 +14,6 @@ #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "base/test/task_environment.h" -#include "chrome/browser/media/router/discovery/dial/device_description_fetcher.h" #include "chrome/browser/media/router/discovery/dial/dial_device_data.h" #include "chrome/browser/media/router/test/provider_test_helpers.h" #include "net/base/ip_address.h"
diff --git a/chrome/browser/media/router/discovery/dial/device_description_service.cc b/chrome/browser/media/router/discovery/dial/device_description_service.cc index 9261b22..3b72b681 100644 --- a/chrome/browser/media/router/discovery/dial/device_description_service.cc +++ b/chrome/browser/media/router/discovery/dial/device_description_service.cc
@@ -130,8 +130,9 @@ // Existing Fetcher. const auto& it = device_description_fetcher_map_.find(device_data.label()); - if (it != device_description_fetcher_map_.end()) + if (it != device_description_fetcher_map_.end()) { return; + } std::unique_ptr<DeviceDescriptionFetcher> device_description_fetcher = CreateFetcher( @@ -172,8 +173,9 @@ DeviceDescriptionService::CheckAndUpdateCache( const DialDeviceData& device_data) { const auto& it = description_cache_.find(device_data.label()); - if (it == description_cache_.end()) + if (it == description_cache_.end()) { return nullptr; + } // If the entry's config_id does not match, or it has expired, remove it. if (it->second.config_id != device_data.config_id() ||
diff --git a/chrome/browser/media/router/discovery/dial/device_description_service_unittest.cc b/chrome/browser/media/router/discovery/dial/device_description_service_unittest.cc index 92dba29..22302b3 100644 --- a/chrome/browser/media/router/discovery/dial/device_description_service_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/device_description_service_unittest.cc
@@ -108,8 +108,7 @@ (*description_cache_)[device_label] = cache_entry; } - void OnDeviceDescriptionFetchComplete(int num) { - } + void OnDeviceDescriptionFetchComplete(int num) {} void TestOnParsedDeviceDescription( ParsedDialDeviceDescription device_description, @@ -267,9 +266,10 @@ SafeDialDeviceDescriptionParser::ParsingResult::kFailedToReadFriendlyName, SafeDialDeviceDescriptionParser::ParsingResult::kFailedToReadModelName, SafeDialDeviceDescriptionParser::ParsingResult::kFailedToReadDeviceType}; - for (auto error : errors) + for (auto error : errors) { TestOnParsedDeviceDescription(ParsedDialDeviceDescription(), error, error_message); + } // Empty field error_message = "Failed to process fetch result";
diff --git a/chrome/browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc b/chrome/browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc index 9b02b5c3..328f4fa 100644 --- a/chrome/browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc
@@ -41,8 +41,9 @@ void InvokeParseCallback(std::unique_ptr<ParsedDialAppInfo> app_info, ParsingResult parsing_result) { - if (!parse_callback_) + if (!parse_callback_) { return; + } std::move(parse_callback_).Run(std::move(app_info), parsing_result); } @@ -73,10 +74,11 @@ void OnAppInfo(const MediaSink::Id& sink_id, const std::string& app_name, DialAppInfoResult result) { - if (result.app_info) + if (result.app_info) { OnAppInfoSuccess(sink_id, app_name, *result.app_info, result.result_code); - else + } else { OnAppInfoFailure(sink_id, app_name, result.result_code); + } } // Returns a raw pointer to the PendingRequest tracked in
diff --git a/chrome/browser/media/router/discovery/dial/dial_device_data.cc b/chrome/browser/media/router/discovery/dial/dial_device_data.cc index d23f188..2dc67b9 100644 --- a/chrome/browser/media/router/discovery/dial/dial_device_data.cc +++ b/chrome/browser/media/router/discovery/dial/dial_device_data.cc
@@ -36,15 +36,18 @@ } bool DialDeviceData::IsValidUrl(const GURL& url) const { - if (!url.is_valid() || url.is_empty() || !url.SchemeIsHTTPOrHTTPS()) + if (!url.is_valid() || url.is_empty() || !url.SchemeIsHTTPOrHTTPS()) { return false; + } net::IPAddress host_address; - if (!net::ParseURLHostnameToAddress(url.host(), &host_address)) + if (!net::ParseURLHostnameToAddress(url.host(), &host_address)) { return false; + } - if (host_address.IsPubliclyRoutable()) + if (host_address.IsPubliclyRoutable()) { return false; + } return host_address == ip_address_; }
diff --git a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc index 4b9b0b446..463c8a2 100644 --- a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc +++ b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc
@@ -163,8 +163,9 @@ base::Unretained(this), app_name, callback_list.get())); // Start checking if |app_name| is available on existing sinks. - for (const auto& sink : GetSinks()) + for (const auto& sink : GetSinks()) { FetchAppInfoForSink(sink.second, app_name); + } } return callback_list->Add(callback); @@ -184,28 +185,33 @@ std::vector<MediaSinkInternal> sinks_to_update; std::vector<MediaSinkInternal> sinks_to_remove; for (const auto& sink : GetSinks()) { - if (!base::Contains(latest_sinks_, sink.first)) + if (!base::Contains(latest_sinks_, sink.first)) { sinks_to_remove.push_back(sink.second); + } } for (const auto& latest_sink : latest_sinks_) { // Sink is added or updated. const MediaSinkInternal* sink = GetSinkById(latest_sink.first); - if (!sink || *sink != latest_sink.second) + if (!sink || *sink != latest_sink.second) { sinks_to_update.push_back(latest_sink.second); + } } // Note: calling |AddOrUpdateSink()| or |RemoveSink()| here won't cause the // discovery timer to fire again, since it is considered to be still running. - for (const auto& sink : sinks_to_update) + for (const auto& sink : sinks_to_update) { AddOrUpdateSink(sink); + } - for (const auto& sink : sinks_to_remove) + for (const auto& sink : sinks_to_remove) { RemoveSink(sink); + } // If discovered sinks are updated, then query results might have changed. - for (const auto& query : sink_queries_) + for (const auto& query : sink_queries_) { query.second->Notify(query.first); + } MediaSinkServiceBase::OnDiscoveryComplete(); } @@ -254,8 +260,9 @@ if (!IsDiscoveryOnly(description_data.model_name)) { // Start checking if all registered apps are available on |dial_sink|. - for (const auto& query : sink_queries_) + for (const auto& query : sink_queries_) { FetchAppInfoForSink(dial_sink, query.first); + } } } @@ -285,8 +292,9 @@ SinkAppStatus old_status = GetAppStatus(sink_id, app_name); SetAppStatus(sink_id, app_name, app_status); - if (old_status == app_status) + if (old_status == app_status) { return; + } if (!result.app_info) { LoggerList::GetInstance()->Log( @@ -301,12 +309,14 @@ // The sink might've been removed before the parse was complete. In that case // the callbacks won't be notified, but the app status will be saved for later // use. - if (!GetSinkById(sink_id)) + if (!GetSinkById(sink_id)) { return; + } auto query_it = sink_queries_.find(app_name); - if (query_it != sink_queries_.end()) + if (query_it != sink_queries_.end()) { query_it->second->Notify(app_name); + } } void DialMediaSinkServiceImpl::FetchAppInfoForSink( @@ -319,8 +329,9 @@ std::string sink_id = dial_sink.sink().id(); SinkAppStatus app_status = GetAppStatus(sink_id, app_name); - if (app_status != SinkAppStatus::kUnknown) + if (app_status != SinkAppStatus::kUnknown) { return; + } app_discovery_service_->FetchDialAppInfo( dial_sink, app_name, @@ -335,8 +346,9 @@ continue; } - for (const auto& query : sink_queries_) + for (const auto& query : sink_queries_) { FetchAppInfoForSink(sink.second, query.first); + } } } @@ -368,8 +380,9 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // There are no more profiles monitoring |app_name|. - if (callback_list->empty()) + if (callback_list->empty()) { sink_queries_.erase(app_name); + } } std::vector<MediaSinkInternal> DialMediaSinkServiceImpl::GetAvailableSinks( @@ -377,8 +390,9 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); std::vector<MediaSinkInternal> sinks; for (const auto& sink : GetSinks()) { - if (GetAppStatus(sink.first, app_name) == SinkAppStatus::kAvailable) + if (GetAppStatus(sink.first, app_name) == SinkAppStatus::kAvailable) { sinks.push_back(sink.second); + } } return sinks; }
diff --git a/chrome/browser/media/router/discovery/dial/dial_registry.cc b/chrome/browser/media/router/discovery/dial/dial_registry.cc index 59aafefa..82620bd 100644 --- a/chrome/browser/media/router/discovery/dial/dial_registry.cc +++ b/chrome/browser/media/router/discovery/dial/dial_registry.cc
@@ -63,8 +63,9 @@ void DialRegistry::SetNetLog(net::NetLog* net_log) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!net_log_) + if (!net_log_) { net_log_ = net_log; + } } void DialRegistry::Start() { @@ -87,8 +88,9 @@ GURL DialRegistry::GetDeviceDescriptionURL(const std::string& label) const { const auto device_it = device_by_label_map_.find(label); - if (device_it != device_by_label_map_.end()) + if (device_it != device_by_label_map_.end()) { return device_it->second->device_description_url(); + } return GURL(); } @@ -132,8 +134,9 @@ bool DialRegistry::DiscoverNow() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!ReadyToDiscover()) + if (!ReadyToDiscover()) { return false; + } if (!dial_) { client_->OnDialError(DIAL_UNKNOWN); @@ -143,16 +146,18 @@ // Force increment |registry_generation_| to ensure the list is sent even if // it has not changed. bool started = dial_->Discover(); - if (started) + if (started) { ++registry_generation_; + } return started; } void DialRegistry::StartPeriodicDiscovery() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!ReadyToDiscover() || dial_) + if (!ReadyToDiscover() || dial_) { return; + } dial_ = CreateDialService(); DoDiscovery(); @@ -172,8 +177,9 @@ void DialRegistry::StopPeriodicDiscovery() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!dial_) + if (!dial_) { return; + } repeating_timer_->Stop(); repeating_timer_.reset(); @@ -206,15 +212,17 @@ // Check against our default expiration timeout. Time default_expiration_time = device.response_time() + expiration_delta_; - if (now > default_expiration_time) + if (now > default_expiration_time) { return true; + } // Check against the device's cache-control header, if set. if (device.has_max_age()) { Time max_age_expiration_time = device.response_time() + base::Seconds(device.max_age()); - if (now > max_age_expiration_time) + if (now > max_age_expiration_time) { return true; + } } return false; } @@ -230,8 +238,9 @@ // Send the device list to the client if it has changed since the last list // was sent. bool needs_event = last_event_registry_generation_ < registry_generation_; - if (!needs_event) + if (!needs_event) { return; + } DeviceList device_list; for (DeviceByLabelMap::const_iterator it = device_by_label_map_.begin(); @@ -275,8 +284,9 @@ did_modify_list = MaybeAddDevice(std::move(device_data)); } - if (did_modify_list) + if (did_modify_list) { registry_generation_++; + } } bool DialRegistry::MaybeAddDevice(std::unique_ptr<DialDeviceData> device_data) { @@ -293,8 +303,9 @@ void DialRegistry::OnDiscoveryFinished() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (PruneExpiredDevices()) + if (PruneExpiredDevices()) { registry_generation_++; + } MaybeSendDeviceList(); }
diff --git a/chrome/browser/media/router/discovery/dial/dial_registry_unittest.cc b/chrome/browser/media/router/discovery/dial/dial_registry_unittest.cc index 0af07cc..02ef1906 100644 --- a/chrome/browser/media/router/discovery/dial/dial_registry_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/dial_registry_unittest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media/router/discovery/dial/dial_registry.h" + #include <stddef.h> #include "base/memory/ptr_util.h" @@ -9,7 +11,6 @@ #include "base/test/simple_test_clock.h" #include "base/time/time.h" #include "chrome/browser/media/router/discovery/dial/dial_device_data.h" -#include "chrome/browser/media/router/discovery/dial/dial_registry.h" #include "chrome/browser/media/router/discovery/dial/dial_service.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/browser_task_traits.h" @@ -65,8 +66,9 @@ ~MockDialRegistry() override { // Don't let the DialRegistry delete this. DialService* tmp = dial_.release(); - if (tmp) + if (tmp) { CHECK_EQ(&mock_service_, tmp); + } } // Returns the mock Dial service.
diff --git a/chrome/browser/media/router/discovery/dial/dial_service_impl.cc b/chrome/browser/media/router/discovery/dial/dial_service_impl.cc index 0589ab3..4d31f7e 100644 --- a/chrome/browser/media/router/discovery/dial/dial_service_impl.cc +++ b/chrome/browser/media/router/discovery/dial/dial_service_impl.cc
@@ -139,8 +139,9 @@ const ash::NetworkState* state = ash::NetworkHandler::Get() ->network_state_handler() ->ConnectedNetworkByType(type); - if (!state) + if (!state) { return; + } std::string state_ip_address = state->GetIpAddress(); IPAddress bind_ip_address; if (bind_ip_address.AssignFromIPLiteral(state_ip_address) && @@ -270,18 +271,21 @@ int result) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); is_writing_ = false; - if (!CheckResult("OnSocketWrite", result)) + if (!CheckResult("OnSocketWrite", result)) { return; + } dial_service_->NotifyOnDiscoveryRequest(); } bool DialServiceImpl::DialSocket::ReadSocket() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!socket_) + if (!socket_) { return false; + } - if (is_reading_) + if (is_reading_) { return false; + } int result = net::OK; bool result_ok = true; @@ -292,8 +296,9 @@ base::BindOnce(&DialServiceImpl::DialSocket::OnSocketRead, base::Unretained(this))); result_ok = CheckResult("RecvFrom", result); - if (result != net::ERR_IO_PENDING) + if (result != net::ERR_IO_PENDING) { is_reading_ = false; + } if (result_ok && result > 0) { // Synchronous read. HandleResponse(result); @@ -305,10 +310,12 @@ void DialServiceImpl::DialSocket::OnSocketRead(int result) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); is_reading_ = false; - if (!CheckResult("OnSocketRead", result)) + if (!CheckResult("OnSocketRead", result)) { return; - if (result > 0) + } + if (result > 0) { HandleResponse(result); + } // Await next response. ReadSocket(); @@ -326,8 +333,9 @@ // Attempt to parse response, notify client if successful. DialDeviceData parsed_device; - if (ParseResponse(response, response_time, &parsed_device)) + if (ParseResponse(response, response_time, &parsed_device)) { dial_service_->NotifyOnDeviceDiscovered(parsed_device); + } } bool DialServiceImpl::DialSocket::ParseResponse(const std::string& response, @@ -507,8 +515,9 @@ void DialServiceImpl::BindAndAddSocket(const IPAddress& bind_ip_address) { std::unique_ptr<DialServiceImpl::DialSocket> dial_socket(CreateDialSocket()); - if (dial_socket->CreateAndBindSocket(bind_ip_address, net_log_)) + if (dial_socket->CreateAndBindSocket(bind_ip_address, net_log_)) { dial_sockets_.push_back(std::move(dial_socket)); + } } std::unique_ptr<DialServiceImpl::DialSocket> @@ -524,8 +533,9 @@ } num_requests_sent_++; for (const auto& socket : dial_sockets_) { - if (!socket->IsClosed()) + if (!socket->IsClosed()) { socket->SendOneRequest(send_address_, send_buffer_); + } } } @@ -575,8 +585,9 @@ bool DialServiceImpl::HasOpenSockets() { for (const auto& socket : dial_sockets_) { - if (!socket->IsClosed()) + if (!socket->IsClosed()) { return true; + } } return false; }
diff --git a/chrome/browser/media/router/discovery/dial/dial_url_fetcher.cc b/chrome/browser/media/router/discovery/dial/dial_url_fetcher.cc index 9d3e02cf..e9f5c04 100644 --- a/chrome/browser/media/router/discovery/dial/dial_url_fetcher.cc +++ b/chrome/browser/media/router/discovery/dial/dial_url_fetcher.cc
@@ -133,8 +133,9 @@ // or XHR. We set a fake Origin that is only used by the browser to satisfy // this requirement. Rather than attempt to coerce this fake origin into a // url::Origin, set the header directly. - if (set_origin_header) + if (set_origin_header) { request->headers.SetHeader("Origin", GetFakeOriginForDialLaunch()); + } method_ = method; @@ -164,8 +165,9 @@ loader_->SetOnRedirectCallback(base::BindRepeating( &DialURLFetcher::ReportRedirectError, base::Unretained(this))); - if (post_data) + if (post_data) { loader_->AttachStringForUpload(*post_data, "text/plain"); + } StartDownload(); }
diff --git a/chrome/browser/media/router/discovery/dial/dial_url_fetcher_unittest.cc b/chrome/browser/media/router/discovery/dial/dial_url_fetcher_unittest.cc index a28f0cfc..7dd2b22a 100644 --- a/chrome/browser/media/router/discovery/dial/dial_url_fetcher_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/dial_url_fetcher_unittest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media/router/discovery/dial/dial_url_fetcher.h" + #include <memory> #include <string> @@ -12,7 +14,6 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/test/task_environment.h" -#include "chrome/browser/media/router/discovery/dial/dial_url_fetcher.h" #include "chrome/browser/media/router/test/provider_test_helpers.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/browser_task_environment.h"
diff --git a/chrome/browser/media/router/discovery/dial/parsed_dial_device_description.cc b/chrome/browser/media/router/discovery/dial/parsed_dial_device_description.cc index f85934b1..5884ad09 100644 --- a/chrome/browser/media/router/discovery/dial/parsed_dial_device_description.cc +++ b/chrome/browser/media/router/discovery/dial/parsed_dial_device_description.cc
@@ -14,8 +14,9 @@ ParsedDialDeviceDescription& ParsedDialDeviceDescription::operator=( const ParsedDialDeviceDescription& other) { - if (this == &other) + if (this == &other) { return *this; + } this->unique_id = other.unique_id; this->friendly_name = other.friendly_name;
diff --git a/chrome/browser/media/router/discovery/dial/parsed_dial_device_description.h b/chrome/browser/media/router/discovery/dial/parsed_dial_device_description.h index eb7126a..4dd2e83 100644 --- a/chrome/browser/media/router/discovery/dial/parsed_dial_device_description.h +++ b/chrome/browser/media/router/discovery/dial/parsed_dial_device_description.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_PARSED_DIAL_DEVICE_DESCRIPTION_H_ #include <string> + #include "url/gurl.h" namespace media_router {
diff --git a/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.cc b/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.cc index d774d29..cfb2044 100644 --- a/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.cc +++ b/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.cc
@@ -34,8 +34,9 @@ } for (const auto& child_element : *child_elements) { std::string tag_name; - if (!data_decoder::GetXmlElementTagName(child_element, &tag_name)) + if (!data_decoder::GetXmlElementTagName(child_element, &tag_name)) { continue; + } std::string extra_data; if (data_decoder::GetXmlElementText(child_element, &extra_data)) { out_app_info->extra_data[tag_name] = extra_data; @@ -49,12 +50,14 @@ const base::Value& child_element, ParsedDialAppInfo* out_app_info) { std::string tag_name; - if (!data_decoder::GetXmlElementTagName(child_element, &tag_name)) + if (!data_decoder::GetXmlElementTagName(child_element, &tag_name)) { return SafeDialAppInfoParser::ParsingResult::kInvalidXML; + } if (tag_name == "name") { - if (!data_decoder::GetXmlElementText(child_element, &out_app_info->name)) + if (!data_decoder::GetXmlElementText(child_element, &out_app_info->name)) { return SafeDialAppInfoParser::ParsingResult::kFailToReadName; + } } else if (tag_name == "options") { out_app_info->allow_stop = data_decoder::GetXmlElementAttribute( child_element, "allowStop") != "false"; @@ -63,8 +66,9 @@ data_decoder::GetXmlElementAttribute(child_element, "href"); } else if (tag_name == "state") { std::string state; - if (!data_decoder::GetXmlElementText(child_element, &state)) + if (!data_decoder::GetXmlElementText(child_element, &state)) { return SafeDialAppInfoParser::ParsingResult::kFailToReadState; + } out_app_info->state = ParseDialAppState(state); } else if (tag_name == "additionalData") { ProcessAdditionalDataElement(child_element, out_app_info); @@ -78,11 +82,13 @@ // |app_info|: app info object to be validated. SafeDialAppInfoParser::ParsingResult ValidateParsedAppInfo( const ParsedDialAppInfo& app_info) { - if (app_info.name.empty()) + if (app_info.name.empty()) { return SafeDialAppInfoParser::ParsingResult::kMissingName; + } - if (app_info.state == DialAppState::kUnknown) + if (app_info.state == DialAppState::kUnknown) { return SafeDialAppInfoParser::ParsingResult::kInvalidState; + } return SafeDialAppInfoParser::ParsingResult::kSuccess; }
diff --git a/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser.cc b/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser.cc index eaa4d1c..42eecaa 100644 --- a/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser.cc +++ b/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser.cc
@@ -20,8 +20,9 @@ // digits of the UUID as the friendly name. std::string ComputeFriendlyName(const std::string& unique_id, const std::string& model_name) { - if (model_name.empty() || unique_id.length() < 4) + if (model_name.empty() || unique_id.length() < 4) { return std::string(); + } std::string trimmed_unique_id = unique_id.substr(unique_id.length() - 4); return base::StringPrintf("%s [%s]", model_name.c_str(),
diff --git a/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser_unittest.cc b/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser_unittest.cc index 11d6abde..453ba055 100644 --- a/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser_unittest.cc
@@ -65,8 +65,9 @@ const std::string& from, const std::string& to) { size_t pos = input.find(from); - if (pos == std::string::npos) + if (pos == std::string::npos) { return input; + } return input.replace(pos, from.size(), to); }
diff --git a/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc b/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc index 121cfaa..c02b9f2 100644 --- a/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc +++ b/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc
@@ -32,10 +32,14 @@ TEST(DiscoveryNetworkListTest, StableSortDiscoveryNetworkInfoUnique) { std::vector<DiscoveryNetworkInfo> network_info({ - {"wlan0", "ssid0"}, {"wlan1", "ssid1"}, {"eth0", "de:ad:be:ef:00:11"}, + {"wlan0", "ssid0"}, + {"wlan1", "ssid1"}, + {"eth0", "de:ad:be:ef:00:11"}, }); std::vector<DiscoveryNetworkInfo> sorted_network_info({ - {"eth0", "de:ad:be:ef:00:11"}, {"wlan0", "ssid0"}, {"wlan1", "ssid1"}, + {"eth0", "de:ad:be:ef:00:11"}, + {"wlan0", "ssid0"}, + {"wlan1", "ssid1"}, }); StableSortDiscoveryNetworkInfo(network_info.begin(), network_info.end()); @@ -45,10 +49,14 @@ TEST(DiscoveryNetworkListTest, StableSortDiscoveryNetworkInfoDuplicates) { std::vector<DiscoveryNetworkInfo> network_info({ - {"wlan1", "ssid0"}, {"eth0", "de:ad:be:ef:00:11"}, {"wlan0", "ssid0"}, + {"wlan1", "ssid0"}, + {"eth0", "de:ad:be:ef:00:11"}, + {"wlan0", "ssid0"}, }); std::vector<DiscoveryNetworkInfo> sorted_network_info({ - {"eth0", "de:ad:be:ef:00:11"}, {"wlan1", "ssid0"}, {"wlan0", "ssid0"}, + {"eth0", "de:ad:be:ef:00:11"}, + {"wlan1", "ssid0"}, + {"wlan0", "ssid0"}, }); StableSortDiscoveryNetworkInfo(network_info.begin(), network_info.end());
diff --git a/chrome/browser/media/router/discovery/discovery_network_list_wifi_linux.cc b/chrome/browser/media/router/discovery/discovery_network_list_wifi_linux.cc index 14ff6362..6094f13 100644 --- a/chrome/browser/media/router/discovery/discovery_network_list_wifi_linux.cc +++ b/chrome/browser/media/router/discovery/discovery_network_list_wifi_linux.cc
@@ -4,13 +4,12 @@ #include "chrome/browser/media/router/discovery/discovery_network_list_wifi.h" +#include <linux/wireless.h> #include <string.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/types.h> -#include <linux/wireless.h> - #include "base/check.h" #include "base/files/scoped_file.h" #include "net/base/network_interfaces_linux.h" @@ -25,8 +24,9 @@ // AF_INET is for IPv4, so it may fail for IPv6-only hosts even when there // are interfaces up. ioctl_socket.reset(socket(AF_INET6, SOCK_DGRAM, 0)); - if (!ioctl_socket.is_valid()) + if (!ioctl_socket.is_valid()) { return false; + } } struct iwreq wreq = {}; strncpy(wreq.ifr_name, if_name.data(), IFNAMSIZ - 1);
diff --git a/chrome/browser/media/router/discovery/discovery_network_monitor.cc b/chrome/browser/media/router/discovery/discovery_network_monitor.cc index 4809e5c..827403cb 100644 --- a/chrome/browser/media/router/discovery/discovery_network_monitor.cc +++ b/chrome/browser/media/router/discovery/discovery_network_monitor.cc
@@ -102,8 +102,8 @@ network_info_function_(strategy) { DETACH_FROM_SEQUENCE(sequence_checker_); - content::GetNetworkConnectionTracker() - ->AddLeakyNetworkConnectionObserver(this); + content::GetNetworkConnectionTracker()->AddLeakyNetworkConnectionObserver( + this); // If the current connection type is available, call UpdateNetworkInfo, // otherwise let OnConnectionChanged call it when the connection type is
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc index efbb0246..3f2a69a 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc
@@ -280,8 +280,9 @@ } std::vector<MediaSinkInternal> test_sinks = GetFixedIPSinksFromCommandLine(); - if (!test_sinks.empty()) + if (!test_sinks.empty()) { OpenChannels(test_sinks, SinkSource::kMdns); + } } void CastMediaSinkServiceImpl::RecordDeviceCounts() { @@ -292,15 +293,17 @@ void CastMediaSinkServiceImpl::DiscoverSinksNow() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!dial_media_sink_service_) + if (!dial_media_sink_service_) { return; + } // Re-sync sinks from DialMediaSinkService. It's possible that a // DIAL-discovered sink was added here earlier, but was removed due to flaky // network. This gives CastMediaSinkServiceImpl an opportunity to recover even // if mDNS is not working for some reason. - for (const auto& sink : dial_media_sink_service_->GetSinks()) + for (const auto& sink : dial_media_sink_service_->GetSinks()) { TryConnectDialDiscoveredSink(sink.second); + } } void CastMediaSinkServiceImpl::OpenChannelsWithRandomizedDelay( @@ -494,8 +497,9 @@ // Erase the entry from |dial_sink_failure_count_| since the device is now // known to be a Cast device. const MediaSink::Id& sink_id = cast_sink.sink().id(); - if (sink_source != SinkSource::kDial) + if (sink_source != SinkSource::kDial) { dial_sink_failure_count_.erase(sink_id); + } // If there already is a connected sink whose IP endpoint stayed the same, // then there's no need to reopen a socket. We just update the sink info. @@ -564,8 +568,9 @@ pending_for_open_ip_endpoints_.erase(cast_sink.cast_data().ip_endpoint); bool succeeded = socket->error_state() == cast_channel::ChannelError::NONE; - if (backoff_entry) + if (backoff_entry) { backoff_entry->InformOfRequest(succeeded); + } CastAnalytics::RecordDeviceChannelOpenDuration(succeeded, clock_->Now() - start_time); if (succeeded) { @@ -588,14 +593,16 @@ const MediaSink::Id& sink_id = cast_sink.sink().id(); const net::IPEndPoint& ip_endpoint = cast_sink.cast_data().ip_endpoint; - if (sink_source == SinkSource::kDial) + if (sink_source == SinkSource::kDial) { ++dial_sink_failure_count_[sink_id]; + } int failure_count = ++failure_count_map_[sink_id]; failure_count_map_[sink_id] = std::min(failure_count, kMaxFailureCount); - if (!backoff_entry) + if (!backoff_entry) { backoff_entry = std::make_unique<net::BackoffEntry>(&backoff_policy_); + } if (backoff_entry->failure_count() >= retry_params_.max_retry_attempts) { OnChannelOpenFailed(ip_endpoint, cast_sink, std::move(callback)); @@ -662,33 +669,38 @@ entry.second.cast_data().ip_endpoint == ip_endpoint; }); - if (old_sink_it != sinks.end()) + if (old_sink_it != sinks.end()) { RemoveSink(old_sink_it->second); + } // Certain classes of Cast sinks support advertising via SSDP but do not // properly implement the rest of the DIAL protocol. If we successfully open // a Cast channel to a device that came from DIAL, remove it from // |dial_media_sink_service_|. This ensures the device shows up as a Cast sink // only. - if (dial_media_sink_service_) + if (dial_media_sink_service_) { dial_media_sink_service_->RemoveSinkById(GetDialSinkIdFromCast(sink_id)); - if (callback) + } + if (callback) { std::move(callback).Run(true); + } } void CastMediaSinkServiceImpl::OnChannelOpenFailed( const net::IPEndPoint& ip_endpoint, const MediaSinkInternal& sink, ChannelOpenedCallback callback) { - if (callback) + if (callback) { std::move(callback).Run(false); + } // Check that the IPEndPoints match before removing, as it is possible that // the sink was reconnected under a different IP before this method is // called. const MediaSinkInternal* existing_sink = GetSinkById(sink.sink().id()); if (!existing_sink || - !(ip_endpoint == existing_sink->cast_data().ip_endpoint)) + !(ip_endpoint == existing_sink->cast_data().ip_endpoint)) { return; + } LoggerList::GetInstance()->Log( LoggerImpl::Severity::kError, mojom::LogCategory::kDiscovery,
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_test_helpers.h b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_test_helpers.h index bf303ff..dc6e4ae 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_test_helpers.h +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_test_helpers.h
@@ -5,8 +5,6 @@ #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MDNS_CAST_MEDIA_SINK_SERVICE_TEST_HELPERS_H_ #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MDNS_CAST_MEDIA_SINK_SERVICE_TEST_HELPERS_H_ -#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h" - #include <string> #include "base/memory/raw_ptr.h" @@ -15,6 +13,7 @@ #include "base/test/mock_callback.h" #include "base/test/test_simple_task_runner.h" #include "base/timer/mock_timer.h" +#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h" #include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h" #include "chrome/browser/media/router/discovery/mdns/media_sink_util.h" #include "chrome/browser/media/router/test/mock_dns_sd_registry.h"
diff --git a/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h b/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h index 7ecf6ad..ab5c2a0c 100644 --- a/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h +++ b/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h
@@ -14,7 +14,7 @@ namespace local_discovery { class ServiceDiscoveryClient; -} // local_discovery +} // namespace local_discovery namespace media_router {
diff --git a/chrome/browser/media/router/discovery/mdns/dns_sd_registry.cc b/chrome/browser/media/router/discovery/mdns/dns_sd_registry.cc index 5d4a612..fb0cb6f 100644 --- a/chrome/browser/media/router/discovery/mdns/dns_sd_registry.cc +++ b/chrome/browser/media/router/discovery/mdns/dns_sd_registry.cc
@@ -76,8 +76,9 @@ bool DnsSdRegistry::ServiceTypeData::ClearServices() { lister_->Discover(); - if (service_list_.empty()) + if (service_list_.empty()) { return false; + } service_list_.clear(); return true; @@ -141,8 +142,9 @@ void DnsSdRegistry::RegisterDnsSdListener(const std::string& service_type) { DCHECK(thread_checker_.CalledOnValidThread()); - if (service_type.empty()) + if (service_type.empty()) { return; + } if (IsRegistered(service_type)) { service_data_map_[service_type]->ListenerAdded(); @@ -162,11 +164,13 @@ void DnsSdRegistry::UnregisterDnsSdListener(const std::string& service_type) { DCHECK(thread_checker_.CalledOnValidThread()); auto it = service_data_map_.find(service_type); - if (it == service_data_map_.end()) + if (it == service_data_map_.end()) { return; + } - if (service_data_map_[service_type]->ListenerRemoved()) + if (service_data_map_[service_type]->ListenerRemoved()) { service_data_map_.erase(it); + } } void DnsSdRegistry::ResetForTest() { @@ -178,8 +182,9 @@ bool added, const DnsSdService& service) { DCHECK(thread_checker_.CalledOnValidThread()); - if (!IsRegistered(service_type)) + if (!IsRegistered(service_type)) { return; + } // TODO(imcheng): This should be validated upstream in // dns_sd_device_lister.cc, i.e., |service.ip_address| should be a @@ -190,30 +195,35 @@ } bool is_updated = service_data_map_[service_type]->UpdateService(added, service); - if (is_updated) + if (is_updated) { DispatchApiEvent(service_type); + } } void DnsSdRegistry::ServiceRemoved(const std::string& service_type, const std::string& service_name) { DCHECK(thread_checker_.CalledOnValidThread()); - if (!IsRegistered(service_type)) + if (!IsRegistered(service_type)) { return; + } bool is_removed = service_data_map_[service_type]->RemoveService(service_name); - if (is_removed) + if (is_removed) { DispatchApiEvent(service_type); + } } void DnsSdRegistry::ServicesFlushed(const std::string& service_type) { DCHECK(thread_checker_.CalledOnValidThread()); - if (!IsRegistered(service_type)) + if (!IsRegistered(service_type)) { return; + } bool is_cleared = service_data_map_[service_type]->ClearServices(); - if (is_cleared) + if (is_cleared) { DispatchApiEvent(service_type); + } } void DnsSdRegistry::ServicesPermissionRejected() {
diff --git a/chrome/browser/media/router/discovery/mdns/dns_sd_registry_unittest.cc b/chrome/browser/media/router/discovery/mdns/dns_sd_registry_unittest.cc index 03672e3..86ef844 100644 --- a/chrome/browser/media/router/discovery/mdns/dns_sd_registry_unittest.cc +++ b/chrome/browser/media/router/discovery/mdns/dns_sd_registry_unittest.cc
@@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media/router/discovery/mdns/dns_sd_registry.h" + #include <memory> #include "base/memory/raw_ptr.h" #include "chrome/browser/media/router/discovery/mdns/dns_sd_delegate.h" #include "chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h" -#include "chrome/browser/media/router/discovery/mdns/dns_sd_registry.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -34,8 +35,9 @@ } int GetServiceListenerCount(const std::string& service_type) { - if (service_data_map_.find(service_type) == service_data_map_.end()) + if (service_data_map_.find(service_type) == service_data_map_.end()) { return 0; + } return service_data_map_[service_type]->GetListenerCount(); }
diff --git a/chrome/browser/media/router/discovery/mdns/media_sink_util.cc b/chrome/browser/media/router/discovery/mdns/media_sink_util.cc index 4bd34d82..c04b79ef 100644 --- a/chrome/browser/media/router/discovery/mdns/media_sink_util.cc +++ b/chrome/browser/media/router/discovery/mdns/media_sink_util.cc
@@ -33,19 +33,22 @@ CreateCastMediaSinkResult CreateCastMediaSink(const DnsSdService& service, MediaSinkInternal* cast_sink) { DCHECK(cast_sink); - if (service.service_name.find(kCastServiceType) == std::string::npos) + if (service.service_name.find(kCastServiceType) == std::string::npos) { return CreateCastMediaSinkResult::kNotCastDevice; + } net::IPAddress ip_address; - if (!ip_address.AssignFromIPLiteral(service.ip_address)) + if (!ip_address.AssignFromIPLiteral(service.ip_address)) { return CreateCastMediaSinkResult::kMissingOrInvalidIPAddress; + } std::map<std::string, std::string> service_data; for (const auto& item : service.service_data) { // |item| format should be "id=xxxxxx", etc. size_t split_idx = item.find('='); - if (split_idx == std::string::npos) + if (split_idx == std::string::npos) { continue; + } std::string key = item.substr(0, split_idx); std::string val = @@ -54,11 +57,13 @@ } std::string unique_id = service_data["id"]; - if (unique_id.empty()) + if (unique_id.empty()) { return CreateCastMediaSinkResult::kMissingID; + } std::string friendly_name = service_data["fn"]; - if (friendly_name.empty()) + if (friendly_name.empty()) { return CreateCastMediaSinkResult::kMissingFriendlyName; + } CastSinkExtraData extra_data; extra_data.ip_endpoint = @@ -89,8 +94,9 @@ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); std::string ips_string = command_line->GetSwitchValueASCII(kFixedCastDeviceIps); - if (ips_string.empty()) + if (ips_string.empty()) { return std::vector<MediaSinkInternal>(); + } std::vector<MediaSinkInternal> sinks; std::vector<std::string> ips = base::SplitString( @@ -98,15 +104,18 @@ for (const auto& ip : ips) { std::string host; int port = -1; - if (!net::ParseHostAndPort(ip, &host, &port)) + if (!net::ParseHostAndPort(ip, &host, &port)) { continue; + } net::IPAddress ip_address; - if (!ip_address.AssignFromIPLiteral(host)) + if (!ip_address.AssignFromIPLiteral(host)) { continue; + } - if (port == -1) + if (port == -1) { port = kCastControlPort; + } std::string instance_name; base::ReplaceChars(host, ".", "_", &instance_name);
diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc index eb0c8ba21..7a5f1c89 100644 --- a/chrome/browser/media/router/media_router_feature.cc +++ b/chrome/browser/media/router/media_router_feature.cc
@@ -112,8 +112,9 @@ bool MediaRouterEnabled(content::BrowserContext* context) { #if !BUILDFLAG(IS_ANDROID) - if (!base::FeatureList::IsEnabled(kMediaRouter)) + if (!base::FeatureList::IsEnabled(kMediaRouter)) { return false; + } #endif // !BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_CHROMEOS_ASH) // TODO(crbug.com/1380828): Make the Media Router feature configurable via a @@ -129,8 +130,9 @@ base::flat_map<content::BrowserContext*, bool>& pref_values = GetStoredPrefValues(); auto const it = pref_values.find(context); - if (it != pref_values.end()) + if (it != pref_values.end()) { return it->second; + } // Check the enterprise policy. const PrefService::Preference* pref = GetMediaRouterPref(context);
diff --git a/chrome/browser/media/router/mojo/media_router_desktop.cc b/chrome/browser/media/router/mojo/media_router_desktop.cc index db06c669..0bcddc0 100644 --- a/chrome/browser/media/router/mojo/media_router_desktop.cc +++ b/chrome/browser/media/router/mojo/media_router_desktop.cc
@@ -127,8 +127,9 @@ MediaRouterDesktop::~MediaRouterDesktop() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - if (media_sink_service_) + if (media_sink_service_) { media_sink_service_->RemoveLogger(GetLogger()); + } } void MediaRouterDesktop::Initialize() {
diff --git a/chrome/browser/media/router/mojo/media_router_desktop.h b/chrome/browser/media/router/mojo/media_router_desktop.h index 140ecad..4570602 100644 --- a/chrome/browser/media/router/mojo/media_router_desktop.h +++ b/chrome/browser/media/router/mojo/media_router_desktop.h
@@ -46,7 +46,7 @@ namespace content { class BrowserContext; struct DesktopMediaID; -} +} // namespace content namespace media { class FlingingController;
diff --git a/chrome/browser/media/router/mojo/media_sink_service_status.cc b/chrome/browser/media/router/mojo/media_sink_service_status.cc index 72d91d10..27900e1 100644 --- a/chrome/browser/media/router/mojo/media_sink_service_status.cc +++ b/chrome/browser/media/router/mojo/media_sink_service_status.cc
@@ -59,8 +59,9 @@ base::Value::Dict dict; for (const auto& sinks_it : sinks) { base::Value::List list; - for (const auto& inner_sink : sinks_it.second) + for (const auto& inner_sink : sinks_it.second) { list.Append(ToValue(inner_sink)); + } dict.Set(sinks_it.first, std::move(list)); } return dict;
diff --git a/chrome/browser/media/router/presentation/chrome_local_presentation_manager_factory_unittest.cc b/chrome/browser/media/router/presentation/chrome_local_presentation_manager_factory_unittest.cc index f6d87da..139a66aa3 100644 --- a/chrome/browser/media/router/presentation/chrome_local_presentation_manager_factory_unittest.cc +++ b/chrome/browser/media/router/presentation/chrome_local_presentation_manager_factory_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/media/router/presentation/chrome_local_presentation_manager_factory.h" + #include "chrome/test/base/testing_profile.h" #include "content/public/browser/browser_context.h" #include "content/public/test/browser_task_environment.h"
diff --git a/chrome/browser/media/router/providers/cast/app_activity.cc b/chrome/browser/media/router/providers/cast/app_activity.cc index ba81c7b..f4300cc 100644 --- a/chrome/browser/media/router/providers/cast/app_activity.cc +++ b/chrome/browser/media/router/providers/cast/app_activity.cc
@@ -48,8 +48,9 @@ AppActivity::~AppActivity() = default; void AppActivity::OnSessionSet(const CastSession& session) { - if (media_controller_) + if (media_controller_) { media_controller_->SetSession(session); + } } void AppActivity::OnSessionUpdated(const CastSession& session, @@ -58,8 +59,9 @@ client.second->SendMessageToClient( CreateUpdateSessionMessage(session, client.first, sink_, hash_token)); } - if (media_controller_) + if (media_controller_) { media_controller_->SetSession(session); + } } cast_channel::Result AppActivity::SendAppMessageToReceiver( @@ -97,8 +99,9 @@ std::optional<int> AppActivity::SendMediaRequestToReceiver( const CastInternalMessage& cast_message) { CastSession* session = GetSession(); - if (!session) + if (!session) { return std::nullopt; + } return message_handler_->SendMediaRequest( cast_channel_id(), cast_message.v2_message_body(), cast_message.client_id(), session->destination_id()); @@ -116,8 +119,9 @@ const base::Value::Dict& media_status, std::optional<int> request_id) { CastActivity::SendMediaStatusToClients(media_status, request_id); - if (media_controller_) + if (media_controller_) { media_controller_->SetMediaStatus(media_status); + } } void AppActivity::BindMediaController( @@ -181,11 +185,13 @@ } bool AppActivity::CanJoinSession(const CastMediaSource& cast_source) const { - if (!cast_source.ContainsApp(app_id())) + if (!cast_source.ContainsApp(app_id())) { return false; + } - if (base::Contains(connected_clients_, cast_source.client_id())) + if (base::Contains(connected_clients_, cast_source.client_id())) { return false; + } return true; }
diff --git a/chrome/browser/media/router/providers/cast/cast_activity.cc b/chrome/browser/media/router/providers/cast/cast_activity.cc index 2d81123..6dbbdb05 100644 --- a/chrome/browser/media/router/providers/cast/cast_activity.cc +++ b/chrome/browser/media/router/providers/cast/cast_activity.cc
@@ -62,13 +62,15 @@ // Don't erase by key here as the |client_id| may be referring to the // client being deleted. auto it = connected_clients_.find(client_id); - if (it != connected_clients_.end()) + if (it != connected_clients_.end()) { connected_clients_.erase(it); + } } CastSession* CastActivity::GetSession() const { - if (!session_id_) + if (!session_id_) { return nullptr; + } CastSession* session = session_tracker_->GetSessionById(*session_id_); if (!session) { // TODO(crbug.com/41426190): Add UMA metrics for this and other error @@ -119,19 +121,22 @@ void CastActivity::SendMediaStatusToClients( const base::Value::Dict& media_status, std::optional<int> request_id) { - for (auto& client : connected_clients_) + for (auto& client : connected_clients_) { client.second->SendMediaMessageToClient(media_status, request_id); + } } void CastActivity::ClosePresentationConnections( blink::mojom::PresentationConnectionCloseReason close_reason) { - for (auto& client : connected_clients_) + for (auto& client : connected_clients_) { client.second->CloseConnection(close_reason); + } } void CastActivity::TerminatePresentationConnections() { - for (auto& client : connected_clients_) + for (auto& client : connected_clients_) { client.second->TerminateConnection(); + } } std::optional<int> CastActivity::SendMediaRequestToReceiver( @@ -190,8 +195,9 @@ std::vector<std::string> leaving_client_ids; for (const auto& pair : connected_clients_) { if (pair.second->MatchesAutoJoinPolicy(client.origin(), - client.frame_tree_node_id())) + client.frame_tree_node_id())) { leaving_client_ids.push_back(pair.first); + } } for (const auto& leaving_client_id : leaving_client_ids) {
diff --git a/chrome/browser/media/router/providers/cast/cast_activity_manager.cc b/chrome/browser/media/router/providers/cast/cast_activity_manager.cc index ca8ca13..d318234299 100644 --- a/chrome/browser/media/router/providers/cast/cast_activity_manager.cc +++ b/chrome/browser/media/router/providers/cast/cast_activity_manager.cc
@@ -105,8 +105,9 @@ for (const auto& sink_id_session : session_tracker_->GetSessions()) { const MediaSinkInternal* sink = media_sink_service_->GetSinkById(sink_id_session.first); - if (!sink) + if (!sink) { break; + } AddNonLocalActivity(*sink, *sink_id_session.second); } session_tracker_->AddObserver(this); @@ -189,8 +190,9 @@ // function is a default constructed `result`, which is supposed to be // ignored. std::optional<base::Value> opt_result = std::nullopt; - if (result.has_value() && !result->is_none()) + if (result.has_value() && !result->is_none()) { opt_result = std::move(*result); + } DoLaunchSessionParams params(route, cast_source, sink, origin, frame_tree_node_id, std::move(opt_result), @@ -295,10 +297,12 @@ [&cast_source, &origin, frame_tree_node_id](const auto& pair) { AutoJoinPolicy policy = cast_source.auto_join_policy(); const AppActivity* activity = pair.second; - if (!activity->route().is_local()) + if (!activity->route().is_local()) { return false; - if (!cast_source.ContainsApp(activity->app_id())) + } + if (!cast_source.ContainsApp(activity->app_id())) { return false; + } return activity->HasJoinableClient(policy, origin, frame_tree_node_id); }); return it == app_activities_.end() ? nullptr : it->second; @@ -818,8 +822,9 @@ std::vector<MediaRoute> CastActivityManager::GetRoutes() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); std::vector<MediaRoute> routes; - for (const auto& activity : activities_) + for (const auto& activity : activities_) { routes.push_back(activity.second->route()); + } return routes; } @@ -1037,8 +1042,9 @@ PresentationConnectionCloseReason::CONNECTION_ERROR); if (result_code != mojom::RouteRequestResultCode::USER_NOT_ALLOWED && - result_code != mojom::RouteRequestResultCode::NOTIFICATION_DISABLED) + result_code != mojom::RouteRequestResultCode::NOTIFICATION_DISABLED) { SendFailedToCastIssue(params.sink.id(), params.route.media_route_id()); + } } void CastActivityManager::HandleLaunchSessionResponseMiddleStages( @@ -1116,8 +1122,9 @@ const MediaSinkInternal& sink) const { const auto& sink_capabilities = sink.cast_data().capabilities; for (const auto& info : source.app_infos()) { - if (sink_capabilities.HasAll(info.required_capabilities)) + if (sink_capabilities.HasAll(info.required_capabilities)) { return info.app_id; + } } DUMP_WILL_BE_NOTREACHED() << "Can't determine app ID from capabilities."; return source.app_infos()[0].app_id; @@ -1174,8 +1181,9 @@ frame_tree_node_id(frame_tree_node_id), creation_time(base::Time::Now()), callback(std::move(callback)) { - if (app_params) + if (app_params) { this->app_params = app_params->Clone(); + } } void CastActivityManager::AddMirroringActivityForTest(
diff --git a/chrome/browser/media/router/providers/cast/cast_activity_test_base.cc b/chrome/browser/media/router/providers/cast/cast_activity_test_base.cc index 928dab92..b43f2acc 100644 --- a/chrome/browser/media/router/providers/cast/cast_activity_test_base.cc +++ b/chrome/browser/media/router/providers/cast/cast_activity_test_base.cc
@@ -109,8 +109,9 @@ testing::Mock::VerifyAndClearExpectations(&socket_service_); testing::Mock::VerifyAndClearExpectations(&message_handler_); testing::Mock::VerifyAndClearExpectations(&manager_); - for (const auto* client : MockCastSessionClient::instances()) + for (const auto* client : MockCastSessionClient::instances()) { testing::Mock::VerifyAndClearExpectations(&client); + } } std::unique_ptr<CastSessionClient> CastActivityTestBase::MakeClientForTest(
diff --git a/chrome/browser/media/router/providers/cast/cast_app_availability_tracker.cc b/chrome/browser/media/router/providers/cast/cast_app_availability_tracker.cc index f2ba1bc..55a569f 100644 --- a/chrome/browser/media/router/providers/cast/cast_app_availability_tracker.cc +++ b/chrome/browser/media/router/providers/cast/cast_app_availability_tracker.cc
@@ -17,16 +17,18 @@ base::flat_set<std::string> CastAppAvailabilityTracker::RegisterSource( const CastMediaSource& source) { - if (base::Contains(registered_sources_, source.source_id())) + if (base::Contains(registered_sources_, source.source_id())) { return base::flat_set<std::string>(); + } registered_sources_.emplace(source.source_id(), source); base::flat_set<std::string> new_app_ids; for (const auto& app_info : source.app_infos()) { const auto& app_id = app_info.app_id; - if (++registration_count_by_app_id_[app_id] == 1) + if (++registration_count_by_app_id_[app_id] == 1) { new_app_ids.insert(app_id); + } } return new_app_ids; } @@ -34,16 +36,18 @@ void CastAppAvailabilityTracker::UnregisterSource( const CastMediaSource& source) { auto it = registered_sources_.find(source.source_id()); - if (it == registered_sources_.end()) + if (it == registered_sources_.end()) { return; + } for (const auto& app_info : it->second.app_infos()) { const std::string& app_id = app_info.app_id; auto count_it = registration_count_by_app_id_.find(app_id); CHECK(count_it != registration_count_by_app_id_.end(), base::NotFatalUntil::M130); - if (--(count_it->second) == 0) + if (--(count_it->second) == 0) { registration_count_by_app_id_.erase(count_it); + } } registered_sources_.erase(it); @@ -69,13 +73,15 @@ old_availability != new_availability; availabilities[app_id] = availability; - if (!updated) + if (!updated) { return std::vector<CastMediaSource>(); + } std::vector<CastMediaSource> affected_sources; for (const auto& source : registered_sources_) { - if (source.second.ContainsApp(app_id)) + if (source.second.ContainsApp(app_id)) { affected_sources.push_back(source.second); + } } return affected_sources; } @@ -90,21 +96,24 @@ std::vector<CastMediaSource> CastAppAvailabilityTracker::GetSupportedSources( const MediaSink::Id& sink_id) const { auto it = capabilities_and_availabilities_.find(sink_id); - if (it == capabilities_and_availabilities_.end()) + if (it == capabilities_and_availabilities_.end()) { return std::vector<CastMediaSource>(); + } // Find all app IDs that are available on the sink. std::vector<std::string> supported_app_ids; for (const auto& availability : it->second.availabilities) { - if (availability.second.first == GetAppAvailabilityResult::kAvailable) + if (availability.second.first == GetAppAvailabilityResult::kAvailable) { supported_app_ids.push_back(availability.first); + } } // Find all registered sources whose query results contains the sink ID. std::vector<CastMediaSource> sources; for (const auto& source : registered_sources_) { - if (source.second.ContainsAnyAppFrom(supported_app_ids)) + if (source.second.ContainsAnyAppFrom(supported_app_ids)) { sources.push_back(source.second); + } } return sources; } @@ -113,21 +122,24 @@ CastAppAvailabilityTracker::GetAvailability(const MediaSink::Id& sink_id, const std::string& app_id) const { auto availabilities_it = capabilities_and_availabilities_.find(sink_id); - if (availabilities_it == capabilities_and_availabilities_.end()) + if (availabilities_it == capabilities_and_availabilities_.end()) { return {GetAppAvailabilityResult::kUnknown, base::TimeTicks()}; + } const auto& availability_map = availabilities_it->second.availabilities; auto availability_it = availability_map.find(app_id); - if (availability_it == availability_map.end()) + if (availability_it == availability_map.end()) { return {GetAppAvailabilityResult::kUnknown, base::TimeTicks()}; + } return availability_it->second; } std::vector<std::string> CastAppAvailabilityTracker::GetRegisteredApps() const { std::vector<std::string> registered_apps; - for (const auto& app_ids_and_count : registration_count_by_app_id_) + for (const auto& app_ids_and_count : registration_count_by_app_id_) { registered_apps.push_back(app_ids_and_count.first); + } return registered_apps; }
diff --git a/chrome/browser/media/router/providers/cast/cast_app_discovery_service.cc b/chrome/browser/media/router/providers/cast/cast_app_discovery_service.cc index 4d1d738..b7742d85 100644 --- a/chrome/browser/media/router/providers/cast/cast_app_discovery_service.cc +++ b/chrome/browser/media/router/providers/cast/cast_app_discovery_service.cc
@@ -170,8 +170,9 @@ // Any queries that currently contains this sink should be updated. UpdateSinkQueries(availability_tracker_.GetSupportedSources(sink_id)); - for (const std::string& app_id : availability_tracker_.GetRegisteredApps()) + for (const std::string& app_id : availability_tracker_.GetRegisteredApps()) { RequestAppAvailability(socket, app_id, sink); + } } void CastAppDiscoveryServiceImpl::OnSinkRemoved(const MediaSinkInternal& sink) { @@ -217,8 +218,9 @@ for (const auto& source : sources) { const MediaSource::Id& source_id = source.source_id(); auto it = sink_queries_.find(source_id); - if (it == sink_queries_.end()) + if (it == sink_queries_.end()) { continue; + } base::flat_set<MediaSink::Id> sink_ids = availability_tracker_.GetAvailableSinks(source); it->second->Notify(source_id, GetSinksByIds(sink_ids)); @@ -230,8 +232,9 @@ std::vector<MediaSinkInternal> sinks; for (const auto& sink_id : sink_ids) { const MediaSinkInternal* sink = media_sink_service_->GetSinkById(sink_id); - if (sink) + if (sink) { sinks.push_back(*sink); + } } return sinks; }
diff --git a/chrome/browser/media/router/providers/cast/cast_internal_message_util.cc b/chrome/browser/media/router/providers/cast/cast_internal_message_util.cc index 8ff5a7a..8ede051 100644 --- a/chrome/browser/media/router/providers/cast/cast_internal_message_util.cc +++ b/chrome/browser/media/router/providers/cast/cast_internal_message_util.cc
@@ -83,8 +83,9 @@ const std::string& key, std::string* out) { const std::string* string = value.FindString(key); - if (!string) + if (!string) { return false; + } *out = *string; return !out->empty(); @@ -102,8 +103,9 @@ const std::string& key, base::Value::Dict& to) { const base::Value* value = from.Find(key); - if (value) + if (value) { to.Set(key, value->Clone()); + } } CastInternalMessage::Type CastInternalMessageTypeFromString( @@ -175,10 +177,11 @@ // When `payload` is empty, we want to set `message` to null instead of {} in // the JSON that is generated. - if (payload.empty()) + if (payload.empty()) { message.Set("message", base::Value()); - else + } else { message.Set("message", std::move(payload)); + } if (sequence_number) { message.Set("sequenceNumber", base::Value(*sequence_number)); @@ -534,18 +537,24 @@ base::Value::List SupportedMediaCommandsToListValue(int media_commands) { base::Value::List value; - if (media_commands & static_cast<int>(MediaCommand::kPause)) + if (media_commands & static_cast<int>(MediaCommand::kPause)) { value.Append(kMediaCommandPause); - if (media_commands & static_cast<int>(MediaCommand::kSeek)) + } + if (media_commands & static_cast<int>(MediaCommand::kSeek)) { value.Append(kMediaCommandSeek); - if (media_commands & static_cast<int>(MediaCommand::kStreamVolume)) + } + if (media_commands & static_cast<int>(MediaCommand::kStreamVolume)) { value.Append(kMediaCommandStreamVolume); - if (media_commands & static_cast<int>(MediaCommand::kStreamMute)) + } + if (media_commands & static_cast<int>(MediaCommand::kStreamMute)) { value.Append(kMediaCommandStreamMute); - if (media_commands & static_cast<int>(MediaCommand::kQueueNext)) + } + if (media_commands & static_cast<int>(MediaCommand::kQueueNext)) { value.Append(kMediaCommandQueueNext); - if (media_commands & static_cast<int>(MediaCommand::kQueuePrev)) + } + if (media_commands & static_cast<int>(MediaCommand::kQueuePrev)) { value.Append(kMediaCommandQueuePrev); + } return value; }
diff --git a/chrome/browser/media/router/providers/cast/cast_media_controller.cc b/chrome/browser/media/router/providers/cast/cast_media_controller.cc index 014a293c..5fff5cc 100644 --- a/chrome/browser/media/router/providers/cast/cast_media_controller.cc +++ b/chrome/browser/media/router/providers/cast/cast_media_controller.cc
@@ -25,17 +25,20 @@ constexpr int kQueueNextJumpValue = 1; void SetIfValid(std::string* out, const base::Value* value) { - if (value && value->is_string()) + if (value && value->is_string()) { *out = value->GetString(); + } } void SetIfValid(bool* out, const base::Value* value) { - if (value && value->is_bool()) + if (value && value->is_bool()) { *out = value->GetBool(); + } } void SetIfNonNegative(float* out, const base::Value* value) { - if (!value) + if (!value) { return; + } if (value->is_double() && value->GetDouble() >= 0) { *out = value->GetDouble(); } else if (value->is_int() && value->GetInt() >= 0) { @@ -43,12 +46,14 @@ } } void SetIfNonNegative(int* out, const base::Value* value) { - if (value && value->is_int() && value->GetInt() >= 0) + if (value && value->is_int() && value->GetInt() >= 0) { *out = value->GetInt(); + } } void SetIfNonNegative(base::TimeDelta* out, const base::Value* value) { - if (!value) + if (!value) { return; + } if (value->is_double() && value->GetDouble() >= 0) { *out = base::Seconds(value->GetDouble()); } else if (value->is_int() && value->GetInt() >= 0) { @@ -63,8 +68,9 @@ int height = 0; SetIfNonNegative(&width, dict.Find("width")); SetIfNonNegative(&height, dict.Find("height")); - if (width <= 0 || height <= 0) + if (width <= 0 || height <= 0) { return std::nullopt; + } return std::make_optional<gfx::Size>(width, height); } @@ -77,22 +83,25 @@ CastMediaController::~CastMediaController() = default; void CastMediaController::Play() { - if (session_id_.empty()) + if (session_id_.empty()) { return; + } activity_->SendMediaRequestToReceiver( *CastInternalMessage::From(CreateMediaRequest(V2MessageType::kPlay))); } void CastMediaController::Pause() { - if (session_id_.empty()) + if (session_id_.empty()) { return; + } activity_->SendMediaRequestToReceiver( *CastInternalMessage::From(CreateMediaRequest(V2MessageType::kPause))); } void CastMediaController::SetMute(bool mute) { - if (session_id_.empty()) + if (session_id_.empty()) { return; + } auto message = CastInternalMessage::From( CreateVolumeRequest() .SetByDottedPath("message.volume.muted", mute) @@ -102,8 +111,9 @@ } void CastMediaController::SetVolume(float volume) { - if (session_id_.empty()) + if (session_id_.empty()) { return; + } activity_->SendSetVolumeRequestToReceiver( *CastInternalMessage::From( CreateVolumeRequest() @@ -114,16 +124,18 @@ } void CastMediaController::Seek(base::TimeDelta time) { - if (session_id_.empty()) + if (session_id_.empty()) { return; + } activity_->SendMediaRequestToReceiver(*CastInternalMessage::From( CreateMediaRequest(V2MessageType::kSeek) .SetByDottedPath("message.currentTime", time.InSecondsF()))); } void CastMediaController::NextTrack() { - if (session_id_.empty()) + if (session_id_.empty()) { return; + } // We do not use |kQueueNext| because not all receiver apps support it. // See crbug.com/1078601. activity_->SendMediaRequestToReceiver(*CastInternalMessage::From( @@ -132,8 +144,9 @@ } void CastMediaController::PreviousTrack() { - if (session_id_.empty()) + if (session_id_.empty()) { return; + } // We do not use |kQueuePrev| because not all receiver apps support it. // See crbug.com/1078601. activity_->SendMediaRequestToReceiver(*CastInternalMessage::From( @@ -152,8 +165,9 @@ session_id_ = session.session_id(); const base::Value::Dict* volume = session.value().FindDictByDottedPath("receiver.volume"); - if (!volume) + if (!volume) { return; + } SetIfNonNegative(&media_status_.volume, volume->Find("level")); SetIfValid(&media_status_.is_muted, volume->Find("muted")); const std::string* volume_type = volume->FindString("controlType"); @@ -200,13 +214,16 @@ void CastMediaController::UpdateMediaStatus( const base::Value::Dict& message_value) { const base::Value::List* status_list = message_value.FindList("status"); - if (!status_list) + if (!status_list) { return; - if (status_list->empty()) + } + if (status_list->empty()) { return; + } const base::Value& status_value = (*status_list)[0]; - if (!status_value.is_dict()) + if (!status_value.is_dict()) { return; + } SetIfNonNegative(&media_session_id_, status_value.GetDict().Find("mediaSessionId")); SetIfValid(&media_status_.title, @@ -224,12 +241,14 @@ if (images) { media_status_.images.clear(); for (const base::Value& image_value : *images) { - if (!image_value.is_dict()) + if (!image_value.is_dict()) { continue; + } const base::Value::Dict& image_dict = image_value.GetDict(); const std::string* url_string = image_dict.FindString("url"); - if (!url_string) + if (!url_string) { continue; + } media_status_.images.emplace_back(std::in_place, GURL(*url_string), GetValidSize(image_dict)); }
diff --git a/chrome/browser/media/router/providers/cast/cast_media_controller_unittest.cc b/chrome/browser/media/router/providers/cast/cast_media_controller_unittest.cc index 53de3ccb..ea148572 100644 --- a/chrome/browser/media/router/providers/cast/cast_media_controller_unittest.cc +++ b/chrome/browser/media/router/providers/cast/cast_media_controller_unittest.cc
@@ -70,14 +70,18 @@ base::Value::List commands; // |can_set_volume| and |can_mute| are not used, because the receiver volume // is used instead. - if (status.can_play_pause) + if (status.can_play_pause) { commands.Append("pause"); - if (status.can_seek) + } + if (status.can_seek) { commands.Append("seek"); - if (status.can_skip_to_next_track) + } + if (status.can_skip_to_next_track) { commands.Append("queue_next"); - if (status.can_skip_to_previous_track) + } + if (status.can_skip_to_previous_track) { commands.Append("queue_next"); + } return commands; }
diff --git a/chrome/browser/media/router/providers/cast/cast_media_route_provider.cc b/chrome/browser/media/router/providers/cast/cast_media_route_provider.cc index 6c9dd36..49a9cf0 100644 --- a/chrome/browser/media/router/providers/cast/cast_media_route_provider.cc +++ b/chrome/browser/media/router/providers/cast/cast_media_route_provider.cc
@@ -62,8 +62,9 @@ if (IsSiteInitiatedMirroringSource(source_id) && !base::FeatureList::IsEnabled(kAllowAllSitesToInitiateMirroring)) { allowed_origins.reserve(kPresentationApiAllowlist.size()); - for (const auto& origin : kPresentationApiAllowlist) + for (const auto& origin : kPresentationApiAllowlist) { allowed_origins.push_back(url::Origin::Create(GURL(origin))); + } } return allowed_origins; } @@ -266,13 +267,15 @@ void CastMediaRouteProvider::StartObservingMediaSinks( const std::string& media_source) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (base::Contains(sink_queries_, media_source)) + if (base::Contains(sink_queries_, media_source)) { return; + } std::unique_ptr<CastMediaSource> cast_source = CastMediaSource::FromMediaSourceId(media_source); - if (!cast_source) + if (!cast_source) { return; + } sink_queries_[media_source] = app_discovery_service_->StartObservingMediaSinks( @@ -320,8 +323,9 @@ activity_manager_->GetCastSessionTracker()->GetSessions(); mojom::CastProviderStatePtr cast_state(mojom::CastProviderState::New()); for (const auto& session : sessions) { - if (!session.second) + if (!session.second) { continue; + } mojom::CastSessionStatePtr session_state(mojom::CastSessionState::New()); session_state->sink_id = session.first; session_state->app_id = session.second->app_id();
diff --git a/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.cc b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.cc index 40a03a3df..4f5b0a9e 100644 --- a/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.cc +++ b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.cc
@@ -15,10 +15,11 @@ void RecordAppAvailabilityResult(cast_channel::GetAppAvailabilityResult result, base::TimeDelta duration) { - if (result == cast_channel::GetAppAvailabilityResult::kUnknown) + if (result == cast_channel::GetAppAvailabilityResult::kUnknown) { UMA_HISTOGRAM_TIMES(kHistogramAppAvailabilityFailure, duration); - else + } else { UMA_HISTOGRAM_TIMES(kHistogramAppAvailabilitySuccess, duration); + } } void RecordLaunchSessionResponseAppType(const base::Value* app_type) {
diff --git a/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h index 045ceed7..e3059fc4 100644 --- a/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h +++ b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h
@@ -48,7 +48,6 @@ void RecordAppAvailabilityResult(cast_channel::GetAppAvailabilityResult result, base::TimeDelta duration); - // Records the type of app (web app, native Android app etc.) launched on the // receiver side in an Enumeration histogram. // If |app_type| is "WEB", a kWeb will be recorded. If |app_type| is
diff --git a/chrome/browser/media/router/providers/cast/cast_session_client_impl.cc b/chrome/browser/media/router/providers/cast/cast_session_client_impl.cc index 833f92e7..2546102 100644 --- a/chrome/browser/media/router/providers/cast/cast_session_client_impl.cc +++ b/chrome/browser/media/router/providers/cast/cast_session_client_impl.cc
@@ -155,8 +155,9 @@ void CastSessionClientImpl::OnMessage( PresentationConnectionMessagePtr message) { - if (!message->is_message()) + if (!message->is_message()) { return; + } GetDataDecoder().ParseJson( message->get_message(), @@ -316,15 +317,17 @@ void CastSessionClientImpl::CloseConnection( PresentationConnectionCloseReason close_reason) { - if (connection_remote_) + if (connection_remote_) { connection_remote_->DidClose(close_reason); + } TearDownPresentationConnection(); activity_->CloseConnectionOnReceiver(client_id(), close_reason); } void CastSessionClientImpl::TerminateConnection() { - if (connection_remote_) + if (connection_remote_) { connection_remote_->DidChangeState(PresentationConnectionState::TERMINATED); + } TearDownPresentationConnection(); }
diff --git a/chrome/browser/media/router/providers/cast/cast_session_tracker.cc b/chrome/browser/media/router/providers/cast/cast_session_tracker.cc index f995857c..c606bdea 100644 --- a/chrome/browser/media/router/providers/cast/cast_session_tracker.cc +++ b/chrome/browser/media/router/providers/cast/cast_session_tracker.cc
@@ -25,8 +25,9 @@ // static CastSessionTracker* CastSessionTracker::GetInstance() { - if (instance_for_test_) + if (instance_for_test_) { return instance_for_test_; + } static CastSessionTracker* instance = new CastSessionTracker( DualMediaSinkService::GetInstance()->GetCastMediaSinkServiceImpl(), @@ -90,8 +91,9 @@ const MediaSink::Id& sink_id = sink.sink().id(); if (!session) { if (sessions_by_sink_id_.erase(sink_id)) { - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnSessionRemoved(sink); + } } return; } @@ -103,8 +105,9 @@ it->second->UpdateSession(std::move(session)); } - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnSessionAddedOrUpdated(sink, *it->second); + } } void CastSessionTracker::HandleMediaStatusMessage( @@ -144,8 +147,9 @@ media_dict.Set("sessionId", session_id); std::optional<int> supported_media_commands = media_dict.FindInt("supportedMediaCommands"); - if (!supported_media_commands.has_value()) + if (!supported_media_commands.has_value()) { continue; + } media_dict.Set( "supportedMediaCommands", @@ -161,8 +165,9 @@ cast_channel::GetRequestIdFromResponse(updated_message); // Notify observers of media update. - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnMediaStatusUpdated(sink, updated_message, request_id); + } } void CastSessionTracker::CopySavedMediaFieldsToMediaList( @@ -173,34 +178,39 @@ // to the corresponding objects in |media_list|. const base::Value::List* session_media_value_list = session->value().FindList("media"); - if (!session_media_value_list) + if (!session_media_value_list) { return; + } for (auto& media : media_list) { base::Value::Dict& media_dict = media.GetDict(); std::optional<int> media_session_id = media_dict.FindInt("mediaSessionId"); - if (!media_session_id.has_value() || media_dict.Find("media")) + if (!media_session_id.has_value() || media_dict.Find("media")) { continue; + } auto session_media_it = base::ranges::find( *session_media_value_list, media_session_id, [](const base::Value& session_media) { return session_media.GetDict().FindInt("mediaSessionId"); }); - if (session_media_it == session_media_value_list->end()) + if (session_media_it == session_media_value_list->end()) { continue; + } const base::Value* session_media = session_media_it->GetDict().Find("media"); - if (session_media) + if (session_media) { media_dict.Set("media", session_media->Clone()); + } } } const MediaSinkInternal* CastSessionTracker::GetSinkByChannelId( int channel_id) const { for (const auto& sink : media_sink_service_->GetSinks()) { - if (sink.second.cast_data().cast_channel_id == channel_id) + if (sink.second.cast_data().cast_channel_id == channel_id) { return &sink.second; + } } return nullptr; } @@ -213,8 +223,9 @@ void CastSessionTracker::OnSinkRemoved(const MediaSinkInternal& sink) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (sessions_by_sink_id_.erase(sink.sink().id())) { - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnSessionRemoved(sink); + } } }
diff --git a/chrome/browser/media/router/providers/cast/test_util.h b/chrome/browser/media/router/providers/cast/test_util.h index 95cdc4f3..9323d13 100644 --- a/chrome/browser/media/router/providers/cast/test_util.h +++ b/chrome/browser/media/router/providers/cast/test_util.h
@@ -26,8 +26,9 @@ return false; } - if (arg.has_session_id() && arg.session_id() != message->session_id()) + if (arg.has_session_id() && arg.session_id() != message->session_id()) { return false; + } switch (arg.type()) { case CastInternalMessage::Type::kAppMessage:
diff --git a/chrome/browser/media/router/providers/dial/dial_activity_manager.cc b/chrome/browser/media/router/providers/dial/dial_activity_manager.cc index 2e24d53e..71ec242 100644 --- a/chrome/browser/media/router/providers/dial/dial_activity_manager.cc +++ b/chrome/browser/media/router/providers/dial/dial_activity_manager.cc
@@ -33,8 +33,9 @@ // |response_info|. GURL GetApplicationInstanceURL( const network::mojom::URLResponseHead& response_info) { - if (!response_info.headers) + if (!response_info.headers) { return GURL(); + } // If the application is running after the action specified above, the DIAL // server SHALL return an HTTP response with response code 201 Created. In @@ -50,8 +51,9 @@ } GURL app_instance_url(*location_header); - if (!app_instance_url.is_valid() || !app_instance_url.SchemeIs("http")) + if (!app_instance_url.is_valid() || !app_instance_url.SchemeIs("http")) { return GURL(); + } return app_instance_url; } @@ -79,12 +81,14 @@ const url::Origin& client_origin) { MediaSource source(source_id); GURL url = source.url(); - if (!url.is_valid()) + if (!url.is_valid()) { return nullptr; + } std::string app_name = source.AppNameFromDialSource(); - if (app_name.empty()) + if (app_name.empty()) { return nullptr; + } std::string client_id; std::optional<std::string> post_data; @@ -99,8 +103,9 @@ post_data = std::string(query_it.GetValue()); } } - if (client_id.empty()) + if (client_id.empty()) { return nullptr; + } GURL app_launch_url = GetAppURL(sink, app_name); DCHECK(app_launch_url.is_valid()); @@ -190,8 +195,9 @@ auto& record = record_it->second; if (record->pending_launch_request || - record->state == DialActivityManager::Record::State::kLaunched) + record->state == DialActivityManager::Record::State::kLaunched) { return; + } if (!message.do_launch) { record->state = DialActivityManager::Record::State::kLaunched; @@ -219,9 +225,10 @@ std::pair<std::optional<std::string>, mojom::RouteRequestResultCode> DialActivityManager::CanStopApp(const MediaRoute::Id& route_id) const { auto record_it = records_.find(route_id); - if (record_it == records_.end()) + if (record_it == records_.end()) { return {"Activity not found", mojom::RouteRequestResultCode::ROUTE_NOT_FOUND}; + } if (record_it->second->pending_stop_request) { return {"A pending request already exists", @@ -269,8 +276,9 @@ std::vector<MediaRoute> DialActivityManager::GetRoutes() const { std::vector<MediaRoute> routes; - for (const auto& record : records_) + for (const auto& record : records_) { routes.push_back(record.second->activity.route); + } return routes; } @@ -287,8 +295,9 @@ const std::string& response) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto record_it = records_.find(route_id); - if (record_it == records_.end()) + if (record_it == records_.end()) { return; + } auto& record = record_it->second; const network::mojom::URLResponseHead* response_info = @@ -306,8 +315,9 @@ std::optional<int> response_code) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto record_it = records_.find(route_id); - if (record_it == records_.end()) + if (record_it == records_.end()) { return; + } // Move the callback out of the record since we are erasing the record. auto cb = std::move(record_it->second->pending_launch_request->callback); @@ -319,8 +329,9 @@ const std::string& response) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto record_it = records_.find(route_id); - if (record_it == records_.end()) + if (record_it == records_.end()) { return; + } // Move the callback out of the record since we are erasing the record. auto& record = record_it->second; @@ -334,8 +345,9 @@ std::optional<int> response_code) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto record_it = records_.find(route_id); - if (record_it == records_.end()) + if (record_it == records_.end()) { return; + } // The vast majority of failures to stop a DIAL session is due to the session // no longer existing on the receiver device. So we make another request to @@ -354,8 +366,9 @@ const std::string& app_name, DialAppInfoResult result) { auto record_it = records_.find(route_id); - if (record_it == records_.end()) + if (record_it == records_.end()) { return; + } auto& record = record_it->second; auto cb = std::move(record->pending_stop_request->callback);
diff --git a/chrome/browser/media/router/providers/dial/dial_internal_message_fuzzer.cc b/chrome/browser/media/router/providers/dial/dial_internal_message_fuzzer.cc index 55904767..c6ca0c2 100644 --- a/chrome/browser/media/router/providers/dial/dial_internal_message_fuzzer.cc +++ b/chrome/browser/media/router/providers/dial/dial_internal_message_fuzzer.cc
@@ -13,19 +13,22 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Limit input size to prevent out-of-memory failures like the one seen in // crbug.com/964715. - if (size > 16 * 1024) + if (size > 16 * 1024) { return 0; + } std::optional<base::Value> input = base::JSONReader::Read( std::string(reinterpret_cast<const char*>(data), size)); - if (!input || !input.value().is_dict()) + if (!input || !input.value().is_dict()) { return 0; + } std::string error_unused; auto dial_internal_message = DialInternalMessage::From( std::move(input.value().GetDict()), &error_unused); - if (!dial_internal_message) + if (!dial_internal_message) { return 0; + } DialInternalMessageUtil::IsStopSessionMessage(*dial_internal_message);
diff --git a/chrome/browser/media/router/providers/dial/dial_internal_message_util.cc b/chrome/browser/media/router/providers/dial/dial_internal_message_util.cc index 193c5c5..a4df3461 100644 --- a/chrome/browser/media/router/providers/dial/dial_internal_message_util.cc +++ b/chrome/browser/media/router/providers/dial/dial_internal_message_util.cc
@@ -58,26 +58,33 @@ DialInternalMessageType StringToDialInternalMessageType( const std::string& str_type) { - if (str_type == "client_connect") + if (str_type == "client_connect") { return DialInternalMessageType::kClientConnect; + } - if (str_type == "v2_message") + if (str_type == "v2_message") { return DialInternalMessageType::kV2Message; + } - if (str_type == "receiver_action") + if (str_type == "receiver_action") { return DialInternalMessageType::kReceiverAction; + } - if (str_type == "new_session") + if (str_type == "new_session") { return DialInternalMessageType::kNewSession; + } - if (str_type == "custom_dial_launch") + if (str_type == "custom_dial_launch") { return DialInternalMessageType::kCustomDialLaunch; + } - if (str_type == "dial_app_info") + if (str_type == "dial_app_info") { return DialInternalMessageType::kDialAppInfo; + } - if (str_type == "error") + if (str_type == "error") { return DialInternalMessageType::kError; + } return DialInternalMessageType::kOther; } @@ -136,8 +143,9 @@ std::optional<base::Value> message_body; base::Value* message_body_value = message.Find("message"); - if (message_body_value) + if (message_body_value) { message_body = std::move(*message_body_value); + } int sequence_number = message.FindInt("sequenceNumber").value_or(-1); @@ -161,8 +169,9 @@ DCHECK(message.type == DialInternalMessageType::kCustomDialLaunch); const std::optional<base::Value>& body = message.body; - if (!body || !body->is_dict()) + if (!body || !body->is_dict()) { return CustomDialLaunchMessageBody(); + } const std::optional<bool> do_launch = body->GetDict().FindBool("doLaunch"); if (!do_launch) { @@ -172,8 +181,9 @@ std::optional<std::string> launch_parameter; const std::string* launch_parameter_value = body->GetDict().FindString("launchParameter"); - if (launch_parameter_value) + if (launch_parameter_value) { launch_parameter = *launch_parameter_value; + } return CustomDialLaunchMessageBody(*do_launch, launch_parameter); } @@ -194,12 +204,14 @@ // static bool DialInternalMessageUtil::IsStopSessionMessage( const DialInternalMessage& message) { - if (message.type != DialInternalMessageType::kV2Message) + if (message.type != DialInternalMessageType::kV2Message) { return false; + } const std::optional<base::Value>& body = message.body; - if (!body || !body->is_dict()) + if (!body || !body->is_dict()) { return false; + } const std::string* request_type = body->GetDict().FindString("type"); return request_type && *request_type == "STOP";
diff --git a/chrome/browser/media/router/providers/dial/dial_media_route_provider.cc b/chrome/browser/media/router/providers/dial/dial_media_route_provider.cc index 7d0c43b4..a0fa73a1 100644 --- a/chrome/browser/media/router/providers/dial/dial_media_route_provider.cc +++ b/chrome/browser/media/router/providers/dial/dial_media_route_provider.cc
@@ -62,9 +62,10 @@ media_router_->GetLogger(logger_.BindNewPipeAndPassReceiver()); // |activity_manager_| might have already been set in tests. - if (!activity_manager_) + if (!activity_manager_) { activity_manager_ = std::make_unique<DialActivityManager>( media_sink_service_->app_discovery_service()); + } } DialMediaRouteProvider::~DialMediaRouteProvider() { @@ -128,8 +129,8 @@ base::DoNothing()); logger_->LogInfo(mojom::LogCategory::kRoute, kLoggerComponent, "Existing route terminated successfully.", sink_id, - MediaRoute::GetMediaSourceIdFromMediaRouteId(route_id), - MediaRoute::GetPresentationIdFromMediaRouteId(route_id)); + MediaRoute::GetMediaSourceIdFromMediaRouteId(route_id), + MediaRoute::GetPresentationIdFromMediaRouteId(route_id)); } activity_manager_->AddActivity(*activity); @@ -520,19 +521,22 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (media_source.empty()) { std::vector<MediaSinkInternal> sinks; - for (const auto& sink_it : media_sink_service_->GetSinks()) + for (const auto& sink_it : media_sink_service_->GetSinks()) { sinks.push_back(sink_it.second); + } OnSinksDiscovered(sinks); return; } MediaSource dial_source(media_source); - if (!dial_source.IsDialSource()) + if (!dial_source.IsDialSource()) { return; + } std::string app_name = dial_source.AppNameFromDialSource(); - if (app_name.empty()) + if (app_name.empty()) { return; + } auto& sink_query = media_sink_queries_[app_name]; if (!sink_query) { @@ -557,24 +561,28 @@ MediaSource dial_source(media_source); std::string app_name = dial_source.AppNameFromDialSource(); - if (!dial_source.id().empty() && app_name.empty()) + if (!dial_source.id().empty() && app_name.empty()) { return; + } const auto& sink_query_it = media_sink_queries_.find(app_name); - if (sink_query_it == media_sink_queries_.end()) + if (sink_query_it == media_sink_queries_.end()) { return; + } auto& media_sources = sink_query_it->second->media_sources; media_sources.erase(dial_source); - if (media_sources.empty()) + if (media_sources.empty()) { media_sink_queries_.erase(sink_query_it); + } } void DialMediaRouteProvider::StartObservingMediaRoutes() { // Return current set of routes. auto routes = activity_manager_->GetRoutes(); - if (!routes.empty()) + if (!routes.empty()) { NotifyOnRoutesUpdated(routes); + } } void DialMediaRouteProvider::DetachRoute(const std::string& route_id) { @@ -624,8 +632,9 @@ std::vector<url::Origin> origins = GetOrigins(app_name); auto sinks = media_sink_service_->GetAvailableSinks(app_name); - for (const auto& media_source : media_sources) + for (const auto& media_source : media_sources) { NotifyOnSinksReceived(media_source.id(), sinks, origins); + } } void DialMediaRouteProvider::NotifyOnSinksReceived( @@ -660,8 +669,9 @@ {"com.dailymotion", {CreateOrigin("https://www.dailymotion.com")}}}); auto origins_it = origin_allowlist->find(app_name); - if (origins_it == origin_allowlist->end()) + if (origins_it == origin_allowlist->end()) { return std::vector<url::Origin>(); + } return origins_it->second; }
diff --git a/chrome/browser/media/router/providers/dial/dial_media_route_provider_unittest.cc b/chrome/browser/media/router/providers/dial/dial_media_route_provider_unittest.cc index 49878f7..b949ec4 100644 --- a/chrome/browser/media/router/providers/dial/dial_media_route_provider_unittest.cc +++ b/chrome/browser/media/router/providers/dial/dial_media_route_provider_unittest.cc
@@ -59,8 +59,9 @@ const SinkQueryByAppCallback& callback) override { DoStartMonitoringAvailableSinksForApp(app_name); auto& cb_list = sink_query_cbs_[app_name]; - if (!cb_list) + if (!cb_list) { cb_list = std::make_unique<SinkQueryByAppCallbackList>(); + } return cb_list->Add(callback); } MOCK_METHOD1(DoStartMonitoringAvailableSinksForApp, @@ -69,14 +70,16 @@ void SetAvailableSinks(const std::string& app_name, const std::vector<MediaSinkInternal>& sinks) { available_sinks_[app_name] = sinks; - for (const auto& sink : sinks) + for (const auto& sink : sinks) { AddOrUpdateSink(sink); + } } void NotifyAvailableSinks(const std::string& app_name) { auto& cb_list = sink_query_cbs_[app_name]; - if (cb_list) + if (cb_list) { cb_list->Notify(app_name); + } } std::vector<MediaSinkInternal> GetAvailableSinks( @@ -171,8 +174,9 @@ std::vector<RouteMessagePtr> received_messages; EXPECT_CALL(mock_router_, OnRouteMessagesReceived(route_id, _)) .WillOnce([&](const auto& route_id, auto messages) { - for (auto& message : messages) + for (auto& message : messages) { received_messages.emplace_back(std::move(message)); + } }); task_environment_.RunUntilIdle(); @@ -229,8 +233,9 @@ std::vector<RouteMessagePtr> received_messages; EXPECT_CALL(mock_router_, OnRouteMessagesReceived(route_id, _)) .WillOnce([&](const auto& route_id, auto messages) { - for (auto& message : messages) + for (auto& message : messages) { received_messages.emplace_back(std::move(message)); + } }); std::move(app_info_cb) .Run(sink_.sink().id(), "YouTube", @@ -353,8 +358,9 @@ std::vector<RouteMessagePtr> received_messages; EXPECT_CALL(mock_router_, OnRouteMessagesReceived(route_id, _)) .WillOnce([&](const auto& route_id, auto messages) { - for (auto& message : messages) + for (auto& message : messages) { received_messages.emplace_back(std::move(message)); + } }); EXPECT_CALL( mock_router_,
diff --git a/chrome/browser/media/router/providers/openscreen/network_service_async_packet_sender.h b/chrome/browser/media/router/providers/openscreen/network_service_async_packet_sender.h index 993e0904..1a815e1 100644 --- a/chrome/browser/media/router/providers/openscreen/network_service_async_packet_sender.h +++ b/chrome/browser/media/router/providers/openscreen/network_service_async_packet_sender.h
@@ -6,7 +6,6 @@ #define CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_OPENSCREEN_NETWORK_SERVICE_ASYNC_PACKET_SENDER_H_ #include "base/functional/callback.h" - #include "mojo/public/cpp/bindings/remote.h" #include "net/base/net_errors.h" #include "services/network/public/mojom/ip_endpoint.mojom.h"
diff --git a/chrome/browser/media/router/providers/openscreen/network_service_quic_packet_writer.h b/chrome/browser/media/router/providers/openscreen/network_service_quic_packet_writer.h index def6c0b..b6488aa0 100644 --- a/chrome/browser/media/router/providers/openscreen/network_service_quic_packet_writer.h +++ b/chrome/browser/media/router/providers/openscreen/network_service_quic_packet_writer.h
@@ -6,16 +6,16 @@ #define CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_OPENSCREEN_NETWORK_SERVICE_QUIC_PACKET_WRITER_H_ #include <stddef.h> + #include <memory> +#include "base/task/single_thread_task_runner.h" +#include "chrome/browser/media/router/providers/openscreen/network_service_async_packet_sender.h" #include "net/third_party/quiche/src/quiche/quic/core/quic_connection.h" #include "net/third_party/quiche/src/quiche/quic/core/quic_packet_writer.h" #include "net/third_party/quiche/src/quiche/quic/core/quic_packets.h" #include "net/third_party/quiche/src/quiche/quic/core/quic_types.h" -#include "base/task/single_thread_task_runner.h" -#include "chrome/browser/media/router/providers/openscreen/network_service_async_packet_sender.h" - namespace media_router { // Chrome-specific packet writer. Intended for use outside of the Network
diff --git a/chrome/browser/media/router/providers/openscreen/network_service_quic_packet_writer_unittest.cc b/chrome/browser/media/router/providers/openscreen/network_service_quic_packet_writer_unittest.cc index 5410235..ff884d10 100644 --- a/chrome/browser/media/router/providers/openscreen/network_service_quic_packet_writer_unittest.cc +++ b/chrome/browser/media/router/providers/openscreen/network_service_quic_packet_writer_unittest.cc
@@ -3,15 +3,14 @@ // found in the LICENSE file. #include "chrome/browser/media/router/providers/openscreen/network_service_quic_packet_writer.h" -#include "chrome/browser/media/router/providers/openscreen/network_service_async_packet_sender.h" #include <utility> -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - +#include "chrome/browser/media/router/providers/openscreen/network_service_async_packet_sender.h" #include "media/base/fake_single_thread_task_runner.h" #include "net/base/net_errors.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" namespace media_router {
diff --git a/chrome/browser/media/router/providers/test/test_media_route_provider.cc b/chrome/browser/media/router/providers/test/test_media_route_provider.cc index b16ad2d..6ca53ff 100644 --- a/chrome/browser/media/router/providers/test/test_media_route_provider.cc +++ b/chrome/browser/media/router/providers/test/test_media_route_provider.cc
@@ -186,8 +186,9 @@ void TestMediaRouteProvider::StartObservingMediaSinks( const std::string& media_source) { - if (base::Contains(unsupported_media_sources_, media_source)) + if (base::Contains(unsupported_media_sources_, media_source)) { sinks_ = {}; + } media_router_->OnSinksReceived(kProviderId, media_source, sinks_, {}); } @@ -240,13 +241,15 @@ void TestMediaRouteProvider::TearDown() { // An OffscreenTab observes its Profile*, and must be destroyed before // Profiles. - if (offscreen_tab_) + if (offscreen_tab_) { offscreen_tab_.reset(); + } } void TestMediaRouteProvider::DestroyTab(OffscreenTab* tab) { - if (offscreen_tab_ && offscreen_tab_.get() == tab) + if (offscreen_tab_ && offscreen_tab_.get() == tab) { offscreen_tab_.reset(); + } } } // namespace media_router
diff --git a/chrome/browser/media/router/providers/test/test_media_route_provider.h b/chrome/browser/media/router/providers/test/test_media_route_provider.h index 927c26b..036e2b9f 100644 --- a/chrome/browser/media/router/providers/test/test_media_route_provider.h +++ b/chrome/browser/media/router/providers/test/test_media_route_provider.h
@@ -84,8 +84,9 @@ std::vector<std::string> get_presentation_ids() { std::vector<std::string> presentation_ids; - for (auto& element : presentation_ids_to_routes_) + for (auto& element : presentation_ids_to_routes_) { presentation_ids.push_back(element.first); + } return presentation_ids; }
diff --git a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc index bf5c7a9..724fa01 100644 --- a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc +++ b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc
@@ -173,12 +173,14 @@ void WiredDisplayMediaRouteProvider::StartObservingMediaSinks( const std::string& media_source) { - if (!IsValidStandardPresentationSource(media_source)) + if (!IsValidStandardPresentationSource(media_source)) { return; + } // Start observing displays if |this| isn't already observing. - if (!display_observer_) + if (!display_observer_) { display_observer_.emplace(this); + } sink_queries_.insert(media_source); DiscoverSinksNow(); } @@ -190,8 +192,9 @@ void WiredDisplayMediaRouteProvider::StartObservingMediaRoutes() { std::vector<MediaRoute> route_list; - for (const auto& presentation : presentations_) + for (const auto& presentation : presentations_) { route_list.push_back(presentation.second.route()); + } media_router_->OnRoutesUpdated(kProviderId, route_list); } @@ -273,12 +276,14 @@ void WiredDisplayMediaRouteProvider::Presentation::UpdatePresentationTitle( const std::string& title) { - if (status_->title == title) + if (status_->title == title) { return; + } status_->title = title; - if (media_status_observer_) + if (media_status_observer_) { media_status_observer_->OnMediaStatusUpdated(status_.Clone()); + } } void WiredDisplayMediaRouteProvider::Presentation::SetMojoConnections( @@ -303,8 +308,9 @@ void WiredDisplayMediaRouteProvider::NotifyRouteObservers() const { std::vector<MediaRoute> route_list; - for (const auto& presentation : presentations_) + for (const auto& presentation : presentations_) { route_list.push_back(presentation.second.route()); + } media_router_->OnRoutesUpdated(kProviderId, route_list); } @@ -312,16 +318,18 @@ void WiredDisplayMediaRouteProvider::NotifySinkObservers() { std::vector<MediaSinkInternal> sinks = GetSinks(); device_count_metrics_.RecordDeviceCountsIfNeeded(sinks.size(), sinks.size()); - for (const auto& sink_query : sink_queries_) + for (const auto& sink_query : sink_queries_) { media_router_->OnSinksReceived(kProviderId, sink_query, sinks, {}); + } } std::vector<MediaSinkInternal> WiredDisplayMediaRouteProvider::GetSinks() const { std::vector<MediaSinkInternal> sinks; std::vector<Display> displays = GetAvailableDisplays(); - for (size_t i = 0; i < displays.size(); i++) + for (size_t i = 0; i < displays.size(); i++) { sinks.push_back(CreateSinkForDisplay(displays[i], i + 1)); + } return sinks; } @@ -330,8 +338,9 @@ std::vector<Display> displays = GetAllDisplays(); // If there is only one display, the user should not be able to present to it. // If there are no displays, GetPrimaryDisplay() below fails. - if (displays.size() <= 1) + if (displays.size() <= 1) { return std::vector<Display>(); + } const Display primary_display = GetPrimaryDisplay(); std::sort( @@ -355,8 +364,9 @@ void WiredDisplayMediaRouteProvider::RemovePresentationById( const std::string& presentation_id) { auto entry = presentations_.find(presentation_id); - if (entry == presentations_.end()) + if (entry == presentations_.end()) { return; + } media_router_->OnPresentationConnectionStateChanged( entry->second.route().media_route_id(), blink::mojom::PresentationConnectionState::TERMINATED); @@ -390,8 +400,9 @@ presentations_to_terminate.push_back(presentation.second.receiver()); } } - for (auto* presentation_to_terminate : presentations_to_terminate) + for (auto* presentation_to_terminate : presentations_to_terminate) { presentation_to_terminate->Terminate(); + } } std::optional<Display> WiredDisplayMediaRouteProvider::GetDisplayBySinkId(
diff --git a/chrome/browser/resources/chromeos/accessibility/common/browser_util.ts b/chrome/browser/resources/chromeos/accessibility/common/browser_util.ts index 0d917d5..acdc3f94 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/browser_util.ts +++ b/chrome/browser/resources/chromeos/accessibility/common/browser_util.ts
@@ -10,24 +10,10 @@ export class BrowserUtil { /** - * Opens a URL in the user's preferred browser (Lacros if enabled, Ash - * otherwise). If a feature needs to always open in the Ash browser, for - * example to show an extension page, it should not use this method. + * Opens a URL in the browser. * @param url The URL to open. */ static async openBrowserUrl(url: string): Promise<void> { - if (isLacrosEnabled === null) { - // Cache the value on first use. This will not change after Chrome OS - // is already running. - isLacrosEnabled = await new Promise( - resolve => chrome.accessibilityPrivate.isLacrosPrimary(resolve)); - } - - if (isLacrosEnabled) { - globalThis.open(url, '_blank'); - return; - } - chrome.windows.getAll((windows: Window[]) => { if (windows.length > 0) { // Open in existing window. @@ -40,9 +26,3 @@ }); } } - -/** - * Cached value of AccessibilityPrivate.isLacrosPrimary, - * null if it hasn't been fetched yet. - */ -let isLacrosEnabled: boolean | null = null;
diff --git a/chrome/browser/resources/chromeos/accessibility/definitions/accessibility_private_mv2.d.ts b/chrome/browser/resources/chromeos/accessibility/definitions/accessibility_private_mv2.d.ts index c758063d..ef25759 100644 --- a/chrome/browser/resources/chromeos/accessibility/definitions/accessibility_private_mv2.d.ts +++ b/chrome/browser/resources/chromeos/accessibility/definitions/accessibility_private_mv2.d.ts
@@ -422,8 +422,6 @@ export function setSelectToSpeakState(state: SelectToSpeakState): void; - export function clipboardCopyInActiveLacrosGoogleDoc(url: string): void; - export function handleScrollableBoundsForPointFound(rect: ScreenRect): void; @@ -473,9 +471,6 @@ dlc: DlcType, variant: TtsVariant, callback: GetDlcContentsCallback): void; - type IsLacrosPrimaryCallback = (result: boolean) => void; - export function isLacrosPrimary(callback: IsLacrosPrimaryCallback): void; - export function getDisplayBounds( callback: (screens: ScreenRect[]) => void): void;
diff --git a/chrome/browser/resources/chromeos/accessibility/select_to_speak/select_to_speak.ts b/chrome/browser/resources/chromeos/accessibility/select_to_speak/select_to_speak.ts index c278a748..58dcd2e 100644 --- a/chrome/browser/resources/chromeos/accessibility/select_to_speak/select_to_speak.ts +++ b/chrome/browser/resources/chromeos/accessibility/select_to_speak/select_to_speak.ts
@@ -213,7 +213,7 @@ // Install the context menu in the Ash browser. await chrome.contextMenus.create(createArgs); - // Listen for context menu clicks from other contexts (like Lacros). + // Listen for context menu clicks from other contexts. chrome.accessibilityPrivate.onSelectToSpeakContextMenuClicked.addListener( () => { this.getFocusedNodeAndSpeakSelectedText_(); @@ -574,19 +574,15 @@ this.inputHandler_!.onRequestReadClipboardData(); this.currentNodeGroupItem_ = new ParagraphUtils.NodeGroupItem(gsuiteAppRootNode, 0, false); - if (tabs.length > 0 && tabs[0].url === gsuiteAppRootNode.url) { - const tab = tabs[0]; - chrome.tabs.executeScript(tab.id, { - allFrames: true, - matchAboutBlank: true, - code: 'document.execCommand("copy");', - }); - } else { - // In Lacros because chrome.tabs didn't return a tab or it - // was a tab with a different URL. - chrome.accessibilityPrivate.clipboardCopyInActiveLacrosGoogleDoc( - gsuiteAppRootNode.url); + if (tabs.length === 0 || tabs[0].url !== gsuiteAppRootNode.url) { + return; } + const tab = tabs[0]; + chrome.tabs.executeScript(tab.id, { + allFrames: true, + matchAboutBlank: true, + code: 'document.execCommand("copy");', + }); if (userRequested) { MetricsUtils.recordStartEvent(methodNumber, this.prefsManager_); }
diff --git a/chrome/browser/resources/chromeos/login/screens/common/sync_consent.html b/chrome/browser/resources/chromeos/login/screens/common/sync_consent.html index bc65a10..4a13332d 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/sync_consent.html +++ b/chrome/browser/resources/chromeos/login/screens/common/sync_consent.html
@@ -230,198 +230,3 @@ <iron-icon slot="icon" icon="oobe-32:googleg"></iron-icon> </oobe-loading-dialog> -<oobe-adaptive-dialog id="syncConsentLacrosOverviewDialog" role="dialog" - for-step="lacros-overview"> - <iron-icon slot="icon" icon="oobe-32:sync-chrome"></iron-icon> - <h1 slot="title" consent-description> - [[i18nDynamic(locale, 'syncConsentScreenTitleLacros')]] - </h1> - <div slot="subtitle"> - <p consent-description> - [[i18nDynamic(locale, 'syncConsentScreenSubtitleLacros')]] - </p> - <p consent-description> - [[i18nDynamic(locale, 'syncConsentScreenAdditionalSubtitleLacros')]] - </p> - </div> - <div slot="content" class="layout vertical landscape-vertical-centered"> - <iron-icon icon="oobe-illos:sync-consent-illo" class="illustration-jelly"> - </iron-icon> - </div> - <div slot="bottom-buttons" hidden="[[isMinorMode]]"> - <oobe-text-button id="manageButtonRegularUser" - on-click="onManageClicked" - label-for-aria="[[i18nDynamic(locale, 'syncConsentScreenManage')]]"> - <div slot="text" consent-description consent-confirmation> - [[i18nDynamic(locale, 'syncConsentScreenManage')]] - </div> - </oobe-text-button> - <oobe-text-button class="focus-on-show" inverse - id="syncEverythingButton" - on-click="onSyncEverything" - label-for-aria="[[i18nDynamic(locale, 'syncConsentTurnOnSync')]]"> - <div slot="text" consent-description consent-confirmation> - [[i18nDynamic(locale, 'syncConsentTurnOnSync')]] - </div> - </oobe-text-button> - </div> - <div class="bottom-buttons" slot="bottom-buttons" hidden="[[!isMinorMode]]"> - <oobe-text-button id="manageButtonMinorUser" - on-click="onManageClicked" - label-for-aria="[[i18nDynamic(locale, 'syncConsentScreenManage')]]"> - <div slot="text" consent-description consent-confirmation> - [[i18nDynamic(locale, 'syncConsentScreenManage')]] - </div> - </oobe-text-button> - <div id="rightButtons"> - <oobe-text-button id="declineLacrosButton" - on-click="onLacrosDeclineClicked" - label-for-aria="[[i18nDynamic(locale, - 'syncConsentScreenDecline')]]"> - <div slot="text" consent-description consent-confirmation> - [[i18nDynamic(locale, 'syncConsentScreenDecline')]] - </div> - </oobe-text-button> - <oobe-text-button class="focus-on-show" - id="syncEverythingButton" - on-click="onSyncEverything" - label-for-aria="[[i18nDynamic(locale, 'syncConsentTurnOnSync')]]"> - <div slot="text" consent-description consent-confirmation> - [[i18nDynamic(locale, 'syncConsentTurnOnSync')]] - </div> - </oobe-text-button> - </div> - </div> -</oobe-adaptive-dialog> - -<oobe-adaptive-dialog id="syncConsentLacrosCustomizeDialog" role="dialog" - for-step="lacros-customize"> - <iron-icon slot="icon" icon="oobe-32:sync-chrome"></iron-icon> - <h1 slot="title"> - [[i18nDynamic(locale, 'syncConsentScreenManageTitleLacros')]] - </h1> - <div slot="subtitle"> - [[i18nDynamic(locale, 'syncConsentScreenManageSubtitleLacros')]] - </div> - <div slot="back-navigation"> - <oobe-back-button id="backButton" - on-click="onBackClicked"></oobe-back-button> - </div> - <div slot="content" class="layout vertical landscape-header-aligned "> - <div id="cards-container"> - <!--Apps card--> - <div class="card layout horizontal"> - <div class="card-icon"> - <iron-icon icon="oobe-32:sync-app"></iron-icon> - </div> - <div aria-hidden="true" - class="text-container flex layout vertical center-justified"> - <div class="card-title"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncItemOptionAppsTitle')]] - </div> - <div class="card-subtitle"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncItemOptionAppsSubtitle')]] - </div> - </div> - <div style="display:inline-block"> - <iron-icon id="tooltip-icon" icon="oobe-32:sync-tooltip" - role="img" aria-label$="[[getAriaLabeltooltip(locale)]]"> - </iron-icon> - <paper-tooltip id="tooltip-element" position="left" - aria-hidden="true" - for="tooltip-icon" - animation-delay="0"> - <p class="tooltip-text"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncAppsTooltipText')]] - </p> - <p class="tooltip-text"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncAppsTooltipAdditionalText')]] - </p> - </paper-tooltip> - </div> - <cr-toggle id="appsTogglebutton" checked="{{osSyncItemsStatus.osApps}}" - aria-label$="[[getAriaLabelToggleButtons(locale, - 'syncConsentScreenOsSyncItemOptionAppsTitle' , - 'syncConsentScreenOsSyncItemOptionAppsSubtitle')]]"> - </cr-toggle> - </div> - <!--Settings card--> - <div class="card layout horizontal"> - <div class="card-icon"> - <iron-icon icon="oobe-32:sync-settings"></iron-icon> - </div> - <div aria-hidden="true" class="text-container"> - <div class="card-title"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncItemOptionSettingsTitle')]] - </div> - <div class="card-subtitle"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncItemOptionSettingsSubtitle')]] - </div> - </div> - <cr-toggle id="settingsTogglebutton" - on-change="onSettingsSyncedChanged" - checked="{{osSyncItemsStatus.osPreferences}}" - aria-label$="[[getAriaLabelToggleButtons(locale, - 'syncConsentScreenOsSyncItemOptionSettingsTitle' , - 'syncConsentScreenOsSyncItemOptionSettingsSubtitle')]]"> - </cr-toggle> - </div> - <!--Wifi card--> - <div class="card layout horizontal"> - <div class="card-icon"> - <iron-icon icon="oobe-32:sync-wifi"></iron-icon> - </div> - <div aria-hidden="true" class="text-container"> - <div class="card-title"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncItemOptionWifiTitle')]] - </div> - <div class="card-subtitle"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncItemOptionWifiSubtitle')]] - </div> - </div> - <cr-toggle id="wifiTogglebutton" - checked="{{osSyncItemsStatus.osWifiConfigurations}}" - aria-label$="[[getAriaLabelToggleButtons(locale, - 'syncConsentScreenOsSyncItemOptionWifiTitle' , - 'syncConsentScreenOsSyncItemOptionWifiSubtitle')]]"> - </cr-toggle> - </div> - <!--Wallpaper card--> - <div class="card layout horizontal"> - <div class="card-icon"> - <iron-icon icon="oobe-32:sync-wallpaper"></iron-icon> - </div> - <div aria-hidden="true" class="text-container"> - <div class="card-title"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncItemOptionWallpaperTitle')]] - </div> - <div class="card-subtitle"> - [[i18nDynamic(locale, - 'syncConsentScreenOsSyncItemOptionWallpaperSubtitle')]] - </div> - </div> - <cr-toggle id="wallpaperTogglebutton" - checked="{{osSyncItemsStatus.osWallpaper}}" - disabled="[[!osSyncItemsStatus.osPreferences]]" - aria-label$="[[getAriaLabelToggleButtons(locale, - 'syncConsentScreenOsSyncItemOptionWallpaperTitle' , - 'syncConsentScreenOsSyncItemOptionWallpaperSubtitle')]]"> - </cr-toggle> - </div> - </div> - </div> - <div slot="bottom-buttons"> - <oobe-next-button id="nextButton" class="focus-on-show" - on-click="onNextClicked"> - </oobe-next-button> - </div> -</oobe-adaptive-dialog>
diff --git a/chrome/browser/supervised_user/supervised_user_pending_state_navigation_browsertest.cc b/chrome/browser/supervised_user/supervised_user_pending_state_navigation_browsertest.cc index 8bf5d72..646a0618 100644 --- a/chrome/browser/supervised_user/supervised_user_pending_state_navigation_browsertest.cc +++ b/chrome/browser/supervised_user/supervised_user_pending_state_navigation_browsertest.cc
@@ -582,8 +582,16 @@ // Tests that when the user doesn't have a valid access token the request is // sent with an api key and not an access token (i.e an anonymous request). +// TODO(https://crbug.com/385450025): Flaky on Win ASAN. +#if BUILDFLAG(IS_WIN) && defined(ADDRESS_SANITIZER) +#define MAYBE_TestPendingStateRequestHasGoogleApiInHeader \ + DISABLED_TestPendingStateRequestHasGoogleApiInHeader +#else +#define MAYBE_TestPendingStateRequestHasGoogleApiInHeader \ + TestPendingStateRequestHasGoogleApiInHeader +#endif IN_PROC_BROWSER_TEST_P(SupervisedUserPendingStateNavigationTest, - TestPendingStateRequestHasGoogleApiInHeader) { + MAYBE_TestPendingStateRequestHasGoogleApiInHeader) { // TODO(crbug.com/365529863): Move the methods SetAutomaticIssueOfAccessTokens // and WaitForAccessTokenRequestIfNecessaryAndRespondWithError to // supervisionMixin::SetPendingStateForPrimaryAccount.
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 4a95926..50d91d6 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -4667,8 +4667,6 @@ "views/tabs/tab_drag_context.h", "views/tabs/tab_drag_controller.cc", "views/tabs/tab_drag_controller.h", - "views/tabs/tab_glic_container.cc", - "views/tabs/tab_glic_container.h", "views/tabs/tab_group_editor_bubble_view.cc", "views/tabs/tab_group_editor_bubble_view.h", "views/tabs/tab_group_header.cc", @@ -4704,6 +4702,8 @@ "views/tabs/tab_slot_view.h", "views/tabs/tab_strip.cc", "views/tabs/tab_strip.h", + "views/tabs/tab_strip_action_container.cc", + "views/tabs/tab_strip_action_container.h", "views/tabs/tab_strip_combo_button.cc", "views/tabs/tab_strip_combo_button.h", "views/tabs/tab_strip_control_button.cc",
diff --git a/chrome/browser/ui/android/edge_to_edge/internal/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeBottomChinMediator.java b/chrome/browser/ui/android/edge_to_edge/internal/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeBottomChinMediator.java index df3f6e3..157a83366 100644 --- a/chrome/browser/ui/android/edge_to_edge/internal/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeBottomChinMediator.java +++ b/chrome/browser/ui/android/edge_to_edge/internal/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeBottomChinMediator.java
@@ -60,6 +60,7 @@ private @LayerVisibility int mLatestLayerVisibility; private boolean mIsKeyboardVisible; + private boolean mHasSafeAreaConstraint; private final @NonNull KeyboardVisibilityDelegate mKeyboardVisibilityDelegate; private final @NonNull LayoutManager mLayoutManager; @@ -192,6 +193,15 @@ } @Override + public void onSafeAreaConstraintChanged(boolean hasConstraint) { + if (mHasSafeAreaConstraint == hasConstraint) return; + // mHasSafeAreaConstraint impacts scroll behavior which changes the min height of browser + // controls layers. Request an update to refresh the calculated height in the stacker. + mHasSafeAreaConstraint = hasConstraint; + mBottomControlsStacker.requestLayerUpdate(false); + } + + @Override public void onNavigationBarColorChanged(int color) { if (!isVisible()) { mNavigationBarColor = color; @@ -241,7 +251,9 @@ @Override public int getScrollBehavior() { - return LayerScrollBehavior.DEFAULT_SCROLL_OFF; + return mHasSafeAreaConstraint + ? LayerScrollBehavior.NEVER_SCROLL_OFF + : LayerScrollBehavior.DEFAULT_SCROLL_OFF; } @Override
diff --git a/chrome/browser/ui/android/edge_to_edge/internal/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeControllerImpl.java b/chrome/browser/ui/android/edge_to_edge/internal/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeControllerImpl.java index 06ec285..9e047902 100644 --- a/chrome/browser/ui/android/edge_to_edge/internal/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeControllerImpl.java +++ b/chrome/browser/ui/android/edge_to_edge/internal/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeControllerImpl.java
@@ -98,6 +98,13 @@ */ private boolean mIsPageOptedIntoEdgeToEdge; + /** + * Whether the page should constrain the safe area, which requires the page to be retained + * within the safe area region. This essentially opts the page out of edge-to-edge, regardless + * of other flags and values (e.g. |mIsPageOptedIntoEdgeToEdge|) + */ + private boolean mHasSafeAreaConstraint; + private InsetObserver mInsetObserver; private @NonNull Insets mSystemInsets; private Insets mAppliedContentViewPadding; @@ -369,6 +376,9 @@ boolean changedDrawToEdge = shouldDrawToEdge != mIsDrawingToEdge; mIsPageOptedIntoEdgeToEdge = pageOptedIntoEdgeToEdge; mIsDrawingToEdge = shouldDrawToEdge; + // Refresh the mHasSafeAreaConstraint to ensure the boolean stays fresh (e.g. when + // #drawToEdge is called due to tab switching) + mHasSafeAreaConstraint = EdgeToEdgeUtils.hasSafeAreaConstraintForTab(mCurrentTab); if (changedPageOptedIn) { Log.v( @@ -390,6 +400,7 @@ for (var observer : mEdgeChangeObservers) { observer.onToEdgeChange( mSystemInsets.bottom, isDrawingToEdge(), isPageOptedIntoEdgeToEdge()); + observer.onSafeAreaConstraintChanged(mHasSafeAreaConstraint); } } }
diff --git a/chrome/browser/ui/android/edge_to_edge/internal/junit/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeBottomChinMediatorTest.java b/chrome/browser/ui/android/edge_to_edge/internal/junit/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeBottomChinMediatorTest.java index ffc4a0f..218eb32 100644 --- a/chrome/browser/ui/android/edge_to_edge/internal/junit/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeBottomChinMediatorTest.java +++ b/chrome/browser/ui/android/edge_to_edge/internal/junit/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeBottomChinMediatorTest.java
@@ -305,6 +305,26 @@ } @Test + public void testUpdateSafeAreaConstraint() { + assertEquals( + "The chin should be DEFAULT_SCROLL_OFF.", + BottomControlsStacker.LayerScrollBehavior.DEFAULT_SCROLL_OFF, + mMediator.getScrollBehavior()); + + mMediator.onSafeAreaConstraintChanged(true); + assertEquals( + "The chin should NEVER_SCROLL_OFF when safe area constraint presents.", + BottomControlsStacker.LayerScrollBehavior.NEVER_SCROLL_OFF, + mMediator.getScrollBehavior()); + + mMediator.onSafeAreaConstraintChanged(false); + assertEquals( + "The chin should change back to DEFAULT_SCROLL_OFF once constraint removed.", + BottomControlsStacker.LayerScrollBehavior.DEFAULT_SCROLL_OFF, + mMediator.getScrollBehavior()); + } + + @Test public void testOnBrowserControlsOffsetUpdate() { enableDispatchYOffset();
diff --git a/chrome/browser/ui/android/edge_to_edge/internal/junit/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeControllerTest.java b/chrome/browser/ui/android/edge_to_edge/internal/junit/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeControllerTest.java index d908c56..32ede4d4 100644 --- a/chrome/browser/ui/android/edge_to_edge/internal/junit/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeControllerTest.java +++ b/chrome/browser/ui/android/edge_to_edge/internal/junit/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeControllerTest.java
@@ -11,6 +11,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeastOnce; @@ -69,6 +70,7 @@ import org.chromium.chrome.browser.ui.native_page.NativePage; import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgePadAdjuster; import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeStateProvider; +import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeSupplier; import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.WebContentsObserver; import org.chromium.ui.InsetObserver; @@ -148,6 +150,7 @@ @Mock private EdgeToEdgeOSWrapper mOsWrapper; @Mock private EdgeToEdgeStateProvider mEdgeToEdgeStateProvider; + @Mock private EdgeToEdgeSupplier.ChangeObserver mChangeObserver; @Captor private ArgumentCaptor<WindowInsetsConsumer> mWindowInsetsListenerCaptor; @@ -209,7 +212,6 @@ mBrowserControlsStateProvider, mLayoutManagerSupplier, mFullscreenManager); - assertNotNull(mEdgeToEdgeControllerImpl); verify(mEdgeToEdgeStateProvider, times(1)).acquireSetDecorFitsSystemWindowToken(); verify(mOsWrapper, times(1)) @@ -224,6 +226,8 @@ verify(mInsetObserver, times(1)) .addInsetsConsumer(any(), eq(InsetConsumerSource.EDGE_TO_EDGE_CONTROLLER_IMPL)); EdgeToEdgeControllerFactory.setHas3ButtonNavBar(false); + + mEdgeToEdgeControllerImpl.registerObserver(mChangeObserver); } @After @@ -771,13 +775,21 @@ mTabProvider.set(mTab); verifyInteractions(mTab); assertFalse("Shouldn't be toEdge.", mEdgeToEdgeControllerImpl.isPageOptedIntoEdgeToEdge()); + verify(mChangeObserver, times(1)) + .onToEdgeChange(eq(BOTTOM_INSET), anyBoolean(), anyBoolean()); // Simulate a viewport fit change to kick off WindowInsetConsumer being hooked up. mEdgeToEdgeControllerImpl.getWebContentsObserver().viewportFitChanged(ViewportFit.COVER); + verify(mChangeObserver, times(2)) + .onToEdgeChange(eq(BOTTOM_INSET), anyBoolean(), anyBoolean()); // Simulate another viewport fit change prior to #handleWindowInsets being called. mEdgeToEdgeControllerImpl.getWebContentsObserver().viewportFitChanged(ViewportFit.CONTAIN); + verify(mChangeObserver, times(3)) + .onToEdgeChange(eq(BOTTOM_INSET), anyBoolean(), anyBoolean()); // Go back to edge. mEdgeToEdgeControllerImpl.getWebContentsObserver().viewportFitChanged(ViewportFit.COVER); + verify(mChangeObserver, times(4)) + .onToEdgeChange(eq(BOTTOM_INSET), anyBoolean(), anyBoolean()); // Simulate insets being available. assertNotNull(mWindowInsetsListenerCaptor.getValue()); @@ -791,6 +803,8 @@ "Should be drawing toEdge after toggling viewport-fit.", mEdgeToEdgeControllerImpl.isDrawingToEdge()); verify(mOsWrapper).setPadding(any(), eq(0), eq(TOP_INSET), eq(0), eq(0)); + + verify(mChangeObserver, atLeastOnce()).onSafeAreaConstraintChanged(false); } @Test
diff --git a/chrome/browser/ui/android/edge_to_edge/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeUtils.java b/chrome/browser/ui/android/edge_to_edge/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeUtils.java index 119bd14..3fe2c03 100644 --- a/chrome/browser/ui/android/edge_to_edge/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeUtils.java +++ b/chrome/browser/ui/android/edge_to_edge/java/src/org/chromium/chrome/browser/ui/edge_to_edge/EdgeToEdgeUtils.java
@@ -212,6 +212,15 @@ return value == ViewportFit.COVER || value == ViewportFit.COVER_FORCED_BY_USER_AGENT; } + /** Return whether there's any safe area constraint found for the given tab. */ + static boolean hasSafeAreaConstraintForTab(Tab tab) { + if (tab == null) return false; + + SafeAreaInsetsTracker safeAreaInsetsTracker = + DisplayCutoutController.getSafeAreaInsetsTracker(tab); + return safeAreaInsetsTracker != null && safeAreaInsetsTracker.hasSafeAreaConstraint(); + } + /** Whether a native tab will be drawn edge to to edge. */ static boolean isNativeTabDrawingToEdge(Tab activeTab) { // sDrawNativeEdgeToEdge will draw all native page to edge forcefully.
diff --git a/chrome/browser/ui/tabs/organization/tab_declutter_controller.cc b/chrome/browser/ui/tabs/organization/tab_declutter_controller.cc index ccba154c..fdc95c6 100644 --- a/chrome/browser/ui/tabs/organization/tab_declutter_controller.cc +++ b/chrome/browser/ui/tabs/organization/tab_declutter_controller.cc
@@ -390,7 +390,7 @@ } void TabDeclutterController::OnActionUIDismissed( - base::PassKey<TabGlicContainer>) { + base::PassKey<TabStripActionContainer>) { ResetAndDoubleNudgeTimer(); }
diff --git a/chrome/browser/ui/tabs/organization/tab_declutter_controller.h b/chrome/browser/ui/tabs/organization/tab_declutter_controller.h index 20ef4eb..5791fdf 100644 --- a/chrome/browser/ui/tabs/organization/tab_declutter_controller.h +++ b/chrome/browser/ui/tabs/organization/tab_declutter_controller.h
@@ -20,8 +20,8 @@ #include "chrome/browser/ui/webui/tab_search/tab_search.mojom-forward.h" #include "url/gurl.h" +class TabStripActionContainer; class TabStripModel; -class TabGlicContainer; class TabSearchContainer; class BrowserWindowInterface; @@ -79,7 +79,7 @@ base::TimeDelta nudge_timer_interval() const { return nudge_timer_interval_; } void OnActionUIDismissed(base::PassKey<TabSearchContainer>); - void OnActionUIDismissed(base::PassKey<TabGlicContainer>); + void OnActionUIDismissed(base::PassKey<TabStripActionContainer>); void SetTimerForTesting(const base::TickClock* tick_clock, scoped_refptr<base::SequencedTaskRunner> task_runner);
diff --git a/chrome/browser/ui/views/frame/tab_strip_region_view.cc b/chrome/browser/ui/views/frame/tab_strip_region_view.cc index f4dbc46..ef08244f 100644 --- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc +++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
@@ -22,10 +22,10 @@ #include "chrome/browser/ui/views/tab_search_bubble_host.h" #include "chrome/browser/ui/views/tabs/new_tab_button.h" #include "chrome/browser/ui/views/tabs/tab_drag_controller.h" -#include "chrome/browser/ui/views/tabs/tab_glic_container.h" #include "chrome/browser/ui/views/tabs/tab_search_button.h" #include "chrome/browser/ui/views/tabs/tab_search_container.h" #include "chrome/browser/ui/views/tabs/tab_strip.h" +#include "chrome/browser/ui/views/tabs/tab_strip_action_container.h" #include "chrome/browser/ui/views/tabs/tab_strip_combo_button.h" #include "chrome/browser/ui/views/tabs/tab_strip_control_button.h" #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" @@ -126,7 +126,7 @@ // Add and configure the TabSearchContainer, TabStripComboButton, and // ProductSpecificationsButton. std::unique_ptr<TabSearchContainer> tab_search_container; - std::unique_ptr<TabGlicContainer> tab_glic_container; + std::unique_ptr<TabStripActionContainer> tab_strip_action_container; std::unique_ptr<TabStripComboButton> tab_strip_combo_button; std::unique_ptr<ProductSpecificationsButton> product_specifications_button; if (browser && @@ -155,12 +155,12 @@ views::kCrossAxisAlignmentKey, views::LayoutAlignment::kCenter); } if (features::IsTabstripComboButtonEnabled()) { - tab_glic_container = std::make_unique<TabGlicContainer>( + tab_strip_action_container = std::make_unique<TabStripActionContainer>( tab_strip_->controller(), this, browser->GetFeatures().tab_declutter_controller()); - tab_glic_container->SetProperty(views::kCrossAxisAlignmentKey, - views::LayoutAlignment::kCenter); - tab_glic_container->SetProperty( + tab_strip_action_container->SetProperty(views::kCrossAxisAlignmentKey, + views::LayoutAlignment::kCenter); + tab_strip_action_container->SetProperty( views::kMarginsKey, gfx::Insets::TLBR(0, 0, 0, GetLayoutConstant(TAB_STRIP_PADDING))); } @@ -264,13 +264,21 @@ gfx::Insets::TLBR(0, 0, 0, GetLayoutConstant(TAB_STRIP_PADDING))); } - if (tab_glic_container) { - tab_glic_container_ = AddChildView(std::move(tab_glic_container)); + if (tab_strip_action_container) { + tab_strip_action_container_ = + AddChildView(std::move(tab_strip_action_container)); } UpdateTabStripMargin(); } -TabStripRegionView::~TabStripRegionView() = default; +TabStripRegionView::~TabStripRegionView() { + // TabStripActionContainer has a pointer to TabStripController , which is + // also destoroyed by this class. + // This enusres that the action container is destroyed first. + if (tab_strip_action_container_) { + RemoveChildViewT(std::exchange(tab_strip_action_container_, nullptr)); + } +} bool TabStripRegionView::IsRectInWindowCaption(const gfx::Rect& rect) { const auto get_target_rect = [&](views::View* target) { @@ -361,9 +369,9 @@ } glic::GlicButton* TabStripRegionView::GetGlicButton() { - if (tab_glic_container_) { + if (tab_strip_action_container_) { #if BUILDFLAG(ENABLE_GLIC) - return tab_glic_container_->GetGlicButton(); + return tab_strip_action_container_->GetGlicButton(); #endif // BUILDFLAG(ENABLE_GLIC) } return nullptr; @@ -377,8 +385,8 @@ } } -TabGlicContainer* TabStripRegionView::GetTabGlicContainer() { - return tab_glic_container_; +TabStripActionContainer* TabStripRegionView::GetTabStripActionContainer() { + return tab_strip_action_container_; } views::View::Views TabStripRegionView::GetChildrenInZOrder() { @@ -404,8 +412,8 @@ children.emplace_back(product_specifications_button_.get()); } - if (tab_glic_container_) { - children.emplace_back(tab_glic_container_.get()); + if (tab_strip_action_container_) { + children.emplace_back(tab_strip_action_container_.get()); } if (reserved_grab_handle_space_) {
diff --git a/chrome/browser/ui/views/frame/tab_strip_region_view.h b/chrome/browser/ui/views/frame/tab_strip_region_view.h index 530cd6a5..5c28640d8 100644 --- a/chrome/browser/ui/views/frame/tab_strip_region_view.h +++ b/chrome/browser/ui/views/frame/tab_strip_region_view.h
@@ -19,7 +19,7 @@ class Button; } class NewTabButton; -class TabGlicContainer; +class TabStripActionContainer; class TabSearchButton; class TabStrip; class TabStripComboButton; @@ -63,7 +63,7 @@ TabSearchContainer* GetTabSearchContainer(); - TabGlicContainer* GetTabGlicContainer(); + TabStripActionContainer* GetTabStripActionContainer(); TabStripComboButton* tab_strip_combo_button() { return tab_strip_combo_button_; @@ -144,13 +144,13 @@ void AdjustViewBoundsRect(View* view, int offset); raw_ptr<const Profile> profile_ = nullptr; + raw_ptr<TabStripActionContainer> tab_strip_action_container_ = nullptr; raw_ptr<views::View> tab_strip_container_ = nullptr; raw_ptr<views::View> reserved_grab_handle_space_ = nullptr; raw_ptr<TabStrip> tab_strip_ = nullptr; raw_ptr<TabStripScrollContainer> tab_strip_scroll_container_ = nullptr; raw_ptr<views::Button> new_tab_button_ = nullptr; raw_ptr<TabSearchContainer> tab_search_container_ = nullptr; - raw_ptr<TabGlicContainer> tab_glic_container_ = nullptr; raw_ptr<TabStripComboButton> tab_strip_combo_button_ = nullptr; raw_ptr<ProductSpecificationsButton> product_specifications_button_ = nullptr;
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc index d050d58..b4b61fda 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -264,6 +264,15 @@ return model_->count(); } +bool BrowserTabStripController::CanShowModalUI() const { + return model_->CanShowModalUI(); +} + +std::unique_ptr<ScopedTabStripModalUI> +BrowserTabStripController::ShowModalUI() { + return model_->ShowModalUI(); +} + bool BrowserTabStripController::IsValidIndex(int index) const { return model_->ContainsIndex(index); }
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h index be8958a..7a86b99f 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h
@@ -66,6 +66,8 @@ // TabStripController implementation: const ui::ListSelectionModel& GetSelectionModel() const override; int GetCount() const override; + bool CanShowModalUI() const override; + std::unique_ptr<ScopedTabStripModalUI> ShowModalUI() override; bool IsValidIndex(int model_index) const override; bool IsActiveTab(int model_index) const override; std::optional<int> GetActiveIndex() const override;
diff --git a/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.cc index b17c3875..67eb5fd 100644 --- a/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.cc +++ b/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.cc
@@ -327,6 +327,15 @@ return nullptr; } +bool FakeBaseTabStripController::CanShowModalUI() const { + return false; +} + +std::unique_ptr<ScopedTabStripModalUI> +FakeBaseTabStripController::ShowModalUI() { + return nullptr; +} + #if BUILDFLAG(IS_CHROMEOS) bool FakeBaseTabStripController::IsLockedForOnTask() { return on_task_locked_;
diff --git a/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h b/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h index c4c6345..6a181eb 100644 --- a/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h +++ b/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h
@@ -102,6 +102,9 @@ Profile* GetProfile() const override; BrowserWindowInterface* GetBrowserWindowInterface() override; const Browser* GetBrowser() const override; + bool CanShowModalUI() const override; + std::unique_ptr<ScopedTabStripModalUI> ShowModalUI() override; + #if BUILDFLAG(IS_CHROMEOS) bool IsLockedForOnTask() override;
diff --git a/chrome/browser/ui/views/tabs/tab_glic_container_browsertest.cc b/chrome/browser/ui/views/tabs/tab_glic_container_browsertest.cc deleted file mode 100644 index c4757a37..0000000 --- a/chrome/browser/ui/views/tabs/tab_glic_container_browsertest.cc +++ /dev/null
@@ -1,232 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/tabs/tab_glic_container.h" - -#include "base/feature_list.h" -#include "base/test/metrics/histogram_tester.h" -#include "base/test/scoped_feature_list.h" -#include "chrome/browser/optimization_guide/browser_test_util.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/signin/identity_manager_factory.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/tabs/organization/tab_organization_service.h" -#include "chrome/browser/ui/tabs/organization/tab_organization_utils.h" -#include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "chrome/browser/ui/ui_features.h" -#include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/browser/ui/views/frame/tab_strip_region_view.h" -#include "chrome/browser/ui/views/tabs/tab_search_button.h" -#include "chrome/common/chrome_features.h" -#include "chrome/test/base/in_process_browser_test.h" -#include "chrome/test/views/chrome_views_test_base.h" -#include "components/optimization_guide/core/model_execution/model_execution_features.h" -#include "components/optimization_guide/core/optimization_guide_features.h" -#include "components/signin/public/identity_manager/identity_test_utils.h" -#include "content/public/test/browser_test.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/ui_base_features.h" -#include "ui/events/test/event_generator.h" -#include "ui/gfx/animation/slide_animation.h" - -class TabGlicContainerBrowserTest : public InProcessBrowserTest { - public: - TabGlicContainerBrowserTest() { - feature_list_.InitWithFeatures( - {features::kGlic, features::kTabstripComboButton, - features::kTabstripDeclutter}, - {}); - TabOrganizationUtils::GetInstance()->SetIgnoreOptGuideForTesting(true); - } - - TabStripModel* tab_strip_model() { return browser()->tab_strip_model(); } - - BrowserView* browser_view() { - return BrowserView::GetBrowserViewForBrowser(browser()); - } - - TabGlicContainer* tab_glic_container() { - return browser_view()->tab_strip_region_view()->GetTabGlicContainer(); - } - - private: - base::test::ScopedFeatureList feature_list_; -}; - -IN_PROC_BROWSER_TEST_F(TabGlicContainerBrowserTest, ShowsDeclutterChip) { - ASSERT_FALSE(tab_glic_container()->animation_session_for_testing()); - - tab_glic_container()->ShowTabStripNudge( - tab_glic_container()->tab_declutter_button()); - - ASSERT_TRUE(tab_glic_container() - ->animation_session_for_testing() - ->expansion_animation() - ->IsShowing()); -} - -IN_PROC_BROWSER_TEST_F(TabGlicContainerBrowserTest, - ShowsAndHidesDeclutterChip) { - ASSERT_FALSE(tab_glic_container()->animation_session_for_testing()); - - tab_glic_container()->ShowTabStripNudge( - tab_glic_container()->tab_declutter_button()); - - ASSERT_TRUE(tab_glic_container() - ->animation_session_for_testing() - ->expansion_animation() - ->IsShowing()); - - // Finish showing declutter chip. - tab_glic_container() - ->animation_session_for_testing() - ->ResetAnimationForTesting(1); - tab_glic_container()->GetWidget()->LayoutRootViewIfNecessary(); - - // Hide the declutter chip. - tab_glic_container()->HideTabStripNudge( - tab_glic_container()->tab_declutter_button()); - - ASSERT_TRUE(tab_glic_container() - ->animation_session_for_testing() - ->expansion_animation() - ->IsClosing()); -} - -IN_PROC_BROWSER_TEST_F(TabGlicContainerBrowserTest, - LogsWhenDeclutterButtonClicked) { - base::HistogramTester histogram_tester; - - tab_glic_container()->ShowTabStripNudge( - tab_glic_container()->tab_declutter_button()); - - tab_glic_container()->OnTabDeclutterButtonClicked(); - - histogram_tester.ExpectUniqueSample( - "Tab.Organization.Declutter.Trigger.Outcome", 0, 1); - // Bucketed CTR metric should reflect one show and one click, with fewer than - // 15 total tabs. - histogram_tester.ExpectBucketCount( - "Tab.Organization.Declutter.Trigger.BucketedCTR", 0, 1); - histogram_tester.ExpectBucketCount( - "Tab.Organization.Declutter.Trigger.BucketedCTR", 10, 1); -} - -IN_PROC_BROWSER_TEST_F(TabGlicContainerBrowserTest, - LogsWhenDeclutterButtonDismissed) { - base::HistogramTester histogram_tester; - - tab_glic_container()->ShowTabStripNudge( - tab_glic_container()->tab_declutter_button()); - - tab_glic_container()->OnTabDeclutterButtonDismissed(); - - histogram_tester.ExpectUniqueSample( - "Tab.Organization.Declutter.Trigger.Outcome", 1, 1); -} - -IN_PROC_BROWSER_TEST_F(TabGlicContainerBrowserTest, - LogsWhenDeclutterButtonTimeout) { - base::HistogramTester histogram_tester; - - tab_glic_container()->ShowTabStripNudge( - tab_glic_container()->tab_declutter_button()); - - tab_glic_container()->OnTabStripNudgeButtonTimeout( - tab_glic_container()->tab_declutter_button()); - - histogram_tester.ExpectUniqueSample( - "Tab.Organization.Declutter.Trigger.Outcome", 2, 1); -} - -IN_PROC_BROWSER_TEST_F(TabGlicContainerBrowserTest, DelaysShow) { - ASSERT_FALSE(tab_glic_container()->animation_session_for_testing()); - - tab_glic_container()->SetLockedExpansionMode( - LockedExpansionMode::kWillShow, - tab_glic_container()->tab_declutter_button()); - tab_glic_container()->ShowTabStripNudge( - tab_glic_container()->tab_declutter_button()); - - ASSERT_FALSE(tab_glic_container()->animation_session_for_testing()); - - tab_glic_container()->SetLockedExpansionMode(LockedExpansionMode::kNone, - nullptr); - - ASSERT_TRUE(tab_glic_container() - ->animation_session_for_testing() - ->expansion_animation() - ->IsShowing()); -} - -IN_PROC_BROWSER_TEST_F(TabGlicContainerBrowserTest, DelaysHide) { - ASSERT_FALSE(tab_glic_container()->animation_session_for_testing()); - - tab_glic_container()->ShowTabStripNudge( - tab_glic_container()->tab_declutter_button()); - tab_glic_container() - ->animation_session_for_testing() - ->ResetAnimationForTesting(1); - tab_glic_container()->GetWidget()->LayoutRootViewIfNecessary(); - - ASSERT_FALSE(tab_glic_container()->animation_session_for_testing()); - - tab_glic_container()->SetLockedExpansionMode( - LockedExpansionMode::kWillHide, - tab_glic_container()->tab_declutter_button()); - tab_glic_container()->HideTabStripNudge( - tab_glic_container()->tab_declutter_button()); - - ASSERT_FALSE(tab_glic_container()->animation_session_for_testing()); - - tab_glic_container()->SetLockedExpansionMode(LockedExpansionMode::kNone, - nullptr); - - ASSERT_TRUE(tab_glic_container() - ->animation_session_for_testing() - ->expansion_animation() - ->IsClosing()); -} - -IN_PROC_BROWSER_TEST_F(TabGlicContainerBrowserTest, - ImmediatelyHidesWhenOrganizeButtonClicked) { - tab_glic_container()->ShowTabStripNudge( - tab_glic_container()->tab_declutter_button()); - tab_glic_container() - ->animation_session_for_testing() - ->ResetAnimationForTesting(1); - tab_glic_container()->GetWidget()->LayoutRootViewIfNecessary(); - - tab_glic_container()->SetLockedExpansionMode( - LockedExpansionMode::kWillHide, - tab_glic_container()->tab_declutter_button()); - - tab_glic_container()->OnTabDeclutterButtonClicked(); - - EXPECT_TRUE(tab_glic_container() - ->animation_session_for_testing() - ->expansion_animation() - ->IsClosing()); -} - -IN_PROC_BROWSER_TEST_F(TabGlicContainerBrowserTest, - ImmediatelyHidesWhenOrganizeButtonDismissed) { - tab_glic_container()->ShowTabStripNudge( - tab_glic_container()->tab_declutter_button()); - tab_glic_container() - ->animation_session_for_testing() - ->ResetAnimationForTesting(1); - tab_glic_container()->GetWidget()->LayoutRootViewIfNecessary(); - - tab_glic_container()->SetLockedExpansionMode( - LockedExpansionMode::kWillHide, - tab_glic_container()->tab_declutter_button()); - - tab_glic_container()->OnTabDeclutterButtonDismissed(); - - EXPECT_TRUE(tab_glic_container() - ->animation_session_for_testing() - ->expansion_animation() - ->IsClosing()); -}
diff --git a/chrome/browser/ui/views/tabs/tab_glic_container.cc b/chrome/browser/ui/views/tabs/tab_strip_action_container.cc similarity index 64% rename from chrome/browser/ui/views/tabs/tab_glic_container.cc rename to chrome/browser/ui/views/tabs/tab_strip_action_container.cc index 76228b20..6a7f376 100644 --- a/chrome/browser/ui/views/tabs/tab_glic_container.cc +++ b/chrome/browser/ui/views/tabs/tab_strip_action_container.cc
@@ -2,18 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/views/tabs/tab_glic_container.h" +#include "chrome/browser/ui/views/tabs/tab_strip_action_container.h" #include <memory> #include "base/feature_list.h" #include "base/metrics/histogram_macros.h" #include "base/types/pass_key.h" -#include "build/build_config.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_element_identifiers.h" +#include "chrome/browser/ui/browser_window/public/browser_window_features.h" #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/tabs/organization/tab_declutter_controller.h" #include "chrome/browser/ui/tabs/organization/tab_organization_service.h" +#include "chrome/browser/ui/tabs/organization/tab_organization_service_factory.h" +#include "chrome/browser/ui/tabs/organization/tab_organization_utils.h" #include "chrome/browser/ui/ui_features.h" #include "chrome/browser/ui/views/tabs/tab_strip_nudge_button.h" #include "chrome/browser/ui/webui/tab_search/tab_search.mojom.h" @@ -50,6 +53,8 @@ constexpr base::TimeDelta kOpacityOutDuration = base::Milliseconds(100); constexpr base::TimeDelta kOpacityDelay = base::Milliseconds(100); constexpr base::TimeDelta kShowDuration = base::Seconds(16); +constexpr char kAutoTabGroupsTriggerOutcomeName[] = + "Tab.Organization.Trigger.Outcome"; constexpr char kDeclutterTriggerOutcomeName[] = "Tab.Organization.Declutter.Trigger.Outcome"; constexpr char kDeclutterTriggerBucketedCTRName[] = @@ -58,11 +63,11 @@ } // namespace -TabGlicContainer::TabStripNudgeAnimationSession::TabStripNudgeAnimationSession( - TabStripNudgeButton* button, - TabGlicContainer* container, - AnimationSessionType session_type, - base::OnceCallback<void()> on_animation_ended) +TabStripActionContainer::TabStripNudgeAnimationSession:: + TabStripNudgeAnimationSession(TabStripNudgeButton* button, + TabStripActionContainer* container, + AnimationSessionType session_type, + base::OnceCallback<void()> on_animation_ended) : button_(button), container_(container), expansion_animation_(container), @@ -75,10 +80,10 @@ } } -TabGlicContainer::TabStripNudgeAnimationSession:: +TabStripActionContainer::TabStripNudgeAnimationSession:: ~TabStripNudgeAnimationSession() = default; -void TabGlicContainer::TabStripNudgeAnimationSession::Start() { +void TabStripActionContainer::TabStripNudgeAnimationSession::Start() { if (session_type_ == TabStripNudgeAnimationSession::AnimationSessionType::SHOW) { Show(); @@ -87,8 +92,8 @@ } } -void TabGlicContainer::TabStripNudgeAnimationSession::ResetAnimationForTesting( - double value) { +void TabStripActionContainer::TabStripNudgeAnimationSession:: + ResetAnimationForTesting(double value) { if (opacity_animation_delay_timer_.IsRunning()) { opacity_animation_delay_timer_.FireNow(); } @@ -97,7 +102,7 @@ opacity_animation_.Reset(value); } -void TabGlicContainer::TabStripNudgeAnimationSession::Show() { +void TabStripActionContainer::TabStripNudgeAnimationSession::Show() { expansion_animation_.SetTweenType(gfx::Tween::Type::ACCEL_20_DECEL_100); opacity_animation_.SetTweenType(gfx::Tween::Type::LINEAR); @@ -110,10 +115,11 @@ const base::TimeDelta delay = GetAnimationDuration(kOpacityDelay); opacity_animation_delay_timer_.Start( FROM_HERE, delay, this, - &TabGlicContainer::TabStripNudgeAnimationSession::ShowOpacityAnimation); + &TabStripActionContainer::TabStripNudgeAnimationSession:: + ShowOpacityAnimation); } -void TabGlicContainer::TabStripNudgeAnimationSession::Hide() { +void TabStripActionContainer::TabStripNudgeAnimationSession::Hide() { // Animate and hide existing chip. if (session_type_ == TabStripNudgeAnimationSession::AnimationSessionType::SHOW) { @@ -137,18 +143,19 @@ } base::TimeDelta -TabGlicContainer::TabStripNudgeAnimationSession::GetAnimationDuration( +TabStripActionContainer::TabStripNudgeAnimationSession::GetAnimationDuration( base::TimeDelta duration) { return gfx::Animation::ShouldRenderRichAnimation() ? duration : base::TimeDelta(); } -void TabGlicContainer::TabStripNudgeAnimationSession::ShowOpacityAnimation() { +void TabStripActionContainer::TabStripNudgeAnimationSession:: + ShowOpacityAnimation() { opacity_animation_.Show(); } -void TabGlicContainer::TabStripNudgeAnimationSession::ApplyAnimationValue( - const gfx::Animation* animation) { +void TabStripActionContainer::TabStripNudgeAnimationSession:: + ApplyAnimationValue(const gfx::Animation* animation) { float value = animation->GetCurrentValue(); if (animation == &expansion_animation_) { button_->SetWidthFactor(value); @@ -157,7 +164,7 @@ } } -void TabGlicContainer::TabStripNudgeAnimationSession::MarkAnimationDone( +void TabStripActionContainer::TabStripNudgeAnimationSession::MarkAnimationDone( const gfx::Animation* animation) { if (animation == &expansion_animation_) { expansion_animation_done_ = true; @@ -172,17 +179,25 @@ } } -TabGlicContainer::TabGlicContainer( +TabStripActionContainer::TabStripActionContainer( TabStripController* tab_strip_controller, View* locked_expansion_view, tabs::TabDeclutterController* tab_declutter_controller) : AnimationDelegateViews(this), locked_expansion_view_(locked_expansion_view), - tab_declutter_controller_(tab_declutter_controller) { + tab_declutter_controller_(tab_declutter_controller), + tab_strip_controller_(tab_strip_controller) { mouse_watcher_ = std::make_unique<views::MouseWatcher>( std::make_unique<views::MouseWatcherViewHost>(locked_expansion_view, gfx::Insets()), this); + + tab_organization_service_ = TabOrganizationServiceFactory::GetForProfile( + tab_strip_controller->GetProfile()); + if (tab_organization_service_) { + tab_organization_observation_.Observe(tab_organization_service_); + } + // `tab_declutter_controller_` will be null for some profile types and if // feature is not enabled. if (tab_declutter_controller_) { @@ -194,6 +209,13 @@ tab_declutter_observation_.Observe(tab_declutter_controller_); } + auto_tab_group_button_ = + AddChildView(CreateAutoTabGroupButton(tab_strip_controller)); + + SetupButtonProperties(auto_tab_group_button_); + + browser_ = tab_strip_controller->GetBrowser(); + #if BUILDFLAG(ENABLE_GLIC) if (GlicEnabling::IsEnabledByFlags() && glic::GlicProfileManager::IsProfileSupported( @@ -213,16 +235,22 @@ SetLayoutManager(std::make_unique<views::FlexLayout>()); } -TabGlicContainer::~TabGlicContainer() = default; +TabStripActionContainer::~TabStripActionContainer() { + if (scoped_tab_strip_modal_ui_) { + scoped_tab_strip_modal_ui_.reset(); + } +} -std::unique_ptr<TabStripNudgeButton> TabGlicContainer::CreateTabDeclutterButton( +std::unique_ptr<TabStripNudgeButton> +TabStripActionContainer::CreateTabDeclutterButton( TabStripController* tab_strip_controller) { auto button = std::make_unique<TabStripNudgeButton>( tab_strip_controller, - base::BindRepeating(&TabGlicContainer::OnTabDeclutterButtonClicked, + base::BindRepeating(&TabStripActionContainer::OnTabDeclutterButtonClicked, base::Unretained(this)), - base::BindRepeating(&TabGlicContainer::OnTabDeclutterButtonDismissed, - base::Unretained(this)), + base::BindRepeating( + &TabStripActionContainer::OnTabDeclutterButtonDismissed, + base::Unretained(this)), features::IsTabstripDedupeEnabled() ? l10n_util::GetStringUTF16(IDS_TAB_DECLUTTER) : l10n_util::GetStringUTF16(IDS_TAB_DECLUTTER_NO_DEDUPE), @@ -242,7 +270,42 @@ return button; } -void TabGlicContainer::OnTabDeclutterButtonClicked() { +std::unique_ptr<TabStripNudgeButton> +TabStripActionContainer::CreateAutoTabGroupButton( + TabStripController* tab_strip_controller) { + auto button = std::make_unique<TabStripNudgeButton>( + tab_strip_controller, + base::BindRepeating(&TabStripActionContainer::OnAutoTabGroupButtonClicked, + base::Unretained(this)), + base::BindRepeating( + &TabStripActionContainer::OnAutoTabGroupButtonDismissed, + base::Unretained(this)), + l10n_util::GetStringUTF16(IDS_TAB_ORGANIZE), kAutoTabGroupButtonElementId, + Edge::kNone); + button->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_ORGANIZE)); + button->GetViewAccessibility().SetName( + l10n_util::GetStringUTF16(IDS_ACCNAME_TAB_ORGANIZE)); + button->SetProperty(views::kCrossAxisAlignmentKey, + views::LayoutAlignment::kCenter); + return button; +} + +void TabStripActionContainer::OnToggleActionUIState(const Browser* browser, + bool should_show) { + CHECK(tab_organization_service_); + + if (locked_expansion_mode_ != LockedExpansionMode::kNone) { + return; + } + + if (should_show && browser_ == browser) { + ShowTabStripNudge(auto_tab_group_button_); + } else { + HideTabStripNudge(auto_tab_group_button_); + } +} + +void TabStripActionContainer::OnTabDeclutterButtonClicked() { tabs::TabDeclutterController::EmitEntryPointHistogram( tab_search::mojom::TabDeclutterEntryPoint::kNudge); base::UmaHistogramEnumeration(kDeclutterTriggerOutcomeName, @@ -252,22 +315,22 @@ ExecuteHideTabStripNudge(tab_declutter_button_); } -void TabGlicContainer::OnTabDeclutterButtonDismissed() { +void TabStripActionContainer::OnTabDeclutterButtonDismissed() { base::UmaHistogramEnumeration(kDeclutterTriggerOutcomeName, TriggerOutcome::kDismissed); tab_declutter_controller_->OnActionUIDismissed( - base::PassKey<TabGlicContainer>()); + base::PassKey<TabStripActionContainer>()); ExecuteHideTabStripNudge(tab_declutter_button_); } -void TabGlicContainer::OnTriggerDeclutterUIVisibility() { +void TabStripActionContainer::OnTriggerDeclutterUIVisibility() { CHECK(tab_declutter_controller_); ShowTabStripNudge(tab_declutter_button_); } -DeclutterTriggerCTRBucket TabGlicContainer::GetDeclutterTriggerBucket( +DeclutterTriggerCTRBucket TabStripActionContainer::GetDeclutterTriggerBucket( bool clicked) { const auto total_tab_count = tab_declutter_controller_->tab_strip_model()->GetTabCount(); @@ -310,12 +373,12 @@ } } -void TabGlicContainer::LogDeclutterTriggerBucket(bool clicked) { +void TabStripActionContainer::LogDeclutterTriggerBucket(bool clicked) { const DeclutterTriggerCTRBucket bucket = GetDeclutterTriggerBucket(clicked); base::UmaHistogramEnumeration(kDeclutterTriggerBucketedCTRName, bucket); } -void TabGlicContainer::ShowTabStripNudge(TabStripNudgeButton* button) { +void TabStripActionContainer::ShowTabStripNudge(TabStripNudgeButton* button) { if (locked_expansion_view_->IsMouseHovered()) { SetLockedExpansionMode(LockedExpansionMode::kWillShow, button); } @@ -324,7 +387,7 @@ } } -void TabGlicContainer::HideTabStripNudge(TabStripNudgeButton* button) { +void TabStripActionContainer::HideTabStripNudge(TabStripNudgeButton* button) { if (locked_expansion_view_->IsMouseHovered()) { SetLockedExpansionMode(LockedExpansionMode::kWillHide, button); } @@ -333,17 +396,29 @@ } } -void TabGlicContainer::ExecuteShowTabStripNudge(TabStripNudgeButton* button) { - // TODO(crbug.com/384554420) add modal support. +void TabStripActionContainer::ExecuteShowTabStripNudge( + TabStripNudgeButton* button) { + if (browser_ && (button == auto_tab_group_button_) && + !TabOrganizationUtils::GetInstance()->IsEnabled(browser_->profile())) { + return; + } + + // If the tab strip already has a modal UI showing, exit early. + if (!tab_strip_controller_->CanShowModalUI()) { + return; + } + + scoped_tab_strip_modal_ui_ = tab_strip_controller_->ShowModalUI(); + animation_session_ = std::make_unique<TabStripNudgeAnimationSession>( button, this, TabStripNudgeAnimationSession::AnimationSessionType::SHOW, - base::BindOnce(&TabGlicContainer::OnAnimationSessionEnded, + base::BindOnce(&TabStripActionContainer::OnAnimationSessionEnded, base::Unretained(this))); animation_session_->Start(); hide_tab_strip_nudge_timer_.Start( FROM_HERE, kShowDuration, - base::BindOnce(&TabGlicContainer::OnTabStripNudgeButtonTimeout, + base::BindOnce(&TabStripActionContainer::OnTabStripNudgeButtonTimeout, base::Unretained(this), button)); if (button == tab_declutter_button_) { @@ -351,7 +426,8 @@ } } -void TabGlicContainer::ExecuteHideTabStripNudge(TabStripNudgeButton* button) { +void TabStripActionContainer::ExecuteHideTabStripNudge( + TabStripNudgeButton* button) { // Hide the current animation if the shown button is the same button. Do not // create a new animation session. if (animation_session_ && @@ -372,13 +448,14 @@ hide_tab_strip_nudge_timer_.Stop(); animation_session_ = std::make_unique<TabStripNudgeAnimationSession>( button, this, TabStripNudgeAnimationSession::AnimationSessionType::HIDE, - base::BindOnce(&TabGlicContainer::OnAnimationSessionEnded, + base::BindOnce(&TabStripActionContainer::OnAnimationSessionEnded, base::Unretained(this))); animation_session_->Start(); } -void TabGlicContainer::SetLockedExpansionMode(LockedExpansionMode mode, - TabStripNudgeButton* button) { +void TabStripActionContainer::SetLockedExpansionMode( + LockedExpansionMode mode, + TabStripNudgeButton* button) { if (mode == LockedExpansionMode::kNone) { if (locked_expansion_mode_ == LockedExpansionMode::kWillShow) { ExecuteShowTabStripNudge(locked_expansion_button_); @@ -393,9 +470,36 @@ locked_expansion_mode_ = mode; } -void TabGlicContainer::OnTabStripNudgeButtonTimeout( +void TabStripActionContainer::OnAutoTabGroupButtonClicked() { + base::UmaHistogramEnumeration(kAutoTabGroupsTriggerOutcomeName, + TriggerOutcome::kAccepted); + tab_organization_service_->OnActionUIAccepted(browser_); + + UMA_HISTOGRAM_BOOLEAN("Tab.Organization.AllEntrypoints.Clicked", true); + UMA_HISTOGRAM_BOOLEAN("Tab.Organization.Proactive.Clicked", true); + + // Force hide the button when pressed, bypassing locked expansion mode. + ExecuteHideTabStripNudge(auto_tab_group_button_); +} + +void TabStripActionContainer::OnAutoTabGroupButtonDismissed() { + base::UmaHistogramEnumeration(kAutoTabGroupsTriggerOutcomeName, + TriggerOutcome::kDismissed); + tab_organization_service_->OnActionUIDismissed(browser_); + + UMA_HISTOGRAM_BOOLEAN("Tab.Organization.Proactive.Clicked", false); + + // Force hide the button when pressed, bypassing locked expansion mode. + ExecuteHideTabStripNudge(auto_tab_group_button_); +} + +void TabStripActionContainer::OnTabStripNudgeButtonTimeout( TabStripNudgeButton* button) { - if (button == tab_declutter_button_) { + if (button == auto_tab_group_button_) { + base::UmaHistogramEnumeration(kAutoTabGroupsTriggerOutcomeName, + TriggerOutcome::kTimedOut); + UMA_HISTOGRAM_BOOLEAN("Tab.Organization.Proactive.Clicked", false); + } else if (button == tab_declutter_button_) { base::UmaHistogramEnumeration(kDeclutterTriggerOutcomeName, TriggerOutcome::kTimedOut); } @@ -405,7 +509,8 @@ HideTabStripNudge(button); } -void TabGlicContainer::SetupButtonProperties(TabStripNudgeButton* button) { +void TabStripActionContainer::SetupButtonProperties( + TabStripNudgeButton* button) { // Set the margins for the button const int space_between_buttons = kLargeSpaceBetweenButtons; gfx::Insets margin; @@ -416,28 +521,35 @@ button->SetOpacity(0); } -void TabGlicContainer::MouseMovedOutOfHost() { +void TabStripActionContainer::MouseMovedOutOfHost() { SetLockedExpansionMode(LockedExpansionMode::kNone, nullptr); } -void TabGlicContainer::AnimationCanceled(const gfx::Animation* animation) { +void TabStripActionContainer::AnimationCanceled( + const gfx::Animation* animation) { AnimationEnded(animation); } -void TabGlicContainer::AnimationEnded(const gfx::Animation* animation) { +void TabStripActionContainer::AnimationEnded(const gfx::Animation* animation) { animation_session_->ApplyAnimationValue(animation); animation_session_->MarkAnimationDone(animation); } -void TabGlicContainer::OnAnimationSessionEnded() { - // TODO(crbug.com/384554420) add modal support. +void TabStripActionContainer::OnAnimationSessionEnded() { + // If the button went from shown -> hidden, unblock the tab strip from + // showing other modal UIs. + if (animation_session_->session_type() == + TabStripNudgeAnimationSession::AnimationSessionType::HIDE) { + scoped_tab_strip_modal_ui_.reset(); + } animation_session_.reset(); } -void TabGlicContainer::AnimationProgressed(const gfx::Animation* animation) { +void TabStripActionContainer::AnimationProgressed( + const gfx::Animation* animation) { animation_session_->ApplyAnimationValue(animation); } -BEGIN_METADATA(TabGlicContainer) +BEGIN_METADATA(TabStripActionContainer) END_METADATA
diff --git a/chrome/browser/ui/views/tabs/tab_glic_container.h b/chrome/browser/ui/views/tabs/tab_strip_action_container.h similarity index 70% rename from chrome/browser/ui/views/tabs/tab_glic_container.h rename to chrome/browser/ui/views/tabs/tab_strip_action_container.h index 6214795..3975e8bc 100644 --- a/chrome/browser/ui/views/tabs/tab_glic_container.h +++ b/chrome/browser/ui/views/tabs/tab_strip_action_container.h
@@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_GLIC_CONTAINER_H_ -#define CHROME_BROWSER_UI_VIEWS_TABS_TAB_GLIC_CONTAINER_H_ +#ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_ACTION_CONTAINER_H_ +#define CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_ACTION_CONTAINER_H_ +#include "base/gtest_prod_util.h" #include "chrome/browser/ui/tabs/organization/tab_declutter_controller.h" #include "chrome/browser/ui/tabs/organization/tab_declutter_observer.h" #include "chrome/browser/ui/views/tabs/tab_search_container.h" @@ -20,11 +21,12 @@ class GlicButton; } -class TabGlicContainer : public views::View, - public TabDeclutterObserver, - public views::AnimationDelegateViews, - public views::MouseWatcherListener { - METADATA_HEADER(TabGlicContainer, views::View) +class TabStripActionContainer : public views::View, + public TabDeclutterObserver, + public views::AnimationDelegateViews, + public views::MouseWatcherListener, + public TabOrganizationObserver { + METADATA_HEADER(TabStripActionContainer, views::View) public: class TabStripNudgeAnimationSession { @@ -33,7 +35,7 @@ TabStripNudgeAnimationSession( TabStripNudgeButton* button, - TabGlicContainer* container, + TabStripActionContainer* container, AnimationSessionType session_type, base::OnceCallback<void()> on_animation_ended); ~TabStripNudgeAnimationSession(); @@ -52,8 +54,8 @@ base::TimeDelta GetAnimationDuration(base::TimeDelta duration); void ShowOpacityAnimation(); void Show(); - raw_ptr<TabStripNudgeButton> button_; - raw_ptr<TabGlicContainer> container_; + raw_ptr<TabStripNudgeButton> button_ = nullptr; + raw_ptr<TabStripActionContainer> container_ = nullptr; gfx::SlideAnimation expansion_animation_; gfx::SlideAnimation opacity_animation_; @@ -68,45 +70,42 @@ // Callback to container after animation has ended. base::OnceCallback<void()> on_animation_ended_; }; - explicit TabGlicContainer( + explicit TabStripActionContainer( TabStripController* tab_strip_controller, View* locked_expansion_view, tabs::TabDeclutterController* tab_declutter_controller); - TabGlicContainer(const TabGlicContainer&) = delete; - TabGlicContainer& operator=(const TabGlicContainer&) = delete; - ~TabGlicContainer() override; + TabStripActionContainer(const TabStripActionContainer&) = delete; + TabStripActionContainer& operator=(const TabStripActionContainer&) = delete; + ~TabStripActionContainer() override; TabStripNudgeButton* tab_declutter_button() { return tab_declutter_button_; } + TabStripNudgeButton* auto_tab_group_button() { + return auto_tab_group_button_; + } TabStripNudgeAnimationSession* animation_session_for_testing() { return animation_session_.get(); } + + TabOrganizationService* tab_organization_service_for_testing() { + return tab_organization_service_; + } + +#if BUILDFLAG(ENABLE_GLIC) + glic::GlicButton* GetGlicButton() { return glic_button_; } +#endif // BUILDFLAG(ENABLE_GLIC) + + // TabOrganizationObserver + void OnToggleActionUIState(const Browser* browser, bool should_show) override; + // TabDeclutterObserver void OnTriggerDeclutterUIVisibility() override; // views::MouseWatcherListener: void MouseMovedOutOfHost() override; -#if BUILDFLAG(ENABLE_GLIC) - glic::GlicButton* GetGlicButton() { return glic_button_; } -#endif // BUILDFLAG(ENABLE_GLIC) - private: - FRIEND_TEST_ALL_PREFIXES(TabGlicContainerBrowserTest, ShowsDeclutterChip); - FRIEND_TEST_ALL_PREFIXES(TabGlicContainerBrowserTest, - ShowsAndHidesDeclutterChip); - FRIEND_TEST_ALL_PREFIXES(TabGlicContainerBrowserTest, - LogsWhenDeclutterButtonClicked); - FRIEND_TEST_ALL_PREFIXES(TabGlicContainerBrowserTest, - LogsWhenDeclutterButtonDismissed); - FRIEND_TEST_ALL_PREFIXES(TabGlicContainerBrowserTest, - LogsWhenDeclutterButtonTimeout); - FRIEND_TEST_ALL_PREFIXES(TabGlicContainerBrowserTest, DelaysShow); - FRIEND_TEST_ALL_PREFIXES(TabGlicContainerBrowserTest, DelaysHide); - FRIEND_TEST_ALL_PREFIXES(TabGlicContainerBrowserTest, - ImmediatelyHidesWhenOrganizeButtonDismissed); - FRIEND_TEST_ALL_PREFIXES(TabGlicContainerBrowserTest, - ImmediatelyHidesWhenOrganizeButtonClicked); + friend class TabStripActionContainerBrowserTest; void ShowTabStripNudge(TabStripNudgeButton* button); void HideTabStripNudge(TabStripNudgeButton* button); @@ -119,6 +118,9 @@ void OnTabDeclutterButtonClicked(); void OnTabDeclutterButtonDismissed(); + void OnAutoTabGroupButtonClicked(); + void OnAutoTabGroupButtonDismissed(); + void OnTabStripNudgeButtonTimeout(TabStripNudgeButton* button); DeclutterTriggerCTRBucket GetDeclutterTriggerBucket(bool clicked); @@ -143,6 +145,8 @@ void OnAnimationSessionEnded(); + std::unique_ptr<TabStripNudgeButton> CreateAutoTabGroupButton( + TabStripController* tab_strip_controller); std::unique_ptr<TabStripNudgeButton> CreateTabDeclutterButton( TabStripController* tab_strip_controller); void SetupButtonProperties(TabStripNudgeButton* button); @@ -150,13 +154,21 @@ // The button currently holding the lock to be shown/hidden. raw_ptr<TabStripNudgeButton> locked_expansion_button_ = nullptr; raw_ptr<TabStripNudgeButton> tab_declutter_button_ = nullptr; + raw_ptr<TabStripNudgeButton> auto_tab_group_button_ = nullptr; + raw_ptr<TabOrganizationService> tab_organization_service_ = nullptr; raw_ptr<tabs::TabDeclutterController> tab_declutter_controller_; + #if BUILDFLAG(ENABLE_GLIC) raw_ptr<glic::GlicButton, DanglingUntriaged> glic_button_ = nullptr; #endif // BUILDFLAG(ENABLE_GLIC) raw_ptr<const Browser> browser_; + // The TabStripController is removed as part of the TabStripRegionView's + // destructor before this class gets cleanup up. THis Pointer is avlid except + // during destruciotn. + const raw_ptr<TabStripController> tab_strip_controller_ = nullptr; + // Timer for hiding tab_strip_nudge_button_ after show. base::OneShotTimer hide_tab_strip_nudge_timer_; @@ -164,10 +176,16 @@ // will be staged until after this is unlocked. LockedExpansionMode locked_expansion_mode_ = LockedExpansionMode::kNone; + base::ScopedObservation<TabOrganizationService, TabOrganizationObserver> + tab_organization_observation_{this}; + base::ScopedObservation<tabs::TabDeclutterController, TabDeclutterObserver> tab_declutter_observation_{this}; + // Prevents other features from showing tabstrip-modal UI. + std::unique_ptr<ScopedTabStripModalUI> scoped_tab_strip_modal_ui_; + std::unique_ptr<TabStripNudgeAnimationSession> animation_session_; }; -#endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_GLIC_CONTAINER_H_ +#endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_ACTION_CONTAINER_H_
diff --git a/chrome/browser/ui/views/tabs/tab_strip_action_container_browsertest.cc b/chrome/browser/ui/views/tabs/tab_strip_action_container_browsertest.cc new file mode 100644 index 0000000..ed7fd3b2 --- /dev/null +++ b/chrome/browser/ui/views/tabs/tab_strip_action_container_browsertest.cc
@@ -0,0 +1,302 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/views/tabs/tab_strip_action_container.h" + +#include "base/feature_list.h" +#include "base/test/metrics/histogram_tester.h" +#include "base/test/scoped_feature_list.h" +#include "chrome/browser/optimization_guide/browser_test_util.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/signin/identity_manager_factory.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/tabs/organization/tab_organization_service.h" +#include "chrome/browser/ui/tabs/organization/tab_organization_utils.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/browser/ui/ui_features.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/frame/tab_strip_region_view.h" +#include "chrome/browser/ui/views/tabs/tab_search_button.h" +#include "chrome/common/chrome_features.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/views/chrome_views_test_base.h" +#include "components/optimization_guide/core/model_execution/model_execution_features.h" +#include "components/optimization_guide/core/optimization_guide_features.h" +#include "components/signin/public/identity_manager/identity_test_utils.h" +#include "content/public/test/browser_test.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/ui_base_features.h" +#include "ui/events/test/event_generator.h" +#include "ui/gfx/animation/slide_animation.h" + +class TabStripActionContainerBrowserTest : public InProcessBrowserTest { + public: + TabStripActionContainerBrowserTest() { + feature_list_.InitWithFeatures( + {features::kTabOrganization, features::kGlic, + features::kTabstripComboButton, features::kTabstripDeclutter}, + {}); + TabOrganizationUtils::GetInstance()->SetIgnoreOptGuideForTesting(true); + } + + TabStripModel* tab_strip_model() { return browser()->tab_strip_model(); } + + BrowserView* browser_view() { + return BrowserView::GetBrowserViewForBrowser(browser()); + } + + TabStripActionContainer* tab_strip_action_container() { + return browser_view() + ->tab_strip_region_view() + ->GetTabStripActionContainer(); + } + + protected: + TabStripNudgeButton* TabDeclutterButton() { + return tab_strip_action_container()->tab_declutter_button(); + } + TabStripNudgeButton* AutoTabGroupButton() { + return tab_strip_action_container()->auto_tab_group_button(); + } + void ShowTabStripNudgeButton(TabStripNudgeButton* button) { + tab_strip_action_container()->ShowTabStripNudge(button); + } + void HideTabStripNudgeButton(TabStripNudgeButton* button) { + tab_strip_action_container()->HideTabStripNudge(button); + } + + void OnTabStripNudgeButtonTimeout(TabStripNudgeButton* button) { + tab_strip_action_container()->OnTabStripNudgeButtonTimeout(button); + } + + void SetLockedExpansionMode(LockedExpansionMode mode, + TabStripNudgeButton* button) { + tab_strip_action_container()->SetLockedExpansionMode(mode, button); + } + void OnButtonClicked(TabStripNudgeButton* button) { + if (button == TabDeclutterButton()) { + tab_strip_action_container()->OnTabDeclutterButtonClicked(); + } else if (button == AutoTabGroupButton()) { + tab_strip_action_container()->OnAutoTabGroupButtonClicked(); + } + } + void OnButtonDismissed(TabStripNudgeButton* button) { + if (button == TabDeclutterButton()) { + tab_strip_action_container()->OnTabDeclutterButtonDismissed(); + } else if (button == AutoTabGroupButton()) { + tab_strip_action_container()->OnAutoTabGroupButtonDismissed(); + } + } + + private: + base::test::ScopedFeatureList feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, ShowsDeclutterChip) { + ASSERT_FALSE(tab_strip_action_container()->animation_session_for_testing()); + + ShowTabStripNudgeButton(TabDeclutterButton()); + + ASSERT_TRUE(tab_strip_action_container() + ->animation_session_for_testing() + ->expansion_animation() + ->IsShowing()); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, + ShowsAndHidesDeclutterChip) { + ASSERT_FALSE(tab_strip_action_container()->animation_session_for_testing()); + + ShowTabStripNudgeButton(TabDeclutterButton()); + + ASSERT_TRUE(tab_strip_action_container() + ->animation_session_for_testing() + ->expansion_animation() + ->IsShowing()); + + // Finish showing declutter chip. + tab_strip_action_container() + ->animation_session_for_testing() + ->ResetAnimationForTesting(1); + tab_strip_action_container()->GetWidget()->LayoutRootViewIfNecessary(); + + // Hide the declutter chip. + HideTabStripNudgeButton(TabDeclutterButton()); + + ASSERT_TRUE(tab_strip_action_container() + ->animation_session_for_testing() + ->expansion_animation() + ->IsClosing()); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, + LogsWhenDeclutterButtonClicked) { + base::HistogramTester histogram_tester; + + ShowTabStripNudgeButton(TabDeclutterButton()); + + OnButtonClicked(TabDeclutterButton()); + + histogram_tester.ExpectUniqueSample( + "Tab.Organization.Declutter.Trigger.Outcome", 0, 1); + // Bucketed CTR metric should reflect one show and one click, with fewer than + // 15 total tabs. + histogram_tester.ExpectBucketCount( + "Tab.Organization.Declutter.Trigger.BucketedCTR", 0, 1); + histogram_tester.ExpectBucketCount( + "Tab.Organization.Declutter.Trigger.BucketedCTR", 10, 1); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, + LogsWhenDeclutterButtonDismissed) { + base::HistogramTester histogram_tester; + + ShowTabStripNudgeButton(TabDeclutterButton()); + + OnButtonDismissed(TabDeclutterButton()); + + histogram_tester.ExpectUniqueSample( + "Tab.Organization.Declutter.Trigger.Outcome", 1, 1); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, + LogsWhenDeclutterButtonTimeout) { + base::HistogramTester histogram_tester; + + ShowTabStripNudgeButton(TabDeclutterButton()); + + OnTabStripNudgeButtonTimeout(TabDeclutterButton()); + + histogram_tester.ExpectUniqueSample( + "Tab.Organization.Declutter.Trigger.Outcome", 2, 1); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, + LogsSuccessWhenAutoTabGroupsButtonClicked) { + base::HistogramTester histogram_tester; + + ShowTabStripNudgeButton(AutoTabGroupButton()); + + tab_strip_action_container() + ->animation_session_for_testing() + ->ResetAnimationForTesting(1); + + tab_strip_action_container()->GetWidget()->LayoutRootViewIfNecessary(); + + TabOrganizationService* service = + tab_strip_action_container()->tab_organization_service_for_testing(); + + service->OnTriggerOccured(browser()); + + OnButtonClicked(AutoTabGroupButton()); + + histogram_tester.ExpectUniqueSample("Tab.Organization.AllEntrypoints.Clicked", + true, 1); + histogram_tester.ExpectUniqueSample("Tab.Organization.Proactive.Clicked", + true, 1); + histogram_tester.ExpectUniqueSample("Tab.Organization.Trigger.Outcome", 0, 1); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, + LogsFailureWhenAutoTabGroupsButtonDismissed) { + base::HistogramTester histogram_tester; + + ShowTabStripNudgeButton(AutoTabGroupButton()); + + tab_strip_action_container() + ->animation_session_for_testing() + ->ResetAnimationForTesting(1); + + tab_strip_action_container()->GetWidget()->LayoutRootViewIfNecessary(); + + TabOrganizationService* service = + tab_strip_action_container()->tab_organization_service_for_testing(); + + service->OnTriggerOccured(browser()); + + OnButtonDismissed(AutoTabGroupButton()); + + histogram_tester.ExpectUniqueSample("Tab.Organization.Proactive.Clicked", + false, 1); + histogram_tester.ExpectUniqueSample("Tab.Organization.Trigger.Outcome", 1, 1); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, DelaysShow) { + ASSERT_FALSE(tab_strip_action_container()->animation_session_for_testing()); + + SetLockedExpansionMode(LockedExpansionMode::kWillShow, TabDeclutterButton()); + + ShowTabStripNudgeButton(TabDeclutterButton()); + + ASSERT_FALSE(tab_strip_action_container()->animation_session_for_testing()); + + SetLockedExpansionMode(LockedExpansionMode::kNone, nullptr); + + ASSERT_TRUE(tab_strip_action_container() + ->animation_session_for_testing() + ->expansion_animation() + ->IsShowing()); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, DelaysHide) { + ASSERT_FALSE(tab_strip_action_container()->animation_session_for_testing()); + + ShowTabStripNudgeButton(TabDeclutterButton()); + + tab_strip_action_container() + ->animation_session_for_testing() + ->ResetAnimationForTesting(1); + tab_strip_action_container()->GetWidget()->LayoutRootViewIfNecessary(); + + ASSERT_FALSE(tab_strip_action_container()->animation_session_for_testing()); + + SetLockedExpansionMode(LockedExpansionMode::kWillHide, TabDeclutterButton()); + + HideTabStripNudgeButton(TabDeclutterButton()); + + ASSERT_FALSE(tab_strip_action_container()->animation_session_for_testing()); + + SetLockedExpansionMode(LockedExpansionMode::kNone, nullptr); + + ASSERT_TRUE(tab_strip_action_container() + ->animation_session_for_testing() + ->expansion_animation() + ->IsClosing()); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, + ImmediatelyHidesWhenOrganizeButtonClicked) { + ShowTabStripNudgeButton(TabDeclutterButton()); + tab_strip_action_container() + ->animation_session_for_testing() + ->ResetAnimationForTesting(1); + tab_strip_action_container()->GetWidget()->LayoutRootViewIfNecessary(); + + SetLockedExpansionMode(LockedExpansionMode::kWillHide, TabDeclutterButton()); + + OnButtonClicked(TabDeclutterButton()); + + EXPECT_TRUE(tab_strip_action_container() + ->animation_session_for_testing() + ->expansion_animation() + ->IsClosing()); +} + +IN_PROC_BROWSER_TEST_F(TabStripActionContainerBrowserTest, + ImmediatelyHidesWhenOrganizeButtonDismissed) { + ShowTabStripNudgeButton(TabDeclutterButton()); + tab_strip_action_container() + ->animation_session_for_testing() + ->ResetAnimationForTesting(1); + tab_strip_action_container()->GetWidget()->LayoutRootViewIfNecessary(); + + SetLockedExpansionMode(LockedExpansionMode::kWillHide, TabDeclutterButton()); + + OnButtonDismissed(TabDeclutterButton()); + + EXPECT_TRUE(tab_strip_action_container() + ->animation_session_for_testing() + ->expansion_animation() + ->IsClosing()); +}
diff --git a/chrome/browser/ui/views/tabs/tab_glic_container_unittest.cc b/chrome/browser/ui/views/tabs/tab_strip_action_container_unittest.cc similarity index 75% rename from chrome/browser/ui/views/tabs/tab_glic_container_unittest.cc rename to chrome/browser/ui/views/tabs/tab_strip_action_container_unittest.cc index f7c23411..c11de3f1 100644 --- a/chrome/browser/ui/views/tabs/tab_glic_container_unittest.cc +++ b/chrome/browser/ui/views/tabs/tab_strip_action_container_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/views/tabs/tab_glic_container.h" +#include "chrome/browser/ui/views/tabs/tab_strip_action_container.h" #include <memory> @@ -43,14 +43,15 @@ std::unique_ptr<TestingProfile> profile_ = std::make_unique<TestingProfile>(); }; -class TabGlicContainerTest : public ChromeViewsTestBase { +class TabStripActionContainerTest : public ChromeViewsTestBase { public: - TabGlicContainerTest() + TabStripActionContainerTest() : animation_mode_reset_(gfx::AnimationTestApi::SetRichAnimationRenderMode( gfx::Animation::RichAnimationRenderMode::FORCE_ENABLED)) {} - TabGlicContainerTest(const TabGlicContainerTest&) = delete; - TabGlicContainerTest& operator=(const TabGlicContainerTest&) = delete; - ~TabGlicContainerTest() override = default; + TabStripActionContainerTest(const TabStripActionContainerTest&) = delete; + TabStripActionContainerTest& operator=(const TabStripActionContainerTest&) = + delete; + ~TabStripActionContainerTest() override = default; void SetUp() override { ChromeViewsTestBase::SetUp(); @@ -60,7 +61,7 @@ void TearDown() override { ChromeViewsTestBase::TearDown(); - tab_glic_container_.reset(); + tab_strip_action_container_.reset(); } void BuildGlicContainer(bool use_otr_profile) { @@ -84,7 +85,7 @@ locked_expansion_view_ = std::make_unique<views::View>(); - tab_glic_container_ = std::make_unique<TabGlicContainer>( + tab_strip_action_container_ = std::make_unique<TabStripActionContainer>( tab_strip_->controller(), locked_expansion_view_.get(), tab_declutter_controller_.get()); } @@ -97,8 +98,8 @@ TestTabStripModelDelegate tab_strip_model_delegate_; base::test::ScopedFeatureList scoped_feature_list_; std::unique_ptr<views::View> locked_expansion_view_; - std::unique_ptr<TabGlicContainer> tab_glic_container_; std::unique_ptr<FakeGlicTabStripController> controller_; + std::unique_ptr<TabStripActionContainer> tab_strip_action_container_; private: // Owned by TabStrip. @@ -106,25 +107,28 @@ }; #if BUILDFLAG(ENABLE_GLIC) -TEST_F(TabGlicContainerTest, GlicButtonDrawing) { +TEST_F(TabStripActionContainerTest, GlicButtonDrawing) { BuildGlicContainer(/*use_otr_profile=*/false); - EXPECT_TRUE(tab_glic_container_->GetGlicButton()); + EXPECT_TRUE(tab_strip_action_container_->GetGlicButton()); } -TEST_F(TabGlicContainerTest, GlicButtonUnsupportedProfile) { +TEST_F(TabStripActionContainerTest, GlicButtonUnsupportedProfile) { BuildGlicContainer(/*use_otr_profile=*/true); - EXPECT_FALSE(tab_glic_container_->GetGlicButton()); + EXPECT_FALSE(tab_strip_action_container_->GetGlicButton()); } #endif // BUILDFLAG(ENABLE_GLIC) -TEST_F(TabGlicContainerTest, OrdersButtonsCorrectly) { +TEST_F(TabStripActionContainerTest, OrdersButtonsCorrectly) { BuildGlicContainer(/*use_otr_profile=*/false); - ASSERT_EQ(tab_glic_container_->tab_declutter_button(), - tab_glic_container_->children()[0]); + ASSERT_EQ(tab_strip_action_container_->tab_declutter_button(), + tab_strip_action_container_->children()[0]); + + ASSERT_EQ(tab_strip_action_container_->auto_tab_group_button(), + tab_strip_action_container_->children()[1]); #if BUILDFLAG(ENABLE_GLIC) - ASSERT_EQ(tab_glic_container_->GetGlicButton(), - tab_glic_container_->children()[1]); + ASSERT_EQ(tab_strip_action_container_->GetGlicButton(), + tab_strip_action_container_->children()[2]); #endif // BUILDFLAG(ENABLE_GLIC) }
diff --git a/chrome/browser/ui/views/tabs/tab_strip_controller.h b/chrome/browser/ui/views/tabs/tab_strip_controller.h index 09f7746..43b3916 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_controller.h +++ b/chrome/browser/ui/views/tabs/tab_strip_controller.h
@@ -18,6 +18,7 @@ class Browser; class BrowserWindowInterface; +class ScopedTabStripModalUI; class Tab; class TabGroup; class TabStrip; @@ -49,6 +50,13 @@ // Returns the number of tabs in the model. virtual int GetCount() const = 0; + // Features that want to show tabstrip-modal UI are mutually exclusive. + // Before showing a modal UI first check `CanShowModalUI`. Then call + // ShowModalUI() and keep `ScopedTabStripModal` alive to prevent other + // features from showing tabstrip-modal UI. + virtual bool CanShowModalUI() const = 0; + virtual std::unique_ptr<ScopedTabStripModalUI> ShowModalUI() = 0; + // Returns true if |index| is a valid model index. virtual bool IsValidIndex(int index) const = 0;
diff --git a/chrome/browser/ui/views/web_apps/simple_install_dialog_bubble_view_browsertest.cc b/chrome/browser/ui/views/web_apps/simple_install_dialog_bubble_view_browsertest.cc index 31cbed9..5c839121 100644 --- a/chrome/browser/ui/views/web_apps/simple_install_dialog_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/web_apps/simple_install_dialog_bubble_view_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/functional/callback_helpers.h" +#include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" @@ -13,6 +14,8 @@ #include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_finder.h" +#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h" #include "chrome/browser/ui/web_applications/web_app_browsertest_base.h" #include "chrome/browser/ui/web_applications/web_app_dialogs.h" @@ -35,8 +38,11 @@ #include "components/webapps/common/web_app_id.h" #include "content/public/browser/document_picture_in_picture_window_controller.h" #include "content/public/browser/picture_in_picture_window_controller.h" +#include "content/public/browser/web_contents_observer.h" #include "content/public/test/browser_test.h" +#include "content/public/test/browser_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/window_open_disposition.h" #include "ui/views/test/dialog_test.h" #include "ui/views/test/widget_test.h" #include "ui/views/widget/any_widget_observer.h" @@ -67,6 +73,36 @@ } constexpr char kInstallDialogName[] = "WebAppSimpleInstallDialog"; + +// Waits for a pop-up web contents to open. +class PopupObserver : public content::WebContentsObserver { + public: + explicit PopupObserver(content::WebContents* web_contents) + : WebContentsObserver(web_contents) {} + + void Wait() { run_loop_.Run(); } + content::WebContents* popup() { return popup_; } + + private: + // WebContentsObserver overrides: + void DidOpenRequestedURL(content::WebContents* new_contents, + content::RenderFrameHost* source_render_frame_host, + const GURL& url, + const content::Referrer& referrer, + WindowOpenDisposition disposition, + ui::PageTransition transition, + bool started_from_context_menu, + bool renderer_initiated) override { + if (!popup_ && disposition == WindowOpenDisposition::NEW_POPUP) { + popup_ = new_contents; + run_loop_.Quit(); + } + } + + raw_ptr<content::WebContents> popup_ = nullptr; + base::RunLoop run_loop_; +}; + class SimpleInstallDialogBubbleViewBrowserTest : public WebAppBrowserTestBase { public: SimpleInstallDialogBubbleViewBrowserTest() @@ -74,6 +110,22 @@ web_app::SetDontCloseOnDeactivateForTesting()) {} ~SimpleInstallDialogBubbleViewBrowserTest() override = default; + // Open a popup window with the given URL and return its WebContents. + base::expected<content::WebContents*, std::string> OpenPopup( + const GURL& url) { + auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); + PopupObserver observer(web_contents); + if (!content::ExecJs( + web_contents, + content::JsReplace( + "window.open($1, '', 'popup=true, width=200, height=100')", + url))) { + return base::unexpected("window.open failed"); + } + observer.Wait(); + return observer.popup(); + } + private: base::AutoReset<bool> prevent_close_on_deactivate_; }; @@ -281,6 +333,70 @@ views::Widget::ClosedReason::kCloseButtonClicked, 1); } +// TODO(dibyapal): `ui_test_utils::SetAndWaitForBounds()` does not seem to be +// resizing the browser window on Mac. +#if !BUILDFLAG(IS_MAC) +IN_PROC_BROWSER_TEST_F(SimpleInstallDialogBubbleViewBrowserTest, + WindowSizeLoweringClosesDialog) { + std::unique_ptr<webapps::MlInstallOperationTracker> install_tracker = + GetInstallTracker(browser()); + + views::NamedWidgetShownWaiter widget_waiter( + views::test::AnyWidgetTestPasskey{}, kInstallDialogName); + base::test::TestFuture<bool, std::unique_ptr<WebAppInstallInfo>> test_future; + ShowSimpleInstallDialogForWebApps( + browser()->tab_strip_model()->GetActiveWebContents(), GetAppInfo(), + std::move(install_tracker), test_future.GetCallback()); + + views::Widget* widget = widget_waiter.WaitIfNeededAndGet(); + ASSERT_NE(widget, nullptr); + EXPECT_FALSE(test_future.IsReady()); + + base::HistogramTester histograms; + views::test::WidgetDestroyedWaiter destroy_waiter(widget); + // Make the size of the browser window too small for the dialog. + ui_test_utils::SetAndWaitForBounds(*browser(), gfx::Rect(100, 100)); + destroy_waiter.Wait(); + + ASSERT_TRUE(test_future.Wait()); + EXPECT_FALSE(test_future.Get<bool>()); + + histograms.ExpectUniqueSample( + "WebApp.InstallConfirmation.CloseReason", + views::Widget::ClosedReason::kCloseButtonClicked, 1); +} +#endif // !BUILDFLAG(IS_MAC) + +IN_PROC_BROWSER_TEST_F(SimpleInstallDialogBubbleViewBrowserTest, + SmallPopupClosesWindowAutomatically) { + auto popup_value = OpenPopup(GURL("https://www.example.com")); + EXPECT_TRUE(popup_value.has_value()); + content::WebContents* popup_contents = popup_value.value(); + Browser* popup_browser = chrome::FindBrowserWithTab(popup_contents); + + std::unique_ptr<webapps::MlInstallOperationTracker> install_tracker = + GetInstallTracker(popup_browser); + + base::HistogramTester histograms; + views::AnyWidgetObserver widget_observer(views::test::AnyWidgetTestPasskey{}); + + base::RunLoop run_loop; + widget_observer.set_closing_callback( + base::BindLambdaForTesting([&](views::Widget* widget) { + if (widget->GetName() == kInstallDialogName) { + run_loop.Quit(); + } + })); + ShowSimpleInstallDialogForWebApps(popup_contents, GetAppInfo(), + std::move(install_tracker), + base::DoNothing()); + run_loop.Run(); + + histograms.ExpectUniqueSample( + "WebApp.InstallConfirmation.CloseReason", + views::Widget::ClosedReason::kCloseButtonClicked, 1); +} + class PictureInPictureSimpleInstallDialogOcclusionTest : public MixinBasedInProcessBrowserTest { protected:
diff --git a/chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.cc b/chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.cc index 1156fa1..0e8b752 100644 --- a/chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.cc
@@ -106,24 +106,6 @@ "syncConsentScreenTitleArcRestrictions", IDS_LOGIN_SYNC_CONSENT_SCREEN_TITLE_WITH_ARC_RESTRICTED, builder); - RememberLocalizedValue("syncConsentScreenTitleLacros", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_TITLE, builder); - - RememberLocalizedValue("syncConsentScreenSubtitleLacros", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SUBTITLE, builder); - - RememberLocalizedValue("syncConsentScreenAdditionalSubtitleLacros", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_ADDITIONAL_SUBTITLE, - builder); - - RememberLocalizedValue("syncConsentScreenManageTitleLacros", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_TITLE, - builder); - - RememberLocalizedValue("syncConsentScreenManageSubtitleLacros", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_MANAGE_SYNC_SUBTITLE, - builder); - // Content section. RememberLocalizedValueWithDeviceName( "syncConsentScreenOsSyncTitle", @@ -157,39 +139,6 @@ RememberLocalizedValue("syncConsentScreenDecline", IDS_LOGIN_SYNC_CONSENT_SCREEN_DECLINE2, builder); - RememberLocalizedValue("syncConsentScreenManage", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_SYNC_OPTIONS, - builder); - - // Content section Customize Lacros Sync. - RememberLocalizedValue("syncConsentScreenOsSyncItemOptionAppsTitle", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_TITLE, - builder); - RememberLocalizedValue("syncConsentScreenOsSyncItemOptionAppsSubtitle", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_APPS_SUBTITLE, - builder); - - RememberLocalizedValue("syncConsentScreenOsSyncItemOptionSettingsTitle", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_TITLE, - builder); - RememberLocalizedValue( - "syncConsentScreenOsSyncItemOptionSettingsSubtitle", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_SETTINGS_SUBTITLE, builder); - - RememberLocalizedValue("syncConsentScreenOsSyncItemOptionWifiTitle", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_TITLE, - builder); - RememberLocalizedValue("syncConsentScreenOsSyncItemOptionWifiSubtitle", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WIFI_SUBTITLE, - builder); - - RememberLocalizedValue( - "syncConsentScreenOsSyncItemOptionWallpaperTitle", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_TITLE, builder); - RememberLocalizedValue( - "syncConsentScreenOsSyncItemOptionWallpaperSubtitle", - IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_OPTION_WALLPAPER_SUBTITLE, builder); - // App Tooltip text. RememberLocalizedValue("syncConsentScreenOsSyncAppsTooltipText", IDS_LOGIN_OS_SYNC_CONSENT_SCREEN_TOOLTIP_TEXT,
diff --git a/chrome/browser/ui/webui/ash/settings/pages/crostini/crostini_section.cc b/chrome/browser/ui/webui/ash/settings/pages/crostini/crostini_section.cc index be381c1c..77e3c1a0 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/crostini/crostini_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/crostini/crostini_section.cc
@@ -269,7 +269,7 @@ {"bruschettaRemoveButton", IDS_SETTINGS_BRUSCHETTA_REMOVE_BUTTON}, {"crostiniPageTitle", IDS_SETTINGS_CROSTINI_TITLE}, {"crostiniPageLabel", IDS_SETTINGS_CROSTINI_LABEL}, - {"crostiniEnable", IDS_OS_SETTINGS_REVAMP_CROSTINI_SET_UP}, + {"crostiniEnable", IDS_OS_SETTINGS_CROSTINI_SET_UP}, {"crostiniSharedPathsInstructionsAdd", IDS_SETTINGS_CROSTINI_SHARED_PATHS_INSTRUCTIONS_ADD}, {"crostiniSharedPathsRemoveFailureDialogMessage", @@ -508,7 +508,7 @@ html_source->AddString( "crostiniSubtext", l10n_util::GetStringFUTF16( - IDS_OS_SETTINGS_REVAMP_CROSTINI_SUBTEXT, + IDS_OS_SETTINGS_CROSTINI_SUBTEXT, GetHelpUrlWithBoard(chrome::kLinuxAppsLearnMoreURL))); html_source->AddString( "crostiniSubtextNotSupported",
diff --git a/chrome/browser/ui/webui/glic/glic_page_handler.cc b/chrome/browser/ui/webui/glic/glic_page_handler.cc index bd11ccf..744a7ad 100644 --- a/chrome/browser/ui/webui/glic/glic_page_handler.cc +++ b/chrome/browser/ui/webui/glic/glic_page_handler.cc
@@ -33,6 +33,8 @@ pref_service_(profile_->GetPrefs()), receiver_(this, std::move(receiver)) {} + ~GlicWebClientHandler() override { Uninstall(); } + // glic::mojom::WebClientHandler implementation. void WebClientInitialized( ::mojo::PendingRemote<glic::mojom::WebClient> web_client) override { @@ -59,6 +61,7 @@ // Communicate initial permission values to web client. SendPermissionsToWebClient(); + installed_ = true; } void GetChromeVersion(GetChromeVersionCallback callback) override { @@ -155,12 +158,19 @@ web_client_->NotifyPanelStateChange(panel_state.Clone()); } - private: - void WebClientDisconnected() { + void Uninstall() { + if (!installed_) { + return; + } + pref_change_registrar_.Reset(); glic_service_->window_controller().RemoveStateObserver(this); + installed_ = false; } + private: + void WebClientDisconnected() { Uninstall(); } + void OnPrefChanged(const std::string& pref_name) { bool is_enabled = pref_service_->GetBoolean(pref_name); if (pref_name == prefs::kGlicMicrophoneEnabled) { @@ -189,6 +199,7 @@ raw_ptr<PrefService> pref_service_; mojo::Receiver<glic::mojom::WebClientHandler> receiver_; mojo::Remote<glic::mojom::WebClient> web_client_; + bool installed_ = false; }; GlicPageHandler::GlicPageHandler(
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index bc330fc9..3774bd7b6 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1734955174-be74f280c8a495ca85153700bd44ed1ccc98f0a6-cd4d4057ce6c26f114210606a77cc5b6d53633c6.profdata +chrome-android32-main-1734998282-eab565bc18848a43814116441e105fb7a1cc80f7-078b65dc02a5aff7a126ae0371a4de107631c14e.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index ce9d461b..5284d6d8 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1734973787-c04aeaadf791e04aacce43a0d89d4d83663624a9-8a6d0004776ccdcaa7f006724680067508238c9a.profdata +chrome-android64-main-1735006814-35cf11ae6797d15a9f3052728a059a448f366e96-71d318f610bd85865ea1adf4a60f55e53073d029.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 38399f0..3c44f3f 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1734955174-519c993e8e9dbc46b43822dcde04b3cf9084d486-cd4d4057ce6c26f114210606a77cc5b6d53633c6.profdata +chrome-linux-main-1734998282-199b4d27b3e11116ef3898f71f416bd3ff0833fd-078b65dc02a5aff7a126ae0371a4de107631c14e.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index c38261cf..84bfdf5 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1734976754-374a4aa3269f7a9c0d2e7209951dce935f52947b-0add407c1df86e8883c71dedfcaf017e76840e3c.profdata +chrome-mac-arm-main-1735005476-35ec3bef926c9890a860c3b16a0064be02134b9f-b1e2c07716d3881c1aeb9abc8e1dc58e963e0c24.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index c41dbb4..6b5a9f2 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1734955174-7843aaf2abf77f6a47ccc2083a713f6603bd87f5-cd4d4057ce6c26f114210606a77cc5b6d53633c6.profdata +chrome-mac-main-1734998282-c0d263b2f687ebf8f1c3132dcbbb5eacce4dc0ae-078b65dc02a5aff7a126ae0371a4de107631c14e.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index 3f126cd..30ea9ce 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1734955174-c5b10146f557a99b95cd6dd6b1916b28e4a17287-cd4d4057ce6c26f114210606a77cc5b6d53633c6.profdata +chrome-win-arm64-main-1734998282-078bd10fef1143c09023f0f398fd6524bd2e77e6-078b65dc02a5aff7a126ae0371a4de107631c14e.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 7784ec0a..6b12df0 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1734965995-72bc722c6628db9df4ec77104936d364fc90bdbd-7a273d0c97d4fe0d35c9d487e12ffe2ced07f1e4.profdata +chrome-win32-main-1734987568-05d03c2bb859527dd7c49428c40c888be2882f9c-9e79b08298588370cfb467a2db43df76bf959b95.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 6693e1dc..e564b3fa 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1734965995-6942cd46ac876d595bd674da2ab1e422395a7285-7a273d0c97d4fe0d35c9d487e12ffe2ced07f1e4.profdata +chrome-win64-main-1734987568-2204e9683c334721ac9ef223ed2351c23b4a5fb7-9e79b08298588370cfb467a2db43df76bf959b95.profdata
diff --git a/chrome/common/apps/platform_apps/api/media_galleries.idl b/chrome/common/apps/platform_apps/api/media_galleries.idl index 0ac695c680..a1d5daf7 100644 --- a/chrome/common/apps/platform_apps/api/media_galleries.idl +++ b/chrome/common/apps/platform_apps/api/media_galleries.idl
@@ -7,7 +7,7 @@ // images, video) from the user's local disks (with the user's consent). namespace mediaGalleries { - [inline_doc] enum GalleryChangeType { + enum GalleryChangeType { // The contents of the gallery have changed. contents_changed, // The watch has been dropped because the device has been detached, @@ -15,7 +15,7 @@ watch_dropped }; - [inline_doc] enum GetMediaFileSystemsInteractivity { + enum GetMediaFileSystemsInteractivity { // Do not act interactively. no, // Ask the user to manage permitted media galleries. @@ -25,7 +25,7 @@ if_needed }; - [inline_doc] enum GetMetadataType { + enum GetMetadataType { // Retrieve the mime type, metadata tags, and attached images. all, // Retrieve only the mime type and the metadata tags. @@ -34,7 +34,7 @@ mimeTypeOnly }; - [inline_doc] dictionary GalleryChangeDetails { + dictionary GalleryChangeDetails { // Type of change event. GalleryChangeType type; @@ -42,7 +42,7 @@ DOMString galleryId; }; - [inline_doc] dictionary MediaFileSystemsDetails { + dictionary MediaFileSystemsDetails { // Whether to prompt the user for permission to additional media galleries // before returning the permitted set. Default is silent. If the value // 'yes' is passed, or if the application has not been granted access to @@ -51,7 +51,7 @@ GetMediaFileSystemsInteractivity? interactive; }; - [inline_doc] dictionary MediaMetadataOptions { + dictionary MediaMetadataOptions { // Specifies which subset of the metadata to retrieve. Defaults to 'all' // if the option is omitted. GetMetadataType? metadataType; @@ -64,7 +64,7 @@ void ([instanceOf=DOMFileSystem] object[] mediaFileSystems, DOMString selectedFileSystemName); - [inline_doc] dictionary MediaFileSystemMetadata { + dictionary MediaFileSystemMetadata { // The name of the file system. DOMString name;
diff --git a/chrome/common/extensions/api/accessibility_private.json b/chrome/common/extensions/api/accessibility_private.json index fca841e..5b0526f 100644 --- a/chrome/common/extensions/api/accessibility_private.json +++ b/chrome/common/extensions/api/accessibility_private.json
@@ -812,17 +812,6 @@ ] }, { - "name": "clipboardCopyInActiveLacrosGoogleDoc", - "type": "function", - "description": "Called by the Select-to-Speak extension to request a clipboard copy in the active Lacros Google Docs tab for the copy-paste fallback.", - "parameters": [ { - "name": "url", - "type": "string", - "description": "URL of the Google Docs tab." - } - ] - }, - { "name": "handleScrollableBoundsForPointFound", "type": "function", "description": "Called by the Accessibility Common extension when onScrollableBoundsForPointRequested has found a scrolling container. |rect| will be the bounds of the nearest scrollable ancestor of the node at the point requested using onScrollableBoundsForPointRequested.", @@ -1090,23 +1079,6 @@ } }, { - "name": "isLacrosPrimary", - "type": "function", - "description": "Gets whether new browser windows and tabs should be in Lacros browser.", - "parameters": [], - "returns_async": { - "name": "callback", - "description": "A callback that is run when the result is returned.", - "parameters": [ - { - "type": "boolean", - "name": "useLacros", - "description": "True if new browser windows and tabs should be in Lacros." - } - ] - } - }, - { "name": "showToast", "type": "function", "description": "Displays an accessibility-related toast.",
diff --git a/chrome/common/extensions/api/bookmarks.json b/chrome/common/extensions/api/bookmarks.json index 49c5e49..c039ae7 100644 --- a/chrome/common/extensions/api/bookmarks.json +++ b/chrome/common/extensions/api/bookmarks.json
@@ -86,7 +86,6 @@ { "id": "CreateDetails", "description": "Object passed to the create() function.", - "inline_doc": true, "type": "object", "properties": { "parentId": {
diff --git a/chrome/common/extensions/api/certificate_provider.idl b/chrome/common/extensions/api/certificate_provider.idl index ea9b246..2f121fd 100644 --- a/chrome/common/extensions/api/certificate_provider.idl +++ b/chrome/common/extensions/api/certificate_provider.idl
@@ -47,7 +47,7 @@ }; // Information about a client certificate. - [noinline_doc] dictionary ClientCertificateInfo { + dictionary ClientCertificateInfo { // The array must contain the DER encoding of the X.509 client certificate // as its first element. // <p>This must include exactly one certificate.</p>
diff --git a/chrome/common/extensions/api/declarative_content.json b/chrome/common/extensions/api/declarative_content.json index 1f45afa7..0bc5f136 100644 --- a/chrome/common/extensions/api/declarative_content.json +++ b/chrome/common/extensions/api/declarative_content.json
@@ -12,8 +12,7 @@ "type": "binary", "isInstanceOf": "ImageData", "additionalProperties": { "type": "any" }, - "description": "See <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/ImageData\">https://developer.mozilla.org/en-US/docs/Web/API/ImageData</a>.", - "inline_doc": true + "description": "See <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/ImageData\">https://developer.mozilla.org/en-US/docs/Web/API/ImageData</a>." }, { "id": "PageStateMatcherInstanceType",
diff --git a/chrome/common/extensions/api/enterprise_platform_keys.idl b/chrome/common/extensions/api/enterprise_platform_keys.idl index 45d8407..4b083fb 100644 --- a/chrome/common/extensions/api/enterprise_platform_keys.idl +++ b/chrome/common/extensions/api/enterprise_platform_keys.idl
@@ -8,7 +8,7 @@ // extension through $(ref:platformKeys chrome.platformKeys). [platforms = ("chromeos", "lacros")] namespace enterprise.platformKeys { - [nocompile, noinline_doc] dictionary Token { + [nocompile] dictionary Token { // Uniquely identifies this <code>Token</code>. // <p>Static IDs are <code>"user"</code> and <code>"system"</code>, // referring to the platform's user-specific and the system-wide hardware
diff --git a/chrome/common/extensions/api/notifications.idl b/chrome/common/extensions/api/notifications.idl index 65f7a35b..fd6d6b69 100644 --- a/chrome/common/extensions/api/notifications.idl +++ b/chrome/common/extensions/api/notifications.idl
@@ -5,7 +5,7 @@ // Use the <code>chrome.notifications</code> API to create rich notifications // using templates and show these notifications to users in the system tray. namespace notifications { - [noinline_doc] enum TemplateType { + enum TemplateType { // Contains an icon, title, message, expandedMessage, and up to two // buttons. basic,
diff --git a/chrome/common/extensions/api/omnibox.json b/chrome/common/extensions/api/omnibox.json index c14b429..752c4ca 100644 --- a/chrome/common/extensions/api/omnibox.json +++ b/chrome/common/extensions/api/omnibox.json
@@ -64,7 +64,6 @@ }, { "id": "DefaultSuggestResult", - "inline_doc": true, "type": "object", "description": "A suggest result.", "properties": {
diff --git a/chrome/common/extensions/api/platform_keys.idl b/chrome/common/extensions/api/platform_keys.idl index 916abf8f..fff9ebf 100644 --- a/chrome/common/extensions/api/platform_keys.idl +++ b/chrome/common/extensions/api/platform_keys.idl
@@ -8,7 +8,7 @@ // E.g. this allows usage of platform managed certificates in third party VPNs // (see $(ref:vpnProvider chrome.vpnProvider)). namespace platformKeys { - [noinline_doc] dictionary Match { + dictionary Match { // The DER encoding of a X.509 certificate. ArrayBuffer certificate;
diff --git a/chrome/common/extensions/api/vpn_provider.idl b/chrome/common/extensions/api/vpn_provider.idl index 4f7abdc79..eb0a2d0 100644 --- a/chrome/common/extensions/api/vpn_provider.idl +++ b/chrome/common/extensions/api/vpn_provider.idl
@@ -108,14 +108,14 @@ // to signal completion. The callback is called with // <code>chrome.runtime.lastError</code> set to error code if // there is an error. - [inline_doc] callback CallCompleteCallback = void (); + callback CallCompleteCallback = void (); // The callback is used by <code>createConfig</code> to signal completion. // The callback is called with <code>chrome.runtime.lastError</code> set to // an error code if there is an error. // |id|: A unique ID for the created configuration, or <code>undefined</code> // on failure. - [inline_doc] callback CreateConfigCompleteCallback = void (DOMString id); + callback CreateConfigCompleteCallback = void (DOMString id); interface Functions { // Creates a new VPN configuration that persists across multiple login
diff --git a/chrome/common/profiler/thread_profiler_platform_configuration.cc b/chrome/common/profiler/thread_profiler_platform_configuration.cc index 2355c2a..7514fc80 100644 --- a/chrome/common/profiler/thread_profiler_platform_configuration.cc +++ b/chrome/common/profiler/thread_profiler_platform_configuration.cc
@@ -170,6 +170,9 @@ sampling_profiler::ProfilerThreadType thread, std::optional<version_info::Channel> release_channel) const override; + bool IsSupportedForChannel( + std::optional<version_info::Channel> release_channel) const override; + private: // Whether profiling is enabled on a thread type for Android DEV channel. const base::flat_map<sampling_profiler::ProfilerThreadType, bool> @@ -308,6 +311,25 @@ } } +bool AndroidPlatformConfiguration::IsSupportedForChannel( + std::optional<version_info::Channel> release_channel) const { + // The profiler is always supported for local builds and the CQ. + if (!release_channel) { + return true; + } + + // Canary, dev, and beta channels are supported in release builds. + switch (*release_channel) { + case version_info::Channel::CANARY: + case version_info::Channel::DEV: + case version_info::Channel::BETA: + return true; + + default: + return false; + } +} + #endif // BUILDFLAG(IS_ANDROID) } // namespace
diff --git a/chrome/common/profiler/thread_profiler_platform_configuration_unittest.cc b/chrome/common/profiler/thread_profiler_platform_configuration_unittest.cc index 30491b6d..3505f64 100644 --- a/chrome/common/profiler/thread_profiler_platform_configuration_unittest.cc +++ b/chrome/common/profiler/thread_profiler_platform_configuration_unittest.cc
@@ -79,7 +79,11 @@ EXPECT_TRUE(config()->IsSupported(version_info::Channel::CANARY)); EXPECT_TRUE(config()->IsSupported(version_info::Channel::DEV)); EXPECT_TRUE(config()->IsSupported(version_info::Channel::BETA)); +#if BUILDFLAG(IS_ANDROID) + EXPECT_FALSE(config()->IsSupported(version_info::Channel::STABLE)); +#else // BUILDFLAG(IS_ANDROID) EXPECT_TRUE(config()->IsSupported(version_info::Channel::STABLE)); +#endif // BUILDFLAG(IS_ANDROID) EXPECT_TRUE(config()->IsSupported(std::nullopt)); #endif
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 3006734..4d3b8908 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -3235,9 +3235,9 @@ "../browser/ui/views/side_panel/side_panel_coordinator_browsertest.cc", "../browser/ui/views/side_panel/side_panel_web_ui_view_browsertest.cc", "../browser/ui/views/tab_search_bubble_host_browsertest.cc", - "../browser/ui/views/tabs/tab_glic_container_browsertest.cc", "../browser/ui/views/tabs/tab_search_button_browsertest.cc", "../browser/ui/views/tabs/tab_search_container_browsertest.cc", + "../browser/ui/views/tabs/tab_strip_action_container_browsertest.cc", "../browser/ui/views/tabs/tab_strip_browsertest.cc", "../browser/ui/views/tabs/tab_strip_combo_button_browsertest.cc", "../browser/ui/views/toolbar/app_menu_browsertest.cc", @@ -9854,11 +9854,11 @@ "../browser/ui/views/tabs/fake_tab_slot_controller.h", "../browser/ui/views/tabs/overflow_view_unittest.cc", "../browser/ui/views/tabs/tab_container_unittest.cc", - "../browser/ui/views/tabs/tab_glic_container_unittest.cc", "../browser/ui/views/tabs/tab_group_views_unittest.cc", "../browser/ui/views/tabs/tab_hover_card_bubble_view_unittest.cc", "../browser/ui/views/tabs/tab_hover_card_controller_unittest.cc", "../browser/ui/views/tabs/tab_search_container_unittest.cc", + "../browser/ui/views/tabs/tab_strip_action_container_unittest.cc", "../browser/ui/views/tabs/tab_strip_control_button_unittest.cc", "../browser/ui/views/tabs/tab_strip_layout_unittest.cc", "../browser/ui/views/tabs/tab_strip_nudge_button_unittest.cc",
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/SnackbarFacility.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/SnackbarFacility.java index 6d09fb3..fcd2060 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/SnackbarFacility.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/SnackbarFacility.java
@@ -51,8 +51,7 @@ } if (mExpectedButtonText != null) { - ViewSpec messageSpec = - viewSpec(withText(mExpectedButtonText), SNACKBAR_BUTTON.getViewMatcher()); + ViewSpec messageSpec = SNACKBAR_BUTTON.and(withText(mExpectedButtonText)); elements.declareView(messageSpec); } else { elements.declareView(SNACKBAR_BUTTON);
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/HubBaseStation.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/HubBaseStation.java index 511c089..c3142a183 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/HubBaseStation.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/HubBaseStation.java
@@ -45,11 +45,9 @@ public static final ViewSpec HUB_TOOLBAR = viewSpec(withId(R.id.hub_toolbar)); public static final ViewSpec HUB_PANE_HOST = viewSpec(withId(R.id.hub_pane_host)); public static final ViewSpec HUB_MENU_BUTTON = - viewSpec( - isDescendantOfA(withId(R.id.hub_toolbar)), - withId(org.chromium.chrome.R.id.menu_button)); + HUB_TOOLBAR.descendant(withId(org.chromium.chrome.R.id.menu_button)); public static final ViewSpec HUB_PANE_SWITCHER = - viewSpec(allOf(isDescendantOfA(withId(R.id.hub_toolbar)), withId(R.id.pane_switcher))); + HUB_TOOLBAR.descendant(withId(R.id.pane_switcher)); // The non-regular toggle tab button contentDescription is a substring found in the string: // R.string.accessibility_tab_switcher_standard_stack.
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/IncognitoTabSwitcherStation.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/IncognitoTabSwitcherStation.java index 176a2f42..861b9fa 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/IncognitoTabSwitcherStation.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/IncognitoTabSwitcherStation.java
@@ -6,8 +6,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isSelected; -import static org.chromium.base.test.transit.ViewSpec.viewSpec; - import org.chromium.base.test.transit.Elements; import org.chromium.base.test.transit.ViewSpec; import org.chromium.chrome.browser.hub.PaneId; @@ -18,7 +16,7 @@ public class IncognitoTabSwitcherStation extends TabSwitcherStation { public static final ViewSpec SELECTED_INCOGNITO_TOGGLE_TAB_BUTTON = - viewSpec(INCOGNITO_TOGGLE_TAB_BUTTON.getViewMatcher(), isSelected()); + INCOGNITO_TOGGLE_TAB_BUTTON.and(isSelected()); public IncognitoTabSwitcherStation(boolean regularTabsExist, boolean incognitoTabsExist) { super(/* isIncognito= */ true, regularTabsExist, incognitoTabsExist);
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/RegularTabSwitcherStation.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/RegularTabSwitcherStation.java index c2e8061..47624e47 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/RegularTabSwitcherStation.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/RegularTabSwitcherStation.java
@@ -21,7 +21,7 @@ public static final ViewSpec EMPTY_STATE_TEXT = viewSpec(withText(R.string.tabswitcher_no_tabs_empty_state)); public static final ViewSpec SELECTED_REGULAR_TOGGLE_TAB_BUTTON = - viewSpec(REGULAR_TOGGLE_TAB_BUTTON.getViewMatcher(), isSelected()); + REGULAR_TOGGLE_TAB_BUTTON.and(isSelected()); public RegularTabSwitcherStation(boolean regularTabsExist, boolean incognitoTabsExist) { super(/* isIncognito= */ false, regularTabsExist, incognitoTabsExist);
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabGroupDialogFacility.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabGroupDialogFacility.java index fec6121..4de9132 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabGroupDialogFacility.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabGroupDialogFacility.java
@@ -6,22 +6,16 @@ import static androidx.test.espresso.action.ViewActions.replaceText; import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom; -import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.CoreMatchers.allOf; - import static org.chromium.base.test.transit.ViewSpec.viewSpec; -import android.view.View; import android.widget.EditText; import androidx.annotation.Nullable; -import org.hamcrest.Matcher; - import org.chromium.base.test.transit.Elements; import org.chromium.base.test.transit.Facility; import org.chromium.base.test.transit.Station; @@ -46,24 +40,22 @@ */ public class TabGroupDialogFacility<HostStationT extends Station<ChromeTabbedActivity>> extends Facility<HostStationT> { - public static final Matcher<View> TOOLBAR_MATCHER = - isDescendantOfA(withId(R.id.tab_group_toolbar)); - public static final Matcher<View> TITLE_INPUT_MATCHER = - allOf(withId(R.id.title), isAssignableFrom(EditText.class), TOOLBAR_MATCHER); + public static final ViewSpec TOOLBAR = viewSpec(withId(R.id.tab_group_toolbar)); + public static final ViewSpec TITLE_INPUT = + TOOLBAR.descendant(withId(R.id.title), isAssignableFrom(EditText.class)); public static final ViewSpec TABS_LIST = viewSpec( withId(R.id.tab_list_recycler_view), withParent(withId(R.id.tab_grid_dialog_recycler_view_container))); public static final ViewSpec COLOR_ICON = - viewSpec(withId(R.id.tab_group_color_icon_container), TOOLBAR_MATCHER); + TOOLBAR.descendant(withId(R.id.tab_group_color_icon_container)); public static final ViewSpec NEW_TAB_BUTTON = - viewSpec(withId(R.id.toolbar_new_tab_button), TOOLBAR_MATCHER); - public static final ViewSpec BACK_BUTTON = - viewSpec(withId(R.id.toolbar_back_button), TOOLBAR_MATCHER); - public static final ViewSpec LIST_MENU_BUTTON = viewSpec(withId(R.id.toolbar_menu_button)); - public static final ViewSpec SHARE_BUTTON = - viewSpec(withId(R.id.share_button), TOOLBAR_MATCHER); + TOOLBAR.descendant(withId(R.id.toolbar_new_tab_button)); + public static final ViewSpec BACK_BUTTON = TOOLBAR.descendant(withId(R.id.toolbar_back_button)); + public static final ViewSpec LIST_MENU_BUTTON = + TOOLBAR.descendant(withId(R.id.toolbar_menu_button)); + public static final ViewSpec SHARE_BUTTON = TOOLBAR.descendant(withId(R.id.share_button)); private final List<Integer> mTabIdsInGroup; private final String mTitle; @@ -94,7 +86,7 @@ mSelectedColor = selectedColor; mIsIncognito = isIncognito; - mTitleInputSpec = viewSpec(withText(mTitle), TITLE_INPUT_MATCHER); + mTitleInputSpec = TITLE_INPUT.and(withText(mTitle)); } @Override
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabSwitcherListEditorFacility.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabSwitcherListEditorFacility.java index 6df3424..c825fb2 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabSwitcherListEditorFacility.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabSwitcherListEditorFacility.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.test.transit.hub; import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withText; @@ -35,10 +34,7 @@ public class TabSwitcherListEditorFacility extends Facility<TabSwitcherStation> { public static final ViewSpec TAB_LIST_EDITOR_LAYOUT = viewSpec(withId(R.id.selectable_list)); public static final ViewSpec TAB_LIST_EDITOR_RECYCLER_VIEW = - viewSpec( - allOf( - isDescendantOfA(withId(R.id.selectable_list)), - withId(R.id.tab_list_recycler_view))); + TAB_LIST_EDITOR_LAYOUT.descendant(withId(R.id.tab_list_recycler_view)); private final List<Integer> mTabIdsSelected; private final List<List<Integer>> mTabGroupsSelected;
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabSwitcherStation.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabSwitcherStation.java index c527e1f..d835c69 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabSwitcherStation.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/hub/TabSwitcherStation.java
@@ -41,17 +41,13 @@ /** The base station for Hub tab switcher stations. */ public abstract class TabSwitcherStation extends HubBaseStation { public static final ViewSpec TAB_LIST_RECYCLER_VIEW = - viewSpec( - allOf( - isDescendantOfA(HubBaseStation.HUB_PANE_HOST.getViewMatcher()), - withId(R.id.tab_list_recycler_view))); + HUB_PANE_HOST.descendant(withId(R.id.tab_list_recycler_view)); public static final ViewSpec TOOLBAR_NEW_TAB_BUTTON = viewSpec( allOf( withId(R.id.toolbar_action_button), isDescendantOfA(instanceOf(HubToolbarView.class)))); - public static final Matcher<View> TAB_CLOSE_BUTTON = allOf( withId(R.id.action_button),
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/omnibox/OmniboxEnteredTextFacility.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/omnibox/OmniboxEnteredTextFacility.java index a598f0a..9cada498 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/omnibox/OmniboxEnteredTextFacility.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/omnibox/OmniboxEnteredTextFacility.java
@@ -6,8 +6,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.chromium.base.test.transit.ViewSpec.viewSpec; - import androidx.test.espresso.action.ViewActions; import org.chromium.base.test.transit.Elements; @@ -32,7 +30,7 @@ @Override public void declareElements(Elements.Builder elements) { - elements.declareView(viewSpec(OmniboxFacility.URL_FIELD.getViewMatcher(), withText(mText))); + elements.declareView(OmniboxFacility.URL_FIELD.and(withText(mText))); elements.declareView( OmniboxFacility.DELETE_BUTTON, ViewElement.displayingAtLeastOption(50)); elements.declareNoView(OmniboxFacility.MIC_BUTTON);
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/omnibox/OmniboxFacility.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/omnibox/OmniboxFacility.java index 5b541ef5..2b2d44a 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/omnibox/OmniboxFacility.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/omnibox/OmniboxFacility.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.test.transit.omnibox; import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static org.hamcrest.CoreMatchers.instanceOf; @@ -28,11 +27,9 @@ public static final ViewSpec STATUS_ICON = viewSpec(withId(R.id.location_bar_status_icon)); public static final ViewSpec URL_FIELD = viewSpec(withId(R.id.url_bar)); public static final ViewSpec ACTION_CONTAINER = viewSpec(withId(R.id.url_action_container)); - - public static final ViewSpec MIC_BUTTON = - viewSpec(withId(R.id.mic_button), withParent(ACTION_CONTAINER.getViewMatcher())); + public static final ViewSpec MIC_BUTTON = ACTION_CONTAINER.descendant(withId(R.id.mic_button)); public static final ViewSpec DELETE_BUTTON = - viewSpec(withId(R.id.delete_button), withParent(ACTION_CONTAINER.getViewMatcher())); + ACTION_CONTAINER.descendant(withId(R.id.delete_button)); private final boolean mIncognito; private final FakeOmniboxSuggestions mFakeSuggestions;
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/page/TabSwitcherActionMenuFacility.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/page/TabSwitcherActionMenuFacility.java index 52681cc..a05fd366 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/page/TabSwitcherActionMenuFacility.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/transit/page/TabSwitcherActionMenuFacility.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.test.transit.page; -import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; @@ -35,27 +34,19 @@ // withId() cannot differentiate items because android:id is id/menu_item_text for all items. public static final ViewSpec CLOSE_TAB_MENU_ITEM = - viewSpec(withText(R.string.close_tab), isDescendantOfA(APP_MENU_LIST.getViewMatcher())); + APP_MENU_LIST.descendant(withText(R.string.close_tab)); public static final ViewSpec NEW_TAB_MENU_ITEM = - viewSpec( - withText(R.string.menu_new_tab), - isDescendantOfA(APP_MENU_LIST.getViewMatcher())); + APP_MENU_LIST.descendant(withText(R.string.menu_new_tab)); public static final ViewSpec NEW_INCOGNITO_TAB_MENU_ITEM = - viewSpec( - withText(R.string.menu_new_incognito_tab), - isDescendantOfA(APP_MENU_LIST.getViewMatcher())); + APP_MENU_LIST.descendant(withText(R.string.menu_new_incognito_tab)); public static final ViewSpec SWITCH_TO_INCOGNITO_MENU_ITEM = - viewSpec( - withText(R.string.menu_switch_to_incognito), - isDescendantOfA(APP_MENU_LIST.getViewMatcher())); + APP_MENU_LIST.descendant(withText(R.string.menu_switch_to_incognito)); public static final ViewSpec SWITCH_OUT_OF_INCOGNITO_MENU_ITEM = - viewSpec( - withText(R.string.menu_switch_out_of_incognito), - isDescendantOfA(APP_MENU_LIST.getViewMatcher())); + APP_MENU_LIST.descendant(withText(R.string.menu_switch_out_of_incognito)); @Override public void declareElements(Elements.Builder elements) {
diff --git a/chrome/test/data/extensions/api_test/user_scripts/execute/manifest.json b/chrome/test/data/extensions/api_test/user_scripts/execute/manifest.json new file mode 100644 index 0000000..c72ec534 --- /dev/null +++ b/chrome/test/data/extensions/api_test/user_scripts/execute/manifest.json
@@ -0,0 +1,13 @@ +{ + "name": "User script test extension", + "version": "0.1", + "manifest_version": 3, + "description": "Tests a variety of user scripts API calls for registering an user script.", + "background": { + "service_worker": "worker.js", + "type": "module" + }, + "permissions": [ + "userScripts" + ] +}
diff --git a/chrome/test/data/extensions/api_test/user_scripts/execute/worker.js b/chrome/test/data/extensions/api_test/user_scripts/execute/worker.js new file mode 100644 index 0000000..697f3dd6 --- /dev/null +++ b/chrome/test/data/extensions/api_test/user_scripts/execute/worker.js
@@ -0,0 +1,66 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +chrome.test.runTests([ + // Test that an error is returned if the user script source is not specified. + async function invalidScriptSource_EmptyJs() { + await chrome.userScripts.unregister(); + + const script = {js: {}, target: {tabId: 123}}; + await chrome.test.assertPromiseRejects( + chrome.userScripts.execute(script), + `Error: User script must specify exactly one of 'code' or 'file' as ` + + `a js source.`); + + chrome.test.succeed(); + }, + + // Test that an error is returned if the user script source specifies both + // code and file. + async function invalidScriptSource_MultipleSources() { + await chrome.userScripts.unregister(); + + const script = {js: {file: 'script.js', code: ''}, target: {tabId: 123}}; + await chrome.test.assertPromiseRejects( + chrome.userScripts.execute(script), + `Error: User script must specify exactly one of 'code' or 'file' as ` + + `a js source.`); + + chrome.test.succeed(); + }, + + // Tests that an error is returned if the user scrip specifies injection to + // all frames and also a specific set of frame ids. + async function invalidAllFrames() { + await chrome.userScripts.unregister(); + + const script = { + js: {file: 'script.js'}, + target: {allFrames: true, frameIds: [456], tabId: 123} + }; + await chrome.test.assertPromiseRejects( + chrome.userScripts.execute(script), + `Error: User script must not specify injection to 'all frames' when ` + + `it has a specific set of 'frameIds' to inject into.`); + + chrome.test.succeed(); + }, + + // Test that an error is returned is the user script has both document ids and + // frame ids as injection targets. + async function invalidTargetIds() { + await chrome.userScripts.unregister(); + + const script = { + js: {file: 'script.js'}, + target: {documentIds: ['documentId'], frameIds: [456], tabId: 123} + }; + await chrome.test.assertPromiseRejects( + chrome.userScripts.execute(script), + `Error: User script must not specify both 'documentIds' and ` + + `'frameIds'.`); + + chrome.test.succeed(); + } +])
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index e3f472c4..18eac57 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -16137.0.0-1065600 \ No newline at end of file +16137.0.0-1065606 \ No newline at end of file
diff --git a/chromeos/ash/resources/internal b/chromeos/ash/resources/internal index 576e40d..dd3d2b0 160000 --- a/chromeos/ash/resources/internal +++ b/chromeos/ash/resources/internal
@@ -1 +1 @@ -Subproject commit 576e40d7e0a7aa51d16bc211db51ab4331399233 +Subproject commit dd3d2b0c1e780a13f6716cdbd20b2489811f0218
diff --git a/chromeos/crosapi/cpp/BUILD.gn b/chromeos/crosapi/cpp/BUILD.gn index 4147f58..eff91a4 100644 --- a/chromeos/crosapi/cpp/BUILD.gn +++ b/chromeos/crosapi/cpp/BUILD.gn
@@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/chromeos/ui_mode.gni") - # C++ components used by both lacros-chrome and ash-chrome. config("crosapi_implementation") { defines = [ "IS_CROSAPI_IMPL" ] @@ -25,13 +23,6 @@ "//components/version_info", "//mojo/public/cpp/bindings", ] - - if (is_chromeos_ash) { - sources += [ - "lacros_startup_state.cc", - "lacros_startup_state.h", - ] - } } static_library("crosapi_constants") {
diff --git a/chromeos/crosapi/cpp/lacros_startup_state.cc b/chromeos/crosapi/cpp/lacros_startup_state.cc deleted file mode 100644 index 5ed5388a..0000000 --- a/chromeos/crosapi/cpp/lacros_startup_state.cc +++ /dev/null
@@ -1,27 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chromeos/crosapi/cpp/lacros_startup_state.h" - -namespace { - -bool g_is_lacros_enabled = false; - -} // namespace - -namespace crosapi { - -namespace lacros_startup_state { - -void SetLacrosStartupState(bool is_enabled) { - g_is_lacros_enabled = is_enabled; -} - -bool IsLacrosEnabled() { - return g_is_lacros_enabled; -} - -} // namespace lacros_startup_state - -} // namespace crosapi
diff --git a/chromeos/crosapi/cpp/lacros_startup_state.h b/chromeos/crosapi/cpp/lacros_startup_state.h deleted file mode 100644 index 80d83ea..0000000 --- a/chromeos/crosapi/cpp/lacros_startup_state.h +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROMEOS_CROSAPI_CPP_LACROS_STARTUP_STATE_H_ -#define CHROMEOS_CROSAPI_CPP_LACROS_STARTUP_STATE_H_ - -#include "base/component_export.h" - -namespace crosapi { - -namespace lacros_startup_state { - -// Transfers the Lacros startup state from the browser level to lower levels -// like components. If |is_lacros_enabled| is true, Lacros is enabled, which -// means that Lacros is the only browser and Ash is only used for system -// operations. -// Note: As the state cannot state wile Ash is running (profile migration, -// browser restart and other things required) this will be set when Ash -// determines if Lacros should get launched or not. -COMPONENT_EXPORT(CROSAPI) -void SetLacrosStartupState(bool is_lacros_enabled); - -// Mirroring the Lacros enabled flag for components and other lower than browser -// components for dependent feature development. -COMPONENT_EXPORT(CROSAPI) bool IsLacrosEnabled(); - -} // namespace lacros_startup_state - -} // namespace crosapi - -#endif // CHROMEOS_CROSAPI_CPP_LACROS_STARTUP_STATE_H_
diff --git a/clank b/clank index bf9cb3c..658e1c2 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit bf9cb3c0d3d3c0bb540a67a3072f4c5483728f2b +Subproject commit 658e1c22f9848f261a9400329bffd2b896be057c
diff --git a/components/account_manager_core/chromeos/account_manager_facade_factory.h b/components/account_manager_core/chromeos/account_manager_facade_factory.h index cc0e3c2..f5c055c 100644 --- a/components/account_manager_core/chromeos/account_manager_facade_factory.h +++ b/components/account_manager_core/chromeos/account_manager_facade_factory.h
@@ -14,33 +14,8 @@ namespace account_manager { class AccountManagerFacade; -class AccountManager; -class AccountManagerUI; } // namespace account_manager -namespace crosapi { -class AccountManagerMojoService; -} // namespace crosapi - -#if BUILDFLAG(IS_CHROMEOS_LACROS) -// Create a new instance of `account_manager::AccountManager` for tests. Should -// be called before the first call to `GetAccountManagerFacade()`. After this -// call `GetAccountManagerFacade()` will be returning an instance that is -// connected to `AccountManagerMojoService` and `AccountManagerMojoService` will -// delegate all UI tasks to `account_manager_ui`. -class COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) ScopedAshAccountManagerForTests { - public: - explicit ScopedAshAccountManagerForTests( - std::unique_ptr<account_manager::AccountManagerUI> account_manager_ui); - ~ScopedAshAccountManagerForTests(); - - ScopedAshAccountManagerForTests(const ScopedAshAccountManagerForTests&) = - delete; - ScopedAshAccountManagerForTests& operator=( - const ScopedAshAccountManagerForTests&) = delete; -}; -#endif - // A factory function for getting platform specific implementations of // |AccountManagerFacade|. // Returns the |AccountManagerFacade| for the given |profile_path|. @@ -49,21 +24,4 @@ account_manager::AccountManagerFacade* COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) GetAccountManagerFacade(const std::string& profile_path); -#if BUILDFLAG(IS_CHROMEOS_LACROS) -// Return an `AccountManager` instance if it was created for tests, -// otherwise return `nullptr`. -account_manager::AccountManager* COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) - MaybeGetAshAccountManagerForTests(); - -// Return a `AccountManagerUI` instance if it was created for tests, -// otherwise return `nullptr`. -account_manager::AccountManagerUI* COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) - MaybeGetAshAccountManagerUIForTests(); - -// Return a `AccountManagerMojoService` instance if it was created for tests, -// otherwise return `nullptr`. -crosapi::AccountManagerMojoService* COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) - MaybeGetAshAccountManagerMojoServiceForTests(); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - #endif // COMPONENTS_ACCOUNT_MANAGER_CORE_CHROMEOS_ACCOUNT_MANAGER_FACADE_FACTORY_H_
diff --git a/components/autofill/android/java/res/values/dimens.xml b/components/autofill/android/java/res/values/dimens.xml index ae63ac0..4c14f88 100644 --- a/components/autofill/android/java/res/values/dimens.xml +++ b/components/autofill/android/java/res/values/dimens.xml
@@ -59,7 +59,7 @@ <dimen name="card_icon_border_width">1dp</dimen> <dimen name="large_card_icon_corner_radius">3dp</dimen> <dimen name="small_card_icon_corner_radius">2dp</dimen> - <dimen name="square_card_icon_corner_radius">4dp</dimen> + <dimen name="square_card_icon_corner_radius">3dp</dimen> <!-- Local credit card editor --> <dimen name="local_card_scanner_height">64dp</dimen>
diff --git a/components/autofill/core/browser/foundations/browser_autofill_manager.cc b/components/autofill/core/browser/foundations/browser_autofill_manager.cc index deac3493..67b28c6 100644 --- a/components/autofill/core/browser/foundations/browser_autofill_manager.cc +++ b/components/autofill/core/browser/foundations/browser_autofill_manager.cc
@@ -2675,6 +2675,7 @@ metrics_->credit_card_form_event_logger.OnDidFetchSuggestion( suggestions, summary.with_offer, summary.with_cvc, + summary.with_card_info_retrieval_enrolled, is_virtual_card_standalone_cvc_field, std::move(summary.metadata_logging_context)); return suggestions;
diff --git a/components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.cc b/components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.cc index d5757f3..af451a3 100644 --- a/components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.cc +++ b/components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.cc
@@ -46,10 +46,13 @@ const std::vector<Suggestion>& suggestions, bool with_offer, bool with_cvc, + bool with_card_info_retrieval_enrolled, bool is_virtual_card_standalone_cvc_field, CardMetadataLoggingContext metadata_logging_context) { has_eligible_offer_ = with_offer; suggestion_contains_card_with_cvc_ = with_cvc; + suggestion_contains_card_info_retrieval_enrolled_card_ = + with_card_info_retrieval_enrolled; is_virtual_card_standalone_cvc_field_ = is_virtual_card_standalone_cvc_field; metadata_logging_context_ = std::move(metadata_logging_context); suggestions_.clear();
diff --git a/components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.h b/components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.h index b5905274..581d3f8 100644 --- a/components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.h +++ b/components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.h
@@ -55,6 +55,8 @@ // suggestion in the list. // `with_cvc` indicates whether CVC is saved in any of the suggestion in // the list. + // `with_card_info_retrieval_enrolled` indicates whether at least one of the + // suggestions contains card info retrieval enrolled card. // `is_virtual_card_standalone_cvc_field` indicates whether the `suggestions` // are fetched for a virtual card standalone CVC field. // `metadata_logging_context` contains information about whether any card has @@ -63,6 +65,7 @@ const std::vector<Suggestion>& suggestions, bool with_offer, bool with_cvc, + bool with_card_info_retrieval_enrolled, bool is_virtual_card_standalone_cvc_field, CardMetadataLoggingContext metadata_logging_context); @@ -194,6 +197,9 @@ bool is_virtual_card_standalone_cvc_field_ = false; // If true, one of the cards in the suggestions fetched has cvc info saved. bool suggestion_contains_card_with_cvc_ = false; + // If true, one of the cards in the suggestions fetched card info retrieval + // enrolled. + bool suggestion_contains_card_info_retrieval_enrolled_card_ = false; CardMetadataLoggingContext metadata_logging_context_;
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager.cc b/components/autofill/core/browser/payments/credit_card_access_manager.cc index 0e9b4f5..1e2424f 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager.cc +++ b/components/autofill/core/browser/payments/credit_card_access_manager.cc
@@ -223,7 +223,9 @@ case UnmaskAuthFlowType::kOtp: autofill_metrics::LogServerCardUnmaskResult( autofill_metrics::ServerCardUnmaskResult::kAuthenticationUnmasked, - PaymentsRpcCardType::kVirtualCard, + card_->record_type() == CreditCard::RecordType::kVirtualCard + ? PaymentsRpcCardType::kVirtualCard + : PaymentsRpcCardType::kServerCard, autofill_metrics::ServerCardUnmaskFlowType::kOtpOnly); break; case UnmaskAuthFlowType::kOtpFallbackFromFido: @@ -483,9 +485,26 @@ bool fido_auth_enabled) { UnmaskAuthFlowType flow_type; #if BUILDFLAG(IS_IOS) - // There is no FIDO auth available on iOS, so offer CVC auth immediately. + // On iOS only the CVC auth is available for masked server card. flow_type = UnmaskAuthFlowType::kCvc; #else + // We check if the card is enrolled in runtime retrieval and only SMS OTP + // challenge option is present, then render the challenge option selection + // dialog. Currently the selection dialog box is only supported for SMS OTP + // challenge for masked server cards. + std::vector<CardUnmaskChallengeOption>& challenge_options = + risk_based_authentication_response_.card_unmask_challenge_options; + if (card_->card_info_retrieval_enrollment_state() == + CreditCard::CardInfoRetrievalEnrollmentState::kRetrievalEnrolled && + challenge_options.size() == 1 && + challenge_options[0].type == CardUnmaskChallengeOptionType::kSmsOtp) { + selected_challenge_option_ = &challenge_options[0]; + ShowUnmaskAuthenticatorSelectionDialog(); + return; + } + + // If not enrolled in runtime retrieval then currently only FIDO and CVC auth + // are available for masked server card. if (!fido_auth_enabled) { // If FIDO auth is not enabled we offer CVC auth. flow_type = UnmaskAuthFlowType::kCvc; @@ -604,6 +623,8 @@ } case UnmaskAuthFlowType::kOtp: case UnmaskAuthFlowType::kOtpFallbackFromFido: { + CHECK(card_->record_type() == CreditCard::RecordType::kVirtualCard || + card_->record_type() == CreditCard::RecordType::kMaskedServerCard); // Delegate the task to CreditCardOtpAuthenticator. DCHECK(selected_challenge_option_); payments_autofill_client() @@ -1526,6 +1547,9 @@ CardUnmaskChallengeOption* CreditCardAccessManager::GetCardUnmaskChallengeOptionForChallengeId( const std::string& challenge_id) { + CreditCard::RecordType card_record_type = card_->record_type(); + CHECK(card_record_type == CreditCard::RecordType::kVirtualCard || + card_record_type == CreditCard::RecordType::kMaskedServerCard); std::vector<CardUnmaskChallengeOption>& challenge_options = risk_based_authentication_response_.card_unmask_challenge_options; auto card_unmask_challenge_options_it = base::ranges::find(
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager_risk_based_unittest.cc b/components/autofill/core/browser/payments/credit_card_access_manager_risk_based_unittest.cc index 51d0ef9..edc8fb1d 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager_risk_based_unittest.cc +++ b/components/autofill/core/browser/payments/credit_card_access_manager_risk_based_unittest.cc
@@ -472,6 +472,154 @@ ->risk_based_authentication_invoked()); } +// Test the green path flow when the masked server card enrolled in card info +// retrieval is successfully returned from the server during a risk-based +// retrieval. +TEST_F(CreditCardAccessManagerRiskBasedMaskedServerCardUnmaskingTest, + CardInfoRetrievalUnmasking_Success) { + std::string test_number = "4444333322221111"; + const CreditCard* enrolled_card = + CreateServerCard(kTestGUID, test_number, kTestServerId, /*cvc=*/u"", + CreditCard::RecordType::kMaskedServerCard, + /*is_card_info_retrieval_enrolled=*/true); + + credit_card_access_manager().FetchCreditCard( + enrolled_card, base::BindOnce(&TestAccessor::OnCreditCardFetched, + accessor_->GetWeakPtr())); + + // Ensures CreditCardRiskBasedAuthenticator::Authenticate is successfully + // invoked. + EXPECT_TRUE(autofill_client_.GetPaymentsAutofillClient() + ->risk_based_authentication_invoked()); + EXPECT_TRUE(autofill_client_.GetPaymentsAutofillClient() + ->autofill_progress_dialog_shown()); + + // Mock that CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse + // indicates a green path with valid card number returned. + credit_card_access_manager().OnRiskBasedAuthenticationResponseReceived( + CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse() + .with_result(CreditCardRiskBasedAuthenticator:: + RiskBasedAuthenticationResponse::Result:: + kNoAuthenticationRequired) + .with_card(*enrolled_card)); + + // Ensure the accessor received the correct response. + EXPECT_EQ(accessor_->number(), base::UTF8ToUTF16(test_number)); + + // There was no interactive authentication in this flow, so check that this + // is signaled correctly. + std::optional<NonInteractivePaymentMethodType> type = + test_api(*autofill_client_.GetFormDataImporter()) + .payment_method_type_if_non_interactive_authentication_flow_completed(); + EXPECT_THAT(type, testing::Optional( + NonInteractivePaymentMethodType::kMaskedServerCard)); +} + +// Testing metrics for cards enroilled in runtime retrieval. +TEST_F(CreditCardAccessManagerRiskBasedMaskedServerCardUnmaskingTest, + CardInfoRetrievalUnmasking_Success_Metrics) { + base::HistogramTester histogram_tester; + std::string test_number = "4444333322221111"; + const CreditCard* enrolled_card = + CreateServerCard(kTestGUID, kTestNumber, kTestServerId, /*cvc=*/u"", + CreditCard::RecordType::kMaskedServerCard, + /*is_card_info_retrieval_enrolled=*/true); + + credit_card_access_manager().FetchCreditCard( + enrolled_card, base::BindOnce(&TestAccessor::OnCreditCardFetched, + accessor_->GetWeakPtr())); + + // Mock that CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse + // indicates a green path with valid card number returned. + credit_card_access_manager().OnRiskBasedAuthenticationResponseReceived( + CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse() + .with_result(CreditCardRiskBasedAuthenticator:: + RiskBasedAuthenticationResponse::Result:: + kNoAuthenticationRequired) + .with_card(*enrolled_card)); + + test_api(*autofill_client_.GetFormDataImporter()) + .payment_method_type_if_non_interactive_authentication_flow_completed(); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.ServerCard.Result.RiskBased", + autofill_metrics::ServerCardUnmaskResult::kRiskBasedUnmasked, 1); +} + +// Test the yellow path flow when the masked server card enrolled in card info +// retrieval is retrieved from the server with Sms Otp authentication. +TEST_F(CreditCardAccessManagerRiskBasedMaskedServerCardUnmaskingTest, + CardInfoRetrievalUnmasking_AuthenticationRequired_OtpOnly) { + std::vector<CardUnmaskChallengeOption> challenge_options = + test::GetCardUnmaskChallengeOptions( + {CardUnmaskChallengeOptionType::kSmsOtp}); + MockCardUnmaskFlowUpToAuthenticationSelectionDialogAccepted( + /*fido_authenticator_is_user_opted_in=*/false, + /*is_user_verifiable=*/false, challenge_options, /*selected_index=*/0, + CreditCard::RecordType::kMaskedServerCard, + /*is_card_info_retrieval_enrolled=*/true); + + const CreditCard* enrolled_card = + CreateServerCard(kTestGUID, kTestNumber, kTestServerId, kTestCvc16, + CreditCard::RecordType::kMaskedServerCard, + /*is_card_info_retrieval_enrolled=*/true); + credit_card_access_manager().OnOtpAuthenticationComplete( + CreditCardOtpAuthenticator::OtpAuthenticationResponse() + .with_result(CreditCardOtpAuthenticator::OtpAuthenticationResponse:: + Result::kSuccess) + .with_card(enrolled_card) + .with_cvc(kTestCvc16)); + + // Expect that we did not signal that there was no interactive authentication. + EXPECT_FALSE( + test_api(*autofill_client_.GetFormDataImporter()) + .payment_method_type_if_non_interactive_authentication_flow_completed() + .has_value()); + + // Expect accessor to successfully retrieve the CVC. + EXPECT_EQ(kTestCvc16, accessor_->cvc()); +} + +// Testing autofill metrics for runtime retrieval cards in otp authentication +// flow. +TEST_F(CreditCardAccessManagerRiskBasedMaskedServerCardUnmaskingTest, + CardInfoRetrievalUnmasking_AuthenticationRequired_OtpOnly_Metrics) { + base::HistogramTester histogram_tester; + + std::vector<CardUnmaskChallengeOption> challenge_options = + test::GetCardUnmaskChallengeOptions( + {CardUnmaskChallengeOptionType::kSmsOtp}); + MockCardUnmaskFlowUpToAuthenticationSelectionDialogAccepted( + /*fido_authenticator_is_user_opted_in=*/false, + /*is_user_verifiable=*/false, challenge_options, /*selected_index=*/0, + CreditCard::RecordType::kMaskedServerCard, + /*is_card_info_retrieval_enrolled=*/true); + + const CreditCard* enrolled_card = + CreateServerCard(kTestGUID, kTestNumber, kTestServerId, kTestCvc16, + CreditCard::RecordType::kMaskedServerCard, + /*is_card_info_retrieval_enrolled=*/true); + credit_card_access_manager().OnOtpAuthenticationComplete( + CreditCardOtpAuthenticator::OtpAuthenticationResponse() + .with_result(CreditCardOtpAuthenticator::OtpAuthenticationResponse:: + Result::kSuccess) + .with_card(enrolled_card) + .with_cvc(kTestCvc16)); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.VirtualCard.Attempt", false, 0); + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.VirtualCard.Result.Otp", + autofill_metrics::ServerCardUnmaskResult::kAuthenticationUnmasked, 0); + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.ServerCard.Attempt", true, 1); + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.ServerCard.Result.Otp", + autofill_metrics::ServerCardUnmaskResult::kAuthenticationUnmasked, 1); +} + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) // Params of the // CreditCardAccessManagerRiskBasedMaskedServerCardUnmaskingPreflightCallReturnedTest:
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager_test_base.cc b/components/autofill/core/browser/payments/credit_card_access_manager_test_base.cc index 58c1a2f30..e0623c9d 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager_test_base.cc +++ b/components/autofill/core/browser/payments/credit_card_access_manager_test_base.cc
@@ -146,7 +146,8 @@ std::string number, std::string server_id, const char16_t* cvc, - CreditCard::RecordType record_type) { + CreditCard::RecordType record_type, + bool is_card_info_retrieval_enrolled) { CreditCard server_card = CreditCard(); test::SetCreditCardInfo(&server_card, "Elvis Presley", number.c_str(), test::NextMonth().c_str(), test::NextYear().c_str(), @@ -154,6 +155,10 @@ server_card.set_guid(guid); server_card.set_record_type(record_type); server_card.set_server_id(server_id); + if (is_card_info_retrieval_enrolled) { + server_card.set_card_info_retrieval_enrollment_state( + CreditCard::CardInfoRetrievalEnrollmentState::kRetrievalEnrolled); + } personal_data().test_payments_data_manager().AddServerCreditCard(server_card); return personal_data().payments_data_manager().GetCreditCardByGUID(guid); } @@ -345,10 +350,12 @@ bool fido_authenticator_is_user_opted_in, bool is_user_verifiable, const std::vector<CardUnmaskChallengeOption>& challenge_options, - int selected_index) { + int selected_index, + CreditCard::RecordType record_type, + bool is_card_info_retrieval_enrolled) { CreateServerCard(kTestGUID, kTestNumber, kTestServerId, kTestCvc16, - CreditCard::RecordType::kVirtualCard); - const CreditCard* virtual_card = + record_type, is_card_info_retrieval_enrolled); + const CreditCard* card = personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) @@ -362,8 +369,8 @@ test_api(credit_card_access_manager()) .set_is_user_verifiable(is_user_verifiable); credit_card_access_manager().FetchCreditCard( - virtual_card, base::BindOnce(&TestAccessor::OnCreditCardFetched, - accessor_->GetWeakPtr())); + card, base::BindOnce(&TestAccessor::OnCreditCardFetched, + accessor_->GetWeakPtr())); // This checks risk-based authentication flow is successfully invoked, // because it is always the very first authentication flow in a VCN @@ -404,7 +411,7 @@ #endif const CardUnmaskChallengeOption& challenge_option = - response.card_unmask_challenge_options[selected_index]; + challenge_options[selected_index]; payments::PaymentsWindowManager::Vcn3dsContext vcn_3ds_context; if (challenge_option.type == @@ -459,8 +466,8 @@ u"a******b@google.com"); break; case CardUnmaskChallengeOptionType::kThreeDomainSecure: - EXPECT_EQ(vcn_3ds_context.context_token, response.context_token); - EXPECT_EQ(vcn_3ds_context.card, *virtual_card); + EXPECT_EQ(vcn_3ds_context.context_token, "fake_context_token"); + EXPECT_EQ(vcn_3ds_context.card, *card); EXPECT_EQ(vcn_3ds_context.challenge_option.type, CardUnmaskChallengeOptionType::kThreeDomainSecure); EXPECT_TRUE(vcn_3ds_context.user_consent_already_given); @@ -475,8 +482,6 @@ EXPECT_TRUE(otp_authenticator_->on_challenge_option_selected_invoked()); EXPECT_EQ(otp_authenticator_->card().number(), base::UTF8ToUTF16(std::string(kTestNumber))); - EXPECT_EQ(otp_authenticator_->card().record_type(), - CreditCard::RecordType::kVirtualCard); EXPECT_EQ(otp_authenticator_->context_token(), "fake_context_token"); }
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager_test_base.h b/components/autofill/core/browser/payments/credit_card_access_manager_test_base.h index b01b2cc..ef06a67f 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager_test_base.h +++ b/components/autofill/core/browser/payments/credit_card_access_manager_test_base.h
@@ -116,7 +116,8 @@ std::string server_id = std::string(), const char16_t* cvc = kTestCvc16, CreditCard::RecordType record_type = - CreditCard::RecordType::kMaskedServerCard); + CreditCard::RecordType::kMaskedServerCard, + bool is_card_info_retrieval_enrolled = false); CreditCardCvcAuthenticator& GetCvcAuthenticator(); @@ -172,7 +173,9 @@ bool fido_authenticator_is_user_opted_in, bool is_user_verifiable, const std::vector<CardUnmaskChallengeOption>& challenge_options, - int selected_index); + int selected_index, + CreditCard::RecordType record_type, + bool is_card_info_retrieval_enrolled = false); void VerifyOnSelectChallengeOptionInvoked();
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc b/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc index 1083d78..f4ecf545 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc +++ b/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc
@@ -1798,9 +1798,10 @@ CardUnmaskChallengeOptionType::kEmailOtp}); MockCardUnmaskFlowUpToAuthenticationSelectionDialogAccepted( /*fido_authenticator_is_user_opted_in=*/false, - /*is_user_verifiable=*/false, challenge_options, /*selected_index=*/0); + /*is_user_verifiable=*/false, challenge_options, + /*selected_index=*/0, CreditCard::RecordType::kVirtualCard); - CreditCard card = test::GetCreditCard(); + CreditCard card = test::GetVirtualCard(); credit_card_access_manager().OnOtpAuthenticationComplete( CreditCardOtpAuthenticator::OtpAuthenticationResponse() .with_result(CreditCardOtpAuthenticator::OtpAuthenticationResponse:: @@ -1837,7 +1838,8 @@ {CardUnmaskChallengeOptionType::kCvc}); MockCardUnmaskFlowUpToAuthenticationSelectionDialogAccepted( /*fido_authenticator_is_user_opted_in=*/false, - /*is_user_verifiable=*/false, challenge_options, /*selected_index=*/0); + /*is_user_verifiable=*/false, challenge_options, + /*selected_index=*/0, CreditCard::RecordType::kVirtualCard); CreditCard card = test::GetCreditCard(); credit_card_access_manager().OnCvcAuthenticationComplete( @@ -1940,11 +1942,12 @@ selected_index++) { MockCardUnmaskFlowUpToAuthenticationSelectionDialogAccepted( /*fido_authenticator_is_user_opted_in=*/false, - /*is_user_verifiable=*/false, challenge_options, selected_index); + /*is_user_verifiable=*/false, challenge_options, selected_index, + CreditCard::RecordType::kVirtualCard); switch (challenge_options[selected_index].type) { case CardUnmaskChallengeOptionType::kSmsOtp: { - CreditCard card = test::GetCreditCard(); + CreditCard card = test::GetVirtualCard(); credit_card_access_manager().OnOtpAuthenticationComplete( CreditCardOtpAuthenticator::OtpAuthenticationResponse() .with_result(CreditCardOtpAuthenticator:: @@ -1954,7 +1957,7 @@ break; } case CardUnmaskChallengeOptionType::kCvc: { - CreditCard card = test::GetCreditCard(); + CreditCard card = test::GetVirtualCard(); credit_card_access_manager().OnCvcAuthenticationComplete( CreditCardCvcAuthenticator::CvcAuthenticationResponse() .with_did_succeed(true) @@ -2000,7 +2003,8 @@ {CardUnmaskChallengeOptionType::kSmsOtp}); MockCardUnmaskFlowUpToAuthenticationSelectionDialogAccepted( /*fido_authenticator_is_user_opted_in=*/false, - /*is_user_verifiable=*/false, challenge_options, /*selected_index=*/0); + /*is_user_verifiable=*/false, challenge_options, + /*selected_index=*/0, CreditCard::RecordType::kVirtualCard); // This check already happens in // MockCardUnmaskFlowUpToAuthenticationSelectionDialogAccepted(), but double @@ -2241,12 +2245,13 @@ {CardUnmaskChallengeOptionType::kSmsOtp}); MockCardUnmaskFlowUpToAuthenticationSelectionDialogAccepted( /*fido_authenticator_is_user_opted_in=*/false, - /*is_user_verifiable=*/true, challenge_options, /*selected_index=*/0); + /*is_user_verifiable=*/true, challenge_options, + /*selected_index=*/0, CreditCard::RecordType::kVirtualCard); CreditCardOtpAuthenticator::OtpAuthenticationResponse otp_response; otp_response.result = CreditCardOtpAuthenticator::OtpAuthenticationResponse::Result::kSuccess; - CreditCard card = test::GetCreditCard(); + CreditCard card = test::GetVirtualCard(); otp_response.card = &card; otp_response.cvc = u"123"; credit_card_access_manager().OnOtpAuthenticationComplete(otp_response); @@ -2272,7 +2277,8 @@ {CardUnmaskChallengeOptionType::kSmsOtp}); MockCardUnmaskFlowUpToAuthenticationSelectionDialogAccepted( /*fido_authenticator_is_user_opted_in=*/true, - /*is_user_verifiable=*/true, challenge_options, /*selected_index=*/0); + /*is_user_verifiable=*/true, challenge_options, + /*selected_index=*/0, CreditCard::RecordType::kVirtualCard); CreditCardOtpAuthenticator::OtpAuthenticationResponse otp_response; otp_response.result =
diff --git a/components/autofill/core/browser/payments/credit_card_otp_authenticator.cc b/components/autofill/core/browser/payments/credit_card_otp_authenticator.cc index 90476bc..ab705fc 100644 --- a/components/autofill/core/browser/payments/credit_card_otp_authenticator.cc +++ b/components/autofill/core/browser/payments/credit_card_otp_authenticator.cc
@@ -52,7 +52,9 @@ ClientBehaviorConstants::kShowingCardBenefits); } - if (card_->record_type() == CreditCard::RecordType::kVirtualCard) { + if (card_->record_type() == CreditCard::RecordType::kVirtualCard || + card_->card_info_retrieval_enrollment_state() == + CreditCard::CardInfoRetrievalEnrollmentState::kRetrievalEnrolled) { std::optional<GURL> last_committed_primary_main_frame_origin; if (autofill_client_->GetLastCommittedPrimaryMainFrameURL().is_valid()) { last_committed_primary_main_frame_origin = @@ -111,11 +113,11 @@ return; } - // Currently only virtual cards are supported for OTP authentication. - // If non-virtual cards are allowed for OTP unmasking in the future, - // |OnDidSelectChallengeOption()| and |OnDidGetRealPan()| should allow for a - // generic error dialog. - CHECK_EQ(card->record_type(), CreditCard::RecordType::kVirtualCard); + // Currently only virtual cards and cards enrolled in runtime retrieval are + // supported for OTP authentication. + CHECK((card->record_type() == CreditCard::RecordType::kVirtualCard) || + (card->card_info_retrieval_enrollment_state() == + CreditCard::CardInfoRetrievalEnrollmentState::kRetrievalEnrolled)); CHECK(selected_challenge_option.type == CardUnmaskChallengeOptionType::kSmsOtp || selected_challenge_option.type ==
diff --git a/components/autofill/core/browser/payments/credit_card_otp_authenticator_unittest.cc b/components/autofill/core/browser/payments/credit_card_otp_authenticator_unittest.cc index 9341bad9..ab60d48 100644 --- a/components/autofill/core/browser/payments/credit_card_otp_authenticator_unittest.cc +++ b/components/autofill/core/browser/payments/credit_card_otp_authenticator_unittest.cc
@@ -58,7 +58,6 @@ std::make_unique<CreditCardOtpAuthenticator>(&autofill_client_); card_ = test::GetMaskedServerCard(); - card_.set_record_type(CreditCard::RecordType::kVirtualCard); } void TearDown() override { @@ -106,7 +105,7 @@ return authenticator_->ContextTokenForTesting(); } - void verifySelectChallengeOptionRequest(const std::string& context_token, + void VerifySelectChallengeOptionRequest(const std::string& context_token, int64_t billing_customer_number) { const payments::SelectChallengeOptionRequestDetails* request = payments_network_interface().select_challenge_option_request(); @@ -153,32 +152,43 @@ class CreditCardOtpAuthenticatorTest : public CreditCardOtpAuthenticatorTestBase, - public testing::WithParamInterface<CardUnmaskChallengeOptionType> { + public ::testing::WithParamInterface< + std::tuple<CardUnmaskChallengeOptionType, CreditCard::RecordType>> { public: CreditCardOtpAuthenticatorTest() = default; ~CreditCardOtpAuthenticatorTest() override = default; void SetUp() override { CreditCardOtpAuthenticatorTestBase::SetUp(); - CreateSelectedOtpChallengeOption(GetParam()); + CardUnmaskChallengeOptionType option_type = std::get<0>(GetParam()); + CreditCard::RecordType record_type = std::get<1>(GetParam()); + CreateSelectedOtpChallengeOption(option_type); + + if (option_type == CardUnmaskChallengeOptionType::kSmsOtp && + record_type == CreditCard::RecordType::kMaskedServerCard) { + card_.set_card_info_retrieval_enrollment_state( + CreditCard::CardInfoRetrievalEnrollmentState::kRetrievalEnrolled); + } else { + card_.set_record_type(CreditCard::RecordType::kVirtualCard); + } } std::string GetOtpAuthType() { - return autofill_metrics::GetOtpAuthType(GetParam()); + return autofill_metrics::GetOtpAuthType(std::get<0>(GetParam())); } }; +// Test the yellow path SMAS based OTP challenege flow. TEST_P(CreditCardOtpAuthenticatorTest, AuthenticateServerCardSuccess) { - base::HistogramTester histogram_tester; // Simulate user selects OTP challenge option. Current context_token is from - // previous unmask response. TestPaymentsNetworkInterface will ack the select - // challenge option request and directly invoke the callback. + // previous unmask response. TestPaymentsNetworkInterface will directly invoke + // m the callback. authenticator_->OnChallengeOptionSelected( &card_, selected_otp_challenge_option_, requester_->GetWeakPtr(), /*context_token=*/"context_token_from_previous_unmask_response", /*billing_customer_number=*/kTestBillingCustomerNumber); // Verify the SelectChallengeRequest content. - verifySelectChallengeOptionRequest( + VerifySelectChallengeOptionRequest( /*context_token=*/"context_token_from_previous_unmask_response", kTestBillingCustomerNumber); // Verify the context token is updated with SelectChallengeOption response. @@ -208,6 +218,27 @@ ASSERT_TRUE(requester_->did_succeed().has_value()); EXPECT_TRUE(*(requester_->did_succeed())); EXPECT_EQ(kTestNumber16, requester_->number()); +} + +TEST_P(CreditCardOtpAuthenticatorTest, AuthenticateServerCardSuccessMetrics) { + base::HistogramTester histogram_tester; + // Simulate user selects OTP challenge option. Current context_token is from + // previous unmask response. TestPaymentsNetworkInterface will directly invoke + // m the callback. + authenticator_->OnChallengeOptionSelected( + &card_, selected_otp_challenge_option_, requester_->GetWeakPtr(), + /*context_token=*/"context_token_from_previous_unmask_response", + /*billing_customer_number=*/kTestBillingCustomerNumber); + + // Simulate user provides the OTP and clicks 'Confirm' in the OTP dialog. + // TestPaymentsNetworkInterface just stores the unmask request detail, won't + // invoke the callback. OnDidGetRealPan below will manually invoke the + // callback. + authenticator_->OnUnmaskPromptAccepted(/*otp=*/u"111111"); + + // Simulate server returns success and invoke the callback. + OnDidGetRealPan(payments::PaymentsAutofillClient::PaymentsRpcResult::kSuccess, + kTestNumber); // Ensures the metrics have been logged correctly. histogram_tester.ExpectUniqueSample( @@ -225,7 +256,6 @@ } TEST_P(CreditCardOtpAuthenticatorTest, SelectChallengeOptionFailsWithVcnError) { - base::HistogramTester histogram_tester; // Simulate server returns virtual card permanent failure. payments_network_interface().set_select_challenge_option_result( PaymentsRpcResult::kVcnRetrievalPermanentFailure); @@ -238,7 +268,7 @@ /*context_token=*/"context_token_from_previous_unmask_response", /*billing_customer_number=*/kTestBillingCustomerNumber); // Verify the SelectChallengeRequest content. - verifySelectChallengeOptionRequest( + VerifySelectChallengeOptionRequest( /*context_token=*/"context_token_from_previous_unmask_response", kTestBillingCustomerNumber); // Verify error dialog is shown. @@ -247,6 +277,22 @@ EXPECT_TRUE(OtpAuthenticatorContextToken().empty()); ASSERT_TRUE(requester_->did_succeed().has_value()); EXPECT_FALSE(*(requester_->did_succeed())); +} + +TEST_P(CreditCardOtpAuthenticatorTest, + SelectChallengeOptionFailsWithVcnErrorMetrics) { + base::HistogramTester histogram_tester; + // Simulate server returns virtual card permanent failure. + payments_network_interface().set_select_challenge_option_result( + payments::PaymentsAutofillClient::PaymentsRpcResult:: + kVcnRetrievalPermanentFailure); + // Simulate user selects OTP challenge option. Current context_token is from + // previous unmask response. TestPaymentsNetworkInterface will ack the select + // challenge option request and directly invoke the callback. + authenticator_->OnChallengeOptionSelected( + &card_, selected_otp_challenge_option_, requester_->GetWeakPtr(), + /*context_token=*/"context_token_from_previous_unmask_response", + /*billing_customer_number=*/kTestBillingCustomerNumber); // Ensures the metrics have been logged correctly. histogram_tester.ExpectUniqueSample( @@ -264,7 +310,6 @@ TEST_P(CreditCardOtpAuthenticatorTest, SelectChallengeOptionFailsWithOtherErrors) { - base::HistogramTester histogram_tester; // Simulate server returns non-virtual card permanent failure, e.g. response // not complete. payments_network_interface().set_select_challenge_option_result( @@ -278,7 +323,7 @@ /*context_token=*/"context_token_from_previous_unmask_response", /*billing_customer_number=*/kTestBillingCustomerNumber); // Verify the SelectChallengeRequest content. - verifySelectChallengeOptionRequest( + VerifySelectChallengeOptionRequest( /*context_token=*/"context_token_from_previous_unmask_response", kTestBillingCustomerNumber); // Verify error dialog is shown. @@ -287,6 +332,23 @@ EXPECT_TRUE(OtpAuthenticatorContextToken().empty()); ASSERT_TRUE(requester_->did_succeed().has_value()); EXPECT_FALSE(*(requester_->did_succeed())); +} + +TEST_P(CreditCardOtpAuthenticatorTest, + SelectChallengeOptionFailsWithOtherErrorsMetrics) { + base::HistogramTester histogram_tester; + // Simulate server returns non-virtual card permanent failure, e.g. response + // not complete. + payments_network_interface().set_select_challenge_option_result( + payments::PaymentsAutofillClient::PaymentsRpcResult::kPermanentFailure); + + // Simulate user selects OTP challenge option. Current context_token is from + // previous unmask response. TestPaymentsNetworkInterface will ack the select + // challenge option request and directly invoke the callback. + authenticator_->OnChallengeOptionSelected( + &card_, selected_otp_challenge_option_, requester_->GetWeakPtr(), + /*context_token=*/"context_token_from_previous_unmask_response", + /*billing_customer_number=*/kTestBillingCustomerNumber); // Ensures the metrics have been logged correctly. histogram_tester.ExpectUniqueSample( @@ -302,7 +364,6 @@ TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthServerVcnError) { for (bool server_returned_decline_details : {true, false}) { - base::HistogramTester histogram_tester; // Simulate user selects OTP challenge option. Current context_token is from // previous unmask response. TestPaymentsNetworkInterface will ack the // select challenge option request and directly invoke the callback. @@ -340,6 +401,29 @@ EXPECT_TRUE(OtpAuthenticatorContextToken().empty()); ASSERT_TRUE(requester_->did_succeed().has_value()); EXPECT_FALSE(*(requester_->did_succeed())); + } +} + +TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthServerVcnErrorMetrics) { + for (bool server_returned_decline_details : {true, false}) { + base::HistogramTester histogram_tester; + // Simulate user selects OTP challenge option. Current context_token is from + // previous unmask response. TestPaymentsNetworkInterface will ack the + // select challenge option request and directly invoke the callback. + authenticator_->OnChallengeOptionSelected( + &card_, selected_otp_challenge_option_, requester_->GetWeakPtr(), + /*context_token=*/"context_token_from_previous_unmask_response", + /*billing_customer_number=*/kTestBillingCustomerNumber); + // Simulate user provides the OTP and clicks 'Confirm' in the OTP dialog. + // TestPaymentsNetworkInterface just stores the unmask request detail, won't + // invoke the callback. OnDidGetRealPan below will manually invoke the + // callback. + authenticator_->OnUnmaskPromptAccepted(/*otp=*/u"111111"); + // Simulate server returns virtual card retrieval try again failure. We will + // show the error dialog and end session. + OnDidGetRealPan(payments::PaymentsAutofillClient::PaymentsRpcResult:: + kVcnRetrievalTryAgainFailure, + /*real_pan=*/"", server_returned_decline_details); // Ensures the metrics have been logged correctly. histogram_tester.ExpectUniqueSample( @@ -359,7 +443,6 @@ } TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthServerNonVcnError) { - base::HistogramTester histogram_tester; // Simulate user selects OTP challenge option. Current context_token is from // previous unmask response. TestPaymentsNetworkInterface will ack the select // challenge option request and directly invoke the callback. @@ -388,6 +471,28 @@ EXPECT_TRUE(OtpAuthenticatorContextToken().empty()); ASSERT_TRUE(requester_->did_succeed().has_value()); EXPECT_FALSE(*(requester_->did_succeed())); +} + +TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthServerNonVcnErrorMetrics) { + base::HistogramTester histogram_tester; + // Simulate user selects OTP challenge option. Current context_token is from + // previous unmask response. TestPaymentsNetworkInterface will ack the select + // challenge option request and directly invoke the callback. + authenticator_->OnChallengeOptionSelected( + &card_, selected_otp_challenge_option_, requester_->GetWeakPtr(), + /*context_token=*/"context_token_from_previous_unmask_response", + /*billing_customer_number=*/kTestBillingCustomerNumber); + + // Simulate user provides the OTP and clicks 'Confirm' in the OTP dialog. + // TestPaymentsNetworkInterface just stores the unmask request detail, won't + // invoke the callback. OnDidGetRealPan below will manually invoke the + // callback. + authenticator_->OnUnmaskPromptAccepted(/*otp=*/u"111111"); + // Simulate server returns non-Vcn try again failure. We will reuse virtual + // card error dialog and end session. + OnDidGetRealPan( + payments::PaymentsAutofillClient::PaymentsRpcResult::kTryAgainFailure, + /*real_pan=*/""); // Ensures the metrics have been logged correctly. histogram_tester.ExpectUniqueSample( @@ -405,7 +510,6 @@ } TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthMismatchThenRetry) { - base::HistogramTester histogram_tester; // Simulate user selects OTP challenge option. Current context_token is from // previous unmask response. TestPaymentsNetworkInterface will ack the select // challenge option request and directly invoke the callback. @@ -461,6 +565,32 @@ EXPECT_TRUE(*(requester_->did_succeed())); EXPECT_EQ(kTestNumber16, requester_->number()); EXPECT_FALSE(payments_autofill_client().show_otp_input_dialog()); +} + +TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthMismatchThenRetryMetrics) { + base::HistogramTester histogram_tester; + // Simulate user selects OTP challenge option. Current context_token is from + // previous unmask response. TestPaymentsNetworkInterface will ack the select + // challenge option request and directly invoke the callback. + authenticator_->OnChallengeOptionSelected( + &card_, selected_otp_challenge_option_, requester_->GetWeakPtr(), + /*context_token=*/"context_token_from_previous_unmask_response", + /*billing_customer_number=*/kTestBillingCustomerNumber); + payments_autofill_client().ResetShowOtpInputDialog(); + // Simulate user provides the OTP and clicks 'Confirm' in the OTP dialog. + // TestPaymentsNetworkInterface just stores the unmask request detail, won't + // invoke the callback. OnDidGetRealPan below will manually invoke the + // callback. + authenticator_->OnUnmaskPromptAccepted(/*otp=*/u"222222"); + // Simulate otp mismatch, server returns flow_status indicating incorrect otp. + OnDidGetRealPanWithFlowStatus( + /*flow_status=*/"FLOW_STATUS_INCORRECT_OTP", + /*context_token=*/"context_token_from_incorrect_otp"); + // Simulate user types in another otp and click 'Confirm' again. + authenticator_->OnUnmaskPromptAccepted(/*otp=*/u"333333"); + // Simulate server returns success for the second try and invoke the callback. + OnDidGetRealPan(payments::PaymentsAutofillClient::PaymentsRpcResult::kSuccess, + kTestNumber); // Ensures the metrics have been logged correctly. histogram_tester.ExpectUniqueSample( @@ -481,7 +611,6 @@ } TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthExpiredThenResendOtp) { - base::HistogramTester histogram_tester; // Simulate user selects OTP challenge option. Current context_token is from // previous unmask response. TestPaymentsNetworkInterface will ack the select // challenge option request and directly invoke the callback. @@ -490,7 +619,7 @@ /*context_token=*/"context_token_from_previous_unmask_response", /*billing_customer_number=*/kTestBillingCustomerNumber); // Verify the SelectChallengeRequest content. - verifySelectChallengeOptionRequest( + VerifySelectChallengeOptionRequest( /*context_token=*/"context_token_from_previous_unmask_response", kTestBillingCustomerNumber); // Verify the context token is updated with SelectChallengeOption response. @@ -530,7 +659,7 @@ authenticator_->OnNewOtpRequested(); // Verify the second SelectChallengeRequest is correctly set, the only // difference from the previous call is the context_token. - verifySelectChallengeOptionRequest( + VerifySelectChallengeOptionRequest( /*context_token=*/"context_token_from_expired_otp", kTestBillingCustomerNumber); EXPECT_FALSE(payments_autofill_client().show_otp_input_dialog()); @@ -553,6 +682,36 @@ ASSERT_TRUE(requester_->did_succeed().has_value()); EXPECT_TRUE(*(requester_->did_succeed())); EXPECT_EQ(kTestNumber16, requester_->number()); +} + +TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthExpiredThenResendOtpMetrics) { + base::HistogramTester histogram_tester; + // Simulate user selects OTP challenge option. Current context_token is from + // previous unmask response. TestPaymentsNetworkInterface will ack the select + // challenge option request and directly invoke the callback. + authenticator_->OnChallengeOptionSelected( + &card_, selected_otp_challenge_option_, requester_->GetWeakPtr(), + /*context_token=*/"context_token_from_previous_unmask_response", + /*billing_customer_number=*/kTestBillingCustomerNumber); + payments_autofill_client().ResetShowOtpInputDialog(); + // Simulate user provides the OTP and clicks 'Confirm' in the OTP dialog. + // TestPaymentsNetworkInterface just stores the unmask request detail, won't + // invoke the callback. OnDidGetRealPan below will manually invoke the + // callback. + authenticator_->OnUnmaskPromptAccepted(/*otp=*/u"4444444"); + // Simulate otp expired, server returns flow_status indicating expired otp. + OnDidGetRealPanWithFlowStatus( + /*flow_status=*/"FLOW_STATUS_EXPIRED_OTP", + /*context_token=*/"context_token_from_expired_otp"); + // Simulate user clicks "Get new code" from the UI, which calls + // SendSelectChallengeOptionRequest() again. This will send the same selected + // challenge option with the new context token. + authenticator_->OnNewOtpRequested(); + // Simulate user receives the new otp and types in the new otp. + authenticator_->OnUnmaskPromptAccepted(/*otp=*/u"555555"); + // Simulate server returns success for the second try and invoke the callback. + OnDidGetRealPan(payments::PaymentsAutofillClient::PaymentsRpcResult::kSuccess, + kTestNumber); // Ensures the metrics have been logged correctly. histogram_tester.ExpectUniqueSample( @@ -573,7 +732,6 @@ } TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthCancelled) { - base::HistogramTester histogram_tester; // Simulate user selects OTP challenge option. Current context_token is from // previous unmask response. TestPaymentsNetworkInterface will ack the select // challenge option request and directly invoke the callback. @@ -582,7 +740,7 @@ /*context_token=*/"context_token_from_previous_unmask_response", /*billing_customer_number=*/kTestBillingCustomerNumber); // Verify the SelectChallengeRequest content. - verifySelectChallengeOptionRequest( + VerifySelectChallengeOptionRequest( /*context_token=*/"context_token_from_previous_unmask_response", kTestBillingCustomerNumber); // Verify the context token is updated with SelectChallengeOption response. @@ -594,6 +752,19 @@ authenticator_->OnUnmaskPromptClosed(/*user_closed_dialog=*/true); ASSERT_TRUE(requester_->did_succeed().has_value()); EXPECT_FALSE(*(requester_->did_succeed())); +} + +TEST_P(CreditCardOtpAuthenticatorTest, OtpAuthCancelledMetrics) { + base::HistogramTester histogram_tester; + // Simulate user selects OTP challenge option. Current context_token is from + // previous unmask response. TestPaymentsNetworkInterface will ack the select + // challenge option request and directly invoke the callback. + authenticator_->OnChallengeOptionSelected( + &card_, selected_otp_challenge_option_, requester_->GetWeakPtr(), + /*context_token=*/"context_token_from_previous_unmask_response", + /*billing_customer_number=*/kTestBillingCustomerNumber); + // Simulate user closes the otp input dialog. + authenticator_->OnUnmaskPromptClosed(/*user_closed_dialog=*/true); // Ensures the metrics have been logged correctly. histogram_tester.ExpectUniqueSample( @@ -613,8 +784,11 @@ INSTANTIATE_TEST_SUITE_P( , CreditCardOtpAuthenticatorTest, - testing::Values(CardUnmaskChallengeOptionType::kSmsOtp, - CardUnmaskChallengeOptionType::kEmailOtp)); + testing::Combine( + testing::Values(CardUnmaskChallengeOptionType::kSmsOtp, + CardUnmaskChallengeOptionType::kEmailOtp), + testing::Values(CreditCard::RecordType::kVirtualCard, + CreditCard::RecordType::kMaskedServerCard))); // Params of the CreditCardOtpAuthenticatorCardMetadataTest: // -- bool card_name_available; @@ -630,6 +804,7 @@ void SetUp() override { CreditCardOtpAuthenticatorTestBase::SetUp(); CreateSelectedOtpChallengeOption(CardUnmaskChallengeOptionType::kSmsOtp); + card_.set_record_type(CreditCard::RecordType::kVirtualCard); } bool CardNameAvailable() { return std::get<0>(GetParam()); }
diff --git a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.h b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.h index 4dd68de..3a9e53f 100644 --- a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.h +++ b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.h
@@ -63,6 +63,11 @@ context_token = std::move(s); return *this; } + RiskBasedAuthenticationResponse& with_card_unmask_challenge_options( + std::vector<CardUnmaskChallengeOption> c) { + card_unmask_challenge_options = std::move(c); + return *this; + } // The `result` will be used to notify requesters of the outcome of the // risk-based authentication.
diff --git a/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator.cc b/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator.cc index 2d7f46c1..66f7299 100644 --- a/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator.cc +++ b/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator.cc
@@ -1019,6 +1019,11 @@ } summary.with_cvc = !std::ranges::all_of( cards_to_suggest, &std::u16string::empty, &CreditCard::cvc); + summary.with_card_info_retrieval_enrolled = + std::ranges::any_of(cards_to_suggest, [](const CreditCard& card) { + return card.card_info_retrieval_enrollment_state() == + CreditCard::CardInfoRetrievalEnrollmentState::kRetrievalEnrolled; + }); if (suggestions.empty()) { return suggestions; }
diff --git a/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator.h b/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator.h index 4b670c4a..3babbe3 100644 --- a/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator.h +++ b/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator.h
@@ -42,6 +42,8 @@ bool with_offer = false; // True if any card has a saved CVC. bool with_cvc = false; + // True if any card is card info retrieval enrolled. + bool with_card_info_retrieval_enrolled = false; // Contains card metadata related information used for metrics logging. autofill_metrics::CardMetadataLoggingContext metadata_logging_context; // Contains information regarding the ranking of suggestions and is used for
diff --git a/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator_unittest.cc b/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator_unittest.cc index a56f2417..aefc0ac0 100644 --- a/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator_unittest.cc +++ b/components/autofill/core/browser/suggestions/payments/payments_suggestion_generator_unittest.cc
@@ -1063,6 +1063,31 @@ ContainsCreditCardFooterSuggestions(/*with_gpay_logo=*/true)); } +// Ensures we appropriately generate suggestions for card info retrieval +// enrolled card. +TEST_F(PaymentsSuggestionGeneratorTest, + GetCardSuggestionsWithCardInfoRetrievalEnrolled) { + CreditCard card = test::GetMaskedServerCardEnrolledIntoRuntimeRetrieval(); + payments_data().AddServerCreditCard(card); + + CreditCardSuggestionSummary summary; + std::vector<Suggestion> suggestions = GetCreditCardOrCvcFieldSuggestions( + *autofill_client(), FormFieldData(), + /*four_digit_combinations_in_dom=*/{}, + /*autofilled_last_four_digits_in_form_for_filtering=*/u"", + CREDIT_CARD_NUMBER, + /*should_show_scan_credit_card=*/false, + /*should_show_cards_from_account=*/false, summary); + + // There are 3 suggestions, 1 for card info retrieval enrolled card + // suggestions, followed by a separator, and followed by "Manage payment + // methods..." which redirects to the Chrome payment methods settings page. + ASSERT_EQ(suggestions.size(), 3U); + EXPECT_TRUE(summary.with_card_info_retrieval_enrolled); + EXPECT_THAT(suggestions, + ContainsCreditCardFooterSuggestions(/*with_gpay_logo=*/true)); +} + // Verifies that the GPay logo is set correctly. TEST_F(PaymentsSuggestionGeneratorTest, ShouldDisplayGpayLogo) { // GPay logo should be displayed if suggestions were all for server cards;
diff --git a/components/browser_ui/display_cutout/android/java/src/org/chromium/components/browser_ui/display_cutout/DisplayCutoutController.java b/components/browser_ui/display_cutout/android/java/src/org/chromium/components/browser_ui/display_cutout/DisplayCutoutController.java index 426254c40..d9962ea8 100644 --- a/components/browser_ui/display_cutout/android/java/src/org/chromium/components/browser_ui/display_cutout/DisplayCutoutController.java +++ b/components/browser_ui/display_cutout/android/java/src/org/chromium/components/browser_ui/display_cutout/DisplayCutoutController.java
@@ -76,8 +76,13 @@ */ public interface SafeAreaInsetsTracker { - /** @return whether this Tracker was created for a web page set to Cover. */ + /** + * @return whether this Tracker was created for a web page set to Cover. + */ boolean isViewportFitCover(); + + /** Return whether the safe area is constrained on the current web page. */ + boolean hasSafeAreaConstraint(); } /** @@ -86,6 +91,7 @@ */ private static class SafeAreaInsetsTrackerImpl implements SafeAreaInsetsTracker { private boolean mIsViewportFitCover; + private boolean mHasSafeAreaConstraint; /** Sets whether this Tracker was created for a web page set to Cover. */ public void setIsViewportFitCover(boolean isViewportFitCover) { @@ -96,6 +102,16 @@ public boolean isViewportFitCover() { return mIsViewportFitCover; } + + /** Sets whether there are safe area constraint for the web page. */ + public void setSafeAreaConstraint(boolean hasConstraint) { + mHasSafeAreaConstraint = hasConstraint; + } + + @Override + public boolean hasSafeAreaConstraint() { + return mHasSafeAreaConstraint; + } } /** An interface for providing embedder-specific behavior to the controller. */ @@ -313,6 +329,16 @@ } /** + * Set whether there are safe area constraint on the current web page. + * + * @param hasConstraint whether the safe area is constrained on the current web page. + */ + public void setSafeAreaConstraint(boolean hasConstraint) { + Log.i(TAG, "setSafeAreaConstraint: %b", hasConstraint); + mSafeAreaInsetsTracker.setSafeAreaConstraint(hasConstraint); + } + + /** * Gets the {@link SafeAreaInsetsTracker} associated with the given Tab. * * @param tab The {@link Tab} that may have a web page rendered already
diff --git a/components/browser_ui/edge_to_edge/android/java/src/org/chromium/components/browser_ui/edge_to_edge/EdgeToEdgeSupplier.java b/components/browser_ui/edge_to_edge/android/java/src/org/chromium/components/browser_ui/edge_to_edge/EdgeToEdgeSupplier.java index 5d902af..94efe90 100644 --- a/components/browser_ui/edge_to_edge/android/java/src/org/chromium/components/browser_ui/edge_to_edge/EdgeToEdgeSupplier.java +++ b/components/browser_ui/edge_to_edge/android/java/src/org/chromium/components/browser_ui/edge_to_edge/EdgeToEdgeSupplier.java
@@ -27,6 +27,14 @@ */ void onToEdgeChange( @Px int bottomInset, boolean isDrawingToEdge, boolean isPageOptInToEdge); + + /** + * Whether any constraint exists to retain web content to within the safe area. + * + * @param hasConstraint Whether to retain the web content within the safe area. + */ + // TODO(https://crbug.com/385221500): Consider add hasConstraint to #onToEdgeChange. + default void onSafeAreaConstraintChanged(boolean hasConstraint) {} } /** Registers an automatic adjuster of padding for a view. See {@link EdgeToEdgePadAdjuster}. */
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/gesture/BackPressHandler.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/gesture/BackPressHandler.java index 19f07b02..d1135dce 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/gesture/BackPressHandler.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/gesture/BackPressHandler.java
@@ -29,13 +29,13 @@ Type.TEXT_BUBBLE, Type.XR_DELEGATE, Type.SCENE_OVERLAY, - Type.START_SURFACE, + // Deprecated: Type.START_SURFACE, Type.SELECTION_POPUP, Type.MANUAL_FILLING, Type.TAB_MODAL_HANDLER, Type.FULLSCREEN, Type.HUB, - Type.TAB_SWITCHER, + // Deprecated: Type.TAB_SWITCHER, Type.CLOSE_WATCHER, Type.FIND_TOOLBAR, Type.LOCATION_BAR, @@ -52,11 +52,11 @@ int XR_DELEGATE = 1; int SCENE_OVERLAY = 2; int BOTTOM_SHEET = 3; - int START_SURFACE = 5; + // Deprecated: int START_SURFACE = 5; // The archived tabs dialog is shown on top of the hub, so it must take priority. int ARCHIVED_TABS_DIALOG = 6; int HUB = 7; - int TAB_SWITCHER = 8; + // Deprecated: int TAB_SWITCHER = 8; // Fullscreen must be before selection popup. crbug.com/1454817. int FULLSCREEN = 9; int SELECTION_POPUP = 10;
diff --git a/components/cast_receiver/browser/permissions_manager_impl_unittest.cc b/components/cast_receiver/browser/permissions_manager_impl_unittest.cc index 40d72f1..c62fff3 100644 --- a/components/cast_receiver/browser/permissions_manager_impl_unittest.cc +++ b/components/cast_receiver/browser/permissions_manager_impl_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "components/cast_receiver/browser/permissions_manager_impl.h" + #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/permissions/permission_utils.h"
diff --git a/components/cast_streaming/browser/cast_message_port_converter_trivial.cc b/components/cast_streaming/browser/cast_message_port_converter_trivial.cc index 045a0156..4390588 100644 --- a/components/cast_streaming/browser/cast_message_port_converter_trivial.cc +++ b/components/cast_streaming/browser/cast_message_port_converter_trivial.cc
@@ -2,9 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/cast_streaming/browser/cast_message_port_converter.h" - #include "base/notreached.h" +#include "components/cast_streaming/browser/cast_message_port_converter.h" namespace cast_streaming {
diff --git a/components/cast_streaming/browser/cast_message_port_impl.cc b/components/cast_streaming/browser/cast_message_port_impl.cc index b42266c..32aec10 100644 --- a/components/cast_streaming/browser/cast_message_port_impl.cc +++ b/components/cast_streaming/browser/cast_message_port_impl.cc
@@ -225,8 +225,9 @@ const std::string& message_namespace, const std::string& message) { DVLOG(3) << __func__; - if (!message_port_) + if (!message_port_) { return; + } DVLOG(3) << "Received Open Screen message. SenderId: " << sender_id << ". Namespace: " << message_namespace << ". Message: " << message;
diff --git a/components/cast_streaming/common/message_serialization.cc b/components/cast_streaming/common/message_serialization.cc index d2b669f..a7ca5629 100644 --- a/components/cast_streaming/common/message_serialization.cc +++ b/components/cast_streaming/common/message_serialization.cc
@@ -57,27 +57,32 @@ std::string* message_namespace, std::string* message) { std::optional<base::Value> converted_value = base::JSONReader::Read(buffer); - if (!converted_value) + if (!converted_value) { return false; + } - if (!converted_value->is_dict()) + if (!converted_value->is_dict()) { return false; + } const base::Value::Dict& converted_dict = converted_value->GetDict(); const std::string* sender_id_value = converted_dict.FindString(kKeySenderId); - if (!sender_id_value) + if (!sender_id_value) { return false; + } *sender_id = *sender_id_value; const std::string* message_namespace_value = converted_dict.FindString(kKeyNamespace); - if (!message_namespace_value) + if (!message_namespace_value) { return false; + } *message_namespace = *message_namespace_value; const std::string* message_value = converted_dict.FindString(kKeyData); - if (!message_value) + if (!message_value) { return false; + } *message = *message_value; return true;
diff --git a/components/cast_streaming/renderer/public/decoder_buffer_provider.h b/components/cast_streaming/renderer/public/decoder_buffer_provider.h index 843af513..4f5df69 100644 --- a/components/cast_streaming/renderer/public/decoder_buffer_provider.h +++ b/components/cast_streaming/renderer/public/decoder_buffer_provider.h
@@ -12,7 +12,7 @@ class AudioDecoderConfig; class DecoderBuffer; class VideoDecoderConfig; -} +} // namespace media namespace cast_streaming {
diff --git a/components/cast_streaming/renderer/web_codecs/stream_control_channel.cc b/components/cast_streaming/renderer/web_codecs/stream_control_channel.cc index c3a7510..007e3d3 100644 --- a/components/cast_streaming/renderer/web_codecs/stream_control_channel.cc +++ b/components/cast_streaming/renderer/web_codecs/stream_control_channel.cc
@@ -3,10 +3,11 @@ // found in the LICENSE file. #include "components/cast_streaming/renderer/web_codecs/stream_control_channel.h" -#include "base/task/sequenced_task_runner.h" #include <utility> +#include "base/task/sequenced_task_runner.h" + namespace cast_streaming::webcodecs { StreamControlChannel::StreamControlChannel(
diff --git a/components/crash/core/app/crashpad_linux.cc b/components/crash/core/app/crashpad_linux.cc index aff834c..a5710389 100644 --- a/components/crash/core/app/crashpad_linux.cc +++ b/components/crash/core/app/crashpad_linux.cc
@@ -40,10 +40,6 @@ #include "third_party/cros_system_api/constants/crash_reporter.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "base/build_time.h" -#endif - namespace crash_reporter { namespace { @@ -208,14 +204,6 @@ annotations["plat"] = std::string("Linux"); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // "build_time_millis" is used on LaCros chrome to determine when to stop - // sending crash reports (from outdated versions of the browser). - int64_t build_time = - (base::GetBuildTime() - base::Time::UnixEpoch()).InMilliseconds(); - annotations["build_time_millis"] = base::NumberToString(build_time); -#endif - #if BUILDFLAG(IS_CHROMEOS_DEVICE) // Chromium OS: save board and builder path for 'tast symbolize'. annotations["chromeos-board"] = base::SysInfo::GetLsbReleaseBoard();
diff --git a/components/facilitated_payments/core/browser/ewallet_manager.cc b/components/facilitated_payments/core/browser/ewallet_manager.cc index f3cf379..a250cda 100644 --- a/components/facilitated_payments/core/browser/ewallet_manager.cc +++ b/components/facilitated_payments/core/browser/ewallet_manager.cc
@@ -20,6 +20,7 @@ #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_network_interface.h" #include "components/facilitated_payments/core/features/features.h" #include "components/facilitated_payments/core/metrics/facilitated_payments_metrics.h" +#include "components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h" #include "components/facilitated_payments/core/utils/facilitated_payments_utils.h" #include "components/facilitated_payments/core/validation/payment_link_validator.h" #include "components/optimization_guide/core/optimization_guide_decider.h" @@ -43,10 +44,15 @@ optimization_guide_decider_->RegisterOptimizationTypes( {optimization_guide::proto::EWALLET_MERCHANT_ALLOWLIST}); } -EwalletManager::~EwalletManager() = default; + +EwalletManager::~EwalletManager() { + DismissPrompt(); +} void EwalletManager::TriggerEwalletPushPayment(const GURL& payment_link_url, const GURL& page_url) { + payment_flow_triggered_timestamp_ = base::TimeTicks::Now(); + if (optimization_guide_decider_->CanApplyOptimization( page_url, optimization_guide::proto::EWALLET_MERCHANT_ALLOWLIST, /*optimization_metadata=*/nullptr) != @@ -108,6 +114,9 @@ page_url.host(); initiate_payment_request_details_->payment_link_ = payment_link_url.spec(); + client_->SetUiEventListener(base::BindRepeating( + &EwalletManager::OnUiEvent, weak_ptr_factory_.GetWeakPtr())); + GetApiClient()->IsAvailable( base::BindOnce(&EwalletManager::OnApiAvailabilityReceived, weak_ptr_factory_.GetWeakPtr(), base::TimeTicks::Now())); @@ -116,6 +125,7 @@ void EwalletManager::Reset() { supported_ewallets_.clear(); initiate_payment_request_details_.reset(); + ui_state_ = UiState::kHidden; weak_ptr_factory_.InvalidateWeakPtrs(); } @@ -144,7 +154,7 @@ autofill::payments::GetBillingCustomerId( *client_->GetPaymentsDataManager()); - client_->ShowEwalletPaymentPrompt( + ShowEwalletPaymentPrompt( supported_ewallets_, base::BindOnce(&EwalletManager::OnEwalletPaymentPromptResult, weak_ptr_factory_.GetWeakPtr())); @@ -156,8 +166,7 @@ if (!is_prompt_accepted) { return; } - - client_->ShowProgressScreen(); + ShowProgressScreen(); initiate_payment_request_details_->instrument_id_ = selected_instrument_id; @@ -174,7 +183,7 @@ if (risk_data.empty()) { LogEwalletFlowExitedReason(EwalletFlowExitedReason::kRiskDataEmpty, scheme_); - client_->ShowErrorScreen(); + ShowErrorScreen(); return; } @@ -193,7 +202,7 @@ if (client_token.empty()) { LogEwalletFlowExitedReason( EwalletFlowExitedReason::kClientTokenNotAvailable, scheme_); - client_->ShowErrorScreen(); + ShowErrorScreen(); return; } initiate_payment_request_details_->client_token_ = std::move(client_token); @@ -206,7 +215,7 @@ client_->GetFacilitatedPaymentsNetworkInterface(); if (!payments_network_interface) { - client_->ShowErrorScreen(); + ShowErrorScreen(); return; } @@ -230,7 +239,7 @@ base::TimeTicks::Now() - start_time, scheme_); if (!is_successful) { - client_->ShowErrorScreen(); + ShowErrorScreen(); LogEwalletFlowExitedReason(EwalletFlowExitedReason::kInitiatePaymentFailed, scheme_); return; @@ -238,7 +247,7 @@ if (!response_details || response_details->action_token_.empty()) { LogEwalletFlowExitedReason( EwalletFlowExitedReason::kActionTokenNotAvailable, scheme_); - client_->ShowErrorScreen(); + ShowErrorScreen(); return; } std::optional<CoreAccountInfo> account_info = client_->GetCoreAccountInfo(); @@ -248,7 +257,7 @@ if (!account_info.has_value() || account_info.value().IsEmpty()) { LogEwalletFlowExitedReason(EwalletFlowExitedReason::kUserLoggedOut, scheme_); - client_->ShowErrorScreen(); + ShowErrorScreen(); return; } @@ -260,10 +269,71 @@ } void EwalletManager::OnTransactionResult(PurchaseActionResult result) { - // When server responds to the purchase action, Google Play Services takes - // over, but the dismiss of progress screen is not taken over. Calling - // `DismissPrompt` to dismiss it manually. + switch (result) { + case PurchaseActionResult::kCouldNotInvoke: + ShowErrorScreen(); + break; + case PurchaseActionResult::kResultOk: + [[fallthrough]]; // Intentional fallthrough. + case PurchaseActionResult::kResultCanceled: + DismissPrompt(); + break; + } +} + +void EwalletManager::OnUiEvent(UiEvent ui_event_type) { + switch (ui_event_type) { + case UiEvent::kNewScreenShown: { + CHECK_NE(ui_state_, UiState::kHidden); + LogUiScreenShown(kPaymentsType, ui_state_, scheme_); + if (ui_state_ == UiState::kFopSelector) { + LogFopSelectorShownLatency( + kPaymentsType, + base::TimeTicks::Now() - payment_flow_triggered_timestamp_, + scheme_); + } + break; + } + case UiEvent::kScreenClosedNotByUser: { + if (ui_state_ == UiState::kFopSelector) { + LogEwalletFlowExitedReason( + EwalletFlowExitedReason::kFopSelectorClosedNotByUser, scheme_); + } + ui_state_ = UiState::kHidden; + break; + } + case UiEvent::kScreenClosedByUser: { + if (ui_state_ == UiState::kFopSelector) { + LogEwalletFlowExitedReason( + EwalletFlowExitedReason::kFopSelectorClosedByUser, scheme_); + } + ui_state_ = UiState::kHidden; + break; + } + } +} + +void EwalletManager::DismissPrompt() { + ui_state_ = UiState::kHidden; client_->DismissPrompt(); } +void EwalletManager::ShowEwalletPaymentPrompt( + base::span<const autofill::Ewallet> ewallet_suggestions, + base::OnceCallback<void(bool, int64_t)> on_user_decision_callback) { + ui_state_ = UiState::kFopSelector; + client_->ShowEwalletPaymentPrompt(std::move(ewallet_suggestions), + std::move(on_user_decision_callback)); +} + +void EwalletManager::ShowProgressScreen() { + ui_state_ = UiState::kProgressScreen; + client_->ShowProgressScreen(); +} + +void EwalletManager::ShowErrorScreen() { + ui_state_ = UiState::kErrorScreen; + client_->ShowErrorScreen(); +} + } // namespace payments::facilitated
diff --git a/components/facilitated_payments/core/browser/ewallet_manager.h b/components/facilitated_payments/core/browser/ewallet_manager.h index 0a508c6..d10918bc 100644 --- a/components/facilitated_payments/core/browser/ewallet_manager.h +++ b/components/facilitated_payments/core/browser/ewallet_manager.h
@@ -16,6 +16,7 @@ #include "components/autofill/core/browser/payments/payments_autofill_client.h" #include "components/facilitated_payments/core/browser/facilitated_payments_api_client.h" #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_request_details.h" +#include "components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h" #include "components/facilitated_payments/core/utils/facilitated_payments_utils.h" #include "components/facilitated_payments/core/validation/payment_link_validator.h" @@ -108,6 +109,24 @@ // payment. void OnTransactionResult(PurchaseActionResult result); + // Called by the view to communicate UI events. + void OnUiEvent(UiEvent ui_event_type); + + // Updates the `ui_state_` value and triggers dismissal. + void DismissPrompt(); + + // Updates the `ui_state_` value and triggers showing the eWallet payment + // prompt. + void ShowEwalletPaymentPrompt( + base::span<const autofill::Ewallet> ewallet_suggestions, + base::OnceCallback<void(bool, int64_t)> on_user_decision_callback); + + // Updates the `ui_state_` value and triggers showing the progress screen. + void ShowProgressScreen(); + + // Updates the `ui_state_` value and triggers showing the error screen. + void ShowErrorScreen(); + // A list of eWallets that support the payment link provided in // TriggerEwalletPushPayment(). // @@ -147,6 +166,14 @@ std::unique_ptr<FacilitatedPaymentsInitiatePaymentRequestDetails> initiate_payment_request_details_; + // Represents the current state of the UI or the UI state that is intended. In + // the latter case, the UI state is always updated to reflect the current + // state via a callback. + UiState ui_state_ = UiState::kHidden; + + // Stores the time when eWallet payment flow is triggered. + base::TimeTicks payment_flow_triggered_timestamp_; + base::WeakPtrFactory<EwalletManager> weak_ptr_factory_{this}; };
diff --git a/components/facilitated_payments/core/browser/ewallet_manager_test_api.h b/components/facilitated_payments/core/browser/ewallet_manager_test_api.h index 755cd1a..1c817f17 100644 --- a/components/facilitated_payments/core/browser/ewallet_manager_test_api.h +++ b/components/facilitated_payments/core/browser/ewallet_manager_test_api.h
@@ -9,9 +9,11 @@ #include "base/check_deref.h" #include "base/memory/raw_ref.h" +#include "components/autofill/core/browser/data_model/ewallet.h" #include "components/facilitated_payments/core/browser/ewallet_manager.h" #include "components/facilitated_payments/core/browser/facilitated_payments_api_client.h" #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_request_details.h" +#include "components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h" namespace payments::facilitated { @@ -77,6 +79,27 @@ start_time, result, std::move(response_details)); } + UiState ui_state() { return ewallet_manager_->ui_state_; } + + void OnUiEvent(UiEvent ui_event_type) { + ewallet_manager_->OnUiEvent(ui_event_type); + } + + void ShowEwalletPaymentPrompt( + base::span<const autofill::Ewallet> ewallet_suggestions, + base::OnceCallback<void(bool, int64_t)> on_user_decision_callback) { + ewallet_manager_->ShowEwalletPaymentPrompt( + ewallet_suggestions, std::move(on_user_decision_callback)); + } + + void ShowProgressScreen() { ewallet_manager_->ShowProgressScreen(); } + + void ShowErrorScreen() { ewallet_manager_->ShowErrorScreen(); } + + void OnTransactionResult(PurchaseActionResult result) { + ewallet_manager_->OnTransactionResult(result); + } + private: const raw_ref<EwalletManager> ewallet_manager_; };
diff --git a/components/facilitated_payments/core/browser/ewallet_manager_unittest.cc b/components/facilitated_payments/core/browser/ewallet_manager_unittest.cc index b0ce8bd..153b4f5 100644 --- a/components/facilitated_payments/core/browser/ewallet_manager_unittest.cc +++ b/components/facilitated_payments/core/browser/ewallet_manager_unittest.cc
@@ -10,6 +10,7 @@ #include "base/functional/callback.h" #include "base/test/metrics/histogram_tester.h" +#include "base/test/task_environment.h" #include "components/autofill/core/browser/data_manager/payments/test_payments_data_manager.h" #include "components/autofill/core/browser/data_model/ewallet.h" #include "components/autofill/core/browser/test_utils/autofill_test_utils.h" @@ -22,6 +23,7 @@ #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.h" #include "components/facilitated_payments/core/browser/network_api/mock_facilitated_payments_network_interface.h" #include "components/facilitated_payments/core/metrics/facilitated_payments_metrics.h" +#include "components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h" #include "components/optimization_guide/core/mock_optimization_guide_decider.h" #include "components/signin/public/identity_manager/account_info.h" #include "components/sync/test/test_sync_service.h" @@ -80,12 +82,18 @@ FacilitatedPaymentsInitiatePaymentRequestDetails>()); } + void FastForwardBy(base::TimeDelta duration) { + task_environment_.FastForwardBy(duration); + } + MockFacilitatedPaymentsApiClient& GetApiClient() { return *static_cast<MockFacilitatedPaymentsApiClient*>( test_api(*ewallet_manager_).GetApiClient()); } protected: + base::test::TaskEnvironment task_environment_{ + base::test::TaskEnvironment::TimeSource::MOCK_TIME}; MockFacilitatedPaymentsClient client_; optimization_guide::MockOptimizationGuideDecider optimization_guide_decider_; // Order matters here because `ewallet_manager_` keeps a reference @@ -703,10 +711,10 @@ // Test that API availability is invoked for websites in the allowlist. TEST_F(EwalletManagerTest, TriggerEwalletPushPayment_UrlInAllowlist_ApiAvailabilityInvoked) { - GURL url("https://example.com/"); + GURL page_url("https://example.com/"); payments_data_manager_.AddEwalletForTest(autofill::Ewallet( /*instrument_id=*/100, u"nickname", - /*display_icon_url=*/url, u"ewallet_name", u"account_display_name", + /*display_icon_url=*/page_url, u"ewallet_name", u"account_display_name", /*supported_payment_link_uris=*/ {u"^shopeepay:\\/\\/shopeepay\\.com\\.my\\?code=.*$", u"^tngd:\\/\\/tngdigital\\.com\\.my\\?code=.*$"}, @@ -718,7 +726,7 @@ EXPECT_CALL( optimization_guide_decider_, CanApplyOptimization( - testing::Eq(url), + testing::Eq(page_url), testing::Eq(optimization_guide::proto::EWALLET_MERCHANT_ALLOWLIST), testing::Matcher<optimization_guide::OptimizationMetadata*>( testing::Eq(nullptr)))) @@ -726,7 +734,7 @@ optimization_guide::OptimizationGuideDecision::kTrue)); EXPECT_CALL(GetApiClient(), IsAvailable); - ewallet_manager_->TriggerEwalletPushPayment(supported_payment_link, url); + ewallet_manager_->TriggerEwalletPushPayment(supported_payment_link, page_url); } // Test that API availability is not invoked for webpages not in the @@ -734,7 +742,7 @@ TEST_F(EwalletManagerTest, TriggerEwalletPushPayment_UrlNotInAllowlist_ApiAvailabilityNotInvoked) { base::HistogramTester histogram_tester; - GURL url("https://example.com/"); + GURL page_url("https://example.com/"); payments_data_manager_.AddEwalletForTest( autofill::Ewallet(/*instrument_id=*/100, u"nickname", /*display_icon_url=*/GURL("http://www.example.com"), @@ -750,7 +758,7 @@ EXPECT_CALL( optimization_guide_decider_, CanApplyOptimization( - testing::Eq(url), + testing::Eq(page_url), testing::Eq(optimization_guide::proto::EWALLET_MERCHANT_ALLOWLIST), testing::Matcher<optimization_guide::OptimizationMetadata*>( testing::Eq(nullptr)))) @@ -758,7 +766,7 @@ optimization_guide::OptimizationGuideDecision::kFalse)); EXPECT_CALL(GetApiClient(), IsAvailable).Times(0); - ewallet_manager_->TriggerEwalletPushPayment(supported_payment_link, url); + ewallet_manager_->TriggerEwalletPushPayment(supported_payment_link, page_url); histogram_tester.ExpectUniqueSample( "FacilitatedPayments.Ewallet.PayflowExitedReason", @@ -775,7 +783,7 @@ TEST_F( EwalletManagerTest, TriggerEwalletPushPayment_AllowlistNotAvailable_ApiAvailabilityNotInvoked) { - GURL url("https://example.com/"); + GURL page_url("https://example.com/"); payments_data_manager_.AddEwalletForTest( autofill::Ewallet(/*instrument_id=*/100, u"nickname", /*display_icon_url=*/GURL("http://www.example.com"), @@ -791,7 +799,7 @@ EXPECT_CALL( optimization_guide_decider_, CanApplyOptimization( - testing::Eq(url), + testing::Eq(page_url), testing::Eq(optimization_guide::proto::EWALLET_MERCHANT_ALLOWLIST), testing::Matcher<optimization_guide::OptimizationMetadata*>( testing::Eq(nullptr)))) @@ -799,7 +807,203 @@ optimization_guide::OptimizationGuideDecision::kUnknown)); EXPECT_CALL(GetApiClient(), IsAvailable).Times(0); - ewallet_manager_->TriggerEwalletPushPayment(supported_payment_link, url); + ewallet_manager_->TriggerEwalletPushPayment(supported_payment_link, page_url); +} + +// Test that when the eWallet FOP selector is shown, its latency is logged. +TEST_F(EwalletManagerTest, FopSelectorShown_LatencyHistogramLogged) { + base::HistogramTester histogram_tester; + autofill::Ewallet supported_ewallet( + /*instrument_id=*/100, u"nickname", + /*display_icon_url=*/GURL("http://www.example.com"), u"ewallet_name", + u"account_display_name", + /*supported_payment_link_uris=*/ + {u"^shopeepay:\\/\\/shopeepay\\.com\\.my\\?code=.*$", + u"^tngd:\\/\\/tngdigital\\.com\\.my\\?code=.*$"}, + /*is_fido_enrolled=*/true); + payments_data_manager_.AddEwalletForTest(supported_ewallet); + GURL page_url("https://example.com/"); + GURL supported_payment_link( + "shopeepay://shopeepay.com.my?code=https://shopeepay.com.my/" + "281011051692389958586862838?merchant=Walmart&amount=101¤cy=usd"); + + // Simulate eWallet payment flow is triggered. + ewallet_manager_->TriggerEwalletPushPayment(supported_payment_link, page_url); + // Fully mocked time, does not advance by itself. + FastForwardBy(base::Seconds(2)); + // Simulate that the FOP selector was shown successfully. + test_api(*ewallet_manager_) + .ShowEwalletPaymentPrompt({supported_ewallet}, base::DoNothing()); + test_api(*ewallet_manager_).OnUiEvent(UiEvent::kNewScreenShown); + + // Verify that when the eWallet FOP selector is shown, latency histogram is + // logged. + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.FopSelectorShown." + "LatencyAfterDetectingPaymentLink", + /*sample=*/2000, + /*expected_bucket_count=*/1); + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.FopSelectorShown." + "LatencyAfterDetectingPaymentLink.ShopeePay", + /*sample=*/2000, + /*expected_bucket_count=*/1); +} + +class EwalletManagerTestForUiScreens + : public EwalletManagerTest, + public testing::WithParamInterface<UiState> { + public: + void SetUp() override { + // Default state. + EXPECT_EQ(test_api(*ewallet_manager_).ui_state(), UiState::kHidden); + + switch (ui_state()) { + case UiState::kFopSelector: { + const std::vector<autofill::Ewallet> ewallets = { + autofill::test::CreateEwalletAccount(100L)}; + test_api(*ewallet_manager_) + .ShowEwalletPaymentPrompt(std::move(ewallets), base::DoNothing()); + break; + } + case UiState::kProgressScreen: + test_api(*ewallet_manager_).ShowProgressScreen(); + break; + case UiState::kErrorScreen: + test_api(*ewallet_manager_).ShowErrorScreen(); + break; + case UiState::kHidden: + NOTREACHED(); + } + } + + UiState ui_state() { return GetParam(); } +}; + +INSTANTIATE_TEST_SUITE_P(EwalletManagerTest, + EwalletManagerTestForUiScreens, + testing::Values(UiState::kFopSelector, + UiState::kProgressScreen, + UiState::kErrorScreen)); + +// Test that when a new screen is shown, UI state reflects the current UI being +// shown. +TEST_P(EwalletManagerTestForUiScreens, NewScreenShown) { + base::HistogramTester histogram_tester; + + // Simulate new screen was shown successfully. + test_api(*ewallet_manager_).OnUiEvent(UiEvent::kNewScreenShown); + + // Verify feature has updated the UI state. + EXPECT_EQ(test_api(*ewallet_manager_).ui_state(), ui_state()); + + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.UiScreenShown", + /*sample=*/ui_state(), + /*expected_bucket_count=*/1); + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.UiScreenShown.ShopeePay", + /*sample=*/ui_state(), + /*expected_bucket_count=*/1); +} + +// Test that when a new screen could not be shown, UI state is updated. +TEST_P(EwalletManagerTestForUiScreens, NewScreenCouldNotBeShown) { + base::HistogramTester histogram_tester; + + // Simulate new screen could not be shown. + test_api(*ewallet_manager_).OnUiEvent(UiEvent::kScreenClosedNotByUser); + + // Verify that the UI state is hidden. + EXPECT_EQ(test_api(*ewallet_manager_).ui_state(), UiState::kHidden); + + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.PayflowExitedReason", + /*sample=*/EwalletFlowExitedReason::kFopSelectorClosedNotByUser, + /*expected_bucket_count=*/ui_state() == UiState::kFopSelector ? 1 : 0); + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.PayflowExitedReason.ShopeePay", + /*sample=*/EwalletFlowExitedReason::kFopSelectorClosedNotByUser, + /*expected_bucket_count=*/ui_state() == UiState::kFopSelector ? 1 : 0); +} + +// Test that when the UI screen is closed, but it was not due to a user action, +// the feature updates the UI state. +TEST_P(EwalletManagerTestForUiScreens, ScreenClosedNotByUser) { + base::HistogramTester histogram_tester; + + // Simulate new screen was shown successfully. + test_api(*ewallet_manager_).OnUiEvent(UiEvent::kNewScreenShown); + // Simulate UI screen was closed, but it was not due to a user action. + test_api(*ewallet_manager_).OnUiEvent(UiEvent::kScreenClosedNotByUser); + + // Verify that the UI state is hidden. + EXPECT_EQ(test_api(*ewallet_manager_).ui_state(), UiState::kHidden); + + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.PayflowExitedReason", + /*sample=*/EwalletFlowExitedReason::kFopSelectorClosedNotByUser, + /*expected_bucket_count=*/ui_state() == UiState::kFopSelector ? 1 : 0); + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.PayflowExitedReason.ShopeePay", + /*sample=*/EwalletFlowExitedReason::kFopSelectorClosedNotByUser, + /*expected_bucket_count=*/ui_state() == UiState::kFopSelector ? 1 : 0); +} + +// Test that when the UI screen is closed by the user, the feature updates the +// UI state. +TEST_P(EwalletManagerTestForUiScreens, ScreenClosedByUser) { + base::HistogramTester histogram_tester; + + // Simulate new screen was shown successfully. + test_api(*ewallet_manager_).OnUiEvent(UiEvent::kNewScreenShown); + // Simulate UI screen was closed by the user. + test_api(*ewallet_manager_).OnUiEvent(UiEvent::kScreenClosedByUser); + + // Verify that the UI state is hidden. + EXPECT_EQ(test_api(*ewallet_manager_).ui_state(), UiState::kHidden); + + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.PayflowExitedReason", + /*sample=*/EwalletFlowExitedReason::kFopSelectorClosedByUser, + /*expected_bucket_count=*/ui_state() == UiState::kFopSelector ? 1 : 0); + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.PayflowExitedReason.ShopeePay", + /*sample=*/EwalletFlowExitedReason::kFopSelectorClosedByUser, + /*expected_bucket_count=*/ui_state() == UiState::kFopSelector ? 1 : 0); +} + +// Test that when Chrome fails to invoke purchase action, the error screen is +// shown. +TEST_F(EwalletManagerTest, + OnTransactionResult_CouldNotInvoke_ErrorScreenShown) { + EXPECT_CALL(client_, ShowErrorScreen); + + test_api(*ewallet_manager_) + .OnTransactionResult(PurchaseActionResult::kCouldNotInvoke); +} + +// Test that when Chrome is successful in invoking the purchase action, the UI +// screen is dismissed. +TEST_F(EwalletManagerTest, OnTransactionResult_ResultOk_UiScreenDismissed) { + // `DismissPrompt` is called once when the purchase action result is + // received, and again when the test fixture destroys the `manager_`. + EXPECT_CALL(client_, DismissPrompt).Times(2); + + test_api(*ewallet_manager_) + .OnTransactionResult(PurchaseActionResult::kResultOk); +} + +// Test that when Chrome is successful in invoking the purchase action, the UI +// screen is dismissed. +TEST_F(EwalletManagerTest, + OnTransactionResult_ResultCanceled_UiScreenDismissed) { + // `DismissPrompt` is called once when the purchase action result is + // received, and again when the test fixture destroys the `manager_`. + EXPECT_CALL(client_, DismissPrompt).Times(2); + + test_api(*ewallet_manager_) + .OnTransactionResult(PurchaseActionResult::kResultCanceled); } } // namespace payments::facilitated
diff --git a/components/facilitated_payments/core/browser/facilitated_payments_manager.cc b/components/facilitated_payments/core/browser/facilitated_payments_manager.cc index c04ba60a..5bad352 100644 --- a/components/facilitated_payments/core/browser/facilitated_payments_manager.cc +++ b/components/facilitated_payments/core/browser/facilitated_payments_manager.cc
@@ -329,10 +329,10 @@ switch (ui_event_type) { case UiEvent::kNewScreenShown: { CHECK_NE(ui_state_, UiState::kHidden); - LogUiScreenShown(ui_state_); + LogUiScreenShown(kPaymentsType, ui_state_); if (ui_state_ == UiState::kFopSelector) { - LogPixFopSelectorShownLatency(base::TimeTicks::Now() - - pix_code_copied_timestamp_); + LogFopSelectorShownLatency( + kPaymentsType, base::TimeTicks::Now() - pix_code_copied_timestamp_); LogFopSelectorShownUkm(ukm_source_id_); } break;
diff --git a/components/facilitated_payments/core/metrics/facilitated_payments_metrics.cc b/components/facilitated_payments/core/metrics/facilitated_payments_metrics.cc index 1d85f6a..a593ddf 100644 --- a/components/facilitated_payments/core/metrics/facilitated_payments_metrics.cc +++ b/components/facilitated_payments/core/metrics/facilitated_payments_metrics.cc
@@ -37,6 +37,16 @@ } } +std::string PaymentTypeToFopSelectorLatencyString( + FacilitatedPaymentsType payment_type) { + switch (payment_type) { + case FacilitatedPaymentsType::kPix: + return "LatencyAfterCopy"; + case FacilitatedPaymentsType::kEwallet: + return "LatencyAfterDetectingPaymentLink"; + } +} + std::string SchemeToString(PaymentLinkValidator::Scheme scheme) { switch (scheme) { case PaymentLinkValidator::Scheme::kDuitNow: @@ -255,14 +265,44 @@ .Record(ukm::UkmRecorder::Get()); } -void LogUiScreenShown(UiState ui_screen) { - base::UmaHistogramEnumeration("FacilitatedPayments.Pix.UiScreenShown", +void LogUiScreenShown(FacilitatedPaymentsType payment_type, + UiState ui_screen, + std::optional<PaymentLinkValidator::Scheme> scheme) { + base::UmaHistogramEnumeration(base::StrCat({ + "FacilitatedPayments.", + PaymentTypeToString(payment_type), + ".UiScreenShown", + }), ui_screen); + if (payment_type == FacilitatedPaymentsType::kEwallet) { + CHECK(scheme.has_value()); + CHECK_NE(PaymentLinkValidator::Scheme::kInvalid, *scheme); + base::UmaHistogramEnumeration( + base::StrCat({"FacilitatedPayments.Ewallet.UiScreenShown.", + SchemeToString(*scheme)}), + ui_screen); + } } -void LogPixFopSelectorShownLatency(base::TimeDelta latency) { +void LogFopSelectorShownLatency( + FacilitatedPaymentsType payment_type, + base::TimeDelta latency, + std::optional<PaymentLinkValidator::Scheme> scheme) { base::UmaHistogramLongTimes( - "FacilitatedPayments.Pix.FopSelectorShown.LatencyAfterCopy", latency); + base::StrCat({"FacilitatedPayments.", PaymentTypeToString(payment_type), + ".FopSelectorShown.", + PaymentTypeToFopSelectorLatencyString(payment_type)}), + latency); + + if (payment_type == FacilitatedPaymentsType::kEwallet) { + CHECK(scheme.has_value()); + CHECK_NE(PaymentLinkValidator::Scheme::kInvalid, *scheme); + base::UmaHistogramLongTimes( + base::StrCat({"FacilitatedPayments.Ewallet.FopSelectorShown." + "LatencyAfterDetectingPaymentLink.", + SchemeToString(*scheme)}), + latency); + } } } // namespace payments::facilitated
diff --git a/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h b/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h index 781c0a6..4e057b787 100644 --- a/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h +++ b/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h
@@ -54,7 +54,13 @@ kActionTokenNotAvailable = 9, // The user has logged out after selecting a payment method. kUserLoggedOut = 10, - kMaxValue = kUserLoggedOut + // The FOP selector either wasn't shown, or was dismissed not as a result of a + // user action. + kFopSelectorClosedNotByUser = 11, + // The FOP selector was dismissed by a user action e.g., swiping down, tapping + // on the webpage behind the FOP selector, or tapping on the omnibox. + kFopSelectorClosedByUser = 12, + kMaxValue = kFopSelectorClosedByUser }; // LINT.ThenChange(/tools/metrics/histograms/metadata/facilitated_payments/enums.xml:FacilitatedPayments.EwalletFlowExitedReason) @@ -203,11 +209,22 @@ ukm::SourceId ukm_source_id); // Logs showing a new UI screen. -void LogUiScreenShown(UiState ui_screen); +// The `scheme` parameter is required for the 'kEwallet' payment type and should +// not be `kInvalid`. +void LogUiScreenShown( + FacilitatedPaymentsType payment_type, + UiState ui_screen, + std::optional<PaymentLinkValidator::Scheme> scheme = std::nullopt); -// Logs the latency for seeing the Pix FOP selector after a user has copied the -// Pix payment code on the browser. -void LogPixFopSelectorShownLatency(base::TimeDelta latency); +// Logs the latency for displaying the FOP selector +// - Pix: Measures latency from Pix payment code copy to FOP selector display. +// - Ewallet: Measures latency from payment link detection to FOP selector +// display. The `scheme` parameter is required for the 'kEwallet' payment type +// and should not be `kInvalid`. +void LogFopSelectorShownLatency( + FacilitatedPaymentsType payment_type, + base::TimeDelta latency, + std::optional<PaymentLinkValidator::Scheme> scheme = std::nullopt); } // namespace payments::facilitated
diff --git a/components/facilitated_payments/core/metrics/facilitated_payments_metrics_unittest.cc b/components/facilitated_payments/core/metrics/facilitated_payments_metrics_unittest.cc index bcc8f16..465174c 100644 --- a/components/facilitated_payments/core/metrics/facilitated_payments_metrics_unittest.cc +++ b/components/facilitated_payments/core/metrics/facilitated_payments_metrics_unittest.cc
@@ -106,17 +106,6 @@ } } -TEST(FacilitatedPaymentsMetricsTest, LogPixFopSelectorShownLatency) { - base::HistogramTester histogram_tester; - - LogPixFopSelectorShownLatency(base::Milliseconds(10)); - - histogram_tester.ExpectUniqueSample( - "FacilitatedPayments.Pix.FopSelectorShown.LatencyAfterCopy", - /*sample=*/10, - /*expected_bucket_count=*/1); -} - class FacilitatedPaymentsMetricsEwalletExitedReasonTest : public testing::TestWithParam< std::tuple<EwalletFlowExitedReason, PaymentLinkValidator::Scheme>> { @@ -177,7 +166,9 @@ EwalletFlowExitedReason::kClientTokenNotAvailable, EwalletFlowExitedReason::kInitiatePaymentFailed, EwalletFlowExitedReason::kActionTokenNotAvailable, - EwalletFlowExitedReason::kUserLoggedOut), + EwalletFlowExitedReason::kUserLoggedOut, + EwalletFlowExitedReason::kFopSelectorClosedNotByUser, + EwalletFlowExitedReason::kFopSelectorClosedByUser), testing::Values(PaymentLinkValidator::Scheme::kDuitNow, PaymentLinkValidator::Scheme::kShopeePay, PaymentLinkValidator::Scheme::kTngd))); @@ -308,6 +299,15 @@ NOTREACHED(); } } + + std::string GetFopSelectorShownLatencyString() const { + switch (payment_type()) { + case FacilitatedPaymentsType::kEwallet: + return "LatencyAfterDetectingPaymentLink"; + case FacilitatedPaymentsType::kPix: + return "LatencyAfterCopy"; + } + } }; INSTANTIATE_TEST_SUITE_P( @@ -539,26 +539,97 @@ : 0); } +TEST_P(FacilitatedPaymentsMetricsParameterizedTest, + LogFopSelectorShownLatency) { + base::HistogramTester histogram_tester; + + LogFopSelectorShownLatency(payment_type(), base::Milliseconds(10), scheme()); + + histogram_tester.ExpectUniqueSample( + base::StrCat({"FacilitatedPayments.", GetFacilitatedPaymentsTypeString(), + ".FopSelectorShown.", GetFopSelectorShownLatencyString()}), + /*sample=*/10, + /*expected_bucket_count=*/1); + + histogram_tester.ExpectUniqueSample( + base::StrCat({"FacilitatedPayments.Ewallet.FopSelectorShown." + "LatencyAfterDetectingPaymentLink.", + GetSchemeString()}), + /*sample=*/10, + /*expected_bucket_count=*/payment_type() == + FacilitatedPaymentsType::kEwallet + ? 1 + : 0); +} + class FacilitatedPaymentsMetricsTestForUiScreens - : public testing::TestWithParam<UiState> { + : public testing::TestWithParam<std::tuple<FacilitatedPaymentsType, + PaymentLinkValidator::Scheme, + UiState>> { public: - UiState ui_screen() { return GetParam(); } + FacilitatedPaymentsType payment_type() const { + return std::get<0>(GetParam()); + } + + PaymentLinkValidator::Scheme scheme() const { + return std::get<1>(GetParam()); + } + + UiState ui_screen() { return std::get<2>(GetParam()); } + + std::string GetFacilitatedPaymentsTypeString() const { + switch (payment_type()) { + case FacilitatedPaymentsType::kEwallet: + return "Ewallet"; + case FacilitatedPaymentsType::kPix: + return "Pix"; + } + } + + std::string GetSchemeString() const { + switch (scheme()) { + case PaymentLinkValidator::Scheme::kDuitNow: + return "DuitNow"; + case PaymentLinkValidator::Scheme::kShopeePay: + return "ShopeePay"; + case PaymentLinkValidator::Scheme::kTngd: + return "Tngd"; + case PaymentLinkValidator::Scheme::kInvalid: + NOTREACHED(); + } + } }; -INSTANTIATE_TEST_SUITE_P(FacilitatedPaymentsMetricsTest, - FacilitatedPaymentsMetricsTestForUiScreens, - testing::Values(UiState::kFopSelector, - UiState::kProgressScreen, - UiState::kErrorScreen)); +INSTANTIATE_TEST_SUITE_P( + FacilitatedPaymentsMetricsTest, + FacilitatedPaymentsMetricsTestForUiScreens, + testing::Combine(testing::Values(FacilitatedPaymentsType::kEwallet, + FacilitatedPaymentsType::kPix), + testing::Values(PaymentLinkValidator::Scheme::kDuitNow, + PaymentLinkValidator::Scheme::kShopeePay, + PaymentLinkValidator::Scheme::kTngd), + testing::Values(UiState::kFopSelector, + UiState::kProgressScreen, + UiState::kErrorScreen))); TEST_P(FacilitatedPaymentsMetricsTestForUiScreens, LogUiScreenShown) { base::HistogramTester histogram_tester; - LogUiScreenShown(ui_screen()); + LogUiScreenShown(payment_type(), ui_screen(), scheme()); - histogram_tester.ExpectUniqueSample("FacilitatedPayments.Pix.UiScreenShown", - /*sample=*/ui_screen(), - /*expected_bucket_count=*/1); + histogram_tester.ExpectUniqueSample( + base::StrCat({"FacilitatedPayments.", GetFacilitatedPaymentsTypeString(), + ".UiScreenShown"}), + /*sample=*/ui_screen(), + /*expected_bucket_count=*/1); + histogram_tester.ExpectUniqueSample( + base::StrCat({"FacilitatedPayments.", GetFacilitatedPaymentsTypeString(), + ".UiScreenShown.", GetSchemeString()}), + /*sample=*/ui_screen(), + /*expected_bucket_count=*/payment_type() == + FacilitatedPaymentsType::kEwallet + ? 1 + : 0); } } // namespace payments::facilitated
diff --git a/components/media_router/browser/android/flinging_controller_bridge.cc b/components/media_router/browser/android/flinging_controller_bridge.cc index 99b7104..5c92fc8 100644 --- a/components/media_router/browser/android/flinging_controller_bridge.cc +++ b/components/media_router/browser/android/flinging_controller_bridge.cc
@@ -98,8 +98,9 @@ JNIEnv* env, const base::android::JavaParamRef<jobject>& j_bridge, const base::android::JavaParamRef<jobject>& j_status) { - if (!observer_) + if (!observer_) { return; + } media::MediaStatus status;
diff --git a/components/media_router/browser/android/media_router_android.cc b/components/media_router/browser/android/media_router_android.cc index 457ccd8c..6dafe5c 100644 --- a/components/media_router/browser/android/media_router_android.cc +++ b/components/media_router/browser/android/media_router_android.cc
@@ -44,8 +44,9 @@ void MediaRouterAndroid::PresentationConnectionProxy::OnMessage( blink::mojom::PresentationConnectionMessagePtr message) { - if (message->is_message()) + if (message->is_message()) { media_router_android_->SendRouteMessage(route_id_, message->get_message()); + } } void MediaRouterAndroid::PresentationConnectionProxy::Terminate() { @@ -98,8 +99,9 @@ const MediaRoute* MediaRouterAndroid::FindRouteBySource( const MediaSource::Id& source_id) const { for (const auto& route : active_routes_) { - if (route.media_source().id() == source_id) + if (route.media_source().id() == source_id) { return &route; + } } return nullptr; } @@ -187,8 +189,9 @@ MediaSinksObserver* observer) { const std::string& source_id = observer->source()->id(); auto it = sinks_observers_.find(source_id); - if (it == sinks_observers_.end() || !it->second->HasObserver(observer)) + if (it == sinks_observers_.end() || !it->second->HasObserver(observer)) { return; + } // If we are removing the final observer for the source, then stop // observing sinks for it. @@ -207,8 +210,9 @@ void MediaRouterAndroid::UnregisterMediaRoutesObserver( MediaRoutesObserver* observer) { - if (!routes_observers_.HasObserver(observer)) + if (!routes_observers_.HasObserver(observer)) { return; + } routes_observers_.RemoveObserver(observer); } @@ -227,8 +231,9 @@ auto it = sinks_observers_.find(source_urn); if (it != sinks_observers_.end()) { // TODO(imcheng): Pass origins to OnSinksUpdated (crbug.com/594858). - for (auto& observer : *it->second) + for (auto& observer : *it->second) { observer.OnSinksUpdated(sinks, std::vector<url::Origin>()); + } } } @@ -237,8 +242,9 @@ int route_request_id, bool is_local) { MediaRouteRequest* request = route_requests_.Lookup(route_request_id); - if (!request) + if (!request) { return; + } MediaRoute route(route_id, request->media_source, sink_id, std::string(), is_local); @@ -254,8 +260,9 @@ route_requests_.Remove(route_request_id); active_routes_.push_back(route); - for (auto& observer : routes_observers_) + for (auto& observer : routes_observers_) { observer.OnRoutesUpdated(active_routes_); + } if (is_local) { MediaRouterMetrics::RecordCreateRouteResultCode( result->result_code(), mojom::MediaRouteProviderId::ANDROID_CAF); @@ -351,14 +358,16 @@ void MediaRouterAndroid::RemoveRoute(const MediaRoute::Id& route_id) { presentation_connections_.erase(route_id); - for (auto it = active_routes_.begin(); it != active_routes_.end(); ++it) + for (auto it = active_routes_.begin(); it != active_routes_.end(); ++it) { if (it->media_route_id() == route_id) { active_routes_.erase(it); break; } + } - for (auto& observer : routes_observers_) + for (auto& observer : routes_observers_) { observer.OnRoutesUpdated(active_routes_); + } } std::unique_ptr<media::FlingingController> @@ -378,8 +387,9 @@ std::optional<mojom::MediaRouteProviderId>)> callback) { MediaRouteRequest* request = route_requests_.Lookup(route_request_id); - if (!request) + if (!request) { return; + } // TODO: Provide a more specific result code. std::unique_ptr<RouteRequestResult> result = RouteRequestResult::FromError(
diff --git a/components/media_router/browser/android/media_router_android_bridge.cc b/components/media_router/browser/android/media_router_android_bridge.cc index 98c43b4..743ffb8a 100644 --- a/components/media_router/browser/android/media_router_android_bridge.cc +++ b/components/media_router/browser/android/media_router_android_bridge.cc
@@ -54,8 +54,9 @@ ScopedJavaLocalRef<jstring> jorigin = ConvertUTF8ToJavaString(env, origin.GetURL().spec()); base::android::ScopedJavaLocalRef<jobject> java_web_contents; - if (web_contents) + if (web_contents) { java_web_contents = web_contents->GetJavaWebContents(); + } Java_BrowserMediaRouter_createRoute(env, java_media_router_, jsource_id, jsink_id, jpresentation_id, jorigin, @@ -75,8 +76,9 @@ ScopedJavaLocalRef<jstring> jorigin = ConvertUTF8ToJavaString(env, origin.GetURL().spec()); base::android::ScopedJavaLocalRef<jobject> java_web_contents; - if (web_contents) + if (web_contents) { java_web_contents = web_contents->GetJavaWebContents(); + } Java_BrowserMediaRouter_joinRoute(env, java_media_router_, jsource_id, jpresentation_id, jorigin, @@ -137,8 +139,9 @@ flinging_controller.Reset(Java_BrowserMediaRouter_getFlingingControllerBridge( env, java_media_router_, jroute_id)); - if (flinging_controller.is_null()) + if (flinging_controller.is_null()) { return nullptr; + } return std::make_unique<FlingingControllerBridge>(flinging_controller); }
diff --git a/components/media_router/browser/android/media_router_android_unittest.cc b/components/media_router/browser/android/media_router_android_unittest.cc index b82ddfe..7500d0f 100644 --- a/components/media_router/browser/android/media_router_android_unittest.cc +++ b/components/media_router/browser/android/media_router_android_unittest.cc
@@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/media_router/browser/android/media_router_android.h" + #include <memory> #include "base/android/jni_android.h" #include "base/functional/callback_helpers.h" #include "base/memory/raw_ptr.h" #include "base/test/mock_callback.h" -#include "components/media_router/browser/android/media_router_android.h" #include "components/media_router/browser/android/media_router_android_bridge.h" #include "components/media_router/browser/test/test_helper.h" #include "content/public/browser/presentation_service_delegate.h"
diff --git a/components/media_router/browser/android/media_router_dialog_controller_android.cc b/components/media_router/browser/android/media_router_dialog_controller_android.cc index 3bebf04..3c628425 100644 --- a/components/media_router/browser/android/media_router_dialog_controller_android.cc +++ b/components/media_router/browser/android/media_router_dialog_controller_android.cc
@@ -41,8 +41,9 @@ const JavaParamRef<jstring>& jsource_id, const JavaParamRef<jstring>& jsink_id) { auto start_presentation_context = std::move(start_presentation_context_); - if (!start_presentation_context) + if (!start_presentation_context) { return; + } const auto& presentation_request = start_presentation_context->presentation_request(); @@ -53,8 +54,9 @@ // Verify that there was a request containing the source id the sink was // selected for. std::vector<MediaSource> sources; - for (const auto& url : presentation_request.presentation_urls) + for (const auto& url : presentation_request.presentation_urls) { sources.push_back(MediaSource::ForPresentationUrl(url)); + } bool is_source_from_request = false; for (const auto& source : sources) { if (source.id() == source_id) { @@ -104,8 +106,9 @@ JNIEnv* env, const JavaParamRef<jobject>& obj) { auto request = std::move(start_presentation_context_); - if (!request) + if (!request) { return; + } request->InvokeErrorCallback(blink::mojom::PresentationError( blink::mojom::PresentationErrorType::NO_AVAILABLE_SCREENS, @@ -114,8 +117,9 @@ void MediaRouterDialogControllerAndroid::CancelPresentationRequest() { auto request = std::move(start_presentation_context_); - if (!request) + if (!request) { return; + } request->InvokeErrorCallback(blink::mojom::PresentationError( blink::mojom::PresentationErrorType::PRESENTATION_REQUEST_CANCELLED, @@ -141,8 +145,9 @@ std::vector<MediaSource> sources; for (const auto& url : - start_presentation_context_->presentation_request().presentation_urls) + start_presentation_context_->presentation_request().presentation_urls) { sources.push_back(MediaSource::ForPresentationUrl(url)); + } // If it's a single route with the same source, show the controller dialog // instead of the device picker. @@ -156,8 +161,9 @@ for (const auto& source : sources) { const MediaSource::Id& source_id = source.id(); const MediaRoute* matching_route = router->FindRouteBySource(source_id); - if (!matching_route) + if (!matching_route) { continue; + } ScopedJavaLocalRef<jstring> jsource_id = base::android::ConvertUTF8ToJavaString(env, source_id); @@ -174,8 +180,9 @@ std::vector<std::u16string> source_ids; source_ids.reserve(sources.size()); - for (const auto& source : sources) + for (const auto& source : sources) { source_ids.push_back(base::UTF8ToUTF16(source.id())); + } ScopedJavaLocalRef<jobjectArray> jsource_ids = base::android::ToJavaArrayOfStrings(env, source_ids); Java_BrowserMediaRouterDialogController_openRouteChooserDialog(
diff --git a/components/media_router/browser/issue_manager_unittest.cc b/components/media_router/browser/issue_manager_unittest.cc index c24baf2f..6b485fc 100644 --- a/components/media_router/browser/issue_manager_unittest.cc +++ b/components/media_router/browser/issue_manager_unittest.cc
@@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/media_router/browser/issue_manager.h" + #include <string> #include "base/test/task_environment.h" -#include "components/media_router/browser/issue_manager.h" #include "components/media_router/browser/test/test_helper.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -27,8 +28,7 @@ class IssueManagerTest : public ::testing::Test { protected: IssueManagerTest() - : task_environment_(base::test::TaskEnvironment::TimeSource::MOCK_TIME) { - } + : task_environment_(base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} ~IssueManagerTest() override = default; content::BrowserTaskEnvironment task_environment_;
diff --git a/components/media_router/browser/issues_observer.cc b/components/media_router/browser/issues_observer.cc index b6895d0..3aa01605 100644 --- a/components/media_router/browser/issues_observer.cc +++ b/components/media_router/browser/issues_observer.cc
@@ -15,13 +15,15 @@ } IssuesObserver::~IssuesObserver() { - if (initialized_) + if (initialized_) { issue_manager_->UnregisterObserver(this); + } } void IssuesObserver::Init() { - if (initialized_) + if (initialized_) { return; + } issue_manager_->RegisterObserver(this); initialized_ = true;
diff --git a/components/media_router/browser/logger_impl.cc b/components/media_router/browser/logger_impl.cc index 68ac68442..f53f77c8 100644 --- a/components/media_router/browser/logger_impl.cc +++ b/components/media_router/browser/logger_impl.cc
@@ -116,8 +116,9 @@ TruncateMessage(message), log_util::TruncateId(sink_id), MediaSource(media_source).TruncateForLogging(kSourceMaxLength), log_util::TruncateId(session_id)); - if (entries_.size() > capacity_) + if (entries_.size() > capacity_) { entries_.pop_front(); + } } std::string LoggerImpl::GetLogsAsJson() const { @@ -133,8 +134,9 @@ base::Value LoggerImpl::GetLogsAsValue() const { base::Value::List entries_val; - for (const auto& entry : entries_) + for (const auto& entry : entries_) { entries_val.Append(AsValue(entry)); + } return base::Value(std::move(entries_val)); }
diff --git a/components/media_router/browser/media_router_base.cc b/components/media_router/browser/media_router_base.cc index e6c1cbd..d860d4c0 100644 --- a/components/media_router/browser/media_router_base.cc +++ b/components/media_router/browser/media_router_base.cc
@@ -50,8 +50,9 @@ DCHECK_NE(state, PresentationConnectionState::CLOSED); auto it = presentation_connection_state_callbacks_.find(route_id); - if (it == presentation_connection_state_callbacks_.end()) + if (it == presentation_connection_state_callbacks_.end()) { return; + } it->second->Notify(content::PresentationConnectionStateChangeInfo(state)); } @@ -63,8 +64,9 @@ DCHECK_CURRENTLY_ON(content::BrowserThread::UI); auto it = presentation_connection_state_callbacks_.find(route_id); - if (it == presentation_connection_state_callbacks_.end()) + if (it == presentation_connection_state_callbacks_.end()) { return; + } content::PresentationConnectionStateChangeInfo info( PresentationConnectionState::CLOSED);
diff --git a/components/media_router/browser/media_router_metrics.cc b/components/media_router/browser/media_router_metrics.cc index 2446a1b..aad58415 100644 --- a/components/media_router/browser/media_router_metrics.cc +++ b/components/media_router/browser/media_router_metrics.cc
@@ -51,21 +51,28 @@ } PresentationUrlType GetPresentationUrlType(const GURL& url) { - if (url.SchemeIs(kDialPresentationUrlScheme)) + if (url.SchemeIs(kDialPresentationUrlScheme)) { return PresentationUrlType::kDial; - if (url.SchemeIs(kCastPresentationUrlScheme)) + } + if (url.SchemeIs(kCastPresentationUrlScheme)) { return PresentationUrlType::kCast; - if (url.SchemeIs(kCastDialPresentationUrlScheme)) + } + if (url.SchemeIs(kCastDialPresentationUrlScheme)) { return PresentationUrlType::kCastDial; - if (url.SchemeIs(kRemotePlaybackPresentationUrlScheme)) + } + if (url.SchemeIs(kRemotePlaybackPresentationUrlScheme)) { return PresentationUrlType::kRemotePlayback; + } if (base::StartsWith(url.spec(), kLegacyCastPresentationUrlPrefix, - base::CompareCase::INSENSITIVE_ASCII)) + base::CompareCase::INSENSITIVE_ASCII)) { return PresentationUrlType::kCastLegacy; - if (url.SchemeIs(url::kHttpsScheme)) + } + if (url.SchemeIs(url::kHttpsScheme)) { return PresentationUrlType::kHttps; - if (url.SchemeIs(url::kHttpScheme)) + } + if (url.SchemeIs(url::kHttpScheme)) { return PresentationUrlType::kHttp; + } return PresentationUrlType::kOther; } @@ -128,8 +135,7 @@ // static void MediaRouterMetrics::RecordMediaRouterFileFormat( const media::container_names::MediaContainerName format) { - base::UmaHistogramEnumeration( - kHistogramMediaRouterFileFormat, format); + base::UmaHistogramEnumeration(kHistogramMediaRouterFileFormat, format); } // static
diff --git a/components/media_router/browser/media_sinks_observer.cc b/components/media_router/browser/media_sinks_observer.cc index cbb6ad4e..29f6ec9 100644 --- a/components/media_router/browser/media_sinks_observer.cc +++ b/components/media_router/browser/media_sinks_observer.cc
@@ -31,13 +31,15 @@ DCHECK(!in_on_sinks_updated_); #endif - if (initialized_) + if (initialized_) { router_->UnregisterMediaSinksObserver(this); + } } bool MediaSinksObserver::Init() { - if (initialized_) + if (initialized_) { return true; + } initialized_ = router_->RegisterMediaSinksObserver(this); return initialized_; @@ -50,10 +52,11 @@ base::AutoReset<bool> reset_in_on_sinks_updated(&in_on_sinks_updated_, true); #endif - if (origins.empty() || base::Contains(origins, origin_)) + if (origins.empty() || base::Contains(origins, origin_)) { OnSinksReceived(sinks); - else + } else { OnSinksReceived(std::vector<MediaSink>()); + } } } // namespace media_router
diff --git a/components/media_router/browser/presentation/local_presentation_manager.cc b/components/media_router/browser/presentation/local_presentation_manager.cc index 22328ac..3738d17 100644 --- a/components/media_router/browser/presentation/local_presentation_manager.cc +++ b/components/media_router/browser/presentation/local_presentation_manager.cc
@@ -56,8 +56,9 @@ const content::GlobalRenderFrameHostId& render_frame_host_id) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); auto it = local_presentations_.find(presentation_id); - if (it == local_presentations_.end()) + if (it == local_presentations_.end()) { return; + } // Remove presentation if no controller and receiver. it->second->UnregisterController(render_frame_host_id); @@ -89,8 +90,9 @@ bool LocalPresentationManager::IsLocalPresentation( content::WebContents* web_contents) { for (auto& local_presentation : local_presentations_) { - if (local_presentation.second->receiver_web_contents_ == web_contents) + if (local_presentation.second->receiver_web_contents_ == web_contents) { return true; + } } return false; }
diff --git a/components/media_router/browser/presentation/local_presentation_manager_unittest.cc b/components/media_router/browser/presentation/local_presentation_manager_unittest.cc index 96882e6..f744cbf 100644 --- a/components/media_router/browser/presentation/local_presentation_manager_unittest.cc +++ b/components/media_router/browser/presentation/local_presentation_manager_unittest.cc
@@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/media_router/browser/presentation/local_presentation_manager.h" + #include <utility> #include "base/containers/contains.h" #include "base/functional/bind.h" -#include "components/media_router/browser/presentation/local_presentation_manager.h" #include "components/media_router/browser/test/test_helper.h" #include "content/public/test/test_renderer_host.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
diff --git a/components/media_router/browser/presentation/presentation_media_sinks_observer.cc b/components/media_router/browser/presentation/presentation_media_sinks_observer.cc index 555d65b..3269a505 100644 --- a/components/media_router/browser/presentation/presentation_media_sinks_observer.cc +++ b/components/media_router/browser/presentation/presentation_media_sinks_observer.cc
@@ -30,8 +30,9 @@ result.empty() ? blink::mojom::ScreenAvailability::UNAVAILABLE : blink::mojom::ScreenAvailability::AVAILABLE; // Don't send if new result is same as previous. - if (previous_availability_ == current_availability) + if (previous_availability_ == current_availability) { return; + } listener_->OnScreenAvailabilityChanged(current_availability); previous_availability_ = current_availability;
diff --git a/components/media_router/browser/presentation/presentation_service_delegate_observers.cc b/components/media_router/browser/presentation/presentation_service_delegate_observers.cc index 2578c002..be04e8d 100644 --- a/components/media_router/browser/presentation/presentation_service_delegate_observers.cc +++ b/components/media_router/browser/presentation/presentation_service_delegate_observers.cc
@@ -12,8 +12,9 @@ default; PresentationServiceDelegateObservers::~PresentationServiceDelegateObservers() { - for (auto& observer_pair : observers_) + for (auto& observer_pair : observers_) { observer_pair.second->OnDelegateDestroyed(); + } } void PresentationServiceDelegateObservers::AddObserver(
diff --git a/components/media_router/browser/presentation/receiver_presentation_service_delegate_impl.cc b/components/media_router/browser/presentation/receiver_presentation_service_delegate_impl.cc index ac472a84..22e96a6 100644 --- a/components/media_router/browser/presentation/receiver_presentation_service_delegate_impl.cc +++ b/components/media_router/browser/presentation/receiver_presentation_service_delegate_impl.cc
@@ -21,8 +21,9 @@ const std::string& presentation_id) { DCHECK(web_contents); - if (FromWebContents(web_contents)) + if (FromWebContents(web_contents)) { return; + } web_contents->SetUserData( UserDataKey(),
diff --git a/components/media_router/browser/presentation/web_contents_presentation_manager.cc b/components/media_router/browser/presentation/web_contents_presentation_manager.cc index 760a79fc..ba8c724 100644 --- a/components/media_router/browser/presentation/web_contents_presentation_manager.cc +++ b/components/media_router/browser/presentation/web_contents_presentation_manager.cc
@@ -15,8 +15,9 @@ // static base::WeakPtr<WebContentsPresentationManager> WebContentsPresentationManager::Get(content::WebContents* web_contents) { - if (g_test_instance) + if (g_test_instance) { return g_test_instance->GetWeakPtr(); + } return ControllerPresentationServiceDelegateImpl::GetOrCreateForWebContents( web_contents)
diff --git a/components/media_router/common/discovery/media_sink_internal.cc b/components/media_router/common/discovery/media_sink_internal.cc index 512f369..490b60b 100644 --- a/components/media_router/common/discovery/media_sink_internal.cc +++ b/components/media_router/common/discovery/media_sink_internal.cc
@@ -53,11 +53,13 @@ } bool MediaSinkInternal::operator==(const MediaSinkInternal& other) const { - if (sink_type_ != other.sink_type_) + if (sink_type_ != other.sink_type_) { return false; + } - if (sink_ != other.sink_) + if (sink_ != other.sink_) { return false; + } switch (sink_type_) { case SinkType::DIAL: @@ -126,12 +128,14 @@ // static std::string MediaSinkInternal::ProcessDeviceUUID( const std::string& device_uuid) { - if (device_uuid.empty()) + if (device_uuid.empty()) { return std::string(); + } std::string result = device_uuid; - if (base::StartsWith(device_uuid, "uuid:", base::CompareCase::SENSITIVE)) + if (base::StartsWith(device_uuid, "uuid:", base::CompareCase::SENSITIVE)) { result = device_uuid.substr(5); + } base::RemoveChars(result, "-", &result); return base::ToLowerASCII(result);
diff --git a/components/media_router/common/discovery/media_sink_service_base.cc b/components/media_router/common/discovery/media_sink_service_base.cc index ff5595a0..739f5da 100644 --- a/components/media_router/common/discovery/media_sink_service_base.cc +++ b/components/media_router/common/discovery/media_sink_service_base.cc
@@ -3,13 +3,14 @@ // found in the LICENSE file. #include "components/media_router/common/discovery/media_sink_service_base.h" + +#include <vector> + #include "base/functional/bind.h" #include "base/logging.h" #include "base/observer_list.h" #include "components/media_router/common/media_route.h" -#include <vector> - namespace { // Timeout amount for |discovery_timer_|. const constexpr base::TimeDelta kDiscoveryTimeout = base::Seconds(3); @@ -59,8 +60,9 @@ void MediaSinkServiceBase::AddOrUpdateSink(const MediaSinkInternal& sink) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); sinks_.insert_or_assign(sink.sink().id(), sink); - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnSinkAddedOrUpdated(sink); + } StartTimer(); } @@ -73,13 +75,15 @@ void MediaSinkServiceBase::RemoveSinkById(const MediaSink::Id& sink_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto it = sinks_.find(sink_id); - if (it == sinks_.end()) + if (it == sinks_.end()) { return; + } MediaSinkInternal sink = std::move(it->second); sinks_.erase(it); - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnSinkRemoved(sink); + } StartTimer(); } @@ -95,8 +99,9 @@ void MediaSinkServiceBase::StartTimer() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (discovery_timer_->IsRunning()) + if (discovery_timer_->IsRunning()) { return; + } discovery_timer_->Start( FROM_HERE, kDiscoveryTimeout, @@ -118,11 +123,13 @@ DVLOG(2) << "Send sinks to media router, [size]: " << sinks_.size(); std::vector<MediaSinkInternal> sinks; - for (const auto& sink_it : sinks_) + for (const auto& sink_it : sinks_) { sinks.push_back(sink_it.second); + } - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnSinksDiscovered(sinks); + } on_sinks_discovered_cb_.Run(std::move(sinks)); previous_sinks_ = sinks_; }
diff --git a/components/media_router/common/discovery/media_sink_service_base_unittest.cc b/components/media_router/common/discovery/media_sink_service_base_unittest.cc index 72ef9cf..9c77f1b 100644 --- a/components/media_router/common/discovery/media_sink_service_base_unittest.cc +++ b/components/media_router/common/discovery/media_sink_service_base_unittest.cc
@@ -57,13 +57,15 @@ void PopulateSinks(const std::vector<MediaSinkInternal>& old_sinks, const std::vector<MediaSinkInternal>& new_sinks) { media_sink_service_.previous_sinks_.clear(); - for (const auto& old_sink : old_sinks) + for (const auto& old_sink : old_sinks) { media_sink_service_.previous_sinks_.emplace(old_sink.sink().id(), old_sink); + } media_sink_service_.sinks_.clear(); - for (const auto& new_sink : new_sinks) + for (const auto& new_sink : new_sinks) { media_sink_service_.sinks_.emplace(new_sink.sink().id(), new_sink); + } } void TestOnDiscoveryComplete(
diff --git a/components/media_router/common/media_route.cc b/components/media_router/common/media_route.cc index 1d9c26e2e..8018b6bb 100644 --- a/components/media_router/common/media_route.cc +++ b/components/media_router/common/media_route.cc
@@ -17,8 +17,10 @@ namespace { bool IsValidMediaRouteId(const MediaRoute::Id route_id) { - if (!base::StartsWith(route_id, kRouteIdPrefix, base::CompareCase::SENSITIVE)) + if (!base::StartsWith(route_id, kRouteIdPrefix, + base::CompareCase::SENSITIVE)) { return false; + } // return false if there are not at least two slashes in |route_id|. size_t pos; return ((pos = route_id.find("/")) != std::string::npos &&
diff --git a/components/media_router/common/media_sink.cc b/components/media_router/common/media_sink.cc index 49505967..ba85a77 100644 --- a/components/media_router/common/media_sink.cc +++ b/components/media_router/common/media_sink.cc
@@ -38,22 +38,25 @@ bool MediaSink::CompareUsingCollator(const MediaSink& other, const icu::Collator* collator) const { - if (icon_type_ != other.icon_type_) + if (icon_type_ != other.icon_type_) { return icon_type_ < other.icon_type_; + } if (collator) { std::u16string this_name = base::UTF8ToUTF16(name_); std::u16string other_name = base::UTF8ToUTF16(other.name_); UCollationResult result = base::i18n::CompareString16WithCollator( *collator, this_name, other_name); - if (result != UCOL_EQUAL) + if (result != UCOL_EQUAL) { return result == UCOL_LESS; + } } else { // Fall back to simple string comparison if collator is not // available. int val = name_.compare(other.name_); - if (val) + if (val) { return val < 0; + } } return sink_id_ < other.sink_id_;
diff --git a/components/media_router/common/media_source.cc b/components/media_router/common/media_source.cc index eea5e654..c2a68a9 100644 --- a/components/media_router/common/media_source.cc +++ b/components/media_router/common/media_source.cc
@@ -88,8 +88,9 @@ MediaSource::MediaSource(const MediaSource::Id& source_id) : id_(source_id) { GURL url(source_id); - if (IsValidPresentationUrl(url)) + if (IsValidPresentationUrl(url)) { url_ = url; + } } MediaSource::MediaSource(const GURL& presentation_url)
diff --git a/components/media_router/common/mojom/media_router_mojom_traits.cc b/components/media_router/common/mojom/media_router_mojom_traits.cc index 8948357..a4ddd75 100644 --- a/components/media_router/common/mojom/media_router_mojom_traits.cc +++ b/components/media_router/common/mojom/media_router_mojom_traits.cc
@@ -17,23 +17,28 @@ bool StructTraits<media_router::mojom::IssueDataView, media_router::IssueInfo>:: Read(media_router::mojom::IssueDataView data, media_router::IssueInfo* out) { - if (!data.ReadTitle(&out->title)) + if (!data.ReadTitle(&out->title)) { return false; + } - if (!data.ReadSeverity(&out->severity)) + if (!data.ReadSeverity(&out->severity)) { return false; + } std::optional<std::string> message; - if (!data.ReadMessage(&message)) + if (!data.ReadMessage(&message)) { return false; + } out->message = message.value_or(std::string()); - if (!data.ReadRouteId(&out->route_id)) + if (!data.ReadRouteId(&out->route_id)) { return false; + } - if (!data.ReadSinkId(&out->sink_id)) + if (!data.ReadSinkId(&out->sink_id)) { return false; + } return true; } @@ -65,25 +70,29 @@ out->sink().set_sink_id(id); std::string name; - if (!data.ReadName(&name)) + if (!data.ReadName(&name)) { return false; + } out->sink().set_name(name); media_router::SinkIconType icon_type; - if (!data.ReadIconType(&icon_type)) + if (!data.ReadIconType(&icon_type)) { return false; + } out->sink().set_icon_type(icon_type); media_router::mojom::MediaRouteProviderId provider_id; - if (!data.ReadProviderId(&provider_id)) + if (!data.ReadProviderId(&provider_id)) { return false; + } out->sink().set_provider_id(provider_id); - if (!data.ReadExtraData(out)) + if (!data.ReadExtraData(out)) { return false; + } return true; } @@ -96,15 +105,17 @@ switch (data.tag()) { case media_router::mojom::MediaSinkExtraDataDataView::Tag::kDialMediaSink: { media_router::DialSinkExtraData extra_data; - if (!data.ReadDialMediaSink(&extra_data)) + if (!data.ReadDialMediaSink(&extra_data)) { return false; + } out->set_dial_data(extra_data); return true; } case media_router::mojom::MediaSinkExtraDataDataView::Tag::kCastMediaSink: { media_router::CastSinkExtraData extra_data; - if (!data.ReadCastMediaSink(&extra_data)) + if (!data.ReadCastMediaSink(&extra_data)) { return false; + } out->set_cast_data(extra_data); return true; } @@ -117,14 +128,17 @@ media_router::DialSinkExtraData>:: Read(media_router::mojom::DialMediaSinkDataView data, media_router::DialSinkExtraData* out) { - if (!data.ReadIpAddress(&out->ip_address)) + if (!data.ReadIpAddress(&out->ip_address)) { return false; + } - if (!data.ReadModelName(&out->model_name)) + if (!data.ReadModelName(&out->model_name)) { return false; + } - if (!data.ReadAppUrl(&out->app_url)) + if (!data.ReadAppUrl(&out->app_url)) { return false; + } return true; } @@ -134,11 +148,13 @@ media_router::CastSinkExtraData>:: Read(media_router::mojom::CastMediaSinkDataView data, media_router::CastSinkExtraData* out) { - if (!data.ReadIpEndpoint(&out->ip_endpoint)) + if (!data.ReadIpEndpoint(&out->ip_endpoint)) { return false; + } - if (!data.ReadModelName(&out->model_name)) + if (!data.ReadModelName(&out->model_name)) { return false; + } out->capabilities = cast_channel::CastDeviceCapabilitySet::FromEnumBitmask( data.capabilities()); @@ -153,39 +169,47 @@ Read(media_router::mojom::MediaRouteDataView data, media_router::MediaRoute* out) { media_router::MediaRoute::Id media_route_id; - if (!data.ReadMediaRouteId(&media_route_id)) + if (!data.ReadMediaRouteId(&media_route_id)) { return false; + } out->set_media_route_id(media_route_id); std::string presentation_id; - if (!data.ReadPresentationId(&presentation_id)) + if (!data.ReadPresentationId(&presentation_id)) { return false; + } out->set_presentation_id(presentation_id); std::optional<media_router::MediaSource::Id> media_source_id; - if (!data.ReadMediaSource(&media_source_id)) + if (!data.ReadMediaSource(&media_source_id)) { return false; - if (media_source_id) + } + if (media_source_id) { out->set_media_source(media_router::MediaSource(*media_source_id)); + } media_router::MediaSink::Id media_sink_id; - if (!data.ReadMediaSinkId(&media_sink_id)) + if (!data.ReadMediaSinkId(&media_sink_id)) { return false; + } out->set_media_sink_id(media_sink_id); std::string media_sink_name; - if (!data.ReadMediaSinkName(&media_sink_name)) + if (!data.ReadMediaSinkName(&media_sink_name)) { return false; + } out->set_media_sink_name(media_sink_name); std::string description; - if (!data.ReadDescription(&description)) + if (!data.ReadDescription(&description)) { return false; + } out->set_description(description); media_router::RouteControllerType controller_type; - if (!data.ReadControllerType(&controller_type)) + if (!data.ReadControllerType(&controller_type)) { return false; + } out->set_controller_type(controller_type); out->set_local(data.is_local());
diff --git a/components/media_router/common/providers/cast/cast_media_source.cc b/components/media_router/common/providers/cast/cast_media_source.cc index 087f117..614956be 100644 --- a/components/media_router/common/providers/cast/cast_media_source.cc +++ b/components/media_router/common/providers/cast/cast_media_source.cc
@@ -117,8 +117,9 @@ const Map& map, const typename Map::key_type& key) { auto it = map.find(key); - if (it == map.end()) + if (it == map.end()) { return nullptr; + } return &it->second; } @@ -127,8 +128,9 @@ auto FindValue(const Map& map, const Key& key) -> const decltype(begin(map)->second)* { for (const auto& item : map) { - if (item.first == key) + if (item.first == key) { return &item.second; + } } return nullptr; } @@ -231,8 +233,9 @@ const std::vector<ReceiverAppType>& supported_app_types, const std::string& app_params, const std::string& invisible_sender) { - if (app_infos.empty()) + if (app_infos.empty()) { return nullptr; + } auto cast_source = std::make_unique<CastMediaSource>( source_id, app_infos, @@ -256,11 +259,13 @@ base::Milliseconds(target_playout_delay_millis)); } - if (audio_capture_str == "0") + if (audio_capture_str == "0") { cast_source->set_site_requested_audio_capture(false); + } - if (!supported_app_types.empty()) + if (!supported_app_types.empty()) { cast_source->set_supported_app_types(supported_app_types); + } cast_source->set_app_params(app_params); if (invisible_sender == "true") { @@ -275,8 +280,9 @@ const GURL& url) { std::string app_id = url.path(); // App ID must be non-empty. - if (app_id.empty()) + if (app_id.empty()) { return nullptr; + } auto params{MakeQueryMap(url)}; return CreateFromURLParams( @@ -310,8 +316,9 @@ // Legacy URLs can specify multiple apps. std::vector<std::string> app_id_params; for (const auto& param : params) { - if (param.first == "__castAppId__") + if (param.first == "__castAppId__") { app_id_params.push_back(param.second); + } } std::vector<CastAppInfo> app_infos; @@ -330,8 +337,9 @@ } } - if (app_id.empty()) + if (app_id.empty()) { continue; + } CastAppInfo app_info(app_id, CastDeviceCapabilitiesFromString(capabilities)); @@ -339,8 +347,9 @@ app_infos.push_back(app_info); } - if (app_infos.empty()) + if (app_infos.empty()) { return nullptr; + } return CreateFromURLParams( source_id, app_infos, FindValueOr(params, "__castAutoJoinPolicy__", ""), @@ -405,19 +414,23 @@ // static std::unique_ptr<CastMediaSource> CastMediaSource::FromMediaSource( const MediaSource& source) { - if (source.IsTabMirroringSource()) + if (source.IsTabMirroringSource()) { return CastMediaSourceForTabMirroring(source.id()); + } - if (source.IsDesktopMirroringSource()) + if (source.IsDesktopMirroringSource()) { return CastMediaSourceForDesktopMirroring(source); + } - if (source.IsRemotePlaybackSource()) + if (source.IsRemotePlaybackSource()) { return CastMediaSourceForRemotePlayback(source); + } const GURL& url = source.url(); - if (!url.is_valid() || url.spec().length() > kMaxCastPresentationUrlLength) + if (!url.is_valid() || url.spec().length() > kMaxCastPresentationUrlLength) { return nullptr; + } if (url.SchemeIs(kCastPresentationUrlScheme)) { return ParseCastUrl(source.id(), url); } else if (IsLegacyCastPresentationUrl(url)) { @@ -461,8 +474,9 @@ bool CastMediaSource::ContainsApp(const std::string& app_id) const { for (const auto& info : app_infos_) { - if (info.app_id == app_id) + if (info.app_id == app_id) { return true; + } } return false; } @@ -480,8 +494,9 @@ std::vector<std::string> CastMediaSource::GetAppIds() const { std::vector<std::string> app_ids; - for (const auto& info : app_infos_) + for (const auto& info : app_infos_) { app_ids.push_back(info.app_id); + } return app_ids; }
diff --git a/components/media_router/common/providers/cast/certificate/cast_cert_reader.cc b/components/media_router/common/providers/cast/certificate/cast_cert_reader.cc index 3b11495d..808e86a 100644 --- a/components/media_router/common/providers/cast/certificate/cast_cert_reader.cc +++ b/components/media_router/common/providers/cast/certificate/cast_cert_reader.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "components/media_router/common/providers/cast/certificate/cast_cert_reader.h" + #include "base/files/file_util.h" #include "base/logging.h" #include "base/path_service.h" @@ -48,8 +49,9 @@ std::vector<std::string> ReadCertificateChainFromString(const char* str) { std::vector<std::string> certs; bssl::PEMTokenizer pem_tokenizer(str, {"CERTIFICATE"}); - while (pem_tokenizer.GetNext()) + while (pem_tokenizer.GetNext()) { certs.push_back(pem_tokenizer.data()); + } if (certs.empty()) { LOG(WARNING) << "Certificate chain is empty.";
diff --git a/components/media_router/common/providers/cast/certificate/cast_cert_validator.cc b/components/media_router/common/providers/cast/certificate/cast_cert_validator.cc index 71de051..d17f58c 100644 --- a/components/media_router/common/providers/cast/certificate/cast_cert_validator.cc +++ b/components/media_router/common/providers/cast/certificate/cast_cert_validator.cc
@@ -171,8 +171,9 @@ const bssl::ParsedCertificate* cert, std::unique_ptr<CertVerificationContext>* context) { // Get the Key Usage extension. - if (!cert->has_key_usage()) + if (!cert->has_key_usage()) { return false; + } // Ensure Key Usage contains digitalSignature. if (!cert->key_usage().AssertsBit(bssl::KEY_USAGE_BIT_DIGITAL_SIGNATURE)) { @@ -181,15 +182,17 @@ // Get the Common Name for the certificate. std::string common_name; - if (!GetCommonNameFromSubject(cert->tbs().subject_tlv, &common_name)) + if (!GetCommonNameFromSubject(cert->tbs().subject_tlv, &common_name)) { return false; + } // Get the public key for the certificate. CBS spki; CBS_init(&spki, cert->tbs().spki_tlv.data(), cert->tbs().spki_tlv.size()); bssl::UniquePtr<EVP_PKEY> key(EVP_parse_public_key(&spki)); - if (!key || CBS_len(&spki) != 0) + if (!key || CBS_len(&spki) != 0) { return false; + } *context = std::make_unique<CertVerificationContextImpl>(std::move(key), common_name); @@ -216,8 +219,9 @@ // This function must only be called if path building failed. CastCertError MapToCastError(const bssl::CertPathBuilder::Result& result) { DCHECK(!result.HasValidPath()); - if (result.paths.empty()) + if (result.paths.empty()) { return CastCertError::ERR_CERTS_VERIFY_GENERIC; + } const bssl::CertPathErrors& path_errors = result.paths.at(result.best_result_index)->errors; if (path_errors.ContainsError(bssl::cert_errors::kValidityFailedNotAfter) || @@ -268,16 +272,19 @@ << CastCertificateChainAsPEM(certs); } - if (!trust_store) + if (!trust_store) { return VerifyDeviceCert(certs, time, context, policy, crl, fallback_crl, crl_policy); + } - if (certs.empty()) + if (certs.empty()) { return CastCertError::ERR_CERTS_MISSING; + } // Fail early if CRL is required but not provided. - if (!crl && crl_policy == CRLPolicy::CRL_REQUIRED) + if (!crl && crl_policy == CRLPolicy::CRL_REQUIRED) { return CastCertError::ERR_CRL_INVALID; + } bssl::CertErrors errors; std::shared_ptr<const bssl::ParsedCertificate> target_cert; @@ -287,13 +294,15 @@ bssl::ParsedCertificate::Create( net::x509_util::CreateCryptoBuffer(certs[i]), GetCertParsingOptions(), &errors)); - if (!cert) + if (!cert) { return CastCertError::ERR_CERTS_PARSE; + } - if (i == 0) + if (i == 0) { target_cert = std::move(cert); - else + } else { intermediate_cert_issuer_source.AddCert(std::move(cert)); + } } CastPathBuilderDelegate path_builder_delegate; @@ -312,8 +321,9 @@ bssl::InitialAnyPolicyInhibit::kFalse); path_builder.AddCertIssuerSource(&intermediate_cert_issuer_source); bssl::CertPathBuilder::Result result = path_builder.Run(); - if (!result.HasValidPath()) + if (!result.HasValidPath()) { return MapToCastError(result); + } // Determine whether this device certificate is restricted to audio-only. DetermineDeviceCertificatePolicy(result.GetBestValidPath(), policy); @@ -321,8 +331,9 @@ // Check properties of the leaf certificate not already verified by path // building (key usage), and construct a CertVerificationContext that uses // its public key. - if (!CheckTargetCertificate(target_cert.get(), context)) + if (!CheckTargetCertificate(target_cert.get(), context)) { return CastCertError::ERR_CERTS_RESTRICTIONS; + } if (!crl && (crl_policy == CRLPolicy::CRL_REQUIRED_WITH_FALLBACK || crl_policy == CRLPolicy::CRL_OPTIONAL_WITH_FALLBACK)) {
diff --git a/components/media_router/common/providers/cast/certificate/cast_cert_validator_unittest.cc b/components/media_router/common/providers/cast/certificate/cast_cert_validator_unittest.cc index 516b125a..eb0b03eb 100644 --- a/components/media_router/common/providers/cast/certificate/cast_cert_validator_unittest.cc +++ b/components/media_router/common/providers/cast/certificate/cast_cert_validator_unittest.cc
@@ -138,8 +138,9 @@ trust_store.get()); ASSERT_EQ(expected_result, result); - if (expected_result != CastCertError::OK) + if (expected_result != CastCertError::OK) { return; + } EXPECT_EQ(expected_policy, policy); ASSERT_TRUE(context.get());
diff --git a/components/media_router/common/providers/cast/certificate/cast_crl.cc b/components/media_router/common/providers/cast/certificate/cast_crl.cc index ac6a019..c0571995 100644 --- a/components/media_router/common/providers/cast/certificate/cast_crl.cc +++ b/components/media_router/common/providers/cast/certificate/cast_crl.cc
@@ -9,11 +9,10 @@ #include "components/media_router/common/providers/cast/certificate/cast_crl.h" +#include <memory> #include <unordered_map> #include <unordered_set> -#include <memory> - #include "base/build_time.h" #include "base/containers/span.h" #include "base/logging.h" @@ -314,8 +313,9 @@ // means that these calls were successful. ConvertTimeSeconds(tbs_crl.not_before_seconds(), ¬_before_); ConvertTimeSeconds(tbs_crl.not_after_seconds(), ¬_after_); - if (overall_not_after < not_after_) + if (overall_not_after < not_after_) { not_after_ = overall_not_after; + } // Parse the revoked hashes. for (const auto& hash : tbs_crl.revoked_public_key_hashes()) { @@ -348,8 +348,9 @@ bool CastCRLImpl::CheckRevocation( const bssl::ParsedCertificateList& trusted_chain, const base::Time& time) const { - if (trusted_chain.empty()) + if (trusted_chain.empty()) { return false; + } // Check the validity of the CRL at the specified time. bssl::der::GeneralizedTime verification_time; @@ -418,8 +419,9 @@ const base::Time& time, bssl::TrustStore* trust_store, const bool is_fallback_crl) { - if (!trust_store) + if (!trust_store) { return ParseAndVerifyCRL(crl_proto, time, is_fallback_crl); + } CrlBundle crl_bundle; if (!crl_bundle.ParseFromString(crl_proto)) {
diff --git a/components/media_router/common/providers/cast/certificate/cast_crl_unittest.cc b/components/media_router/common/providers/cast/certificate/cast_crl_unittest.cc index 0f6be22..36a59ad 100644 --- a/components/media_router/common/providers/cast/certificate/cast_crl_unittest.cc +++ b/components/media_router/common/providers/cast/certificate/cast_crl_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "components/media_router/common/providers/cast/certificate/cast_crl.h" + #include "base/files/file_util.h" #include "base/logging.h" #include "base/time/time.h" @@ -115,8 +116,9 @@ uint64_t crl_verify_time = test_case.crl_verification_time_seconds(); base::Time crl_verification_time = testing::ConvertUnixTimestampSeconds(crl_verify_time); - if (crl_verify_time == 0) + if (crl_verify_time == 0) { crl_verification_time = cert_verification_time; + } std::string crl_bundle = test_case.crl_bundle(); switch (test_case.expected_result()) {
diff --git a/components/media_router/common/providers/cast/channel/cast_auth_util.cc b/components/media_router/common/providers/cast/channel/cast_auth_util.cc index cbbfd8a..3945cbf 100644 --- a/components/media_router/common/providers/cast/channel/cast_auth_util.cc +++ b/components/media_router/common/providers/cast/channel/cast_auth_util.cc
@@ -453,8 +453,9 @@ // Handle and report errors. AuthResult result = MapToAuthResult(verify_result, crl_policy); result.CopyFlagsFrom(parse_result); - if (!result.success()) + if (!result.success()) { return result; + } // The certificate is verified at this point. RecordCertificateStatus(CastCertificateStatus::kOk); @@ -470,8 +471,9 @@ AuthResult digest_result = VerifyAndMapDigestAlgorithm(response.hash_algorithm(), &digest_algorithm); digest_result.CopyFlagsFrom(result); - if (!digest_result.success()) + if (!digest_result.success()) { return digest_result; + } if (!verification_context->VerifySignatureOverData( response.signature(), signature_input, digest_algorithm)) {
diff --git a/components/media_router/common/providers/cast/channel/cast_auth_util_fuzzer.cc b/components/media_router/common/providers/cast/channel/cast_auth_util_fuzzer.cc index 23fb177..c06c5d85 100644 --- a/components/media_router/common/providers/cast/channel/cast_auth_util_fuzzer.cc +++ b/components/media_router/common/providers/cast/channel/cast_auth_util_fuzzer.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/media_router/common/providers/cast/channel/cast_auth_util.h" + #include <cstdlib> #include <iostream> #include <string> @@ -12,7 +14,6 @@ #include "base/time/time_override.h" #include "components/media_router/common/providers/cast/certificate/cast_cert_reader.h" #include "components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.h" -#include "components/media_router/common/providers/cast/channel/cast_auth_util.h" #include "components/media_router/common/providers/cast/channel/cast_auth_util_fuzzer_shared.h" #include "components/media_router/common/providers/cast/channel/fuzz_proto/fuzzer_inputs.pb.h" // Generated by the "cast_auth_util_fuzzer_certs" data_headers target.
diff --git a/components/media_router/common/providers/cast/channel/cast_auth_util_fuzzer_shared.h b/components/media_router/common/providers/cast/channel/cast_auth_util_fuzzer_shared.h index b65d0f8..1c39f573 100644 --- a/components/media_router/common/providers/cast/channel/cast_auth_util_fuzzer_shared.h +++ b/components/media_router/common/providers/cast/channel/cast_auth_util_fuzzer_shared.h
@@ -7,6 +7,7 @@ #include <string> #include <vector> + #include "components/media_router/common/providers/cast/channel/fuzz_proto/fuzzer_inputs.pb.h" namespace cast_channel {
diff --git a/components/media_router/common/providers/cast/channel/cast_auth_util_unittest.cc b/components/media_router/common/providers/cast/channel/cast_auth_util_unittest.cc index 1a775e85..e7d717d8 100644 --- a/components/media_router/common/providers/cast/channel/cast_auth_util_unittest.cc +++ b/components/media_router/common/providers/cast/channel/cast_auth_util_unittest.cc
@@ -69,8 +69,9 @@ AuthResponse response; response.set_client_auth_certificate(chain[0]); - for (size_t i = 1; i < chain.size(); ++i) + for (size_t i = 1; i < chain.size(); ++i) { response.add_intermediate_certificate(chain[i]); + } response.set_hash_algorithm(digest_algorithm); switch (digest_algorithm) { @@ -440,16 +441,18 @@ if (certificate_chain.size() > 0) { response.set_client_auth_certificate(certificate_chain[0]); - for (size_t i = 1; i < certificate_chain.size(); ++i) + for (size_t i = 1; i < certificate_chain.size(); ++i) { response.add_intermediate_certificate(certificate_chain[i]); + } } response.set_crl(crl_bundle); cast_certificate::CRLPolicy crl_policy = cast_certificate::CRLPolicy::CRL_REQUIRED; - if (!crl_required && crl_bundle.empty()) + if (!crl_required && crl_bundle.empty()) { crl_policy = cast_certificate::CRLPolicy::CRL_OPTIONAL; + } AuthResult result = VerifyCredentialsForTest( response, "", crl_policy, crl_trust_store, verification_time); // This test doesn't set the signature so it will just fail there.
diff --git a/components/media_router/common/providers/cast/channel/cast_framer_ingest_fuzzer.cc b/components/media_router/common/providers/cast/channel/cast_framer_ingest_fuzzer.cc index 0fa5235..2e00e093 100644 --- a/components/media_router/common/providers/cast/channel/cast_framer_ingest_fuzzer.cc +++ b/components/media_router/common/providers/cast/channel/cast_framer_ingest_fuzzer.cc
@@ -24,8 +24,9 @@ namespace cast_channel { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - if (size > MessageFramer::MessageHeader::max_message_size()) + if (size > MessageFramer::MessageHeader::max_message_size()) { return 0; + } scoped_refptr<net::GrowableIOBuffer> buffer = base::MakeRefCounted<net::GrowableIOBuffer>();
diff --git a/components/media_router/common/providers/cast/channel/cast_framer_serialize_fuzzer.cc b/components/media_router/common/providers/cast/channel/cast_framer_serialize_fuzzer.cc index 0a515049..6056b0a 100644 --- a/components/media_router/common/providers/cast/channel/cast_framer_serialize_fuzzer.cc +++ b/components/media_router/common/providers/cast/channel/cast_framer_serialize_fuzzer.cc
@@ -16,8 +16,9 @@ DEFINE_PROTO_FUZZER(const openscreen::cast::proto::CastMessage& input) { std::string native_input; MessageFramer::Serialize(input, &native_input); - if (::getenv("LPM_DUMP_NATIVE_INPUT")) + if (::getenv("LPM_DUMP_NATIVE_INPUT")) { std::cout << native_input << std::endl; + } } } // namespace fuzz
diff --git a/components/media_router/common/providers/cast/channel/cast_message_handler.cc b/components/media_router/common/providers/cast/channel/cast_message_handler.cc index 9f48636..7984f07 100644 --- a/components/media_router/common/providers/cast/channel/cast_message_handler.cc +++ b/components/media_router/common/providers/cast/channel/cast_message_handler.cc
@@ -370,14 +370,16 @@ << message.namespace_(); } } else { - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnAppMessage(socket.id(), message); + } } } void CastMessageHandler::OnReadyStateChanged(const CastSocket& socket) { - if (socket.ready_state() == ReadyState::CLOSED) + if (socket.ready_state() == ReadyState::CLOSED) { pending_requests_.erase(socket.id()); + } } void CastMessageHandler::HandleCastInternalMessage( @@ -405,11 +407,12 @@ std::optional<int> request_id = GetRequestIdFromResponse(*payload); if (request_id) { auto requests_it = pending_requests_.find(channel_id); - if (requests_it != pending_requests_.end()) + if (requests_it != pending_requests_.end()) { // You might think this method should return in this case, but there is at // least one message type (RECEIVER_STATUS), that has a request ID but // also needs to be handled by the registered observers. requests_it->second->HandlePendingRequest(*request_id, *payload); + } } CastMessageType type = ParseMessageTypeFromPayload(*payload); @@ -427,8 +430,9 @@ InternalMessage internal_message(type, source_id, destination_id, namespace_, std::move(*payload)); - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnInternalMessage(channel_id, internal_message); + } } void CastMessageHandler::SendCastMessageToSocket(CastSocket* socket, @@ -455,8 +459,9 @@ VirtualConnection connection(socket->id(), source_id, destination_id); // If there is already a connection, there is nothing to do. - if (virtual_connections_.find(connection) != virtual_connections_.end()) + if (virtual_connections_.find(connection) != virtual_connections_.end()) { return; + } VLOG(1) << "Creating VC for channel: " << connection.channel_id << ", source: " << connection.source_id @@ -493,11 +498,13 @@ .Run(std::move(response), nullptr); } - if (pending_stop_session_request_) + if (pending_stop_session_request_) { std::move(pending_stop_session_request_->callback).Run(Result::kFailed); + } - for (auto& request : pending_volume_requests_by_id_) + for (auto& request : pending_volume_requests_by_id_) { std::move(request.second->callback).Run(Result::kFailed); + } } bool CastMessageHandler::PendingRequests::AddAppAvailabilityRequest(
diff --git a/components/media_router/common/providers/cast/channel/cast_message_handler_unittest.cc b/components/media_router/common/providers/cast/channel/cast_message_handler_unittest.cc index 950e721..1e1dd89 100644 --- a/components/media_router/common/providers/cast/channel/cast_message_handler_unittest.cc +++ b/components/media_router/common/providers/cast/channel/cast_message_handler_unittest.cc
@@ -71,24 +71,28 @@ std::optional<base::Value::Dict> GetDictionaryFromCastMessage( const CastMessage& message) { - if (!message.has_payload_utf8()) + if (!message.has_payload_utf8()) { return std::nullopt; + } std::optional<base::Value> value = base::JSONReader::Read(message.payload_utf8()); - if (!value || !value->is_dict()) + if (!value || !value->is_dict()) { return std::nullopt; + } return std::move(*value).TakeDict(); } CastMessageType GetMessageType(const CastMessage& message) { std::optional<base::Value::Dict> dict = GetDictionaryFromCastMessage(message); - if (!dict) + if (!dict) { return CastMessageType::kOther; + } const std::string* message_type = dict->FindString("type"); - if (!message_type) + if (!message_type) { return CastMessageType::kOther; + } return CastMessageTypeFromString(*message_type); } @@ -131,8 +135,9 @@ void OnAppAvailability(const std::string& app_id, GetAppAvailabilityResult result) { - if (run_loop_) + if (run_loop_) { run_loop_->Quit(); + } DoOnAppAvailability(app_id, result); } @@ -143,12 +148,14 @@ void ExpectSessionLaunchResult(LaunchSessionResponse::Result expected_result, LaunchSessionResponse response, LaunchSessionCallbackWrapper* out_callback) { - if (run_loop_) + if (run_loop_) { run_loop_->Quit(); + } ++session_launch_response_count_; EXPECT_EQ(expected_result, response.result); - if (response.result == LaunchSessionResponse::Result::kOk) + if (response.result == LaunchSessionResponse::Result::kOk) { EXPECT_TRUE(response.receiver_status); + } } void ExpectEnsureConnection() {
diff --git a/components/media_router/common/providers/cast/channel/cast_message_util.cc b/components/media_router/common/providers/cast/channel/cast_message_util.cc index 4dd57e2..1228333 100644 --- a/components/media_router/common/providers/cast/channel/cast_message_util.cc +++ b/components/media_router/common/providers/cast/channel/cast_message_util.cc
@@ -223,8 +223,9 @@ } bool IsCastMessageValid(const CastMessage& message_proto) { - if (!message_proto.IsInitialized()) + if (!message_proto.IsInitialized()) { return false; + } if (message_proto.namespace_().empty() || message_proto.source_id().empty() || message_proto.destination_id().empty()) { @@ -243,8 +244,9 @@ // messages, but there is at least one namespace in widespread use that uses // the "reserved" prefix for app-level messages, so after matching the main // prefix, we look for longer prefixes that really need to be reserved. - if (!base::StartsWith(message_namespace, kCastReservedNamespacePrefix)) + if (!base::StartsWith(message_namespace, kCastReservedNamespacePrefix)) { return false; + } const auto prefix_length = kCastReservedNamespacePrefix.length(); for (std::string_view reserved_namespace : kReservedNamespaces) { @@ -259,8 +261,9 @@ // never out of bounds because |message_namespace| must be // at least as long as |reserved_namespace|. (message_namespace.length() == reserved_namespace.length() || - message_namespace[reserved_namespace.length()] == '.')) + message_namespace[reserved_namespace.length()] == '.')) { return true; + } } return false; } @@ -389,8 +392,9 @@ sender_info.Set("browserVersion", browser_version); sender_info.Set("platform", GetVirtualConnectPlatformValue()); sender_info.Set("connectionType", kVirtualConnectTypeLocal); - if (!system_version.empty()) + if (!system_version.empty()) { sender_info.Set("systemVersion", system_version); + } dict.Set("senderInfo", std::move(sender_info)); @@ -447,12 +451,14 @@ dict.Set("appId", app_id); dict.Set("language", locale); base::Value::List supported_app_types_value; - for (const std::string& type : supported_app_types) + for (const std::string& type : supported_app_types) { supported_app_types_value.Append(type); + } dict.Set("supportedAppTypes", std::move(supported_app_types_value)); - if (app_params) + if (app_params) { dict.Set("appParams", app_params.value().Clone()); + } return CreateCastMessage(kReceiverNamespace, base::Value(std::move(dict)), source_id, kPlatformReceiverId); } @@ -557,11 +563,13 @@ const Value::Dict& payload, const std::string& app_id) { const Value::Dict* availability_dict = payload.FindDict("availability"); - if (!availability_dict) + if (!availability_dict) { return GetAppAvailabilityResult::kUnknown; + } const std::string* availability = availability_dict->FindString(app_id); - if (!availability) + if (!availability) { return GetAppAvailabilityResult::kUnknown; + } return StringToEnum<GetAppAvailabilityResult>(*availability) .value_or(GetAppAvailabilityResult::kUnknown); @@ -584,8 +592,9 @@ LaunchSessionResponse GetLaunchSessionResponse( const base::Value::Dict& payload) { const std::string* type_string = payload.FindString("type"); - if (!type_string) + if (!type_string) { return LaunchSessionResponse(); + } const auto type = CastMessageTypeFromString(*type_string); if (type != CastMessageType::kReceiverStatus && @@ -624,8 +633,9 @@ } const Value::Dict* receiver_status = payload.FindDict("status"); - if (!receiver_status) + if (!receiver_status) { return LaunchSessionResponse(); + } response.result = LaunchSessionResponse::Result::kOk; response.receiver_status = receiver_status->Clone();
diff --git a/components/media_router/common/providers/cast/channel/cast_message_util_fuzzer.cc b/components/media_router/common/providers/cast/channel/cast_message_util_fuzzer.cc index 4512ee5..949e293 100644 --- a/components/media_router/common/providers/cast/channel/cast_message_util_fuzzer.cc +++ b/components/media_router/common/providers/cast/channel/cast_message_util_fuzzer.cc
@@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/media_router/common/providers/cast/channel/cast_message_util.h" + #include <string> #include <utility> #include <vector> #include "base/values.h" -#include "components/media_router/common/providers/cast/channel/cast_message_util.h" #include "components/media_router/common/providers/cast/channel/enum_table.h" #include "components/media_router/common/providers/cast/channel/fuzz_proto/fuzzer_inputs.pb.h" #include "testing/libfuzzer/proto/lpm_interface.h" @@ -61,8 +62,9 @@ case CastMessageUtilInputs::kCreateLaunchRequestInput: { const auto& input = input_union.create_launch_request_input(); std::optional<base::Value> app_params; - if (input.has_app_params()) + if (input.has_app_params()) { app_params = MakeValue(input.app_params()); + } CreateLaunchRequest(input.source_id(), input.request_id(), input.app_id(), input.locale(), MakeVector(input.supported_app_types()), app_params); @@ -138,8 +140,9 @@ case CastMessageUtilInputs::kGetRequestIdFromResponseInput: { const auto& input = input_union.get_request_id_from_response_input(); base::Value::Dict payload = MakeDict(input.payload()); - if (input.has_request_id()) + if (input.has_request_id()) { payload.Set("requestId", input.request_id()); + } GetRequestIdFromResponse(payload); break; } @@ -152,8 +155,9 @@ case CastMessageUtilInputs::kParseMessageTypeFromPayloadInput: { const auto& input = input_union.parse_message_type_from_payload_input(); base::Value::Dict payload = MakeDict(input.payload()); - if (input.has_type()) + if (input.has_type()) { payload.Set("type", input.type()); + } ParseMessageTypeFromPayload(payload); break; }
diff --git a/components/media_router/common/providers/cast/channel/cast_socket.cc b/components/media_router/common/providers/cast/channel/cast_socket.cc index 88be205..a55fc70 100644 --- a/components/media_router/common/providers/cast/channel/cast_socket.cc +++ b/components/media_router/common/providers/cast/channel/cast_socket.cc
@@ -42,9 +42,8 @@ // Helper for logging data with remote host IP and authentication state. // Assumes |ip_endpoint_| of type net::IPEndPoint and |channel_auth_| of enum // type ChannelAuthType are available in the current scope. -#define CONNECTION_INFO() \ - "[" << open_params_.ip_endpoint.ToString() << ", auth=SSL_VERIFIED" \ - << "] " +#define CONNECTION_INFO() \ + "[" << open_params_.ip_endpoint.ToString() << ", auth=SSL_VERIFIED" << "] " #define VLOG_WITH_CONNECTION(level) VLOG(level) << CONNECTION_INFO() #define LOG_WITH_CONNECTION(level) LOG(level) << CONNECTION_INFO() @@ -128,8 +127,9 @@ CloseInternal(); error_state_ = ChannelError::UNKNOWN; - for (auto& connect_callback : connect_callbacks_) + for (auto& connect_callback : connect_callbacks_) { std::move(connect_callback).Run(this); + } connect_callbacks_.clear(); } @@ -254,8 +254,9 @@ void CastSocketImpl::AddObserver(Observer* observer) { DCHECK(observer); - if (!observers_.HasObserver(observer)) + if (!observers_.HasObserver(observer)) { observers_.AddObserver(observer); + } } void CastSocketImpl::RemoveObserver(Observer* observer) { @@ -575,8 +576,9 @@ mojo_data_pump_ = std::make_unique<MojoDataPump>(std::move(receive_stream), std::move(send_stream)); } - if (ssl_info.has_value() && ssl_info->cert) + if (ssl_info.has_value() && ssl_info->cert) { peer_cert_ = ssl_info->cert; + } DoConnectLoop(result); } @@ -601,8 +603,9 @@ CloseInternal(); } - for (auto& connect_callback : connect_callbacks_) + for (auto& connect_callback : connect_callbacks_) { std::move(connect_callback).Run(this); + } connect_callbacks_.clear(); } @@ -654,8 +657,9 @@ void CastSocketImpl::SetReadyState(ReadyState ready_state) { if (ready_state_ != ready_state) { ready_state_ = ready_state; - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnReadyStateChanged(*this); + } } } @@ -679,14 +683,16 @@ // CastTransport::Delegate implementation. void CastSocketImpl::CastSocketMessageDelegate::OnError( ChannelError error_state) { - for (auto& observer : socket_->observers_) + for (auto& observer : socket_->observers_) { observer.OnError(*socket_, error_state); + } } void CastSocketImpl::CastSocketMessageDelegate::OnMessage( const CastMessage& message) { - for (auto& observer : socket_->observers_) + for (auto& observer : socket_->observers_) { observer.OnMessage(*socket_, message); + } } void CastSocketImpl::CastSocketMessageDelegate::Start() {}
diff --git a/components/media_router/common/providers/cast/channel/cast_socket_service.cc b/components/media_router/common/providers/cast/channel/cast_socket_service.cc index 21c3574..e213040 100644 --- a/components/media_router/common/providers/cast/channel/cast_socket_service.cc +++ b/components/media_router/common/providers/cast/channel/cast_socket_service.cc
@@ -112,8 +112,9 @@ } } - for (auto& observer : observers_) + for (auto& observer : observers_) { socket->AddObserver(&observer); + } socket->Connect(std::move(open_cb)); } @@ -121,20 +122,23 @@ void CastSocketServiceImpl::AddObserver(CastSocket::Observer* observer) { DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(observer); - if (observers_.HasObserver(observer)) + if (observers_.HasObserver(observer)) { return; + } observers_.AddObserver(observer); - for (auto& socket_it : sockets_) + for (auto& socket_it : sockets_) { socket_it.second->AddObserver(observer); + } } void CastSocketServiceImpl::RemoveObserver(CastSocket::Observer* observer) { DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(observer); - for (auto& socket_it : sockets_) + for (auto& socket_it : sockets_) { socket_it.second->RemoveObserver(observer); + } observers_.RemoveObserver(observer); }
diff --git a/components/media_router/common/providers/cast/channel/cast_socket_service_unittest.cc b/components/media_router/common/providers/cast/channel/cast_socket_service_unittest.cc index c0c3567..87af44a8 100644 --- a/components/media_router/common/providers/cast/channel/cast_socket_service_unittest.cc +++ b/components/media_router/common/providers/cast/channel/cast_socket_service_unittest.cc
@@ -10,7 +10,6 @@ #include "base/test/test_simple_task_runner.h" #include "components/media_router/common/providers/cast/channel/cast_test_util.h" #include "content/public/test/browser_task_environment.h" - #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/media_router/common/providers/cast/channel/cast_socket_unittest.cc b/components/media_router/common/providers/cast/channel/cast_socket_unittest.cc index 151616b..ac3dd7d 100644 --- a/components/media_router/common/providers/cast/channel/cast_socket_unittest.cc +++ b/components/media_router/common/providers/cast/channel/cast_socket_unittest.cc
@@ -295,10 +295,11 @@ } void Pause() { - if (socket_data_provider_) + if (socket_data_provider_) { socket_data_provider_->Pause(); - else + } else { socket_data_provider_paused_ = true; + } } void Resume() { socket_data_provider_->Resume(); } @@ -317,8 +318,9 @@ net::NetworkQualityEstimator*, net::NetLog*, const net::NetLogSource&) override { - if (tcp_client_socket_) + if (tcp_client_socket_) { return std::move(tcp_client_socket_); + } if (tcp_unresponsive_) { socket_data_provider_ = std::make_unique<net::StaticSocketDataProvider>(); @@ -328,8 +330,9 @@ socket_data_provider_ = std::make_unique<net::StaticSocketDataProvider>(reads_, writes_); socket_data_provider_->set_connect_data(*tcp_connect_data_); - if (socket_data_provider_paused_) + if (socket_data_provider_paused_) { socket_data_provider_->Pause(); + } return std::unique_ptr<net::TransportClientSocket>( new MockTCPSocket(false, socket_data_provider_.get())); } @@ -348,8 +351,9 @@ ssl_socket_data_provider_ = std::make_unique<net::SSLSocketDataProvider>( ssl_connect_data_->mode, ssl_connect_data_->result); - if (tls_socket_created_) + if (tls_socket_created_) { std::move(tls_socket_created_).Run(); + } return std::make_unique<net::MockSSLClientSocket>( std::move(nested_socket), net::HostPortPair(), net::SSLConfig(),
diff --git a/components/media_router/common/providers/cast/channel/cast_transport.cc b/components/media_router/common/providers/cast/channel/cast_transport.cc index 67f04d18..26bf63a 100644 --- a/components/media_router/common/providers/cast/channel/cast_transport.cc +++ b/components/media_router/common/providers/cast/channel/cast_transport.cc
@@ -130,13 +130,15 @@ CastTransportImpl::WriteRequest::~WriteRequest() = default; void CastTransportImpl::SetReadState(ReadState read_state) { - if (read_state_ != read_state) + if (read_state_ != read_state) { read_state_ = read_state; + } } void CastTransportImpl::SetWriteState(WriteState write_state) { - if (write_state_ != write_state) + if (write_state_ != write_state) { write_state_ = write_state; + } } void CastTransportImpl::SetErrorState(ChannelError error_state) { @@ -161,8 +163,8 @@ do { VLOG_WITH_CONNECTION(2) << "OnWriteResult (state=" << AsInteger(write_state_) << ", " - << "result=" << rv << ", " - << "queue size=" << write_queue_.size() << ")"; + << "result=" << rv << ", " << "queue size=" << write_queue_.size() + << ")"; WriteState state = write_state_; write_state_ = WriteState::UNKNOWN;
diff --git a/components/media_router/common/providers/cast/channel/enum_table.cc b/components/media_router/common/providers/cast/channel/enum_table.cc index bbc8a5f..ba5f6c9 100644 --- a/components/media_router/common/providers/cast/channel/enum_table.cc +++ b/components/media_router/common/providers/cast/channel/enum_table.cc
@@ -29,8 +29,9 @@ std::string_view str) { for (std::size_t i = 0; i < size; i++) { if (data[i].length == str.length() && - std::memcmp(data[i].chars, str.data(), str.length()) == 0) + std::memcmp(data[i].chars, str.data(), str.length()) == 0) { return &data[i]; + } } return nullptr; } @@ -41,8 +42,9 @@ std::size_t size, int value) { for (std::size_t i = 0; i < size; i++) { - if (data[i].value == value && data[i].has_str()) + if (data[i].value == value && data[i].has_str()) { return data[i].str(); + } } return std::nullopt; }
diff --git a/components/media_router/common/providers/cast/channel/enum_table.h b/components/media_router/common/providers/cast/channel/enum_table.h index fba9c057..fdf8941 100644 --- a/components/media_router/common/providers/cast/channel/enum_table.h +++ b/components/media_router/common/providers/cast/channel/enum_table.h
@@ -319,8 +319,9 @@ const std::size_t index = static_cast<std::size_t>(value); if (ANALYZER_ASSUME_TRUE(index < data_.size())) { const auto& entry = data_.begin()[index]; - if (ANALYZER_ASSUME_TRUE(entry.has_str())) + if (ANALYZER_ASSUME_TRUE(entry.has_str())) { return entry.str(); + } } return std::nullopt; } @@ -340,8 +341,9 @@ template <E Value> constexpr std::string_view GetString() const { for (const auto& entry : data_) { - if (entry.value == static_cast<int32_t>(Value) && entry.has_str()) + if (entry.value == static_cast<int32_t>(Value) && entry.has_str()) { return entry.str(); + } } NOTREACHED() << "No string for enum value: " << static_cast<int32_t>(Value);
diff --git a/components/media_router/common/providers/cast/channel/keep_alive_handler.cc b/components/media_router/common/providers/cast/channel/keep_alive_handler.cc index afa327e..a01ee36 100644 --- a/components/media_router/common/providers/cast/channel/keep_alive_handler.cc +++ b/components/media_router/common/providers/cast/channel/keep_alive_handler.cc
@@ -89,8 +89,9 @@ static const char* ping_message_type = ToString(CastMessageType::kPing); if (message.payload_utf8().find(ping_message_type) != std::string::npos) { DVLOG(2) << "Received PING."; - if (started_) + if (started_) { SendKeepAliveMessage(pong_message_, CastMessageType::kPong); + } } else { DCHECK_NE(std::string::npos, message.payload_utf8().find(ToString(CastMessageType::kPong))); @@ -132,8 +133,9 @@ return; } - if (liveness_timer_) + if (liveness_timer_) { liveness_timer_->Reset(); + } } void KeepAliveHandler::LivenessTimeout() {
diff --git a/components/media_router/common/providers/cast/channel/logger.cc b/components/media_router/common/providers/cast/channel/logger.cc index ebdf25dc..5e1b99b 100644 --- a/components/media_router/common/providers/cast/channel/logger.cc +++ b/components/media_router/common/providers/cast/channel/logger.cc
@@ -119,8 +119,9 @@ int rv, ChallengeReplyError challenge_reply_error) { auto it = last_errors_.find(channel_id); - if (it == last_errors_.end()) + if (it == last_errors_.end()) { last_errors_[channel_id] = LastError(); + } LastError* last_error = &last_errors_[channel_id]; if (rv < net::ERR_IO_PENDING) {
diff --git a/components/media_router/common/providers/cast/channel/logger_unittest.cc b/components/media_router/common/providers/cast/channel/logger_unittest.cc index 17d95ad..24349ef 100644 --- a/components/media_router/common/providers/cast/channel/logger_unittest.cc +++ b/components/media_router/common/providers/cast/channel/logger_unittest.cc
@@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/media_router/common/providers/cast/channel/logger.h" + #include <stddef.h> #include <stdint.h> #include <string> #include "components/media_router/common/providers/cast/channel/cast_auth_util.h" -#include "components/media_router/common/providers/cast/channel/logger.h" #include "net/base/net_errors.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/media_router/common/route_request_result.cc b/components/media_router/common/route_request_result.cc index 08def3b9..fd1eab2 100644 --- a/components/media_router/common/route_request_result.cc +++ b/components/media_router/common/route_request_result.cc
@@ -34,8 +34,9 @@ presentation_id_(presentation_id), error_(error), result_code_(result_code) { - if (route_) + if (route_) { presentation_url_ = route_->media_source().url(); + } } RouteRequestResult::~RouteRequestResult() = default;
diff --git a/components/mirroring/browser/single_client_video_capture_host.cc b/components/mirroring/browser/single_client_video_capture_host.cc index 82373a4..4208932a 100644 --- a/components/mirroring/browser/single_client_video_capture_host.cc +++ b/components/mirroring/browser/single_client_video_capture_host.cc
@@ -35,18 +35,21 @@ // content::VideoCaptureDeviceLauncher::Callbacks implementations void OnDeviceLaunched( std::unique_ptr<content::LaunchedVideoCaptureDevice> device) override { - if (video_capture_host_) + if (video_capture_host_) { video_capture_host_->OnDeviceLaunched(std::move(device)); + } } void OnDeviceLaunchFailed(media::VideoCaptureError error) override { - if (video_capture_host_) + if (video_capture_host_) { video_capture_host_->OnDeviceLaunchFailed(error); + } } void OnDeviceLaunchAborted() override { - if (video_capture_host_) + if (video_capture_host_) { video_capture_host_->OnDeviceLaunchAborted(); + } } private: @@ -110,14 +113,16 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(1) << __func__; - if (!observer_) + if (!observer_) { return; + } // Returns all the buffers. std::vector<int> buffers_in_use; buffers_in_use.reserve(buffer_context_map_.size()); - for (const auto& entry : buffer_context_map_) + for (const auto& entry : buffer_context_map_) { buffers_in_use.push_back(entry.first); + } for (int buffer_id : buffers_in_use) { OnFinishedConsumingBuffer(buffer_id, media::VideoCaptureFeedback()); } @@ -134,8 +139,9 @@ void SingleClientVideoCaptureHost::Pause( const base::UnguessableToken& device_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (launched_device_) + if (launched_device_) { launched_device_->MaybeSuspendDevice(); + } } void SingleClientVideoCaptureHost::Resume( @@ -143,15 +149,17 @@ const base::UnguessableToken& session_id, const VideoCaptureParams& params) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (launched_device_) + if (launched_device_) { launched_device_->ResumeDevice(); + } } void SingleClientVideoCaptureHost::RequestRefreshFrame( const base::UnguessableToken& device_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (launched_device_) + if (launched_device_) { launched_device_->RequestRefreshFrame(); + } } void SingleClientVideoCaptureHost::ReleaseBuffer( @@ -259,9 +267,10 @@ void SingleClientVideoCaptureHost::OnError(media::VideoCaptureError error) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); VLOG(1) << __func__; - if (observer_) + if (observer_) { observer_->OnStateChanged( media::mojom::VideoCaptureResult::NewErrorCode(error)); + } } void SingleClientVideoCaptureHost::OnFrameDropped(
diff --git a/components/mirroring/browser/single_client_video_capture_host.h b/components/mirroring/browser/single_client_video_capture_host.h index 09f2d56..d3b537a 100644 --- a/components/mirroring/browser/single_client_video_capture_host.h +++ b/components/mirroring/browser/single_client_video_capture_host.h
@@ -21,8 +21,8 @@ #include "media/capture/video/video_frame_receiver.h" #include "mojo/public/cpp/bindings/remote.h" -using media::VideoCaptureParams; using media::VideoCaptureDevice; +using media::VideoCaptureParams; namespace mirroring {
diff --git a/components/mirroring/browser/single_client_video_capture_host_unittest.cc b/components/mirroring/browser/single_client_video_capture_host_unittest.cc index 9b5e980..9fc39e0 100644 --- a/components/mirroring/browser/single_client_video_capture_host_unittest.cc +++ b/components/mirroring/browser/single_client_video_capture_host_unittest.cc
@@ -22,8 +22,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using ::testing::InvokeWithoutArgs; using media::VideoFrameReceiver; +using ::testing::InvokeWithoutArgs; namespace mirroring { @@ -170,16 +170,18 @@ MOCK_METHOD1(OnStateChangedCall, void(media::mojom::VideoCaptureState state)); MOCK_METHOD1(OnVideoCaptureErrorCall, void(media::VideoCaptureError error)); void OnStateChanged(media::mojom::VideoCaptureResultPtr result) override { - if (result->which() == media::mojom::VideoCaptureResult::Tag::kState) + if (result->which() == media::mojom::VideoCaptureResult::Tag::kState) { OnStateChangedCall(result->get_state()); - else + } else { OnVideoCaptureErrorCall(result->get_error_code()); + } } void Start(bool valid_params) { VideoCaptureParams params = VideoCaptureParams(); - if (!valid_params) + if (!valid_params) { params.requested_format.frame_rate = std::numeric_limits<float>::max(); + } host_->Start(device_id_, session_id_, params, receiver_.BindNewPipeAndPassRemote());
diff --git a/components/mirroring/service/fake_video_capture_host.cc b/components/mirroring/service/fake_video_capture_host.cc index 9d928e1..7ad523d 100644 --- a/components/mirroring/service/fake_video_capture_host.cc +++ b/components/mirroring/service/fake_video_capture_host.cc
@@ -39,8 +39,9 @@ } void FakeVideoCaptureHost::Stop(const base::UnguessableToken& device_id) { - if (!observer_) + if (!observer_) { return; + } observer_->OnStateChanged(media::mojom::VideoCaptureResult::NewState( media::mojom::VideoCaptureState::ENDED)); @@ -60,8 +61,9 @@ void FakeVideoCaptureHost::SendOneFrame(const gfx::Size& size, base::TimeTicks capture_time) { - if (!observer_) + if (!observer_) { return; + } auto shmem = base::ReadOnlySharedMemoryRegion::Create(5000); if (!shmem.IsValid()) {
diff --git a/components/mirroring/service/media_remoter.cc b/components/mirroring/service/media_remoter.cc index c285d51..99a5e0d9 100644 --- a/components/mirroring/service/media_remoter.cc +++ b/components/mirroring/service/media_remoter.cc
@@ -80,8 +80,9 @@ } void MediaRemoter::OnMirroringResumed(bool is_tab_switching) { - if (state_ == REMOTING_DISABLED) + if (state_ == REMOTING_DISABLED) { return; + } DCHECK(state_ == STOPPING_REMOTING || (state_ == MIRRORING && is_tab_switching)); @@ -158,8 +159,9 @@ audio_sender_receiver, mojo::PendingReceiver<media::mojom::RemotingDataStreamSender> video_sender_receiver) { - if (state_ != REMOTING_STARTED) + if (state_ != REMOTING_STARTED) { return; // Stop() was called before. + } DCHECK(cast_environment_); DCHECK(openscreen_audio_sender_ || openscreen_video_sender_); @@ -186,8 +188,9 @@ } void MediaRemoter::SendMessageToSink(const std::vector<uint8_t>& message) { - if (state_ != REMOTING_STARTED) + if (state_ != REMOTING_STARTED) { return; + } rpc_dispatcher_->SendOutboundMessage(message); } @@ -198,8 +201,9 @@ } void MediaRemoter::OnRemotingDataStreamError() { - if (state_ != REMOTING_STARTED) + if (state_ != REMOTING_STARTED) { return; + } Stop(media::mojom::RemotingStopReason::DATA_SEND_FAILED); state_ = REMOTING_DISABLED; }
diff --git a/components/mirroring/service/openscreen_message_port_unittest.cc b/components/mirroring/service/openscreen_message_port_unittest.cc index 9af8b0e..b6c81f3 100644 --- a/components/mirroring/service/openscreen_message_port_unittest.cc +++ b/components/mirroring/service/openscreen_message_port_unittest.cc
@@ -4,8 +4,6 @@ #include "components/mirroring/service/openscreen_message_port.h" -#include "third_party/openscreen/src/cast/common/public/message_port.h" - #include "base/base64.h" #include "base/functional/bind.h" #include "base/functional/callback.h" @@ -15,6 +13,7 @@ #include "components/mirroring/service/value_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/openscreen/src/cast/common/public/message_port.h" using ::testing::_; using ::testing::InvokeWithoutArgs;
diff --git a/components/mirroring/service/openscreen_session_host.cc b/components/mirroring/service/openscreen_session_host.cc index 07814f3f..b0d2206 100644 --- a/components/mirroring/service/openscreen_session_host.cc +++ b/components/mirroring/service/openscreen_session_host.cc
@@ -293,8 +293,9 @@ std::string error_message = base::StrCat( {"AudioCaptureError occurred, code: ", base::NumberToString(static_cast<int>(code)), ", message: ", message}); - if (!error_callback_.is_null()) + if (!error_callback_.is_null()) { std::move(error_callback_).Run(error_message); + } } void OnCaptureMuted(bool is_muted) override { @@ -415,8 +416,9 @@ const openscreen::cast::SenderSession* session, openscreen::cast::SenderSession::ConfiguredSenders senders, Recommendations capture_recommendations) { - if (state_ == State::kStopped) + if (state_ == State::kStopped) { return; + } const media::AudioCodec audio_codec = media::cast::ToAudioCodec(senders.audio_config.codec); @@ -633,8 +635,9 @@ // mojom interface. Generally speaking, receivers do not update their remoting // capabilities during a single session. DCHECK(!media_remoter_); - if (state_ == State::kStopped) + if (state_ == State::kStopped) { return; + } InitMediaRemoter(capabilities); } @@ -678,15 +681,17 @@ } void OpenscreenSessionHost::RequestRefreshFrame() { - if (video_capture_client_) + if (video_capture_client_) { video_capture_client_->RequestRefreshFrame(); + } } void OpenscreenSessionHost::CreateVideoEncodeAccelerator( media::cast::ReceiveVideoEncodeAcceleratorCallback callback) { DCHECK_NE(state_, State::kInitializing); - if (callback.is_null()) + if (callback.is_null()) { return; + } std::unique_ptr<media::VideoEncodeAccelerator> mojo_vea; if (gpu_ && !supported_profiles_.empty()) { @@ -722,16 +727,18 @@ void OpenscreenSessionHost::RequestRemotingStreaming() { DCHECK(media_remoter_); DCHECK_EQ(State::kMirroring, state_); - if (video_capture_client_) + if (video_capture_client_) { video_capture_client_->Pause(); + } StopStreaming(); state_ = State::kRemoting; Negotiate(); } void OpenscreenSessionHost::RestartMirroringStreaming() { - if (state_ != State::kRemoting) + if (state_ != State::kRemoting) { return; + } // Stop session instead of switching to mirroring when in Remote Playback // mode. @@ -746,8 +753,9 @@ } void OpenscreenSessionHost::SwitchSourceTab() { - if (observer_) + if (observer_) { observer_->OnSourceChanged(); + } if (state_ == State::kRemoting) { switching_tab_source_ = true; @@ -772,8 +780,9 @@ audio_input_device_->Start(); } - if (media_remoter_) + if (media_remoter_) { media_remoter_->OnMirroringResumed(true); + } } void OpenscreenSessionHost::OnAsyncInitialized( @@ -789,8 +798,9 @@ state_ = State::kMirroring; Negotiate(); - if (!initialized_cb_.is_null()) + if (!initialized_cb_.is_null()) { std::move(initialized_cb_).Run(); + } } void OpenscreenSessionHost::ReportAndLogError(SessionError error, @@ -806,8 +816,9 @@ } // Report the error and stop this session. - if (observer_) + if (observer_) { observer_->OnError(error); + } StopSession(); } @@ -816,8 +827,9 @@ logger_.LogInfo( base::StrCat({"stopped streaming. state=", base::NumberToString(static_cast<int>(state_))})); - if (!cast_environment_) + if (!cast_environment_) { return; + } if (audio_input_device_) { audio_input_device_->Stop(); @@ -836,8 +848,9 @@ logger_.LogInfo( base::StrCat({"stopped session. state=", base::NumberToString(static_cast<int>(state_))})); - if (state_ == State::kStopped) + if (state_ == State::kStopped) { return; + } state_ = State::kStopped; StopStreaming();
diff --git a/components/mirroring/service/openscreen_session_host_unittest.cc b/components/mirroring/service/openscreen_session_host_unittest.cc index b8ddd45..277d034 100644 --- a/components/mirroring/service/openscreen_session_host_unittest.cc +++ b/components/mirroring/service/openscreen_session_host_unittest.cc
@@ -65,7 +65,6 @@ namespace { - const openscreen::cast::Answer kAnswerWithConstraints{ 1234, // Send indexes and SSRCs are set later. @@ -373,8 +372,9 @@ void NegotiateMirroring() { session_host_->NegotiateMirroring(); } void StopSession() { - if (video_host_) + if (video_host_) { EXPECT_CALL(*video_host_, OnStopped()); + } EXPECT_CALL(*this, DidStop()); session_host_.reset(); task_environment_.RunUntilIdle(); @@ -509,8 +509,9 @@ ASSERT_EQ(cast_mode_, "remoting"); const RemotingStopReason reason = RemotingStopReason::LOCAL_PLAYBACK; EXPECT_CALL(remoting_source_, OnStopped(reason)); - if (video_host_) + if (video_host_) { EXPECT_CALL(*video_host_, OnStopped()); + } EXPECT_CALL(*this, DidStop()); remoter_->Stop(reason); task_environment_.RunUntilIdle(); @@ -868,14 +869,13 @@ // We should have put a video config for VP8 with hardware enabled in the last // offered configs. - EXPECT_TRUE(std::any_of(LastOfferedVideoConfigs().begin(), - LastOfferedVideoConfigs().end(), + EXPECT_TRUE(std::any_of( + LastOfferedVideoConfigs().begin(), LastOfferedVideoConfigs().end(), - [](const media::cast::FrameSenderConfig& config) { - return config.video_codec() == - media::VideoCodec::kVP8 && - config.use_hardware_encoder; - })); + [](const media::cast::FrameSenderConfig& config) { + return config.video_codec() == media::VideoCodec::kVP8 && + config.use_hardware_encoder; + })); } TEST_F(OpenscreenSessionHostTest, @@ -964,14 +964,13 @@ // We should have put a video config for H264 with hardware enabled in the // last offered configs. - EXPECT_TRUE(std::any_of(LastOfferedVideoConfigs().begin(), - LastOfferedVideoConfigs().end(), + EXPECT_TRUE(std::any_of( + LastOfferedVideoConfigs().begin(), LastOfferedVideoConfigs().end(), - [](const media::cast::FrameSenderConfig& config) { - return config.video_codec() == - media::VideoCodec::kH264 && - config.use_hardware_encoder; - })); + [](const media::cast::FrameSenderConfig& config) { + return config.video_codec() == media::VideoCodec::kH264 && + config.use_hardware_encoder; + })); #endif }
diff --git a/components/mirroring/service/remoting_sender.cc b/components/mirroring/service/remoting_sender.cc index e8ead46..58a3d327 100644 --- a/components/mirroring/service/remoting_sender.cc +++ b/components/mirroring/service/remoting_sender.cc
@@ -323,8 +323,9 @@ // NOTE: This method must be idemptotent as it may be called more than once. decoder_buffer_reader_.reset(); stream_sender_.reset(); - if (!error_callback_.is_null()) + if (!error_callback_.is_null()) { std::move(error_callback_).Run(); + } } void RemotingSender::ClearCurrentFrame() {
diff --git a/components/mirroring/service/rpc_dispatcher.h b/components/mirroring/service/rpc_dispatcher.h index 42ebabe9..2f926f0 100644 --- a/components/mirroring/service/rpc_dispatcher.h +++ b/components/mirroring/service/rpc_dispatcher.h
@@ -6,6 +6,7 @@ #define COMPONENTS_MIRRORING_SERVICE_RPC_DISPATCHER_H_ #include <stdint.h> + #include <vector> #include "base/component_export.h"
diff --git a/components/mirroring/service/rpc_dispatcher_impl_unittest.cc b/components/mirroring/service/rpc_dispatcher_impl_unittest.cc index 762b2d7..5c88293a 100644 --- a/components/mirroring/service/rpc_dispatcher_impl_unittest.cc +++ b/components/mirroring/service/rpc_dispatcher_impl_unittest.cc
@@ -102,8 +102,8 @@ dispatcher().OnMessage(kMessage); EXPECT_CALL(*this, OnMessage(testing::ElementsAre(1, 2, 3, 4))); - dispatcher().Subscribe(base::BindRepeating( - &RpcDispatcherImplTest::OnMessage, base::Unretained(this))); + dispatcher().Subscribe(base::BindRepeating(&RpcDispatcherImplTest::OnMessage, + base::Unretained(this))); dispatcher().OnMessage(kMessage); }
diff --git a/components/mirroring/service/rtp_stream.h b/components/mirroring/service/rtp_stream.h index 8c99831e..eda168a 100644 --- a/components/mirroring/service/rtp_stream.h +++ b/components/mirroring/service/rtp_stream.h
@@ -45,7 +45,6 @@ // The VEA is necessary for hardware encoding. virtual void CreateVideoEncodeAccelerator( media::cast::ReceiveVideoEncodeAcceleratorCallback callback) = 0; - }; // Receives video frames and submits the data to media::cast::VideoSender. It
diff --git a/components/mirroring/service/value_util.cc b/components/mirroring/service/value_util.cc index 1e70214..9ef32842 100644 --- a/components/mirroring/service/value_util.cc +++ b/components/mirroring/service/value_util.cc
@@ -10,8 +10,9 @@ const std::string& key, std::string* result) { auto* found = value.GetDict().Find(key); - if (!found || found->is_none()) + if (!found || found->is_none()) { return true; + } if (found->is_string()) { *result = found->GetString(); return true;
diff --git a/components/mirroring/service/video_capture_client.cc b/components/mirroring/service/video_capture_client.cc index 8d0e94c..f23c6112 100644 --- a/components/mirroring/service/video_capture_client.cc +++ b/components/mirroring/service/video_capture_client.cc
@@ -71,8 +71,9 @@ void VideoCaptureClient::Pause() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(2) << __func__; - if (frame_deliver_callback_.is_null()) + if (frame_deliver_callback_.is_null()) { return; + } frame_deliver_callback_.Reset(); video_capture_host_->Pause(DeviceId()); } @@ -90,8 +91,9 @@ void VideoCaptureClient::RequestRefreshFrame() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (frame_deliver_callback_.is_null()) + if (frame_deliver_callback_.is_null()) { return; + } video_capture_host_->RequestRefreshFrame(DeviceId()); } @@ -136,8 +138,9 @@ } } else { DVLOG(2) << __func__ << " Failed with an error."; - if (!error_callback_.is_null()) + if (!error_callback_.is_null()) { std::move(error_callback_).Run(); + } } } @@ -184,15 +187,17 @@ base::TimeTicks reference_time = *buffer->info->metadata.reference_time; - if (first_frame_ref_time_.is_null()) + if (first_frame_ref_time_.is_null()) { first_frame_ref_time_ = reference_time; + } // If the timestamp is not prepared, we use reference time to make a rough // estimate. e.g. ThreadSafeCaptureOracle::DidCaptureFrame(). // TODO(crbug.com/40472286): Fix upstream capturers to always set timestamp // and reference time. - if (buffer->info->timestamp.is_zero()) + if (buffer->info->timestamp.is_zero()) { buffer->info->timestamp = reference_time - first_frame_ref_time_; + } // Used by chrome/browser/media/cast_mirroring_performance_browsertest.cc TRACE_EVENT_INSTANT2("cast_perf_test", "OnBufferReceived", @@ -277,8 +282,9 @@ // Streaming. // https://crbug.com/1206325 if (frame->format() == media::PIXEL_FORMAT_NV12) { - if (!nv12_to_i420_pool_) + if (!nv12_to_i420_pool_) { nv12_to_i420_pool_ = std::make_unique<media::VideoFramePool>(); + } scoped_refptr<media::VideoFrame> new_frame = nv12_to_i420_pool_->CreateFrame( media::PIXEL_FORMAT_I420, frame->coded_size(), @@ -308,8 +314,9 @@ DVLOG(3) << __func__ << ": buffer_id=" << buffer_id; const auto& buffer_iter = client_buffers_.find(buffer_id); - if (buffer_iter != client_buffers_.end()) + if (buffer_iter != client_buffers_.end()) { client_buffers_.erase(buffer_iter); + } } void VideoCaptureClient::OnFrameDropped(
diff --git a/components/mirroring/service/video_capture_client_unittest.cc b/components/mirroring/service/video_capture_client_unittest.cc index 0cc9a4f..a3e0e5b 100644 --- a/components/mirroring/service/video_capture_client_unittest.cc +++ b/components/mirroring/service/video_capture_client_unittest.cc
@@ -19,8 +19,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using ::testing::InvokeWithoutArgs; using ::testing::_; +using ::testing::InvokeWithoutArgs; namespace mirroring {
diff --git a/components/optimization_guide/content/browser/page_content_proto_provider_browsertest.cc b/components/optimization_guide/content/browser/page_content_proto_provider_browsertest.cc index f4c5c31..fd3fa3d 100644 --- a/components/optimization_guide/content/browser/page_content_proto_provider_browsertest.cc +++ b/components/optimization_guide/content/browser/page_content_proto_provider_browsertest.cc
@@ -276,10 +276,8 @@ ASSERT_EQ(iframe_root.children_nodes().size(), 1); const auto& p = iframe_root.children_nodes()[0]; EXPECT_EQ(p.content_attributes().attribute_type(), - optimization_guide::proto::CONTENT_ATTRIBUTE_CONTAINER); - EXPECT_EQ(p.content_attributes().annotated_roles().size(), 1); - EXPECT_EQ(p.content_attributes().annotated_roles()[0], - optimization_guide::proto::ANNOTATED_ROLE_PARAGRAPH); + optimization_guide::proto::CONTENT_ATTRIBUTE_PARAGRAPH); + EXPECT_EQ(p.content_attributes().annotated_roles().size(), 0); const auto& geometry = p.content_attributes().geometry(); AssertRectsEqual(geometry.outer_bounding_box(), gfx::Rect(-20, -10, 100, 200)); @@ -309,10 +307,8 @@ const auto& p = iframe_root.children_nodes()[0]; EXPECT_EQ(p.content_attributes().attribute_type(), - optimization_guide::proto::CONTENT_ATTRIBUTE_CONTAINER); - EXPECT_EQ(p.content_attributes().annotated_roles().size(), 1); - EXPECT_EQ(p.content_attributes().annotated_roles()[0], - optimization_guide::proto::ANNOTATED_ROLE_PARAGRAPH); + optimization_guide::proto::CONTENT_ATTRIBUTE_PARAGRAPH); + EXPECT_EQ(p.content_attributes().annotated_roles().size(), 0); // TODO(khushalsagar): This is an existing bug where the scroll offset of the // root scroller in the ancestor remote frame is not applied.
diff --git a/components/optimization_guide/content/browser/page_content_proto_util.cc b/components/optimization_guide/content/browser/page_content_proto_util.cc index a930f74..45cc6826 100644 --- a/components/optimization_guide/content/browser/page_content_proto_util.cc +++ b/components/optimization_guide/content/browser/page_content_proto_util.cc
@@ -35,6 +35,19 @@ return optimization_guide::proto::CONTENT_ATTRIBUTE_TABLE; case blink::mojom::AIPageContentAttributeType::kTableRow: return optimization_guide::proto::CONTENT_ATTRIBUTE_TABLE_ROW; + case blink::mojom::AIPageContentAttributeType::kParagraph: + return optimization_guide::proto::CONTENT_ATTRIBUTE_PARAGRAPH; + case blink::mojom::AIPageContentAttributeType::kHeading: + return optimization_guide::proto::CONTENT_ATTRIBUTE_HEADING; + case blink::mojom::AIPageContentAttributeType::kOrderedList: + return optimization_guide::proto::CONTENT_ATTRIBUTE_ORDERED_LIST; + case blink::mojom::AIPageContentAttributeType::kUnorderedList: + return optimization_guide::proto::CONTENT_ATTRIBUTE_UNORDERED_LIST; + case blink::mojom::AIPageContentAttributeType::kTableCell: + return optimization_guide::proto::CONTENT_ATTRIBUTE_TABLE_CELL; + case blink::mojom::AIPageContentAttributeType::kListItem: + // TODO(khushalsagar): Add this to the proto format. + return optimization_guide::proto::CONTENT_ATTRIBUTE_UNKNOWN; } NOTREACHED(); } @@ -42,17 +55,6 @@ optimization_guide::proto::AnnotatedRole ConvertAnnotatedRole( blink::mojom::AIPageContentAnnotatedRole role) { switch (role) { - case blink::mojom::AIPageContentAnnotatedRole::kParagraph: - return optimization_guide::proto::ANNOTATED_ROLE_PARAGRAPH; - case blink::mojom::AIPageContentAnnotatedRole::kHeading: - return optimization_guide::proto::ANNOTATED_ROLE_HEADING; - case blink::mojom::AIPageContentAnnotatedRole::kOrderedList: - return optimization_guide::proto::ANNOTATED_ROLE_ORDERED_LIST; - case blink::mojom::AIPageContentAnnotatedRole::kUnorderedList: - return optimization_guide::proto::ANNOTATED_ROLE_UNORDERED_LIST; - case blink::mojom::AIPageContentAnnotatedRole::kTableCell: - // TODO(abigailbklein): Add this. - return optimization_guide::proto::ANNOTATED_ROLE_UNKNOWN; case blink::mojom::AIPageContentAnnotatedRole::kHeader: return optimization_guide::proto::ANNOTATED_ROLE_HEADER; case blink::mojom::AIPageContentAnnotatedRole::kNav:
diff --git a/components/optimization_guide/content/browser/page_content_proto_util_unittest.cc b/components/optimization_guide/content/browser/page_content_proto_util_unittest.cc index 88b4575a..23086f4 100644 --- a/components/optimization_guide/content/browser/page_content_proto_util_unittest.cc +++ b/components/optimization_guide/content/browser/page_content_proto_util_unittest.cc
@@ -459,16 +459,6 @@ auto container_node = CreateContentNode(blink::mojom::AIPageContentAttributeType::kContainer); container_node->content_attributes->annotated_roles.push_back( - blink::mojom::AIPageContentAnnotatedRole::kParagraph); - container_node->content_attributes->annotated_roles.push_back( - blink::mojom::AIPageContentAnnotatedRole::kHeading); - container_node->content_attributes->annotated_roles.push_back( - blink::mojom::AIPageContentAnnotatedRole::kOrderedList); - container_node->content_attributes->annotated_roles.push_back( - blink::mojom::AIPageContentAnnotatedRole::kUnorderedList); - container_node->content_attributes->annotated_roles.push_back( - blink::mojom::AIPageContentAnnotatedRole::kTableCell); - container_node->content_attributes->annotated_roles.push_back( blink::mojom::AIPageContentAnnotatedRole::kHeader); container_node->content_attributes->annotated_roles.push_back( blink::mojom::AIPageContentAnnotatedRole::kNav); @@ -497,32 +487,22 @@ proto.root_node().children_nodes(0).content_attributes(); EXPECT_EQ(container_node_attributes_proto.attribute_type(), optimization_guide::proto::CONTENT_ATTRIBUTE_CONTAINER); - EXPECT_EQ(container_node_attributes_proto.annotated_roles_size(), 13); + EXPECT_EQ(container_node_attributes_proto.annotated_roles_size(), 8); EXPECT_EQ(container_node_attributes_proto.annotated_roles(0), - optimization_guide::proto::ANNOTATED_ROLE_PARAGRAPH); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(1), - optimization_guide::proto::ANNOTATED_ROLE_HEADING); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(2), - optimization_guide::proto::ANNOTATED_ROLE_ORDERED_LIST); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(3), - optimization_guide::proto::ANNOTATED_ROLE_UNORDERED_LIST); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(4), - optimization_guide::proto::ANNOTATED_ROLE_UNKNOWN); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(5), optimization_guide::proto::ANNOTATED_ROLE_HEADER); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(6), + EXPECT_EQ(container_node_attributes_proto.annotated_roles(1), optimization_guide::proto::ANNOTATED_ROLE_NAV); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(7), + EXPECT_EQ(container_node_attributes_proto.annotated_roles(2), optimization_guide::proto::ANNOTATED_ROLE_SEARCH); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(8), + EXPECT_EQ(container_node_attributes_proto.annotated_roles(3), optimization_guide::proto::ANNOTATED_ROLE_MAIN); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(9), + EXPECT_EQ(container_node_attributes_proto.annotated_roles(4), optimization_guide::proto::ANNOTATED_ROLE_ARTICLE); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(10), + EXPECT_EQ(container_node_attributes_proto.annotated_roles(5), optimization_guide::proto::ANNOTATED_ROLE_SECTION); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(11), + EXPECT_EQ(container_node_attributes_proto.annotated_roles(6), optimization_guide::proto::ANNOTATED_ROLE_ASIDE); - EXPECT_EQ(container_node_attributes_proto.annotated_roles(12), + EXPECT_EQ(container_node_attributes_proto.annotated_roles(7), optimization_guide::proto::ANNOTATED_ROLE_FOOTER); }
diff --git a/components/optimization_guide/internal b/components/optimization_guide/internal index bfb0033..cf67ed8d 160000 --- a/components/optimization_guide/internal +++ b/components/optimization_guide/internal
@@ -1 +1 @@ -Subproject commit bfb00333807212903408145b1b2fd0e3f43d2237 +Subproject commit cf67ed8d9eb55e6befedfce5fc6beb0bc5200a63
diff --git a/components/optimization_guide/proto/features/common_quality_data.proto b/components/optimization_guide/proto/features/common_quality_data.proto index 09f8372e..20d947ad 100644 --- a/components/optimization_guide/proto/features/common_quality_data.proto +++ b/components/optimization_guide/proto/features/common_quality_data.proto
@@ -159,7 +159,7 @@ repeated float transform = 6; } -// Next ID: 10 +// Next ID: 11 message PageContext { // The URL of the page that the form is on. string url = 1; @@ -229,7 +229,7 @@ ContentAttributes content_attributes = 2; } -// Next ID: 16 +// Next ID: 19 message ContentAttributes { oneof content_data { // Only set if attribute_type is CONTENT_ATTRIBUTE_TEXT. @@ -275,10 +275,21 @@ // These can come from the aria role, the html tag, or are assumed from some // properties of the page. repeated AnnotatedRole annotated_roles = 15; + + // A text "label" for the content node, e.g. for a "Submit" button this would + // be "Submit". + string label = 16; + + string tag_name = 17; // HTML tag name. + + string type = 18; // HTML type attribute. } // The geometry of the content, in the page coordinate system. // Next ID: 6 +// NOTE: If `visual_bounding_box` is empty, i.e., the content is offscreen and +// it's in an iframe, the `outer_bounding_box` may be incorrect. See crbug.com/384996050 +// for details. message Geometry { // The bounding box of the content node, in the page coordinate system. This // roughly corresponds to the element's local box used for hit testing. @@ -1315,11 +1326,13 @@ } // This will be updated when there is a significant change in the parsing logic. -// Next ID: 2 +// Next ID: 3 enum AnnotatedPageContentVersion { ANNOTATED_PAGE_CONTENT_VERSION_UNKNOWN = 0; ANNOTATED_PAGE_CONTENT_VERSION_1_0 = 1; + + ANNOTATED_PAGE_CONTENT_VERSION_ONLY_ACTIONABLE_ELEMENTS_1_0 = 2; } // Indicates the structure of the ContentNode. Suggests which type of
diff --git a/components/paint_preview/browser/paint_preview_base_service_unittest.cc b/components/paint_preview/browser/paint_preview_base_service_unittest.cc index 7d77c5b..0093c3b 100644 --- a/components/paint_preview/browser/paint_preview_base_service_unittest.cc +++ b/components/paint_preview/browser/paint_preview_base_service_unittest.cc
@@ -26,10 +26,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/lacros/lacros_test_helper.h" -#endif - namespace paint_preview { namespace { @@ -196,10 +192,6 @@ } private: -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // Instantiate LacrosService for WakeLock support during capturing. - chromeos::ScopedLacrosServiceTestHelper scoped_lacros_service_test_helper_; -#endif std::unique_ptr<SimpleFactoryKey> key_; std::unique_ptr<SimpleFactoryKey> rejection_policy_key_; };
diff --git a/components/policy/core/browser/policy_conversions_client.cc b/components/policy/core/browser/policy_conversions_client.cc index 10e093ed..002b23a 100644 --- a/components/policy/core/browser/policy_conversions_client.cc +++ b/components/policy/core/browser/policy_conversions_client.cc
@@ -39,9 +39,6 @@ namespace { const char* USER_SCOPE = "user"; const char* DEVICE_SCOPE = "machine"; -#if BUILDFLAG(IS_CHROMEOS_LACROS) -const char* ALL_USERS_SCOPE = "allUsers"; -#endif // Return true if machine policy information needs to be hidden. bool IsMachineInfoHidden(PolicyScope scope, bool show_machine_values) { @@ -124,10 +121,6 @@ // Convert dictionary values to strings for display. handler_list->PrepareForDisplaying(&map); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - PopulatePerProfileMap(); -#endif - return GetPolicyValues(map, &errors, deprecated_policies, future_policies, GetKnownPolicies(schema_map, policy_namespace)); } @@ -467,47 +460,9 @@ if (policy_scope != POLICY_SCOPE_USER) { return DEVICE_SCOPE; } - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - if (per_profile_map_) { - auto it = per_profile_map_->find(policy_name); - if (it != per_profile_map_->end()) { - return it->second ? USER_SCOPE : ALL_USERS_SCOPE; - } - } -#endif - - // In Lacros case, this policy is missing from the policy templates. - // Which means it's a policy for apps/extensions. return USER_SCOPE; } -#if BUILDFLAG(IS_CHROMEOS_LACROS) -void PolicyConversionsClient::PopulatePerProfileMap() { - if (per_profile_map_) { - return; - } - - per_profile_map_ = std::make_unique<std::map<std::string, bool>>(); - for (const BooleanPolicyAccess& access : kBooleanPolicyAccess) { - per_profile_map_->emplace(std::string(access.policy_key), - access.per_profile); - } - for (const IntegerPolicyAccess& access : kIntegerPolicyAccess) { - per_profile_map_->emplace(std::string(access.policy_key), - access.per_profile); - } - for (const StringPolicyAccess& access : kStringPolicyAccess) { - per_profile_map_->emplace(std::string(access.policy_key), - access.per_profile); - } - for (const StringListPolicyAccess& access : kStringListPolicyAccess) { - per_profile_map_->emplace(std::string(access.policy_key), - access.per_profile); - } -} -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - std::u16string PolicyConversionsClient::GetPolicyError( const std::string& policy_name, const PolicyMap::Entry& policy,
diff --git a/components/policy/core/browser/policy_conversions_client.h b/components/policy/core/browser/policy_conversions_client.h index 03eacc9..8aff49d 100644 --- a/components/policy/core/browser/policy_conversions_client.h +++ b/components/policy/core/browser/policy_conversions_client.h
@@ -193,11 +193,6 @@ bool user_policies_enabled_ = true; bool drop_default_values_enabled_ = false; bool show_machine_values_ = true; - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - void PopulatePerProfileMap(); - std::unique_ptr<std::map<std::string, bool>> per_profile_map_; -#endif }; } // namespace policy
diff --git a/components/policy/core/browser/policy_pref_mapping_test.cc b/components/policy/core/browser/policy_pref_mapping_test.cc index 4f8e97b..5124e72 100644 --- a/components/policy/core/browser/policy_pref_mapping_test.cc +++ b/components/policy/core/browser/policy_pref_mapping_test.cc
@@ -407,8 +407,6 @@ const std::string os("android"); #elif BUILDFLAG(IS_CHROMEOS_ASH) const std::string os("chromeos_ash"); -#elif BUILDFLAG(IS_CHROMEOS_LACROS) - const std::string os("chromeos_lacros"); #elif BUILDFLAG(IS_IOS) const std::string os("ios"); #elif BUILDFLAG(IS_LINUX)
diff --git a/components/policy/core/browser/webui/policy_status_provider.cc b/components/policy/core/browser/webui/policy_status_provider.cc index b5e9d4d..d6cd8891 100644 --- a/components/policy/core/browser/webui/policy_status_provider.cc +++ b/components/policy/core/browser/webui/policy_status_provider.cc
@@ -159,15 +159,6 @@ dict.Set(kGaiaIdKey, policy->gaia_id()); } -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // Include the "Managed by:" attribute for the user policy legend. - if (policy->state() == enterprise_management::PolicyData::ACTIVE) { - if (policy->has_managed_by()) - dict.Set(kEnterpriseDomainManagerKey, policy->managed_by()); - else if (policy->has_display_domain()) - dict.Set(kEnterpriseDomainManagerKey, policy->display_domain()); - } -#endif return dict; }
diff --git a/components/policy/core/common/cloud/cloud_policy_client_unittest.cc b/components/policy/core/common/cloud/cloud_policy_client_unittest.cc index 99019b4..470dd97 100644 --- a/components/policy/core/common/cloud/cloud_policy_client_unittest.cc +++ b/components/policy/core/common/cloud/cloud_policy_client_unittest.cc
@@ -109,8 +109,7 @@ constexpr char kOidcState[] = "fake-oidc-state"; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) constexpr char kBrowserEnrollmentToken[] = "browser_enrollment_token"; #endif @@ -337,8 +336,7 @@ return request; } -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) em::DeviceManagementRequest GetEnrollmentRequest() { em::DeviceManagementRequest request; @@ -914,8 +912,7 @@ CheckPolicyResponse(policy_response); } -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) TEST_F(CloudPolicyClientTest, BrowserRegistrationWithTokenAndPolicyFetch) { const em::DeviceManagementResponse policy_response = GetPolicyResponse();
diff --git a/components/policy/core/common/cloud/cloud_policy_util.cc b/components/policy/core/common/cloud/cloud_policy_util.cc index 057fc73e..616480e 100644 --- a/components/policy/core/common/cloud/cloud_policy_util.cc +++ b/components/policy/core/common/cloud/cloud_policy_util.cc
@@ -21,8 +21,7 @@ #include "base/win/wincred_shim.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \ - BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) #include <pwd.h> #include <sys/types.h> #include <unistd.h> @@ -37,7 +36,7 @@ #import <SystemConfiguration/SCDynamicStoreCopySpecific.h> #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) #include <limits.h> // For HOST_NAME_MAX #endif @@ -60,10 +59,6 @@ #include "components/user_manager/user_manager.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/startup/browser_params_proxy.h" -#endif - #if BUILDFLAG(IS_WIN) #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -89,8 +84,7 @@ namespace em = enterprise_management; std::string GetMachineName() { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \ - BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) char hostname[HOST_NAME_MAX]; if (gethostname(hostname, HOST_NAME_MAX) == 0) // Success. return hostname; @@ -194,18 +188,6 @@ if (!user) return std::string(); return user->GetAccountId().GetUserEmail(); -#elif BUILDFLAG(IS_CHROMEOS_LACROS) - const chromeos::BrowserParamsProxy* init_params = - chromeos::BrowserParamsProxy::Get(); - if (init_params->DeviceAccount()) { - return init_params->DeviceAccount()->raw_email; - } - // Fallback if init params are missing. - struct passwd* creds = getpwuid(getuid()); - if (!creds || !creds->pw_name) - return std::string(); - - return creds->pw_name; #elif BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) // TODO(crbug.com/40200780): This should be fully implemented when there is // support in fuchsia. @@ -235,14 +217,6 @@ return std::string( ash::system::StatisticsProvider::GetInstance()->GetMachineID().value_or( "")); -#elif BUILDFLAG(IS_CHROMEOS_LACROS) - const chromeos::BrowserParamsProxy* init_params = - chromeos::BrowserParamsProxy::Get(); - if (init_params->DeviceProperties() && - init_params->DeviceProperties()->serial_number.has_value()) { - return init_params->DeviceProperties()->serial_number.value(); - } - return GetMachineName(); #else return GetMachineName(); #endif
diff --git a/components/policy/core/common/cloud/user_cloud_policy_manager.cc b/components/policy/core/common/cloud/user_cloud_policy_manager.cc index 899a888c..e606fb4 100644 --- a/components/policy/core/common/cloud/user_cloud_policy_manager.cc +++ b/components/policy/core/common/cloud/user_cloud_policy_manager.cc
@@ -149,14 +149,6 @@ // If the store has a verified policy blob received from the server then apply // the defaults for policies that haven't been configured by the administrator // given that this is an enterprise user. -#if BUILDFLAG(IS_CHROMEOS_LACROS) - if (!store()->has_policy()) - return; - - // TODO(https://crbug.com/1206315): Don't apply enterprise defaults for Child - // user. - SetEnterpriseUsersProfileDefaults(policy_map); -#endif #if BUILDFLAG(IS_ANDROID) if (store()->has_policy() && !policy_map->Get(key::kNTPContentSuggestionsEnabled)) {
diff --git a/components/policy/core/common/cloud/user_cloud_policy_store_base.cc b/components/policy/core/common/cloud/user_cloud_policy_store_base.cc index 7d4417e..ad057d8 100644 --- a/components/policy/core/common/cloud/user_cloud_policy_store_base.cc +++ b/components/policy/core/common/cloud/user_cloud_policy_store_base.cc
@@ -47,15 +47,7 @@ const std::string& policy_signature_public_key) { // Decode the payload. policy_map_.Clear(); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // From the policies that Lacros fetched from the cloud, it should only - // respect the ones with per_profile=True. Session-wide policies - // (per_profile=False) are be provided by ash and installed by - // PolicyLoaderLacros. - PolicyPerProfileFilter filter = PolicyPerProfileFilter::kTrue; -#else PolicyPerProfileFilter filter = PolicyPerProfileFilter::kAny; -#endif DecodeProtoFields(*payload, external_data_manager(), POLICY_SOURCE_CLOUD, policy_scope_, &policy_map_, filter);
diff --git a/components/policy/core/common/management/platform_management_service.cc b/components/policy/core/common/management/platform_management_service.cc index 5c42ca4..c7f35ae 100644 --- a/components/policy/core/common/management/platform_management_service.cc +++ b/components/policy/core/common/management/platform_management_service.cc
@@ -14,9 +14,6 @@ #include "components/policy/core/common/management/platform_management_status_provider_mac.h" #elif BUILDFLAG(IS_WIN) #include "components/policy/core/common/management/platform_management_status_provider_win.h" -#elif BUILDFLAG(IS_CHROMEOS_LACROS) -#include "build/chromeos_buildflags.h" -#include "components/policy/core/common/management/platform_management_status_provider_lacros.h" #endif namespace policy { @@ -34,10 +31,6 @@ providers.emplace_back( std::make_unique<AzureActiveDirectoryStatusProvider>()); #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) - providers.emplace_back( - std::make_unique<DeviceEnterpriseManagedStatusProvider>()); -#endif return providers; }
diff --git a/components/segmentation_platform/components_unittests.filter b/components/segmentation_platform/components_unittests.filter index 7c43eca..62dae5f 100644 --- a/components/segmentation_platform/components_unittests.filter +++ b/components/segmentation_platform/components_unittests.filter
@@ -86,6 +86,7 @@ *StatsTest.* *SyncDeviceInfoObserverTest.* *TabGroupPromoTest.* +*TabGroupSyncPromoTest.* *TabRankDispatcherTest.* *TabResumptionRankerTest.* *TabSessionSourceTest.*
diff --git a/components/segmentation_platform/embedder/home_modules/BUILD.gn b/components/segmentation_platform/embedder/home_modules/BUILD.gn index c4653dc8..99b85fe 100644 --- a/components/segmentation_platform/embedder/home_modules/BUILD.gn +++ b/components/segmentation_platform/embedder/home_modules/BUILD.gn
@@ -45,6 +45,8 @@ "default_browser_promo.h", "tab_group_promo.cc", "tab_group_promo.h", + "tab_group_sync_promo.cc", + "tab_group_sync_promo.h", ] } @@ -97,6 +99,7 @@ sources += [ "default_browser_promo_unittest.cc", "tab_group_promo_unittest.cc", + "tab_group_sync_promo_unittest.cc", ] }
diff --git a/components/segmentation_platform/embedder/home_modules/constants.h b/components/segmentation_platform/embedder/home_modules/constants.h index fb505c9c..08da7b6 100644 --- a/components/segmentation_platform/embedder/home_modules/constants.h +++ b/components/segmentation_platform/embedder/home_modules/constants.h
@@ -45,7 +45,8 @@ const char kTabGroupExists[] = "tab_group_exists"; const char kNumberOfTabs[] = "number_of_tabs"; const char kTabGroupPromoShownCount[] = "tab_group_shown_count"; -const char kHaveSyncedTabGroups[] = "have_synced_tab_groups"; +const char kSyncedTabGroupExists[] = "synced_tab_group_exists"; +const char kTabGroupSyncPromoShownCount[] = "tab_group_sync_shown_count"; const char kHaveClearedBrowsingDataInThirtyDays[] = "have_cleared_browsing_data_in_thirty_days"; const char kHaveUsedIncognito[] = "have_used_incognito";
diff --git a/components/segmentation_platform/embedder/home_modules/home_modules_card_registry.cc b/components/segmentation_platform/embedder/home_modules/home_modules_card_registry.cc index 108fc79..5b96a6c64 100644 --- a/components/segmentation_platform/embedder/home_modules/home_modules_card_registry.cc +++ b/components/segmentation_platform/embedder/home_modules/home_modules_card_registry.cc
@@ -16,6 +16,7 @@ #include "components/segmentation_platform/embedder/home_modules/price_tracking_notification_promo.h" #include "components/segmentation_platform/embedder/home_modules/send_tab_notification_promo.h" #include "components/segmentation_platform/embedder/home_modules/tab_group_promo.h" +#include "components/segmentation_platform/embedder/home_modules/tab_group_sync_promo.h" #include "components/segmentation_platform/embedder/home_modules/tips_manager/constants.h" #include "components/segmentation_platform/public/features.h" #if BUILDFLAG(IS_IOS) @@ -38,6 +39,10 @@ "ephemeral_pref_counter.tab_group_promo_counter"; const char kTabGroupPromoInteractedPref[] = "ephemeral_pref_interacted.tab_group_promo_interacted"; +const char kTabGroupSyncPromoImpressionCounterPref[] = + "ephemeral_pref_counter.tab_group_sync_promo_counter"; +const char kTabGroupSyncPromoInteractedPref[] = + "ephemeral_pref_interacted.tab_group_sync_promo_interacted"; #endif namespace { @@ -176,6 +181,8 @@ registry->RegisterBooleanPref(kDefaultBrowserPromoInteractedPref, false); registry->RegisterIntegerPref(kTabGroupPromoImpressionCounterPref, 0); registry->RegisterBooleanPref(kTabGroupPromoInteractedPref, false); + registry->RegisterIntegerPref(kTabGroupSyncPromoImpressionCounterPref, 0); + registry->RegisterBooleanPref(kTabGroupSyncPromoInteractedPref, false); #endif } @@ -255,8 +262,13 @@ profile_prefs_->GetInteger(kTabGroupPromoImpressionCounterPref); profile_prefs_->SetInteger(kTabGroupPromoImpressionCounterPref, freshness_impression_count + 1); + } else if (strcmp(card_name, kTabGroupSyncPromo) == 0) { + int freshness_impression_count = + profile_prefs_->GetInteger(kTabGroupSyncPromoImpressionCounterPref); + profile_prefs_->SetInteger(kTabGroupSyncPromoImpressionCounterPref, + freshness_impression_count + 1); } - } + } #endif } @@ -306,6 +318,8 @@ profile_prefs_->SetBoolean(kDefaultBrowserPromoInteractedPref, true); } else if (strcmp(card_name, kTabGroupPromo) == 0) { profile_prefs_->SetBoolean(kTabGroupPromoInteractedPref, true); + } else if (strcmp(card_name, kTabGroupSyncPromo) == 0) { + profile_prefs_->SetBoolean(kTabGroupSyncPromoInteractedPref, true); } #endif } @@ -383,6 +397,13 @@ all_cards_by_priority_.push_back( std::make_unique<TabGroupPromo>(profile_prefs_)); } + + int tab_group_sync_promo_count = + profile_prefs_->GetInteger(kTabGroupSyncPromoImpressionCounterPref); + if (TabGroupSyncPromo::IsEnabled(tab_group_sync_promo_count)) { + all_cards_by_priority_.push_back( + std::make_unique<TabGroupSyncPromo>(profile_prefs_)); + } #endif InitializeAfterAddingCards(); }
diff --git a/components/segmentation_platform/embedder/home_modules/home_modules_card_registry.h b/components/segmentation_platform/embedder/home_modules/home_modules_card_registry.h index f98e4f59..63c3301 100644 --- a/components/segmentation_platform/embedder/home_modules/home_modules_card_registry.h +++ b/components/segmentation_platform/embedder/home_modules/home_modules_card_registry.h
@@ -21,10 +21,12 @@ // Immpression counter for each card. extern const char kDefaultBrowserPromoImpressionCounterPref[]; extern const char kTabGroupPromoImpressionCounterPref[]; +extern const char kTabGroupSyncPromoImpressionCounterPref[]; // Interaction flag for each card. extern const char kDefaultBrowserPromoInteractedPref[]; extern const char kTabGroupPromoInteractedPref[]; +extern const char kTabGroupSyncPromoInteractedPref[]; #endif // Registry that manages all ephemeral cards in mobile home modules.
diff --git a/components/segmentation_platform/embedder/home_modules/home_modules_card_registry_unittest.cc b/components/segmentation_platform/embedder/home_modules/home_modules_card_registry_unittest.cc index 7317633..276aec7 100644 --- a/components/segmentation_platform/embedder/home_modules/home_modules_card_registry_unittest.cc +++ b/components/segmentation_platform/embedder/home_modules/home_modules_card_registry_unittest.cc
@@ -124,10 +124,10 @@ } #endif +#if BUILDFLAG(IS_ANDROID) // Tests that the Registry registers the DefaultBrowserPromo card when its // feature is enabled. TEST_F(HomeModulesCardRegistryTest, TestDefaultBrowserPromoCardEnabled) { -#if BUILDFLAG(IS_ANDROID) feature_list_.InitWithFeatures({features::kEducationalTipModule}, {}); registry_ = std::make_unique<HomeModulesCardRegistry>(&pref_service_); @@ -145,13 +145,11 @@ Contains("should_show_non_role_manager_default_browser_promo")); EXPECT_THAT(signalKeys, Contains("has_default_browser_promo_shown_in_other_surface")); -#endif } // Tests that the Registry won't register the DefaultBrowserPromo card when it // is disabled because of user's interaction history. TEST_F(HomeModulesCardRegistryTest, TestDefaultBrowserPromoCardDisabled) { -#if BUILDFLAG(IS_ANDROID) feature_list_.InitWithFeatures({features::kEducationalTipModule}, {}); pref_service_.SetUserPref(kDefaultBrowserPromoImpressionCounterPref, std::make_unique<base::Value>(4)); @@ -174,13 +172,11 @@ EXPECT_THAT( signalKeys, Not(Contains("has_default_browser_promo_shown_in_other_surface"))); -#endif } // Tests that the Registry registers the TabGroupPromo card when its feature is // enabled. TEST_F(HomeModulesCardRegistryTest, TestTabGroupPromoCardEnabled) { -#if BUILDFLAG(IS_ANDROID) feature_list_.InitWithFeatures({features::kEducationalTipModule}, {}); registry_ = std::make_unique<HomeModulesCardRegistry>(&pref_service_); @@ -197,13 +193,11 @@ EXPECT_THAT(signalKeys, Contains("tab_group_exists")); EXPECT_THAT(signalKeys, Contains("number_of_tabs")); EXPECT_THAT(signalKeys, Contains("tab_group_shown_count")); -#endif } // Tests that the Registry won't register the TabGroupPromo card when it is // disabled because of user's interaction history. TEST_F(HomeModulesCardRegistryTest, TestTabGroupPromoCardDisabled) { -#if BUILDFLAG(IS_ANDROID) feature_list_.InitWithFeatures({features::kEducationalTipModule}, {}); pref_service_.SetUserPref(kTabGroupPromoImpressionCounterPref, std::make_unique<base::Value>(11)); @@ -222,14 +216,12 @@ EXPECT_THAT(signalKeys, Not(Contains("tab_group_exists"))); EXPECT_THAT(signalKeys, Not(Contains("number_of_tabs"))); EXPECT_THAT(signalKeys, Not(Contains("tab_group_shown_count"))); -#endif } // Tests that for educational tip cards, except for the default browser promo // card, could send a notification when the card is shown once per session, // rather than every time it is displayed. TEST_F(HomeModulesCardRegistryTest, TestShouldNotifyCardShownPerSession) { -#if BUILDFLAG(IS_ANDROID) feature_list_.InitWithFeatures({features::kEducationalTipModule}, {}); registry_ = std::make_unique<HomeModulesCardRegistry>(&pref_service_); const char* card_name_1 = "TabGroupPromo"; @@ -238,7 +230,50 @@ EXPECT_FALSE(registry_->ShouldNotifyCardShownPerSession(card_name_1)); EXPECT_TRUE(registry_->ShouldNotifyCardShownPerSession(card_name_2)); EXPECT_FALSE(registry_->ShouldNotifyCardShownPerSession(card_name_2)); -#endif } +// Tests that the Registry registers the TabGroupSyncPromo card when its feature +// is enabled. +TEST_F(HomeModulesCardRegistryTest, TestTabGroupSyncPromoCardEnabled) { + feature_list_.InitWithFeatures({features::kEducationalTipModule}, {}); + registry_ = std::make_unique<HomeModulesCardRegistry>(&pref_service_); + + EXPECT_THAT(registry_->all_output_labels(), Contains(kTabGroupSyncPromo)); + EXPECT_GE(registry_->all_cards_input_size(), 7u); + const std::vector<std::unique_ptr<CardSelectionInfo>>& all_cards = + registry_->get_all_cards_by_priority(); + std::vector<std::string> card_names = ExtractCardNames(all_cards); + EXPECT_THAT(card_names, Contains(kTabGroupSyncPromo)); + + const CardSignalMap& signal_map = registry_->get_card_signal_map(); + std::vector<std::string> signalKeys = + GetSignalKeys(signal_map, kTabGroupSyncPromo); + EXPECT_THAT(signalKeys, Contains("synced_tab_group_exists")); + EXPECT_THAT(signalKeys, Contains("tab_group_sync_shown_count")); +} + +// Tests that the Registry won't register the TabGroupSyncPromo card when it is +// disabled because of user's interaction history. +TEST_F(HomeModulesCardRegistryTest, TestTabGroupSyncPromoCardDisabled) { + feature_list_.InitWithFeatures({features::kEducationalTipModule}, {}); + pref_service_.SetUserPref(kTabGroupSyncPromoImpressionCounterPref, + std::make_unique<base::Value>(11)); + registry_ = std::make_unique<HomeModulesCardRegistry>(&pref_service_); + + EXPECT_THAT(registry_->all_output_labels(), + Not(Contains(kTabGroupSyncPromo))); + EXPECT_GE(registry_->all_cards_input_size(), 0u); + const std::vector<std::unique_ptr<CardSelectionInfo>>& all_cards = + registry_->get_all_cards_by_priority(); + std::vector<std::string> card_names = ExtractCardNames(all_cards); + EXPECT_THAT(card_names, Not(Contains(kTabGroupSyncPromo))); + + const CardSignalMap& signal_map = registry_->get_card_signal_map(); + std::vector<std::string> signalKeys = + GetSignalKeys(signal_map, kTabGroupSyncPromo); + EXPECT_THAT(signalKeys, Not(Contains("synced_tab_group_exists"))); + EXPECT_THAT(signalKeys, Not(Contains("tab_group_sync_shown_count"))); +} +#endif + } // namespace segmentation_platform::home_modules
diff --git a/components/segmentation_platform/embedder/home_modules/tab_group_sync_promo.cc b/components/segmentation_platform/embedder/home_modules/tab_group_sync_promo.cc new file mode 100644 index 0000000..65bef3a --- /dev/null +++ b/components/segmentation_platform/embedder/home_modules/tab_group_sync_promo.cc
@@ -0,0 +1,116 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/segmentation_platform/embedder/home_modules/tab_group_sync_promo.h" + +#include "base/metrics/field_trial_params.h" +#include "components/commerce/core/commerce_feature_list.h" +#include "components/segmentation_platform/embedder/home_modules/constants.h" +#include "components/segmentation_platform/embedder/home_modules/ephemeral_module_utils.h" +#include "components/segmentation_platform/embedder/home_modules/home_modules_card_registry.h" +#include "components/segmentation_platform/public/features.h" +#include "components/segmentation_platform/public/proto/model_metadata.pb.h" + +namespace { + +// The number of times the tab group sync promo card can be shown to the user in +// a single day. +const int kShownCountLimit = 3; + +const char kTabGroupSyncPromoHistogramName[] = + "MagicStack.Clank.NewTabPage.Module.TopImpressionV2"; + +// TODO(crbug.com/382803396): The enum id of the tab group sync promo card. +// Could be referenced after refactor. +const int kTabGroupSyncPromoId = 8; + +} // namespace + +namespace segmentation_platform::home_modules { + +TabGroupSyncPromo::TabGroupSyncPromo(PrefService* profile_prefs) + : CardSelectionInfo(kTabGroupSyncPromo), profile_prefs_(profile_prefs) {} + +std::map<SignalKey, FeatureQuery> TabGroupSyncPromo::GetInputs() { + std::map<SignalKey, FeatureQuery> map = { + {kSyncedTabGroupExists, + FeatureQuery::FromCustomInput(MetadataWriter::CustomInput{ + .tensor_length = 1, + .fill_policy = proto::CustomInput::FILL_FROM_INPUT_CONTEXT, + .name = kSyncedTabGroupExists})}, + }; + + DEFINE_UMA_FEATURE_ENUM_COUNT(count, kTabGroupSyncPromoHistogramName, + &kTabGroupSyncPromoId, /* enum_size= */ 1, + /* days= */ 1); + map.emplace(kTabGroupSyncPromoShownCount, std::move(count)); + + return map; +} + +CardSelectionInfo::ShowResult TabGroupSyncPromo::ComputeCardResult( + const CardSelectionSignals& signals) const { + // Check for a forced `ShowResult`. + std::optional<CardSelectionInfo::ShowResult> forced_result = + GetForcedEphemeralModuleShowResult(); + + if (forced_result.has_value() && + forced_result.value().result_label.has_value() && + kTabGroupSyncPromo == forced_result.value().result_label.value()) { + return forced_result.value(); + } + + CardSelectionInfo::ShowResult result; + result.result_label = kTabGroupSyncPromo; + + bool has_been_interacted_with = + profile_prefs_->GetBoolean(kTabGroupSyncPromoInteractedPref); + if (has_been_interacted_with) { + result.position = EphemeralHomeModuleRank::kNotShown; + return result; + } + + std::optional<float> resultForSyncedTabGroupExists = + signals.GetSignal(kSyncedTabGroupExists); + std::optional<float> resultForTabGroupSyncPromoShownCount = + signals.GetSignal(kTabGroupSyncPromoShownCount); + + if (!resultForSyncedTabGroupExists.has_value() || + !resultForTabGroupSyncPromoShownCount.has_value()) { + result.position = EphemeralHomeModuleRank::kNotShown; + return result; + } + + if (*resultForSyncedTabGroupExists && + resultForTabGroupSyncPromoShownCount.value() < kShownCountLimit) { + result.position = EphemeralHomeModuleRank::kTop; + return result; + } + + result.position = EphemeralHomeModuleRank::kNotShown; + return result; +} + +bool TabGroupSyncPromo::IsEnabled(int impression_count) { + std::optional<CardSelectionInfo::ShowResult> forced_result = + GetForcedEphemeralModuleShowResult(); + + if (forced_result.has_value() && + forced_result.value().result_label.has_value() && + kTabGroupSyncPromo == forced_result.value().result_label.value()) { + return true; + } + + if (!base::FeatureList::IsEnabled(features::kEducationalTipModule)) { + return false; + } + + if (impression_count >= features::kMaxTabGroupSyncCardImpressions.Get()) { + return false; + } + + return true; +} + +} // namespace segmentation_platform::home_modules
diff --git a/components/segmentation_platform/embedder/home_modules/tab_group_sync_promo.h b/components/segmentation_platform/embedder/home_modules/tab_group_sync_promo.h new file mode 100644 index 0000000..41d1369 --- /dev/null +++ b/components/segmentation_platform/embedder/home_modules/tab_group_sync_promo.h
@@ -0,0 +1,36 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SEGMENTATION_PLATFORM_EMBEDDER_HOME_MODULES_TAB_GROUP_SYNC_PROMO_H_ +#define COMPONENTS_SEGMENTATION_PLATFORM_EMBEDDER_HOME_MODULES_TAB_GROUP_SYNC_PROMO_H_ + +#include "components/prefs/pref_service.h" +#include "components/segmentation_platform/embedder/home_modules/card_selection_info.h" + +namespace segmentation_platform::home_modules { + +// 'TabGroupSyncPromo' is a class that represents an ephemeral home module, +// specifically designed for the tab group sync promo card found in the +// educational tip section on chrome android. It is responsible for determining +// whether the module should be shown to the user based on the enable signal and +// the user's interaction history. +class TabGroupSyncPromo : public CardSelectionInfo { + public: + explicit TabGroupSyncPromo(PrefService* profile_prefs); + ~TabGroupSyncPromo() override = default; + + static bool IsEnabled(int impression_count); + + // CardSelectionInfo + std::map<SignalKey, FeatureQuery> GetInputs() override; + ShowResult ComputeCardResult( + const CardSelectionSignals& signals) const override; + + private: + raw_ptr<PrefService> profile_prefs_; +}; + +} // namespace segmentation_platform::home_modules + +#endif // COMPONENTS_SEGMENTATION_PLATFORM_EMBEDDER_HOME_MODULES_TAB_GROUP_SYNC_PROMO_H_
diff --git a/components/segmentation_platform/embedder/home_modules/tab_group_sync_promo_unittest.cc b/components/segmentation_platform/embedder/home_modules/tab_group_sync_promo_unittest.cc new file mode 100644 index 0000000..064fdf0 --- /dev/null +++ b/components/segmentation_platform/embedder/home_modules/tab_group_sync_promo_unittest.cc
@@ -0,0 +1,106 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/segmentation_platform/embedder/home_modules/tab_group_sync_promo.h" + +#include "components/prefs/testing_pref_service.h" +#include "components/segmentation_platform/embedder/home_modules/card_selection_signals.h" +#include "components/segmentation_platform/embedder/home_modules/constants.h" +#include "components/segmentation_platform/embedder/home_modules/home_modules_card_registry.h" +#include "components/segmentation_platform/embedder/home_modules/test_utils.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace segmentation_platform::home_modules { + +// Tests TabGroupSyncPromo's functionality. +class TabGroupSyncPromoTest : public testing::Test { + public: + TabGroupSyncPromoTest() = default; + ~TabGroupSyncPromoTest() override = default; + + void SetUp() override { + HomeModulesCardRegistry::RegisterProfilePrefs(pref_service_.registry()); + } + + void TearDown() override { Test::TearDown(); } + + protected: + TestingPrefServiceSimple pref_service_; +}; + +// Verifies that the `GetInputs(…)` method returns the expected inputs. +TEST_F(TabGroupSyncPromoTest, GetInputsReturnsExpectedInputs) { + auto card = std::make_unique<TabGroupSyncPromo>(&pref_service_); + std::map<SignalKey, FeatureQuery> inputs = card->GetInputs(); + EXPECT_EQ(inputs.size(), 2u); + // Verify that the inputs map contains the expected keys. + EXPECT_NE(inputs.find(segmentation_platform::kSyncedTabGroupExists), + inputs.end()); + EXPECT_NE(inputs.find(segmentation_platform::kTabGroupSyncPromoShownCount), + inputs.end()); +} + +// Validates that ComputeCardResult() returns kTop when tab group sync promo +// card is enabled. +TEST_F(TabGroupSyncPromoTest, TestComputeCardResultWithCardEnabled) { + pref_service_.SetUserPref(kTabGroupSyncPromoInteractedPref, + std::make_unique<base::Value>(false)); + auto card = std::make_unique<TabGroupSyncPromo>(&pref_service_); + AllCardSignals all_signals = + CreateAllCardSignals(card.get(), {/* kSyncedTabGroupExists */ 1, + /* kTabGroupSyncPromoShownCount */ 0}); + CardSelectionSignals card_signal(&all_signals, kTabGroupSyncPromo); + CardSelectionInfo::ShowResult result = card->ComputeCardResult(card_signal); + EXPECT_EQ(EphemeralHomeModuleRank::kTop, result.position); +} + +// Validates that when the tab group sync promo card is disabled because the +// user does not have synced tab group, the ComputeCardResult() function returns +// kNotShown. +TEST_F(TabGroupSyncPromoTest, + TestComputeCardResultWithCardDisabledForSyncedTabGroupNotExists) { + pref_service_.SetUserPref(kTabGroupSyncPromoInteractedPref, + std::make_unique<base::Value>(false)); + auto card = std::make_unique<TabGroupSyncPromo>(&pref_service_); + AllCardSignals all_signals = + CreateAllCardSignals(card.get(), {/* kSyncedTabGroupExists */ 0, + /* kTabGroupSyncPromoShownCount */ 0}); + CardSelectionSignals card_signal(&all_signals, kTabGroupSyncPromo); + CardSelectionInfo::ShowResult result = card->ComputeCardResult(card_signal); + EXPECT_EQ(EphemeralHomeModuleRank::kNotShown, result.position); +} + +// Validates that the ComputeCardResult() function returns kNotShown when the +// card has been displayed to the user more times than the single day limit +// allows. +TEST_F(TabGroupSyncPromoTest, + TestComputeCardResultWithCardDisabledForHasReachedSessionLimit) { + pref_service_.SetUserPref(kTabGroupSyncPromoInteractedPref, + std::make_unique<base::Value>(false)); + auto card = std::make_unique<TabGroupSyncPromo>(&pref_service_); + AllCardSignals all_signals = + CreateAllCardSignals(card.get(), {/* kSyncedTabGroupExists */ 1, + /* kTabGroupSyncPromoShownCount */ 3}); + CardSelectionSignals card_signal(&all_signals, kTabGroupSyncPromo); + CardSelectionInfo::ShowResult result = card->ComputeCardResult(card_signal); + EXPECT_EQ(EphemeralHomeModuleRank::kNotShown, result.position); +} + +// Validates that the ComputeCardResult() function returns kNotShown when the +// tab group sync promo card is disabled because the user already interacted +// with the card. +TEST_F(TabGroupSyncPromoTest, + TestComputeCardResultWithCardDisabledForUserInteraction) { + pref_service_.SetUserPref(kTabGroupSyncPromoInteractedPref, + std::make_unique<base::Value>(true)); + auto card = std::make_unique<TabGroupSyncPromo>(&pref_service_); + AllCardSignals all_signals = + CreateAllCardSignals(card.get(), {/* kSyncedTabGroupExists */ 1, + /* kTabGroupSyncPromoShownCount */ 0}); + CardSelectionSignals card_signal(&all_signals, kTabGroupSyncPromo); + CardSelectionInfo::ShowResult result = card->ComputeCardResult(card_signal); + EXPECT_EQ(EphemeralHomeModuleRank::kNotShown, result.position); +} + +} // namespace segmentation_platform::home_modules
diff --git a/components/segmentation_platform/public/features.cc b/components/segmentation_platform/public/features.cc index 30f78fe8..78da2e29e 100644 --- a/components/segmentation_platform/public/features.cc +++ b/components/segmentation_platform/public/features.cc
@@ -243,5 +243,8 @@ constexpr base::FeatureParam<int> kMaxTabGroupCardImpressions{ &kEducationalTipModule, "max_tab_group_card_impressions", /*default_value=*/10}; +constexpr base::FeatureParam<int> kMaxTabGroupSyncCardImpressions{ + &kEducationalTipModule, "max_tab_group_sync_card_impressions", + /*default_value=*/10}; } // namespace segmentation_platform::features
diff --git a/components/segmentation_platform/public/features.h b/components/segmentation_platform/public/features.h index 5e8390d..bd23761 100644 --- a/components/segmentation_platform/public/features.h +++ b/components/segmentation_platform/public/features.h
@@ -156,6 +156,9 @@ // The maximum number of times the tab group promo card can be visible to the // user. extern const base::FeatureParam<int> kMaxTabGroupCardImpressions; +// The maximum number of times the tab group sync promo card can be visible to +// the user. +extern const base::FeatureParam<int> kMaxTabGroupSyncCardImpressions; } // namespace segmentation_platform::features
diff --git a/components/services/app_service/public/cpp/app_registry_cache.cc b/components/services/app_service/public/cpp/app_registry_cache.cc index 25bba97..3d2fa8c 100644 --- a/components/services/app_service/public/cpp/app_registry_cache.cc +++ b/components/services/app_service/public/cpp/app_registry_cache.cc
@@ -114,11 +114,8 @@ in_progress_initialized_app_types_.clear(); published_app_types_.clear(); - // On most platforms, we can't clear initialized_app_types_ here as observers + // We can't clear initialized_app_types_ here as observers // expect each type to be initialized only once. -#if BUILDFLAG(IS_CHROMEOS_LACROS) - initialized_app_types_.clear(); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) } void AppRegistryCache::OnAppsForTesting(std::vector<AppPtr> deltas,
diff --git a/components/services/storage/indexed_db/locks/partitioned_lock_manager.cc b/components/services/storage/indexed_db/locks/partitioned_lock_manager.cc index d52a40f..ca35d2ba 100644 --- a/components/services/storage/indexed_db/locks/partitioned_lock_manager.cc +++ b/components/services/storage/indexed_db/locks/partitioned_lock_manager.cc
@@ -17,8 +17,10 @@ #include "base/functional/callback.h" #include "base/location.h" #include "base/memory/weak_ptr.h" +#include "base/metrics/histogram_functions.h" #include "base/ranges/algorithm.h" #include "base/task/sequenced_task_runner.h" +#include "base/time/time.h" #include "components/services/storage/indexed_db/locks/partitioned_lock.h" #include "components/services/storage/indexed_db/locks/partitioned_lock_id.h" @@ -68,6 +70,10 @@ return request_queue_.size(); } +int64_t PartitionedLockManager::RequestsWaitingForMetrics() const { + return request_queue_.size(); +} + void PartitionedLockManager::AcquireLocks( base::flat_set<PartitionedLockRequest> lock_requests, PartitionedLockHolder& locks_holder, @@ -190,12 +196,21 @@ std::vector<PartitionedLockId> PartitionedLockManager::GetUnacquirableLocks( std::vector<PartitionedLockRequest>& lock_requests) { + base::TimeTicks start = base::TimeTicks::Now(); std::vector<PartitionedLockId> lock_ids; for (PartitionedLockRequest& request : lock_requests) { if (TestLock(request) == TestLockResult::kLocked) { lock_ids.push_back(request.lock_id); } } + base::TimeDelta duration = base::TimeTicks::Now() - start; + if (duration > base::Milliseconds(2)) { + base::UmaHistogramTimes("IndexedDB.GetUnacquirableLocksLongTimes", + duration); + base::UmaHistogramCounts100000( + "IndexedDB.GetUnacquirableLocksRequestQueueSize", + request_queue_.size()); + } return lock_ids; } @@ -257,17 +272,26 @@ } void PartitionedLockManager::LockRequestCancelled() { + base::TimeTicks start = base::TimeTicks::Now(); auto remove_iter = base::ranges::remove_if( request_queue_, [](AcquisitionRequest& request) { return !request.locks_holder; }); if (remove_iter == request_queue_.end()) { return; } + const size_t request_queue_size = request_queue_.size(); // Iterate through the entire queue starting from the erased element, as any // subsequent queued request could now be free to start. for (auto iter = request_queue_.erase(remove_iter, request_queue_.end()); iter != request_queue_.end(); MaybeGrantLocksAndIterate(iter)) { } + base::TimeDelta duration = base::TimeTicks::Now() - start; + if (duration > base::Milliseconds(2)) { + base::UmaHistogramTimes("IndexedDB.LockRequestCancelledLongTimes", + duration); + base::UmaHistogramCounts100000( + "IndexedDB.LockRequestCancelledRequestQueueSize", request_queue_size); + } } std::set<PartitionedLockHolder*> PartitionedLockManager::GetBlockedRequests(
diff --git a/components/services/storage/indexed_db/locks/partitioned_lock_manager.h b/components/services/storage/indexed_db/locks/partitioned_lock_manager.h index d20bd72f..5823f978 100644 --- a/components/services/storage/indexed_db/locks/partitioned_lock_manager.h +++ b/components/services/storage/indexed_db/locks/partitioned_lock_manager.h
@@ -69,6 +69,7 @@ int64_t LocksHeldForTesting() const; int64_t RequestsWaitingForTesting() const; + int64_t RequestsWaitingForMetrics() const; // Acquires locks for the given requests. Lock partitions are treated as // completely independent domains.
diff --git a/components/signin/core/browser/account_reconcilor.cc b/components/signin/core/browser/account_reconcilor.cc index aa854c1e..b059aa7 100644 --- a/components/signin/core/browser/account_reconcilor.cc +++ b/components/signin/core/browser/account_reconcilor.cc
@@ -43,10 +43,6 @@ #include "google_apis/gaia/gaia_urls.h" #include "google_apis/gaia/google_service_auth_error.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "components/signin/core/browser/consistency_cookie_manager.h" -#endif - using signin::AccountReconcilorDelegate; using signin::ConsentLevel; using signin_metrics::AccountReconcilorState; @@ -169,10 +165,6 @@ client_(client), account_manager_facade_(account_manager_facade) { VLOG(1) << "AccountReconcilor::AccountReconcilor"; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - consistency_cookie_manager_ = - std::make_unique<signin::ConsistencyCookieManager>(client_, this); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) // Reconcilor is constructed but not initialized. Call `Initialize()` before // using this object. } @@ -910,13 +902,6 @@ return error_during_last_reconcile_; } -#if BUILDFLAG(IS_CHROMEOS_LACROS) -signin::ConsistencyCookieManager* -AccountReconcilor::GetConsistencyCookieManager() { - return consistency_cookie_manager_.get(); -} -#endif - void AccountReconcilor::BlockReconcile() { DCHECK(IsReconcileBlocked()); VLOG(1) << "AccountReconcilor::BlockReconcile.";
diff --git a/components/signin/core/browser/account_reconcilor.h b/components/signin/core/browser/account_reconcilor.h index 22c5b31a..ff5e18fb3 100644 --- a/components/signin/core/browser/account_reconcilor.h +++ b/components/signin/core/browser/account_reconcilor.h
@@ -39,11 +39,6 @@ namespace signin { class AccountReconcilorDelegate; enum class SetAccountsInCookieResult; - -#if BUILDFLAG(IS_CHROMEOS_LACROS) -class ConsistencyCookieManager; -class ConsistencyCookieManagerTest; -#endif } // namespace signin class SigninClient; @@ -170,12 +165,6 @@ // `GoogleServiceAuthError::State::NONE`. GoogleServiceAuthError GetReconcileError() const; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // Gets the ConsistencyCookieManager, which updates the - // "CHROME_ID_CONSISTENCY_STATE" cookie. - signin::ConsistencyCookieManager* GetConsistencyCookieManager(); -#endif - protected: void OnSetAccountsInCookieCompleted( const std::vector<CoreAccountId>& accounts_to_send, @@ -189,10 +178,6 @@ friend class BaseAccountReconcilorTestTable; friend class DiceBrowserTest; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - friend class signin::ConsistencyCookieManagerTest; -#endif - #if BUILDFLAG(ENABLE_MIRROR) FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, ForceReconcileEarlyExitsForInactiveReconcilor); @@ -316,10 +301,10 @@ TableRowTestMultilogin); FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, ReconcileAfterShutdown); FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, UnlockAfterShutdown); -#if BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(ENABLE_DICE_SUPPORT) FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, OnAccountsInCookieUpdatedLogoutInProgress); -#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) FRIEND_TEST_ALL_PREFIXES(AccountReconcilorThrottlerTest, RefillOneRequest); FRIEND_TEST_ALL_PREFIXES(AccountReconcilorThrottlerTest, RefillFiveRequests); FRIEND_TEST_ALL_PREFIXES(AccountReconcilorThrottlerTest, @@ -567,10 +552,6 @@ // Set to true when Shutdown() is called. bool was_shut_down_ = false; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - std::unique_ptr<signin::ConsistencyCookieManager> consistency_cookie_manager_; -#endif - base::WeakPtrFactory<AccountReconcilor> weak_factory_{this}; };
diff --git a/components/signin/core/browser/account_reconcilor_unittest.cc b/components/signin/core/browser/account_reconcilor_unittest.cc index 5fadc00b..15c2e3a8 100644 --- a/components/signin/core/browser/account_reconcilor_unittest.cc +++ b/components/signin/core/browser/account_reconcilor_unittest.cc
@@ -68,10 +68,6 @@ #include "chromeos/ash/components/install_attributes/stub_install_attributes.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "components/signin/core/browser/mirror_landing_account_reconcilor_delegate.h" -#endif - using signin_metrics::AccountReconcilorState; using testing::_; using testing::InSequence; @@ -175,13 +171,8 @@ SigninClient* client) { switch (account_consistency) { case signin::AccountConsistencyMethod::kMirror: -#if BUILDFLAG(IS_CHROMEOS_LACROS) - return std::make_unique<signin::MirrorLandingAccountReconcilorDelegate>( - identity_manager, client->GetInitialPrimaryAccount().has_value()); -#else return std::make_unique<signin::MirrorAccountReconcilorDelegate>( identity_manager); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) case signin::AccountConsistencyMethod::kDisabled: return std::make_unique<signin::AccountReconcilorDelegate>(); case signin::AccountConsistencyMethod::kDice: @@ -836,9 +827,7 @@ } }; -// On Lacros, the reconcilor is always registered as reconcile is always -// enabled. -#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#if !BUILDFLAG(IS_CHROMEOS_ASH) TEST_F(AccountReconcilorMirrorTest, IdentityManagerRegistration) { AccountReconcilor* reconcilor = GetMockReconcilor(); ASSERT_TRUE(reconcilor); @@ -871,7 +860,7 @@ ASSERT_TRUE(reconcilor->IsRegisteredWithIdentityManager()); } -#endif // !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // !BUILDFLAG(IS_CHROMEOS_ASH) TEST_F(AccountReconcilorMirrorTest, ProfileAlreadyConnected) { ConnectProfileToAccount(kFakeEmail); @@ -2063,17 +2052,6 @@ { "*A", "AB", IsFirstReconcile::kBoth, "UA", "*A", "A"}, // Check that the previous case is idempotent. { "*A", "A", IsFirstReconcile::kBoth, "", "*A", "A"}, - -// On Lacros, the reconcilor is enabled even if there is no account, or if the -// primary account is in error. -#if BUILDFLAG(IS_CHROMEOS_LACROS) -{ "", "", IsFirstReconcile::kBoth, "", "", ""}, -{ "*xA", "", IsFirstReconcile::kBoth, "", "*xA", ""}, -{ "*xAB", "", IsFirstReconcile::kBoth, "", "*xAB", ""}, -{ "", "A", IsFirstReconcile::kBoth, "X", "", ""}, -{ "*xA", "A", IsFirstReconcile::kBoth, "X", "*xA", ""}, -{ "*xAB", "AB", IsFirstReconcile::kBoth, "X", "*xAB", ""}, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) }; // clang-format on @@ -2507,11 +2485,7 @@ account_info.email, account_info.gaia, &test_url_loader_factory_); bool expect_logout = -#if BUILDFLAG(IS_CHROMEOS_LACROS) - true; -#else account_consistency == signin::AccountConsistencyMethod::kDice; -#endif if (expect_logout) { EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction()) .Times(1); @@ -2609,22 +2583,12 @@ identity_test_env()->identity_manager(), account_info.account_id, GoogleServiceAuthError(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS)); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction()); -#endif AccountReconcilor* reconcilor = GetMockReconcilor(); signin::SetListAccountsResponseTwoAccounts( account_info.email, account_info.gaia, kFakeEmail2, "67890", &test_url_loader_factory_); reconcilor->StartReconcile(AccountReconcilor::Trigger::kCookieChange); base::RunLoop().RunUntilIdle(); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - ASSERT_TRUE(reconcilor->is_reconcile_started_); - SimulateLogOutFromCookieCompleted(reconcilor, - GoogleServiceAuthError::AuthErrorNone()); - testing::Mock::VerifyAndClearExpectations(GetMockReconcilor()); - base::RunLoop().RunUntilIdle(); -#endif ASSERT_FALSE(reconcilor->is_reconcile_started_); } @@ -3441,17 +3405,11 @@ EXPECT_FALSE(reconcilor->is_reconcile_started_); } -#if BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) -TEST_F(AccountReconcilorTest, OnAccountsInCookieUpdatedLogoutInProgress) { #if BUILDFLAG(ENABLE_DICE_SUPPORT) +TEST_F(AccountReconcilorTest, OnAccountsInCookieUpdatedLogoutInProgress) { signin::AccountConsistencyMethod account_consistency = signin::AccountConsistencyMethod::kDice; SetAccountConsistency(account_consistency); -#else - signin::AccountConsistencyMethod account_consistency = - signin::AccountConsistencyMethod::kMirror; - SetAccountConsistency(account_consistency); -#endif signin::CookieParams cookie_params = { kFakeEmail, signin::GetTestGaiaIdForEmail(kFakeEmail), true /* valid */, false /* signed_out */, true /* verified */}; @@ -3481,7 +3439,7 @@ ASSERT_FALSE(reconcilor->is_reconcile_started_); ASSERT_EQ(AccountReconcilorState::kOk, reconcilor->GetState()); } -#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) class AccountReconcilorThrottlerTest : public AccountReconcilorTest { public:
diff --git a/components/signin/core/browser/chrome_connected_header_helper.cc b/components/signin/core/browser/chrome_connected_header_helper.cc index 8e64016..b4b9804 100644 --- a/components/signin/core/browser/chrome_connected_header_helper.cc +++ b/components/signin/core/browser/chrome_connected_header_helper.cc
@@ -22,11 +22,6 @@ #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/crosapi/mojom/crosapi.mojom.h" -#include "chromeos/lacros/lacros_service.h" -#endif - namespace signin { namespace { @@ -257,11 +252,7 @@ parts.push_back(base::StringPrintf("%s=%s", kConsistencyEnabledByDefaultAttrName, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - "true")); -#else "false")); -#endif return base::JoinString(parts, is_header_request ? "," : ":"); }
diff --git a/components/signin/core/browser/signin_header_helper_unittest.cc b/components/signin/core/browser/signin_header_helper_unittest.cc index ab0673e2..0d71cbd 100644 --- a/components/signin/core/browser/signin_header_helper_unittest.cc +++ b/components/signin/core/browser/signin_header_helper_unittest.cc
@@ -29,11 +29,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/lacros/lacros_service.h" -#include "chromeos/lacros/lacros_test_helper.h" -#endif - #if BUILDFLAG(ENABLE_DICE_SUPPORT) #include "components/signin/core/browser/dice_header_helper.h" #endif @@ -77,14 +72,6 @@ HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry()); privacy_sandbox::RegisterProfilePrefs(prefs_.registry()); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // TODO(crbug.com/40760763): remove this after the rollout. - if (!chromeos::LacrosService::Get()) { - scoped_lacros_test_helper_ = - std::make_unique<chromeos::ScopedLacrosServiceTestHelper>(); - } -#endif - settings_map_ = new HostContentSettingsMap( &prefs_, false /* is_off_the_record */, false /* store_last_modified */, false /* restore_session */, false /* should_record_metrics */); @@ -158,11 +145,7 @@ #endif std::string consistency_enabled_by_default_value() const { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - return "true"; -#else return "false"; -#endif } base::test::TaskEnvironment task_environment_; @@ -175,10 +158,6 @@ sync_preferences::TestingPrefServiceSyncable prefs_; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - std::unique_ptr<chromeos::ScopedLacrosServiceTestHelper> - scoped_lacros_test_helper_; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) scoped_refptr<HostContentSettingsMap> settings_map_; scoped_refptr<content_settings::CookieSettings> cookie_settings_; };
diff --git a/components/signin/internal/identity_manager/primary_account_mutator_impl.cc b/components/signin/internal/identity_manager/primary_account_mutator_impl.cc index d24dd75..9f29efe 100644 --- a/components/signin/internal/identity_manager/primary_account_mutator_impl.cc +++ b/components/signin/internal/identity_manager/primary_account_mutator_impl.cc
@@ -57,12 +57,6 @@ #if !BUILDFLAG(IS_CHROMEOS_ASH) bool is_signin_allowed = pref_service_->GetBoolean(prefs::kSigninAllowed); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // Check that `prefs::kSigninAllowed` has not been set to false in a context - // where Lacros wants to set a Primary Account. Lacros doesn't offer account - // inconsistency - just like Ash. - DCHECK(is_signin_allowed); -#endif if (!is_signin_allowed) return PrimaryAccountError::kSigninNotAllowed; #endif
diff --git a/components/signin/internal/identity_manager/profile_oauth2_token_service_builder.cc b/components/signin/internal/identity_manager/profile_oauth2_token_service_builder.cc index 468ff5a1..85c00e3 100644 --- a/components/signin/internal/identity_manager/profile_oauth2_token_service_builder.cc +++ b/components/signin/internal/identity_manager/profile_oauth2_token_service_builder.cc
@@ -63,16 +63,10 @@ AccountTrackerService* account_tracker_service, network::NetworkConnectionTracker* network_connection_tracker, account_manager::AccountManagerFacade* account_manager_facade, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - bool delete_signin_cookies_on_exit, -#endif bool is_regular_profile) { return std::make_unique<signin::ProfileOAuth2TokenServiceDelegateChromeOS>( signin_client, account_tracker_service, network_connection_tracker, account_manager_facade, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - delete_signin_cookies_on_exit, -#endif is_regular_profile); } #elif BUILDFLAG(ENABLE_DICE_SUPPORT) @@ -132,9 +126,9 @@ account_manager::AccountManagerFacade* account_manager_facade, bool is_regular_profile, #endif // BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(ENABLE_DICE_SUPPORT) bool delete_signin_cookies_on_exit, -#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(ENABLE_DICE_SUPPORT) scoped_refptr<TokenWebData> token_web_data, #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) @@ -159,9 +153,6 @@ return CreateCrOsOAuthDelegate(signin_client, account_tracker_service, network_connection_tracker, account_manager_facade, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - delete_signin_cookies_on_exit, -#endif is_regular_profile); #elif BUILDFLAG(ENABLE_DICE_SUPPORT) // Fall back to |MutableProfileOAuth2TokenServiceDelegate| on all platforms @@ -192,9 +183,9 @@ account_manager::AccountManagerFacade* account_manager_facade, bool is_regular_profile, #endif // BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(ENABLE_DICE_SUPPORT) bool delete_signin_cookies_on_exit, -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(ENABLE_DICE_SUPPORT) scoped_refptr<TokenWebData> token_web_data, #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) @@ -225,9 +216,9 @@ #if BUILDFLAG(IS_CHROMEOS) account_manager_facade, is_regular_profile, #endif // BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(ENABLE_DICE_SUPPORT) delete_signin_cookies_on_exit, -#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(ENABLE_DICE_SUPPORT) token_web_data, #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
diff --git a/components/signin/internal/identity_manager/profile_oauth2_token_service_builder.h b/components/signin/internal/identity_manager/profile_oauth2_token_service_builder.h index f68a895..b5ac6b58 100644 --- a/components/signin/internal/identity_manager/profile_oauth2_token_service_builder.h +++ b/components/signin/internal/identity_manager/profile_oauth2_token_service_builder.h
@@ -61,9 +61,9 @@ account_manager::AccountManagerFacade* account_manager_facade, bool is_regular_profile, #endif // BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(ENABLE_DICE_SUPPORT) bool delete_signin_cookies_on_exit, -#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(ENABLE_DICE_SUPPORT) scoped_refptr<TokenWebData> token_web_data, #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
diff --git a/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos.cc b/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos.cc index 49ba77a1..6ceeebdb 100644 --- a/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos.cc +++ b/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos.cc
@@ -129,18 +129,12 @@ AccountTrackerService* account_tracker_service, network::NetworkConnectionTracker* network_connection_tracker, account_manager::AccountManagerFacade* account_manager_facade, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - bool delete_signin_cookies_on_exit, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) bool is_regular_profile) : ProfileOAuth2TokenServiceDelegate(/*use_backoff=*/true), signin_client_(signin_client), account_tracker_service_(account_tracker_service), network_connection_tracker_(network_connection_tracker), account_manager_facade_(account_manager_facade), -#if BUILDFLAG(IS_CHROMEOS_LACROS) - delete_signin_cookies_on_exit_(delete_signin_cookies_on_exit), -#endif is_regular_profile_(is_regular_profile), weak_factory_(this) { network_connection_tracker_->AddNetworkConnectionObserver(this); @@ -256,20 +250,6 @@ DCHECK(account_manager_facade_); account_manager_facade_->AddObserver(this); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // On Lacros, signin cookies can only be cleared for non-syncing - // secondary profiles, because: - // - the main profile cannot be signed out, - // - clearing cookie does not turn sync off - // Additionally, there is no way for Chrome to "invalidate" a token. In - // particular, the "sync paused" state does not exist. - bool revoke_all_tokens = - delete_signin_cookies_on_exit_ && !is_syncing && - !signin_client_->GetInitialPrimaryAccount().has_value(); - if (revoke_all_tokens) - RevokeAllCredentials(); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - account_manager_facade_->GetAccounts( base::BindOnce(&ProfileOAuth2TokenServiceDelegateChromeOS::OnGetAccounts, weak_factory_.GetWeakPtr())); @@ -484,30 +464,14 @@ void ProfileOAuth2TokenServiceDelegateChromeOS::RevokeCredentialsInternal( const CoreAccountId& account_id) { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - ScopedBatchChange batch(this); - AccountInfo account_info = - account_tracker_service_->GetAccountInfo(account_id); - DCHECK(!account_info.IsEmpty()); - signin_client_->RemoveAccount( - account_manager::AccountKey::FromGaiaId(account_info.gaia)); - ClearAuthError(account_id); -#else - // Signing out of Chrome is not possible on Chrome OS Ash / Lacros. + // Signing out of Chrome is not possible on Chrome OS. NOTREACHED(); -#endif } void ProfileOAuth2TokenServiceDelegateChromeOS::RevokeAllCredentialsInternal( signin_metrics::SourceForRefreshTokenOperation source) { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - DCHECK(!signin_client_->GetInitialPrimaryAccount().has_value()); - ScopedBatchChange batch(this); - signin_client_->RemoveAllAccounts(); -#else - // Signing out of Chrome is not possible on Chrome OS Ash. + // Signing out of Chrome is not possible on Chrome OS. NOTREACHED(); -#endif } void ProfileOAuth2TokenServiceDelegateChromeOS::UpdateAuthError(
diff --git a/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos.h b/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos.h index a70eb7a4..b416d2b9 100644 --- a/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos.h +++ b/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos.h
@@ -37,11 +37,6 @@ AccountTrackerService* account_tracker_service, network::NetworkConnectionTracker* network_connection_tracker, account_manager::AccountManagerFacade* account_manager_facade, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // |delete_signin_cookies_on_exit| is used on startup, in case the - // cookies were not properly cleared on last exit. - bool delete_signin_cookies_on_exit, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) bool is_regular_profile); ProfileOAuth2TokenServiceDelegateChromeOS( @@ -116,10 +111,6 @@ // A cache of AccountKeys. std::set<account_manager::AccountKey> account_keys_; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - const bool delete_signin_cookies_on_exit_; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - // Is |this| attached to a regular (non-Signin && non-LockScreen) Profile. const bool is_regular_profile_;
diff --git a/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos_unittest.cc b/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos_unittest.cc index fca1082b..8b61b30 100644 --- a/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos_unittest.cc +++ b/components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos_unittest.cc
@@ -164,16 +164,6 @@ token_service_observation_{this}; }; -#if BUILDFLAG(IS_CHROMEOS_LACROS) -class MockTestSigninClient : public testing::StrictMock<TestSigninClient> { - public: - explicit MockTestSigninClient(PrefService* pref_service) - : testing::StrictMock<TestSigninClient>(pref_service) {} - - MOCK_METHOD(void, RemoveAllAccounts, (), (override)); -}; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - } // namespace class ProfileOAuth2TokenServiceDelegateChromeOSTest : public testing::Test { @@ -193,11 +183,7 @@ AccountTrackerService::RegisterPrefs(pref_service_.registry()); AccountManager::RegisterPrefs(pref_service_.registry()); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - client_ = std::make_unique<MockTestSigninClient>(&pref_service_); -#else client_ = std::make_unique<TestSigninClient>(&pref_service_); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) account_manager_.Initialize(tmp_dir_.GetPath(), client_->GetURLLoaderFactory(), @@ -227,9 +213,6 @@ client_.get(), &account_tracker_service_, network::TestNetworkConnectionTracker::GetInstance(), account_manager_facade_.get(), -#if BUILDFLAG(IS_CHROMEOS_LACROS) - delete_signin_cookies_on_exit, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) /*is_regular_profile=*/true); delegate_->SetOnRefreshTokenRevokedNotified(base::DoNothing()); @@ -372,61 +355,9 @@ base::BindRepeating( [](base::OnceClosure closure) -> void { std::move(closure).Run(); }); sync_preferences::TestingPrefServiceSyncable pref_service_; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - std::unique_ptr<MockTestSigninClient> client_; -#else std::unique_ptr<TestSigninClient> client_; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) }; -#if BUILDFLAG(IS_CHROMEOS_LACROS) -// Tests |RemoveAllAccounts| is not called on startup if -// |delete_signin_cookies_on_exit| is false. -TEST_F(ProfileOAuth2TokenServiceDelegateChromeOSTest, - CookieNotClearedOnStartup) { - EXPECT_FALSE(client_->GetInitialPrimaryAccount().has_value()); - EXPECT_CALL(*(client_.get()), RemoveAllAccounts()).Times(0); - ResetProfileOAuth2TokenServiceDelegateChromeOS( - /*delete_signin_cookies_on_exit=*/false, /*is_syncing=*/false); -} - -TEST_F(ProfileOAuth2TokenServiceDelegateChromeOSTest, - CookieClearedOnStartupSecondaryNonSyncingProfile) { - EXPECT_FALSE(client_->GetInitialPrimaryAccount().has_value()); - EXPECT_CALL(*(client_.get()), RemoveAllAccounts()).Times(1); - ResetProfileOAuth2TokenServiceDelegateChromeOS( - /*delete_signin_cookies_on_exit=*/true, /*is_syncing=*/false); -} - -// Test that |delete_signin_cookies_on_exit| does nothing if the profile -// is syncing. -TEST_F(ProfileOAuth2TokenServiceDelegateChromeOSTest, - CookieNotClearedOnStartupSyncingProfile) { - EXPECT_FALSE(client_->GetInitialPrimaryAccount().has_value()); - EXPECT_CALL(*(client_.get()), RemoveAllAccounts()).Times(0); - ResetProfileOAuth2TokenServiceDelegateChromeOS( - /*delete_signin_cookies_on_exit=*/true, /*is_syncing=*/true); -} - -// Test that |delete_signin_cookies_on_exit| does nothing for the main profile. -TEST_F(ProfileOAuth2TokenServiceDelegateChromeOSTest, - CookieNotClearedOnStartupMainProfile) { - // The delegate figures out that the profile is the main profile by checking - // if the |SigninClient| has an initial primary account set. - client_->SetInitialPrimaryAccountForTests( - account_manager::Account{ - account_manager::AccountKey{kGaiaId, - account_manager::AccountType::kGaia}, - kUserEmail}, - /*is_child=*/false); - EXPECT_TRUE(client_->GetInitialPrimaryAccount().has_value()); - - EXPECT_CALL(*(client_.get()), RemoveAllAccounts()).Times(0); - ResetProfileOAuth2TokenServiceDelegateChromeOS( - /*delete_signin_cookies_on_exit=*/true, /*is_syncing=*/false); -} -#endif - // Refresh tokens should load successfully for non-regular (Signin and Lock // Screen) Profiles. TEST_F(ProfileOAuth2TokenServiceDelegateChromeOSTest, @@ -441,9 +372,6 @@ client_.get(), &account_tracker_service_, network::TestNetworkConnectionTracker::GetInstance(), account_manager_facade_.get(), -#if BUILDFLAG(IS_CHROMEOS_LACROS) - /*delete_signin_cookies_on_exit=*/false, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) /*is_regular_profile=*/false); TestOAuth2TokenServiceObserver observer(delegate.get()); @@ -712,9 +640,6 @@ client_.get(), &account_tracker_service_, network::TestNetworkConnectionTracker::GetInstance(), account_manager_facade.get(), -#if BUILDFLAG(IS_CHROMEOS_LACROS) - /*delete_signin_cookies_on_exit=*/false, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS /*is_regular_profile=*/true); delegate->LoadCredentials(account1.account_id /* primary_account_id */, /*is_syncing=*/false);
diff --git a/components/signin/public/base/signin_client.h b/components/signin/public/base/signin_client.h index fd53769..c250a3dd 100644 --- a/components/signin/public/base/signin_client.h +++ b/components/signin/public/base/signin_client.h
@@ -23,10 +23,6 @@ #include "third_party/abseil-cpp/absl/types/variant.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "components/account_manager_core/account.h" -#endif - #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) namespace signin { class BoundSessionOAuthMultiLoginDelegate; @@ -135,23 +131,6 @@ GaiaAuthConsumer* consumer, gaia::GaiaSource source) = 0; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // Returns an account used to sign into Chrome OS session if available. - virtual std::optional<account_manager::Account> - GetInitialPrimaryAccount() = 0; - - // Returns whether account used to sign into Chrome OS is a child account. - // Returns nullopt for secondary / non-main profiles in LaCrOS. - virtual std::optional<bool> IsInitialPrimaryAccountChild() const = 0; - - // Remove account. - virtual void RemoveAccount( - const account_manager::AccountKey& account_key) = 0; - - // Removes all accounts. - virtual void RemoveAllAccounts() = 0; -#endif - // Returns the channel for the client installation. virtual version_info::Channel GetClientChannel() = 0;
diff --git a/components/signin/public/base/test_signin_client.cc b/components/signin/public/base/test_signin_client.cc index 176d833d..3b2d53ea 100644 --- a/components/signin/public/base/test_signin_client.cc +++ b/components/signin/public/base/test_signin_client.cc
@@ -16,12 +16,6 @@ #include "services/network/test/test_cookie_manager.h" #include "testing/gtest/include/gtest/gtest.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include <optional> - -#include "components/account_manager_core/account.h" -#endif - TestWaitForNetworkCallbackHelper::TestWaitForNetworkCallbackHelper() = default; TestWaitForNetworkCallbackHelper::~TestWaitForNetworkCallbackHelper() = default; @@ -156,26 +150,3 @@ bound_session_delegate_factory_ = std::move(factory); } #endif - -#if BUILDFLAG(IS_CHROMEOS_LACROS) -std::optional<account_manager::Account> -TestSigninClient::GetInitialPrimaryAccount() { - return initial_primary_account_; -} - -std::optional<bool> TestSigninClient::IsInitialPrimaryAccountChild() const { - return is_initial_primary_account_child_; -} - -void TestSigninClient::SetInitialPrimaryAccountForTests( - const account_manager::Account& account, - const std::optional<bool>& is_child) { - initial_primary_account_ = std::make_optional(account); - is_initial_primary_account_child_ = is_child; -} - -void TestSigninClient::RemoveAccount( - const account_manager::AccountKey& account_key) {} -void TestSigninClient::RemoveAllAccounts() {} - -#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
diff --git a/components/signin/public/base/test_signin_client.h b/components/signin/public/base/test_signin_client.h index a0597d4..7e9f8e62 100644 --- a/components/signin/public/base/test_signin_client.h +++ b/components/signin/public/base/test_signin_client.h
@@ -24,12 +24,6 @@ #include "services/network/test/test_network_context.h" #include "services/network/test/test_url_loader_factory.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include <optional> - -#include "components/account_manager_core/account.h" -#endif - #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) #include "components/signin/public/base/bound_session_oauth_multilogin_delegate.h" #endif @@ -137,17 +131,6 @@ factory); #endif // BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) -#if BUILDFLAG(IS_CHROMEOS_LACROS) - std::optional<account_manager::Account> GetInitialPrimaryAccount() override; - std::optional<bool> IsInitialPrimaryAccountChild() const override; - - void SetInitialPrimaryAccountForTests(const account_manager::Account& account, - const std::optional<bool>& is_child); - void RemoveAccount(const account_manager::AccountKey& account_key) override; - - void RemoveAllAccounts() override; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - private: #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) using BoundSessionOauthMultiloginDelegateFactory = base::RepeatingCallback< @@ -169,11 +152,6 @@ #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) BoundSessionOauthMultiloginDelegateFactory bound_session_delegate_factory_; #endif // BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - std::optional<account_manager::Account> initial_primary_account_; - std::optional<bool> is_initial_primary_account_child_; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) }; #endif // COMPONENTS_SIGNIN_PUBLIC_BASE_TEST_SIGNIN_CLIENT_H_
diff --git a/components/signin/public/identity_manager/identity_manager.cc b/components/signin/public/identity_manager/identity_manager.cc index c18043d..325b697 100644 --- a/components/signin/public/identity_manager/identity_manager.cc +++ b/components/signin/public/identity_manager/identity_manager.cc
@@ -39,69 +39,8 @@ #include "components/signin/internal/identity_manager/mutable_profile_oauth2_token_service_delegate.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "components/account_manager_core/account.h" -#include "components/signin/public/identity_manager/tribool.h" -#endif - namespace signin { -namespace { - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - -void SetPrimaryAccount(IdentityManager* identity_manager, - AccountTrackerService* account_tracker_service, - SigninClient* signin_client, - const account_manager::Account& device_account, - signin::Tribool device_account_is_child, - ConsentLevel requested_level) { - if (device_account.key.account_type() != account_manager::AccountType::kGaia) - return; - - // An account can be set as the Primary Account only if it exists in - // `AccountTrackerService`. However, for the first run, when accounts have not - // yet been received from `AccountManagerFacade`, entities can ask about the - // Primary Account and expect it to be available pretty early. Manually seed - // the account in `AccountTrackerService` to get around this issue. - const CoreAccountId device_account_id = - account_tracker_service->SeedAccountInfo( - /*gaia=*/device_account.key.id(), device_account.raw_email); - - const CoreAccountId primary_account_id = - identity_manager->GetPrimaryAccountId(requested_level); - DCHECK(signin_client); - - if (primary_account_id == device_account_id) { - identity_manager->GetAccountsMutator()->UpdateAccountInfo( - device_account_id, device_account_is_child, signin::Tribool::kUnknown); - - return; // Already correct primary account set, nothing to do. - } - - if (!primary_account_id.empty()) { - // Different primary account found, have to clear it first. - // TODO(crbug.com/40774609): Replace this if with a CHECK after all - // the existing users have been migrated. - identity_manager->GetPrimaryAccountMutator()->ClearPrimaryAccount( - signin_metrics::ProfileSignout::kAccountRemovedFromDevice); - } - - PrimaryAccountMutator::PrimaryAccountError error = - identity_manager->GetPrimaryAccountMutator()->SetPrimaryAccount( - device_account_id, requested_level); - identity_manager->GetAccountsMutator()->UpdateAccountInfo( - device_account_id, device_account_is_child, signin::Tribool::kUnknown); - CHECK_EQ(PrimaryAccountMutator::PrimaryAccountError::kNoError, error) - << "SetPrimaryAccount error: " << static_cast<int>(error); - CHECK(identity_manager->HasPrimaryAccount(requested_level)); - CHECK_EQ(identity_manager->GetPrimaryAccountInfo(requested_level).gaia, - device_account.key.id()); -} -#endif - -} // namespace - IdentityManager::InitParameters::InitParameters() = default; IdentityManager::InitParameters::InitParameters(InitParameters&&) = default; @@ -160,27 +99,6 @@ base::android::AttachCurrentThread(), reinterpret_cast<intptr_t>(this), token_service_->GetDelegate()->GetJavaObject()); #endif - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // We need to set the Primary Account in Lacros. In Ash, this happens in - // `UserSessionManager::InitProfilePreferences`, before anyone starts using - // Profile / KeyedServices - but with the availability of IdentityManager. We - // don't have such a place in Lacros - which guarantees that the Primary - // Account will be available on startup - just like Ash. - std::optional<account_manager::Account> initial_account = - signin_client_->GetInitialPrimaryAccount(); - if (initial_account.has_value()) { - const std::optional<bool>& initial_account_is_child = - signin_client_->IsInitialPrimaryAccountChild(); - CHECK(initial_account_is_child.has_value()); - SetPrimaryAccount(this, account_tracker_service_.get(), signin_client_, - initial_account.value(), - initial_account_is_child.value() - ? signin::Tribool::kTrue - : signin::Tribool::kFalse, - ConsentLevel::kSignin); - } -#endif } IdentityManager::~IdentityManager() {
diff --git a/components/signin/public/identity_manager/identity_manager_builder.cc b/components/signin/public/identity_manager/identity_manager_builder.cc index 8c86163..b9b7f83e 100644 --- a/components/signin/public/identity_manager/identity_manager_builder.cc +++ b/components/signin/public/identity_manager/identity_manager_builder.cc
@@ -117,9 +117,9 @@ #if BUILDFLAG(IS_CHROMEOS) params->account_manager_facade, params->is_regular_profile, #endif // BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(ENABLE_DICE_SUPPORT) params->delete_signin_cookies_on_exit, -#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(ENABLE_DICE_SUPPORT) params->token_web_data, #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
diff --git a/components/signin/public/identity_manager/identity_manager_builder.h b/components/signin/public/identity_manager/identity_manager_builder.h index 7012394d..09d6c32 100644 --- a/components/signin/public/identity_manager/identity_manager_builder.h +++ b/components/signin/public/identity_manager/identity_manager_builder.h
@@ -72,7 +72,7 @@ std::unique_ptr<ProfileOAuth2TokenService> token_service; std::unique_ptr<AccountTrackerService> account_tracker_service; -#if BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(ENABLE_DICE_SUPPORT) bool delete_signin_cookies_on_exit = false; #endif
diff --git a/components/signin/public/identity_manager/identity_manager_unittest.cc b/components/signin/public/identity_manager/identity_manager_unittest.cc index f0cec02..72c372e 100644 --- a/components/signin/public/identity_manager/identity_manager_unittest.cc +++ b/components/signin/public/identity_manager/identity_manager_unittest.cc
@@ -2339,49 +2339,6 @@ EXPECT_TRUE(identity_manager()->AreRefreshTokensLoaded()); } -#if BUILDFLAG(IS_CHROMEOS_LACROS) -TEST_F(IdentityManagerTest, SetPrimaryAccount) { - signin_client()->SetInitialPrimaryAccountForTests( - account_manager::Account{ - account_manager::AccountKey{kTestGaiaId, - account_manager::AccountType::kGaia}, - kTestEmail}, - /*is_child=*/false); - // Do not sign into a primary account as part of the test setup. - RecreateIdentityManager(AccountConsistencyMethod::kDisabled, - PrimaryAccountManagerSetup::kNoAuthenticatedAccount); - - // We should have a non-syncing Primary Account set up automatically. - ASSERT_TRUE(identity_manager()->HasPrimaryAccount(ConsentLevel::kSignin)); - ASSERT_FALSE(identity_manager()->HasPrimaryAccount(ConsentLevel::kSync)); - EXPECT_EQ( - kTestGaiaId, - identity_manager()->GetPrimaryAccountInfo(ConsentLevel::kSignin).gaia); -} - -// TODO(crbug.com/40774609): Remove this when all the users are migrated. -TEST_F(IdentityManagerTest, SetPrimaryAccountClearsExistingPrimaryAccount) { - signin_client()->SetInitialPrimaryAccountForTests( - account_manager::Account{ - account_manager::AccountKey{kTestGaiaId2, - account_manager::AccountType::kGaia}, - kTestEmail2}, - /*is_child=*/false); - - // RecreateIdentityManager will create PrimaryAccountManager with the primary - // account set to kTestGaiaId. After that, IdentityManager ctor should clear - // this existing primary account and set the new one to the initial value - // provided by the SigninClient. - RecreateIdentityManager(AccountConsistencyMethod::kDisabled, - PrimaryAccountManagerSetup::kWithAuthenticatedAccout); - ASSERT_TRUE(identity_manager()->HasPrimaryAccount(ConsentLevel::kSignin)); - ASSERT_FALSE(identity_manager()->HasPrimaryAccount(ConsentLevel::kSync)); - EXPECT_EQ( - kTestGaiaId2, - identity_manager()->GetPrimaryAccountInfo(ConsentLevel::kSignin).gaia); -} -#endif - // Checks that IdentityManager::Observer gets OnAccountUpdated when account info // is updated. TEST_F(IdentityManagerTest, ObserveOnAccountUpdated) {
diff --git a/components/signin/public/identity_manager/identity_test_environment.cc b/components/signin/public/identity_manager/identity_test_environment.cc index fc318d87..7f0d24f5a 100644 --- a/components/signin/public/identity_manager/identity_test_environment.cc +++ b/components/signin/public/identity_manager/identity_test_environment.cc
@@ -52,10 +52,6 @@ #include "components/signin/internal/identity_manager/test_profile_oauth2_token_service_delegate_chromeos.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "components/account_manager_core/chromeos/account_manager_facade_factory.h" -#endif - #if BUILDFLAG(IS_IOS) #include "components/signin/internal/identity_manager/device_accounts_synchronizer_impl.h" #include "components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_ios.h"
diff --git a/components/signin/public/identity_manager/identity_test_utils.cc b/components/signin/public/identity_manager/identity_test_utils.cc index c17bf51..fbcd358 100644 --- a/components/signin/public/identity_manager/identity_test_utils.cc +++ b/components/signin/public/identity_manager/identity_test_utils.cc
@@ -36,10 +36,6 @@ #include "components/account_manager_core/account_manager_facade.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "components/account_manager_core/chromeos/account_manager_facade_factory.h" -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - #if BUILDFLAG(IS_ANDROID) #include "components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_android.h" #include "components/signin/public/android/test_support_jni_headers/AccountManagerFacadeUtil_jni.h" @@ -51,22 +47,6 @@ namespace { -#if BUILDFLAG(IS_CHROMEOS) -// Whether identity_test_utils uses `AccountManagerFacade` or -// `ProfileOAuth2TokenService` for managing credentials. -bool ShouldUseAccountManagerFacade(IdentityManager* identity_manager) { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // If account consistency is `kMirror` - use `AccountManagerFacade` for - // managing credentials, otherwise use `ProfileOAuth2TokenService`. - return identity_manager->GetAccountConsistency() == - AccountConsistencyMethod::kMirror; -#else - // In Ash - always use `AccountManagerFacade` for managing credentials. - return true; -#endif -} -#endif // BUILDFLAG(IS_CHROMEOS) - // Helper function that updates the refresh token for |account_id| to // |new_token|. Before updating the refresh token, blocks until refresh tokens // are loaded. After updating the token, blocks until the update is processed by @@ -98,28 +78,23 @@ token_updated_observer.SetOnRefreshTokenUpdatedCallback( run_loop.QuitClosure()); - // TODO(crbug.com/40776160): simplify this when all Lacros Profiles use - // Mirror. #if BUILDFLAG(IS_CHROMEOS) - if (ShouldUseAccountManagerFacade(identity_manager)) { - const AccountInfo& account_info = - account_tracker_service->GetAccountInfo(account_id); - account_manager::Account account{ - account_manager::AccountKey{account_info.gaia, - account_manager::AccountType::kGaia}, - account_info.email}; - GetAccountManagerFacade(identity_manager) - ->UpsertAccountForTesting(account, new_token); - } else -#endif // BUILDFLAG(IS_CHROMEOS) - { - token_service->UpdateCredentials(account_id, new_token, source + const AccountInfo& account_info = + account_tracker_service->GetAccountInfo(account_id); + account_manager::Account account{ + account_manager::AccountKey{account_info.gaia, + account_manager::AccountType::kGaia}, + account_info.email}; + GetAccountManagerFacade(identity_manager) + ->UpsertAccountForTesting(account, new_token); +#else + token_service->UpdateCredentials(account_id, new_token, source #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) - , - wrapped_binding_key + , + wrapped_binding_key #endif // BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) - ); - } + ); +#endif // BUILDFLAG(IS_CHROMEOS) run_loop.Run(); } @@ -539,21 +514,15 @@ token_updated_observer.SetOnRefreshTokenRemovedCallback( run_loop.QuitClosure()); - // TODO(crbug.com/40776160): simplify this when all Lacros Profiles use - // Mirror. #if BUILDFLAG(IS_CHROMEOS) - if (ShouldUseAccountManagerFacade(identity_manager)) { - const AccountInfo& account_info = - identity_manager->GetAccountTrackerService()->GetAccountInfo( - account_id); - GetAccountManagerFacade(identity_manager) - ->RemoveAccountForTesting(account_manager::AccountKey{ - account_info.gaia, account_manager::AccountType::kGaia}); - } else + const AccountInfo& account_info = + identity_manager->GetAccountTrackerService()->GetAccountInfo(account_id); + GetAccountManagerFacade(identity_manager) + ->RemoveAccountForTesting(account_manager::AccountKey{ + account_info.gaia, account_manager::AccountType::kGaia}); +#else + identity_manager->GetTokenService()->RevokeCredentials(account_id); #endif // BUILDFLAG(IS_CHROMEOS) - { - identity_manager->GetTokenService()->RevokeCredentials(account_id); - } run_loop.Run(); }
diff --git a/components/signin/public/identity_manager/primary_account_mutator_unittest.cc b/components/signin/public/identity_manager/primary_account_mutator_unittest.cc index b262c9d..9505b45 100644 --- a/components/signin/public/identity_manager/primary_account_mutator_unittest.cc +++ b/components/signin/public/identity_manager/primary_account_mutator_unittest.cc
@@ -578,7 +578,6 @@ primary_account_info.account_id); } -#if !BUILDFLAG(IS_CHROMEOS_LACROS) // Checks that trying to set the primary account fails if setting the primary // account is not allowed. TEST_F(PrimaryAccountMutatorTest, @@ -614,7 +613,6 @@ signin::PrimaryAccountMutator::PrimaryAccountError::kSigninNotAllowed, setPrimaryAccountResult); } -#endif // !BUILDFLAG(IS_CHROMEOS_LACROS) // End of tests of preconditions not being satisfied causing the setting of // the primary account to fail.
diff --git a/components/signin/public/identity_manager/test_accounts.cc b/components/signin/public/identity_manager/test_accounts.cc index d46e0c0..ebd1c892 100644 --- a/components/signin/public/identity_manager/test_accounts.cc +++ b/components/signin/public/identity_manager/test_accounts.cc
@@ -25,7 +25,7 @@ const char kPlatform[] = "mac"; #elif BUILDFLAG(IS_CHROMEOS_ASH) const char kPlatform[] = "chromeos"; -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#elif BUILDFLAG(IS_LINUX) const char kPlatform[] = "linux"; #elif BUILDFLAG(IS_ANDROID) const char kPlatform[] = "android";
diff --git a/components/sync/test/sync_user_settings_mock.h b/components/sync/test/sync_user_settings_mock.h index b9a717b..2ba2556e 100644 --- a/components/sync/test/sync_user_settings_mock.h +++ b/components/sync/test/sync_user_settings_mock.h
@@ -83,10 +83,6 @@ (const override)); #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) - MOCK_METHOD(void, SetAppsSyncEnabledByOs, (bool), (override)); -#endif - MOCK_METHOD(bool, IsCustomPassphraseAllowed, (), (const override)); MOCK_METHOD(bool, IsEncryptEverythingEnabled, (), (const override)); MOCK_METHOD(DataTypeSet, GetAllEncryptedDataTypes, (), (const override));
diff --git a/components/sync_device_info/local_device_info_util.cc b/components/sync_device_info/local_device_info_util.cc index feaa52e..e5e88dc 100644 --- a/components/sync_device_info/local_device_info_util.cc +++ b/components/sync_device_info/local_device_info_util.cc
@@ -108,8 +108,6 @@ DeviceInfo::OsType GetLocalDeviceOSType() { #if BUILDFLAG(IS_CHROMEOS_ASH) return DeviceInfo::OsType::kChromeOsAsh; -#elif BUILDFLAG(IS_CHROMEOS_LACROS) - return DeviceInfo::OsType::kChromeOsLacros; #elif BUILDFLAG(IS_LINUX) return DeviceInfo::OsType::kLinux; #elif BUILDFLAG(IS_ANDROID)
diff --git a/components/variations/client_filterable_state.cc b/components/variations/client_filterable_state.cc index e885b395..ce94386f 100644 --- a/components/variations/client_filterable_state.cc +++ b/components/variations/client_filterable_state.cc
@@ -50,8 +50,6 @@ return Study::PLATFORM_MAC; #elif BUILDFLAG(IS_CHROMEOS_ASH) return Study::PLATFORM_CHROMEOS; -#elif BUILDFLAG(IS_CHROMEOS_LACROS) - return Study::PLATFORM_CHROMEOS_LACROS; #elif BUILDFLAG(IS_ANDROID) return Study::PLATFORM_ANDROID; #elif BUILDFLAG(IS_FUCHSIA)
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc index a967f08..3779b36 100644 --- a/components/variations/service/variations_service.cc +++ b/components/variations/service/variations_service.cc
@@ -96,8 +96,6 @@ return "mac"; #elif BUILDFLAG(IS_CHROMEOS_ASH) return "chromeos"; -#elif BUILDFLAG(IS_CHROMEOS_LACROS) - return "chromeos_lacros"; #elif BUILDFLAG(IS_ANDROID) return "android"; #elif BUILDFLAG(IS_FUCHSIA)
diff --git a/components/variations/service/variations_service.h b/components/variations/service/variations_service.h index a173f352..f2cf9494 100644 --- a/components/variations/service/variations_service.h +++ b/components/variations/service/variations_service.h
@@ -351,11 +351,6 @@ FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, DoNotRetryAfterARetry); FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, DoNotRetryIfInsecureURLIsHTTPS); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // For the test to access |limited_entropy_synthetic_trial_|. - FRIEND_TEST_ALL_PREFIXES(VariationsServiceBrowserTest, - LimitedEntropySyntheticTrialSeedTransfer); -#endif void InitResourceRequestedAllowedNotifier();
diff --git a/components/variations/variations_crash_keys.cc b/components/variations/variations_crash_keys.cc index 23dbbf9..0b38775 100644 --- a/components/variations/variations_crash_keys.cc +++ b/components/variations/variations_crash_keys.cc
@@ -23,7 +23,7 @@ #include "components/variations/synthetic_trials.h" #include "components/variations/variations_switches.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) #include "base/task/thread_pool.h" #include "components/variations/variations_crash_keys_chromeos.h" #endif @@ -105,11 +105,11 @@ // observer calls that happen on a different thread. scoped_refptr<base::SequencedTaskRunner> ui_thread_task_runner_; -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) // Task runner corresponding to a background thread, used for tasks that may // block. scoped_refptr<base::SequencedTaskRunner> background_thread_task_runner_; -#endif // IS_CHROMEOS_ASH || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // IS_CHROMEOS_ASH // A serialized string containing the variations state. std::string variations_string_; @@ -149,10 +149,10 @@ for (const auto& entry : active_groups) { AppendFieldTrial(entry.trial_name, entry.group_name, entry.is_overridden); } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) background_thread_task_runner_ = base::ThreadPool::CreateSequencedTaskRunner( {base::TaskPriority::BEST_EFFORT, base::MayBlock()}); -#endif // IS_CHROMEOS_ASH || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // IS_CHROMEOS_ASH UpdateCrashKeys(); } @@ -252,9 +252,9 @@ variations::switches::kVariationsSeedVersion)); } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) ReportVariationsToChromeOs(background_thread_task_runner_, info); -#endif // IS_CHROMEOS_ASH || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // IS_CHROMEOS_ASH } void VariationsCrashKeys::OnSyntheticTrialsChanged(
diff --git a/components/variations/variations_crash_keys_chromeos.cc b/components/variations/variations_crash_keys_chromeos.cc index 60fa83d..a20758b 100644 --- a/components/variations/variations_crash_keys_chromeos.cc +++ b/components/variations/variations_crash_keys_chromeos.cc
@@ -21,9 +21,6 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) constexpr char kCrashVariationsFileName[] = ".variations-list.txt"; #endif // IS_CHROMEOS_ASH -#if BUILDFLAG(IS_CHROMEOS_LACROS) -constexpr char kCrashVariationsFileName[] = ".variations-list-lacros.txt"; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) void WriteVariationsToFile(ExperimentListInfo info) { std::string combined_string = base::StrCat(
diff --git a/components/web_modal/OWNERS b/components/web_modal/OWNERS index 6ca79f28..eb3e931f 100644 --- a/components/web_modal/OWNERS +++ b/components/web_modal/OWNERS
@@ -1,2 +1,3 @@ -pbos@chromium.org +file://ui/views/OWNERS + wittman@chromium.org
diff --git a/content/browser/devtools/devtools_instrumentation.cc b/content/browser/devtools/devtools_instrumentation.cc index 57ca949..3f870f6 100644 --- a/content/browser/devtools/devtools_instrumentation.cc +++ b/content/browser/devtools/devtools_instrumentation.cc
@@ -228,11 +228,12 @@ protocol::String violation_type = BuildAttributionReportingIssueViolationType( issue_details->violation_type); - CHECK(issue_details->request->url.has_value()); auto request = protocol::Audits::AffectedRequest::Create() - .SetRequestId(issue_details->request->request_id) - .SetUrl(issue_details->request->url.value()) + .SetUrl(issue_details->request->url) .Build(); + if (issue_details->request->request_id.has_value()) { + request->SetRequestId(issue_details->request->request_id.value()); + } auto attribution_reporting_issue_details = protocol::Audits::AttributionReportingIssueDetails::Create() .SetViolationType(violation_type)
diff --git a/content/browser/indexed_db/instance/connection.cc b/content/browser/indexed_db/instance/connection.cc index ca1f197d..efe03ce6 100644 --- a/content/browser/indexed_db/instance/connection.cc +++ b/content/browser/indexed_db/instance/connection.cc
@@ -10,6 +10,7 @@ #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" +#include "base/metrics/histogram_functions.h" #include "base/sequence_checker.h" #include "base/stl_util.h" #include "base/trace_event/base_tracing.h" @@ -131,18 +132,33 @@ return; } + base::TimeTicks start = base::TimeTicks::Now(); + bool can_go_inactive = true; + // If this client is still blocking other clients, leave the keep-actives // alive. for (const auto& [_, transaction] : transactions_) { if (transaction->state() == Transaction::State::STARTED && transaction->IsTransactionBlockingOtherClients( /*consider_priority=*/true)) { - return; + can_go_inactive = false; + break; } } + base::TimeDelta duration = base::TimeTicks::Now() - start; + if (duration > base::Milliseconds(2)) { + base::UmaHistogramTimes("IndexedDB.RemoveTransactionLongTimes", duration); + base::UmaHistogramCounts100000( + "IndexedDB.RemoveTransactionRequestQueueSize", + bucket_context_handle_->lock_manager().RequestsWaitingForMetrics()); + base::UmaHistogramCounts100000( + "IndexedDB.RemoveTransactionConnectionTxnCount", transactions_.size()); + } // Safe to make this client inactive. - client_keep_active_remotes_.Clear(); + if (can_go_inactive) { + client_keep_active_remotes_.Clear(); + } } void Connection::AbortTransactionAndTearDownOnError(
diff --git a/content/browser/indexed_db/instance/transaction.cc b/content/browser/indexed_db/instance/transaction.cc index ffcf3b77..0c18fab 100644 --- a/content/browser/indexed_db/instance/transaction.cc +++ b/content/browser/indexed_db/instance/transaction.cc
@@ -296,7 +296,8 @@ CHECK_EQ(state_, STARTED); std::set<PartitionedLockHolder*> blocked_requests = bucket_context_->lock_manager().GetBlockedRequests(lock_ids()); - return std::ranges::any_of( + base::TimeTicks start = base::TimeTicks::Now(); + const bool is_blocking_others = std::ranges::any_of( blocked_requests, [&](PartitionedLockHolder* blocked_lock_holder) { auto* lock_request_data = static_cast<LockRequestData*>( blocked_lock_holder->GetUserData(LockRequestData::kKey)); @@ -315,6 +316,15 @@ } return lock_request_data->client_token != connection_->client_token(); }); + base::TimeDelta duration = base::TimeTicks::Now() - start; + if (duration > base::Milliseconds(2)) { + base::UmaHistogramTimes("IndexedDB.CalculateBlockingStatusLongTimes", + duration); + base::UmaHistogramCounts100000( + "IndexedDB.CalculateBlockingStatusRequestQueueSize", + bucket_context_->lock_manager().RequestsWaitingForMetrics()); + } + return is_blocking_others; } void Transaction::Start() {
diff --git a/docs/android_build_instructions.md b/docs/android_build_instructions.md index 479795cc..b74e754 100644 --- a/docs/android_build_instructions.md +++ b/docs/android_build_instructions.md
@@ -135,6 +135,7 @@ target_os = "android" target_cpu = "arm64" # See "Figuring out target_cpu" below use_remoteexec = true # Enables distributed builds. See "Faster Builds". +android_static_analysis = "build_server" # Does static checks in background. See "Faster Builds". ``` * You only have to run this once for each new build directory, Ninja will
diff --git a/extensions/browser/api/user_scripts/user_scripts_api.cc b/extensions/browser/api/user_scripts/user_scripts_api.cc index 59ca8a6..af343d03 100644 --- a/extensions/browser/api/user_scripts/user_scripts_api.cc +++ b/extensions/browser/api/user_scripts/user_scripts_api.cc
@@ -38,8 +38,15 @@ constexpr char kInvalidSourceError[] = "User script with ID '*' must specify exactly one of 'code' or 'file' as a " "js source."; +constexpr char kInvalidSourceWithoutIdError[] = + "User script must specify exactly one of 'code' or 'file' as a js source."; constexpr char kMatchesMissingError[] = "User script with ID '*' must specify 'matches'."; +constexpr char kInvalidAllFramesError[] = + "User script must not specify injection to 'all frames' when it has a " + "specific set of 'frameIds' to inject into."; +constexpr char kInvalidInjectionTargetIdsError[] = + "User script must not specify both 'documentIds' and 'frameIds'."; // Sanitizes the given `world_id`, updating it if necessary. // Returns true on success; on failure, returns false and populates `error_out`. @@ -633,6 +640,32 @@ return RespondNow(NoArguments()); } +ExtensionFunction::ResponseAction UserScriptsExecuteFunction::Run() { + std::optional<api::user_scripts::Execute::Params> params( + api::user_scripts::Execute::Params::Create(args())); + EXTENSION_FUNCTION_VALIDATE(params); + EXTENSION_FUNCTION_VALIDATE(extension()); + + injection_ = std::move(params->injection); + + if ((injection_.js.code && injection_.js.file) || + (!injection_.js.code && !injection_.js.file)) { + return RespondNow(Error(kInvalidSourceWithoutIdError)); + } + + if (injection_.target.frame_ids && + injection_.target.all_frames.value_or(false)) { + return RespondNow(Error(kInvalidAllFramesError)); + } + + if (injection_.target.document_ids && injection_.target.frame_ids) { + return RespondNow(Error(kInvalidInjectionTargetIdsError)); + } + + // TODO(crbug.com/326657581): Execute script with the given parameters. + return RespondNow(NoArguments()); +} + ExtensionFunction::ResponseAction UserScriptsGetWorldConfigurationsFunction::Run() { EXTENSION_FUNCTION_VALIDATE(extension());
diff --git a/extensions/browser/api/user_scripts/user_scripts_api.h b/extensions/browser/api/user_scripts/user_scripts_api.h index f661cc4..c1c31579 100644 --- a/extensions/browser/api/user_scripts/user_scripts_api.h +++ b/extensions/browser/api/user_scripts/user_scripts_api.h
@@ -99,6 +99,24 @@ void OnUserScriptsUpdated(const std::optional<std::string>& error); }; +class UserScriptsExecuteFunction : public ExtensionFunction { + public: + DECLARE_EXTENSION_FUNCTION("userScripts.execute", USERSCRIPTS_EXECUTE) + + UserScriptsExecuteFunction() = default; + UserScriptsExecuteFunction(const UserScriptsExecuteFunction&) = delete; + const UserScriptsExecuteFunction& operator=( + const UserScriptsExecuteFunction&) = delete; + + // ExtensionFunction: + ResponseAction Run() override; + + private: + ~UserScriptsExecuteFunction() override = default; + + api::user_scripts::UserScriptInjection injection_; +}; + class UserScriptsConfigureWorldFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("userScripts.configureWorld",
diff --git a/extensions/browser/extension_function_histogram_value.h b/extensions/browser/extension_function_histogram_value.h index d563772..ecbcd1e2 100644 --- a/extensions/browser/extension_function_histogram_value.h +++ b/extensions/browser/extension_function_histogram_value.h
@@ -1831,7 +1831,7 @@ DELETED_SMARTCARDPROVIDERPRIVATE_REPORTDISCONNECTRESULT = 1769, WMDESKSPRIVATE_GETDESKBYID = 1770, AUTOFILLPRIVATE_ISVALIDIBAN = 1771, - ACCESSIBILITY_PRIVATE_ISLACROSPRIMARY = 1772, + DELETED_ACCESSIBILITY_PRIVATE_ISLACROSPRIMARY = 1772, POWER_REPORTACTIVITY = 1773, PASSWORDSPRIVATE_CONTINUEIMPORT = 1774, PASSWORDSPRIVATE_RESETIMPORTER = 1775, @@ -1889,7 +1889,7 @@ OS_DIAGNOSTICS_STARTROUTINE = 1827, OS_DIAGNOSTICS_CANCELROUTINE = 1828, OS_DIAGNOSTICS_ISMEMORYROUTINEARGUMENTSUPPORTED = 1829, - ACCESSIBILITY_PRIVATE_CLIPBOARDCOPYINACTIVELACROSGOOGLEDOC = 1830, + DELETED_ACCESSIBILITY_PRIVATE_CLIPBOARDCOPYINACTIVELACROSGOOGLEDOC = 1830, USERSCRIPTS_UPDATE = 1831, INPUTMETHODPRIVATE_GETLANGUAGEPACKSTATUS = 1832, OS_DIAGNOSTICS_RUNFANROUTINE = 1833, @@ -1976,6 +1976,7 @@ COOKIES_GETPARTITIONKEY = 1914, CONTROLLEDFRAMEINTERNAL_SETCLIENTHINTSENABLED = 1915, DEVELOPERPRIVATE_UPLOADEXTENSIONTOACCOUNT = 1916, + USERSCRIPTS_EXECUTE = 1917, // Last entry: Add new entries above, then run: // tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/extensions/common/api/app_runtime.idl b/extensions/common/api/app_runtime.idl index 89b50ea2..d298391 100644 --- a/extensions/common/api/app_runtime.idl +++ b/extensions/common/api/app_runtime.idl
@@ -7,7 +7,7 @@ // shut down the app at anytime. namespace app.runtime { - [inline_doc] dictionary LaunchItem { + dictionary LaunchItem { // Entry for the item. [instanceOf=Entry] object entry;
diff --git a/extensions/common/api/automation.idl b/extensions/common/api/automation.idl index 1d4e3ca..41ba51a 100644 --- a/extensions/common/api/automation.idl +++ b/extensions/common/api/automation.idl
@@ -679,7 +679,7 @@ }; // Arguments for the find() and findAll() methods. - [nocompile, noinline_doc] dictionary FindParams { + [nocompile] dictionary FindParams { RoleType? role; // A map of $(ref:automation.StateType) to boolean, indicating for each @@ -706,7 +706,7 @@ }; // Arguments for the setDocumentSelection() function. - [nocompile, noinline_doc] dictionary SetDocumentSelectionParams { + [nocompile] dictionary SetDocumentSelectionParams { // The node where the selection begins. [instanceOf=AutomationNode] object anchorObject; @@ -720,7 +720,7 @@ long focusOffset; }; - [nocompile, noinline_doc] dictionary AutomationIntent { + [nocompile] dictionary AutomationIntent { // A command associated with this AutomationIntent. IntentCommandType command; @@ -732,7 +732,7 @@ }; // An event in the Automation tree. - [nocompile, noinline_doc] dictionary AutomationEvent { + [nocompile] dictionary AutomationEvent { // The $(ref:automation.AutomationNode) to which the event was targeted. AutomationNode target; @@ -758,7 +758,7 @@ callback AutomationListener = void(AutomationEvent event); // A change to the Automation tree. - [nocompile, noinline_doc] dictionary TreeChange { + [nocompile] dictionary TreeChange { // The $(ref:automation.AutomationNode) that changed. AutomationNode target; @@ -783,13 +783,13 @@ callback PerformActionCallbackWithNode = void(AutomationNode node); callback BoundsForRangeCallback = void(Rect bounds); - [nocompile, noinline_doc] dictionary CustomAction { + [nocompile] dictionary CustomAction { long id; DOMString description; }; // A marker associated with an AutomationNode. - [nocompile, noinline_doc] dictionary Marker { + [nocompile] dictionary Marker { // The start offset within the text of the associated node. long startOffset; @@ -806,7 +806,7 @@ // be kept in sync with // extensions/renderer/api/automation/automation_position.h. // Some members there are kept private and not represented here. - [nocompile, noinline_doc] dictionary AutomationPosition { + [nocompile] dictionary AutomationPosition { AutomationNode? node; long childIndex; @@ -876,7 +876,7 @@ }; // A single node in an Automation tree. - [nocompile, noinline_doc] dictionary AutomationNode { + [nocompile] dictionary AutomationNode { // The root node of the tree containing this AutomationNode. AutomationNode? root;
diff --git a/extensions/common/api/declarative_net_request.idl b/extensions/common/api/declarative_net_request.idl index 4cc8e33..13e0df8 100644 --- a/extensions/common/api/declarative_net_request.idl +++ b/extensions/common/api/declarative_net_request.idl
@@ -121,7 +121,6 @@ }; // Describes modification to various url components. - [noinline_doc] dictionary URLTransform { // The new scheme for the request. Allowed values are "http", "https", // "ftp" and "chrome-extension". @@ -190,7 +189,7 @@ DOMString[]? excludedValues; }; - [noinline_doc] dictionary RuleCondition { + dictionary RuleCondition { // The pattern which is matched against the network request url. // Supported constructs: @@ -409,7 +408,6 @@ [nodoc] HeaderRegexOptions? regexOptions; }; - [noinline_doc] dictionary RuleAction { // The type of action to perform. RuleActionType type; @@ -452,13 +450,11 @@ DOMString rulesetId; }; - [noinline_doc] dictionary GetRulesFilter { // If specified, only rules with matching IDs are included. long[]? ruleIds; }; - [noinline_doc] dictionary MatchedRuleInfo { MatchedRule rule; @@ -486,7 +482,6 @@ MatchedRuleInfo[] rulesMatchedInfo; }; - [noinline_doc] dictionary RequestDetails { // The ID of the request. Request IDs are unique within a browser session. DOMString requestId;
diff --git a/extensions/common/api/hid.idl b/extensions/common/api/hid.idl index 8537705..c26a2580 100644 --- a/extensions/common/api/hid.idl +++ b/extensions/common/api/hid.idl
@@ -19,7 +19,7 @@ long[] reportIds; }; - [noinline_doc] dictionary HidDeviceInfo { + dictionary HidDeviceInfo { // Opaque device ID. long deviceId; // Vendor ID. @@ -47,7 +47,7 @@ long connectionId; }; - [noinline_doc] dictionary DeviceFilter { + dictionary DeviceFilter { // Device vendor ID. long? vendorId; // Device product ID, only checked only if the vendor ID matches.
diff --git a/extensions/common/api/networking_onc.idl b/extensions/common/api/networking_onc.idl index 0d22763..0c8cf22 100644 --- a/extensions/common/api/networking_onc.idl +++ b/extensions/common/api/networking_onc.idl
@@ -351,7 +351,7 @@ ManagedLong Port; }; - [noinline_doc] dictionary ManualProxySettings { + dictionary ManualProxySettings { // Settings for HTTP proxy. ProxyLocation? HTTPProxy; // Settings for secure HTTP proxy. @@ -373,7 +373,7 @@ ManagedProxyLocation? SOCKS; }; - [noinline_doc] dictionary ProxySettings { + dictionary ProxySettings { // The type of proxy settings. ProxySettingsType Type; // Manual proxy settings - used only for <code>Manual</code> proxy settings. @@ -422,7 +422,7 @@ // Network type dictionary types. - [noinline_doc] dictionary CellularProperties { + dictionary CellularProperties { // Whether the cellular network should be connected automatically (when // in range). boolean? AutoConnect; @@ -574,7 +574,7 @@ DOMString Type; }; - [noinline_doc] dictionary WiFiProperties { + dictionary WiFiProperties { [deprecated="Removed in M131. There is no active ARP polling now."] boolean? AllowGatewayARPPolling; // Whether the WiFi network should be connected automatically when in range. @@ -681,7 +681,6 @@ WiMAXProperties? WiMAX; }; - [noinline_doc] dictionary NetworkProperties { // For cellular networks, cellular network properties. CellularProperties? Cellular; @@ -741,7 +740,6 @@ WiFiProperties? WiFi; }; - [noinline_doc] dictionary ManagedProperties { // See $(ref:NetworkProperties.Cellular). ManagedCellularProperties? Cellular;
diff --git a/extensions/common/api/power.idl b/extensions/common/api/power.idl index 8ce3875..ec8cf36 100644 --- a/extensions/common/api/power.idl +++ b/extensions/common/api/power.idl
@@ -7,7 +7,7 @@ namespace power { callback VoidCallback = void (); - [noinline_doc] enum Level { + enum Level { // Prevents the system from sleeping in response to user inactivity. system,
diff --git a/extensions/common/api/printer_provider.idl b/extensions/common/api/printer_provider.idl index 920f82a..5626631 100644 --- a/extensions/common/api/printer_provider.idl +++ b/extensions/common/api/printer_provider.idl
@@ -37,7 +37,7 @@ }; // Printing request parameters. Passed to $(ref:onPrintRequested) event. - [noinline_doc] dictionary PrintJob { + dictionary PrintJob { // ID of the printer which should handle the job. DOMString printerId;
diff --git a/extensions/common/api/system_storage.idl b/extensions/common/api/system_storage.idl index 2d52be2e..f4f9bf19 100644 --- a/extensions/common/api/system_storage.idl +++ b/extensions/common/api/system_storage.idl
@@ -37,7 +37,7 @@ double availableCapacity; }; - [inline_doc] enum EjectDeviceResultCode { + enum EjectDeviceResultCode { // The ejection command is successful -- the application can prompt the user // to remove the device. success,
diff --git a/extensions/common/api/usb.idl b/extensions/common/api/usb.idl index f961395..38a413b 100644 --- a/extensions/common/api/usb.idl +++ b/extensions/common/api/usb.idl
@@ -53,7 +53,7 @@ long productId; }; - [noinline_doc] dictionary EndpointDescriptor { + dictionary EndpointDescriptor { // Endpoint address. long address; // Transfer type. @@ -72,7 +72,7 @@ ArrayBuffer extra_data; }; - [noinline_doc] dictionary InterfaceDescriptor { + dictionary InterfaceDescriptor { // The interface number. long interfaceNumber; // The interface alternate setting number (defaults to <code>0</code). @@ -91,7 +91,7 @@ ArrayBuffer extra_data; }; - [noinline_doc] dictionary ConfigDescriptor { + dictionary ConfigDescriptor { // Is this the active configuration? boolean active; // The configuration number. @@ -184,7 +184,7 @@ ArrayBuffer? data; }; - [noinline_doc] dictionary DeviceFilter { + dictionary DeviceFilter { // Device vendor ID. long? vendorId; // Device product ID, checked only if the vendor ID matches.
diff --git a/extensions/common/api/user_scripts.idl b/extensions/common/api/user_scripts.idl index dd37655..3aadc81 100644 --- a/extensions/common/api/user_scripts.idl +++ b/extensions/common/api/user_scripts.idl
@@ -82,6 +82,49 @@ DOMString[]? ids; }; + // TODO(crbug.com/326657581): Remove nodoc. + [nodoc] dictionary InjectionTarget { + // Whether the script should inject into all frames within the tab. Defaults + // to false. This must not be true if <code>frameIds</code> is specified. + boolean? allFrames; + // The IDs of specific documentIds to inject into. This must not be set if + // <code>frameIds</code> is set. + DOMString[]? documentIds; + // The IDs of specific frames to inject into. + long[]? frameIds; + // The ID of the tab into which to inject. + long tabId; + }; + + // TODO(crbug.com/326657581): Remove nodoc. + [nodoc] dictionary InjectionResult { + // The document associated with the injection. + DOMString documentId; + // The frame associated with the injection. + long frameId; + // The result of the script execution. + any? result; + // The error, if any. <code>error</code> and <code>result</code> are + // mutually exclusive. + DOMString? error; + }; + + // TODO(crbug.com/326657581): Remove nodoc. + [nodoc] dictionary UserScriptInjection { + // Whether the injection should be triggered in the target as soon as + // possible. Note that this is not a guarantee that injection will occur + // prior to page load, as the page may have already loaded by the time the + // script reaches the target. + boolean? injectImmediately; + // The script source to inject into the target. + ScriptSource js; + // Details specifying the target into which to inject the script. + InjectionTarget target; + // The JavaScript "world" to run the script in. The default is + // <code>USER_SCRIPT</code>. + ExecutionWorld? world; + }; + // An object used to update the <code>`USER_SCRIPT`</code> world // configuration. If a property is not specified, it will reset it to its // default value. @@ -108,6 +151,8 @@ callback UpdateCallback = void(); + callback ExecuteCallback = void(InjectionResult[] result); + callback ConfigureWorldCallback = void(); callback GetAllWorldConfigurationsCallback = void(WorldProperties[] worlds); @@ -153,6 +198,18 @@ RegisteredUserScript[] scripts, optional UpdateCallback callback); + // Injects a script into a target context. By default, the script will be + // run at <code>document_idle</code>, or immediately if the page has already + // loaded. If the <code>injectImmediately</code> property is set, the script + // will inject without waiting, even if the page has not finished loading. + // If the script evaluates to a promise, the browser will wait for the + // promise to settle and return the resulting value. + // TODO(crbug.com/326657581): Remove nodoc. + [nodoc] static void execute( + UserScriptInjection injection, + optional ExecuteCallback callback + ); + // Configures the <code>`USER_SCRIPT`</code> execution environment. // |properties|: Contains the user script world configuration. // |callback|: Called once world hase been configured.
diff --git a/gpu/command_buffer/service/dawn_context_provider.cc b/gpu/command_buffer/service/dawn_context_provider.cc index 5b86a75..cdf6fed 100644 --- a/gpu/command_buffer/service/dawn_context_provider.cc +++ b/gpu/command_buffer/service/dawn_context_provider.cc
@@ -210,6 +210,7 @@ wgpu::FeatureName::DawnLoadResolveTexture, wgpu::FeatureName::DawnPartialLoadResolveTexture, wgpu::FeatureName::DawnTexelCopyBufferRowAlignment, + wgpu::FeatureName::FlexibleTextureViews, }; for (auto feature : kOptionalFeatures) { @@ -410,29 +411,28 @@ // Provided to wgpu::Device as logging callback. #ifdef WGPU_BREAKING_CHANGE_LOGGING_CALLBACK_TYPE - static void LogInfo(wgpu::LoggingType type, wgpu::StringView message) { - std::string_view view = {message.data, message.length}; - switch (type) { - case wgpu::LoggingType::Warning: - LOG(WARNING) << view; - break; - case wgpu::LoggingType::Error: - LOG(ERROR) << view; - SetDawnErrorCrashKey(view); - base::debug::DumpWithoutCrashing(); - break; - default: - break; - } - } + static void LogInfo(wgpu::LoggingType type, + wgpu::StringView message, + DawnSharedContext* shared_context) { #else static void LogInfo(WGPULoggingType type, WGPUStringView message, - void*) { + void* userdata) { + auto* shared_context = static_cast<DawnSharedContext*>(userdata); +#endif std::string_view view = {message.data, message.length}; switch (static_cast<wgpu::LoggingType>(type)) { case wgpu::LoggingType::Warning: LOG(WARNING) << view; + if (shared_context && !shared_context->device_) { + // If device hasn't been created yet. This warning message must be + // from dawn::native::Instance when we try to enumerate adapters or + // when trying to create the device. In that case, saving the message + // so that if there is any init failure afterward, we can include the + // warnings in the LogInitFailure()'s report. + shared_context->init_warning_msgs_.append(view); + shared_context->init_warning_msgs_.append("\n"); + } break; case wgpu::LoggingType::Error: LOG(ERROR) << view; @@ -443,7 +443,6 @@ break; } } -#endif ~DawnSharedContext() override; @@ -457,6 +456,10 @@ } SCOPED_CRASH_KEY_STRING256("dawn-shared-context", "init-failure", reason); + // Also include any warning messages collected during the initialization. + SCOPED_CRASH_KEY_STRING1024("dawn-shared-context", "init-warning-msgs", + init_warning_msgs_); + init_warning_msgs_.clear(); base::debug::DumpWithoutCrashing(); } @@ -473,6 +476,7 @@ wgpu::Adapter adapter_; wgpu::Device device_; wgpu::BackendType backend_type_; + std::string init_warning_msgs_; bool is_vulkan_swiftshader_adapter_ = false; bool registered_memory_dump_provider_ = false; @@ -511,13 +515,16 @@ // instance doesn't exit the GPU process. // LogInfo will be used to receive instance level errors. For example failures // of loading libraries, initializing backend, etc - instance_ = webgpu::DawnInstance::Create(&platform_, gpu_preferences, - webgpu::SafetyLevel::kUnsafe, + instance_ = webgpu::DawnInstance::Create( + &platform_, gpu_preferences, webgpu::SafetyLevel::kUnsafe, #ifdef WGPU_BREAKING_CHANGE_LOGGING_CALLBACK_TYPE - &DawnSharedContext::LogInfo); + // TODO(369445924): fix this code once the new callback type is about to + // be landed in dawn. + [this](wgpu::LoggingType type, wgpu::StringView message) { + DawnSharedContext::LogInfo(type, message, this); + }); #else - &DawnSharedContext::LogInfo, - nullptr); + &DawnSharedContext::LogInfo, this); #endif std::vector<const char*> enabled_toggles = @@ -688,9 +695,14 @@ } #ifdef WGPU_BREAKING_CHANGE_LOGGING_CALLBACK_TYPE - device_.SetLoggingCallback(&DawnSharedContext::LogInfo); + // TODO(369445924): fix this code once the new callback type is about to be + // landed in dawn. + device_.SetLoggingCallback( + [this](wgpu::LoggingType type, wgpu::StringView message) { + DawnSharedContext::LogInfo(type, message, this); + }); #else - device_.SetLoggingCallback(&DawnSharedContext::LogInfo, nullptr); + device_.SetLoggingCallback(&DawnSharedContext::LogInfo, this); #endif backend_type_ = backend_type;
diff --git a/infra/inclusive_language_presubmit_exempt_dirs.txt b/infra/inclusive_language_presubmit_exempt_dirs.txt index 7a81d68e2..53b8fc8 100644 --- a/infra/inclusive_language_presubmit_exempt_dirs.txt +++ b/infra/inclusive_language_presubmit_exempt_dirs.txt
@@ -644,8 +644,8 @@ third_party/rust/chromium_crates_io/vendor/adler2-2.0.0/.github/workflows 2 1 third_party/rust/chromium_crates_io/vendor/aho-corasick-1.1.3/.github/workflows 5 1 third_party/rust/chromium_crates_io/vendor/anstyle-1.0.10 1 1 -third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94 2 1 -third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.github/workflows 3 1 +third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95 2 1 +third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.github/workflows 3 1 third_party/rust/chromium_crates_io/vendor/base64-0.13.1 1 1 third_party/rust/chromium_crates_io/vendor/byteorder-1.5.0/.github/workflows 5 1 third_party/rust/chromium_crates_io/vendor/bytes-1.9.0/.github/workflows 3 1 @@ -712,16 +712,16 @@ third_party/rust/chromium_crates_io/vendor/serde-1.0.216 1 1 third_party/rust/chromium_crates_io/vendor/serde-1.0.216/src 1 1 third_party/rust/chromium_crates_io/vendor/serde_derive-1.0.216 1 1 -third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133 6 1 -third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.github/workflows 1 1 +third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134 6 1 +third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.github/workflows 1 1 third_party/rust/chromium_crates_io/vendor/serde_json_lenient-0.2.4 1 1 third_party/rust/chromium_crates_io/vendor/simd-adler32-0.3.7/.github/workflows 1 1 third_party/rust/chromium_crates_io/vendor/static_assertions-1.1.0 5 2 third_party/rust/chromium_crates_io/vendor/static_assertions-1.1.0/src 2 1 third_party/rust/chromium_crates_io/vendor/strum-0.25.0/src 1 1 third_party/rust/chromium_crates_io/vendor/strum_macros-0.25.3 1 1 -third_party/rust/chromium_crates_io/vendor/syn-2.0.90 1 1 -third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src 2 1 +third_party/rust/chromium_crates_io/vendor/syn-2.0.91 1 1 +third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src 2 1 third_party/rust/chromium_crates_io/vendor/termcolor-1.4.1/.github/workflows 3 1 third_party/rust/chromium_crates_io/vendor/unicode-ident-1.0.14 1 1 third_party/rust/chromium_crates_io/vendor/unicode-ident-1.0.14/.github/workflows 2 1
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index a206686..e3906d6 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -2267,6 +2267,11 @@ flag_descriptions::kLensSingleTapTextSelectionDisabledName, flag_descriptions::kLensSingleTapTextSelectionDisabledDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kLensSingleTapTextSelectionDisabled)}, + {"lens-overlay-enable-location-bar-entrypoint-on-srp", + flag_descriptions::kLensOverlayEnableLocationBarEntrypointOnSRPName, + flag_descriptions::kLensOverlayEnableLocationBarEntrypointOnSRPDescription, + flags_ui::kOsIos, + FEATURE_VALUE_TYPE(kLensOverlayEnableLocationBarEntrypointOnSRP)}, }; bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc index 528d4e3..864f239 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -710,6 +710,12 @@ "no other buttons are shown (price insight or messages). Enabled by " "default. "; +extern const char kLensOverlayEnableLocationBarEntrypointOnSRPName[] = + "Enable Lens overlay location bar entrypoint on SRP."; +extern const char kLensOverlayEnableLocationBarEntrypointOnSRPDescription[] = + "When enabled, the location bar entrypoint is available on SRP. Enabled by " + "default."; + extern const char kLensOverlayEnableSameTabNavigationName[] = "Lens overlay same tab navigation"; extern const char kLensOverlayEnableSameTabNavigationDescription[] =
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h index 2538428..fa5c3ab 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -479,7 +479,7 @@ extern const char kIOSDockingPromoDescription[]; // Title and description for the flag to enable delete all saved credentials in -// GPM. +// PWM. extern const char kIOSEnableDeleteAllSavedCredentialsName[]; extern const char kIOSEnableDeleteAllSavedCredentialsDescription[]; @@ -609,6 +609,11 @@ extern const char kLensOverlayEnableLocationBarEntrypointName[]; extern const char kLensOverlayEnableLocationBarEntrypointDescription[]; +// Title and description for the flag to enable the Lens overlay location bar +// entrypoint on SRP. +extern const char kLensOverlayEnableLocationBarEntrypointOnSRPName[]; +extern const char kLensOverlayEnableLocationBarEntrypointOnSRPDescription[]; + // Title and description for the flag to allow lens overlay same tab navigation. extern const char kLensOverlayEnableSameTabNavigationName[]; extern const char kLensOverlayEnableSameTabNavigationDescription[];
diff --git a/ios/chrome/browser/location_bar/ui_bundled/location_bar_mediator.mm b/ios/chrome/browser/location_bar/ui_bundled/location_bar_mediator.mm index ec075a3..5ac5cec 100644 --- a/ios/chrome/browser/location_bar/ui_bundled/location_bar_mediator.mm +++ b/ios/chrome/browser/location_bar/ui_bundled/location_bar_mediator.mm
@@ -5,6 +5,7 @@ #import "ios/chrome/browser/location_bar/ui_bundled/location_bar_mediator.h" #import "base/memory/ptr_util.h" +#import "components/google/core/common/google_util.h" #import "components/lens/lens_url_utils.h" #import "ios/chrome/browser/lens_overlay/coordinator/lens_overlay_availability.h" #import "ios/chrome/browser/location_bar/ui_bundled/location_bar_consumer.h" @@ -168,6 +169,13 @@ visibleURL = webState->GetVisibleURL(); } } + + if (!base::FeatureList::IsEnabled( + kLensOverlayEnableLocationBarEntrypointOnSRP) && + google_util::IsGoogleSearchUrl(visibleURL)) { + return NO; + } + return !IsURLNewTabPage(visibleURL) && !lens::IsLensMWebResult(visibleURL); }
diff --git a/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider.h b/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider.h index 6f7f9f2..1bdd58d9 100644 --- a/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider.h +++ b/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider.h
@@ -25,11 +25,6 @@ MOBILE_SESSION_SHUTDOWN_TYPE_COUNT, }; -// Percentage of battery level which is assumed low enough to have possibly -// been the reason for the previous session ending in an unclean shutdown. -// Percent rpresented by a value between 0 and 1. -extern const float kCriticallyLowBatteryLevel; - class MobileSessionShutdownMetricsProvider : public metrics::MetricsProvider { public: explicit MobileSessionShutdownMetricsProvider(
diff --git a/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider.mm b/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider.mm index a6063487..d73648fb 100644 --- a/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider.mm +++ b/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider.mm
@@ -20,7 +20,6 @@ #import "ios/chrome/browser/crash_report/model/crash_helper.h" #import "ios/chrome/browser/crash_report/model/features.h" -using previous_session_info_constants::DeviceBatteryState; using previous_session_info_constants::DeviceThermalState; namespace { @@ -202,14 +201,6 @@ base::Seconds(background_time)); } -// Logs the device `battery_level` as a UTE stability metric. -void LogBatteryCharge(float battery_level) { - int battery_charge = static_cast<int>(battery_level * 100); - UMA_STABILITY_HISTOGRAM_PERCENTAGE("Stability.iOS.UTE.BatteryCharge", - battery_charge); -} - - // Logs the OS version change between `os_version` and the current os version. // Records whether the version is the same, if a minor version change occurred, // or if a major version change occurred. @@ -246,8 +237,6 @@ } // namespace -const float kCriticallyLowBatteryLevel = 0.01; - MobileSessionShutdownMetricsProvider::MobileSessionShutdownMetricsProvider( metrics::MetricsService* metrics_service) : metrics_service_(metrics_service) { @@ -304,9 +293,6 @@ SHUTDOWN_IN_FOREGROUND_NO_CRASH_LOG_WITH_MEMORY_WARNING) { // Log UTE metrics only if the crash was classified as a UTE. - if (session_info.deviceBatteryState == DeviceBatteryState::kUnplugged) { - LogBatteryCharge(session_info.deviceBatteryLevel); - } if (session_info.OSVersion) { LogOSVersionChange(base::SysNSStringToUTF8(session_info.OSVersion)); }
diff --git a/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider_unittest.mm b/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider_unittest.mm index 134ddfc1..609892d 100644 --- a/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider_unittest.mm +++ b/ios/chrome/browser/metrics/model/mobile_session_shutdown_metrics_provider_unittest.mm
@@ -335,18 +335,6 @@ histogram_tester->ExpectUniqueSample( "Stability.iOS.UTE.HasPossibleExplanation", false, 1); - // Test UTE with low battery when OS did not restart. - [PreviousSessionInfo sharedInstance].deviceBatteryLevel = - kCriticallyLowBatteryLevel; - [PreviousSessionInfo sharedInstance].deviceBatteryState = - previous_session_info_constants::DeviceBatteryState::kUnplugged; - histogram_tester = std::make_unique<base::HistogramTester>(); - metrics_provider_->ProvidePreviousSessionData(nullptr); - histogram_tester->ExpectUniqueSample( - "Stability.iOS.UTE.OSRestartedAfterPreviousSession", false, 1); - histogram_tester->ExpectUniqueSample( - "Stability.iOS.UTE.HasPossibleExplanation", false, 1); - // Test UTE when OS restarted after previous session. [PreviousSessionInfo sharedInstance].OSRestartedAfterPreviousSession = YES; histogram_tester = std::make_unique<base::HistogramTester>();
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_manager_ui_features.mm b/ios/chrome/browser/settings/ui_bundled/password/password_manager_ui_features.mm index 4c8d544..27dd28c 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_manager_ui_features.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_manager_ui_features.mm
@@ -14,7 +14,7 @@ base::FEATURE_ENABLED_BY_DEFAULT); // Feature switch for the logic that allows the user to delete all saved -// credentials in GPM. +// credentials in PWM. BASE_FEATURE(kIOSEnableDeleteAllSavedCredentials, "IOSEnableDeleteAllSavedCredentials", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/ios/chrome/browser/shared/public/features/features.h b/ios/chrome/browser/shared/public/features/features.h index 8caaf3f..d894aec 100644 --- a/ios/chrome/browser/shared/public/features/features.h +++ b/ios/chrome/browser/shared/public/features/features.h
@@ -318,6 +318,10 @@ // default. BASE_DECLARE_FEATURE(kLensOverlayEnableLocationBarEntrypoint); +// Feature flag to enable the Lens overlay location bar entrypoint on SRP. +// Enabled by default. +BASE_DECLARE_FEATURE(kLensOverlayEnableLocationBarEntrypointOnSRP); + // Feature flag to disable price insights for a lens overlay experiment. As the // price insights entrypoint trumps the lens overlay entrypoint. This flag // should only be used for experiment.
diff --git a/ios/chrome/browser/shared/public/features/features.mm b/ios/chrome/browser/shared/public/features/features.mm index c7fd8f0..8afc218 100644 --- a/ios/chrome/browser/shared/public/features/features.mm +++ b/ios/chrome/browser/shared/public/features/features.mm
@@ -267,6 +267,10 @@ "LensOverlayEnableLocationBarEntrypoint", base::FEATURE_ENABLED_BY_DEFAULT); +BASE_FEATURE(kLensOverlayEnableLocationBarEntrypointOnSRP, + "LensOverlayEnableLocationBarEntrypointOnSRP", + base::FEATURE_ENABLED_BY_DEFAULT); + BASE_FEATURE(kLensOverlayEnableSameTabNavigation, "EnableLensOverlaySameTabNavigation", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 index a9e81ea..1af2df60 100644 --- a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -0dcdf12833fce9121f398fbd6028d315820d9306 \ No newline at end of file +8053fc6367bad7ac312d868eedf1e7556bcc9244 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 index 3bb825f1..02355e2 100644 --- a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -78befffd0085397038733f2981bef5aeb8aa3cff \ No newline at end of file +a7d401c978f0a543fc278e695b5a7110e7cc8434 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 index 73ada09..1a248a1 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -98d1cdb1cc806cec95c3d3d42c43da99f0bdfe24 \ No newline at end of file +0d4ea01ef64586e2194ff0dcc3ec2655b64b5d72 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 index 96a56fab..c0cf0313 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -df718228aebee42a0c59fdb37ad0ef1220d46d7a \ No newline at end of file +575c70121071d2cd18487ad8ae78ba00f5e32c05 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 index cf6c722..6fd08c7 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -a19f6a3937a4b2cb487013cfc1ab8f49be697c78 \ No newline at end of file +8c7b3586b0c477742273f68b86b45c70e6985c28 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 index 05848f7f..90ee56d9 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -860e97b77e999f58e6540a0eb4e7f05b6004eef7 \ No newline at end of file +5e80584314c95ed36b4e36beea22b30733201cda \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 index 38704589..f097da21 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -4166cd44b05c12c6131f0350f0f1c1406a1afc95 \ No newline at end of file +aa16769b002f483fd0245ff1a0ff22cecef2ed86 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 index 0ce6968..91bd7aed 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -f2d639ebb33c12b0f293cd040e50b3d111004384 \ No newline at end of file +ce676e78c4e06087738285e553ff90cff78911e3 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 index d3ac1067d5..fd1cd14 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -aff6b8c5b18241e1e131c5b04e85befe39bdf69f \ No newline at end of file +96943240c0ff25fbb4a45c4fdce2910eb5a8eaf6 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 9c8d88f..8aec337b 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -0717ef48b8bb3917c4c0b7be7ed4ffc6b360fb9d \ No newline at end of file +ac459bb45ae2f0ba55f7b479ec6fc6126e38ff48 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index e0857458..a8dd5c71 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -6cb66b15494ac548af06670c5cde6052ca3f8dc0 \ No newline at end of file +8e4f072b3d84f8743e231d711dff7b90d73208f6 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 index b954993..01a1b8c 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -f87a28060120a81b281ba988160f2bf3a7764d41 \ No newline at end of file +88f358f4fcf95cf8baa08abf3c5d684334291afc \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index a668f63..20d2e93d 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -73971d5427932fd36015cd751e326f34397a38cb \ No newline at end of file +c610b4570b1af7f60db72153ed67f6ff0beaaf28 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 4d30629..b7c8da7 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -337ed392b04ea0a76aec28318897f864ab663622 \ No newline at end of file +e01a980f906464394bd76e8bbb505c3713bee633 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index 6345034..9568789 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -0cc5afdf5351b0207294610ee5de636a5f833f13 \ No newline at end of file +f61e8e24ab887616668a0e60d9be92085b925cc8 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 index cd68357..96a720d6 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -932740fcfa3c0003c8ce32875558feadc17d8dfd \ No newline at end of file +e6ef0667f04a82a32cebe321d9b7ed47f9edc108 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index fcf4a93..24ed7ba 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -bdc3e41e8555cf6dab38644294d8dd4553ba829e \ No newline at end of file +6039d1c759aa32b6b965066d1014304702742ba6 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 33b0f6db..170cf03 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -42a9b4f1e7bba235e6a8f50ed8d48bc389ecf6e8 \ No newline at end of file +252ccefa57e21b54ee053de28d5f23f29bb6836b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 index 12102ecb..746c7b3 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -512580523a61a3a31a1deb3906c359e86c2fff91 \ No newline at end of file +9411a450ab6ae50f29ae26b1ee38ec95a50c3745 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 index 3aebea9..b96791b 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -a6d8c75daf75843155e2c01dba795a656dfff337 \ No newline at end of file +631201f3491292908f27d8e4c13f892fc48552c6 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index 9846ca62..7a30f7024 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -5fa53968bfd060f3451fe68fde61c05d29a53246 \ No newline at end of file +70a49998580aa6cc0c9617ad43e6ae816ec6594f \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 index 1154b3f5..c9378bd1 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -14805b7b471c2e71f8c76f3fb23807888ee5ee31 \ No newline at end of file +2e6bfc37c8d0e95aef9c25f0784b0d7103986796 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index 1c4b437e..2c3ea9e 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -f43880c26911fd4ab862adafe85aae250bf5308d \ No newline at end of file +c6daef4b0aa58bf6dd57193e2e4e5edd42072a71 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 38d1691..d9075be 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -5e1ffbb91f8c0ea9c2efa72341e7383c956c174b \ No newline at end of file +f32fa4f910a14369be1d85ce294e909a471c69d9 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index b15c99f6..e2aa768 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -6cc2602fcb4cbebf476b0946155323cd9ec0106b \ No newline at end of file +9fa80d09495b197a15361cb8693e256d83c024a4 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 index bc4c2d76..05b3b60 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -1f2512db45c4fdd09ba36f8cf12cefb3c8b92042 \ No newline at end of file +2e70a474fb44bcb453dcc9d728631f23964e6b78 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index c8e1d7b..d7e4fa6 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -e28b46f3b4ccf21e0aee1eb23cea1e85f5ba9aaf \ No newline at end of file +53f49ba200a0369275f6c0626883e06a87234b46 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 9674f6e..76dc59b 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -00c2939be3155d3eb529034b1bc8c0fd544665e7 \ No newline at end of file +bae5f802b5d4ddbbf52abd02c6e06d8018e6264f \ No newline at end of file
diff --git a/ios_internal b/ios_internal index 78e59ed..0974809 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 78e59ed0707683eaf1ed43101be35d3f03ff675e +Subproject commit 0974809b07dbf79af4b2fcf0ba0cd10ea4818306
diff --git a/media/cast/common/mod_util.h b/media/cast/common/mod_util.h index ff91d64..1aa2abe 100644 --- a/media/cast/common/mod_util.h +++ b/media/cast/common/mod_util.h
@@ -13,7 +13,7 @@ // MAP is a map<uint??, ...> where the unsigned integer is // assumed to wrap around, but only a small range is used at a time. // Return the oldest entry in the map. -template<class MAP> +template <class MAP> typename MAP::iterator ModMapOldest(MAP* map) { typename MAP::iterator ret = map->begin(); if (ret != map->end()) { @@ -22,8 +22,9 @@ lower_quarter >>= 1; if (ret->first < lower_quarter) { typename MAP::iterator tmp = map->upper_bound(lower_quarter * 3); - if (tmp != map->end()) + if (tmp != map->end()) { ret = tmp; + } } } return ret; @@ -32,7 +33,7 @@ // MAP is a map<uint??, ...> where the unsigned integer is // assumed to wrap around, but only a small range is used at a time. // Returns the previous entry in the map. -template<class MAP> +template <class MAP> typename MAP::iterator ModMapPrevious(MAP* map, typename MAP::iterator i) { DCHECK(!map->empty()); typename MAP::iterator ret = i; @@ -40,10 +41,12 @@ ret = map->end(); } ret--; - if (i == ret) + if (i == ret) { return map->end(); - if ((i->first - ret->first) > ((typename MAP::key_type(0) - 1)) >> 1) + } + if ((i->first - ret->first) > ((typename MAP::key_type(0) - 1)) >> 1) { return map->end(); + } return ret; }
diff --git a/media/cast/encoding/audio_encoder.cc b/media/cast/encoding/audio_encoder.cc index 3eaef8d..2f0fdb7 100644 --- a/media/cast/encoding/audio_encoder.cc +++ b/media/cast/encoding/audio_encoder.cc
@@ -150,8 +150,9 @@ src_pos += num_samples_to_xfer; buffer_fill_end_ += num_samples_to_xfer; - if (buffer_fill_end_ < samples_per_frame_) + if (buffer_fill_end_ < samples_per_frame_) { break; + } auto audio_frame = std::make_unique<SenderEncodedFrame>(); audio_frame->is_key_frame = true;
diff --git a/media/cast/encoding/audio_encoder_unittest.cc b/media/cast/encoding/audio_encoder_unittest.cc index 2a12448..5b2a97d 100644 --- a/media/cast/encoding/audio_encoder_unittest.cc +++ b/media/cast/encoding/audio_encoder_unittest.cc
@@ -100,8 +100,9 @@ std::string ToString() const { std::ostringstream out; for (size_t i = 0; i < num_durations; ++i) { - if (i > 0) + if (i > 0) { out << ", "; + } out << durations_in_ms[i]; } return out.str();
diff --git a/media/cast/encoding/av1_encoder.cc b/media/cast/encoding/av1_encoder.cc index 3fae5d8..ebdfabc 100644 --- a/media/cast/encoding/av1_encoder.cc +++ b/media/cast/encoding/av1_encoder.cc
@@ -93,8 +93,9 @@ Av1Encoder::~Av1Encoder() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - if (is_initialized()) + if (is_initialized()) { aom_codec_destroy(&encoder_); + } } void Av1Encoder::Initialize() { @@ -118,8 +119,9 @@ config_.g_w = frame_size.width(); config_.g_h = frame_size.height(); config_.rc_min_quantizer = codec_params_->min_qp; - if (aom_codec_enc_config_set(&encoder_, &config_) == AOM_CODEC_OK) + if (aom_codec_enc_config_set(&encoder_, &config_) == AOM_CODEC_OK) { return; + } DVLOG(1) << "libaom rejected the attempt to use a smaller frame size in " "the current instance."; } @@ -208,8 +210,9 @@ // Initialize on-demand. Later, if the video frame size has changed, update // the encoder configuration. const gfx::Size frame_size = video_frame->visible_rect().size(); - if (!is_initialized() || gfx::Size(config_.g_w, config_.g_h) != frame_size) + if (!is_initialized() || gfx::Size(config_.g_w, config_.g_h) != frame_size) { ConfigureForNewFrameSize(frame_size); + } // Wrapper for aom_codec_encode() to access the YUV data in the |video_frame|. // Only the VISIBLE rectangle within |video_frame| is exposed to the codec. @@ -383,12 +386,14 @@ void Av1Encoder::UpdateRates(uint32_t new_bitrate) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - if (!is_initialized()) + if (!is_initialized()) { return; + } uint32_t new_bitrate_kbit = new_bitrate / 1000; - if (config_.rc_target_bitrate == new_bitrate_kbit) + if (config_.rc_target_bitrate == new_bitrate_kbit) { return; + } config_.rc_target_bitrate = bitrate_kbit_ = new_bitrate_kbit;
diff --git a/media/cast/encoding/encoding_support.cc b/media/cast/encoding/encoding_support.cc index 8c6c82d..1587555c 100644 --- a/media/cast/encoding/encoding_support.cc +++ b/media/cast/encoding/encoding_support.cc
@@ -90,7 +90,7 @@ const std::vector<VideoEncodeAccelerator::SupportedProfile>& profiles) { // Force disabling takes precedent over other flags. const base::CommandLine& command_line = - *base::CommandLine::ForCurrentProcess(); + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch( switches::kCastStreamingForceDisableHardwareH264)) { return false;
diff --git a/media/cast/encoding/external_video_encoder.cc b/media/cast/encoding/external_video_encoder.cc index 771517c..2cee8e9 100644 --- a/media/cast/encoding/external_video_encoder.cc +++ b/media/cast/encoding/external_video_encoder.cc
@@ -98,10 +98,9 @@ // of the CastEnvironment clock, the latter of which might be simulated. const base::TimeTicks start_time; - InProgressExternalVideoFrameEncode( - scoped_refptr<VideoFrame> v_frame, - base::TimeTicks r_time, - int bit_rate) + InProgressExternalVideoFrameEncode(scoped_refptr<VideoFrame> v_frame, + base::TimeTicks r_time, + int bit_rate) : video_frame(std::move(v_frame)), reference_time(r_time), target_bit_rate(bit_rate), @@ -288,8 +287,9 @@ base::BindOnce(status_change_cb_, status, STATUS_CODEC_RUNTIME_ERROR)); // Flush all in progress frames to avoid any getting stuck. - while (!in_progress_frame_encodes_.empty()) + while (!in_progress_frame_encodes_.empty()) { AbortLatestEncodeAttemptDueToErrors(); + } } void AllocateInputBuffer(size_t size) { @@ -509,8 +509,9 @@ ~VEAClientImpl() final { DCHECK(task_runner_->RunsTasksInCurrentSequence()); - while (!in_progress_frame_encodes_.empty()) + while (!in_progress_frame_encodes_.empty()) { AbortLatestEncodeAttemptDueToErrors(); + } // According to the media::VideoEncodeAccelerator interface, Destroy() // should be called instead of invoking its private destructor. @@ -556,8 +557,9 @@ case H264NALU::kNonIDRSlice: { H264SliceHeader slice_header; if (h264_parser_.ParseSliceHeader(nalu, &slice_header) != - H264Parser::kOk) + H264Parser::kOk) { return -1; + } const H264PPS* pps = h264_parser_.GetPPS(slice_header.pic_parameter_set_id); if (!pps) {
diff --git a/media/cast/encoding/external_video_encoder_unittest.cc b/media/cast/encoding/external_video_encoder_unittest.cc index ee2d03e..ceb5a19 100644 --- a/media/cast/encoding/external_video_encoder_unittest.cc +++ b/media/cast/encoding/external_video_encoder_unittest.cc
@@ -48,13 +48,15 @@ // quantizer value should be repeatedly generated since there is no difference // between frames. EXPECT_EQ(4.0, qe.EstimateForKeyFrame(*black_frame)); - for (int i = 0; i < 3; ++i) + for (int i = 0; i < 3; ++i) { EXPECT_EQ(4.0, qe.EstimateForDeltaFrame(*black_frame)); + } const auto checkerboard_frame_data = std::make_unique<uint8_t[]>(frame_size.GetArea()); - for (int i = 0, end = frame_size.GetArea(); i < end; ++i) + for (int i = 0, end = frame_size.GetArea(); i < end; ++i) { checkerboard_frame_data.get()[i] = (((i % 2) == 0) ? 0 : 255); + } const scoped_refptr<VideoFrame> checkerboard_frame = CreateFrame(checkerboard_frame_data.get(), frame_size);
diff --git a/media/cast/encoding/video_encoder_unittest.cc b/media/cast/encoding/video_encoder_unittest.cc index 11553ec..a12b0e94 100644 --- a/media/cast/encoding/video_encoder_unittest.cc +++ b/media/cast/encoding/video_encoder_unittest.cc
@@ -118,8 +118,9 @@ &FakeVideoEncodeAcceleratorFactory::CreateVideoEncodeAccelerator, base::Unretained(vea_factory_.get()))); RunTasksAndAdvanceClock(); - if (is_encoder_present()) + if (is_encoder_present()) { ASSERT_EQ(STATUS_INITIALIZED, operational_status_); + } } bool is_encoder_present() const { return !!video_encoder_; } @@ -163,14 +164,16 @@ // that the VEA factory has responded (by running the callbacks) a specific // number of times. Otherwise, check that the VEA factory is inactive. void ExpectVEAResponseForExternalVideoEncoder(int vea_response_count) const { - if (!vea_factory_) + if (!vea_factory_) { return; + } EXPECT_EQ(vea_response_count, vea_factory_->vea_response_count()); } void SetVEAFactoryAutoRespond(bool auto_respond) { - if (vea_factory_) + if (vea_factory_) { vea_factory_->SetAutoRespond(auto_respond); + } } private: @@ -274,8 +277,9 @@ } // Wait until all queued frames have been delivered then shut everything down. - while (encoded_frames.size() < static_cast<size_t>(count_frames_accepted)) + while (encoded_frames.size() < static_cast<size_t>(count_frames_accepted)) { RunTasksAndAdvanceClock(); + } DestroyEncoder(); RunTasksAndAdvanceClock(); encoded_frames_weak_factory.InvalidateWeakPtrs();
diff --git a/media/cast/encoding/vpx_encoder.cc b/media/cast/encoding/vpx_encoder.cc index a17752c..53b7e160 100644 --- a/media/cast/encoding/vpx_encoder.cc +++ b/media/cast/encoding/vpx_encoder.cc
@@ -98,8 +98,9 @@ VpxEncoder::~VpxEncoder() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - if (is_initialized()) + if (is_initialized()) { vpx_codec_destroy(&encoder_); + } } void VpxEncoder::Initialize() { @@ -123,8 +124,9 @@ config_.g_w = frame_size.width(); config_.g_h = frame_size.height(); config_.rc_min_quantizer = codec_params_->min_qp; - if (vpx_codec_enc_config_set(&encoder_, &config_) == VPX_CODEC_OK) + if (vpx_codec_enc_config_set(&encoder_, &config_) == VPX_CODEC_OK) { return; + } DVLOG(1) << "libvpx rejected the attempt to use a smaller frame size in " "the current instance."; } @@ -240,8 +242,9 @@ // Initialize on-demand. Later, if the video frame size has changed, update // the encoder configuration. const gfx::Size frame_size = video_frame->visible_rect().size(); - if (!is_initialized() || gfx::Size(config_.g_w, config_.g_h) != frame_size) + if (!is_initialized() || gfx::Size(config_.g_w, config_.g_h) != frame_size) { ConfigureForNewFrameSize(frame_size); + } // Wrapper for vpx_codec_encode() to access the YUV data in the |video_frame|. // Only the VISIBLE rectangle within |video_frame| is exposed to the codec. @@ -439,12 +442,14 @@ void VpxEncoder::UpdateRates(uint32_t new_bitrate) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - if (!is_initialized()) + if (!is_initialized()) { return; + } uint32_t new_bitrate_kbit = new_bitrate / 1000; - if (config_.rc_target_bitrate == new_bitrate_kbit) + if (config_.rc_target_bitrate == new_bitrate_kbit) { return; + } config_.rc_target_bitrate = bitrate_kbit_ = new_bitrate_kbit;
diff --git a/media/cast/logging/encoding_event_subscriber.cc b/media/cast/logging/encoding_event_subscriber.cc index 1bed1732..87b25f67 100644 --- a/media/cast/logging/encoding_event_subscriber.cc +++ b/media/cast/logging/encoding_event_subscriber.cc
@@ -37,7 +37,8 @@ } BasePacketEvent* GetNewBasePacketEvent(AggregatedPacketEvent* event_proto, - int packet_id, int size) { + int packet_id, + int size) { BasePacketEvent* base = event_proto->add_base_packet_event(); base->set_packet_id(packet_id); base->set_size(size); @@ -64,8 +65,9 @@ const FrameEvent& frame_event) { DCHECK(thread_checker_.CalledOnValidThread()); - if (event_media_type_ != frame_event.media_type) + if (event_media_type_ != frame_event.media_type) { return; + } const RtpTimeDelta relative_rtp_timestamp = GetRelativeRtpTimestamp(frame_event.rtp_timestamp); @@ -75,8 +77,9 @@ // Look up existing entry. If not found, create a new entry and add to map. auto it = frame_event_map_.find(relative_rtp_timestamp); if (it == frame_event_map_.end()) { - if (!ShouldCreateNewProto(lower_32_bits)) + if (!ShouldCreateNewProto(lower_32_bits)) { return; + } IncrementStoredProtoCount(lower_32_bits); auto event_proto = std::make_unique<AggregatedFrameEvent>(); @@ -106,8 +109,8 @@ (frame_event.timestamp - base::TimeTicks()).InMilliseconds()); if (frame_event.type == FRAME_CAPTURE_END) { - if (frame_event.media_type == VIDEO_EVENT && - frame_event.width > 0 && frame_event.height > 0) { + if (frame_event.media_type == VIDEO_EVENT && frame_event.width > 0 && + frame_event.height > 0) { event_proto_ptr->set_width(frame_event.width); event_proto_ptr->set_height(frame_event.height); } @@ -131,8 +134,9 @@ event_proto_ptr->set_delay_millis(frame_event.delay_delta.InMilliseconds()); } - if (frame_event_map_.size() > kMaxMapSize) + if (frame_event_map_.size() > kMaxMapSize) { TransferFrameEvents(kNumMapEntriesToTransfer); + } DCHECK(frame_event_map_.size() <= kMaxMapSize); DCHECK(frame_event_storage_.size() <= max_frames_); @@ -142,8 +146,9 @@ const PacketEvent& packet_event) { DCHECK(thread_checker_.CalledOnValidThread()); - if (event_media_type_ != packet_event.media_type) + if (event_media_type_ != packet_event.media_type) { return; + } const RtpTimeDelta relative_rtp_timestamp = GetRelativeRtpTimestamp(packet_event.rtp_timestamp); @@ -153,8 +158,9 @@ // Look up existing entry. If not found, create a new entry and add to map. if (it == packet_event_map_.end()) { - if (!ShouldCreateNewProto(lower_32_bits)) + if (!ShouldCreateNewProto(lower_32_bits)) { return; + } IncrementStoredProtoCount(lower_32_bits); auto event_proto = std::make_unique<AggregatedPacketEvent>(); @@ -170,8 +176,7 @@ it->second->mutable_base_packet_event(); for (RepeatedPtrField<BasePacketEvent>::pointer_iterator base_it = field->pointer_begin(); - base_it != field->pointer_end(); - ++base_it) { + base_it != field->pointer_end(); ++base_it) { if ((*base_it)->packet_id() == packet_event.packet_id) { base_packet_event_proto = *base_it; break; @@ -197,9 +202,9 @@ it->second.get(), packet_event.packet_id, packet_event.size); } else if (base_packet_event_proto->event_type_size() >= kMaxEventsPerProto) { - DVLOG(3) << "Too many events in packet " - << packet_event.rtp_timestamp << ", " - << packet_event.packet_id << ". Using new packet event proto."; + DVLOG(3) << "Too many events in packet " << packet_event.rtp_timestamp + << ", " << packet_event.packet_id + << ". Using new packet event proto."; AddPacketEventToStorage(std::move(it->second)); if (!ShouldCreateNewProto(lower_32_bits)) { packet_event_map_.erase(it); @@ -214,8 +219,7 @@ } } - base_packet_event_proto->add_event_type( - ToProtoEventType(packet_event.type)); + base_packet_event_proto->add_event_type(ToProtoEventType(packet_event.type)); base_packet_event_proto->add_event_timestamp_ms( (packet_event.timestamp - base::TimeTicks()).InMilliseconds()); @@ -226,15 +230,18 @@ base_packet_event_proto->set_size(packet_event.size); } - if (packet_event_map_.size() > kMaxMapSize) + if (packet_event_map_.size() > kMaxMapSize) { TransferPacketEvents(kNumMapEntriesToTransfer); + } DCHECK(packet_event_map_.size() <= kMaxMapSize); DCHECK(packet_event_storage_.size() <= max_frames_); } -void EncodingEventSubscriber::GetEventsAndReset(LogMetadata* metadata, - FrameEventList* frame_events, PacketEventList* packet_events) { +void EncodingEventSubscriber::GetEventsAndReset( + LogMetadata* metadata, + FrameEventList* frame_events, + PacketEventList* packet_events) { DCHECK(thread_checker_.CalledOnValidThread()); // Flush all events. @@ -260,8 +267,7 @@ DCHECK(frame_event_map_.size() >= max_num_entries); auto it = frame_event_map_.begin(); - for (size_t i = 0; - i < max_num_entries && it != frame_event_map_.end(); + for (size_t i = 0; i < max_num_entries && it != frame_event_map_.end(); i++, ++it) { AddFrameEventToStorage(std::move(it->second)); } @@ -271,8 +277,7 @@ void EncodingEventSubscriber::TransferPacketEvents(size_t max_num_entries) { auto it = packet_event_map_.begin(); - for (size_t i = 0; - i < max_num_entries && it != packet_event_map_.end(); + for (size_t i = 0; i < max_num_entries && it != packet_event_map_.end(); i++, ++it) { AddPacketEventToStorage(std::move(it->second)); } @@ -330,10 +335,11 @@ auto it = stored_proto_counts_.find(relative_rtp_timestamp_lower_32_bits); CHECK(it != stored_proto_counts_.end(), base::NotFatalUntil::M130) << "no event protos for " << relative_rtp_timestamp_lower_32_bits; - if (it->second > 1) + if (it->second > 1) { it->second--; - else + } else { stored_proto_counts_.erase(it); + } } RtpTimeDelta EncodingEventSubscriber::GetRelativeRtpTimestamp(
diff --git a/media/cast/logging/encoding_event_subscriber_unittest.cc b/media/cast/logging/encoding_event_subscriber_unittest.cc index 48d2e803..38149fb 100644 --- a/media/cast/logging/encoding_event_subscriber_unittest.cc +++ b/media/cast/logging/encoding_event_subscriber_unittest.cc
@@ -28,7 +28,7 @@ return (event_time - base::TimeTicks()).InMilliseconds(); } -} +} // namespace namespace media { namespace cast { @@ -50,13 +50,14 @@ } ~EncodingEventSubscriberTest() override { - if (event_subscriber_) + if (event_subscriber_) { cast_environment_->logger()->Unsubscribe(event_subscriber_.get()); + } } void GetEventsAndReset() { - event_subscriber_->GetEventsAndReset( - &metadata_, &frame_events_, &packet_events_); + event_subscriber_->GetEventsAndReset(&metadata_, &frame_events_, + &packet_events_); first_rtp_timestamp_ = RtpTimeTicks().Expand(metadata_.first_rtp_timestamp()); } @@ -229,8 +230,7 @@ const AggregatedFrameEvent* frame_event = it->get(); ASSERT_EQ(1, frame_event->event_type_size()); - EXPECT_EQ(media::cast::proto::FRAME_DECODED, - frame_event->event_type(0)); + EXPECT_EQ(media::cast::proto::FRAME_DECODED, frame_event->event_type(0)); GetEventsAndReset(); @@ -467,8 +467,7 @@ const BasePacketEvent& base_event = event->base_packet_event(0); EXPECT_EQ(packet_id, base_event.packet_id()); ASSERT_EQ(1, base_event.event_type_size()); - EXPECT_EQ(media::cast::proto::PACKET_RECEIVED, - base_event.event_type(0)); + EXPECT_EQ(media::cast::proto::PACKET_RECEIVED, base_event.event_type(0)); ASSERT_EQ(1, base_event.event_timestamp_ms_size()); EXPECT_EQ(InMilliseconds(now), base_event.event_timestamp_ms(0)); EXPECT_EQ(size, base_event.size()); @@ -524,8 +523,7 @@ ASSERT_EQ(2, base_event.event_type_size()); EXPECT_EQ(media::cast::proto::PACKET_SENT_TO_NETWORK, base_event.event_type(0)); - EXPECT_EQ(media::cast::proto::PACKET_RETRANSMITTED, - base_event.event_type(1)); + EXPECT_EQ(media::cast::proto::PACKET_RETRANSMITTED, base_event.event_type(1)); ASSERT_EQ(2, base_event.event_timestamp_ms_size()); EXPECT_EQ(InMilliseconds(now1), base_event.event_timestamp_ms(0)); EXPECT_EQ(InMilliseconds(now2), base_event.event_timestamp_ms(1));
diff --git a/media/cast/logging/log_event_dispatcher.cc b/media/cast/logging/log_event_dispatcher.cc index 48a88d9..f35cdd92 100644 --- a/media/cast/logging/log_event_dispatcher.cc +++ b/media/cast/logging/log_event_dispatcher.cc
@@ -105,24 +105,28 @@ void LogEventDispatcher::Impl::DispatchFrameEvent( std::unique_ptr<FrameEvent> event) const { - for (RawEventSubscriber* s : subscribers_) + for (RawEventSubscriber* s : subscribers_) { s->OnReceiveFrameEvent(*event); + } } void LogEventDispatcher::Impl::DispatchPacketEvent( std::unique_ptr<PacketEvent> event) const { - for (RawEventSubscriber* s : subscribers_) + for (RawEventSubscriber* s : subscribers_) { s->OnReceivePacketEvent(*event); + } } void LogEventDispatcher::Impl::DispatchBatchOfEvents( std::unique_ptr<std::vector<FrameEvent>> frame_events, std::unique_ptr<std::vector<PacketEvent>> packet_events) const { for (RawEventSubscriber* s : subscribers_) { - for (const FrameEvent& e : *frame_events) + for (const FrameEvent& e : *frame_events) { s->OnReceiveFrameEvent(e); - for (const PacketEvent& e : *packet_events) + } + for (const PacketEvent& e : *packet_events) { s->OnReceivePacketEvent(e); + } } }
diff --git a/media/cast/logging/proto/proto_utils.cc b/media/cast/logging/proto/proto_utils.cc index a4bad44..a8e03d2 100644 --- a/media/cast/logging/proto/proto_utils.cc +++ b/media/cast/logging/proto/proto_utils.cc
@@ -6,8 +6,8 @@ #include "base/notreached.h" -#define TO_PROTO_ENUM(enum) \ - case enum: \ +#define TO_PROTO_ENUM(enum) \ + case enum: \ return proto::enum namespace media {
diff --git a/media/cast/logging/raw_event_subscriber_bundle.cc b/media/cast/logging/raw_event_subscriber_bundle.cc index 5459bfae..3b592f5 100644 --- a/media/cast/logging/raw_event_subscriber_bundle.cc +++ b/media/cast/logging/raw_event_subscriber_bundle.cc
@@ -20,9 +20,9 @@ event_subscriber_( is_audio ? AUDIO_EVENT : VIDEO_EVENT, is_audio ? kMaxAudioEventEntries : kMaxVideoEventEntries), - stats_subscriber_( - is_audio ? AUDIO_EVENT : VIDEO_EVENT, - cast_environment->Clock(), offset_estimator) { + stats_subscriber_(is_audio ? AUDIO_EVENT : VIDEO_EVENT, + cast_environment->Clock(), + offset_estimator) { cast_environment_->logger()->Subscribe(&event_subscriber_); cast_environment_->logger()->Subscribe(&stats_subscriber_); } @@ -47,8 +47,9 @@ : cast_environment_(cast_environment) {} RawEventSubscriberBundle::~RawEventSubscriberBundle() { - if (receiver_offset_estimator_.get()) + if (receiver_offset_estimator_.get()) { cast_environment_->logger()->Unsubscribe(receiver_offset_estimator_.get()); + } } void RawEventSubscriberBundle::AddEventSubscribers(bool is_audio) { @@ -58,8 +59,9 @@ cast_environment_->logger()->Subscribe(receiver_offset_estimator_.get()); } auto it = subscribers_.find(is_audio); - if (it != subscribers_.end()) + if (it != subscribers_.end()) { return; + } subscribers_.insert(std::make_pair( is_audio, @@ -69,8 +71,9 @@ void RawEventSubscriberBundle::RemoveEventSubscribers(bool is_audio) { auto it = subscribers_.find(is_audio); - if (it == subscribers_.end()) + if (it == subscribers_.end()) { return; + } subscribers_.erase(it); if (subscribers_.empty()) { @@ -79,15 +82,15 @@ } } -EncodingEventSubscriber* -RawEventSubscriberBundle::GetEncodingEventSubscriber(bool is_audio) { +EncodingEventSubscriber* RawEventSubscriberBundle::GetEncodingEventSubscriber( + bool is_audio) { auto it = subscribers_.find(is_audio); return it == subscribers_.end() ? nullptr : it->second->GetEncodingEventSubscriber(); } -StatsEventSubscriber* -RawEventSubscriberBundle::GetStatsEventSubscriber(bool is_audio) { +StatsEventSubscriber* RawEventSubscriberBundle::GetStatsEventSubscriber( + bool is_audio) { auto it = subscribers_.find(is_audio); return it == subscribers_.end() ? nullptr : it->second->GetStatsEventSubscriber();
diff --git a/media/cast/logging/raw_event_subscriber_bundle.h b/media/cast/logging/raw_event_subscriber_bundle.h index f15bec2a..45e35cf 100644 --- a/media/cast/logging/raw_event_subscriber_bundle.h +++ b/media/cast/logging/raw_event_subscriber_bundle.h
@@ -67,8 +67,7 @@ void AddEventSubscribers(bool is_audio); void RemoveEventSubscribers(bool is_audio); - EncodingEventSubscriber* GetEncodingEventSubscriber( - bool is_audio); + EncodingEventSubscriber* GetEncodingEventSubscriber(bool is_audio); StatsEventSubscriber* GetStatsEventSubscriber(bool is_audio); private:
diff --git a/media/cast/logging/receiver_time_offset_estimator_impl.cc b/media/cast/logging/receiver_time_offset_estimator_impl.cc index 77ae96e..54e63e5 100644 --- a/media/cast/logging/receiver_time_offset_estimator_impl.cc +++ b/media/cast/logging/receiver_time_offset_estimator_impl.cc
@@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "media/cast/logging/receiver_time_offset_estimator_impl.h" + #include <algorithm> #include <utility> #include "base/check.h" #include "base/time/tick_clock.h" -#include "media/cast/logging/receiver_time_offset_estimator_impl.h" namespace media { namespace cast { @@ -49,22 +50,23 @@ } void ReceiverTimeOffsetEstimatorImpl::BoundCalculator::UpdateBound( - base::TimeTicks sent, base::TimeTicks received) { - base::TimeDelta delta = received - sent; - if (has_bound_) { - if (delta < bound_) { - bound_ = delta; - } else { - bound_ += (delta - bound_) / kClockDriftSpeed; - } - } else { + base::TimeTicks sent, + base::TimeTicks received) { + base::TimeDelta delta = received - sent; + if (has_bound_) { + if (delta < bound_) { bound_ = delta; + } else { + bound_ += (delta - bound_) / kClockDriftSpeed; } - has_bound_ = true; + } else { + bound_ = delta; } + has_bound_ = true; +} - void ReceiverTimeOffsetEstimatorImpl::BoundCalculator::CheckUpdate( - uint64_t key) { +void ReceiverTimeOffsetEstimatorImpl::BoundCalculator::CheckUpdate( + uint64_t key) { const TimeTickPair& ticks = events_[key]; if (!ticks.first.is_null() && !ticks.second.is_null()) { UpdateBound(ticks.first, ticks.second); @@ -86,20 +88,17 @@ DCHECK(thread_checker_.CalledOnValidThread()); } - void ReceiverTimeOffsetEstimatorImpl::OnReceiveFrameEvent( const FrameEvent& frame_event) { DCHECK(thread_checker_.CalledOnValidThread()); switch (frame_event.type) { case FRAME_ACK_SENT: - lower_bound_.SetSent(frame_event.rtp_timestamp, - 0, + lower_bound_.SetSent(frame_event.rtp_timestamp, 0, frame_event.media_type == AUDIO_EVENT, frame_event.timestamp); break; case FRAME_ACK_RECEIVED: - lower_bound_.SetReceived(frame_event.rtp_timestamp, - 0, + lower_bound_.SetReceived(frame_event.rtp_timestamp, 0, frame_event.media_type == AUDIO_EVENT, frame_event.timestamp); break; @@ -112,8 +111,9 @@ bool ReceiverTimeOffsetEstimatorImpl::GetReceiverOffsetBounds( base::TimeDelta* lower_bound, base::TimeDelta* upper_bound) { - if (!lower_bound_.has_bound() || !upper_bound_.has_bound()) + if (!lower_bound_.has_bound() || !upper_bound_.has_bound()) { return false; + } *lower_bound = -lower_bound_.bound(); *upper_bound = upper_bound_.bound(); @@ -132,16 +132,14 @@ DCHECK(thread_checker_.CalledOnValidThread()); switch (packet_event.type) { case PACKET_SENT_TO_NETWORK: - upper_bound_.SetSent(packet_event.rtp_timestamp, - packet_event.packet_id, + upper_bound_.SetSent(packet_event.rtp_timestamp, packet_event.packet_id, packet_event.media_type == AUDIO_EVENT, packet_event.timestamp); break; case PACKET_RECEIVED: - upper_bound_.SetReceived(packet_event.rtp_timestamp, - packet_event.packet_id, - packet_event.media_type == AUDIO_EVENT, - packet_event.timestamp); + upper_bound_.SetReceived( + packet_event.rtp_timestamp, packet_event.packet_id, + packet_event.media_type == AUDIO_EVENT, packet_event.timestamp); break; default: // Ignored @@ -149,6 +147,5 @@ } } - } // namespace cast } // namespace media
diff --git a/media/cast/logging/receiver_time_offset_estimator_impl.h b/media/cast/logging/receiver_time_offset_estimator_impl.h index 9af3e4c7..1b54903 100644 --- a/media/cast/logging/receiver_time_offset_estimator_impl.h +++ b/media/cast/logging/receiver_time_offset_estimator_impl.h
@@ -19,7 +19,6 @@ namespace media { namespace cast { - // This should be large enough so that we can collect all 3 events before // the entry gets removed from the map. const size_t kMaxEventTimesMapSize = 500; @@ -28,7 +27,6 @@ // (But with more jitter.) const size_t kClockDriftSpeed = 500; - // This implementation listens to two pair of events // 1. FRAME_ACK_SENT / FRAME_ACK_RECEIVED (receiver->sender) // 2. PACKET_SENT_TO_NETWORK / PACKET_RECEIVED (sender->receiver)
diff --git a/media/cast/logging/stats_event_subscriber.cc b/media/cast/logging/stats_event_subscriber.cc index 34c649b8..ac53f6d 100644 --- a/media/cast/logging/stats_event_subscriber.cc +++ b/media/cast/logging/stats_event_subscriber.cc
@@ -30,10 +30,8 @@ const size_t kMaxPacketEventTimeMapSize = 1000; bool IsReceiverEvent(CastLoggingEvent event) { - return event == FRAME_DECODED - || event == FRAME_PLAYOUT - || event == FRAME_ACK_SENT - || event == PACKET_RECEIVED; + return event == FRAME_DECODED || event == FRAME_PLAYOUT || + event == FRAME_ACK_SENT || event == PACKET_RECEIVED; } } // namespace @@ -74,8 +72,9 @@ } for (size_t i = 1; i < buckets_.size() - 1; i++) { - if (!buckets_[i]) + if (!buckets_[i]) { continue; + } base::Value::Dict bucket; int64_t lower = min_ + (i - 1) * width_; int64_t upper = lower + width_ - 1; @@ -122,8 +121,9 @@ DCHECK(thread_checker_.CalledOnValidThread()); CastLoggingEvent type = frame_event.type; - if (frame_event.media_type != event_media_type_) + if (frame_event.media_type != event_media_type_) { return; + } auto it = frame_stats_.find(type); if (it == frame_stats_.end()) { @@ -160,8 +160,9 @@ } } - if (is_receiver_event) + if (is_receiver_event) { UpdateLastResponseTime(frame_event.timestamp); + } } void StatsEventSubscriber::OnReceivePacketEvent( @@ -169,8 +170,9 @@ DCHECK(thread_checker_.CalledOnValidThread()); CastLoggingEvent type = packet_event.type; - if (packet_event.media_type != event_media_type_) + if (packet_event.media_type != event_media_type_) { return; + } auto it = packet_stats_.find(type); if (it == packet_stats_.end()) { @@ -186,8 +188,7 @@ bool is_receiver_event = IsReceiverEvent(type); UpdateFirstLastEventTime(packet_event.timestamp, is_receiver_event); - if (type == PACKET_SENT_TO_NETWORK || - type == PACKET_RECEIVED) { + if (type == PACKET_SENT_TO_NETWORK || type == PACKET_RECEIVED) { RecordPacketRelatedLatencies(packet_event); } else if (type == PACKET_RETRANSMITTED) { // We only measure network latency using packets that doesn't have to be @@ -195,16 +196,18 @@ ErasePacketSentTime(packet_event); } - if (is_receiver_event) + if (is_receiver_event) { UpdateLastResponseTime(packet_event.timestamp); + } } void StatsEventSubscriber::UpdateFirstLastEventTime(base::TimeTicks timestamp, bool is_receiver_event) { if (is_receiver_event) { base::TimeDelta receiver_offset; - if (!GetReceiverOffset(&receiver_offset)) + if (!GetReceiverOffset(&receiver_offset)) { return; + } timestamp -= receiver_offset; } @@ -356,28 +359,21 @@ base::TimeTicks end_time = clock_->NowTicks(); - PopulateFpsStat( - end_time, FRAME_CAPTURE_BEGIN, CAPTURE_FPS, stats_map); - PopulateFpsStat( - end_time, FRAME_ENCODED, ENCODE_FPS, stats_map); - PopulateFpsStat( - end_time, FRAME_DECODED, DECODE_FPS, stats_map); + PopulateFpsStat(end_time, FRAME_CAPTURE_BEGIN, CAPTURE_FPS, stats_map); + PopulateFpsStat(end_time, FRAME_ENCODED, ENCODE_FPS, stats_map); + PopulateFpsStat(end_time, FRAME_DECODED, DECODE_FPS, stats_map); PopulateFrameBitrateStat(end_time, stats_map); - PopulatePacketBitrateStat(end_time, - PACKET_SENT_TO_NETWORK, - TRANSMISSION_KBPS, + PopulatePacketBitrateStat(end_time, PACKET_SENT_TO_NETWORK, TRANSMISSION_KBPS, stats_map); - PopulatePacketBitrateStat(end_time, - PACKET_RETRANSMITTED, - RETRANSMISSION_KBPS, + PopulatePacketBitrateStat(end_time, PACKET_RETRANSMITTED, RETRANSMISSION_KBPS, stats_map); PopulateFrameCountStat(FRAME_CAPTURE_END, NUM_FRAMES_CAPTURED, stats_map); PopulatePacketCountStat(PACKET_SENT_TO_NETWORK, NUM_PACKETS_SENT, stats_map); - PopulatePacketCountStat( - PACKET_RETRANSMITTED, NUM_PACKETS_RETRANSMITTED, stats_map); + PopulatePacketCountStat(PACKET_RETRANSMITTED, NUM_PACKETS_RETRANSMITTED, + stats_map); PopulatePacketCountStat(PACKET_RECEIVED, NUM_PACKETS_RECEIVED, stats_map); - PopulatePacketCountStat( - PACKET_RTX_REJECTED, NUM_PACKETS_RTX_REJECTED, stats_map); + PopulatePacketCountStat(PACKET_RTX_REJECTED, NUM_PACKETS_RTX_REJECTED, + stats_map); if (capture_latency_datapoints_ > 0) { double avg_capture_latency_ms = @@ -389,14 +385,12 @@ if (encode_time_datapoints_ > 0) { double avg_encode_time_ms = total_encode_time_.InMillisecondsF() / encode_time_datapoints_; - stats_map->insert( - std::make_pair(AVG_ENCODE_TIME_MS, avg_encode_time_ms)); + stats_map->insert(std::make_pair(AVG_ENCODE_TIME_MS, avg_encode_time_ms)); } if (queueing_latency_datapoints_ > 0) { - double avg_queueing_latency_ms = - total_queueing_latency_.InMillisecondsF() / - queueing_latency_datapoints_; + double avg_queueing_latency_ms = total_queueing_latency_.InMillisecondsF() / + queueing_latency_datapoints_; stats_map->insert( std::make_pair(AVG_QUEUEING_LATENCY_MS, avg_queueing_latency_ms)); } @@ -429,8 +423,8 @@ } if (!last_response_received_time_.is_null()) { - stats_map->insert( - std::make_pair(MS_SINCE_LAST_RECEIVER_RESPONSE, + stats_map->insert(std::make_pair( + MS_SINCE_LAST_RECEIVER_RESPONSE, (end_time - last_response_received_time_).InMillisecondsF())); } @@ -450,8 +444,7 @@ } StatsEventSubscriber::SimpleHistogram* -StatsEventSubscriber::GetHistogramForTesting( - CastStat stats) const { +StatsEventSubscriber::GetHistogramForTesting(CastStat stats) const { DCHECK(histograms_.find(stats) != histograms_.end()); return histograms_.find(stats)->second.get(); } @@ -481,8 +474,9 @@ if (recent_frame_infos_.size() >= kMaxFrameInfoMapSize) { auto erase_it = recent_frame_infos_.begin(); - if (erase_it->second.encode_end_time.is_null()) + if (erase_it->second.encode_end_time.is_null()) { num_frames_dropped_by_encoder_++; + } recent_frame_infos_.erase(erase_it); } } @@ -532,15 +526,18 @@ void StatsEventSubscriber::RecordFrameTxLatency(const FrameEvent& frame_event) { auto it = recent_frame_infos_.find(frame_event.rtp_timestamp); - if (it == recent_frame_infos_.end()) + if (it == recent_frame_infos_.end()) { return; + } - if (it->second.encode_end_time.is_null()) + if (it->second.encode_end_time.is_null()) { return; + } base::TimeDelta receiver_offset; - if (!GetReceiverOffset(&receiver_offset)) + if (!GetReceiverOffset(&receiver_offset)) { return; + } base::TimeTicks sender_time = frame_event.timestamp - receiver_offset; base::TimeDelta latency = sender_time - it->second.encode_end_time; @@ -551,12 +548,14 @@ void StatsEventSubscriber::RecordE2ELatency(const FrameEvent& frame_event) { base::TimeDelta receiver_offset; - if (!GetReceiverOffset(&receiver_offset)) + if (!GetReceiverOffset(&receiver_offset)) { return; + } auto it = recent_frame_infos_.find(frame_event.rtp_timestamp); - if (it == recent_frame_infos_.end()) + if (it == recent_frame_infos_.end()) { return; + } base::TimeTicks playout_time = frame_event.timestamp - receiver_offset; base::TimeDelta latency = playout_time - it->second.capture_time; @@ -568,8 +567,9 @@ void StatsEventSubscriber::UpdateLastResponseTime( base::TimeTicks receiver_time) { base::TimeDelta receiver_offset; - if (!GetReceiverOffset(&receiver_offset)) + if (!GetReceiverOffset(&receiver_offset)) { return; + } base::TimeTicks sender_time = receiver_time - receiver_offset; last_response_received_time_ = sender_time; } @@ -591,15 +591,15 @@ packet_event.timestamp - it->second.encode_end_time; total_queueing_latency_ += latency; queueing_latency_datapoints_++; - histograms_[QUEUEING_LATENCY_MS_HISTO]->Add( - latency.InMillisecondsF()); + histograms_[QUEUEING_LATENCY_MS_HISTO]->Add(latency.InMillisecondsF()); } } // Log network latency and total packet latency; base::TimeDelta receiver_offset; - if (!GetReceiverOffset(&receiver_offset)) + if (!GetReceiverOffset(&receiver_offset)) { return; + } std::pair<RtpTimeTicks, uint16_t> key( std::make_pair(packet_event.rtp_timestamp, packet_event.packet_id)); @@ -608,8 +608,9 @@ std::pair<base::TimeTicks, CastLoggingEvent> value = std::make_pair(packet_event.timestamp, packet_event.type); packet_sent_times_.insert(std::make_pair(key, value)); - if (packet_sent_times_.size() > kMaxPacketEventTimeMapSize) + if (packet_sent_times_.size() > kMaxPacketEventTimeMapSize) { packet_sent_times_.erase(packet_sent_times_.begin()); + } } else { std::pair<base::TimeTicks, CastLoggingEvent> value = it->second; CastLoggingEvent recorded_type = value.second; @@ -622,7 +623,7 @@ packet_received_time = packet_event.timestamp; match = true; } else if (recorded_type == PACKET_RECEIVED && - packet_event.type == PACKET_SENT_TO_NETWORK) { + packet_event.type == PACKET_SENT_TO_NETWORK) { packet_sent_time = packet_event.timestamp; packet_received_time = value.first; match = true; @@ -646,8 +647,7 @@ packet_received_time - frame_it->second.encode_end_time; total_packet_latency_ += latency; packet_latency_datapoints_++; - histograms_[PACKET_LATENCY_MS_HISTO]->Add( - latency.InMillisecondsF()); + histograms_[PACKET_LATENCY_MS_HISTO]->Add(latency.InMillisecondsF()); } } } @@ -662,8 +662,9 @@ double fps = 0.0; base::TimeDelta duration = (end_time - start_time_); int count = it->second.event_counter; - if (duration.is_positive()) + if (duration.is_positive()) { fps = count / duration.InSecondsF(); + } stats_map->insert(std::make_pair(stat, fps)); } } @@ -725,8 +726,7 @@ : event_counter(0), sum_size(0) {} StatsEventSubscriber::PacketLogStats::~PacketLogStats() = default; -StatsEventSubscriber::FrameInfo::FrameInfo() : encoded(false) { -} +StatsEventSubscriber::FrameInfo::FrameInfo() : encoded(false) {} StatsEventSubscriber::FrameInfo::~FrameInfo() = default; } // namespace cast
diff --git a/media/cast/logging/stats_event_subscriber_unittest.cc b/media/cast/logging/stats_event_subscriber_unittest.cc index a82ae37..1532f97 100644 --- a/media/cast/logging/stats_event_subscriber_unittest.cc +++ b/media/cast/logging/stats_event_subscriber_unittest.cc
@@ -43,8 +43,9 @@ } ~StatsEventSubscriberTest() override { - if (subscriber_.get()) + if (subscriber_.get()) { cast_environment_->logger()->Unsubscribe(subscriber_.get()); + } cast_environment_->logger()->Unsubscribe(&fake_offset_estimator_); } @@ -253,8 +254,9 @@ int late_frames = 0; for (int i = 0, delay_ms = -50; i < num_frames; i++, delay_ms += 10) { base::TimeDelta delay = base::Milliseconds(delay_ms); - if (delay_ms > 0) + if (delay_ms > 0) { late_frames++; + } std::unique_ptr<FrameEvent> playout_event(new FrameEvent()); playout_event->timestamp = receiver_clock_.NowTicks(); playout_event->type = FRAME_PLAYOUT;
diff --git a/media/cast/sender/audio_sender.h b/media/cast/sender/audio_sender.h index a1ef089..4509839 100644 --- a/media/cast/sender/audio_sender.h +++ b/media/cast/sender/audio_sender.h
@@ -33,7 +33,6 @@ // timeouts. class AudioSender : public FrameSender::Client { public: - // New way of instantiating using an openscreen::cast::Sender. Since the // |Sender| instance is destroyed when renegotiation is complete, |this| // is also invalid and should be immediately torn down.
diff --git a/media/cast/sender/performance_metrics_overlay.cc b/media/cast/sender/performance_metrics_overlay.cc index 0d6dedf..c35aaa04 100644 --- a/media/cast/sender/performance_metrics_overlay.cc +++ b/media/cast/sender/performance_metrics_overlay.cc
@@ -67,10 +67,11 @@ base::span<uint8_t> p_l = p_ul.subspan(static_cast<size_t>(y * stride)); for (int x = left; x < right; ++x) { int intensity = p_l[x]; - if (intensity >= kDivergeDownThreshold) + if (intensity >= kDivergeDownThreshold) { intensity = std::max(kMinIntensity, intensity - kDivergeDownAmount); - else + } else { intensity += kDivergeUpAmount; + } p_l[x] = static_cast<uint8_t>(intensity); } } @@ -84,14 +85,18 @@ // including padding. const int line_width = (((kCharacterWidth + kCharacterSpacing) * static_cast<int>(line.size())) + - kCharacterSpacing) * kScale; + kCharacterSpacing) * + kScale; // Determine if any characters would render past the left edge of the frame, // and compute the index of the first character to be rendered. const int pixels_per_char = (kCharacterWidth + kCharacterSpacing) * kScale; - const size_t first_idx = (line_width < frame->visible_rect().width()) ? 0u : - static_cast<size_t>( - ((line_width - frame->visible_rect().width()) / pixels_per_char) + 1); + const size_t first_idx = + (line_width < frame->visible_rect().width()) + ? 0u + : static_cast<size_t>(((line_width - frame->visible_rect().width()) / + pixels_per_char) + + 1); // Compute the pointer to the pixel at the upper-left corner of the first // character to be rendered.
diff --git a/media/cast/sender/video_sender.cc b/media/cast/sender/video_sender.cc index a14a550..b870e17f 100644 --- a/media/cast/sender/video_sender.cc +++ b/media/cast/sender/video_sender.cc
@@ -233,8 +233,9 @@ // session to watching animating content while being limited by end-to-end // delay. VLOG(1) << "Ensure playout time is at least " << min_playout_delay_; - if (new_target_delay < min_playout_delay_) + if (new_target_delay < min_playout_delay_) { new_target_delay = min_playout_delay_; + } VLOG(1) << "New target delay: " << new_target_delay.InMilliseconds(); playout_delay_change_cb_.Run(new_target_delay); } @@ -289,8 +290,8 @@ } else { VLOG(1) << "Encoder rejected a frame. Skipping..."; TRACE_EVENT_INSTANT1("cast.stream", "Video Encode Reject", - TRACE_EVENT_SCOPE_THREAD, - "rtp_timestamp", rtp_timestamp.lower_32_bits()); + TRACE_EVENT_SCOPE_THREAD, "rtp_timestamp", + rtp_timestamp.lower_32_bits()); } } @@ -363,8 +364,9 @@ feedback.resource_utilization = encoded_frame->is_key_frame ? std::min(1.0, attenuated_utilization) : attenuated_utilization; - if (feedback_cb_) + if (feedback_cb_) { feedback_cb_.Run(feedback); + } } const RtpTimeTicks rtp_timestamp = encoded_frame->rtp_timestamp;
diff --git a/media/cast/sender/video_sender.h b/media/cast/sender/video_sender.h index 84a1736..967e193 100644 --- a/media/cast/sender/video_sender.h +++ b/media/cast/sender/video_sender.h
@@ -25,7 +25,7 @@ namespace media { class VideoEncoderMetricsProvider; class VideoFrame; -} +} // namespace media namespace media::cast {
diff --git a/media/cast/test/fake_receiver_time_offset_estimator.h b/media/cast/test/fake_receiver_time_offset_estimator.h index 3bcb0c13..70307133 100644 --- a/media/cast/test/fake_receiver_time_offset_estimator.h +++ b/media/cast/test/fake_receiver_time_offset_estimator.h
@@ -5,8 +5,8 @@ #ifndef MEDIA_CAST_TEST_FAKE_RECEIVER_TIME_OFFSET_ESTIMATOR_H_ #define MEDIA_CAST_TEST_FAKE_RECEIVER_TIME_OFFSET_ESTIMATOR_H_ -#include "base/time/time.h" #include "base/threading/thread_checker.h" +#include "base/time/time.h" #include "media/cast/logging/logging_defines.h" #include "media/cast/logging/receiver_time_offset_estimator.h"
diff --git a/media/cast/test/fake_video_encode_accelerator_factory.cc b/media/cast/test/fake_video_encode_accelerator_factory.cc index 19019c13..38bc4b0 100644 --- a/media/cast/test/fake_video_encode_accelerator_factory.cc +++ b/media/cast/test/fake_video_encode_accelerator_factory.cc
@@ -27,8 +27,9 @@ void FakeVideoEncodeAcceleratorFactory::SetAutoRespond(bool auto_respond) { auto_respond_ = auto_respond; if (auto_respond_) { - if (!vea_response_callback_.is_null()) + if (!vea_response_callback_.is_null()) { RespondWithVideoEncodeAccelerator(); + } } } @@ -42,8 +43,9 @@ vea->SetWillInitializationSucceed(will_init_succeed_); next_response_vea_.reset(vea); vea_response_callback_ = std::move(callback); - if (auto_respond_) + if (auto_respond_) { RespondWithVideoEncodeAccelerator(); + } } void FakeVideoEncodeAcceleratorFactory::RespondWithVideoEncodeAccelerator() {
diff --git a/media/cast/test/utility/audio_utility.cc b/media/cast/test/utility/audio_utility.cc index a294459d..8afc1c9 100644 --- a/media/cast/test/utility/audio_utility.cc +++ b/media/cast/test/utility/audio_utility.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "media/cast/test/utility/audio_utility.h" + #include <cmath> #include <numbers> #include <vector> @@ -9,7 +11,6 @@ #include "base/check_op.h" #include "base/time/time.h" #include "media/base/audio_bus.h" -#include "media/cast/test/utility/audio_utility.h" namespace media { namespace cast { @@ -39,6 +40,5 @@ return bus; } - } // namespace cast } // namespace media
diff --git a/media/cdm/api b/media/cdm/api index 82340ff..05d4084 160000 --- a/media/cdm/api +++ b/media/cdm/api
@@ -1 +1 @@ -Subproject commit 82340ffad5f88d6c2efd458da85d9e5f243eabb3 +Subproject commit 05d4084d7d5a65a422b36da4fa78f1d1740911c0
diff --git a/media/cdm/cdm_adapter_unittest.cc b/media/cdm/cdm_adapter_unittest.cc index c6b52d5..5e9dc88 100644 --- a/media/cdm/cdm_adapter_unittest.cc +++ b/media/cdm/cdm_adapter_unittest.cc
@@ -665,4 +665,16 @@ HasNoLicenseSdkVersion()))); } +// When CDM reports an unexpected value (e.g. new value added in the future), +// no metric will be reported, and there should not be any crash. +TEST_P(CdmAdapterTestWithMockCdm, ReportMetricsWithUnexpectedValue) { + CdmConfig cdm_config = GetCdmConfig(); + InitializeWithCdmConfig(cdm_config); + + EXPECT_CALL(*cdm_helper_, RecordUkm(_)).Times(0); + const uint32_t kInvalidMetricName = 99999999; // Arbitrary large metric name. + cdm_host_proxy_->ReportMetrics( + static_cast<cdm::MetricName>(kInvalidMetricName), 12345); +} + } // namespace media
diff --git a/media/gpu/av1_builder.cc b/media/gpu/av1_builder.cc index d4582b77..5d5609e 100644 --- a/media/gpu/av1_builder.cc +++ b/media/gpu/av1_builder.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40285824): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "media/gpu/av1_builder.h" #include <iterator> @@ -41,9 +36,9 @@ ret.Write(1, 4); // Spatial layer 1 should be decoded. ret.Write((1 << (seq_hdr.operating_points_cnt_minus_1 + 1 - i)) - 1, 8); } - ret.Write(seq_hdr.level[i], 5); - if (seq_hdr.level[i] > 7) { - ret.WriteBool(seq_hdr.tier[i]); + ret.Write(seq_hdr.level.at(i), 5); + if (seq_hdr.level.at(i) > 7) { + ret.WriteBool(seq_hdr.tier.at(i)); } } @@ -159,10 +154,10 @@ for (uint32_t i = 0; i < libgav1::kMaxSegments; i++) { for (uint32_t j = 0; j < libgav1::kSegmentFeatureMax; j++) { bool feature_enabled = (i < pic_hdr.segment_number && - (pic_hdr.feature_mask[i] & (1u << j))); + (pic_hdr.feature_mask.at(i) & (1u << j))); ret.WriteBool(feature_enabled); if (feature_enabled) { - int delta_q = pic_hdr.feature_data[i][j]; + int delta_q = pic_hdr.feature_data.at(i).at(j); ret.WriteBool(delta_q < 0); // Sign bit. if (delta_q < 0) { delta_q += 2 * (1 << 8); @@ -178,9 +173,9 @@ } // Pack loop filter parameters. - ret.Write(pic_hdr.filter_level[0], 6); - ret.Write(pic_hdr.filter_level[1], 6); - if (pic_hdr.filter_level[0] || pic_hdr.filter_level[1]) { + ret.Write(pic_hdr.filter_level.at(0), 6); + ret.Write(pic_hdr.filter_level.at(1), 6); + if (pic_hdr.filter_level.at(0) || pic_hdr.filter_level.at(1)) { ret.Write(pic_hdr.filter_level_u, 6); ret.Write(pic_hdr.filter_level_v, 6); } @@ -193,10 +188,10 @@ ret.Write(2, 2); // Set CDEF damping minus 3 to 5 - 3. ret.Write(3, 2); // Set cdef_bits to 3. for (size_t i = 0; i < (1 << num_planes); i++) { - ret.Write(pic_hdr.cdef_y_pri_strength[i], 4); - ret.Write(pic_hdr.cdef_y_sec_strength[i], 2); - ret.Write(pic_hdr.cdef_uv_pri_strength[i], 4); - ret.Write(pic_hdr.cdef_uv_sec_strength[i], 2); + ret.Write(pic_hdr.cdef_y_pri_strength.at(i), 4); + ret.Write(pic_hdr.cdef_y_sec_strength.at(i), 2); + ret.Write(pic_hdr.cdef_uv_pri_strength.at(i), 4); + ret.Write(pic_hdr.cdef_uv_sec_strength.at(i), 2); } } ret.WriteBool(true); // TxMode TX_MODE_SELECT.
diff --git a/media/gpu/av1_builder.h b/media/gpu/av1_builder.h index 388232c..5b834a9e 100644 --- a/media/gpu/av1_builder.h +++ b/media/gpu/av1_builder.h
@@ -59,8 +59,8 @@ struct AV1BitstreamBuilder::SequenceHeader { uint32_t profile; uint32_t operating_points_cnt_minus_1; - uint32_t level[kMaxTemporalLayerNum]; - uint32_t tier[kMaxTemporalLayerNum]; + std::array<uint32_t, kMaxTemporalLayerNum> level; + std::array<uint32_t, kMaxTemporalLayerNum> tier; uint32_t frame_width_bits_minus_1; uint32_t frame_height_bits_minus_1; uint32_t width; @@ -88,28 +88,29 @@ bool disable_frame_end_update_cdf; uint32_t base_qindex; uint8_t order_hint; - uint32_t filter_level[2]; + std::array<uint32_t, 2> filter_level; uint32_t filter_level_u; uint32_t filter_level_v; uint32_t sharpness_level; bool loop_filter_delta_enabled; uint8_t primary_ref_frame; - uint8_t ref_frame_idx[7]; + std::array<uint8_t, 7> ref_frame_idx; uint8_t refresh_frame_flags; - uint32_t ref_order_hint[8]; - uint8_t cdef_y_pri_strength[8]; - uint8_t cdef_y_sec_strength[8]; - uint8_t cdef_uv_pri_strength[8]; - uint8_t cdef_uv_sec_strength[8]; + std::array<uint32_t, 8> ref_order_hint; + std::array<uint8_t, 8> cdef_y_pri_strength; + std::array<uint8_t, 8> cdef_y_sec_strength; + std::array<uint8_t, 8> cdef_uv_pri_strength; + std::array<uint8_t, 8> cdef_uv_sec_strength; bool reduced_tx_set; bool segmentation_enabled; bool segmentation_update_map; bool segmentation_temporal_update; bool segmentation_update_data; uint32_t segment_number; - uint32_t feature_mask[8 /*libgav1::kMaxSegments*/]; - uint32_t feature_data[8 /*libgav1::kMaxSegments*/] - [8 /*libgav1::kSegmentFeatureMax*/]; + std::array<uint32_t, 8 /*libgav1::kMaxSegments*/> feature_mask; + std::array<std::array<uint32_t, 8 /*libgav1::kMaxSegments*/>, + 8 /*libgav1::kSegmentFeatureMax*/> + feature_data; }; } // namespace media
diff --git a/media/gpu/av1_builder_unittest.cc b/media/gpu/av1_builder_unittest.cc index b8c86147..234f306 100644 --- a/media/gpu/av1_builder_unittest.cc +++ b/media/gpu/av1_builder_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40285824): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "media/gpu/av1_builder.h" #include "testing/gtest/include/gtest/gtest.h" @@ -22,8 +17,8 @@ AV1BitstreamBuilder::SequenceHeader seq_hdr; seq_hdr.profile = 1; seq_hdr.operating_points_cnt_minus_1 = 0; - seq_hdr.level[0] = 12; - seq_hdr.tier[0] = 0; + seq_hdr.level.at(0) = 12; + seq_hdr.tier.at(0) = 0; seq_hdr.frame_width_bits_minus_1 = 15; seq_hdr.frame_height_bits_minus_1 = 15; seq_hdr.width = 1280; @@ -54,8 +49,8 @@ pic_hdr.disable_frame_end_update_cdf = false; pic_hdr.base_qindex = 100; pic_hdr.order_hint = frame_id; - pic_hdr.filter_level[0] = 1; - pic_hdr.filter_level[1] = 1; + pic_hdr.filter_level.at(0) = 1; + pic_hdr.filter_level.at(1) = 1; pic_hdr.filter_level_u = 1; pic_hdr.filter_level_v = 1; pic_hdr.sharpness_level = 1; @@ -69,10 +64,10 @@ ref_order_hint = 0; } for (int i = 0; i < 8; i++) { - pic_hdr.cdef_y_pri_strength[i] = 0; - pic_hdr.cdef_y_sec_strength[i] = 0; - pic_hdr.cdef_uv_pri_strength[i] = 0; - pic_hdr.cdef_uv_sec_strength[i] = 0; + pic_hdr.cdef_y_pri_strength.at(i) = 0; + pic_hdr.cdef_y_sec_strength.at(i) = 0; + pic_hdr.cdef_uv_pri_strength.at(i) = 0; + pic_hdr.cdef_uv_sec_strength.at(i) = 0; } pic_hdr.reduced_tx_set = true; pic_hdr.segmentation_enabled = false; @@ -150,8 +145,8 @@ AV1BitstreamBuilder::SequenceHeader seq_hdr = MakeSequenceHeader(); seq_hdr.operating_points_cnt_minus_1 = 2; // Set scalability mode to L1T3. for (uint32_t i = 0; i <= seq_hdr.operating_points_cnt_minus_1; i++) { - seq_hdr.level[i] = 12; - seq_hdr.tier[i] = 0; + seq_hdr.level.at(i) = 12; + seq_hdr.tier.at(i) = 0; } AV1BitstreamBuilder seq_header_obu = AV1BitstreamBuilder::BuildSequenceHeaderOBU(seq_hdr);
diff --git a/net/device_bound_sessions/session.cc b/net/device_bound_sessions/session.cc index a44d67c..20558490 100644 --- a/net/device_bound_sessions/session.cc +++ b/net/device_bound_sessions/session.cc
@@ -7,6 +7,7 @@ #include <memory> #include "components/unexportable_keys/unexportable_key_id.h" +#include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "net/cookies/canonical_cookie.h" #include "net/cookies/cookie_constants.h" #include "net/cookies/cookie_options.h" @@ -58,6 +59,16 @@ return nullptr; } + if (!params.scope.origin.empty() && !url.host().empty() && + url.host() != params.scope.origin && + net::registry_controlled_domains::GetDomainAndRegistry( + url, net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES) != + net::registry_controlled_domains::GetDomainAndRegistry( + params.scope.origin, + net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES)) { + return nullptr; + } + std::unique_ptr<Session> session( new Session(Id(params.session_id), url::Origin::Create(url), refresh)); for (const auto& spec : params.scope.specifications) {
diff --git a/net/device_bound_sessions/session_json_utils.cc b/net/device_bound_sessions/session_json_utils.cc index 2e77b53e..735c6cc 100644 --- a/net/device_bound_sessions/session_json_utils.cc +++ b/net/device_bound_sessions/session_json_utils.cc
@@ -15,6 +15,8 @@ std::optional<bool> include_site = scope_dict.FindBool("include_site"); scope.include_site = include_site.value_or(false); + const std::string* origin = scope_dict.FindString("origin"); + scope.origin = origin ? *origin : ""; const base::Value::List* specifications_list = scope_dict.FindList("scope_specification"); if (!specifications_list) {
diff --git a/net/device_bound_sessions/session_params.h b/net/device_bound_sessions/session_params.h index 69e894fa..463795fe 100644 --- a/net/device_bound_sessions/session_params.h +++ b/net/device_bound_sessions/session_params.h
@@ -31,6 +31,7 @@ // Defaults to false if not in the params bool include_site = false; std::vector<Specification> specifications; + std::string origin; Scope(); Scope(Scope&& other) noexcept;
diff --git a/net/device_bound_sessions/session_service_impl_unittest.cc b/net/device_bound_sessions/session_service_impl_unittest.cc index 07ae7ca1..64c5144 100644 --- a/net/device_bound_sessions/session_service_impl_unittest.cc +++ b/net/device_bound_sessions/session_service_impl_unittest.cc
@@ -33,10 +33,12 @@ constexpr char kUrlString[] = "https://example.com"; const GURL kTestUrl(kUrlString); const std::string kSessionId = "SessionId"; +const std::string kOrigin = "example.com"; constexpr char kUrlString2[] = "https://example2.com"; const GURL kTestUrl2(kUrlString2); const std::string kSessionId2 = "SessionId2"; +const std::string kOrigin2 = "example2.com"; const std::string kChallenge = "challenge"; @@ -47,12 +49,14 @@ std::optional<RegistrationFetcher::RegistrationCompleteParams> TestFetcher( std::string session_id, - std::string url_string) { + std::string url_string, + std::string origin) { std::vector<SessionParams::Credential> cookie_credentials; cookie_credentials.push_back( SessionParams::Credential{"test_cookie", "secure"}); SessionParams::Scope scope; scope.include_site = true; + scope.origin = origin; SessionParams session_params(std::move(session_id), url_string, std::move(scope), std::move(cookie_credentials)); unexportable_keys::UnexportableKeyId key_id; @@ -72,22 +76,27 @@ } RegistrationFetcher::FetcherType TestFetcherFactory(std::string session_id, - std::string url_string) { + std::string url_string, + std::string origin) { static std::string g_session_id; static std::string g_url_string; + static std::string g_origin; g_session_id = std::move(session_id); g_url_string = std::move(url_string); + g_origin = std::move(origin); - return []() { return TestFetcher(g_session_id, g_url_string); }; + return []() { return TestFetcher(g_session_id, g_url_string, g_origin); }; } class ScopedTestFetcher { public: - ScopedTestFetcher(std::string session_id, std::string url_string) { + ScopedTestFetcher(std::string session_id, + std::string url_string, + std::string origin) { // Reset the testing fetch function. RegistrationFetcher::SetFetcherForTesting(nullptr); - RegistrationFetcher::SetFetcherForTesting( - TestFetcherFactory(std::move(session_id), std::move(url_string))); + RegistrationFetcher::SetFetcherForTesting(TestFetcherFactory( + std::move(session_id), std::move(url_string), std::move(origin))); } ~ScopedTestFetcher() { RegistrationFetcher::SetFetcherForTesting(nullptr); } @@ -177,9 +186,10 @@ // Take list of <session_id, site_url> to add sessions for testing. void AddSessionsForTesting( - std::vector<std::pair<std::string, std::string>> id_url_list) { - for (const auto& [id, url_str] : id_url_list) { - ScopedTestFetcher scoped_test_fetcher(id, url_str); + std::vector<std::tuple<std::string, std::string, std::string>> + id_url_origin_list) { + for (const auto& [id, url_str, origin] : id_url_origin_list) { + ScopedTestFetcher scoped_test_fetcher(id, url_str, origin); auto fetch_param = RegistrationFetcherParam::CreateInstanceForTesting( GURL(url_str), {crypto::SignatureVerifier::SignatureAlgorithm::ECDSA_SHA256}, @@ -197,7 +207,7 @@ }; TEST_F(SessionServiceImplTest, RegisterSuccess) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); net::TestDelegate delegate; std::unique_ptr<URLRequest> request = @@ -214,7 +224,7 @@ } TEST_F(SessionServiceImplTest, RegisterNoId) { - AddSessionsForTesting({{/*session_id=*/"", kUrlString}}); + AddSessionsForTesting({{/*session_id=*/"", kUrlString, kOrigin}}); net::TestDelegate delegate; std::unique_ptr<URLRequest> request = @@ -251,7 +261,7 @@ } TEST_F(SessionServiceImplTest, SetChallengeForBoundSession) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); scoped_refptr<net::HttpResponseHeaders> headers = HttpResponseHeaders::Builder({1, 1}, "200 OK").Build(); @@ -280,7 +290,7 @@ } TEST_F(SessionServiceImplTest, ExpiryExtendedOnUser) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); Session* session = service().GetSession(SchemefulSite(kTestUrl), Session::Id(kSessionId)); @@ -300,7 +310,7 @@ } TEST_F(SessionServiceImplTest, NullAccessObserver) { - ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString); + ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString, kOrigin); auto fetch_param = RegistrationFetcherParam::CreateInstanceForTesting( kTestUrl, {crypto::SignatureVerifier::SignatureAlgorithm::ECDSA_SHA256}, @@ -313,7 +323,7 @@ } TEST_F(SessionServiceImplTest, AccessObserverCalledOnRegistration) { - ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString); + ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString, kOrigin); auto fetch_param = RegistrationFetcherParam::CreateInstanceForTesting( kTestUrl, {crypto::SignatureVerifier::SignatureAlgorithm::ECDSA_SHA256}, @@ -329,7 +339,7 @@ } TEST_F(SessionServiceImplTest, AccessObserverCalledOnDeferral) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); net::TestDelegate delegate; std::unique_ptr<URLRequest> request = @@ -350,7 +360,7 @@ } TEST_F(SessionServiceImplTest, AccessObserverCalledOnSetChallenge) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); scoped_refptr<net::HttpResponseHeaders> headers = HttpResponseHeaders::Builder({1, 1}, "200 OK").Build(); @@ -370,7 +380,8 @@ } TEST_F(SessionServiceImplTest, GetAllSessions) { - AddSessionsForTesting({{kSessionId, kUrlString}, {kSessionId2, kUrlString2}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}, + {kSessionId2, kUrlString2, kOrigin2}}); base::test::TestFuture<std::vector<SessionKey>> future; service().GetAllSessionsAsync( @@ -380,7 +391,7 @@ } TEST_F(SessionServiceImplTest, DeleteSession) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); auto site = SchemefulSite(kTestUrl); auto session_id = Session::Id(kSessionId); @@ -394,9 +405,9 @@ TEST_F(SessionServiceImplTest, DeleteAllSessionsByCreationTime) { net::SchemefulSite site(kTestUrl); - AddSessionsForTesting({{"SessionA", kUrlString}, - {"SessionB", kUrlString}, - {"SessionC", kUrlString}}); + AddSessionsForTesting({{"SessionA", kUrlString, kOrigin}, + {"SessionB", kUrlString, kOrigin}, + {"SessionC", kUrlString, kOrigin}}); service() .GetSession(site, Session::Id("SessionA")) @@ -424,8 +435,8 @@ GURL url_a("https://a_example.com"); GURL url_b("https://b_example.com"); - AddSessionsForTesting( - {{kSessionId, url_a.spec()}, {kSessionId, url_b.spec()}}); + AddSessionsForTesting({{kSessionId, url_a.spec(), "a_example.com"}, + {kSessionId, url_b.spec(), "b_example.com"}}); SchemefulSite site_a(url_a); SchemefulSite site_b(url_b); @@ -446,7 +457,7 @@ } TEST_F(SessionServiceImplTest, TestDeferWithRequestRestart) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); SchemefulSite site(kTestUrl); ASSERT_TRUE(service().GetSession(site, Session::Id(kSessionId))); @@ -475,7 +486,7 @@ future.GetCallback<TestDeferCompletion::CallbackType>()); // Set up the fetcher for a successful refresh. - ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString); + ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString, kOrigin); service().DeferRequestForRefresh(request.get(), Session::Id(kSessionId), defer_completion.GetRestartCb(), defer_completion.GetContinueCb()); @@ -489,7 +500,7 @@ } TEST_F(SessionServiceImplTest, TestDeferWithRequestContinue) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); SchemefulSite site_1(kTestUrl); ASSERT_TRUE(service().GetSession(site_1, Session::Id(kSessionId))); @@ -534,7 +545,7 @@ } TEST_F(SessionServiceImplTest, TestDeferRequestArbitrary) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); // No session for site_2. SchemefulSite site_1(kTestUrl); @@ -566,7 +577,7 @@ future_3.GetCallback<TestDeferCompletion::CallbackType>()); // Set up a successful fetcher. - ScopedTestFetcher scoped_test_fetcher_2(kSessionId2, kUrlString2); + ScopedTestFetcher scoped_test_fetcher_2(kSessionId2, kUrlString2, kOrigin2); service().DeferRequestForRefresh(request.get(), Session::Id(kSessionId2), defer_completion.GetRestartCb(), defer_completion.GetContinueCb()); @@ -577,7 +588,7 @@ TEST_F(SessionServiceImplTest, RefreshWithNewSessionId) { // Register a session with kSessionId. - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); auto site = SchemefulSite(kTestUrl); ASSERT_TRUE(service().GetSession(site, Session::Id(kSessionId))); @@ -607,7 +618,7 @@ // Set up the fetcher for a successful refresh with a new session ID // which doesn't equal to the refreshing one. - ScopedTestFetcher scoped_test_fetcher(kSessionId2, kUrlString); + ScopedTestFetcher scoped_test_fetcher(kSessionId2, kUrlString, kOrigin); service().DeferRequestForRefresh(request.get(), Session::Id(kSessionId), defer_completion.GetRestartCb(), defer_completion.GetContinueCb()); @@ -625,7 +636,7 @@ } TEST_F(SessionServiceImplTest, SessionTerminationFromContinueFalse) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); ASSERT_TRUE( service().GetSession(SchemefulSite(kTestUrl), Session::Id(kSessionId))); @@ -647,7 +658,7 @@ TEST_F(SessionServiceImplTest, NetLogRegistration) { RecordingNetLogObserver observer; - ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString); + ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString, kOrigin); auto fetch_param = RegistrationFetcherParam::CreateInstanceForTesting( kTestUrl, {crypto::SignatureVerifier::SignatureAlgorithm::ECDSA_SHA256}, "challenge", /*authorization=*/std::nullopt); @@ -662,7 +673,7 @@ } TEST_F(SessionServiceImplTest, NetLogRefresh) { - AddSessionsForTesting({{kSessionId, kUrlString}}); + AddSessionsForTesting({{kSessionId, kUrlString, kOrigin}}); SchemefulSite site(kTestUrl); ASSERT_TRUE(service().GetSession(site, Session::Id(kSessionId))); @@ -677,7 +688,7 @@ future.GetCallback<TestDeferCompletion::CallbackType>()); RecordingNetLogObserver observer; - ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString); + ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString, kOrigin); service().DeferRequestForRefresh(request.get(), Session::Id(kSessionId), defer_completion.GetRestartCb(), defer_completion.GetContinueCb()); @@ -735,7 +746,7 @@ // Will invoke the store's load session method. service().LoadSessionsAsync(); - ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString); + ScopedTestFetcher scoped_test_fetcher(kSessionId, kUrlString, kOrigin); auto fetch_param = RegistrationFetcherParam::CreateInstanceForTesting( kTestUrl, {crypto::SignatureVerifier::SignatureAlgorithm::ECDSA_SHA256}, "challenge", /*authorization=*/std::nullopt); @@ -763,8 +774,11 @@ service().GetAllSessionsAsync( future.GetCallback<const std::vector<SessionKey>&>()); + SessionParams::Scope scope; + scope.origin = "example.com"; std::unique_ptr<Session> session = Session::CreateIfValid( - SessionParams("session_id", "https://example.com/refresh", /*scope=*/{}, + SessionParams("session_id", "https://example.com/refresh", + std::move(scope), /*creds=*/{}), kTestUrl); ASSERT_TRUE(session);
diff --git a/net/device_bound_sessions/session_store_impl_unittest.cc b/net/device_bound_sessions/session_store_impl_unittest.cc index c9ea461..2f16e05a 100644 --- a/net/device_bound_sessions/session_store_impl_unittest.cc +++ b/net/device_bound_sessions/session_store_impl_unittest.cc
@@ -66,8 +66,10 @@ std::unique_ptr<Session> CreateSessionHelper( unexportable_keys::UnexportableKeyService& key_service, const std::string& url_string, - const std::string& session_id) { + const std::string& session_id, + const std::string& origin = "foo.test") { SessionParams::Scope scope; + scope.origin = origin; std::string cookie_attr = "Secure; Domain=" + GURL(url_string).host(); std::vector<SessionParams::Credential> cookie_credentials( {SessionParams::Credential{"test_cookie", cookie_attr}}); @@ -82,9 +84,10 @@ proto::Session CreateSessionProto( unexportable_keys::UnexportableKeyService& key_service, const std::string& url_string, - const std::string& session_id) { + const std::string& session_id, + const std::string& origin) { std::unique_ptr<Session> session = - CreateSessionHelper(key_service, url_string, session_id); + CreateSessionHelper(key_service, url_string, session_id, origin); proto::Session sproto = session->ToProto(); unexportable_keys::UnexportableKeyId key_id = session->unexportable_key_id().value(); @@ -96,6 +99,7 @@ struct SessionCfg { std::string url; std::string session_id; + std::string origin; }; using SessionCfgList = std::vector<SessionCfg>; SessionStore::SessionsMap CreateAndSaveSessions( @@ -106,7 +110,7 @@ for (auto& cfg : cfgs) { auto site = net::SchemefulSite(GURL(cfg.url)); std::unique_ptr<Session> session = - CreateSessionHelper(key_service, cfg.url, cfg.session_id); + CreateSessionHelper(key_service, cfg.url, cfg.session_id, cfg.origin); EXPECT_TRUE(session); store.SaveSession(site, *session); session_map.emplace(std::move(site), std::move(session)); @@ -248,9 +252,12 @@ TEST_F(SessionStoreImplTest, SaveNewSessions) { CreateStoreAndLoadSessions(); SessionCfgList cfgs = { - {"https://a.foo.test/index.html", "session0"}, // schemeful site 1 - {"https://b.foo.test/index.html", "session1"}, // "" - {"https://c.bar.test/index.html", "session2"}, // schemeful site 2 + {"https://a.foo.test/index.html", "session0", + "foo.test"}, // schemeful site 1 + {"https://b.foo.test/index.html", "session1", + "foo.test"}, // schemeful site 1 + {"https://c.bar.test/index.html", "session2", + "bar.test"}, // schemeful site 2 }; SessionStore::SessionsMap expected_sessions = CreateAndSaveSessions(cfgs, unexportable_key_service(), store()); @@ -345,9 +352,12 @@ // Create and save some sessions. SessionCfgList cfgs = { - {"https://a.foo.test/index.html", "session0"}, // schemeful site 1 - {"https://b.foo.test/index.html", "session1"}, // "" - {"https://c.bar.test/index.html", "session2"}, // schemeful site 2 + {"https://a.foo.test/index.html", "session0", + "foo.test"}, // schemeful site 1 + {"https://b.foo.test/index.html", "session1", + "foo.test"}, // schemeful site 1 + {"https://c.bar.test/index.html", "session2", + "bar.test"}, // schemeful site 2 }; SessionStore::SessionsMap expected_sessions = CreateAndSaveSessions(cfgs, unexportable_key_service(), store()); @@ -379,9 +389,9 @@ TEST_F(SessionStoreImplTest, LoadSavedSessions) { CreateStoreAndLoadSessions(); SessionCfgList cfgs = { - {"https://a.foo.test/index.html", "session0"}, - {"https://b.foo.test/index.html", "session1"}, - {"https://c.bar.test/index.html", "session2"}, + {"https://a.foo.test/index.html", "session0", "foo.test"}, + {"https://b.foo.test/index.html", "session1", "foo.test"}, + {"https://c.bar.test/index.html", "session2", "bar.test"}, }; SessionStore::SessionsMap saved_sessions = @@ -400,14 +410,14 @@ TEST_F(SessionStoreImplTest, PruneLoadedEntryWithInvalidSite) { // Create an entry with an invalid site. - proto::Session sproto = CreateSessionProto(unexportable_key_service(), - "https://foo.test", "session_id"); + proto::Session sproto = CreateSessionProto( + unexportable_key_service(), "https://foo.test", "session_id", "foo.test"); proto::SiteSessions site_proto; (*site_proto.mutable_sessions())["session_id"] = std::move(sproto); // Create an entry with a valid site. - proto::Session sproto2 = CreateSessionProto(unexportable_key_service(), - "https://bar.test", "session_id"); + proto::Session sproto2 = CreateSessionProto( + unexportable_key_service(), "https://bar.test", "session_id", "bar.test"); proto::SiteSessions site2_proto; (*site2_proto.mutable_sessions())["session_id"] = std::move(sproto2); auto site2 = net::SchemefulSite(GURL("https://bar.test)")); @@ -439,11 +449,13 @@ // in file session_unittest.cc TEST_F(SessionStoreImplTest, PruneLoadedEntryWithInvalidSession) { // Create an entry with 1 valid and 1 invalid session. - proto::Session sproto1 = CreateSessionProto( - unexportable_key_service(), "https://foo.example.test", "session_1"); + proto::Session sproto1 = + CreateSessionProto(unexportable_key_service(), "https://foo.example.test", + "session_1", "foo.example.test"); // Create an invalid session. - proto::Session sproto2 = CreateSessionProto( - unexportable_key_service(), "https://bar.example.test", "session_2"); + proto::Session sproto2 = + CreateSessionProto(unexportable_key_service(), "https://bar.example.test", + "session_2", "bar.example.test"); sproto2.set_refresh_url("invalid_url"); // Create a site proto (proto table's value field) consisting of the above 2 @@ -472,8 +484,9 @@ TEST_F(SessionStoreImplTest, PruneLoadedEntryWithSessionMissingWrappedKey) { // Create a Session proto with missing wrapped key field. - proto::Session sproto = CreateSessionProto( - unexportable_key_service(), "https://foo.example.test", "session_id"); + proto::Session sproto = + CreateSessionProto(unexportable_key_service(), "https://foo.example.test", + "session_id", "foo.example.test"); sproto.clear_wrapped_key(); // Create a single entry table with the above session data.
diff --git a/net/device_bound_sessions/session_unittest.cc b/net/device_bound_sessions/session_unittest.cc index 906b610..118a85b 100644 --- a/net/device_bound_sessions/session_unittest.cc +++ b/net/device_bound_sessions/session_unittest.cc
@@ -34,10 +34,13 @@ net::DefineNetworkTrafficAnnotation("dbsc_registration", ""); constexpr char kSessionId[] = "SessionId"; constexpr char kUrlString[] = "https://example.test/index.html"; +constexpr char kUrlStringForWrongETLD[] = "https://example.co.uk/index.html"; const GURL kTestUrl(kUrlString); +const GURL kTestUrlForWrongETLD(kUrlStringForWrongETLD); SessionParams CreateValidParams() { SessionParams::Scope scope; + scope.origin = "example.test"; std::vector<SessionParams::Credential> cookie_credentials( {SessionParams::Credential{"test_cookie", "Secure; Domain=example.test"}}); @@ -63,6 +66,11 @@ EXPECT_FALSE(Session::CreateIfValid(params, kTestUrl)); } +TEST_F(SessionTest, InvalidTestUrl) { + auto params = CreateValidParams(); + EXPECT_FALSE(Session::CreateIfValid(params, kTestUrlForWrongETLD)); +} + TEST_F(SessionTest, ToFromProto) { std::unique_ptr<Session> session = Session::CreateIfValid(CreateValidParams(), kTestUrl);
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index fdd626fc..bb02881 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -14981,76 +14981,15 @@ ] } ], - "OmniboxMlUrlPiecewiseMappedScoringAndroid": [ + "OmniboxMlUrlScoringAndroid": [ { "platforms": [ "android" ], "experiments": [ { - "name": "Enabled_AdjustedBy0", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,590;0.034,595;0.043,790;0.067,795;0.076,900;0.117,930;0.147,1200;0.184,1205;0.2,1300;0.647,1350;0.668,1410;0.988,1430;1,1530", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1414", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "MlUrlSearchBlending_MappedSearchBlending": "false", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, + "name": "Enabled", "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - }, - { - "name": "Enabled_DemotedBy50", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,590;0.034,545;0.043,740;0.067,745;0.076,850;0.117,880;0.147,1150;0.184,1155;0.2,1250;0.647,1300;0.668,1360;0.988,1380;1,1530", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1364", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "MlUrlSearchBlending_MappedSearchBlending": "false", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - }, - { - "name": "Enabled_DemotedBy100", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,590;0.034,495;0.043,690;0.067,695;0.076,800;0.117,830;0.147,1100;0.184,1105;0.2,1200;0.647,1250;0.668,1310;0.988,1330;1,1530", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1314", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "MlUrlSearchBlending_MappedSearchBlending": "false", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - }, - { - "name": "Enabled_DemotedBy150", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,590;0.034,445;0.043,640;0.067,645;0.076,750;0.117,780;0.147,1050;0.184,1055;0.2,1150;0.647,1200;0.668,1260;0.988,1280;1,1530", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1264", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "MlUrlSearchBlending_MappedSearchBlending": "false", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", "MlUrlScoring", "UrlScoringModel" ] @@ -15058,152 +14997,15 @@ ] } ], - "OmniboxMlUrlPiecewiseMappedScoringDesktop": [ - { - "platforms": [ - "chromeos", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled_AdjustedBy0", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,550;0.018,1300;0.14,1398;1,1422", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1414", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - }, - { - "name": "Enabled_DemotedBy50", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,550;0.018,1250;0.14,1348;1,1422", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1364", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - }, - { - "name": "Enabled_DemotedBy100", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,550;0.018,1200;0.14,1298;1,1422", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1314", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - }, - { - "name": "Enabled_DemotedBy150", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,550;0.018,1150;0.14,1248;1,1422", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1264", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - } - ] - } - ], - "OmniboxMlUrlPiecewiseMappedScoringIOS": [ + "OmniboxMlUrlScoringIOS": [ { "platforms": [ "ios" ], "experiments": [ { - "name": "Enabled_AdjustedBy0", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,590;0.006,790;0.082,1290;0.443,1360;0.464,1400;0.987,1425;1,1530", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1414", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "MlUrlSearchBlending_MappedSearchBlending": "false", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, + "name": "Enabled", "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - }, - { - "name": "Enabled_DemotedBy50", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,590;0.006,740;0.082,1240;0.443,1310;0.464,1350;0.987,1375;1,1530", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1364", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "MlUrlSearchBlending_MappedSearchBlending": "false", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - }, - { - "name": "Enabled_DemotedBy100", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,590;0.006,690;0.082,1190;0.443,1260;0.464,1300;0.987,1325;1,1530", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1314", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "MlUrlSearchBlending_MappedSearchBlending": "false", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", - "MlUrlScoring", - "UrlScoringModel" - ] - }, - { - "name": "Enabled_DemotedBy150", - "params": { - "MlUrlPiecewiseMappedSearchBlending": "true", - "MlUrlPiecewiseMappedSearchBlending_BreakPoints": "0,590;0.006,640;0.082,1140;0.443,1210;0.464,1250;0.987,1275;1,1530", - "MlUrlPiecewiseMappedSearchBlending_GroupingThreshold": "1264", - "MlUrlPiecewiseMappedSearchBlending_RelevanceBias": "0", - "MlUrlScoringShortcutDocumentSignals": "true", - "MlUrlSearchBlending_MappedSearchBlending": "false", - "enable_scoring_signals_annotators_for_ml_scoring": "true" - }, - "enable_features": [ - "MlUrlPiecewiseMappedSearchBlending", "MlUrlScoring", "UrlScoringModel" ] @@ -25922,34 +25724,6 @@ ], "experiments": [ { - "name": "Enabled_PrefetchingOnSRPWeb_Warmup_Ablation_Debouncing", - "params": { - "ZeroSuggestPrefetchDebounceDelay": "300", - "ZeroSuggestPrefetchDebounceFromLastRun": "true" - }, - "enable_features": [ - "AblateSearchProviderWarmup", - "ZeroSuggestPrefetchDebouncing", - "ZeroSuggestPrefetchingOnSRP", - "ZeroSuggestPrefetchingOnWeb" - ] - }, - { - "name": "Enabled_PrefetchingOnSRP_Warmup_Ablation_Debouncing", - "params": { - "ZeroSuggestPrefetchDebounceDelay": "300", - "ZeroSuggestPrefetchDebounceFromLastRun": "true" - }, - "enable_features": [ - "AblateSearchProviderWarmup", - "ZeroSuggestPrefetchDebouncing", - "ZeroSuggestPrefetchingOnSRP" - ], - "disable_features": [ - "ZeroSuggestPrefetchingOnWeb" - ] - }, - { "name": "Enabled_PrefetchingOnSRP_Warmup_Ablation", "enable_features": [ "AblateSearchProviderWarmup", @@ -25959,39 +25733,6 @@ "ZeroSuggestPrefetchDebouncing", "ZeroSuggestPrefetchingOnWeb" ] - }, - { - "name": "Enabled_PrefetchingOnSRPWeb_Warmup_Ablation", - "enable_features": [ - "AblateSearchProviderWarmup", - "ZeroSuggestPrefetchingOnSRP", - "ZeroSuggestPrefetchingOnWeb" - ], - "disable_features": [ - "ZeroSuggestPrefetchDebouncing" - ] - }, - { - "name": "Enabled_PrefetchingOnSRP_Only", - "enable_features": [ - "ZeroSuggestPrefetchingOnSRP" - ], - "disable_features": [ - "AblateSearchProviderWarmup", - "ZeroSuggestPrefetchDebouncing", - "ZeroSuggestPrefetchingOnWeb" - ] - }, - { - "name": "Enabled_PrefetchingOnSRPWeb_Only", - "enable_features": [ - "ZeroSuggestPrefetchingOnSRP", - "ZeroSuggestPrefetchingOnWeb" - ], - "disable_features": [ - "AblateSearchProviderWarmup", - "ZeroSuggestPrefetchDebouncing" - ] } ] }
diff --git a/third_party/angle b/third_party/angle index 501f07a..711b2c3 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit 501f07a6dd53937d83dfad11928a75d0c0c88f73 +Subproject commit 711b2c32641521c9e60a903b85c7367755c6448a
diff --git a/third_party/blink/public/devtools_protocol/browser_protocol.pdl b/third_party/blink/public/devtools_protocol/browser_protocol.pdl index 6254565..06a4381a 100644 --- a/third_party/blink/public/devtools_protocol/browser_protocol.pdl +++ b/third_party/blink/public/devtools_protocol/browser_protocol.pdl
@@ -499,8 +499,8 @@ type AffectedRequest extends object properties # The unique request id. - Network.RequestId requestId - optional string url + optional Network.RequestId requestId + string url # Information about the frame affected by an inspector issue. type AffectedFrame extends object
diff --git a/third_party/blink/public/mojom/content_extraction/ai_page_content.mojom b/third_party/blink/public/mojom/content_extraction/ai_page_content.mojom index 71e856b..31737e8 100644 --- a/third_party/blink/public/mojom/content_extraction/ai_page_content.mojom +++ b/third_party/blink/public/mojom/content_extraction/ai_page_content.mojom
@@ -26,6 +26,8 @@ // Text chunks. kText, kAnchor, + kParagraph, + kHeading, // Image chunks. kImage, @@ -34,14 +36,13 @@ kForm, kTable, kTableRow, + kTableCell, + kOrderedList, + kUnorderedList, + kListItem, }; enum AIPageContentAnnotatedRole { - kParagraph, - kHeading, - kOrderedList, - kUnorderedList, - kTableCell, kHeader, kNav, kSearch,
diff --git a/third_party/blink/public/mojom/devtools/inspector_issue.mojom b/third_party/blink/public/mojom/devtools/inspector_issue.mojom index c8476f4..8fd215d4 100644 --- a/third_party/blink/public/mojom/devtools/inspector_issue.mojom +++ b/third_party/blink/public/mojom/devtools/inspector_issue.mojom
@@ -37,8 +37,8 @@ }; struct AffectedRequest { - string request_id; - string? url; + string? request_id; + string url; }; struct AffectedFrame {
diff --git a/third_party/blink/renderer/core/fetch/fetch_manager.cc b/third_party/blink/renderer/core/fetch/fetch_manager.cc index de2fce0..52733af6 100644 --- a/third_party/blink/renderer/core/fetch/fetch_manager.cc +++ b/third_party/blink/renderer/core/fetch/fetch_manager.cc
@@ -439,8 +439,7 @@ void PerformNetworkError( const String& issue_summary, std::optional<base::UnguessableToken> issue_id = std::nullopt); - void FileIssueAndPerformNetworkError(RendererCorsIssueCode, - int64_t identifier); + void FileIssueAndPerformNetworkError(RendererCorsIssueCode); void PerformHTTPFetch(ExceptionState&); void PerformDataFetch(); bool AddConsoleMessage(const String& message, @@ -941,8 +940,7 @@ // "- |request|'s mode is |same-origin|" if (fetch_request_data_->Mode() == RequestMode::kSameOrigin) { // This error is so early that there isn't an identifier yet, generate one. - FileIssueAndPerformNetworkError(RendererCorsIssueCode::kDisallowedByMode, - CreateUniqueIdentifier()); + FileIssueAndPerformNetworkError(RendererCorsIssueCode::kDisallowedByMode); return; } @@ -954,8 +952,7 @@ // This error is so early that there isn't an identifier yet, generate // one. FileIssueAndPerformNetworkError( - RendererCorsIssueCode::kNoCorsRedirectModeNotFollow, - CreateUniqueIdentifier()); + RendererCorsIssueCode::kNoCorsRedirectModeNotFollow); return; } @@ -974,8 +971,7 @@ if (!SchemeRegistry::ShouldTreatURLSchemeAsSupportingFetchAPI( fetch_request_data_->Url().Protocol())) { // This error is so early that there isn't an identifier yet, generate one. - FileIssueAndPerformNetworkError(RendererCorsIssueCode::kCorsDisabledScheme, - CreateUniqueIdentifier()); + FileIssueAndPerformNetworkError(RendererCorsIssueCode::kCorsDisabledScheme); return; } @@ -1047,22 +1043,20 @@ } else { // FIXME: implement other protocols. // This error is so early that there isn't an identifier yet, generate one. - FileIssueAndPerformNetworkError(RendererCorsIssueCode::kCorsDisabledScheme, - CreateUniqueIdentifier()); + FileIssueAndPerformNetworkError(RendererCorsIssueCode::kCorsDisabledScheme); } } void FetchLoaderBase::FileIssueAndPerformNetworkError( - RendererCorsIssueCode network_error, - int64_t identifier) { + RendererCorsIssueCode network_error) { auto issue_id = base::UnguessableToken::Create(); switch (network_error) { case RendererCorsIssueCode::kCorsDisabledScheme: { - AuditsIssue::ReportCorsIssue( - execution_context_, identifier, network_error, - fetch_request_data_->Url().GetString(), - fetch_request_data_->Origin()->ToString(), - fetch_request_data_->Url().Protocol(), issue_id); + AuditsIssue::ReportCorsIssue(execution_context_, network_error, + fetch_request_data_->Url().GetString(), + fetch_request_data_->Origin()->ToString(), + fetch_request_data_->Url().Protocol(), + issue_id); PerformNetworkError("URL scheme \"" + fetch_request_data_->Url().Protocol() + "\" is not supported.", @@ -1070,8 +1064,7 @@ break; } case RendererCorsIssueCode::kDisallowedByMode: { - AuditsIssue::ReportCorsIssue(execution_context_, identifier, - network_error, + AuditsIssue::ReportCorsIssue(execution_context_, network_error, fetch_request_data_->Url().GetString(), fetch_request_data_->Origin()->ToString(), WTF::g_empty_string, issue_id); @@ -1084,8 +1077,7 @@ break; } case RendererCorsIssueCode::kNoCorsRedirectModeNotFollow: { - AuditsIssue::ReportCorsIssue(execution_context_, identifier, - network_error, + AuditsIssue::ReportCorsIssue(execution_context_, network_error, fetch_request_data_->Url().GetString(), fetch_request_data_->Origin()->ToString(), WTF::g_empty_string, issue_id);
diff --git a/third_party/blink/renderer/core/frame/attribution_src_loader.cc b/third_party/blink/renderer/core/frame/attribution_src_loader.cc index 7c94e592..dc8621c 100644 --- a/third_party/blink/renderer/core/frame/attribution_src_loader.cc +++ b/third_party/blink/renderer/core/frame/attribution_src_loader.cc
@@ -111,21 +111,22 @@ void LogAuditIssue(ExecutionContext* execution_context, AttributionReportingIssueType issue_type, HTMLElement* element, + const String& request_url, std::optional<uint64_t> request_id, const String& invalid_parameter) { - String id_string; - if (request_id) { - id_string = IdentifiersFactory::SubresourceRequestId(*request_id); - } - + String devtools_request_id = + request_id ? IdentifiersFactory::SubresourceRequestId(*request_id) + : String(); AuditsIssue::ReportAttributionIssue(execution_context, issue_type, element, - id_string, invalid_parameter); + request_url, devtools_request_id, + invalid_parameter); } base::expected<attribution_reporting::RegistrationInfo, attribution_reporting::RegistrationInfoError> GetRegistrationInfo(const HTTPHeaderMap& map, ExecutionContext* execution_context, + const String& request_url, uint64_t request_id, bool cross_app_web_enabled) { AtomicString info_header = map.Get(http_names::kAttributionReportingInfo); @@ -138,7 +139,7 @@ if (!parsed_registration_info.has_value()) { LogAuditIssue(execution_context, AttributionReportingIssueType::kInvalidInfoHeader, - /*element=*/nullptr, request_id, + /*element=*/nullptr, request_url, request_id, /*invalid_parameter=*/info_header); } return parsed_registration_info; @@ -154,6 +155,7 @@ if (!network::HasAttributionSupport(loader.GetSupport())) { LogAuditIssue(window, AttributionReportingIssueType::kNoWebOrOsSupport, element, + /*url=*/String(), /*request_id=*/std::nullopt, /*invalid_parameter=*/String()); return {}; @@ -166,7 +168,7 @@ // operations and DevTools issues. for (wtf_size_t i = 0; i < strings.size(); i++) { KURL url = window->CompleteURL(strings[i]); - if (loader.CanRegister(url, element, /*request_id=*/std::nullopt)) { + if (loader.CanRegister(url, element)) { urls.emplace_back(std::move(url)); } } @@ -200,13 +202,16 @@ AtomicString web_trigger; AtomicString os_source; AtomicString os_trigger; + String request_url; uint64_t request_id; AttributionHeaders(const HTTPHeaderMap& map, + const String& request_url, uint64_t request_id, bool cross_app_web_enabled) : web_source(map.Get(http_names::kAttributionReportingRegisterSource)), web_trigger(map.Get(http_names::kAttributionReportingRegisterTrigger)), + request_url(request_url), request_id(request_id) { if (cross_app_web_enabled) { os_source = map.Get(http_names::kAttributionReportingRegisterOSSource); @@ -228,7 +233,7 @@ DCHECK(!os_source.IsNull()); LogAuditIssue(execution_context, AttributionReportingIssueType::kOsSourceIgnored, - /*element=*/nullptr, request_id, + /*element=*/nullptr, request_url, request_id, /*invalid_parameter=*/os_source); } @@ -236,7 +241,7 @@ DCHECK(!os_trigger.IsNull()); LogAuditIssue(execution_context, AttributionReportingIssueType::kOsTriggerIgnored, - /*element=*/nullptr, request_id, + /*element=*/nullptr, request_url, request_id, /*invalid_parameter=*/os_trigger); } @@ -244,7 +249,7 @@ DCHECK(!web_source.IsNull()); LogAuditIssue(execution_context, AttributionReportingIssueType::kSourceIgnored, - /*element=*/nullptr, request_id, + /*element=*/nullptr, request_url, request_id, /*invalid_parameter=*/web_source); } @@ -252,7 +257,7 @@ DCHECK(!web_trigger.IsNull()); LogAuditIssue(execution_context, AttributionReportingIssueType::kTriggerIgnored, - /*element=*/nullptr, request_id, + /*element=*/nullptr, request_url, request_id, /*invalid_parameter=*/web_trigger); } @@ -288,7 +293,7 @@ case IssueType::kWebAndOsHeaders: LogAuditIssue(execution_context, AttributionReportingIssueType::kWebAndOsHeaders, - /*element=*/nullptr, request_id, + /*element=*/nullptr, request_url, request_id, /*invalid_parameter=*/String()); break; case IssueType::kWebIgnored: @@ -311,7 +316,7 @@ is_source ? AttributionReportingIssueType::kNoRegisterSourceHeader : AttributionReportingIssueType::kNoRegisterTriggerHeader, - /*element=*/nullptr, request_id, + /*element=*/nullptr, request_url, request_id, /*invalid_parameter=*/String()); break; case IssueType::kNoOsHeader: @@ -320,7 +325,7 @@ is_source ? AttributionReportingIssueType::kNoRegisterOsSourceHeader : AttributionReportingIssueType::kNoRegisterOsTriggerHeader, - /*element=*/nullptr, request_id, + /*element=*/nullptr, request_url, request_id, /*invalid_parameter=*/String()); break; } @@ -374,8 +379,7 @@ private: void HandleResponseHeaders(Resource* resource, - const ResourceResponse& response, - uint64_t request_id); + const ResourceResponse& response); void HandleSourceRegistration( const AttributionHeaders&, @@ -471,6 +475,7 @@ AttributionReportingIssueType:: kNavigationRegistrationWithoutTransientUserActivation, element, + /*request_url=*/String(), /*request_id=*/std::nullopt, /*invalid_parameter=*/String()); return std::nullopt; @@ -490,7 +495,7 @@ return impression; } - if (CanRegister(navigation_url, element, /*request_id=*/std::nullopt)) { + if (CanRegister(navigation_url, element)) { return impression; } @@ -540,8 +545,7 @@ Vector<KURL> urls = ParseAttributionSrc(attribution_src, anchor); - if (urls.empty() && - !CanRegister(navigation_url, anchor, /*request_id=*/std::nullopt)) { + if (urls.empty() && !CanRegister(navigation_url, anchor)) { return std::nullopt; } @@ -722,6 +726,7 @@ AttributionSrcLoader::ReportingOriginForUrlIfValid( const KURL& url, HTMLElement* element, + const String& request_url, std::optional<uint64_t> request_id, bool log_issues) { LocalDOMWindow* window = local_frame_->DomWindow(); @@ -734,7 +739,7 @@ return; } - LogAuditIssue(window, issue_type, element, request_id, + LogAuditIssue(window, issue_type, element, request_url, request_id, /*invalid_parameter=*/ invalid_origin ? invalid_origin->ToString() : String()); }; @@ -796,9 +801,10 @@ bool AttributionSrcLoader::CanRegister(const KURL& url, HTMLElement* element, - std::optional<uint64_t> request_id, bool log_issues) { - return !!ReportingOriginForUrlIfValid(url, element, request_id, log_issues); + return !!ReportingOriginForUrlIfValid(url, element, /*request_url=*/String(), + /*request_id=*/std::nullopt, + log_issues); } network::mojom::AttributionSupport AttributionSrcLoader::GetSupport() const { @@ -826,14 +832,15 @@ } const uint64_t request_id = request.InspectorId(); + const KURL& request_url = request.Url(); const bool cross_app_web_enabled = RuntimeEnabledFeatures::AttributionReportingCrossAppWebEnabled( local_frame_->DomWindow()) && base::FeatureList::IsEnabled( network::features::kAttributionReportingCrossAppWeb); - AttributionHeaders headers(response.HttpHeaderFields(), request_id, - cross_app_web_enabled); + AttributionHeaders headers(response.HttpHeaderFields(), request_url, + request_id, cross_app_web_enabled); // Only handle requests which are attempting to invoke the API. if (headers.count() == 0) { @@ -842,7 +849,8 @@ std::optional<attribution_reporting::SuitableOrigin> reporting_origin = ReportingOriginForUrlIfValid(response.ResponseUrl(), - /*element=*/nullptr, request_id); + /*element=*/nullptr, request_url, + request_id); if (!reporting_origin) { return false; } @@ -886,8 +894,8 @@ } auto registration_info = GetRegistrationInfo( - response.HttpHeaderFields(), local_frame_->DomWindow(), request_id, - cross_app_web_enabled); + response.HttpHeaderFields(), local_frame_->DomWindow(), request.Url(), + request_id, cross_app_web_enabled); if (!registration_info.has_value()) { return false; } @@ -944,7 +952,7 @@ void AttributionSrcLoader::ResourceClient::ResponseReceived( Resource* resource, const ResourceResponse& response) { - HandleResponseHeaders(resource, response, resource->InspectorId()); + HandleResponseHeaders(resource, response); } bool AttributionSrcLoader::ResourceClient::RedirectReceived( @@ -956,7 +964,7 @@ RecordAttributionSrcRequestStatus(request, AttributionSrcRequestStatus::kRedirected); } - HandleResponseHeaders(resource, response, request.InspectorId()); + HandleResponseHeaders(resource, response); return true; } @@ -998,15 +1006,16 @@ void AttributionSrcLoader::ResourceClient::HandleResponseHeaders( Resource* resource, - const ResourceResponse& response, - uint64_t request_id) { + const ResourceResponse& response) { const bool cross_app_web_enabled = RuntimeEnabledFeatures::AttributionReportingCrossAppWebEnabled( loader_->local_frame_->DomWindow()) && base::FeatureList::IsEnabled( network::features::kAttributionReportingCrossAppWeb); - AttributionHeaders headers(response.HttpHeaderFields(), request_id, - cross_app_web_enabled); + const KURL& request_url = resource->Url(); + const uint64_t request_id = resource->InspectorId(); + AttributionHeaders headers(response.HttpHeaderFields(), request_url, + request_id, cross_app_web_enabled); const bool has_header = headers.count() > 0; base::UmaHistogramBoolean( "Conversions.HasAttributionHeaderInAttributionSrcResponse", has_header); @@ -1021,14 +1030,15 @@ std::optional<attribution_reporting::SuitableOrigin> reporting_origin = loader_->ReportingOriginForUrlIfValid(response.ResponseUrl(), - /*element=*/nullptr, request_id); + /*element=*/nullptr, request_url, + request_id); if (!reporting_origin) { return; } auto registration_info = GetRegistrationInfo( response.HttpHeaderFields(), loader_->local_frame_->DomWindow(), - request_id, cross_app_web_enabled); + request_url, request_id, cross_app_web_enabled); if (!registration_info.has_value()) { return; } @@ -1063,7 +1073,8 @@ if (has_source && has_trigger) { LogAuditIssue(loader_->local_frame_->DomWindow(), AttributionReportingIssueType::kSourceAndTriggerHeaders, - /*element=*/nullptr, headers.request_id, + /*element=*/nullptr, headers.request_url, + headers.request_id, /*invalid_parameter=*/String()); return; } @@ -1285,7 +1296,7 @@ CHECK(!header.IsNull()); LogAuditIssue(loader_->local_frame_->DomWindow(), issue_type, - /*element=*/nullptr, headers.request_id, + /*element=*/nullptr, headers.request_url, headers.request_id, /*invalid_parameter=*/header); if (report_header_errors) { data_host_->ReportRegistrationHeaderError(
diff --git a/third_party/blink/renderer/core/frame/attribution_src_loader.h b/third_party/blink/renderer/core/frame/attribution_src_loader.h index 71d5361..74b36ac 100644 --- a/third_party/blink/renderer/core/frame/attribution_src_loader.h +++ b/third_party/blink/renderer/core/frame/attribution_src_loader.h
@@ -107,11 +107,10 @@ // policy supports Attribution Reporting, the window's context is secure, and // the Attribution Reporting runtime-enabled feature is enabled. // - // Reports a DevTools issue using `element` and `request_id` otherwise, if - // `log_issues` is true. + // Reports a DevTools issue using `element` otherwise, if `log_issues` is + // true. [[nodiscard]] bool CanRegister(const KURL& url, HTMLElement* element, - std::optional<uint64_t> request_id, bool log_issues = true); void Trace(Visitor* visitor) const; @@ -154,6 +153,7 @@ std::optional<attribution_reporting::SuitableOrigin> ReportingOriginForUrlIfValid(const KURL& url, HTMLElement* element, + const WTF::String& request_url, std::optional<uint64_t> request_id, bool log_issues = true);
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 7cf8477..4e24dc0e 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -1685,7 +1685,7 @@ Document* document = GetFrame().GetDocument(); DCHECK(document); - document->Fetcher()->UpdateAllImageResourcePriorities(); + document->Fetcher()->UpdateImagePrioritiesAndSpeculativeDecodes(); UpdateDocumentDraggableRegions(); ExecutePendingStickyUpdates();
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_test.cc b/third_party/blink/renderer/core/frame/web_frame_widget_test.cc index 37466ed6..833a9498 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_test.cc +++ b/third_party/blink/renderer/core/frame/web_frame_widget_test.cc
@@ -601,7 +601,7 @@ Compositor().BeginFrame(); } -TEST_F(WebFrameWidgetImplSimTest, SpeculativeDecodeBackgroundImage) { +TEST_F(WebFrameWidgetImplSimTest, SpeculativeDecodeIgnoresBackgroundImage) { base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatures( /*enabled_features=*/ @@ -614,7 +614,7 @@ WebView().MainFrameViewWidget()->Resize(gfx::Size(800, 600)); SimRequest doc_request("https://example.com/test.html", "text/html"); LoadURL("https://example.com/test.html"); - EXPECT_CALL(*MockMainFrameWidget(), RequestDecode(_, _)).Times(1); + EXPECT_CALL(*MockMainFrameWidget(), RequestDecode(_, _)).Times(0); doc_request.Complete( R"HTML( <!DOCTYPE html>
diff --git a/third_party/blink/renderer/core/html/forms/html_option_element.cc b/third_party/blink/renderer/core/html/forms/html_option_element.cc index cb2aee6..e596260 100644 --- a/third_party/blink/renderer/core/html/forms/html_option_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_option_element.cc
@@ -758,9 +758,8 @@ HTMLElement::FinishParsingChildren(); if (RuntimeEnabledFeatures::CustomizableSelectEnabled() && Selected()) { auto* select = OwnerSelectElement(); - if (select && select->UsesMenuList() && !select->IsMultiple()) { - CHECK_EQ(this, select->SelectedOption()); - select->UpdateAllSelectedcontents(); + if (select && !select->IsMultiple()) { + select->UpdateAllSelectedcontents(this); } } }
diff --git a/third_party/blink/renderer/core/html/forms/html_select_element.cc b/third_party/blink/renderer/core/html/forms/html_select_element.cc index 7cde744..1f63fac 100644 --- a/third_party/blink/renderer/core/html/forms/html_select_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_select_element.cc
@@ -1284,6 +1284,12 @@ if (flags & kDeselectOtherOptionsFlag) should_update_popup |= DeselectItemsWithoutValidation(element); + if (!IsMultiple()) { + UpdateAllSelectedcontents(element); + } + + // Note that DidSelectOption fires change events, which can invoke script + // and then change the selected option again. select_type_->DidSelectOption(element, flags, should_update_popup); NotifyFormStateChanged(); if (GetDocument().IsActive()) { @@ -1301,8 +1307,6 @@ // state to show as as autofilled. SetAutofillState(element ? autofill_state : WebAutofillState::kNotFilled); } - - UpdateAllSelectedcontents(); } bool HTMLSelectElement::DispatchFocusEvent( @@ -1394,7 +1398,7 @@ DCHECK_GE(state.ValueSize(), 2u); if (!IsMultiple()) { unsigned index = state[1].ToUInt(); - auto* option_element = + HTMLOptionElement* option_element = index < items_size ? DynamicTo<HTMLOptionElement>(items[index].Get()) : nullptr; if (option_element && option_element->value() == state[0]) { @@ -1404,19 +1408,21 @@ } else { wtf_size_t found_index = SearchOptionsForValue(state[0], 0, items_size); if (found_index != kNotFound) { - auto* found_option_element = - To<HTMLOptionElement>(items[found_index].Get()); - found_option_element->SetSelectedState(true); - found_option_element->SetDirty(true); - last_on_change_option_ = found_option_element; + option_element = To<HTMLOptionElement>(items[found_index].Get()); + option_element->SetSelectedState(true); + option_element->SetDirty(true); + last_on_change_option_ = option_element; + } else { + option_element = nullptr; } } + UpdateAllSelectedcontents(option_element); } else { wtf_size_t start_index = 0; for (wtf_size_t i = 0; i < state.ValueSize(); i += 2) { const String& value = state[i]; const unsigned index = state[i + 1].ToUInt(); - auto* option_element = + HTMLOptionElement* option_element = index < items_size ? DynamicTo<HTMLOptionElement>(items[index].Get()) : nullptr; if (option_element && option_element->value() == value) { @@ -1430,16 +1436,14 @@ found_index = SearchOptionsForValue(value, 0, start_index); if (found_index == kNotFound) continue; - auto* found_option_element = - To<HTMLOptionElement>(items[found_index].Get()); - found_option_element->SetSelectedState(true); - found_option_element->SetDirty(true); + option_element = To<HTMLOptionElement>(items[found_index].Get()); + option_element->SetSelectedState(true); + option_element->SetDirty(true); start_index = found_index + 1; } } } - UpdateAllSelectedcontents(); SetNeedsValidityCheck(); select_type_->UpdateTextStyleAndContent(); } @@ -2172,18 +2176,24 @@ } } -void HTMLSelectElement::UpdateAllSelectedcontents() { +void HTMLSelectElement::UpdateAllSelectedcontents( + HTMLOptionElement* selected_option) { + DCHECK(!IsMultiple()); if (!RuntimeEnabledFeatures::CustomizableSelectEnabled()) { return; } - auto* option = SelectedOption(); + + // SelectedOption() can be slow, so callers are required to pass it in, and + // we have a DCHECK() that they did so correctly. + DCHECK_EQ(selected_option, SelectedOption()); + if (!descendant_selectedcontents_.IsEmpty()) { (*descendant_selectedcontents_.begin()) - ->CloneContentsFromOptionElement(option); + ->CloneContentsFromOptionElement(selected_option); } if (RuntimeEnabledFeatures::SelectedcontentelementAttributeEnabled()) { if (auto* attr_selectedcontent = selectedContentElement()) { - attr_selectedcontent->CloneContentsFromOptionElement(option); + attr_selectedcontent->CloneContentsFromOptionElement(selected_option); } } }
diff --git a/third_party/blink/renderer/core/html/forms/html_select_element.h b/third_party/blink/renderer/core/html/forms/html_select_element.h index 23066aa..15552e7 100644 --- a/third_party/blink/renderer/core/html/forms/html_select_element.h +++ b/third_party/blink/renderer/core/html/forms/html_select_element.h
@@ -290,7 +290,7 @@ void DefaultEventHandler(Event&) override; - void UpdateAllSelectedcontents(); + void UpdateAllSelectedcontents(HTMLOptionElement* selected_option); private: mojom::blink::FormControlType FormControlType() const override;
diff --git a/third_party/blink/renderer/core/html/parser/preload_request.cc b/third_party/blink/renderer/core/html/parser/preload_request.cc index d76950e..2f5b013 100644 --- a/third_party/blink/renderer/core/html/parser/preload_request.cc +++ b/third_party/blink/renderer/core/html/parser/preload_request.cc
@@ -123,8 +123,7 @@ // called again later. if (is_attribution_reporting_eligible_img_or_script_ && document->domWindow()->GetFrame()->GetAttributionSrcLoader()->CanRegister( - url, /*element=*/nullptr, - /*request_id=*/std::nullopt, /*log_issues=*/false)) { + url, /*element=*/nullptr, /*log_issues=*/false)) { resource_request.SetAttributionReportingEligibility( network::mojom::AttributionReportingEligibility::kEventSourceOrTrigger); }
diff --git a/third_party/blink/renderer/core/inspector/inspector_audits_issue.cc b/third_party/blink/renderer/core/inspector/inspector_audits_issue.cc index 4c8b075..af1bda8 100644 --- a/third_party/blink/renderer/core/inspector/inspector_audits_issue.cc +++ b/third_party/blink/renderer/core/inspector/inspector_audits_issue.cc
@@ -139,17 +139,13 @@ void AuditsIssue::ReportCorsIssue( ExecutionContext* execution_context, - int64_t identifier, RendererCorsIssueCode code, String url, String initiator_origin, String failedParameter, std::optional<base::UnguessableToken> issue_id) { - String devtools_request_id = - IdentifiersFactory::SubresourceRequestId(identifier); std::unique_ptr<protocol::Audits::AffectedRequest> affected_request = protocol::Audits::AffectedRequest::create() - .setRequestId(devtools_request_id) .setUrl(url) .build(); auto protocol_cors_error_status = @@ -256,12 +252,12 @@ } // namespace -void AuditsIssue::ReportAttributionIssue( - ExecutionContext* execution_context, - AttributionReportingIssueType type, - Element* element, - const String& request_id, - const String& invalid_parameter) { +void AuditsIssue::ReportAttributionIssue(ExecutionContext* execution_context, + AttributionReportingIssueType type, + Element* element, + const String& request_url, + const String& request_id, + const String& invalid_parameter) { auto details = protocol::Audits::AttributionReportingIssueDetails::create() .setViolationType(BuildAttributionReportingIssueType(type)) .build(); @@ -269,10 +265,13 @@ if (element) { details->setViolatingNodeId(element->GetDomNodeId()); } - if (!request_id.IsNull()) { - details->setRequest(protocol::Audits::AffectedRequest::create() - .setRequestId(request_id) - .build()); + if (!request_url.IsNull()) { + auto request = + protocol::Audits::AffectedRequest::create().setUrl(request_url).build(); + if (!request_id.IsNull()) { + request->setRequestId(request_id); + } + details->setRequest(std::move(request)); } if (!invalid_parameter.IsNull()) { details->setInvalidParameter(invalid_parameter);
diff --git a/third_party/blink/renderer/core/inspector/inspector_audits_issue.h b/third_party/blink/renderer/core/inspector/inspector_audits_issue.h index 6c23774..146a65b 100644 --- a/third_party/blink/renderer/core/inspector/inspector_audits_issue.h +++ b/third_party/blink/renderer/core/inspector/inspector_audits_issue.h
@@ -99,7 +99,6 @@ String loader_id); static void ReportCorsIssue(ExecutionContext* execution_context, - int64_t identifier, RendererCorsIssueCode code, WTF::String url, WTF::String initiator_origin, @@ -110,6 +109,7 @@ ExecutionContext* execution_context, mojom::blink::AttributionReportingIssueType type, Element* element, + const String& request_url, const String& request_id, const String& invalid_parameter);
diff --git a/third_party/blink/renderer/core/inspector/inspector_issue_conversion.cc b/third_party/blink/renderer/core/inspector/inspector_issue_conversion.cc index 62d60f0c..9786d44 100644 --- a/third_party/blink/renderer/core/inspector/inspector_issue_conversion.cc +++ b/third_party/blink/renderer/core/inspector/inspector_issue_conversion.cc
@@ -24,11 +24,10 @@ std::unique_ptr<protocol::Audits::AffectedRequest> BuildAffectedRequest( const mojom::blink::AffectedRequestPtr& request) { - auto protocol_request = protocol::Audits::AffectedRequest::create() - .setRequestId(request->request_id) - .build(); - if (!request->url.empty()) { - protocol_request->setUrl(request->url); + auto protocol_request = + protocol::Audits::AffectedRequest::create().setUrl(request->url).build(); + if (!request->request_id.empty()) { + protocol_request->setRequestId(request->request_id); } return protocol_request; }
diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/third_party/blink/renderer/core/loader/frame_fetch_context.cc index ff3c8f6..a8ad9f1 100644 --- a/third_party/blink/renderer/core/loader/frame_fetch_context.cc +++ b/third_party/blink/renderer/core/loader/frame_fetch_context.cc
@@ -887,6 +887,9 @@ if (IsA<SVGImage>(image)) { return false; } + if (!image_resource->GetContent()->CanBeSpeculativelyDecoded()) { + return false; + } PaintImage paint_image = image->PaintImageForCurrentFrame(); if (paint_image) { document_->GetFrame()->GetChromeClient().RequestDecode(
diff --git a/third_party/blink/renderer/core/loader/image_loader.cc b/third_party/blink/renderer/core/loader/image_loader.cc index dd91e9ea..765edce9 100644 --- a/third_party/blink/renderer/core/loader/image_loader.cc +++ b/third_party/blink/renderer/core/loader/image_loader.cc
@@ -488,8 +488,7 @@ if (IsA<HTMLImageElement>(GetElement())) { if (GetElement()->FastHasAttribute(html_names::kAttributionsrcAttr) && frame->GetAttributionSrcLoader()->CanRegister( - url, To<HTMLImageElement>(GetElement()), - /*request_id=*/std::nullopt)) { + url, To<HTMLImageElement>(GetElement()))) { resource_request.SetAttributionReportingEligibility( network::mojom::AttributionReportingEligibility:: kEventSourceOrTrigger);
diff --git a/third_party/blink/renderer/core/loader/resource/image_resource.cc b/third_party/blink/renderer/core/loader/resource/image_resource.cc index 7f8e34c..19ef3da 100644 --- a/third_party/blink/renderer/core/loader/resource/image_resource.cc +++ b/third_party/blink/renderer/core/loader/resource/image_resource.cc
@@ -600,6 +600,15 @@ Resource::ResponseReceived(response); } +void ImageResource::UpdateResourceInfoFromObservers() { + GetContent()->UpdateResourceInfoFromObservers(); +} + +std::pair<ResourcePriority, ResourcePriority> +ImageResource::PriorityFromObservers() const { + return GetContent()->PriorityFromObservers(); +} + void ImageResource::OnePartInMultipartReceived( const ResourceResponse& response) { DCHECK(multipart_parser_); @@ -655,11 +664,6 @@ return content_.Get(); } -std::pair<ResourcePriority, ResourcePriority> -ImageResource::ComputePriorityFromObservers() { - return GetContent()->PriorityFromObservers(); -} - void ImageResource::UpdateImage( scoped_refptr<SharedBuffer> shared_buffer, ImageResourceContent::UpdateImageOption update_image_option,
diff --git a/third_party/blink/renderer/core/loader/resource/image_resource.h b/third_party/blink/renderer/core/loader/resource/image_resource.h index 9368a04..08fe4d13 100644 --- a/third_party/blink/renderer/core/loader/resource/image_resource.h +++ b/third_party/blink/renderer/core/loader/resource/image_resource.h
@@ -98,6 +98,10 @@ // For compatibility, images keep loading even if there are HTTP errors. bool ShouldIgnoreHTTPStatusCodeErrors() const override { return true; } + void UpdateResourceInfoFromObservers() override; + std::pair<ResourcePriority, ResourcePriority> PriorityFromObservers() + const override; + // MultipartImageResourceParser::Client void OnePartInMultipartReceived(const ResourceResponse&) final; void MultipartDataReceived(base::span<const uint8_t> bytes) final; @@ -126,9 +130,6 @@ bool IsAccessAllowed( ImageResourceInfo::DoesCurrentFrameHaveSingleSecurityOrigin) const; - std::pair<ResourcePriority, ResourcePriority> ComputePriorityFromObservers() - override; - bool HasClientsOrObservers() const override; void UpdateImageAndClearBuffer();
diff --git a/third_party/blink/renderer/core/loader/resource/image_resource_content.cc b/third_party/blink/renderer/core/loader/resource/image_resource_content.cc index 8c1c036..5a4c5fc 100644 --- a/third_party/blink/renderer/core/loader/resource/image_resource_content.cc +++ b/third_party/blink/renderer/core/loader/resource/image_resource_content.cc
@@ -211,18 +211,40 @@ } } +void ImageResourceContent::UpdateResourceInfoFromObservers() { + ProhibitAddRemoveObserverInScope prohibit_add_remove_observer_in_scope(this); + + cached_info_.priority_ = cached_info_.priority_excluding_image_loader_ = + ResourcePriority(); + + for (const auto& it : finished_observers_) { + PriorityFromObserver(it.key, cached_info_.priority_, + cached_info_.priority_excluding_image_loader_); + } + for (const auto& it : observers_) { + PriorityFromObserver(it.key, cached_info_.priority_, + cached_info_.priority_excluding_image_loader_); + } +} + +bool ImageResourceContent::CanBeSpeculativelyDecoded() const { + for (const auto& it : finished_observers_) { + if (!it.key->CanBeSpeculativelyDecoded()) { + return false; + } + } + for (const auto& it : observers_) { + if (!it.key->CanBeSpeculativelyDecoded()) { + return false; + } + } + return true; +} + std::pair<ResourcePriority, ResourcePriority> ImageResourceContent::PriorityFromObservers() const { - ProhibitAddRemoveObserverInScope prohibit_add_remove_observer_in_scope(this); - ResourcePriority priority; - ResourcePriority priority_excluding_image_loader; - - for (const auto& it : finished_observers_) - PriorityFromObserver(it.key, priority, priority_excluding_image_loader); - for (const auto& it : observers_) - PriorityFromObserver(it.key, priority, priority_excluding_image_loader); - - return std::make_pair(priority, priority_excluding_image_loader); + return std::make_pair(cached_info_.priority_, + cached_info_.priority_excluding_image_loader_); } std::optional<WebURLRequest::Priority> ImageResourceContent::RequestPriority()
diff --git a/third_party/blink/renderer/core/loader/resource/image_resource_content.h b/third_party/blink/renderer/core/loader/resource/image_resource_content.h index 999558f..a72ad373 100644 --- a/third_party/blink/renderer/core/loader/resource/image_resource_content.h +++ b/third_party/blink/renderer/core/loader/resource/image_resource_content.h
@@ -193,17 +193,19 @@ void SetImageResourceInfo(ImageResourceInfo*); + void UpdateResourceInfoFromObservers(); + // Returns priority information to be used for setting the Resource's // priority. This is NOT the current Resource's priority. std::pair<ResourcePriority, ResourcePriority> PriorityFromObservers() const; - // Returns the current Resource's priroity used by MediaTiming. + // Returns the current Resource's priority used by MediaTiming. std::optional<WebURLRequest::Priority> RequestPriority() const override; scoped_refptr<const SharedBuffer> ResourceBuffer() const; bool ShouldUpdateImageImmediately() const; bool HasObservers() const { return !observers_.empty() || !finished_observers_.empty(); } - + bool CanBeSpeculativelyDecoded() const; ImageDecoder::CompressionFormat GetCompressionFormat() const; // Returns the number of bytes of image data which should be used for entropy @@ -258,6 +260,13 @@ HeapHashCountedSet<WeakMember<ImageResourceObserver>> observers_; HeapHashCountedSet<WeakMember<ImageResourceObserver>> finished_observers_; + // This is updated during ResourceFetcher::UpdateResourceInfoFromObservers + // when layout is clean and cached for use when layout may not be clean. + struct { + ResourcePriority priority_; + ResourcePriority priority_excluding_image_loader_; + } cached_info_; + // Keep one-byte members together to avoid wasting space on padding. ResourceStatus content_status_ = ResourceStatus::kNotStarted;
diff --git a/third_party/blink/renderer/core/loader/resource/image_resource_observer.h b/third_party/blink/renderer/core/loader/resource/image_resource_observer.h index 0bb3240e..3528ed0 100644 --- a/third_party/blink/renderer/core/loader/resource/image_resource_observer.h +++ b/third_party/blink/renderer/core/loader/resource/image_resource_observer.h
@@ -86,6 +86,7 @@ virtual ResourcePriority ComputeResourcePriority() const { return ResourcePriority(); } + virtual bool CanBeSpeculativelyDecoded() const { return true; } // Name for debugging, e.g. shown in memory-infra. virtual WTF::String DebugName() const = 0;
diff --git a/third_party/blink/renderer/core/script/script_loader.cc b/third_party/blink/renderer/core/script/script_loader.cc index de92709..927ad518 100644 --- a/third_party/blink/renderer/core/script/script_loader.cc +++ b/third_party/blink/renderer/core/script/script_loader.cc
@@ -794,9 +794,7 @@ // TODO(apaseltiner): Propagate the element instead of passing nullptr. if (element_->HasAttributionsrcAttribute() && context_window->GetFrame()->GetAttributionSrcLoader()->CanRegister( - url, - /*element=*/nullptr, - /*request_id=*/std::nullopt)) { + url, /*element=*/nullptr)) { options.SetAttributionReportingEligibility( ScriptFetchOptions::AttributionReportingEligibility::kEligible); }
diff --git a/third_party/blink/renderer/core/style/style_fetched_image.cc b/third_party/blink/renderer/core/style/style_fetched_image.cc index a439e099..44c1115 100644 --- a/third_party/blink/renderer/core/style/style_fetched_image.cc +++ b/third_party/blink/renderer/core/style/style_fetched_image.cc
@@ -297,6 +297,10 @@ return true; } +bool StyleFetchedImage::CanBeSpeculativelyDecoded() const { + return false; +} + void StyleFetchedImage::Trace(Visitor* visitor) const { visitor->Trace(image_); visitor->Trace(document_);
diff --git a/third_party/blink/renderer/core/style/style_fetched_image.h b/third_party/blink/renderer/core/style/style_fetched_image.h index 57e64cc..12204099 100644 --- a/third_party/blink/renderer/core/style/style_fetched_image.h +++ b/third_party/blink/renderer/core/style/style_fetched_image.h
@@ -104,6 +104,7 @@ // ImageResourceObserver overrides void ImageNotifyFinished(ImageResourceContent*) override; bool GetImageAnimationPolicy(mojom::blink::ImageAnimationPolicy&) override; + bool CanBeSpeculativelyDecoded() const override; Member<ImageResourceContent> image_; Member<const Document> document_;
diff --git a/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc b/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc index 3d8fc33..6ef7815 100644 --- a/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc +++ b/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
@@ -128,10 +128,6 @@ return true; } - if (object.IsTableCell()) { - return true; - } - if (const auto* element = DynamicTo<HTMLElement>(object.GetNode())) { if (element->HasTagName(html_names::kFigureTag)) { return true; @@ -152,27 +148,6 @@ if (!element) { return; } - if (IsHeadingTag(*element)) { - annotated_roles.push_back( - mojom::blink::AIPageContentAnnotatedRole::kHeading); - } - if (element->HasTagName(html_names::kPTag)) { - annotated_roles.push_back( - mojom::blink::AIPageContentAnnotatedRole::kParagraph); - } - if (element->HasTagName(html_names::kOlTag)) { - annotated_roles.push_back( - mojom::blink::AIPageContentAnnotatedRole::kOrderedList); - } - if (element->HasTagName(html_names::kUlTag) || - element->HasTagName(html_names::kDlTag)) { - annotated_roles.push_back( - mojom::blink::AIPageContentAnnotatedRole::kUnorderedList); - } - if (object.IsTableCell()) { - annotated_roles.push_back( - mojom::blink::AIPageContentAnnotatedRole::kTableCell); - } if (element->HasTagName(html_names::kHeaderTag) || element->FastGetAttribute(html_names::kRoleAttr) == "banner") { annotated_roles.push_back( @@ -529,6 +504,7 @@ // Set the attribute type and add any special attributes if the attribute type // requires it. + auto* element = DynamicTo<HTMLElement>(object.GetNode()); if (const auto* iframe = GetIFrame(object)) { ProcessIframe(*iframe, *content_node); } else if (object.IsLayoutView()) { @@ -554,6 +530,27 @@ ProcessTableNode(To<LayoutTable>(object), attributes, document_style); } else if (object.IsTableRow()) { ProcessTableRowNode(To<LayoutTableRow>(object), attributes, document_style); + } else if (object.IsTableCell()) { + attributes.attribute_type = + mojom::blink::AIPageContentAttributeType::kTableCell; + } else if (element && IsHeadingTag(*element)) { + attributes.attribute_type = + mojom::blink::AIPageContentAttributeType::kHeading; + } else if (element && element->HasTagName(html_names::kPTag)) { + attributes.attribute_type = + mojom::blink::AIPageContentAttributeType::kParagraph; + } else if (element && element->HasTagName(html_names::kOlTag)) { + attributes.attribute_type = + mojom::blink::AIPageContentAttributeType::kOrderedList; + } else if (element && (element->HasTagName(html_names::kUlTag) || + element->HasTagName(html_names::kDlTag))) { + attributes.attribute_type = + mojom::blink::AIPageContentAttributeType::kUnorderedList; + } else if (element && (element->HasTagName(html_names::kLiTag) || + element->HasTagName(html_names::kDtTag) || + element->HasTagName(html_names::kDdTag))) { + attributes.attribute_type = + mojom::blink::AIPageContentAttributeType::kListItem; } else if (IsGenericContainer(object, attributes.annotated_roles)) { // Be sure to set annotated roles before calling IsGenericContainer, as // IsGenericContainer will check for annotated roles.
diff --git a/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc b/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc index eb632f17..3bb0bef 100644 --- a/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc +++ b/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc
@@ -47,6 +47,15 @@ ASSERT_TRUE(helper_.LocalMainFrame()); } + void CheckListItemWithText(const mojom::blink::AIPageContentNode& node, + const String& expected_text) { + const auto& attributes = *node.content_attributes; + EXPECT_EQ(attributes.attribute_type, + mojom::blink::AIPageContentAttributeType::kListItem); + EXPECT_EQ(node.children_nodes.size(), 1u); + CheckTextNode(*node.children_nodes[0], expected_text); + } + void CheckTextNode(const mojom::blink::AIPageContentNode& node, const String& expected_text) { const auto& attributes = *node.content_attributes; @@ -107,6 +116,12 @@ } } + void CheckTableCellNode(const mojom::blink::AIPageContentNode& node) { + const auto& attributes = *node.content_attributes; + EXPECT_EQ(attributes.attribute_type, + mojom::blink::AIPageContentAttributeType::kTableCell); + } + void CheckTableRowNode( const mojom::blink::AIPageContentNode& node, const mojom::blink::AIPageContentTableRowType& expected_row_type) { @@ -123,6 +138,30 @@ mojom::blink::AIPageContentAttributeType::kContainer); } + void CheckHeadingNode(const mojom::blink::AIPageContentNode& node) { + const auto& attributes = *node.content_attributes; + EXPECT_EQ(attributes.attribute_type, + mojom::blink::AIPageContentAttributeType::kHeading); + } + + void CheckParagraphNode(const mojom::blink::AIPageContentNode& node) { + const auto& attributes = *node.content_attributes; + EXPECT_EQ(attributes.attribute_type, + mojom::blink::AIPageContentAttributeType::kParagraph); + } + + void CheckUnorderedListNode(const mojom::blink::AIPageContentNode& node) { + const auto& attributes = *node.content_attributes; + EXPECT_EQ(attributes.attribute_type, + mojom::blink::AIPageContentAttributeType::kUnorderedList); + } + + void CheckOrderedListNode(const mojom::blink::AIPageContentNode& node) { + const auto& attributes = *node.content_attributes; + EXPECT_EQ(attributes.attribute_type, + mojom::blink::AIPageContentAttributeType::kOrderedList); + } + void CheckAnnotatedRole( const mojom::blink::AIPageContentNode& node, const mojom::blink::AIPageContentAnnotatedRole& expected_role) { @@ -139,6 +178,21 @@ EXPECT_EQ(geometry.visible_bounding_box, expected_visible_bounding_box); } + const mojom::blink::AIPageContentNode& GetSingleTableCell( + const mojom::blink::AIPageContentNode& table) { + CheckTableNode(table); + EXPECT_EQ(table.children_nodes.size(), 1u); + + const auto& table_row = *table.children_nodes[0]; + CheckTableRowNode(table_row, + mojom::blink::AIPageContentTableRowType::kBody); + EXPECT_EQ(table_row.children_nodes.size(), 1u); + + const auto& table_cell = *table_row.children_nodes[0]; + CheckTableCellNode(table_cell); + return table_cell; + } + protected: test::TaskEnvironment task_environment_; frame_test_helpers::WebViewHelper helper_; @@ -273,25 +327,19 @@ ASSERT_EQ(root.children_nodes.size(), 3u); const auto& heading1 = *root.children_nodes[0]; - CheckContainerNode(heading1); - CheckAnnotatedRole(heading1, - mojom::blink::AIPageContentAnnotatedRole::kHeading); + CheckHeadingNode(heading1); ASSERT_EQ(heading1.children_nodes.size(), 1u); const auto& heading1_text_node = *heading1.children_nodes[0]; CheckTextNode(heading1_text_node, "Heading 1"); const auto& heading2 = *root.children_nodes[1]; - CheckContainerNode(heading2); - CheckAnnotatedRole(heading2, - mojom::blink::AIPageContentAnnotatedRole::kHeading); + CheckHeadingNode(heading2); ASSERT_EQ(heading2.children_nodes.size(), 1u); const auto& heading2_text_node = *heading2.children_nodes[0]; CheckTextNode(heading2_text_node, "Heading 2"); const auto& heading3 = *root.children_nodes[2]; - CheckContainerNode(heading3); - CheckAnnotatedRole(heading3, - mojom::blink::AIPageContentAnnotatedRole::kHeading); + CheckHeadingNode(heading3); ASSERT_EQ(heading3.children_nodes.size(), 1u); const auto& heading3_text_node = *heading3.children_nodes[0]; CheckTextNode(heading3_text_node, "Heading 3"); @@ -327,9 +375,7 @@ ASSERT_EQ(root.children_nodes.size(), 1u); const auto& paragraph = *root.children_nodes[0]; - CheckContainerNode(paragraph); - CheckAnnotatedRole(paragraph, - mojom::blink::AIPageContentAnnotatedRole::kParagraph); + CheckParagraphNode(paragraph); CheckGeometry(paragraph, gfx::Rect(-20, -10, 200, 40), gfx::Rect(0, 0, 180, 30)); @@ -371,30 +417,24 @@ ASSERT_EQ(root.children_nodes.size(), 3u); const auto& ul = *root.children_nodes[0]; - CheckContainerNode(ul); - CheckAnnotatedRole(ul, - mojom::blink::AIPageContentAnnotatedRole::kUnorderedList); + CheckUnorderedListNode(ul); ASSERT_EQ(ul.children_nodes.size(), 2u); - CheckTextNode(*ul.children_nodes[0], "Item 1"); - CheckTextNode(*ul.children_nodes[1], "Item 2"); + CheckListItemWithText(*ul.children_nodes[0], "Item 1"); + CheckListItemWithText(*ul.children_nodes[1], "Item 2"); const auto& ol = *root.children_nodes[1]; - CheckContainerNode(ol); - CheckAnnotatedRole(ol, - mojom::blink::AIPageContentAnnotatedRole::kOrderedList); + CheckOrderedListNode(ol); ASSERT_EQ(ol.children_nodes.size(), 2u); - CheckTextNode(*ol.children_nodes[0], "Step 1"); - CheckTextNode(*ol.children_nodes[1], "Step 2"); + CheckListItemWithText(*ol.children_nodes[0], "Step 1"); + CheckListItemWithText(*ol.children_nodes[1], "Step 2"); const auto& dl = *root.children_nodes[2]; - CheckContainerNode(dl); - CheckAnnotatedRole(dl, - mojom::blink::AIPageContentAnnotatedRole::kUnorderedList); + CheckUnorderedListNode(dl); ASSERT_EQ(dl.children_nodes.size(), 4u); - CheckTextNode(*dl.children_nodes[0], "Detail 1 title"); - CheckTextNode(*dl.children_nodes[1], "Detail 1 description"); - CheckTextNode(*dl.children_nodes[2], "Detail 2 title"); - CheckTextNode(*dl.children_nodes[3], "Detail 2 description"); + CheckListItemWithText(*dl.children_nodes[0], "Detail 1 title"); + CheckListItemWithText(*dl.children_nodes[1], "Detail 1 description"); + CheckListItemWithText(*dl.children_nodes[2], "Detail 2 title"); + CheckListItemWithText(*dl.children_nodes[3], "Detail 2 description"); } TEST_F(AIPageContentAgentTest, IFrameWithContent) { @@ -504,41 +544,31 @@ ASSERT_EQ(root.children_nodes.size(), 5u); const auto& xl_text = *root.children_nodes[0]; - CheckContainerNode(xl_text); - CheckAnnotatedRole(xl_text, - mojom::blink::AIPageContentAnnotatedRole::kHeading); + CheckHeadingNode(xl_text); CheckTextNode(*xl_text.children_nodes[0], "Extra large text"); CheckTextSize(*xl_text.children_nodes[0], mojom::blink::AIPageContentTextSize::kXL); const auto& l_text = *root.children_nodes[1]; - CheckContainerNode(l_text); - CheckAnnotatedRole(l_text, - mojom::blink::AIPageContentAnnotatedRole::kHeading); + CheckHeadingNode(l_text); CheckTextNode(*l_text.children_nodes[0], "Large text"); CheckTextSize(*l_text.children_nodes[0], mojom::blink::AIPageContentTextSize::kL); const auto& m_text = *root.children_nodes[2]; - CheckContainerNode(m_text); - CheckAnnotatedRole(m_text, - mojom::blink::AIPageContentAnnotatedRole::kParagraph); + CheckParagraphNode(m_text); CheckTextNode(*m_text.children_nodes[0], "Regular text"); CheckTextSize(*m_text.children_nodes[0], mojom::blink::AIPageContentTextSize::kM); const auto& s_text = *root.children_nodes[3]; - CheckContainerNode(s_text); - CheckAnnotatedRole(s_text, - mojom::blink::AIPageContentAnnotatedRole::kHeading); + CheckHeadingNode(s_text); CheckTextNode(*s_text.children_nodes[0], "Small text"); CheckTextSize(*s_text.children_nodes[0], mojom::blink::AIPageContentTextSize::kS); const auto& xs_text = *root.children_nodes[4]; - CheckContainerNode(xs_text); - CheckAnnotatedRole(xs_text, - mojom::blink::AIPageContentAnnotatedRole::kParagraph); + CheckParagraphNode(xs_text); CheckTextNode(*xs_text.children_nodes[0], "Extra small text"); CheckTextSize(*xs_text.children_nodes[0], mojom::blink::AIPageContentTextSize::kXS); @@ -572,9 +602,7 @@ ASSERT_EQ(root.children_nodes.size(), 1u); const auto& paragraph = *root.children_nodes[0]; - CheckContainerNode(paragraph); - CheckAnnotatedRole(paragraph, - mojom::blink::AIPageContentAnnotatedRole::kParagraph); + CheckParagraphNode(paragraph); ASSERT_EQ(paragraph.children_nodes.size(), 8u); const auto& regular_text = *paragraph.children_nodes[0]; @@ -655,9 +683,7 @@ ASSERT_EQ(header1.children_nodes.size(), 1u); const auto& header1_cell1 = *header1.children_nodes[0]; - CheckContainerNode(header1_cell1); - CheckAnnotatedRole(header1_cell1, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(header1_cell1); CheckTextNode(*header1_cell1.children_nodes[0], "Header"); const auto& row1 = *table.children_nodes[1]; @@ -665,15 +691,11 @@ ASSERT_EQ(row1.children_nodes.size(), 2u); const auto& row1_cell1 = *row1.children_nodes[0]; - CheckContainerNode(row1_cell1); - CheckAnnotatedRole(row1_cell1, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row1_cell1); CheckTextNode(*row1_cell1.children_nodes[0], "Row 1 Column 1"); const auto& row1_cell2 = *row1.children_nodes[1]; - CheckContainerNode(row1_cell2); - CheckAnnotatedRole(row1_cell2, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row1_cell2); CheckTextNode(*row1_cell2.children_nodes[0], "Row 1 Column 2"); const auto& row2 = *table.children_nodes[2]; @@ -681,15 +703,11 @@ ASSERT_EQ(row2.children_nodes.size(), 2u); const auto& row2_cell1 = *row2.children_nodes[0]; - CheckContainerNode(row2_cell1); - CheckAnnotatedRole(row2_cell1, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row2_cell1); CheckTextNode(*row2_cell1.children_nodes[0], "Row 2 Column 1"); const auto& row2_cell2 = *row2.children_nodes[1]; - CheckContainerNode(row2_cell2); - CheckAnnotatedRole(row2_cell2, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row2_cell2); CheckTextNode(*row2_cell2.children_nodes[0], "Row 2 Column 2"); const auto& footer = *table.children_nodes[3]; @@ -697,15 +715,11 @@ ASSERT_EQ(footer.children_nodes.size(), 2u); const auto& footer_cell1 = *footer.children_nodes[0]; - CheckContainerNode(footer_cell1); - CheckAnnotatedRole(footer_cell1, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(footer_cell1); CheckTextNode(*footer_cell1.children_nodes[0], "Footer 1"); const auto& footer_cell2 = *footer.children_nodes[1]; - CheckContainerNode(footer_cell2); - CheckAnnotatedRole(footer_cell2, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(footer_cell2); CheckTextNode(*footer_cell2.children_nodes[0], "Footer 2"); } @@ -782,15 +796,11 @@ ASSERT_EQ(row1.children_nodes.size(), 2u); const auto& row1_cell1 = *row1.children_nodes[0]; - CheckContainerNode(row1_cell1); - CheckAnnotatedRole(row1_cell1, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row1_cell1); CheckTextNode(*row1_cell1.children_nodes[0], "Personal Info"); const auto& row1_cell2 = *row1.children_nodes[1]; - CheckContainerNode(row1_cell2); - CheckAnnotatedRole(row1_cell2, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row1_cell2); CheckTextNode(*row1_cell2.children_nodes[0], "Contact Info"); const auto& row2 = *table.children_nodes[1]; @@ -798,27 +808,19 @@ ASSERT_EQ(row2.children_nodes.size(), 4u); const auto& row2_cell1 = *row2.children_nodes[0]; - CheckContainerNode(row2_cell1); - CheckAnnotatedRole(row2_cell1, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row2_cell1); CheckTextNode(*row2_cell1.children_nodes[0], "Name"); const auto& row2_cell2 = *row2.children_nodes[1]; - CheckContainerNode(row2_cell2); - CheckAnnotatedRole(row2_cell2, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row2_cell2); CheckTextNode(*row2_cell2.children_nodes[0], "Age"); const auto& row2_cell3 = *row2.children_nodes[2]; - CheckContainerNode(row2_cell3); - CheckAnnotatedRole(row2_cell3, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row2_cell3); CheckTextNode(*row2_cell3.children_nodes[0], "Email"); const auto& row2_cell4 = *row2.children_nodes[3]; - CheckContainerNode(row2_cell4); - CheckAnnotatedRole(row2_cell4, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row2_cell4); CheckTextNode(*row2_cell4.children_nodes[0], "Phone"); const auto& row3 = *table.children_nodes[2]; @@ -826,27 +828,19 @@ ASSERT_EQ(row3.children_nodes.size(), 4u); const auto& row3_cell1 = *row3.children_nodes[0]; - CheckContainerNode(row3_cell1); - CheckAnnotatedRole(row3_cell1, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row3_cell1); CheckTextNode(*row3_cell1.children_nodes[0], "John Doe"); const auto& row3_cell2 = *row3.children_nodes[1]; - CheckContainerNode(row3_cell2); - CheckAnnotatedRole(row3_cell2, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row3_cell2); CheckTextNode(*row3_cell2.children_nodes[0], "30"); const auto& row3_cell3 = *row3.children_nodes[2]; - CheckContainerNode(row3_cell3); - CheckAnnotatedRole(row3_cell3, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row3_cell3); CheckTextNode(*row3_cell3.children_nodes[0], "john.doe@example.com"); const auto& row3_cell4 = *row3.children_nodes[3]; - CheckContainerNode(row3_cell4); - CheckAnnotatedRole(row3_cell4, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row3_cell4); CheckTextNode(*row3_cell4.children_nodes[0], "123-456-7890"); const auto& row4 = *table.children_nodes[3]; @@ -854,27 +848,19 @@ ASSERT_EQ(row4.children_nodes.size(), 4u); const auto& row4_cell1 = *row4.children_nodes[0]; - CheckContainerNode(row4_cell1); - CheckAnnotatedRole(row4_cell1, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row4_cell1); CheckTextNode(*row4_cell1.children_nodes[0], "Jane Smith"); const auto& row4_cell2 = *row4.children_nodes[1]; - CheckContainerNode(row4_cell2); - CheckAnnotatedRole(row4_cell2, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row4_cell2); CheckTextNode(*row4_cell2.children_nodes[0], "28"); const auto& row4_cell3 = *row4.children_nodes[2]; - CheckContainerNode(row4_cell3); - CheckAnnotatedRole(row4_cell3, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row4_cell3); CheckTextNode(*row4_cell3.children_nodes[0], "jane.smith@example.com"); const auto& row4_cell4 = *row4.children_nodes[3]; - CheckContainerNode(row4_cell4); - CheckAnnotatedRole(row4_cell4, - mojom::blink::AIPageContentAnnotatedRole::kTableCell); + CheckTableCellNode(row4_cell4); CheckTextNode(*row4_cell4.children_nodes[0], "987-654-3210"); } @@ -1283,25 +1269,6 @@ CheckTextNode(dialog_text, "This is a dialog."); } -namespace { -const mojom::blink::AIPageContentNode& GetSingleTableCell( - const mojom::blink::AIPageContentNode& table) { - EXPECT_EQ(table.content_attributes->attribute_type, - mojom::blink::AIPageContentAttributeType::kTable); - EXPECT_EQ(table.children_nodes.size(), 1u); - - const auto& table_row = *table.children_nodes[0]; - EXPECT_EQ(table_row.content_attributes->attribute_type, - mojom::blink::AIPageContentAttributeType::kTableRow); - EXPECT_EQ(table_row.children_nodes.size(), 1u); - - const auto& table_cell = *table_row.children_nodes[0]; - EXPECT_EQ(table_cell.content_attributes->attribute_type, - mojom::blink::AIPageContentAttributeType::kContainer); - return table_cell; -} -} // namespace - TEST_F(AIPageContentAgentTest, TableWithAnonymousCells) { frame_test_helpers::LoadHTMLString( helper_.LocalMainFrame(),
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource.h b/third_party/blink/renderer/platform/loader/fetch/resource.h index 314ce46..017dc6b7 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource.h +++ b/third_party/blink/renderer/platform/loader/fetch/resource.h
@@ -202,19 +202,15 @@ void UpdateResourceWidth(const AtomicString& resource_width); + virtual void UpdateResourceInfoFromObservers() {} + // Returns two priorities: // - `first` is the priority with the fix of https://crbug.com/1369823. // - `second` is the priority without the fix, ignoring the priority from // ImageLoader. - std::pair<ResourcePriority, ResourcePriority> PriorityFromObservers() { - std::pair<ResourcePriority, ResourcePriority> result = - ComputePriorityFromObservers(); - last_computed_priority_ = result.first; - return result; - } - - const ResourcePriority& LastComputedPriority() const { - return last_computed_priority_; + virtual std::pair<ResourcePriority, ResourcePriority> PriorityFromObservers() + const { + return std::make_pair(ResourcePriority(), ResourcePriority()); } // If this Resource is already finished when AddClient is called, the @@ -481,10 +477,6 @@ ResourceType, const ResourceLoaderOptions&); - virtual std::pair<ResourcePriority, ResourcePriority> - ComputePriorityFromObservers() { - return std::make_pair(ResourcePriority(), ResourcePriority()); - } virtual void NotifyDataReceived(base::span<const char> data); virtual void NotifyFinished(); @@ -612,8 +604,6 @@ ResourceLoaderOptions options_; - ResourcePriority last_computed_priority_; - base::Time response_timestamp_; TaskHandle async_finish_pending_clients_task_;
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc index c46383cf..a3fb7fa 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc
@@ -370,12 +370,12 @@ HeapHashSet<WeakMember<Resource>>& resources) { Resource* result = nullptr; for (Resource* resource : resources) { - const ResourcePriority& priority = resource->LastComputedPriority(); + const ResourcePriority& priority = resource->PriorityFromObservers().first; if (priority.visibility != ResourcePriority::kVisible) { continue; } if (!result || CompareResourcePriorities( - priority, result->LastComputedPriority()) > 0) { + priority, result->PriorityFromObservers().first) > 0) { result = resource; } } @@ -2776,18 +2776,18 @@ } } -void ResourceFetcher::UpdateAllImageResourcePriorities() { - TRACE_EVENT0( - "blink", - "ResourceLoadPriorityOptimizer::updateAllImageResourcePriorities"); +void ResourceFetcher::UpdateImagePrioritiesAndSpeculativeDecodes() { + TRACE_EVENT0("blink", + "ResourceLoadPriorityOptimizer::" + "UpdateImagePrioritiesAndSpeculativeDecodes"); - // Force all images to update their LastComputedPriority. + // Update ResourcePriority for all resources. for (Resource* resource : speculative_decode_candidate_images_) { - resource->PriorityFromObservers(); + resource->UpdateResourceInfoFromObservers(); } speculative_decode_candidate_images_.erase_if( [](const WeakMember<Resource>& resource) -> bool { - return resource->LastComputedPriority().visibility == + return resource->PriorityFromObservers().first.visibility == ResourcePriority::kNotVisible; }); MaybeStartSpeculativeImageDecode(); @@ -2803,6 +2803,7 @@ continue; } + resource->UpdateResourceInfoFromObservers(); auto priorities = resource->PriorityFromObservers(); ResourcePriority resource_priority = priorities.first; ResourceLoadPriority computed_load_priority = ComputeLoadPriority(
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h index 2bc9bd60..9b658a3f 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h
@@ -300,7 +300,7 @@ static network::mojom::RequestDestination DetermineRequestDestination( ResourceType); - void UpdateAllImageResourcePriorities(); + void UpdateImagePrioritiesAndSpeculativeDecodes(); // Returns whether the given resource is contained as a preloaded resource. bool ContainsAsPreload(Resource*) const;
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index ffdb083b1..f8521a8 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -8897,3 +8897,6 @@ # Gardener 2024-12-20 crbug.com/379003901 [ Mac11 ] virtual/gpu-rasterization/external/wpt/css/css-images/object-view-box-fit-cover-video.html [ Failure Pass ] + +# Gardener 2024-12-23 +crbug.com/385571958 virtual/gpu-rasterization/external/wpt/css/css-images/object-view-box-fit-none-video.html [ Failure Pass ]
diff --git a/third_party/blink/web_tests/TestLists/headless_shell.filter b/third_party/blink/web_tests/TestLists/headless_shell.filter index 11679e48..e0c205a3 100644 --- a/third_party/blink/web_tests/TestLists/headless_shell.filter +++ b/third_party/blink/web_tests/TestLists/headless_shell.filter
@@ -178,8 +178,6 @@ -external/wpt/css/css-backgrounds/css3-border-image-repeat-repeat.html -external/wpt/css/css-backgrounds/table-cell-background-local-003.html -external/wpt/css/css-borders/border-radius-greater-than-width.html -# Known to be very flaky: https://crbug.com/377818367 --external/wpt/css/css-break/* -external/wpt/css/css-color/color-mix-basic-001.html -external/wpt/css/css-color/composited-filters-under-opacity.html -external/wpt/css/css-color/deprecated-sameas-010.html @@ -289,34 +287,7 @@ -external/wpt/css/css-highlight-api/painting/custom-highlight-painting-vertical-writing-mode-001.html -external/wpt/css/css-inline/baseline-source/baseline-source-first-textarea-002.tentative.html -external/wpt/css/css-inline/baseline-source/baseline-source-last-textarea-002.tentative.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-drop-over-ruby.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-drop-over-ruby-tall.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-drop-under-ruby.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-drop-under-ruby-tall.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-margins.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-margins-rtl.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-margins-srl.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-margins-vlr.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-margins-vrl.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-raise-over-ruby.html --external/wpt/css/css-inline/initial-letter/initial-letter-block-position-raise-over-ruby-tall.html --external/wpt/css/css-inline/initial-letter/Initial-letter-breaking.html --external/wpt/css/css-inline/initial-letter/Initial-letter-breaking-rtl.html --external/wpt/css/css-inline/initial-letter/initial-letter-breaking-slr.html --external/wpt/css/css-inline/initial-letter/initial-letter-breaking-srl.html --external/wpt/css/css-inline/initial-letter/Initial-letter-breaking-vlr.html --external/wpt/css/css-inline/initial-letter/Initial-letter-breaking-vrl.html --external/wpt/css/css-inline/initial-letter/initial-letter-drop-initial.html --external/wpt/css/css-inline/initial-letter/initial-letter-drop-initial-rtl.html --external/wpt/css/css-inline/initial-letter/initial-letter-drop-initial-slr.html --external/wpt/css/css-inline/initial-letter/initial-letter-float-001-srl.html --external/wpt/css/css-inline/initial-letter/initial-letter-float-002.html --external/wpt/css/css-inline/initial-letter/initial-letter-raise-initial-srl.html --external/wpt/css/css-inline/initial-letter/initial-letter-raise-initial-vrl.html --external/wpt/css/css-inline/initial-letter/initial-letter-short-para-initial-letter-clears.html --external/wpt/css/css-inline/initial-letter/initial-letter-sunk-initial-slr.html --external/wpt/css/css-inline/initial-letter/initial-letter-sunk-initial-srl.html --external/wpt/css/css-inline/initial-letter/initial-letter-sunk-initial.html?class= +-external/wpt/css/css-inline/initial-letter/* -external/wpt/css/css-layout-api/baseline/orthogonal-baseline.https.html -external/wpt/css/css-layout-api/fallback-intrinsic-sizes/constructor-error.https.html -external/wpt/css/css-layout-api/fallback-layout/constructor-error.https.html @@ -535,14 +506,11 @@ -external/wpt/css/css-transitions/starting-style-rule-basic.html -external/wpt/css/css-transitions/starting-style-rule-none.html -external/wpt/css/css-transitions/transition-behavior.html --external/wpt/css/css-ui/appearance-* --external/wpt/css/css-ui/compute-kind-widget-* --external/wpt/css/css-ui/outline-* --external/wpt/css/css-ui/resize-child-will-change-transform.html +-external/wpt/css/css-ui/compute-kind-widget-no-fallback-props-001.html +-external/wpt/css/css-ui/outline-020.html -external/wpt/css/css-ui/text-overflow-027.html -external/wpt/css/css-ui/text-overflow-028.html -external/wpt/css/css-ui/text-overflow-029.html --external/wpt/css/css-ui/webkit-appearance-* -external/wpt/css/css-variables/variable-presentation-attribute.html -external/wpt/css/css-will-change/will-change-fixedpos-cb-* -external/wpt/css/css-will-change/will-change-transform-zero-size-child-overflow-visible.html
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/issues/renderer-cors-issues-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/issues/renderer-cors-issues-expected.txt index 58185cf8..e16a846 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/issues/renderer-cors-issues-expected.txt +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/issues/renderer-cors-issues-expected.txt
@@ -16,7 +16,6 @@ url : } request : { - requestId : <string> url : file://doesnt.matter/ } } @@ -41,7 +40,6 @@ url : } request : { - requestId : <string> url : https://devtools-b.oopif.test:8443/index.html } } @@ -66,7 +64,6 @@ url : } request : { - requestId : <string> url : https://devtools-b.oopif.test:8443/index.html } }
diff --git a/third_party/closure_compiler/externs/accessibility_private.js b/third_party/closure_compiler/externs/accessibility_private.js index 21cb4f59..1965caae 100644 --- a/third_party/closure_compiler/externs/accessibility_private.js +++ b/third_party/closure_compiler/externs/accessibility_private.js
@@ -207,8 +207,7 @@ * x: number, * y: number, * touchAccessibility: (boolean|undefined), - * mouseButton: - * (!chrome.accessibilityPrivate.SyntheticMouseEventButton|undefined), + * mouseButton: (!chrome.accessibilityPrivate.SyntheticMouseEventButton|undefined), * isDoubleClick: (boolean|undefined), * isTripleClick: (boolean|undefined), * useRewriters: (boolean|undefined), @@ -649,13 +648,6 @@ chrome.accessibilityPrivate.setSelectToSpeakState = function(state) {}; /** - * Called by the Select-to-Speak extension to request a clipboard copy in the - * active Lacros Google Docs tab for the copy-paste fallback. - * @param {string} url URL of the Google Docs tab. - */ -chrome.accessibilityPrivate.clipboardCopyInActiveLacrosGoogleDoc = function(url) {}; - -/** * Called by the Accessibility Common extension when * onScrollableBoundsForPointRequested has found a scrolling container. |rect| * will be the bounds of the nearest scrollable ancestor of the node at the @@ -788,13 +780,6 @@ chrome.accessibilityPrivate.getDisplayBounds = function(callback) {}; /** - * Gets whether new browser windows and tabs should be in Lacros browser. - * @param {function(boolean): void} callback A callback that is run when the - * result is returned. - */ -chrome.accessibilityPrivate.isLacrosPrimary = function(callback) {}; - -/** * Displays an accessibility-related toast. * @param {!chrome.accessibilityPrivate.ToastType} type The type of toast to * show.
diff --git a/third_party/cros-components/src b/third_party/cros-components/src index a155e2d0..59dd6e3 160000 --- a/third_party/cros-components/src +++ b/third_party/cros-components/src
@@ -1 +1 @@ -Subproject commit a155e2d0d2827dcbcbbe2751d98851f75705585e +Subproject commit 59dd6e3d06e111c6a3d323a92e6478b9bbf15915
diff --git a/third_party/dawn b/third_party/dawn index 63466f6..07d1526 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit 63466f66842cd912b81dbc7c496f76d96794a877 +Subproject commit 07d1526700e024fd5826ddbab7f79e0c49e7707d
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index c7ac387..4b49fee 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit c7ac38777ac61afd51fcf85ca72a659d660908a8 +Subproject commit 4b49feedc865853b923b36a7efde5605aaa2d065
diff --git a/third_party/eigen3/src b/third_party/eigen3/src index a32db43..24e0c2a1 160000 --- a/third_party/eigen3/src +++ b/third_party/eigen3/src
@@ -1 +1 @@ -Subproject commit a32db4396635c706d9e862824bdf4e0ec0c3b257 +Subproject commit 24e0c2a125d2b37b35719124d1f758777c150ca8
diff --git a/third_party/googletest/src b/third_party/googletest/src index f3c355f..e54519b 160000 --- a/third_party/googletest/src +++ b/third_party/googletest/src
@@ -1 +1 @@ -Subproject commit f3c355f9dd382bc2c323be2713e351a578b68c61 +Subproject commit e54519b09463cec3aea77a1739e02c97ca766da5
diff --git a/third_party/openscreen/src b/third_party/openscreen/src index c5c06e0..abbaa2e 160000 --- a/third_party/openscreen/src +++ b/third_party/openscreen/src
@@ -1 +1 @@ -Subproject commit c5c06e0cd66bd3f1ecc1c99fea31004c89f131de +Subproject commit abbaa2e7439e91d6a38014302d31feeca66f4193
diff --git a/third_party/rust/anyhow/v1/BUILD.gn b/third_party/rust/anyhow/v1/BUILD.gn index 49b9281a..32bbd3f 100644 --- a/third_party/rust/anyhow/v1/BUILD.gn +++ b/third_party/rust/anyhow/v1/BUILD.gn
@@ -13,25 +13,25 @@ epoch = "1" crate_type = "rlib" crate_root = - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/lib.rs" + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/backtrace.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/chain.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/context.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/ensure.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/error.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/fmt.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/kind.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/macros.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/ptr.rs", - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/wrapper.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/backtrace.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/chain.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/context.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/ensure.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/error.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/fmt.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/kind.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/macros.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/ptr.rs", + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/wrapper.rs", ] inputs = [] build_native_rust_unit_tests = false edition = "2018" - cargo_pkg_version = "1.0.94" + cargo_pkg_version = "1.0.95" cargo_pkg_authors = "David Tolnay <dtolnay@gmail.com>" cargo_pkg_name = "anyhow" cargo_pkg_description = @@ -44,9 +44,9 @@ proc_macro_configs += [ "//build/config/compiler:no_chromium_code" ] features = [ "std" ] build_root = - "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/build.rs" + "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/build.rs" build_sources = - [ "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/build.rs" ] + [ "//third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/build.rs" ] rustflags = [ "--cap-lints=allow", # Suppress all warnings in crates.io crates ]
diff --git a/third_party/rust/anyhow/v1/README.chromium b/third_party/rust/anyhow/v1/README.chromium index 50da0b72..1a2cefc 100644 --- a/third_party/rust/anyhow/v1/README.chromium +++ b/third_party/rust/anyhow/v1/README.chromium
@@ -1,9 +1,9 @@ Name: anyhow URL: https://crates.io/crates/anyhow -Version: 1.0.94 -Revision: 8ceb5e988fcae18270745e291efb8bd716c25bf0 +Version: 1.0.95 +Revision: 48be1caa24fa65467aaa8071eb698542e4fa1d43 License: Apache-2.0 -License File: //third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/LICENSE-APACHE +License File: //third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/LICENSE-APACHE Shipped: no Security Critical: no
diff --git a/third_party/rust/bytemuck/v1/BUILD.gn b/third_party/rust/bytemuck/v1/BUILD.gn index 3bd0f21b..edbd613 100644 --- a/third_party/rust/bytemuck/v1/BUILD.gn +++ b/third_party/rust/bytemuck/v1/BUILD.gn
@@ -13,28 +13,28 @@ epoch = "1" crate_type = "rlib" crate_root = - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/lib.rs" + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/allocation.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/anybitpattern.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/checked.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/contiguous.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/internal.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/must.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/no_uninit.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/offset_of.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/pod.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/pod_in_option.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/transparent.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/zeroable.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/zeroable_in_option.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/allocation.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/anybitpattern.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/checked.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/contiguous.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/internal.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/must.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/no_uninit.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/offset_of.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/pod.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/pod_in_option.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/transparent.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/zeroable.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/zeroable_in_option.rs", ] inputs = [] build_native_rust_unit_tests = false edition = "2018" - cargo_pkg_version = "1.20.0" + cargo_pkg_version = "1.21.0" cargo_pkg_authors = "Lokathor <zefria@gmail.com>" cargo_pkg_name = "bytemuck" cargo_pkg_description = "A crate for mucking around with piles of bytes."
diff --git a/third_party/rust/bytemuck/v1/README.chromium b/third_party/rust/bytemuck/v1/README.chromium index 22f225933..a504b179 100644 --- a/third_party/rust/bytemuck/v1/README.chromium +++ b/third_party/rust/bytemuck/v1/README.chromium
@@ -1,9 +1,9 @@ Name: bytemuck URL: https://crates.io/crates/bytemuck -Version: 1.20.0 -Revision: 9bf993b1e487b1e7242aeb970e0d06fa7e4ae166 +Version: 1.21.0 +Revision: 621848fcf09ac42000e3b9c548f17f252c7e399c License: Apache-2.0 -License File: //third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/LICENSE-APACHE +License File: //third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/LICENSE-APACHE Shipped: yes Security Critical: yes
diff --git a/third_party/rust/bytemuck_derive/v1/BUILD.gn b/third_party/rust/bytemuck_derive/v1/BUILD.gn index 985a1c4..4650aca 100644 --- a/third_party/rust/bytemuck_derive/v1/BUILD.gn +++ b/third_party/rust/bytemuck_derive/v1/BUILD.gn
@@ -12,16 +12,16 @@ crate_name = "bytemuck_derive" epoch = "1" crate_type = "proc-macro" - crate_root = "//third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/src/lib.rs" + crate_root = "//third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/src/traits.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/src/traits.rs", ] inputs = [] build_native_rust_unit_tests = false edition = "2018" - cargo_pkg_version = "1.8.0" + cargo_pkg_version = "1.8.1" cargo_pkg_authors = "Lokathor <zefria@gmail.com>" cargo_pkg_name = "bytemuck_derive" cargo_pkg_description = "derive proc-macros for `bytemuck`"
diff --git a/third_party/rust/bytemuck_derive/v1/README.chromium b/third_party/rust/bytemuck_derive/v1/README.chromium index c353c353..8c04870e 100644 --- a/third_party/rust/bytemuck_derive/v1/README.chromium +++ b/third_party/rust/bytemuck_derive/v1/README.chromium
@@ -1,9 +1,9 @@ Name: bytemuck_derive URL: https://crates.io/crates/bytemuck_derive -Version: 1.8.0 -Revision: 48952a0246ffb54b8cdea1c6adc561ee430420a3 +Version: 1.8.1 +Revision: 45fbae7d8ddb8d75353588920c6fab16943e96bd License: Apache-2.0 -License File: //third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/LICENSE-APACHE +License File: //third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/LICENSE-APACHE Shipped: yes Security Critical: yes
diff --git a/third_party/rust/chromium_crates_io/Cargo.lock b/third_party/rust/chromium_crates_io/Cargo.lock index da0f229..0db92d32 100644 --- a/third_party/rust/chromium_crates_io/Cargo.lock +++ b/third_party/rust/chromium_crates_io/Cargo.lock
@@ -22,7 +22,7 @@ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -51,7 +51,7 @@ [[package]] name = "bytemuck" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytemuck_derive", @@ -59,7 +59,7 @@ [[package]] name = "bytemuck_derive" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2", @@ -79,7 +79,7 @@ [[package]] name = "cc" -version = "1.2.4" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "shlex", @@ -250,7 +250,7 @@ [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -311,7 +311,7 @@ [[package]] name = "libc" -version = "0.2.168" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -357,7 +357,7 @@ [[package]] name = "png" -version = "0.17.15" +version = "0.17.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.3.2", @@ -583,7 +583,7 @@ [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa", @@ -656,7 +656,7 @@ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2", @@ -674,7 +674,7 @@ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]]
diff --git a/third_party/rust/chromium_crates_io/supply-chain/audits.toml b/third_party/rust/chromium_crates_io/supply-chain/audits.toml index 5d0c3fec..31aaf1eeb 100644 --- a/third_party/rust/chromium_crates_io/supply-chain/audits.toml +++ b/third_party/rust/chromium_crates_io/supply-chain/audits.toml
@@ -223,6 +223,11 @@ delta = "1.0.93 -> 1.0.94" notes = "No behavioral changes" +[[audits.anyhow]] +who = "Adrian Taylor <adetaylor@chromium.org>" +criteria = ["safe-to-run", "does-not-implement-crypto"] +delta = "1.0.94 -> 1.0.95" + [[audits.autocfg]] who = "Lukasz Anforowicz <lukasza@chromium.org>" criteria = ["ub-risk-0", "safe-to-deploy", "does-not-implement-crypto"] @@ -418,6 +423,12 @@ delta = "1.19.0 -> 1.20.0" notes = "`unsafe` review can be found at https://crrev.com/c/6096767" +[[audits.bytemuck]] +who = "Adrian Taylor <adetaylor@chromium.org>" +criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] +delta = "1.20.0 -> 1.21.0" +notes = "Unsafe review at https://chromium-review.googlesource.com/c/chromium/src/+/6111154/" + [[audits.bytemuck_derive]] who = "Lukasz Anforowicz <lukasza@chromium.org>" criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] @@ -464,6 +475,12 @@ delta = "1.7.1 -> 1.8.0" notes = "Unsafe review: https://crrev.com/c/5921014" +[[audits.bytemuck_derive]] +who = "Adrian Taylor <adetaylor@chromium.org>" +criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] +delta = "1.8.0 -> 1.8.1" +notes = "Changes do not impact safety." + [[audits.byteorder]] who = "danakj <danakj@chromium.org>" criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] @@ -1246,6 +1263,12 @@ \"Foldhash is **not appropriate for any cryptographic purpose**.\" """ +[[audits.foldhash]] +who = "Adrian Taylor <adetaylor@chromium.org>" +criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] +delta = "0.1.3 -> 0.1.4" +notes = "No changes to safety-relevant code" + [[audits.font-types]] who = "Lukasz Anforowicz <lukasza@chromium.org>" criteria = ["ub-risk-0", "safe-to-deploy", "does-not-implement-crypto"] @@ -1554,6 +1577,11 @@ criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-0"] delta = "0.17.14 -> 0.17.15" +[[audits.png]] +who = "Adrian Taylor <adetaylor@chromium.org>" +criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-0"] +delta = "0.17.15 -> 0.17.16" + [[audits.ppv-lite86]] who = "danakj@chromium.org" criteria = ["safe-to-run", "does-not-implement-crypto"] @@ -2425,6 +2453,11 @@ delta = "1.0.132 -> 1.0.133" notes = "No changes affecting safety-to-run and still no crypto" +[[audits.serde_json]] +who = "Adrian Taylor <adetaylor@chromium.org>" +criteria = ["safe-to-run", "does-not-implement-crypto"] +delta = "1.0.133 -> 1.0.134" + [[audits.serde_json_lenient]] who = "danakj@chromium.org" criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] @@ -2697,6 +2730,11 @@ criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-0"] delta = "1.7.0 -> 1.8.0" +[[audits.tinyvec]] +who = "Adrian Taylor <adetaylor@chromium.org>" +criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-0"] +delta = "1.8.0 -> 1.8.1" + [[audits.unicode-ident]] who = "Lukasz Anforowicz <lukasza@chromium.org>" criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"]
diff --git a/third_party/rust/chromium_crates_io/supply-chain/config.toml b/third_party/rust/chromium_crates_io/supply-chain/config.toml index 17582d5..2d8f7e2 100644 --- a/third_party/rust/chromium_crates_io/supply-chain/config.toml +++ b/third_party/rust/chromium_crates_io/supply-chain/config.toml
@@ -50,7 +50,7 @@ [policy."anstyle:1.0.10"] criteria = ["crypto-safe", "safe-to-run"] -[policy."anyhow:1.0.94"] +[policy."anyhow:1.0.95"] criteria = ["crypto-safe", "safe-to-run"] [policy."base64:0.13.1"] @@ -65,10 +65,10 @@ [policy."bstr:1.11.1"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] -[policy."bytemuck:1.20.0"] +[policy."bytemuck:1.21.0"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] -[policy."bytemuck_derive:1.8.0"] +[policy."bytemuck_derive:1.8.1"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] [policy."byteorder:1.5.0"] @@ -77,7 +77,7 @@ [policy."bytes:1.9.0"] criteria = ["crypto-safe", "safe-to-run"] -[policy."cc:1.2.4"] +[policy."cc:1.2.5"] criteria = [] [policy."cfg-if:1.0.0"] @@ -122,7 +122,7 @@ [policy."flate2:1.0.35"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] -[policy."foldhash:0.1.3"] +[policy."foldhash:0.1.4"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] [policy."font-types:0.7.3"] @@ -152,7 +152,7 @@ [policy."lazy_static:1.5.0"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] -[policy."libc:0.2.168"] +[policy."libc:0.2.169"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] [policy."link-cplusplus:1.0.9"] @@ -173,7 +173,7 @@ [policy."nom:7.1.3"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] -[policy."png:0.17.15"] +[policy."png:0.17.16"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] [policy."ppv-lite86:0.2.20"] @@ -254,7 +254,7 @@ [policy."serde_derive:1.0.216"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] -[policy."serde_json:1.0.133"] +[policy."serde_json:1.0.134"] criteria = ["crypto-safe", "safe-to-run"] [policy."serde_json_lenient:0.2.4"] @@ -284,13 +284,13 @@ [policy."strum_macros:0.25.3"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] -[policy."syn:2.0.90"] +[policy."syn:2.0.91"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] [policy."termcolor:1.4.1"] criteria = ["crypto-safe", "safe-to-run"] -[policy."tinyvec:1.8.0"] +[policy."tinyvec:1.8.1"] criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"] [policy."unicode-ident:1.0.14"] @@ -434,7 +434,7 @@ """ [[exemptions.syn]] -version = "2.0.90" +version = "2.0.91" criteria = ["safe-to-deploy", "crypto-safe", "ub-risk-2"] notes = """ Grandparented-in when setting up `cargo vet` in Jan 2024 @@ -464,6 +464,7 @@ Exemption updated to 2.0.85 when updating the crate in October 2024. Exemption updated to 2.0.87 when updating the crate in November 2024. Exemption updated to 2.0.90 when updating the crate in November 2024. +Exemption updated to 2.0.91 when updating the crate in December 2024. """ [[exemptions.zerocopy]]
diff --git a/third_party/rust/chromium_crates_io/supply-chain/imports.lock b/third_party/rust/chromium_crates_io/supply-chain/imports.lock index 8ebb54a2..815ca9b6 100644 --- a/third_party/rust/chromium_crates_io/supply-chain/imports.lock +++ b/third_party/rust/chromium_crates_io/supply-chain/imports.lock
@@ -7,6 +7,12 @@ user-id = 55123 user-login = "rust-lang-owner" +[[publisher.libc]] +version = "0.2.169" +when = "2024-12-19" +user-id = 55123 +user-login = "rust-lang-owner" + [[publisher.windows-sys]] version = "0.52.0" when = "2023-11-15"
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.cargo_vcs_info.json deleted file mode 100644 index dce90622..0000000 --- a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "8ceb5e988fcae18270745e291efb8bd716c25bf0" - }, - "path_in_vcs": "" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.cargo_vcs_info.json new file mode 100644 index 0000000..d02f3a39 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "48be1caa24fa65467aaa8071eb698542e4fa1d43" + }, + "path_in_vcs": "" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.github/FUNDING.yml b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.github/FUNDING.yml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.github/FUNDING.yml rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.github/FUNDING.yml
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.github/workflows/ci.yml b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.github/workflows/ci.yml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.github/workflows/ci.yml rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.github/workflows/ci.yml
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.gitignore b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.gitignore similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/.gitignore rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/.gitignore
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/Cargo.lock b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/Cargo.lock similarity index 87% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/Cargo.lock rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/Cargo.lock index 4b02b106..b6a4a65 100644 --- a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/Cargo.lock +++ b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/Cargo.lock
@@ -15,13 +15,13 @@ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" dependencies = [ "backtrace 0.3.74 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.31 (registry+https://github.com/rust-lang/crates.io-index)", "rustversion 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 2.0.90 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 2.0.91 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "trybuild 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -32,9 +32,9 @@ dependencies = [ "addr2line 0.24.2 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.167 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "object 0.36.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.169 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "object 0.36.7 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "windows-targets 0.52.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -139,7 +139,7 @@ [[package]] name = "libc" -version = "0.2.167" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -149,7 +149,7 @@ [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "adler2 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -157,7 +157,7 @@ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.7.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -206,31 +206,31 @@ [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 2.0.90 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 2.0.91 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.7.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -238,12 +238,12 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syn" -version = "2.0.90" +version = "2.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", @@ -266,20 +266,20 @@ [[package]] name = "thiserror" -version = "2.0.4" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "thiserror-impl 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror-impl 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "thiserror-impl" -version = "2.0.4" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 2.0.90 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 2.0.91 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -287,7 +287,7 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)", "serde_spanned 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "toml_datetime 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "toml_edit 0.22.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -298,7 +298,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -307,7 +307,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "indexmap 2.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)", "serde_spanned 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "toml_datetime 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "winnow 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -320,9 +320,9 @@ dependencies = [ "dissimilar 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.133 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.134 (registry+https://github.com/rust-lang/crates.io-index)", "target-triple 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", @@ -431,10 +431,10 @@ "checksum hashbrown 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" "checksum indexmap 2.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" "checksum itoa 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" -"checksum libc 0.2.167 (registry+https://github.com/rust-lang/crates.io-index)" = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +"checksum libc 0.2.169 (registry+https://github.com/rust-lang/crates.io-index)" = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" "checksum memchr 2.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -"checksum miniz_oxide 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -"checksum object 0.36.5 (registry+https://github.com/rust-lang/crates.io-index)" = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +"checksum miniz_oxide 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +"checksum object 0.36.7 (registry+https://github.com/rust-lang/crates.io-index)" = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" "checksum pin-project-lite 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" "checksum pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" "checksum proc-macro2 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)" = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" @@ -442,15 +442,15 @@ "checksum rustc-demangle 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" "checksum rustversion 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" "checksum ryu 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -"checksum serde 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)" = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" -"checksum serde_derive 1.0.215 (registry+https://github.com/rust-lang/crates.io-index)" = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" -"checksum serde_json 1.0.133 (registry+https://github.com/rust-lang/crates.io-index)" = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +"checksum serde 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)" = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +"checksum serde_derive 1.0.216 (registry+https://github.com/rust-lang/crates.io-index)" = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +"checksum serde_json 1.0.134 (registry+https://github.com/rust-lang/crates.io-index)" = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" "checksum serde_spanned 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -"checksum syn 2.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +"checksum syn 2.0.91 (registry+https://github.com/rust-lang/crates.io-index)" = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" "checksum target-triple 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" "checksum termcolor 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -"checksum thiserror 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" -"checksum thiserror-impl 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +"checksum thiserror 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +"checksum thiserror-impl 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" "checksum toml 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" "checksum toml_datetime 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" "checksum toml_edit 0.22.22 (registry+https://github.com/rust-lang/crates.io-index)" = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5"
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/Cargo.toml similarity index 98% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/Cargo.toml index 6c5516d..119adf4e 100644 --- a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/Cargo.toml
@@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.39" name = "anyhow" -version = "1.0.94" +version = "1.0.95" authors = ["David Tolnay <dtolnay@gmail.com>"] build = "build.rs" autolib = false @@ -39,6 +39,10 @@ rustdoc-args = ["--generate-link-to-definition"] targets = ["x86_64-unknown-linux-gnu"] +[features] +default = ["std"] +std = [] + [lib] name = "anyhow" path = "src/lib.rs" @@ -121,7 +125,3 @@ [dev-dependencies.trybuild] version = "1.0.66" features = ["diff"] - -[features] -default = ["std"] -std = []
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/Cargo.toml.orig similarity index 98% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/Cargo.toml.orig index 4b2c7ca..0a4eb72 100644 --- a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/Cargo.toml.orig
@@ -1,6 +1,6 @@ [package] name = "anyhow" -version = "1.0.94" +version = "1.0.95" authors = ["David Tolnay <dtolnay@gmail.com>"] categories = ["rust-patterns", "no-std"] description = "Flexible concrete Error type built on std::error::Error"
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/LICENSE-APACHE b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/LICENSE-APACHE similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/LICENSE-APACHE rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/LICENSE-APACHE
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/LICENSE-MIT b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/LICENSE-MIT similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/LICENSE-MIT rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/LICENSE-MIT
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/README.md b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/README.md rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/build.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/build.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/build.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/build.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/build/probe.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/build/probe.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/build/probe.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/build/probe.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/rust-toolchain.toml b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/rust-toolchain.toml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/rust-toolchain.toml rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/rust-toolchain.toml
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/backtrace.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/backtrace.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/backtrace.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/backtrace.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/chain.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/chain.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/chain.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/chain.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/context.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/context.rs similarity index 94% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/context.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/context.rs index b52f682..326c2a4 100644 --- a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/context.rs +++ b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/context.rs
@@ -25,7 +25,7 @@ C: Display + Send + Sync + 'static, { let backtrace = backtrace_if_absent!(&self); - Error::from_context(context, self, backtrace) + Error::construct_from_context(context, self, backtrace) } } @@ -96,7 +96,7 @@ // backtrace. match self { Some(ok) => Ok(ok), - None => Err(Error::from_display(context, backtrace!())), + None => Err(Error::construct_from_display(context, backtrace!())), } } @@ -107,7 +107,7 @@ { match self { Some(ok) => Ok(ok), - None => Err(Error::from_display(context(), backtrace!())), + None => Err(Error::construct_from_display(context(), backtrace!())), } } }
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/ensure.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/ensure.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/ensure.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/ensure.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/error.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/error.rs similarity index 92% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/error.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/error.rs index a83eb7ee..cd1f5f58 100644 --- a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/error.rs +++ b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/error.rs
@@ -36,7 +36,7 @@ E: StdError + Send + Sync + 'static, { let backtrace = backtrace_if_absent!(&error); - Error::from_std(error, backtrace) + Error::construct_from_std(error, backtrace) } /// Create a new error object from a printable error message. @@ -82,12 +82,73 @@ where M: Display + Debug + Send + Sync + 'static, { - Error::from_adhoc(message, backtrace!()) + Error::construct_from_adhoc(message, backtrace!()) + } + + /// Construct an error object from a type-erased standard library error. + /// + /// This is mostly useful for interop with other error libraries. + /// + /// # Example + /// + /// Here is a skeleton of a library that provides its own error abstraction. + /// The pair of `From` impls provide bidirectional support for `?` + /// conversion between `Report` and `anyhow::Error`. + /// + /// ``` + /// use std::error::Error as StdError; + /// + /// pub struct Report {/* ... */} + /// + /// impl<E> From<E> for Report + /// where + /// E: Into<anyhow::Error>, + /// Result<(), E>: anyhow::Context<(), E>, + /// { + /// fn from(error: E) -> Self { + /// let anyhow_error: anyhow::Error = error.into(); + /// let boxed_error: Box<dyn StdError + Send + Sync + 'static> = anyhow_error.into(); + /// Report::from_boxed(boxed_error) + /// } + /// } + /// + /// impl From<Report> for anyhow::Error { + /// fn from(report: Report) -> Self { + /// let boxed_error: Box<dyn StdError + Send + Sync + 'static> = report.into_boxed(); + /// anyhow::Error::from_boxed(boxed_error) + /// } + /// } + /// + /// impl Report { + /// fn from_boxed(boxed_error: Box<dyn StdError + Send + Sync + 'static>) -> Self { + /// todo!() + /// } + /// fn into_boxed(self) -> Box<dyn StdError + Send + Sync + 'static> { + /// todo!() + /// } + /// } + /// + /// // Example usage: can use `?` in both directions. + /// fn a() -> anyhow::Result<()> { + /// b()?; + /// Ok(()) + /// } + /// fn b() -> Result<(), Report> { + /// a()?; + /// Ok(()) + /// } + /// ``` + #[cfg(any(feature = "std", not(anyhow_no_core_error)))] + #[cold] + #[must_use] + pub fn from_boxed(boxed_error: Box<dyn StdError + Send + Sync + 'static>) -> Self { + let backtrace = backtrace_if_absent!(&*boxed_error); + Error::construct_from_boxed(boxed_error, backtrace) } #[cfg(any(feature = "std", not(anyhow_no_core_error)))] #[cold] - pub(crate) fn from_std<E>(error: E, backtrace: Option<Backtrace>) -> Self + pub(crate) fn construct_from_std<E>(error: E, backtrace: Option<Backtrace>) -> Self where E: StdError + Send + Sync + 'static, { @@ -113,7 +174,7 @@ } #[cold] - pub(crate) fn from_adhoc<M>(message: M, backtrace: Option<Backtrace>) -> Self + pub(crate) fn construct_from_adhoc<M>(message: M, backtrace: Option<Backtrace>) -> Self where M: Display + Debug + Send + Sync + 'static, { @@ -142,7 +203,7 @@ } #[cold] - pub(crate) fn from_display<M>(message: M, backtrace: Option<Backtrace>) -> Self + pub(crate) fn construct_from_display<M>(message: M, backtrace: Option<Backtrace>) -> Self where M: Display + Send + Sync + 'static, { @@ -172,7 +233,11 @@ #[cfg(any(feature = "std", not(anyhow_no_core_error)))] #[cold] - pub(crate) fn from_context<C, E>(context: C, error: E, backtrace: Option<Backtrace>) -> Self + pub(crate) fn construct_from_context<C, E>( + context: C, + error: E, + backtrace: Option<Backtrace>, + ) -> Self where C: Display + Send + Sync + 'static, E: StdError + Send + Sync + 'static, @@ -202,7 +267,7 @@ #[cfg(any(feature = "std", not(anyhow_no_core_error)))] #[cold] - pub(crate) fn from_boxed( + pub(crate) fn construct_from_boxed( error: Box<dyn StdError + Send + Sync>, backtrace: Option<Backtrace>, ) -> Self { @@ -562,7 +627,7 @@ #[cold] fn from(error: E) -> Self { let backtrace = backtrace_if_absent!(&error); - Error::from_std(error, backtrace) + Error::construct_from_std(error, backtrace) } }
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/fmt.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/fmt.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/fmt.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/fmt.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/kind.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/kind.rs similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/kind.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/kind.rs index 042af32..a9f40c3 100644 --- a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/kind.rs +++ b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/kind.rs
@@ -70,7 +70,7 @@ where M: Display + Debug + Send + Sync + 'static, { - Error::from_adhoc(message, backtrace!()) + Error::construct_from_adhoc(message, backtrace!()) } } @@ -116,6 +116,6 @@ #[cold] pub fn new(self, error: Box<dyn StdError + Send + Sync>) -> Error { let backtrace = backtrace_if_absent!(&*error); - Error::from_boxed(error, backtrace) + Error::construct_from_boxed(error, backtrace) } }
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/lib.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/lib.rs index d3d0767..947ed20 100644 --- a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/lib.rs +++ b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/lib.rs
@@ -206,7 +206,7 @@ //! function that returns Anyhow's error type, as the trait that `?`-based error //! conversions are defined by is only available in std in those old versions. -#![doc(html_root_url = "https://docs.rs/anyhow/1.0.94")] +#![doc(html_root_url = "https://docs.rs/anyhow/1.0.95")] #![cfg_attr(error_generic_member_access, feature(error_generic_member_access))] #![no_std] #![deny(dead_code, unused_imports, unused_mut)]
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/macros.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/macros.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/macros.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/macros.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/ptr.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/ptr.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/ptr.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/ptr.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/wrapper.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/wrapper.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/src/wrapper.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/src/wrapper.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/common/mod.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/common/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/common/mod.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/common/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/compiletest.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/compiletest.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/compiletest.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/compiletest.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/drop/mod.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/drop/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/drop/mod.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/drop/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_autotrait.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_autotrait.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_autotrait.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_autotrait.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_backtrace.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_backtrace.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_backtrace.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_backtrace.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_boxed.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_boxed.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_boxed.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_boxed.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_chain.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_chain.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_chain.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_chain.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_context.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_context.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_context.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_context.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_convert.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_convert.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_convert.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_convert.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_downcast.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_downcast.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_downcast.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_downcast.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_ensure.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_ensure.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_ensure.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_ensure.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_ffi.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_ffi.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_ffi.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_ffi.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_fmt.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_fmt.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_fmt.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_fmt.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_macros.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_macros.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_macros.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_macros.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_repr.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_repr.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_repr.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_repr.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_source.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_source.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/test_source.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/test_source.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/chained-comparison.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/chained-comparison.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/chained-comparison.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/chained-comparison.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/chained-comparison.stderr b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/chained-comparison.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/chained-comparison.stderr rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/chained-comparison.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/empty-ensure.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/empty-ensure.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/empty-ensure.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/empty-ensure.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/empty-ensure.stderr b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/empty-ensure.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/empty-ensure.stderr rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/empty-ensure.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/ensure-nonbool.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/ensure-nonbool.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/ensure-nonbool.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/ensure-nonbool.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/ensure-nonbool.stderr b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/ensure-nonbool.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/ensure-nonbool.stderr rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/ensure-nonbool.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/must-use.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/must-use.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/must-use.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/must-use.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/must-use.stderr b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/must-use.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/must-use.stderr rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/must-use.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/no-impl.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/no-impl.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/no-impl.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/no-impl.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/no-impl.stderr b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/no-impl.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/no-impl.stderr rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/no-impl.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/temporary-value.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/temporary-value.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/temporary-value.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/temporary-value.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/temporary-value.stderr b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/temporary-value.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/temporary-value.stderr rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/temporary-value.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/wrong-interpolation.rs b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/wrong-interpolation.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/wrong-interpolation.rs rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/wrong-interpolation.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/wrong-interpolation.stderr b/third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/wrong-interpolation.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/anyhow-1.0.94/tests/ui/wrong-interpolation.stderr rename to third_party/rust/chromium_crates_io/vendor/anyhow-1.0.95/tests/ui/wrong-interpolation.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.cargo_vcs_info.json deleted file mode 100644 index 3544527..0000000 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "9bf993b1e487b1e7242aeb970e0d06fa7e4ae166" - }, - "path_in_vcs": "" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/must.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/must.rs deleted file mode 100644 index c937c0686..0000000 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/must.rs +++ /dev/null
@@ -1,206 +0,0 @@ -#![allow(clippy::module_name_repetitions)] -#![allow(clippy::let_unit_value)] -#![allow(clippy::let_underscore_untyped)] -#![allow(clippy::ptr_as_ptr)] - -use crate::{AnyBitPattern, NoUninit}; -use core::mem::{align_of, size_of}; - -struct Cast<A, B>((A, B)); -impl<A, B> Cast<A, B> { - const ASSERT_ALIGN_GREATER_THAN_EQUAL: () = - assert!(align_of::<A>() >= align_of::<B>()); - const ASSERT_SIZE_EQUAL: () = assert!(size_of::<A>() == size_of::<B>()); - const ASSERT_SIZE_MULTIPLE_OF_OR_INPUT_ZST: () = assert!( - (size_of::<A>() == 0) - || (size_of::<B>() != 0 && size_of::<A>() % size_of::<B>() == 0) - ); -} - -/// Cast `A` into `B` if infalliable, or fail to compile. -/// -/// Note that for this particular type of cast, alignment isn't a factor. The -/// input value is semantically copied into the function and then returned to a -/// new memory location which will have whatever the required alignment of the -/// output type is. -/// -/// ## Failure -/// -/// * If the types don't have the same size this fails to compile. -/// -/// ## Examples -/// ``` -/// // compiles: -/// let bytes: [u8; 2] = bytemuck::must_cast(12_u16); -/// ``` -/// ```compile_fail,E0080 -/// // fails to compile (size mismatch): -/// let bytes : [u8; 3] = bytemuck::must_cast(12_u16); -/// ``` -#[inline] -pub const fn must_cast<A: NoUninit, B: AnyBitPattern>(a: A) -> B { - let _ = Cast::<A, B>::ASSERT_SIZE_EQUAL; - unsafe { transmute!(A; B; a) } -} - -/// Convert `&A` into `&B` if infalliable, or fail to compile. -/// -/// ## Failure -/// -/// * If the target type has a greater alignment requirement. -/// * If the source type and target type aren't the same size. -/// -/// ## Examples -/// ``` -/// // compiles: -/// let bytes: &[u8; 2] = bytemuck::must_cast_ref(&12_u16); -/// ``` -/// ```compile_fail,E0080 -/// // fails to compile (size mismatch): -/// let bytes : &[u8; 3] = bytemuck::must_cast_ref(&12_u16); -/// ``` -/// ```compile_fail,E0080 -/// // fails to compile (alignment requirements increased): -/// let bytes : &u16 = bytemuck::must_cast_ref(&[1u8, 2u8]); -/// ``` -#[inline] -pub const fn must_cast_ref<A: NoUninit, B: AnyBitPattern>(a: &A) -> &B { - let _ = Cast::<A, B>::ASSERT_SIZE_EQUAL; - let _ = Cast::<A, B>::ASSERT_ALIGN_GREATER_THAN_EQUAL; - unsafe { &*(a as *const A as *const B) } -} - -/// Convert a `&mut A` into `&mut B` if infalliable, or fail to compile. -/// -/// As [`must_cast_ref`], but `mut`. -/// -/// ## Examples -/// ``` -/// let mut i = 12_u16; -/// // compiles: -/// let bytes: &mut [u8; 2] = bytemuck::must_cast_mut(&mut i); -/// ``` -/// ```compile_fail,E0080 -/// # let mut bytes: &mut [u8; 2] = &mut [1, 2]; -/// // fails to compile (alignment requirements increased): -/// let i : &mut u16 = bytemuck::must_cast_mut(bytes); -/// ``` -/// ```compile_fail,E0080 -/// # let mut i = 12_u16; -/// // fails to compile (size mismatch): -/// let bytes : &mut [u8; 3] = bytemuck::must_cast_mut(&mut i); -/// ``` -#[inline] -pub fn must_cast_mut< - A: NoUninit + AnyBitPattern, - B: NoUninit + AnyBitPattern, ->( - a: &mut A, -) -> &mut B { - let _ = Cast::<A, B>::ASSERT_SIZE_EQUAL; - let _ = Cast::<A, B>::ASSERT_ALIGN_GREATER_THAN_EQUAL; - unsafe { &mut *(a as *mut A as *mut B) } -} - -/// Convert `&[A]` into `&[B]` (possibly with a change in length) if -/// infalliable, or fail to compile. -/// -/// * `input.as_ptr() as usize == output.as_ptr() as usize` -/// * `input.len() * size_of::<A>() == output.len() * size_of::<B>()` -/// -/// ## Failure -/// -/// * If the target type has a greater alignment requirement. -/// * If the target element type doesn't evenly fit into the the current element -/// type (eg: 3 `u16` values is 1.5 `u32` values, so that's a failure). -/// * Similarly, you can't convert from a non-[ZST](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) -/// to a ZST (e.g. 3 `u8` values is not any number of `()` values). -/// -/// ## Examples -/// ``` -/// let indicies: &[u16] = &[1, 2, 3]; -/// // compiles: -/// let bytes: &[u8] = bytemuck::must_cast_slice(indicies); -/// ``` -/// ``` -/// let zsts: &[()] = &[(), (), ()]; -/// // compiles: -/// let bytes: &[u8] = bytemuck::must_cast_slice(zsts); -/// ``` -/// ```compile_fail,E0080 -/// # let bytes : &[u8] = &[1, 0, 2, 0, 3, 0]; -/// // fails to compile (bytes.len() might not be a multiple of 2): -/// let byte_pairs : &[[u8; 2]] = bytemuck::must_cast_slice(bytes); -/// ``` -/// ```compile_fail,E0080 -/// # let byte_pairs : &[[u8; 2]] = &[[1, 0], [2, 0], [3, 0]]; -/// // fails to compile (alignment requirements increased): -/// let indicies : &[u16] = bytemuck::must_cast_slice(byte_pairs); -/// ``` -/// ```compile_fail,E0080 -/// let bytes: &[u8] = &[]; -/// // fails to compile: (bytes.len() might not be 0) -/// let zsts: &[()] = bytemuck::must_cast_slice(bytes); -/// ``` -#[inline] -pub const fn must_cast_slice<A: NoUninit, B: AnyBitPattern>(a: &[A]) -> &[B] { - let _ = Cast::<A, B>::ASSERT_SIZE_MULTIPLE_OF_OR_INPUT_ZST; - let _ = Cast::<A, B>::ASSERT_ALIGN_GREATER_THAN_EQUAL; - let new_len = if size_of::<A>() == size_of::<B>() { - a.len() - } else { - a.len() * (size_of::<A>() / size_of::<B>()) - }; - unsafe { core::slice::from_raw_parts(a.as_ptr() as *const B, new_len) } -} - -/// Convert `&mut [A]` into `&mut [B]` (possibly with a change in length) if -/// infalliable, or fail to compile. -/// -/// As [`must_cast_slice`], but `&mut`. -/// -/// ## Examples -/// ``` -/// let mut indicies = [1, 2, 3]; -/// let indicies: &mut [u16] = &mut indicies; -/// // compiles: -/// let bytes: &mut [u8] = bytemuck::must_cast_slice_mut(indicies); -/// ``` -/// ``` -/// let zsts: &mut [()] = &mut [(), (), ()]; -/// // compiles: -/// let bytes: &mut [u8] = bytemuck::must_cast_slice_mut(zsts); -/// ``` -/// ```compile_fail,E0080 -/// # let mut bytes = [1, 0, 2, 0, 3, 0]; -/// # let bytes : &mut [u8] = &mut bytes[..]; -/// // fails to compile (bytes.len() might not be a multiple of 2): -/// let byte_pairs : &mut [[u8; 2]] = bytemuck::must_cast_slice_mut(bytes); -/// ``` -/// ```compile_fail,E0080 -/// # let mut byte_pairs = [[1, 0], [2, 0], [3, 0]]; -/// # let byte_pairs : &mut [[u8; 2]] = &mut byte_pairs[..]; -/// // fails to compile (alignment requirements increased): -/// let indicies : &mut [u16] = bytemuck::must_cast_slice_mut(byte_pairs); -/// ``` -/// ```compile_fail,E0080 -/// let bytes: &mut [u8] = &mut []; -/// // fails to compile: (bytes.len() might not be 0) -/// let zsts: &mut [()] = bytemuck::must_cast_slice_mut(bytes); -/// ``` -#[inline] -pub fn must_cast_slice_mut< - A: NoUninit + AnyBitPattern, - B: NoUninit + AnyBitPattern, ->( - a: &mut [A], -) -> &mut [B] { - let _ = Cast::<A, B>::ASSERT_SIZE_MULTIPLE_OF_OR_INPUT_ZST; - let _ = Cast::<A, B>::ASSERT_ALIGN_GREATER_THAN_EQUAL; - let new_len = if size_of::<A>() == size_of::<B>() { - a.len() - } else { - a.len() * (size_of::<A>() / size_of::<B>()) - }; - unsafe { core::slice::from_raw_parts_mut(a.as_mut_ptr() as *mut B, new_len) } -}
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.cargo/config.toml b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.cargo/config.toml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.cargo/config.toml rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.cargo/config.toml
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.cargo_vcs_info.json new file mode 100644 index 0000000..c3d9019 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "621848fcf09ac42000e3b9c548f17f252c7e399c" + }, + "path_in_vcs": "" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.github/FUNDING.yml b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.github/FUNDING.yml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.github/FUNDING.yml rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.github/FUNDING.yml
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.github/workflows/rust.yml b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.github/workflows/rust.yml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.github/workflows/rust.yml rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.github/workflows/rust.yml
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.gitignore b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.gitignore similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/.gitignore rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/.gitignore
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/Cargo.toml similarity index 94% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/Cargo.toml index 94bbf217..4f67c8d 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/Cargo.toml
@@ -12,7 +12,7 @@ [package] edition = "2018" name = "bytemuck" -version = "1.20.0" +version = "1.21.0" authors = ["Lokathor <zefria@gmail.com>"] build = false exclude = ["/pedantic.bat"] @@ -97,25 +97,30 @@ aarch64_simd = [] align_offset = [] alloc_uninit = [] +avx512_simd = [] const_zeroed = [] derive = ["bytemuck_derive"] extern_crate_alloc = [] extern_crate_std = ["extern_crate_alloc"] latest_stable_rust = [ "aarch64_simd", + "avx512_simd", "align_offset", "alloc_uninit", "const_zeroed", "derive", "min_const_generics", "must_cast", + "must_cast_extra", "track_caller", + "transparentwrapper_extra", "wasm_simd", "zeroable_atomics", "zeroable_maybe_uninit", ] min_const_generics = [] must_cast = [] +must_cast_extra = ["must_cast"] nightly_docs = [] nightly_float = [] nightly_portable_simd = []
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/Cargo.toml.orig similarity index 90% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/Cargo.toml.orig index 4e6c92a..0a0ac5bd 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/Cargo.toml.orig
@@ -1,7 +1,7 @@ [package] name = "bytemuck" description = "A crate for mucking around with piles of bytes." -version = "1.20.0" +version = "1.21.0" authors = ["Lokathor <zefria@gmail.com>"] repository = "https://github.com/Lokathor/bytemuck" readme = "README.md" @@ -37,8 +37,10 @@ wasm_simd = [] # MSRV 1.54.0: support wasm simd types aarch64_simd = [] # MSRV 1.59.0: support aarch64 simd types +avx512_simd = [] # MSRV 1.72.0: support avx512 simd types must_cast = [] # MSRV 1.64.0: support the `must` module. +must_cast_extra = ["must_cast"] # MSRV 1.83.0: support mutable references in const # Adds `TransparentWrapper` impls for stdlib types newer than bytemuck's base MSRV. # Current MSRV 1.74.0: `core::num::Saturating`. @@ -47,7 +49,8 @@ const_zeroed = [] # MSRV 1.75.0: support const `zeroed()` -alloc_uninit = [] # MSRV 1.82.0: support `zeroed_*rc*` +# MSRV 1.82.0: support `zeroed_*rc*` when combined with `extern_crate_alloc` +alloc_uninit = [] # Do not use if you can avoid it, because this is **unsound**!!!! unsound_ptr_pod_impl = [] @@ -62,13 +65,16 @@ latest_stable_rust = [ # Keep this list sorted. "aarch64_simd", + "avx512_simd", "align_offset", "alloc_uninit", "const_zeroed", "derive", "min_const_generics", "must_cast", + "must_cast_extra", "track_caller", + "transparentwrapper_extra", "wasm_simd", "zeroable_atomics", "zeroable_maybe_uninit",
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/LICENSE-APACHE b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/LICENSE-APACHE similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/LICENSE-APACHE rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/LICENSE-APACHE
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/LICENSE-MIT b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/LICENSE-MIT similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/LICENSE-MIT rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/LICENSE-MIT
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/LICENSE-ZLIB b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/LICENSE-ZLIB similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/LICENSE-ZLIB rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/LICENSE-ZLIB
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/README.md b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/README.md rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/changelog.md b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/changelog.md similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/changelog.md rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/changelog.md index 692c4be0..86c2925c 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/changelog.md +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/changelog.md
@@ -1,5 +1,14 @@ # `bytemuck` changelog +## 1.21 + +* Implement `Pod` and `Zeroable` for `core::arch::{x86, x86_64}::__m512`, `__m512d` and `__m512i` without nightly. + Requires Rust 1.72, and is gated through the `avx512_simd` cargo feature. +* Allow the use of `must_cast_mut` and `must_cast_slice_mut` in const contexts. + Requires Rust 1.83, and is gated through the `must_cast_extra` cargo feature. +* internal: introduced the `maybe_const_fn` macro that allows defining some function + to be const depending upon some `cfg` predicate. + ## 1.20 * New functions to allocate zeroed `Arc` and `Rc`. Requires Rust 1.82
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/rustfmt.toml b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/rustfmt.toml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/rustfmt.toml rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/rustfmt.toml
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/allocation.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/allocation.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/allocation.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/allocation.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/anybitpattern.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/anybitpattern.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/anybitpattern.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/anybitpattern.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/checked.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/checked.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/checked.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/checked.rs index 05e0137..5e89133b 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/checked.rs +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/checked.rs
@@ -438,7 +438,7 @@ /// Reads the slice into a `T` value. /// /// ## Panics -/// * This is like `try_pod_read_unaligned` but will panic on failure. +/// * This is like [`try_pod_read_unaligned`] but will panic on failure. #[inline] #[cfg_attr(feature = "track_caller", track_caller)] pub fn pod_read_unaligned<T: CheckedBitPattern>(bytes: &[u8]) -> T {
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/contiguous.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/contiguous.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/contiguous.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/contiguous.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/internal.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/internal.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/internal.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/internal.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/lib.rs similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/lib.rs index a3700d1..3ae485a 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/lib.rs +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/lib.rs
@@ -1,5 +1,6 @@ #![no_std] #![warn(missing_docs)] +#![allow(unused_mut)] #![allow(clippy::match_like_matches_macro)] #![allow(clippy::uninlined_format_args)] #![allow(clippy::result_unit_err)] @@ -154,6 +155,25 @@ }; } +/// A macro for conditionally const-ifying a function. +/// #[allow(unused)] because currently it is only used with the `must_cast` feature. +#[allow(unused)] +macro_rules! maybe_const_fn { + ( + #[cfg($cfg_predicate:meta)] + $(#[$attr:meta])* + $vis:vis $(unsafe $($unsafe:lifetime)?)? fn $name:ident $($rest:tt)* + ) => { + #[cfg($cfg_predicate)] + $(#[$attr])* + $vis const $(unsafe $($unsafe)?)? fn $name $($rest)* + + #[cfg(not($cfg_predicate))] + $(#[$attr])* + $vis $(unsafe $($unsafe)?)? fn $name $($rest)* + }; +} + #[cfg(feature = "extern_crate_std")] extern crate std;
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/must.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/must.rs new file mode 100644 index 0000000..e3d472c3 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/must.rs
@@ -0,0 +1,212 @@ +#![allow(clippy::module_name_repetitions)] +#![allow(clippy::let_unit_value)] +#![allow(clippy::let_underscore_untyped)] +#![allow(clippy::ptr_as_ptr)] + +use crate::{AnyBitPattern, NoUninit}; +use core::mem::{align_of, size_of}; + +struct Cast<A, B>((A, B)); +impl<A, B> Cast<A, B> { + const ASSERT_ALIGN_GREATER_THAN_EQUAL: () = + assert!(align_of::<A>() >= align_of::<B>()); + const ASSERT_SIZE_EQUAL: () = assert!(size_of::<A>() == size_of::<B>()); + const ASSERT_SIZE_MULTIPLE_OF_OR_INPUT_ZST: () = assert!( + (size_of::<A>() == 0) + || (size_of::<B>() != 0 && size_of::<A>() % size_of::<B>() == 0) + ); +} + +/// Cast `A` into `B` if infalliable, or fail to compile. +/// +/// Note that for this particular type of cast, alignment isn't a factor. The +/// input value is semantically copied into the function and then returned to a +/// new memory location which will have whatever the required alignment of the +/// output type is. +/// +/// ## Failure +/// +/// * If the types don't have the same size this fails to compile. +/// +/// ## Examples +/// ``` +/// // compiles: +/// let bytes: [u8; 2] = bytemuck::must_cast(12_u16); +/// ``` +/// ```compile_fail,E0080 +/// // fails to compile (size mismatch): +/// let bytes : [u8; 3] = bytemuck::must_cast(12_u16); +/// ``` +#[inline] +pub const fn must_cast<A: NoUninit, B: AnyBitPattern>(a: A) -> B { + let _ = Cast::<A, B>::ASSERT_SIZE_EQUAL; + unsafe { transmute!(A; B; a) } +} + +/// Convert `&A` into `&B` if infalliable, or fail to compile. +/// +/// ## Failure +/// +/// * If the target type has a greater alignment requirement. +/// * If the source type and target type aren't the same size. +/// +/// ## Examples +/// ``` +/// // compiles: +/// let bytes: &[u8; 2] = bytemuck::must_cast_ref(&12_u16); +/// ``` +/// ```compile_fail,E0080 +/// // fails to compile (size mismatch): +/// let bytes : &[u8; 3] = bytemuck::must_cast_ref(&12_u16); +/// ``` +/// ```compile_fail,E0080 +/// // fails to compile (alignment requirements increased): +/// let bytes : &u16 = bytemuck::must_cast_ref(&[1u8, 2u8]); +/// ``` +#[inline] +pub const fn must_cast_ref<A: NoUninit, B: AnyBitPattern>(a: &A) -> &B { + let _ = Cast::<A, B>::ASSERT_SIZE_EQUAL; + let _ = Cast::<A, B>::ASSERT_ALIGN_GREATER_THAN_EQUAL; + unsafe { &*(a as *const A as *const B) } +} + +maybe_const_fn! { + #[cfg(feature = "must_cast_extra")] + /// Convert a `&mut A` into `&mut B` if infalliable, or fail to compile. + /// + /// As [`must_cast_ref`], but `mut`. + /// + /// ## Examples + /// ``` + /// let mut i = 12_u16; + /// // compiles: + /// let bytes: &mut [u8; 2] = bytemuck::must_cast_mut(&mut i); + /// ``` + /// ```compile_fail,E0080 + /// # let mut bytes: &mut [u8; 2] = &mut [1, 2]; + /// // fails to compile (alignment requirements increased): + /// let i : &mut u16 = bytemuck::must_cast_mut(bytes); + /// ``` + /// ```compile_fail,E0080 + /// # let mut i = 12_u16; + /// // fails to compile (size mismatch): + /// let bytes : &mut [u8; 3] = bytemuck::must_cast_mut(&mut i); + /// ``` + #[inline] + pub fn must_cast_mut< + A: NoUninit + AnyBitPattern, + B: NoUninit + AnyBitPattern, + >( + a: &mut A, + ) -> &mut B { + let _ = Cast::<A, B>::ASSERT_SIZE_EQUAL; + let _ = Cast::<A, B>::ASSERT_ALIGN_GREATER_THAN_EQUAL; + unsafe { &mut *(a as *mut A as *mut B) } + } +} + +/// Convert `&[A]` into `&[B]` (possibly with a change in length) if +/// infalliable, or fail to compile. +/// +/// * `input.as_ptr() as usize == output.as_ptr() as usize` +/// * `input.len() * size_of::<A>() == output.len() * size_of::<B>()` +/// +/// ## Failure +/// +/// * If the target type has a greater alignment requirement. +/// * If the target element type doesn't evenly fit into the the current element +/// type (eg: 3 `u16` values is 1.5 `u32` values, so that's a failure). +/// * Similarly, you can't convert from a non-[ZST](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) +/// to a ZST (e.g. 3 `u8` values is not any number of `()` values). +/// +/// ## Examples +/// ``` +/// let indicies: &[u16] = &[1, 2, 3]; +/// // compiles: +/// let bytes: &[u8] = bytemuck::must_cast_slice(indicies); +/// ``` +/// ``` +/// let zsts: &[()] = &[(), (), ()]; +/// // compiles: +/// let bytes: &[u8] = bytemuck::must_cast_slice(zsts); +/// ``` +/// ```compile_fail,E0080 +/// # let bytes : &[u8] = &[1, 0, 2, 0, 3, 0]; +/// // fails to compile (bytes.len() might not be a multiple of 2): +/// let byte_pairs : &[[u8; 2]] = bytemuck::must_cast_slice(bytes); +/// ``` +/// ```compile_fail,E0080 +/// # let byte_pairs : &[[u8; 2]] = &[[1, 0], [2, 0], [3, 0]]; +/// // fails to compile (alignment requirements increased): +/// let indicies : &[u16] = bytemuck::must_cast_slice(byte_pairs); +/// ``` +/// ```compile_fail,E0080 +/// let bytes: &[u8] = &[]; +/// // fails to compile: (bytes.len() might not be 0) +/// let zsts: &[()] = bytemuck::must_cast_slice(bytes); +/// ``` +#[inline] +pub const fn must_cast_slice<A: NoUninit, B: AnyBitPattern>(a: &[A]) -> &[B] { + let _ = Cast::<A, B>::ASSERT_SIZE_MULTIPLE_OF_OR_INPUT_ZST; + let _ = Cast::<A, B>::ASSERT_ALIGN_GREATER_THAN_EQUAL; + let new_len = if size_of::<A>() == size_of::<B>() { + a.len() + } else { + a.len() * (size_of::<A>() / size_of::<B>()) + }; + unsafe { core::slice::from_raw_parts(a.as_ptr() as *const B, new_len) } +} + +maybe_const_fn! { + #[cfg(feature = "must_cast_extra")] + /// Convert `&mut [A]` into `&mut [B]` (possibly with a change in length) if + /// infalliable, or fail to compile. + /// + /// As [`must_cast_slice`], but `&mut`. + /// + /// ## Examples + /// ``` + /// let mut indicies = [1, 2, 3]; + /// let indicies: &mut [u16] = &mut indicies; + /// // compiles: + /// let bytes: &mut [u8] = bytemuck::must_cast_slice_mut(indicies); + /// ``` + /// ``` + /// let zsts: &mut [()] = &mut [(), (), ()]; + /// // compiles: + /// let bytes: &mut [u8] = bytemuck::must_cast_slice_mut(zsts); + /// ``` + /// ```compile_fail,E0080 + /// # let mut bytes = [1, 0, 2, 0, 3, 0]; + /// # let bytes : &mut [u8] = &mut bytes[..]; + /// // fails to compile (bytes.len() might not be a multiple of 2): + /// let byte_pairs : &mut [[u8; 2]] = bytemuck::must_cast_slice_mut(bytes); + /// ``` + /// ```compile_fail,E0080 + /// # let mut byte_pairs = [[1, 0], [2, 0], [3, 0]]; + /// # let byte_pairs : &mut [[u8; 2]] = &mut byte_pairs[..]; + /// // fails to compile (alignment requirements increased): + /// let indicies : &mut [u16] = bytemuck::must_cast_slice_mut(byte_pairs); + /// ``` + /// ```compile_fail,E0080 + /// let bytes: &mut [u8] = &mut []; + /// // fails to compile: (bytes.len() might not be 0) + /// let zsts: &mut [()] = bytemuck::must_cast_slice_mut(bytes); + /// ``` + #[inline] + pub fn must_cast_slice_mut< + A: NoUninit + AnyBitPattern, + B: NoUninit + AnyBitPattern, + >( + a: &mut [A], + ) -> &mut [B] { + let _ = Cast::<A, B>::ASSERT_SIZE_MULTIPLE_OF_OR_INPUT_ZST; + let _ = Cast::<A, B>::ASSERT_ALIGN_GREATER_THAN_EQUAL; + let new_len = if size_of::<A>() == size_of::<B>() { + a.len() + } else { + a.len() * (size_of::<A>() / size_of::<B>()) + }; + unsafe { core::slice::from_raw_parts_mut(a.as_mut_ptr() as *mut B, new_len) } + } +}
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/no_uninit.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/no_uninit.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/no_uninit.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/no_uninit.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/offset_of.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/offset_of.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/offset_of.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/offset_of.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/pod.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/pod.rs similarity index 93% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/pod.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/pod.rs index 92747a1..7d17ff9 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/pod.rs +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/pod.rs
@@ -153,17 +153,29 @@ } impl_unsafe_marker_for_simd!( + #[cfg(all(target_arch = "x86", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + unsafe impl Pod for x86::{ + __m512, __m512d, __m512i + } +); + +impl_unsafe_marker_for_simd!( + #[cfg(all(target_arch = "x86_64", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + unsafe impl Pod for x86_64::{ + __m512, __m512d, __m512i + } +); + +impl_unsafe_marker_for_simd!( #[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))] unsafe impl Pod for x86::{ - __m128bh, __m256bh, __m512, - __m512bh, __m512d, __m512i, + __m128bh, __m256bh, __m512bh } ); impl_unsafe_marker_for_simd!( #[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))] unsafe impl Pod for x86_64::{ - __m128bh, __m256bh, __m512, - __m512bh, __m512d, __m512i, + __m128bh, __m256bh, __m512bh } );
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/pod_in_option.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/pod_in_option.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/pod_in_option.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/pod_in_option.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/transparent.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/transparent.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/transparent.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/transparent.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/zeroable.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/zeroable.rs similarity index 94% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/zeroable.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/zeroable.rs index 60dfc8d..bfbb26c 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/zeroable.rs +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/zeroable.rs
@@ -233,17 +233,29 @@ } impl_unsafe_marker_for_simd!( + #[cfg(all(target_arch = "x86", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + unsafe impl Zeroable for x86::{ + __m512, __m512d, __m512i + } +); + +impl_unsafe_marker_for_simd!( + #[cfg(all(target_arch = "x86_64", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + unsafe impl Zeroable for x86_64::{ + __m512, __m512d, __m512i + } +); + +impl_unsafe_marker_for_simd!( #[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))] unsafe impl Zeroable for x86::{ - __m128bh, __m256bh, __m512, - __m512bh, __m512d, __m512i, + __m128bh, __m256bh, __m512bh } ); impl_unsafe_marker_for_simd!( #[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))] unsafe impl Zeroable for x86_64::{ - __m128bh, __m256bh, __m512, - __m512bh, __m512d, __m512i, + __m128bh, __m256bh, __m512bh } );
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/zeroable_in_option.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/zeroable_in_option.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/src/zeroable_in_option.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/src/zeroable_in_option.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/array_tests.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/array_tests.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/array_tests.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/array_tests.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/cast_slice_tests.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/cast_slice_tests.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/cast_slice_tests.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/cast_slice_tests.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/checked_tests.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/checked_tests.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/checked_tests.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/checked_tests.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/derive.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/derive.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/derive.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/derive.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/doc_tests.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/doc_tests.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/doc_tests.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/doc_tests.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/offset_of_tests.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/offset_of_tests.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/offset_of_tests.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/offset_of_tests.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/std_tests.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/std_tests.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/std_tests.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/std_tests.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/transparent.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/transparent.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/transparent.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/transparent.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/wrapper_forgets.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/wrapper_forgets.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck-1.20.0/tests/wrapper_forgets.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck-1.21.0/tests/wrapper_forgets.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/.cargo_vcs_info.json deleted file mode 100644 index 8685808..0000000 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "48952a0246ffb54b8cdea1c6adc561ee430420a3" - }, - "path_in_vcs": "derive" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/.cargo_vcs_info.json new file mode 100644 index 0000000..ceebb6e --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "45fbae7d8ddb8d75353588920c6fab16943e96bd" + }, + "path_in_vcs": "derive" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/Cargo.toml similarity index 98% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/Cargo.toml index db094c0b..bb2368b 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/Cargo.toml
@@ -12,7 +12,7 @@ [package] edition = "2018" name = "bytemuck_derive" -version = "1.8.0" +version = "1.8.1" authors = ["Lokathor <zefria@gmail.com>"] build = false autobins = false
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/Cargo.toml.orig similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/Cargo.toml.orig index 5acc887..b58884c 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/Cargo.toml.orig
@@ -1,7 +1,7 @@ [package] name = "bytemuck_derive" description = "derive proc-macros for `bytemuck`" -version = "1.8.0" +version = "1.8.1" authors = ["Lokathor <zefria@gmail.com>"] repository = "https://github.com/Lokathor/bytemuck" readme = "README.md"
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/LICENSE-APACHE b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/LICENSE-APACHE similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/LICENSE-APACHE rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/LICENSE-APACHE
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/LICENSE-MIT b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/LICENSE-MIT similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/LICENSE-MIT rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/LICENSE-MIT
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/LICENSE-ZLIB b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/LICENSE-ZLIB similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/LICENSE-ZLIB rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/LICENSE-ZLIB
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/README.md b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/README.md rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/changelog.md b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/changelog.md similarity index 97% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/changelog.md rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/changelog.md index 507817a..0890c7b 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/changelog.md +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/changelog.md
@@ -1,6 +1,10 @@ ## `bytemuck_derive` changelog +## 1.8.1 + +* https://github.com/Lokathor/bytemuck/pull/287 + ## 1.8 * [#257](https://github.com/Lokathor/bytemuck/pull/257): Allows deriving Zeroable on some enums.
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/src/lib.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/src/lib.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/src/traits.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/src/traits.rs similarity index 94% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/src/traits.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/src/traits.rs index ed8db9f..2093561 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/src/traits.rs +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/src/traits.rs
@@ -2,7 +2,7 @@ use std::{cmp, convert::TryFrom}; use proc_macro2::{Ident, Span, TokenStream, TokenTree}; -use quote::{quote, quote_spanned, ToTokens}; +use quote::{quote, ToTokens}; use syn::{ parse::{Parse, ParseStream, Parser}, punctuated::Punctuated, @@ -553,7 +553,7 @@ /// Extract the `Fields` off a `DeriveInput`, or, in the `enum` case, off /// those of the `enum_variant`, when provided (e.g., for `Zeroable`). -/// +/// /// We purposely allow not providing an `enum_variant` for cases where /// the caller wants to reject supporting `enum`s (e.g., `NoPadding`). fn get_fields( @@ -607,19 +607,27 @@ let field_name = &field_names[..]; let field_ty = &field_tys[..]; - let derive_dbg = - quote!(#[cfg_attr(not(target_arch = "spirv"), derive(Debug))]); - Ok(( quote! { #[doc = #GENERATED_TYPE_DOCUMENTATION] #repr #[derive(Clone, Copy, #crate_name::AnyBitPattern)] - #derive_dbg #[allow(missing_docs)] pub struct #bits_ty { #(#field_name: <#field_ty as #crate_name::CheckedBitPattern>::Bits,)* } + + #[allow(unexpected_cfgs)] + const _: () = { + #[cfg(not(target_arch = "spirv"))] + impl ::core::fmt::Debug for #bits_ty { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + let mut debug_struct = ::core::fmt::Formatter::debug_struct(f, ::core::stringify!(#bits_ty)); + #(::core::fmt::DebugStruct::field(&mut debug_struct, ::core::stringify!(#field_name), &self.#field_name);)* + ::core::fmt::DebugStruct::finish(&mut debug_struct) + } + } + }; }, quote! { type Bits = #bits_ty; @@ -664,7 +672,7 @@ )?; let check = if count == 0 { - quote_spanned!(span => false) + quote!(false) } else if max - min == count - 1 { // contiguous range let min_lit = LitInt::new(&format!("{}", min), span); @@ -711,9 +719,6 @@ let representation = get_repr(&input.attrs)?; let vis = &input.vis; - let derive_dbg = - quote!(#[cfg_attr(not(target_arch = "spirv"), derive(Debug))]); - match representation.repr { Repr::Rust => unreachable!(), repr @ (Repr::C | Repr::CWithDiscriminant(_)) => { @@ -793,13 +798,25 @@ quote! { #[doc = #GENERATED_TYPE_DOCUMENTATION] #[derive(::core::clone::Clone, ::core::marker::Copy, #crate_name::AnyBitPattern)] - #derive_dbg #bits_repr #vis struct #bits_ty_ident { tag: #integer, payload: #variants_union_ident, } + #[allow(unexpected_cfgs)] + const _: () = { + #[cfg(not(target_arch = "spirv"))] + impl ::core::fmt::Debug for #bits_ty_ident { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + let mut debug_struct = ::core::fmt::Formatter::debug_struct(f, ::core::stringify!(#bits_ty_ident)); + ::core::fmt::DebugStruct::field(&mut debug_struct, "tag", &self.tag); + ::core::fmt::DebugStruct::field(&mut debug_struct, "payload", &self.payload); + ::core::fmt::DebugStruct::finish(&mut debug_struct) + } + } + }; + #[derive(::core::clone::Clone, ::core::marker::Copy, #crate_name::AnyBitPattern)] #[repr(C)] #[allow(non_snake_case)] @@ -807,13 +824,16 @@ #(#union_fields,)* } - #[cfg(not(target_arch = "spirv"))] - impl ::core::fmt::Debug for #variants_union_ident { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - let mut debug_struct = ::core::fmt::Formatter::debug_struct(f, ::core::stringify!(#variants_union_ident)); - ::core::fmt::DebugStruct::finish_non_exhaustive(&mut debug_struct) + #[allow(unexpected_cfgs)] + const _: () = { + #[cfg(not(target_arch = "spirv"))] + impl ::core::fmt::Debug for #variants_union_ident { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + let mut debug_struct = ::core::fmt::Formatter::debug_struct(f, ::core::stringify!(#variants_union_ident)); + ::core::fmt::DebugStruct::finish_non_exhaustive(&mut debug_struct) + } } - } + }; #(#variant_struct_definitions)* }, @@ -930,14 +950,17 @@ #(#union_fields,)* } - #[cfg(not(target_arch = "spirv"))] - impl ::core::fmt::Debug for #bits_ty_ident { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - let mut debug_struct = ::core::fmt::Formatter::debug_struct(f, ::core::stringify!(#bits_ty_ident)); - ::core::fmt::DebugStruct::field(&mut debug_struct, "tag", unsafe { &self.__tag }); - ::core::fmt::DebugStruct::finish_non_exhaustive(&mut debug_struct) + #[allow(unexpected_cfgs)] + const _: () = { + #[cfg(not(target_arch = "spirv"))] + impl ::core::fmt::Debug for #bits_ty_ident { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + let mut debug_struct = ::core::fmt::Formatter::debug_struct(f, ::core::stringify!(#bits_ty_ident)); + ::core::fmt::DebugStruct::field(&mut debug_struct, "tag", unsafe { &self.__tag }); + ::core::fmt::DebugStruct::finish_non_exhaustive(&mut debug_struct) + } } - } + }; #(#variant_struct_definitions)* }, @@ -962,22 +985,20 @@ /// is equal to the sum of the size of it's fields fn generate_assert_no_padding(input: &DeriveInput) -> Result<TokenStream> { let struct_type = &input.ident; - let span = input.ident.span(); let enum_variant = None; // `no padding` check is not supported for `enum`s yet. let fields = get_fields(input, enum_variant)?; let mut field_types = get_field_types(&fields); let size_sum = if let Some(first) = field_types.next() { - let size_first = quote_spanned!(span => ::core::mem::size_of::<#first>()); - let size_rest = - quote_spanned!(span => #( + ::core::mem::size_of::<#field_types>() )*); + let size_first = quote!(::core::mem::size_of::<#first>()); + let size_rest = quote!(#( + ::core::mem::size_of::<#field_types>() )*); - quote_spanned!(span => #size_first #size_rest) + quote!(#size_first #size_rest) } else { - quote_spanned!(span => 0) + quote!(0) }; - Ok(quote_spanned! {span => const _: fn() = || { + Ok(quote! {const _: fn() = || { #[doc(hidden)] struct TypeWithoutPadding([u8; #size_sum]); let _ = ::core::mem::transmute::<#struct_type, TypeWithoutPadding>; @@ -991,9 +1012,8 @@ let (impl_generics, _ty_generics, where_clause) = input.generics.split_for_impl(); let fields = get_fields(input, enum_variant)?; - let span = input.span(); let field_types = get_field_types(&fields); - Ok(quote_spanned! {span => #(const _: fn() = || { + Ok(quote! {#(const _: fn() = || { #[allow(clippy::missing_const_for_fn)] #[doc(hidden)] fn check #impl_generics () #where_clause {
diff --git a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/tests/basic.rs b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/tests/basic.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/tests/basic.rs rename to third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/tests/basic.rs index 8a3dbe1..b04bfc62 100644 --- a/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.0/tests/basic.rs +++ b/third_party/rust/chromium_crates_io/vendor/bytemuck_derive-1.8.1/tests/basic.rs
@@ -1,4 +1,5 @@ #![allow(dead_code)] +#![deny(clippy::allow_attributes)] use bytemuck::{ checked::CheckedCastError, AnyBitPattern, CheckedBitPattern, Contiguous,
diff --git a/third_party/rust/chromium_crates_io/vendor/cc-1.2.4/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/cc-1.2.5/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/cc-1.2.4/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/cc-1.2.5/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/cc-1.2.4/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/cc-1.2.5/Cargo.toml similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/cc-1.2.4/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/cc-1.2.5/Cargo.toml index 1d0983d..64b3027 100644 --- a/third_party/rust/chromium_crates_io/vendor/cc-1.2.4/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/cc-1.2.5/Cargo.toml
@@ -10,7 +10,7 @@ [package] name = "cc" -version = "1.2.4" +version = "1.2.5" [features] "jobserver" = []
diff --git a/third_party/rust/chromium_crates_io/vendor/cc-1.2.4/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/cc-1.2.5/src/lib.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/cc-1.2.4/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/cc-1.2.5/src/lib.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/.cargo_vcs_info.json deleted file mode 100644 index 1f4b243..0000000 --- a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "dd2392d7dcf01112f2a8c84944da724b7f9a9c5c" - }, - "path_in_vcs": "" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/.cargo_vcs_info.json new file mode 100644 index 0000000..9b88c03 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "f2f514c17eeec8e06277836bc2b49c9ca2bc24ce" + }, + "path_in_vcs": "" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/.gitignore b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/.gitignore similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/.gitignore rename to third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/.gitignore
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/Cargo.toml similarity index 97% rename from third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/Cargo.toml index f7a751e4..5848c84 100644 --- a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/Cargo.toml
@@ -12,7 +12,7 @@ [package] edition = "2021" name = "foldhash" -version = "0.1.3" +version = "0.1.4" authors = ["Orson Peters <orsonpeters@gmail.com>"] build = false exclude = [ @@ -20,6 +20,7 @@ "tools", "assets", ] +autolib = false autobins = false autoexamples = false autotests = false
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/Cargo.toml.orig similarity index 97% rename from third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/Cargo.toml.orig index 28e1d14..6af721d 100644 --- a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/Cargo.toml.orig
@@ -1,6 +1,6 @@ [package] name = "foldhash" -version = "0.1.3" +version = "0.1.4" authors = ["Orson Peters <orsonpeters@gmail.com>"] license = "Zlib" repository = "https://github.com/orlp/foldhash"
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/LICENSE b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/LICENSE similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/LICENSE rename to third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/LICENSE
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/README.md b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/README.md rename to third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/convenience.rs b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/convenience.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/convenience.rs rename to third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/convenience.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/lib.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/lib.rs index deb1636..2787b97 100644 --- a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/lib.rs +++ b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/lib.rs
@@ -163,6 +163,7 @@ } impl FoldHasher { + #[inline] pub(crate) fn with_seed(per_hasher_seed: u64, global_seed: &[u64; 4]) -> FoldHasher { FoldHasher { accumulator: per_hasher_seed, @@ -183,7 +184,7 @@ let hi = (self.sponge >> 64) as u64; self.accumulator = folded_multiply(lo ^ self.accumulator, hi ^ self.fold_seed); self.sponge = x.into(); - self.sponge_len = 0; + self.sponge_len = bits as u8; } else { self.sponge |= x.into() << self.sponge_len; self.sponge_len += bits as u8;
diff --git a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/seed.rs b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/seed.rs similarity index 87% rename from third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/seed.rs rename to third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/seed.rs index f74d2a6..01f9f45 100644 --- a/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/seed.rs +++ b/third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/seed.rs
@@ -25,10 +25,16 @@ impl Default for RandomState { fn default() -> Self { - let per_hasher_seed; + // We initialize the per-hasher seed with the stack pointer to ensure + // different threads have different seeds, with as side benefit that + // stack address randomization gives us further non-determinism. + let mut per_hasher_seed = 0; + let stack_ptr = core::ptr::addr_of!(per_hasher_seed) as u64; + per_hasher_seed = stack_ptr; // If we have the standard library available we use a thread-local - // counter for the per-hasher seed. + // state to ensure RandomStates are different with high probability, + // even if the call stack is the same. #[cfg(feature = "std")] { use std::cell::Cell; @@ -36,16 +42,13 @@ static PER_HASHER_NONDETERMINISM: Cell<u64> = const { Cell::new(0) }; } - let mut nondeterminism = PER_HASHER_NONDETERMINISM.get(); - nondeterminism = nondeterminism.wrapping_add(ARBITRARY1 | 1); // Ensure number is odd for maximum period. - PER_HASHER_NONDETERMINISM.set(nondeterminism); - per_hasher_seed = folded_multiply(nondeterminism, ARBITRARY2); + let nondeterminism = PER_HASHER_NONDETERMINISM.get(); + per_hasher_seed = folded_multiply(per_hasher_seed, ARBITRARY1 ^ nondeterminism); + PER_HASHER_NONDETERMINISM.set(per_hasher_seed); }; - // If we don't have the standard library we use our current stack - // address in combination with a global PER_HASHER_NONDETERMINISM to - // create a new value that is very likely to have never been used as - // a random state before. + // If we don't have the standard library we instead use a global + // atomic instead of a thread-local state. // // PER_HASHER_NONDETERMINISM is loaded and updated in a racy manner, // but this doesn't matter in practice - it is impossible that two @@ -62,11 +65,13 @@ static PER_HASHER_NONDETERMINISM: AtomicUsize = AtomicUsize::new(0); let nondeterminism = PER_HASHER_NONDETERMINISM.load(Ordering::Relaxed) as u64; - let stack_ptr = &nondeterminism as *const _ as u64; - per_hasher_seed = folded_multiply(nondeterminism ^ stack_ptr, ARBITRARY2); + per_hasher_seed = folded_multiply(per_hasher_seed, ARBITRARY1 ^ nondeterminism); PER_HASHER_NONDETERMINISM.store(per_hasher_seed as usize, Ordering::Relaxed); } + // One extra mixing step to ensure good random bits. + per_hasher_seed = folded_multiply(per_hasher_seed, ARBITRARY2); + Self { per_hasher_seed, global_seed: global::GlobalSeed::new(), @@ -77,6 +82,7 @@ impl BuildHasher for RandomState { type Hasher = FoldHasher; + #[inline(always)] fn build_hasher(&self) -> FoldHasher { FoldHasher::with_seed(self.per_hasher_seed, self.global_seed.get()) } @@ -92,6 +98,7 @@ impl FixedState { /// Creates a [`FixedState`] with the given seed. + #[inline(always)] pub const fn with_seed(seed: u64) -> Self { // XOR with ARBITRARY3 such that with_seed(0) matches default. Self { @@ -101,6 +108,7 @@ } impl Default for FixedState { + #[inline(always)] fn default() -> Self { Self { per_hasher_seed: ARBITRARY3, @@ -111,6 +119,7 @@ impl BuildHasher for FixedState { type Hasher = FoldHasher; + #[inline(always)] fn build_hasher(&self) -> FoldHasher { FoldHasher::with_seed(self.per_hasher_seed, &FIXED_GLOBAL_SEED) } @@ -130,6 +139,7 @@ impl BuildHasher for RandomState { type Hasher = FoldHasher; + #[inline(always)] fn build_hasher(&self) -> FoldHasher { FoldHasher { inner: self.inner.build_hasher(), @@ -147,6 +157,7 @@ impl FixedState { /// Creates a [`FixedState`] with the given seed. + #[inline(always)] pub const fn with_seed(seed: u64) -> Self { Self { // We do an additional folded multiply with the seed here for @@ -161,6 +172,7 @@ impl BuildHasher for FixedState { type Hasher = FoldHasher; + #[inline(always)] fn build_hasher(&self) -> FoldHasher { FoldHasher { inner: self.inner.build_hasher(), @@ -194,7 +206,11 @@ // current time and an address from the allocator. #[cfg(feature = "std")] { - #[cfg(not(all(target_family = "wasm", target_os = "unknown")))] + #[cfg(not(any( + miri, + all(target_family = "wasm", target_os = "unknown"), + target_os = "zkvm" + )))] if let Ok(duration) = std::time::UNIX_EPOCH.elapsed() { seed = mix(seed, duration.subsec_nanos() as u64); seed = mix(seed, duration.as_secs());
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.cargo_vcs_info.json deleted file mode 100644 index cb5b1158..0000000 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "e6082ef26096154e08ab0cb094d66d5ca116ee15" - }, - "path_in_vcs": "" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/aarch64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/aarch64.rs deleted file mode 100644 index ceabea39..0000000 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/aarch64.rs +++ /dev/null
@@ -1,4 +0,0 @@ -pub type c_char = i8; -pub type wchar_t = u32; -pub type c_long = i64; -pub type c_ulong = u64;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/arm.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/arm.rs deleted file mode 100644 index 04cc154..0000000 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/arm.rs +++ /dev/null
@@ -1,4 +0,0 @@ -pub type c_char = i8; -pub type wchar_t = u32; -pub type c_long = i32; -pub type c_ulong = u32;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.cargo_vcs_info.json new file mode 100644 index 0000000..61cf84b --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "bb5944c67d6f7f3ead944120ec30561731b427de" + }, + "path_in_vcs": "" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.git-blame-ignore-revs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.git-blame-ignore-revs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.git-blame-ignore-revs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.git-blame-ignore-revs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.gitignore b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.gitignore similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.gitignore rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.gitignore
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.release-plz.toml b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.release-plz.toml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/.release-plz.toml rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/.release-plz.toml
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/CHANGELOG.md b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/CHANGELOG.md similarity index 95% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/CHANGELOG.md rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/CHANGELOG.md index 43f7151..e1efe1f 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/CHANGELOG.md +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/CHANGELOG.md
@@ -1,6 +1,24 @@ # Changelog ## [Unreleased] +## [0.2.169](https://github.com/rust-lang/libc/compare/0.2.168...0.2.169) - 2024-12-18 + +### Added + +- FreeBSD: add more socket TCP stack constants <https://github.com/rust-lang/libc/pull/4193> +- Fuchsia: add a `sockaddr_vm` definition <https://github.com/rust-lang/libc/pull/4194> + +### Fixed + +**Breaking**: [rust-lang/rust#132975](https://github.com/rust-lang/rust/pull/132975) corrected the signedness of `core::ffi::c_char` on various Tier 2 and Tier 3 platforms (mostly Arm and RISC-V) to match Clang. This release contains the corresponding changes to `libc`, including the following specific pull requests: + +- ESP-IDF: Replace arch-conditional `c_char` with a reexport <https://github.com/rust-lang/libc/pull/4195> +- Fix `c_char` on various targets <https://github.com/rust-lang/libc/pull/4199> +- Mirror `c_char` configuration from `rust-lang/rust` <https://github.com/rust-lang/libc/pull/4198> + +### Cleanup + +- Do not re-export `c_void` in target-specific code <https://github.com/rust-lang/libc/pull/4200> ## [0.2.168](https://github.com/rust-lang/libc/compare/0.2.167...0.2.168) - 2024-12-09
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/CONTRIBUTING.md b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/CONTRIBUTING.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/CONTRIBUTING.md rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/CONTRIBUTING.md
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/Cargo.toml similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/Cargo.toml index be00f6be..298df7c5 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/Cargo.toml
@@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.63" name = "libc" -version = "0.2.168" +version = "0.2.169" authors = ["The Rust Project Developers"] build = "build.rs" exclude = [
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/Cargo.toml.orig similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/Cargo.toml.orig index b444a64..aa6926e 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/Cargo.toml.orig
@@ -1,6 +1,6 @@ [package] name = "libc" -version = "0.2.168" +version = "0.2.169" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md"
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/LICENSE-APACHE b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/LICENSE-APACHE similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/LICENSE-APACHE rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/LICENSE-APACHE
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/LICENSE-MIT b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/LICENSE-MIT similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/LICENSE-MIT rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/LICENSE-MIT
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/README.md b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/README.md rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/build.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/build.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/build.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/build.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/rustfmt.toml b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/rustfmt.toml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/rustfmt.toml rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/rustfmt.toml
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fixed_width_ints.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fixed_width_ints.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fixed_width_ints.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fixed_width_ints.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/aarch64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/aarch64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/aarch64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/aarch64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/mod.rs index 71b88f57..8e56e3f6 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/mod.rs
@@ -357,6 +357,14 @@ pub sin6_scope_id: u32, } + pub struct sockaddr_vm { + pub svm_family: sa_family_t, + pub svm_reserved1: c_ushort, + pub svm_port: crate::in_port_t, + pub svm_cid: c_uint, + pub svm_zero: [u8; 4], + } + pub struct addrinfo { pub ai_flags: c_int, pub ai_family: c_int,
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/riscv64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/riscv64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/riscv64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/riscv64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/hermit.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/hermit.rs similarity index 98% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/hermit.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/hermit.rs index 2b470e78..9363fed 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/hermit.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/hermit.rs
@@ -1,15 +1,8 @@ //! Hermit C type definitions +pub use crate::arch::c_char_def as c_char; use crate::prelude::*; -cfg_if! { - if #[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] { - pub type c_char = u8; - } else { - pub type c_char = i8; - } -} - pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/lib.rs similarity index 75% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/lib.rs index 9ac6df1..5697750 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/lib.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/lib.rs
@@ -41,6 +41,44 @@ pub use core::ffi::c_void; +/// Type definitions that are coupled tighter to architecture than OS. +mod arch { + cfg_if! { + // This configuration comes from `rust-lang/rust` in `library/core/src/ffi/mod.rs`. + if #[cfg(all( + not(windows), + // FIXME(ctest): just use `target_vendor` = "apple"` once `ctest` supports it + not(any( + target_os = "macos", + target_os = "ios", + target_os = "tvos", + target_os = "watchos", + target_os = "visionos", + )), + any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "csky", + target_arch = "hexagon", + target_arch = "msp430", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "riscv64", + target_arch = "riscv32", + target_arch = "s390x", + target_arch = "xtensa", + ) + ))] { + // To be reexported as `c_char` + // FIXME(ctest): just name these `c_char` once `ctest` learns that these don't get + // exported. + pub type c_char_def = u8; + } else { + pub type c_char_def = i8; + } + } +} + cfg_if! { if #[cfg(windows)] { mod fixed_width_ints;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/macros.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/macros.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/macros.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/macros.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/psp.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/psp.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/psp.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/psp.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/sgx.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/sgx.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/sgx.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/sgx.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/aarch64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/solid/aarch64.rs similarity index 100% copy from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/aarch64.rs copy to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/solid/aarch64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/arm.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/solid/arm.rs similarity index 100% copy from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/arm.rs copy to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/solid/arm.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/solid/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/solid/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/switch.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/switch.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/switch.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/switch.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/teeos/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/teeos/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/teeos/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/teeos/mod.rs index b9a46f9..40bc0c0 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/teeos/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/teeos/mod.rs
@@ -5,9 +5,6 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -// only supported on Rust > 1.59, so we can directly reexport c_void from core. -pub use core::ffi::c_void; - use crate::prelude::*; pub type c_schar = i8;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/trusty.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/trusty.rs similarity index 91% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/trusty.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/trusty.rs index 2d2b7888..676a456 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/trusty.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/trusty.rs
@@ -1,18 +1,10 @@ -pub use core::ffi::c_void; - +pub use crate::arch::c_char_def as c_char; +use crate::prelude::*; pub type size_t = usize; pub type ssize_t = isize; pub type off_t = i64; -cfg_if! { - if #[cfg(any(target_arch = "aarch64", target_arch = "arm"))] { - pub type c_char = u8; - } else if #[cfg(target_arch = "x86_64")] { - pub type c_char = i8; - } -} - pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/aix/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/aix/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/aix/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/aix/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/aix/powerpc64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/aix/powerpc64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/aix/powerpc64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/aix/powerpc64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b32/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b32/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b32/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b32/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b64/aarch64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b64/aarch64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b64/aarch64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b64/aarch64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b64/x86_64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b64/x86_64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b64/x86_64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b64/x86_64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/dragonfly/errno.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/errno.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/dragonfly/errno.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/errno.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/dragonfly/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/aarch64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/aarch64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/arm.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/arm.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/arm.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/arm.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/mod.rs index 72e5e7f..ae4e366 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -3764,6 +3764,30 @@ pub const TCP_FASTOPEN_PSK_LEN: c_int = 16; pub const TCP_FUNCTION_NAME_LEN_MAX: c_int = 32; +pub const TCP_REUSPORT_LB_NUMA: c_int = 1026; +pub const TCP_RACK_MBUF_QUEUE: c_int = 1050; +pub const TCP_RACK_TLP_REDUCE: c_int = 1052; +pub const TCP_RACK_PACE_MAX_SEG: c_int = 1054; +pub const TCP_RACK_PACE_ALWAYS: c_int = 1055; +pub const TCP_RACK_PRR_SENDALOT: c_int = 1057; +pub const TCP_RACK_MIN_TO: c_int = 1058; +pub const TCP_RACK_EARLY_SEG: c_int = 1060; +pub const TCP_RACK_REORD_THRESH: c_int = 1061; +pub const TCP_RACK_REORD_FADE: c_int = 1062; +pub const TCP_RACK_TLP_THRESH: c_int = 1063; +pub const TCP_RACK_PKT_DELAY: c_int = 1064; +pub const TCP_BBR_IWINTSO: c_int = 1067; +pub const TCP_BBR_STARTUP_PG: c_int = 1069; +pub const TCP_BBR_DRAIN_PG: c_int = 1070; +pub const TCP_BBR_PROBE_RTT_INT: c_int = 1072; +pub const TCP_BBR_STARTUP_LOSS_EXIT: c_int = 1074; +pub const TCP_BBR_TSLIMITS: c_int = 1076; +pub const TCP_BBR_PACE_OH: c_int = 1077; +pub const TCP_BBR_USEDEL_RATE: c_int = 1079; +pub const TCP_BBR_MIN_RTO: c_int = 1080; +pub const TCP_BBR_MAX_RTO: c_int = 1081; +pub const TCP_BBR_ALGORITHM: c_int = 1083; + pub const IP_BINDANY: c_int = 24; pub const IP_BINDMULTI: c_int = 25; pub const IP_RSS_LISTEN_BUCKET: c_int = 26;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/powerpc.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/riscv64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/riscv64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/riscv64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/riscv64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/x86.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/x86.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/aarch64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/aarch64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/arm.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/arm.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/arm.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/arm.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mips.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mips.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mips.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mips.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/powerpc.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/powerpc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/powerpc.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/powerpc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/riscv64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/riscv64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/sparc64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/sparc64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/sparc64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/sparc64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/x86.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/x86.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/aarch64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/aarch64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/arm.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/arm.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/arm.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/arm.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/mips64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mips64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/mips64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mips64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/powerpc.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/powerpc.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/riscv64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/riscv64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/riscv64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/riscv64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/sparc64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/sparc64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/sparc64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/sparc64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/x86.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/x86.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/b32.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/b32.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/b32.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/b32.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/b64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/b64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/b64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/b64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/native.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/native.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/native.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/native.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/hurd/b32.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/hurd/b32.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/hurd/b32.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/hurd/b32.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/hurd/b64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/hurd/b64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/hurd/b64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/hurd/b64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/hurd/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/hurd/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/hurd/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/hurd/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b32/arm.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b32/arm.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b32/arm.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b32/arm.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b32/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b32/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b32/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b32/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b32/x86/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b32/x86/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b32/x86/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b32/x86/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/aarch64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/aarch64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/aarch64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/aarch64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/riscv64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/riscv64/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/riscv64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/riscv64/mod.rs index f214fe3..d35c408 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/riscv64/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/riscv64/mod.rs
@@ -1,7 +1,7 @@ use crate::off64_t; use crate::prelude::*; -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = u32; pub type greg_t = i64; pub type __u64 = c_ulonglong;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/x86_64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/x86_64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/x86_64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/x86_64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/emscripten/lfs64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/emscripten/lfs64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/emscripten/lfs64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/emscripten/lfs64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/emscripten/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/emscripten/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/emscripten/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/emscripten/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/generic/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/generic/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/generic/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/generic/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/mips/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/mips/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/mips/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/mips/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/powerpc/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/powerpc/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/powerpc/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/powerpc/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/sparc/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/sparc/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/sparc/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/sparc/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/arm/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/arm/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/csky/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/csky/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/csky/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mips/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/mips/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/powerpc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/powerpc.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/powerpc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/x86/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/x86/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/s390x.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/s390x.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/s390x.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/s390x.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/arm/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/arm/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/arm/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/arm/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/hexagon.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/hexagon.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/hexagon.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/hexagon.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/mips/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mips/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/mips/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mips/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/powerpc.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/powerpc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/powerpc.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/powerpc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/x86/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/x86/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/x86/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/mips64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mips64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/mips64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mips64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/powerpc64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/powerpc64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/powerpc64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/s390x.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/s390x.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/s390x.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/s390x.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/lfs64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/lfs64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/lfs64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/lfs64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/arm/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/arm/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/arm/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/arm/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mips/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mips/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/mod.rs index ce919147..709b0d1 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
@@ -6,7 +6,7 @@ pub type blkcnt_t = i64; pub type blksize_t = i64; pub type clock_t = i64; -pub type c_char = u8; +pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; pub type fsblkcnt_t = c_ulong;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/other.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/other.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/other.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/other.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/aarch64/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/aarch64/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/aarch64/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/aarch64/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/arm/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/arm/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/arm/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/arm/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/espidf/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/espidf/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/espidf/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/espidf/mod.rs index 4e38981..1ac5113 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/espidf/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/espidf/mod.rs
@@ -1,7 +1,7 @@ use crate::prelude::*; pub type clock_t = c_ulong; -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/generic.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/generic.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/generic.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/generic.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/horizon/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/horizon/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/horizon/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/horizon/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/powerpc/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/powerpc/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/powerpc/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/powerpc/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/rtems/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/rtems/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/rtems/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/rtems/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/vita/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/vita/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/vita/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/vita/mod.rs index 120c4d5..1a8c893 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/vita/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/vita/mod.rs
@@ -3,7 +3,7 @@ pub type clock_t = c_long; -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/aarch64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/aarch64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/aarch64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/aarch64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/neutrino.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/neutrino.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/neutrino.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/neutrino.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nuttx/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nuttx/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nuttx/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nuttx/mod.rs index 95d1156b..ed3e1ed8 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nuttx/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nuttx/mod.rs
@@ -1,3 +1,4 @@ +pub use crate::arch::c_char_def as c_char; use crate::prelude::*; use crate::{in6_addr, in_addr_t, timespec, DIR}; @@ -5,7 +6,6 @@ pub type ino_t = u16; pub type blkcnt_t = u64; pub type blksize_t = i16; -pub type c_char = i8; pub type c_long = isize; pub type c_ulong = usize; pub type cc_t = u8;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/redox/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/redox/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/redox/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/redox/mod.rs index 3a8886e2..c557509 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/redox/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/redox/mod.rs
@@ -1,6 +1,6 @@ +pub use crate::arch::c_char_def as c_char; use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = i32; cfg_if! {
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/compat.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/compat.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/compat.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/compat.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/illumos.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/illumos.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/illumos.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/illumos.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/mod.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/mod.rs index 6f35a1e..0f398ca 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/mod.rs
@@ -1,8 +1,8 @@ use core::mem::size_of; +pub use crate::arch::c_char_def as c_char; use crate::prelude::*; -pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; pub type caddr_t = *mut c_char;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/solaris.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/solaris.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/solaris.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/solaris.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/x86.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/x86.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/x86.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/x86.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/x86_common.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/x86_common.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/x86_common.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/x86_common.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/aarch64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/aarch64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/aarch64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/aarch64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/arm.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/arm.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/arm.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/arm.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/powerpc.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/powerpc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/powerpc.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/powerpc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/powerpc64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/powerpc64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/powerpc64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/powerpc64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/riscv32.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/riscv32.rs similarity index 76% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/riscv32.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/riscv32.rs index e617bb8..40a8e33 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/riscv32.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/riscv32.rs
@@ -1,4 +1,4 @@ -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = i32; pub type c_long = i32; pub type c_ulong = u32;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/riscv64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/riscv64.rs similarity index 76% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/riscv64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/riscv64.rs index 5e95ea2..ccd68b0c64 100644 --- a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/riscv64.rs +++ b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/riscv64.rs
@@ -1,4 +1,4 @@ -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = i32; pub type c_long = i64; pub type c_ulong = u64;
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/x86.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/x86.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/x86.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/x86.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/x86_64.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/x86_64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/x86_64.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/x86_64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/wasi/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/wasi/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/wasi/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/wasi/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/wasi/p2.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/wasi/p2.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/wasi/p2.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/wasi/p2.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/windows/gnu/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/windows/gnu/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/windows/gnu/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/windows/gnu/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/windows/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/windows/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/windows/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/windows/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/windows/msvc/mod.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/windows/msvc/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/windows/msvc/mod.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/windows/msvc/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/xous.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/xous.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/xous.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/xous.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/libc-0.2.168/tests/const_fn.rs b/third_party/rust/chromium_crates_io/vendor/libc-0.2.169/tests/const_fn.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/libc-0.2.168/tests/const_fn.rs rename to third_party/rust/chromium_crates_io/vendor/libc-0.2.169/tests/const_fn.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/png-0.17.15/.cargo_vcs_info.json deleted file mode 100644 index e357af3..0000000 --- a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "10644dbff4d5b5614199cbc81145838abdafd98c" - }, - "path_in_vcs": "" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.16/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/.cargo_vcs_info.json new file mode 100644 index 0000000..5198214 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "fbf256669ff23594bf4c618b61fde6a52b79e088" + }, + "path_in_vcs": "" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/CHANGES.md b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/CHANGES.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/CHANGES.md rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/CHANGES.md
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/Cargo.lock b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/Cargo.lock similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/Cargo.lock rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/Cargo.lock index 7ac528d..68c4a73 100644 --- a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/Cargo.lock +++ b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/Cargo.lock
@@ -143,9 +143,9 @@ [[package]] name = "cc" -version = "1.2.3" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" dependencies = [ "shlex", ] @@ -398,9 +398,9 @@ [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -417,9 +417,9 @@ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crossfont" @@ -492,27 +492,6 @@ ] [[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] name = "dispatch" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -820,6 +799,15 @@ ] [[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -902,9 +890,9 @@ [[package]] name = "libc" -version = "0.2.167" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libloading" @@ -927,16 +915,6 @@ ] [[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - -[[package]] name = "lock_api" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -987,9 +965,9 @@ [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", "simd-adler32", @@ -1230,9 +1208,9 @@ [[package]] name = "png" -version = "0.17.14" +version = "0.17.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0" +checksum = "b67582bd5b65bdff614270e2ea89a1cf15bef71245cc1e5f7ea126977144211d" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -1243,7 +1221,7 @@ [[package]] name = "png" -version = "0.17.15" +version = "0.17.16" dependencies = [ "approx", "bitflags 1.3.2", @@ -1389,25 +1367,14 @@ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] [[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - -[[package]] name = "regex" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1443,12 +1410,6 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustversion" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" - -[[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1498,18 +1459,18 @@ [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", @@ -1641,13 +1602,12 @@ [[package]] name = "term" -version = "0.7.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "a3bb6001afcea98122260987f8b7b5da969ecad46dbf0b5453702f776b491a41" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "home", + "windows-sys 0.52.0", ] [[package]] @@ -1695,7 +1655,7 @@ "arrayvec", "bytemuck", "cfg-if", - "png 0.17.14", + "png 0.17.15", "safe_arch", "tiny-skia-path", ] @@ -1979,6 +1939,15 @@ [[package]] name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/Cargo.toml similarity index 93% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/Cargo.toml index 662ffa5..3941875e 100644 --- a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/Cargo.toml
@@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.57" name = "png" -version = "0.17.15" +version = "0.17.16" authors = ["The image-rs Developers"] build = false include = [ @@ -121,8 +121,13 @@ version = "0.8.4" [dev-dependencies.term] -version = "0.7" +version = "1.0.1" [features] benchmarks = [] -unstable = [] +unstable = ["crc32fast/nightly"] + +[lints.rust.unexpected_cfgs] +level = "warn" +priority = 0 +check-cfg = ["cfg(fuzzing)"]
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/Cargo.toml.orig similarity index 88% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/Cargo.toml.orig index ee38788..5aeba7f2e 100644 --- a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/Cargo.toml.orig
@@ -1,6 +1,6 @@ [package] name = "png" -version = "0.17.15" +version = "0.17.16" license = "MIT OR Apache-2.0" description = "PNG decoding and encoding library in pure Rust" @@ -36,12 +36,15 @@ glium = { version = "0.32", features = ["glutin"], default-features = false } glob = "0.3" rand = "0.8.4" -term = "0.7" +term = "1.0.1" [features] -unstable = [] +unstable = ["crc32fast/nightly"] benchmarks = [] +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } + [[bench]] path = "benches/decoder.rs" name = "decoder"
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/LICENSE-APACHE b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/LICENSE-APACHE similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/LICENSE-APACHE rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/LICENSE-APACHE
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/LICENSE-MIT b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/LICENSE-MIT similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/LICENSE-MIT rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/LICENSE-MIT
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/README.md b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/README.md rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/benches/README.md b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/benches/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/benches/README.md rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/benches/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/benches/decoder.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/benches/decoder.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/benches/decoder.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/benches/decoder.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/benches/expand_paletted.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/benches/expand_paletted.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/benches/expand_paletted.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/benches/expand_paletted.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/benches/unfilter.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/benches/unfilter.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/benches/unfilter.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/benches/unfilter.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/change-png-info.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/change-png-info.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/change-png-info.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/change-png-info.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/corpus-bench.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/corpus-bench.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/corpus-bench.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/corpus-bench.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/png-generate.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/png-generate.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/png-generate.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/png-generate.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/pngcheck.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/pngcheck.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/pngcheck.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/pngcheck.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/show.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/show.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/examples/show.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/examples/show.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/adam7.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/adam7.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/adam7.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/adam7.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/benchable_apis.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/benchable_apis.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/benchable_apis.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/benchable_apis.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/chunk.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/chunk.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/chunk.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/chunk.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/common.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/common.rs similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/common.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/common.rs index 9a4e1876..cb56e6e7 100644 --- a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/common.rs +++ b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/common.rs
@@ -725,10 +725,22 @@ .raw_row_length_from_width(self.bit_depth, width) } + /// Mark the image data as conforming to the SRGB color space with the specified rendering intent. + /// + /// Any ICC profiles will be ignored. + /// + /// Source gamma and chromaticities will be written only if they're set to fallback + /// values specified in [11.3.2.5](https://www.w3.org/TR/png-3/#sRGB-gAMA-cHRM). + pub(crate) fn set_source_srgb(&mut self, rendering_intent: SrgbRenderingIntent) { + self.srgb = Some(rendering_intent); + self.icc_profile = None; + } + /// Encode this header to the writer. /// /// Note that this does _not_ include the PNG signature, it starts with the IHDR chunk and then /// includes other chunks that were added to the header. + #[deprecated(note = "Use Encoder+Writer instead")] pub fn encode<W: Write>(&self, mut w: W) -> encoder::Result<()> { // Encode the IHDR chunk let mut data = [0; 13]; @@ -753,11 +765,17 @@ // If specified, the sRGB information overrides the source gamma and chromaticities. if let Some(srgb) = &self.srgb { - let gamma = crate::srgb::substitute_gamma(); - let chromaticities = crate::srgb::substitute_chromaticities(); srgb.encode(&mut w)?; - gamma.encode_gama(&mut w)?; - chromaticities.encode(&mut w)?; + + // gAMA and cHRM are optional, for backwards compatibility + let srgb_gamma = crate::srgb::substitute_gamma(); + if Some(srgb_gamma) == self.source_gamma { + srgb_gamma.encode_gama(&mut w)? + } + let srgb_chromaticities = crate::srgb::substitute_chromaticities(); + if Some(srgb_chromaticities) == self.source_chromaticities { + srgb_chromaticities.encode(&mut w)?; + } } else { if let Some(gma) = self.source_gamma { gma.encode_gama(&mut w)? @@ -766,7 +784,7 @@ chrms.encode(&mut w)?; } if let Some(iccp) = &self.icc_profile { - encoder::write_chunk(&mut w, chunk::iCCP, iccp)?; + encoder::write_iccp_chunk(&mut w, "_", iccp)? } }
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/interlace_info.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/interlace_info.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/interlace_info.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/interlace_info.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/mod.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/mod.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/read_decoder.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/read_decoder.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/read_decoder.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/read_decoder.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/stream.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/stream.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/stream.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/stream.rs index 7d5de33..88044b74 100644 --- a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/stream.rs +++ b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/stream.rs
@@ -1528,9 +1528,11 @@ let mut buf = &self.current_chunk.raw_bytes[..]; // read profile name - let _: u8 = buf.read_be()?; - for _ in 1..80 { + for len in 0..=80 { let raw: u8 = buf.read_be()?; + if (raw == 0 && len == 0) || (raw != 0 && len == 80) { + return Err(DecodingError::from(TextDecodingError::InvalidKeywordSize)); + } if raw == 0 { break; } @@ -2109,6 +2111,23 @@ } #[test] + fn test_iccp_roundtrip() { + let dummy_icc = b"I'm a profile"; + + let mut info = crate::Info::with_size(1, 1); + info.icc_profile = Some(dummy_icc.into()); + let mut encoded_image = Vec::new(); + let enc = crate::Encoder::with_info(&mut encoded_image, info).unwrap(); + let mut enc = enc.write_header().unwrap(); + enc.write_image_data(&[0]).unwrap(); + enc.finish().unwrap(); + + let dec = crate::Decoder::new(encoded_image.as_slice()); + let dec = dec.read_info().unwrap(); + assert_eq!(dummy_icc, &**dec.info().icc_profile.as_ref().unwrap()); + } + + #[test] fn test_png_with_broken_iccp() { let decoder = crate::Decoder::new(File::open("tests/iccp/broken_iccp.png").unwrap()); assert!(decoder.read_info().is_ok());
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/transform.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/transform.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/transform.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/transform.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/transform/palette.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/transform/palette.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/transform/palette.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/transform/palette.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/unfiltering_buffer.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/unfiltering_buffer.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/unfiltering_buffer.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/unfiltering_buffer.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/zlib.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/zlib.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/zlib.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/zlib.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/encoder.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/encoder.rs similarity index 97% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/encoder.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/encoder.rs index d694f76..c143fa04 100644 --- a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/encoder.rs +++ b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/encoder.rs
@@ -13,7 +13,7 @@ }; use crate::filter::{filter, AdaptiveFilterType, FilterType}; use crate::text_metadata::{ - EncodableTextChunk, ITXtChunk, TEXtChunk, TextEncodingError, ZTXtChunk, + encode_iso_8859_1, EncodableTextChunk, ITXtChunk, TEXtChunk, TextEncodingError, ZTXtChunk, }; use crate::traits::WriteBytesExt; @@ -268,9 +268,23 @@ /// Mark the image data as conforming to the SRGB color space with the specified rendering intent. /// /// Matching source gamma and chromaticities chunks are added automatically. - /// Any manually specified source gamma or chromaticities will be ignored. + /// Any manually specified source gamma, chromaticities, or ICC profiles will be ignored. + #[doc(hidden)] + #[deprecated(note = "use set_source_srgb")] pub fn set_srgb(&mut self, rendering_intent: super::SrgbRenderingIntent) { - self.info.srgb = Some(rendering_intent); + self.info.set_source_srgb(rendering_intent); + self.info.source_gamma = Some(crate::srgb::substitute_gamma()); + self.info.source_chromaticities = Some(crate::srgb::substitute_chromaticities()); + } + + /// Mark the image data as conforming to the SRGB color space with the specified rendering intent. + /// + /// Any ICC profiles will be ignored. + /// + /// Source gamma and chromaticities will be written only if they're set to fallback + /// values specified in [11.3.2.5](https://www.w3.org/TR/png-3/#sRGB-gAMA-cHRM). + pub fn set_source_srgb(&mut self, rendering_intent: super::SrgbRenderingIntent) { + self.info.set_source_srgb(rendering_intent); } /// Start encoding by writing the header data. @@ -576,6 +590,7 @@ } self.w.write_all(&[137, 80, 78, 71, 13, 10, 26, 10])?; // PNG signature + #[allow(deprecated)] info.encode(&mut self.w)?; Ok(self) @@ -1040,6 +1055,36 @@ } } +// This should be moved to Writer after `Info::encoding` is gone +pub(crate) fn write_iccp_chunk<W: Write>( + w: &mut W, + profile_name: &str, + icc_profile: &[u8], +) -> Result<()> { + let profile_name = encode_iso_8859_1(profile_name)?; + if profile_name.len() < 1 || profile_name.len() > 79 { + return Err(TextEncodingError::InvalidKeywordSize.into()); + } + + let estimated_compressed_size = icc_profile.len() * 3 / 4; + let chunk_size = profile_name + .len() + .checked_add(2) // string NUL + compression type. Checked add optimizes out later Vec reallocations. + .and_then(|s| s.checked_add(estimated_compressed_size)) + .ok_or(EncodingError::LimitsExceeded)?; + + let mut data = Vec::new(); + data.try_reserve_exact(chunk_size) + .map_err(|_| EncodingError::LimitsExceeded)?; + + data.extend(profile_name.into_iter().chain([0, 0])); + + let mut encoder = ZlibEncoder::new(data, flate2::Compression::default()); + encoder.write_all(icc_profile)?; + + write_chunk(w, chunk::iCCP, &encoder.finish()?) +} + enum ChunkOutput<'a, W: Write> { Borrowed(&'a mut Writer<W>), Owned(Writer<W>),
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/filter.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/filter.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/filter.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/filter.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/lib.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/lib.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/srgb.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/srgb.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/srgb.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/srgb.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/test_utils.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/test_utils.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/test_utils.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/test_utils.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/text_metadata.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/text_metadata.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/text_metadata.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/text_metadata.rs index 7fc730f..3bb491f 100644 --- a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/text_metadata.rs +++ b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/text_metadata.rs
@@ -162,7 +162,7 @@ text.iter().map(|&b| b as char).collect() } -fn encode_iso_8859_1(text: &str) -> Result<Vec<u8>, TextEncodingError> { +pub(crate) fn encode_iso_8859_1(text: &str) -> Result<Vec<u8>, TextEncodingError> { encode_iso_8859_1_iter(text).collect() }
diff --git a/third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/traits.rs b/third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/traits.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/traits.rs rename to third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/traits.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.cargo_vcs_info.json deleted file mode 100644 index ca2623f..0000000 --- a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "0903de449c52c1b4a2271e909b7afb18909dc379" - }, - "path_in_vcs": "" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.cargo_vcs_info.json new file mode 100644 index 0000000..30e2f94 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "b2a1415aad0c76684c675d13a5746850d275c178" + }, + "path_in_vcs": "" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.github/workflows/ci.yml b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.github/workflows/ci.yml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.github/workflows/ci.yml rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.github/workflows/ci.yml
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.gitignore b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.gitignore similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/.gitignore rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/.gitignore
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/CONTRIBUTING.md b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/CONTRIBUTING.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/CONTRIBUTING.md rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/CONTRIBUTING.md
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/Cargo.lock b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/Cargo.lock new file mode 100644 index 0000000..405d0471 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/Cargo.lock
@@ -0,0 +1,417 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "automod" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edf3ee19dbc0a46d740f6f0926bde8c50f02bdbc7b536842da28f6ac56513a8b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cc" +version = "1.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "dissimilar" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "indexmap" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" +dependencies = [ + "cc", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "rustversion" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "serde" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_json" +version = "1.0.134" +dependencies = [ + "automod", + "indexmap", + "indoc", + "itoa", + "memchr", + "ref-cast", + "rustversion", + "ryu", + "serde", + "serde_bytes", + "serde_derive", + "serde_stacker", + "trybuild", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_stacker" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "babfccff5773ff80657f0ecf553c7c516bdc2eb16389c0918b36b73e7015276e" +dependencies = [ + "serde", + "stacker", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "stacker" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys", +] + +[[package]] +name = "syn" +version = "2.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "trybuild" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" +dependencies = [ + "dissimilar", + "glob", + "serde", + "serde_derive", + "serde_json 1.0.133", + "target-triple", + "termcolor", + "toml", +] + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +]
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/Cargo.toml similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/Cargo.toml index 8627d0e1..126b95c 100644 --- a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/Cargo.toml
@@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "serde_json" -version = "1.0.133" +version = "1.0.134" authors = [ "Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>", @@ -52,6 +52,22 @@ [package.metadata.playground] features = ["raw_value"] +[features] +alloc = ["serde/alloc"] +arbitrary_precision = [] +default = ["std"] +float_roundtrip = [] +preserve_order = [ + "indexmap", + "std", +] +raw_value = [] +std = [ + "memchr/std", + "serde/std", +] +unbounded_depth = [] + [lib] name = "serde_json" path = "src/lib.rs" @@ -131,19 +147,3 @@ [dev-dependencies.trybuild] version = "1.0.81" features = ["diff"] - -[features] -alloc = ["serde/alloc"] -arbitrary_precision = [] -default = ["std"] -float_roundtrip = [] -preserve_order = [ - "indexmap", - "std", -] -raw_value = [] -std = [ - "memchr/std", - "serde/std", -] -unbounded_depth = []
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/Cargo.toml.orig similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/Cargo.toml.orig index 4d9e82c7..a2dda353 100644 --- a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/Cargo.toml.orig
@@ -1,6 +1,6 @@ [package] name = "serde_json" -version = "1.0.133" +version = "1.0.134" authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"] categories = ["encoding", "parser-implementations", "no-std"] description = "A JSON serialization file format"
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/LICENSE-APACHE b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/LICENSE-APACHE similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/LICENSE-APACHE rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/LICENSE-APACHE
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/LICENSE-MIT b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/LICENSE-MIT similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/LICENSE-MIT rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/LICENSE-MIT
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/README.md b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/README.md rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/build.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/build.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/build.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/build.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/de.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/de.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/de.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/de.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/error.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/error.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/error.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/error.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/io/core.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/io/core.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/io/core.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/io/core.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/io/mod.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/io/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/io/mod.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/io/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/iter.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/iter.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/iter.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/iter.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/algorithm.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/algorithm.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/algorithm.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/algorithm.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/bhcomp.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/bhcomp.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/bhcomp.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/bhcomp.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/bignum.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/bignum.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/bignum.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/bignum.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/cached.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/cached.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/cached.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/cached.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/cached_float80.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/cached_float80.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/cached_float80.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/cached_float80.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/digit.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/digit.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/digit.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/digit.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/errors.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/errors.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/errors.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/errors.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/exponent.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/exponent.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/exponent.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/exponent.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/float.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/float.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/float.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/float.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/large_powers.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/large_powers.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/large_powers.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/large_powers.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/large_powers32.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/large_powers32.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/large_powers32.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/large_powers32.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/large_powers64.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/large_powers64.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/large_powers64.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/large_powers64.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/math.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/math.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/math.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/math.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/mod.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/mod.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/num.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/num.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/num.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/num.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/parse.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/parse.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/parse.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/parse.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/rounding.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/rounding.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/rounding.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/rounding.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/shift.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/shift.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/shift.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/shift.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/small_powers.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/small_powers.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/small_powers.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/small_powers.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lib.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lib.rs index b98cad6..87d040f8 100644 --- a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lib.rs +++ b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lib.rs
@@ -299,7 +299,7 @@ //! [macro]: crate::json //! [`serde-json-core`]: https://github.com/rust-embedded-community/serde-json-core -#![doc(html_root_url = "https://docs.rs/serde_json/1.0.133")] +#![doc(html_root_url = "https://docs.rs/serde_json/1.0.134")] // Ignored clippy lints #![allow( clippy::collapsible_else_if,
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/macros.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/macros.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/macros.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/macros.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/map.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/map.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/map.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/map.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/number.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/number.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/number.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/number.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/raw.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/raw.rs similarity index 97% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/raw.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/raw.rs index 22d1444..f81d943a 100644 --- a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/raw.rs +++ b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/raw.rs
@@ -119,7 +119,7 @@ } impl RawValue { - fn from_borrowed(json: &str) -> &Self { + const fn from_borrowed(json: &str) -> &Self { unsafe { mem::transmute::<&str, &RawValue>(json) } } @@ -148,7 +148,7 @@ impl Default for Box<RawValue> { fn default() -> Self { - RawValue::from_borrowed("null").to_owned() + RawValue::NULL.to_owned() } } @@ -168,6 +168,13 @@ } impl RawValue { + /// A constant RawValue with the JSON value `null`. + pub const NULL: &'static RawValue = RawValue::from_borrowed("null"); + /// A constant RawValue with the JSON value `true`. + pub const TRUE: &'static RawValue = RawValue::from_borrowed("true"); + /// A constant RawValue with the JSON value `false`. + pub const FALSE: &'static RawValue = RawValue::from_borrowed("false"); + /// Convert an owned `String` of JSON data to an owned `RawValue`. /// /// This function is equivalent to `serde_json::from_str::<Box<RawValue>>`
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/read.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/read.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/read.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/read.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/ser.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/ser.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/ser.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/ser.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/de.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/de.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/de.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/de.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/from.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/from.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/from.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/from.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/index.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/index.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/index.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/index.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/mod.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/mod.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/partial_eq.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/partial_eq.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/partial_eq.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/partial_eq.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/ser.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/ser.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/ser.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/ser.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/compiletest.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/compiletest.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/compiletest.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/compiletest.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/debug.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/debug.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/debug.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/debug.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/algorithm.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/algorithm.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/algorithm.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/algorithm.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/exponent.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/exponent.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/exponent.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/exponent.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/float.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/float.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/float.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/float.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/math.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/math.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/math.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/math.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/num.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/num.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/num.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/num.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/parse.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/parse.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/parse.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/parse.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/rounding.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/rounding.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/lexical/rounding.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/lexical/rounding.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/macros/mod.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/macros/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/macros/mod.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/macros/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/map.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/map.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/map.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/map.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue1004.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue1004.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue1004.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue1004.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue520.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue520.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue520.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue520.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue795.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue795.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue795.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue795.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue845.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue845.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue845.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue845.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue953.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue953.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/regression/issue953.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/regression/issue953.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/stream.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/stream.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/stream.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/stream.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/test.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/test.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/test.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/test.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_colon.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_colon.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_colon.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_colon.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_colon.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_colon.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_colon.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_colon.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_comma.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_comma.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_comma.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_comma.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_comma.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_comma.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_comma.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_comma.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_value.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_value.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_value.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_value.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_value.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_value.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/missing_value.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/missing_value.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/not_found.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/not_found.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/not_found.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/not_found.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/not_found.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/not_found.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/not_found.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/not_found.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/parse_expr.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/parse_expr.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/parse_expr.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/parse_expr.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/parse_expr.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/parse_expr.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/parse_expr.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/parse_expr.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/parse_key.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/parse_key.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/parse_key.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/parse_key.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/parse_key.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/parse_key.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/parse_key.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/parse_key.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_after_array_element.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_after_array_element.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_after_array_element.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_after_array_element.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_after_array_element.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_after_array_element.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_after_array_element.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_after_array_element.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_after_map_entry.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_after_map_entry.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_after_map_entry.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_after_map_entry.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_after_map_entry.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_after_map_entry.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_after_map_entry.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_after_map_entry.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_colon.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_colon.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_colon.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_colon.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_colon.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_colon.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_colon.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_colon.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_comma.rs b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_comma.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_comma.rs rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_comma.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_comma.stderr b/third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_comma.stderr similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/tests/ui/unexpected_comma.stderr rename to third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/tests/ui/unexpected_comma.stderr
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/.cargo_vcs_info.json deleted file mode 100644 index db621789..0000000 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "ac5b41c852137c3d147202e3e6b2666c924cb87c" - }, - "path_in_vcs": "" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/.cargo_vcs_info.json new file mode 100644 index 0000000..2da4343 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "53de985062cbdc99ba002ac85a7926d49d92e611" + }, + "path_in_vcs": "" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/Cargo.lock b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/Cargo.lock similarity index 91% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/Cargo.lock rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/Cargo.lock index cc6ca594e..6f8759e 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/Cargo.lock +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/Cargo.lock
@@ -19,9 +19,9 @@ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "atomic-waker" @@ -43,7 +43,7 @@ dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -87,9 +87,9 @@ [[package]] name = "cc" -version = "1.2.2" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" dependencies = [ "shlex", ] @@ -102,14 +102,14 @@ [[package]] name = "console" -version = "0.15.8" +version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" dependencies = [ "encode_unicode", - "lazy_static", "libc", - "windows-sys 0.52.0", + "once_cell", + "windows-sys 0.59.0", ] [[package]] @@ -139,9 +139,9 @@ [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -158,9 +158,9 @@ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "displaydoc" @@ -170,7 +170,7 @@ dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -181,9 +181,9 @@ [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" @@ -212,9 +212,9 @@ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "filetime" @@ -362,9 +362,9 @@ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -402,9 +402,9 @@ [[package]] name = "hyper" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", @@ -422,9 +422,9 @@ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http", @@ -587,7 +587,7 @@ dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -613,9 +613,9 @@ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -647,10 +647,11 @@ [[package]] name = "js-sys" -version = "0.3.73" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb15147158e79fd8b8afd0252522769c4f48725460b37338544d8379d94fc8f9" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -662,9 +663,9 @@ [[package]] name = "libc" -version = "0.2.167" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libredox" @@ -715,9 +716,9 @@ [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] @@ -752,9 +753,9 @@ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -788,7 +789,7 @@ dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -873,9 +874,9 @@ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags", ] @@ -897,7 +898,7 @@ dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -967,22 +968,22 @@ [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "once_cell", "rustls-pki-types", @@ -1002,9 +1003,9 @@ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-webpki" @@ -1062,9 +1063,9 @@ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" dependencies = [ "core-foundation-sys", "libc", @@ -1072,29 +1073,29 @@ [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", @@ -1171,9 +1172,9 @@ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1182,7 +1183,7 @@ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.91" dependencies = [ "anyhow", "automod", @@ -1224,7 +1225,7 @@ dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -1293,9 +1294,9 @@ [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -1318,20 +1319,19 @@ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ "rustls", - "rustls-pki-types", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -1439,9 +1439,9 @@ [[package]] name = "wasm-bindgen" -version = "0.2.96" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21d3b25c3ea1126a2ad5f4f9068483c2af1e64168f847abe863a526b8dbfe00b" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -1450,24 +1450,23 @@ [[package]] name = "wasm-bindgen-backend" -version = "0.2.96" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52857d4c32e496dc6537646b5b117081e71fd2ff06de792e3577a150627db283" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.46" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "951fe82312ed48443ac78b66fa43eded9999f738f6022e67aead7b708659e49a" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", @@ -1478,9 +1477,9 @@ [[package]] name = "wasm-bindgen-macro" -version = "0.2.96" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "920b0ffe069571ebbfc9ddc0b36ba305ef65577c94b06262ed793716a1afd981" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1488,28 +1487,28 @@ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.96" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf59002391099644be3524e23b781fa43d2be0c5aa0719a18c0731b9d195cab6" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.96" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5047c5392700766601942795a436d7d2599af60dcc3cc1248c9120bfb0827b0" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" -version = "0.3.73" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "476364ff87d0ae6bfb661053a9104ab312542658c3d8f963b7ace80b6f9b26b9" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -1679,7 +1678,7 @@ dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", "synstructure", ] @@ -1700,7 +1699,7 @@ dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", "synstructure", ] @@ -1729,5 +1728,5 @@ dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ]
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/Cargo.toml similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/Cargo.toml index 54afe47..a7a2d001 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/Cargo.toml
@@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.61" name = "syn" -version = "2.0.90" +version = "2.0.91" authors = ["David Tolnay <dtolnay@gmail.com>"] build = false include = [ @@ -61,6 +61,29 @@ "extra-traits", ] +[features] +clone-impls = [] +default = [ + "derive", + "parsing", + "printing", + "clone-impls", + "proc-macro", +] +derive = [] +extra-traits = [] +fold = [] +full = [] +parsing = [] +printing = ["dep:quote"] +proc-macro = [ + "proc-macro2/proc-macro", + "quote?/proc-macro", +] +test = ["syn-test-suite/all-features"] +visit = [] +visit-mut = [] + [lib] name = "syn" path = "src/lib.rs" @@ -228,29 +251,6 @@ [dev-dependencies.termcolor] version = "1" -[features] -clone-impls = [] -default = [ - "derive", - "parsing", - "printing", - "clone-impls", - "proc-macro", -] -derive = [] -extra-traits = [] -fold = [] -full = [] -parsing = [] -printing = ["dep:quote"] -proc-macro = [ - "proc-macro2/proc-macro", - "quote?/proc-macro", -] -test = ["syn-test-suite/all-features"] -visit = [] -visit-mut = [] - [target."cfg(not(miri))".dev-dependencies.flate2] version = "1"
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/Cargo.toml.orig similarity index 98% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/Cargo.toml.orig index 71332d4b..98b490f 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/Cargo.toml.orig
@@ -1,6 +1,6 @@ [package] name = "syn" -version = "2.0.90" +version = "2.0.91" authors = ["David Tolnay <dtolnay@gmail.com>"] categories = ["development-tools::procedural-macro-helpers", "parser-implementations"] description = "Parser for Rust source code"
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/LICENSE-APACHE b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/LICENSE-APACHE similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/LICENSE-APACHE rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/LICENSE-APACHE
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/LICENSE-MIT b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/LICENSE-MIT similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/LICENSE-MIT rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/LICENSE-MIT
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/README.md b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/README.md rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/benches/file.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/benches/file.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/benches/file.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/benches/file.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/benches/rust.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/benches/rust.rs similarity index 95% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/benches/rust.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/benches/rust.rs index 75a9f91..96770dd 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/benches/rust.rs +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/benches/rust.rs
@@ -60,7 +60,10 @@ use crate::repo; use rustc_data_structures::sync::Lrc; use rustc_error_messages::FluentBundle; - use rustc_errors::{emitter::Emitter, translation::Translate, DiagCtxt, DiagInner}; + use rustc_errors::emitter::Emitter; + use rustc_errors::registry::Registry; + use rustc_errors::translation::Translate; + use rustc_errors::{DiagCtxt, DiagInner}; use rustc_session::parse::ParseSess; use rustc_span::source_map::{FilePathMapping, SourceMap}; use rustc_span::FileName; @@ -70,7 +73,7 @@ struct SilentEmitter; impl Emitter for SilentEmitter { - fn emit_diagnostic(&mut self, _diag: DiagInner) {} + fn emit_diagnostic(&mut self, _diag: DiagInner, _registry: &Registry) {} fn source_map(&self) -> Option<&SourceMap> { None }
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/attr.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/attr.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/attr.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/attr.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/bigint.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/bigint.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/bigint.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/bigint.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/buffer.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/buffer.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/buffer.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/buffer.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/classify.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/classify.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/classify.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/classify.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/custom_keyword.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/custom_keyword.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/custom_keyword.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/custom_keyword.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/custom_punctuation.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/custom_punctuation.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/custom_punctuation.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/custom_punctuation.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/data.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/data.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/data.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/data.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/derive.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/derive.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/derive.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/derive.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/discouraged.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/discouraged.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/discouraged.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/discouraged.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/drops.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/drops.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/drops.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/drops.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/error.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/error.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/error.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/error.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/export.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/export.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/export.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/export.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/expr.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/expr.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/expr.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/expr.rs index 545b43d..4939078a 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/expr.rs +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/expr.rs
@@ -2328,10 +2328,7 @@ let brace_token = braced!(content in input); attr::parsing::parse_inner(&content, &mut attrs)?; - let mut arms = Vec::new(); - while !content.is_empty() { - arms.push(content.call(Arm::parse)?); - } + let arms = Arm::parse_multiple(&content)?; Ok(ExprMatch { attrs, @@ -2946,6 +2943,17 @@ } #[cfg(feature = "full")] + impl Arm { + pub(crate) fn parse_multiple(input: ParseStream) -> Result<Vec<Self>> { + let mut arms = Vec::new(); + while !input.is_empty() { + arms.push(input.call(Arm::parse)?); + } + Ok(arms) + } + } + + #[cfg(feature = "full")] #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] impl Parse for Arm { fn parse(input: ParseStream) -> Result<Arm> {
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/ext.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/ext.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/ext.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/ext.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/file.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/file.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/file.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/file.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/fixup.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/fixup.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/fixup.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/fixup.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/clone.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/clone.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/clone.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/clone.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/debug.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/debug.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/debug.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/debug.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/eq.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/eq.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/eq.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/eq.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/fold.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/fold.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/fold.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/fold.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/hash.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/hash.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/hash.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/hash.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/token.css b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/token.css similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/token.css rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/token.css
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/visit.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/visit.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/visit.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/visit.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/visit_mut.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/visit_mut.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/visit_mut.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/visit_mut.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/generics.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/generics.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/generics.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/generics.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/group.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/group.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/group.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/group.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/ident.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/ident.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/ident.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/ident.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/item.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/item.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/item.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/item.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lib.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lib.rs index 1c16c1196..ebaa4cb 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lib.rs +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lib.rs
@@ -249,7 +249,7 @@ //! dynamic library libproc_macro from rustc toolchain. // Syn types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/syn/2.0.90")] +#![doc(html_root_url = "https://docs.rs/syn/2.0.91")] #![cfg_attr(docsrs, feature(doc_cfg))] #![deny(unsafe_op_in_unsafe_fn)] #![allow(non_camel_case_types)]
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lifetime.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lifetime.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lifetime.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lifetime.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lit.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lit.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lit.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lit.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lookahead.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lookahead.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lookahead.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lookahead.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/mac.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/mac.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/mac.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/mac.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/macros.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/macros.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/macros.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/macros.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/meta.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/meta.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/meta.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/meta.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/op.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/op.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/op.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/op.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse_macro_input.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse_macro_input.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse_macro_input.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse_macro_input.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse_quote.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse_quote.rs similarity index 89% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse_quote.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse_quote.rs index fa7ea79..2db20597 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse_quote.rs +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse_quote.rs
@@ -53,11 +53,22 @@ /// /// - [`Attribute`] — parses one attribute, allowing either outer like `#[...]` /// or inner like `#![...]` +/// - [`Vec<Attribute>`] — parses multiple attributes, including mixed kinds in +/// any order /// - [`Punctuated<T, P>`] — parses zero or more `T` separated by punctuation /// `P` with optional trailing punctuation +/// - [`Vec<Arm>`] — parses arms separated by optional commas according to the +/// same grammar as the inside of a `match` expression /// - [`Vec<Stmt>`] — parses the same as `Block::parse_within` +/// - [`Pat`], [`Box<Pat>`] — parses the same as +/// `Pat::parse_multi_with_leading_vert` +/// - [`Field`] — parses a named or unnamed struct field /// +/// [`Vec<Attribute>`]: Attribute +/// [`Vec<Arm>`]: Arm /// [`Vec<Stmt>`]: Block::parse_within +/// [`Pat`]: Pat::parse_multi_with_leading_vert +/// [`Box<Pat>`]: Pat::parse_multi_with_leading_vert /// /// # Panics /// @@ -140,7 +151,7 @@ #[cfg(any(feature = "full", feature = "derive"))] use crate::{attr, Attribute, Field, FieldMutability, Ident, Type, Visibility}; #[cfg(feature = "full")] -use crate::{Block, Pat, Stmt}; +use crate::{Arm, Block, Pat, Stmt}; #[cfg(any(feature = "full", feature = "derive"))] impl ParseQuote for Attribute { @@ -220,3 +231,10 @@ Block::parse_within(input) } } + +#[cfg(feature = "full")] +impl ParseQuote for Vec<Arm> { + fn parse(input: ParseStream) -> Result<Self> { + Arm::parse_multiple(input) + } +}
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/pat.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/pat.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/pat.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/pat.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/path.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/path.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/path.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/path.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/precedence.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/precedence.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/precedence.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/precedence.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/print.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/print.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/print.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/print.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/punctuated.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/punctuated.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/punctuated.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/punctuated.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/restriction.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/restriction.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/restriction.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/restriction.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/scan_expr.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/scan_expr.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/scan_expr.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/scan_expr.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/sealed.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/sealed.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/sealed.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/sealed.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/span.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/span.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/span.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/span.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/spanned.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/spanned.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/spanned.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/spanned.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/stmt.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/stmt.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/stmt.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/stmt.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/thread.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/thread.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/thread.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/thread.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/token.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/token.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/token.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/token.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/tt.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/tt.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/tt.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/tt.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/ty.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/ty.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/ty.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/ty.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/verbatim.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/verbatim.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/verbatim.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/verbatim.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/whitespace.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/whitespace.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/whitespace.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/whitespace.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/common/eq.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/common/eq.rs similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/common/eq.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/common/eq.rs index af1f616..f857f64 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/common/eq.rs +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/common/eq.rs
@@ -15,7 +15,6 @@ use rustc_ast::ast::AssocItemConstraintKind; use rustc_ast::ast::AssocItemKind; use rustc_ast::ast::AttrArgs; -use rustc_ast::ast::AttrArgsEq; use rustc_ast::ast::AttrId; use rustc_ast::ast::AttrItem; use rustc_ast::ast::AttrKind; @@ -150,6 +149,8 @@ use rustc_ast::ast::TyKind; use rustc_ast::ast::UintTy; use rustc_ast::ast::UnOp; +use rustc_ast::ast::UnsafeBinderCastKind; +use rustc_ast::ast::UnsafeBinderTy; use rustc_ast::ast::UnsafeSource; use rustc_ast::ast::UseTree; use rustc_ast::ast::UseTreeKind; @@ -309,6 +310,7 @@ }; } +spanless_eq_partial_eq!(()); spanless_eq_partial_eq!(bool); spanless_eq_partial_eq!(u8); spanless_eq_partial_eq!(u16); @@ -494,7 +496,7 @@ spanless_eq_struct!(EnumDef; variants); spanless_eq_struct!(Expr; id kind span attrs !tokens); spanless_eq_struct!(ExprField; attrs id span ident expr is_shorthand is_placeholder); -spanless_eq_struct!(FieldDef; attrs id span vis safety ident ty is_placeholder); +spanless_eq_struct!(FieldDef; attrs id span vis safety ident ty default is_placeholder); spanless_eq_struct!(Fn; defaultness generics sig body); spanless_eq_struct!(FnDecl; inputs output); spanless_eq_struct!(FnHeader; constness coroutine_kind safety ext); @@ -543,6 +545,7 @@ spanless_eq_struct!(TyAlias; defaultness generics where_clauses bounds ty); spanless_eq_struct!(TyAliasWhereClause; !has_where_token span); spanless_eq_struct!(TyAliasWhereClauses; before after !split); +spanless_eq_struct!(UnsafeBinderTy; generic_params inner_ty); spanless_eq_struct!(UseTree; prefix kind span); spanless_eq_struct!(Variant; attrs id span !vis ident data disr_expr is_placeholder); spanless_eq_struct!(Visibility; kind span tokens); @@ -555,8 +558,7 @@ spanless_eq_enum!(AsmMacro; Asm GlobalAsm NakedAsm); spanless_eq_enum!(AssocItemConstraintKind; Equality(term) Bound(bounds)); spanless_eq_enum!(AssocItemKind; Const(0) Fn(0) Type(0) MacCall(0) Delegation(0) DelegationMac(0)); -spanless_eq_enum!(AttrArgs; Empty Delimited(0) Eq(0 1)); -spanless_eq_enum!(AttrArgsEq; Ast(0) Hir(0)); +spanless_eq_enum!(AttrArgs; Empty Delimited(0) Eq(eq_span expr)); spanless_eq_enum!(AttrStyle; Outer Inner); spanless_eq_enum!(AttrTokenTree; Token(0 1) Delimited(0 1 2 3) AttrsTarget(0)); spanless_eq_enum!(BinOpKind; Add Sub Mul Div Rem And Or BitXor BitAnd BitOr Shl Shr Eq Lt Le Ne Ge Gt); @@ -601,10 +603,10 @@ spanless_eq_enum!(MatchKind; Prefix Postfix); spanless_eq_enum!(MetaItemKind; Word List(0) NameValue(0)); spanless_eq_enum!(MetaItemInner; MetaItem(0) Lit(0)); -spanless_eq_enum!(ModKind; Loaded(0 1 2) Unloaded); +spanless_eq_enum!(ModKind; Loaded(0 1 2 3) Unloaded); spanless_eq_enum!(Movability; Static Movable); spanless_eq_enum!(Mutability; Mut Not); -spanless_eq_enum!(PatFieldsRest; Rest None); +spanless_eq_enum!(PatFieldsRest; Rest Recovered(0) None); spanless_eq_enum!(PreciseCapturingArg; Lifetime(0) Arg(0 1)); spanless_eq_enum!(RangeEnd; Included(0) Excluded); spanless_eq_enum!(RangeLimits; HalfOpen Closed); @@ -618,6 +620,7 @@ spanless_eq_enum!(TraitObjectSyntax; Dyn DynStar None); spanless_eq_enum!(UintTy; Usize U8 U16 U32 U64 U128); spanless_eq_enum!(UnOp; Deref Not Neg); +spanless_eq_enum!(UnsafeBinderCastKind; Wrap Unwrap); spanless_eq_enum!(UnsafeSource; CompilerGenerated UserProvided); spanless_eq_enum!(UseTreeKind; Simple(0) Nested(items span) Glob); spanless_eq_enum!(VariantData; Struct(fields recovered) Tuple(0 1) Unit(0)); @@ -633,7 +636,8 @@ Assign(0 1 2) AssignOp(0 1 2) Field(0 1) Index(0 1 2) Underscore Range(0 1 2) Path(0 1) AddrOf(0 1 2) Break(0 1) Continue(0) Ret(0) InlineAsm(0) OffsetOf(0 1) MacCall(0) Struct(0) Repeat(0 1) Paren(0) Try(0) - Yield(0) Yeet(0) Become(0) IncludedBytes(0) FormatArgs(0) Err(0) Dummy); + Yield(0) Yeet(0) Become(0) IncludedBytes(0) FormatArgs(0) + UnsafeBinderCast(0 1 2) Err(0) Dummy); spanless_eq_enum!(InlineAsmOperand; In(reg expr) Out(reg late expr) InOut(reg late expr) SplitInOut(reg late in_expr out_expr) Const(anon_const) Sym(sym) Label(block)); @@ -645,10 +649,11 @@ Int(0 1) Float(0 1) Bool(0) Err(0)); spanless_eq_enum!(PatKind; Wild Ident(0 1 2) Struct(0 1 2 3) TupleStruct(0 1 2) Or(0) Path(0 1) Tuple(0) Box(0) Deref(0) Ref(0 1) Lit(0) Range(0 1 2) - Slice(0) Rest Never Paren(0) MacCall(0) Err(0)); + Slice(0) Rest Never Guard(0 1) Paren(0) MacCall(0) Err(0)); spanless_eq_enum!(TyKind; Slice(0) Array(0 1) Ptr(0) Ref(0 1) PinnedRef(0 1) - BareFn(0) Never Tup(0) Path(0 1) TraitObject(0 1) ImplTrait(0 1) Paren(0) - Typeof(0) Infer ImplicitSelf MacCall(0) CVarArgs Pat(0 1) Dummy Err(0)); + BareFn(0) UnsafeBinder(0) Never Tup(0) Path(0 1) TraitObject(0 1) + ImplTrait(0 1) Paren(0) Typeof(0) Infer ImplicitSelf MacCall(0) CVarArgs + Pat(0 1) Dummy Err(0)); impl SpanlessEq for Ident { fn eq(&self, other: &Self) -> bool { @@ -717,8 +722,8 @@ impl SpanlessEq for TokenStream { fn eq(&self, other: &Self) -> bool { - let mut this_trees = self.trees(); - let mut other_trees = other.trees(); + let mut this_trees = self.iter(); + let mut other_trees = other.iter(); loop { let this = match this_trees.next() { None => return other_trees.next().is_none(), @@ -776,7 +781,7 @@ Some(TokenTree::Delimited(_span, _spacing, Delimiter::Bracket, stream)) => stream, _ => return false, }; - let mut trees = stream.trees(); + let mut trees = stream.iter(); match trees.next() { Some(TokenTree::Token( Token { @@ -828,16 +833,6 @@ } } -fn is_escaped_literal_attr_args(value: &AttrArgsEq, unescaped: Symbol) -> bool { - match value { - AttrArgsEq::Ast(expr) => match &expr.kind { - ExprKind::Lit(lit) => is_escaped_lit(lit, unescaped), - _ => false, - }, - AttrArgsEq::Hir(lit) => is_escaped_literal_meta_item_lit(lit, unescaped), - } -} - fn is_escaped_literal_meta_item_lit(lit: &MetaItemLit, unescaped: Symbol) -> bool { match lit { MetaItemLit { @@ -898,9 +893,10 @@ SpanlessEq::eq(&path, &normal2.item.path) && match &normal2.item.args { AttrArgs::Empty | AttrArgs::Delimited(_) => false, - AttrArgs::Eq(_span, value) => { - is_escaped_literal_attr_args(value, *unescaped) - } + AttrArgs::Eq { eq_span: _, expr } => match &expr.kind { + ExprKind::Lit(lit) => is_escaped_lit(lit, *unescaped), + _ => false, + }, } } (AttrKind::Normal(_), AttrKind::DocComment(..)) => SpanlessEq::eq(other, self),
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/common/mod.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/common/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/common/mod.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/common/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/common/parse.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/common/parse.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/common/parse.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/common/parse.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/debug/gen.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/debug/gen.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/debug/gen.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/debug/gen.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/debug/mod.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/debug/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/debug/mod.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/debug/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/macros/mod.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/macros/mod.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/macros/mod.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/macros/mod.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/regression.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/regression.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/regression.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/regression.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/regression/issue1108.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/regression/issue1108.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/regression/issue1108.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/regression/issue1108.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/regression/issue1235.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/regression/issue1235.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/regression/issue1235.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/regression/issue1235.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/repo/mod.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/repo/mod.rs similarity index 92% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/repo/mod.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/repo/mod.rs index 96f039c..81b29e2a 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/repo/mod.rs +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/repo/mod.rs
@@ -15,7 +15,7 @@ use tar::Archive; use walkdir::{DirEntry, WalkDir}; -const REVISION: &str = "86d69c705a552236a622eee3fdea94bf13c5f102"; +const REVISION: &str = "0aeaa5eb22180fdf12a8489e63c4daa18da6f236"; #[rustfmt::skip] static EXCLUDE_FILES: &[&str] = &[ @@ -29,11 +29,32 @@ "tests/rustdoc/inline_cross/auxiliary/non_lifetime_binders.rs", "tests/rustdoc/non_lifetime_binders.rs", + // TODO: unsafe binders: `unsafe<'a> &'a T` + // https://github.com/dtolnay/syn/issues/1791 + "src/tools/rustfmt/tests/source/unsafe-binders.rs", + "src/tools/rustfmt/tests/target/unsafe-binders.rs", + + // TODO: unsafe fields: `struct S { unsafe field: T }` + // https://github.com/dtolnay/syn/issues/1792 + "src/tools/rustfmt/tests/source/unsafe-field.rs", + "src/tools/rustfmt/tests/target/unsafe-field.rs", + "tests/ui/unsafe-fields/auxiliary/unsafe-fields-crate-dep.rs", + + // TODO: guard patterns: `match expr { (A if f()) | (B if g()) => {} }` + // https://github.com/dtolnay/syn/issues/1793 + "src/tools/rustfmt/tests/target/guard_patterns.rs", + + // TODO: struct field default: `struct S { field: i32 = 1 }` + // https://github.com/dtolnay/syn/issues/1774 + "tests/ui/structs/auxiliary/struct_field_default.rs", + "tests/ui/structs/default-field-values-support.rs", + // TODO: return type notation: `where T: Trait<method(): Send>` and `where T::method(..): Send` // https://github.com/dtolnay/syn/issues/1434 - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/return_type_syntax_assoc_type_bound.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/return_type_syntax_in_path.rs", "src/tools/rustfmt/tests/target/return-type-notation.rs", + "tests/ui/associated-type-bounds/all-generics-lookup.rs", + "tests/ui/associated-type-bounds/implied-from-self-where-clause.rs", "tests/ui/associated-type-bounds/return-type-notation/basic.rs", "tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.rs", "tests/ui/associated-type-bounds/return-type-notation/namespace-conflict.rs", @@ -169,6 +190,15 @@ // https://github.com/dtolnay/syn/issues/1632 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/const_trait_bound.rs", "tests/ui/generic-const-items/const-trait-impl.rs", + "tests/ui/traits/const-traits/const-bound-in-host.rs", + "tests/ui/traits/const-traits/const-drop.rs", + "tests/ui/traits/const-traits/const-impl-trait.rs", + "tests/ui/traits/const-traits/const-in-closure.rs", + "tests/ui/traits/const-traits/dont-ice-on-const-pred-for-bounds.rs", + "tests/ui/traits/const-traits/effects/auxiliary/minicore.rs", + "tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs", + "tests/ui/traits/const-traits/effects/minicore-const-fn-early-bound.rs", + "tests/ui/traits/const-traits/predicate-entailment-passes.rs", "tests/ui/traits/const-traits/tilde-const-syntax.rs", // TODO: unparenthesized half-open range pattern inside slice pattern: `[1..]` @@ -180,7 +210,7 @@ // https://github.com/dtolnay/syn/issues/1770 "src/tools/rustfmt/tests/source/pin_sugar.rs", "src/tools/rustfmt/tests/target/pin_sugar.rs", - "tests/ui/async-await/pin-sugar.rs", + "tests/ui/async-await/pin-ergonomics/sugar.rs", // TODO: `|| .. .method()` "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/closure_range_method_call.rs", @@ -231,10 +261,8 @@ "tests/rustdoc/generic-associated-types/gats.rs", // Deprecated trait object syntax with parenthesized generic arguments and no dyn keyword - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/bare_dyn_types_with_paren_as_generic_args.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/path_fn_trait_args.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/typepathfn_with_coloncolon.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/value_parameters_no_patterns.rs", "src/tools/rustfmt/tests/source/attrib.rs", "src/tools/rustfmt/tests/source/closure.rs", "src/tools/rustfmt/tests/source/existential_type.rs", @@ -268,7 +296,10 @@ "tests/ui/parser/bounds-obj-parens.rs", // Various extensions to Rust syntax made up by rust-analyzer + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/assoc_type_bound.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/const_param_default_path.rs", + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/field_expr.rs", + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/generic_arg_bounds.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/use_tree_abs_star.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0015_use_tree.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0029_range_forms.rs", @@ -305,6 +336,7 @@ "tests/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs", "tests/ui/editions/edition-keywords-2015-2015.rs", "tests/ui/editions/edition-keywords-2015-2018.rs", + "tests/ui/lint/keyword-idents/auxiliary/multi_file_submod.rs", "tests/ui/lint/lint_pre_expansion_extern_module_aux.rs", "tests/ui/macros/macro-comma-support-rpass.rs", "tests/ui/macros/try-macro.rs",
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/repo/progress.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/repo/progress.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/repo/progress.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/repo/progress.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_asyncness.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_asyncness.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_asyncness.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_asyncness.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_attribute.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_attribute.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_attribute.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_attribute.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_derive_input.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_derive_input.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_derive_input.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_derive_input.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_expr.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_expr.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_expr.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_expr.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_generics.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_generics.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_generics.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_generics.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_grouping.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_grouping.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_grouping.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_grouping.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_ident.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_ident.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_ident.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_ident.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_item.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_item.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_item.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_item.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_iterators.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_iterators.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_iterators.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_iterators.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_lit.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_lit.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_lit.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_lit.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_meta.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_meta.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_meta.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_meta.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_parse_buffer.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_parse_buffer.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_parse_buffer.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_parse_buffer.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_parse_quote.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_parse_quote.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_parse_quote.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_parse_quote.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_parse_stream.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_parse_stream.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_parse_stream.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_parse_stream.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_pat.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_pat.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_pat.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_pat.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_path.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_path.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_path.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_path.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_precedence.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_precedence.rs similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_precedence.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_precedence.rs index e64cbf1d..c7b4acec 100644 --- a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_precedence.rs +++ b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_precedence.rs
@@ -205,12 +205,11 @@ ExprKind, GenericArg, GenericBound, Local, LocalKind, Pat, PolyTraitRef, Stmt, StmtKind, StructExpr, StructRest, TraitBoundModifiers, Ty, }; - use rustc_ast::mut_visit::{walk_flat_map_assoc_item, MutVisitor}; + use rustc_ast::mut_visit::{visit_clobber, walk_flat_map_assoc_item, MutVisitor}; use rustc_ast::visit::{AssocCtxt, BoundKind}; use rustc_data_structures::flat_map_in_place::FlatMapInPlace; use rustc_span::DUMMY_SP; use smallvec::SmallVec; - use std::mem; use std::ops::DerefMut; use thin_vec::ThinVec; @@ -280,19 +279,13 @@ match e.kind { ExprKind::Block(..) | ExprKind::If(..) | ExprKind::Let(..) => {} ExprKind::Binary(..) if contains_let_chain(e) => {} - _ => { - let inner = mem::replace( - e, - P(Expr { - id: ast::DUMMY_NODE_ID, - kind: ExprKind::Dummy, - span: DUMMY_SP, - attrs: ThinVec::new(), - tokens: None, - }), - ); - e.kind = ExprKind::Paren(inner); - } + _ => visit_clobber(&mut **e, |inner| Expr { + id: ast::DUMMY_NODE_ID, + kind: ExprKind::Paren(P(inner)), + span: DUMMY_SP, + attrs: ThinVec::new(), + tokens: None, + }), } }
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_receiver.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_receiver.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_receiver.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_receiver.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_round_trip.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_round_trip.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_round_trip.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_round_trip.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_shebang.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_shebang.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_shebang.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_shebang.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_size.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_size.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_size.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_size.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_stmt.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_stmt.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_stmt.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_stmt.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_token_trees.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_token_trees.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_token_trees.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_token_trees.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_ty.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_ty.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_ty.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_ty.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_unparenthesize.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_unparenthesize.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_unparenthesize.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_unparenthesize.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_visibility.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_visibility.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/test_visibility.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/test_visibility.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/zzz_stable.rs b/third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/zzz_stable.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/syn-2.0.90/tests/zzz_stable.rs rename to third_party/rust/chromium_crates_io/vendor/syn-2.0.91/tests/zzz_stable.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/.cargo_vcs_info.json deleted file mode 100644 index fae18335d..0000000 --- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "4afac90195d3032eee7f1651111c0e78dd5b99a3" - }, - "path_in_vcs": "" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo_vcs_info.json new file mode 100644 index 0000000..290ed7d --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "659e6c1f1f683b7504e71b6773cf0cdb86b1faf3" + }, + "path_in_vcs": "" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/.gitignore b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.gitignore similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/.gitignore rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.gitignore
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/CHANGELOG.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/CHANGELOG.md similarity index 82% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/CHANGELOG.md rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/CHANGELOG.md index 6430aa3..b40a48d6 100644 --- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/CHANGELOG.md +++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/CHANGELOG.md
@@ -1,5 +1,11 @@ # Changelog +## 1.8.1 + +* [e00E](https://github.com/e00E) updated the rustc features so that they all + correctly depend on the lower version feature. + [pr 199](https://github.com/Lokathor/tinyvec/pull/199) + ## 1.8 * [Fuuzetsu](https://github.com/Fuuzetsu) added the `ArrayVec::as_inner` method. @@ -68,13 +74,13 @@ ## 1.1.0 * [slightlyoutofphase](https://github.com/slightlyoutofphase) -added "array splat" style syntax to the `array_vec!` and `tiny_vec!` macros. -You can now write `array_vec![true; 5]` and get a length 5 array vec full of `true`, -just like normal array initialization allows. Same goes for `tiny_vec!`. -([pr 118](https://github.com/Lokathor/tinyvec/pull/118)) + added "array splat" style syntax to the `array_vec!` and `tiny_vec!` macros. + You can now write `array_vec![true; 5]` and get a length 5 array vec full of `true`, + just like normal array initialization allows. Same goes for `tiny_vec!`. + ([pr 118](https://github.com/Lokathor/tinyvec/pull/118)) * [not-a-seagull](https://github.com/not-a-seagull) -added `ArrayVec::into_inner` so that you can get the array out of an `ArrayVec`. -([pr 124](https://github.com/Lokathor/tinyvec/pull/124)) + added `ArrayVec::into_inner` so that you can get the array out of an `ArrayVec`. + ([pr 124](https://github.com/Lokathor/tinyvec/pull/124)) ## 1.0.2
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml index 8423ac1c..564cdff2 100644 --- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml
@@ -12,7 +12,7 @@ [package] edition = "2018" name = "tinyvec" -version = "1.8.0" +version = "1.8.1" authors = ["Lokathor <zefria@gmail.com>"] build = false exclude = [ @@ -69,12 +69,8 @@ path = "src/lib.rs" [[test]] -name = "tinyvec" -path = "tests/tinyvec.rs" -required-features = [ - "alloc", - "std", -] +name = "arrayvec" +path = "tests/arrayvec.rs" [[test]] name = "debugger_visualizer" @@ -83,8 +79,12 @@ required-features = ["debugger_visualizer"] [[test]] -name = "arrayvec" -path = "tests/arrayvec.rs" +name = "tinyvec" +path = "tests/tinyvec.rs" +required-features = [ + "alloc", + "std", +] [[bench]] name = "macros" @@ -138,7 +138,7 @@ nightly_slice_partition_dedup = [] real_blackbox = ["criterion/real_blackbox"] rustc_1_40 = [] -rustc_1_55 = [] +rustc_1_55 = ["rustc_1_40"] rustc_1_57 = ["rustc_1_55"] -rustc_1_61 = [] +rustc_1_61 = ["rustc_1_57"] std = ["alloc"]
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml.orig similarity index 97% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml.orig index 44e7a7e1..f46fc01 100644 --- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml.orig
@@ -1,7 +1,7 @@ [package] name = "tinyvec" description = "`tinyvec` provides 100% safe vec-like data structures." -version = "1.8.0" +version = "1.8.1" authors = ["Lokathor <zefria@gmail.com>"] edition = "2018" license = "Zlib OR Apache-2.0 OR MIT" @@ -35,7 +35,7 @@ # features that require rustc 1.55 # use const generics to implement Array for all array lengths -rustc_1_55 = [] +rustc_1_55 = ["rustc_1_40"] # features that require rustc 1.57 # add try_reserve functions to types that heap allocate. @@ -43,7 +43,7 @@ # features that require rustc 1.61 # add retain_mut function to TinyVec -rustc_1_61 = [] +rustc_1_61 = ["rustc_1_57"] # allow use of nightly feature `slice_partition_dedup`, # will become useless once that is stabilized:
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/LICENSE-APACHE.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-APACHE.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/LICENSE-APACHE.md rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-APACHE.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/LICENSE-MIT.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-MIT.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/LICENSE-MIT.md rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-MIT.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/LICENSE-ZLIB.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-ZLIB.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/LICENSE-ZLIB.md rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-ZLIB.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/README.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/README.md rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/benches/macros.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/benches/macros.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/benches/macros.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/benches/macros.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/benches/smallvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/benches/smallvec.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/benches/smallvec.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/benches/smallvec.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/debug_metadata/README.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/debug_metadata/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/debug_metadata/README.md rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/debug_metadata/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/debug_metadata/tinyvec.natvis b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/debug_metadata/tinyvec.natvis similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/debug_metadata/tinyvec.natvis rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/debug_metadata/tinyvec.natvis index 873581df..7efccec 100644 --- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/debug_metadata/tinyvec.natvis +++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/debug_metadata/tinyvec.natvis
@@ -1,24 +1,24 @@ -<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> - <Type Name="tinyvec::arrayvec::ArrayVec<array$<*,*>>"> - <DisplayString>{{ len={len} }}</DisplayString> - <Expand> - <Item Name="[len]">len</Item> - <Item Name="[capacity]">$T2</Item> - <ArrayItems> - <Size>len</Size> - <ValuePointer>($T1*)data</ValuePointer> - </ArrayItems> - </Expand> - </Type> - - <Type Name="tinyvec::slicevec::SliceVec<*>"> - <DisplayString>{{ len={len} }}</DisplayString> - <Expand> - <Item Name="[len]">len</Item> - <ArrayItems> - <Size>len</Size> - <ValuePointer>data.data_ptr</ValuePointer> - </ArrayItems> - </Expand> - </Type> +<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> + <Type Name="tinyvec::arrayvec::ArrayVec<array$<*,*>>"> + <DisplayString>{{ len={len} }}</DisplayString> + <Expand> + <Item Name="[len]">len</Item> + <Item Name="[capacity]">$T2</Item> + <ArrayItems> + <Size>len</Size> + <ValuePointer>($T1*)data</ValuePointer> + </ArrayItems> + </Expand> + </Type> + + <Type Name="tinyvec::slicevec::SliceVec<*>"> + <DisplayString>{{ len={len} }}</DisplayString> + <Expand> + <Item Name="[len]">len</Item> + <ArrayItems> + <Size>len</Size> + <ValuePointer>data.data_ptr</ValuePointer> + </ArrayItems> + </Expand> + </Type> </AutoVisualizer> \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/rustfmt.toml b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/rustfmt.toml similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/rustfmt.toml rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/rustfmt.toml
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/array.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/array.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/array/const_generic_impl.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/const_generic_impl.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/array/const_generic_impl.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/const_generic_impl.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/array/generated_impl.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/generated_impl.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/array/generated_impl.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/generated_impl.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/arrayvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/arrayvec.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec.rs index f40b6170..94b6fc7 100644 --- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/arrayvec.rs +++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec.rs
@@ -52,8 +52,8 @@ /// An array-backed, vector-like data structure. /// /// * `ArrayVec` has a fixed capacity, equal to the minimum of the array size -/// and `u16::MAX`. Note that not all capacities are necessarily supported by -/// default. See comments in [`Array`]. +/// and `u16::MAX`. Note that not all capacities are necessarily supported by +/// default. See comments in [`Array`]. /// * `ArrayVec` has a variable length, as you add and remove elements. Attempts /// to fill the vec beyond its capacity will cause a panic. /// * All of the vec's array slots are always initialized in terms of Rust's @@ -572,6 +572,7 @@ } let target = &mut self.as_mut_slice()[index..]; + #[allow(clippy::needless_range_loop)] for i in 0..target.len() { core::mem::swap(&mut item, &mut target[i]); } @@ -1857,6 +1858,7 @@ /// assert_eq!(v, &[1, 2, 3]); /// assert_eq!(v.capacity(), 13); /// ``` + #[inline] pub fn drain_to_vec_and_reserve(&mut self, n: usize) -> Vec<A::Item> { let cap = n + self.len(); let mut v = Vec::with_capacity(cap); @@ -1902,6 +1904,7 @@ /// assert_eq!(v, &[1, 2, 3]); /// assert_eq!(v.capacity(), 3); /// ``` + #[inline] pub fn drain_to_vec(&mut self) -> Vec<A::Item> { self.drain_to_vec_and_reserve(0) }
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/arrayvec_drain.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec_drain.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/arrayvec_drain.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec_drain.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs similarity index 98% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs index 3b9f00c..8ecd7715 100644 --- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/lib.rs +++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs
@@ -9,12 +9,13 @@ feature(debugger_visualizer), debugger_visualizer(natvis_file = "../debug_metadata/tinyvec.natvis") )] -#![cfg_attr(docs_rs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] #![warn(clippy::missing_inline_in_public_items)] #![warn(clippy::must_use_candidate)] #![warn(missing_docs)] #![allow(clippy::borrow_deref_ref)] #![allow(unused_imports)] +#![allow(unused_mut)] #![allow(clippy::write_with_newline)] #![allow(clippy::needless_return)]
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/slicevec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/slicevec.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/slicevec.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/slicevec.rs index 8856b53..90b8e9e 100644 --- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/slicevec.rs +++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/slicevec.rs
@@ -655,6 +655,7 @@ /// sv.push(13); /// assert_eq!(sv.grab_spare_slice().len(), 0); /// ``` + #[must_use] #[inline(always)] pub fn grab_spare_slice(&self) -> &[T] { &self.data[self.len..]
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/tinyvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/tinyvec.rs similarity index 98% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/tinyvec.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/tinyvec.rs index 974d0a8..953a47ae 100644 --- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/tinyvec.rs +++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/tinyvec.rs
@@ -1,5 +1,3 @@ -#![cfg(feature = "alloc")] - use super::*; use alloc::vec::{self, Vec}; @@ -35,7 +33,7 @@ /// let many_ints: TinyVec<[i32; 4]> = tiny_vec!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); /// ``` #[macro_export] -#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] +#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] macro_rules! tiny_vec { ($array_type:ty => $($elem:expr),* $(,)?) => { { @@ -94,7 +92,7 @@ /// let empty_tv = tiny_vec!([u8; 16]); /// let some_ints = tiny_vec!([i32; 4] => 1, 2, 3); /// ``` -#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] +#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] pub enum TinyVec<A: Array> { #[allow(missing_docs)] Inline(ArrayVec<A>), @@ -266,6 +264,7 @@ /// tv.shrink_to_fit(); /// assert!(tv.is_inline()); /// ``` + #[inline] pub fn shrink_to_fit(&mut self) { let vec = match self { TinyVec::Inline(_) => return, @@ -276,7 +275,7 @@ return vec.shrink_to_fit(); } - let moved_vec = core::mem::replace(vec, Vec::new()); + let moved_vec = core::mem::take(vec); let mut av = ArrayVec::default(); let mut rest = av.fill(moved_vec); @@ -339,6 +338,7 @@ /// assert!(tv.is_heap()); /// assert!(tv.capacity() >= 35); /// ``` + #[inline] pub fn move_to_the_heap_and_reserve(&mut self, n: usize) { let arr = match self { TinyVec::Heap(h) => return h.reserve(n), @@ -388,6 +388,7 @@ /// assert!(tv.is_heap()); /// assert!(tv.capacity() >= 5); /// ``` + #[inline] pub fn reserve(&mut self, n: usize) { let arr = match self { TinyVec::Heap(h) => return h.reserve(n), @@ -451,6 +452,7 @@ /// assert!(tv.is_heap()); /// assert!(tv.capacity() >= 5); /// ``` + #[inline] pub fn reserve_exact(&mut self, n: usize) { let arr = match self { TinyVec::Heap(h) => return h.reserve_exact(n), @@ -640,7 +642,7 @@ /// assert_eq!(tv.as_slice(), &[2, 4][..]); /// ``` #[inline] - pub fn retain<F: FnMut(&A::Item) -> bool>(self: &mut Self, acceptable: F) { + pub fn retain<F: FnMut(&A::Item) -> bool>(&mut self, acceptable: F) { match self { TinyVec::Inline(i) => i.retain(acceptable), TinyVec::Heap(h) => h.retain(acceptable), @@ -671,14 +673,14 @@ /// Helper for getting the mut slice. #[inline(always)] #[must_use] - pub fn as_mut_slice(self: &mut Self) -> &mut [A::Item] { + pub fn as_mut_slice(&mut self) -> &mut [A::Item] { self.deref_mut() } /// Helper for getting the shared slice. #[inline(always)] #[must_use] - pub fn as_slice(self: &Self) -> &[A::Item] { + pub fn as_slice(&self) -> &[A::Item] { self.deref() } @@ -838,8 +840,7 @@ if let Some(x) = arr.try_insert(index, item) { let mut v = Vec::with_capacity(arr.len() * 2); - let mut it = - arr.iter_mut().map(|r| core::mem::replace(r, Default::default())); + let mut it = arr.iter_mut().map(core::mem::take); v.extend(it.by_ref().take(index)); v.push(x); v.extend(it); @@ -1061,7 +1062,7 @@ /// Draining iterator for `TinyVecDrain` /// /// See [`TinyVecDrain::drain`](TinyVecDrain::<A>::drain) -#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] +#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] pub enum TinyVecDrain<'p, A: Array> { #[allow(missing_docs)] Inline(ArrayVecDrain<'p, A::Item>), @@ -1110,7 +1111,7 @@ /// Splicing iterator for `TinyVec` /// See [`TinyVec::splice`](TinyVec::<A>::splice) -#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] +#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] pub struct TinyVecSplice<'p, A: Array, I: Iterator<Item = A::Item>> { parent: &'p mut TinyVec<A>, removal_start: usize, @@ -1205,6 +1206,7 @@ impl<'p, A: Array, I: Iterator<Item = A::Item>> Drop for TinyVecSplice<'p, A, I> { + #[inline] fn drop(&mut self) { for _ in self.by_ref() {} @@ -1286,6 +1288,7 @@ } impl<A: Array> From<A> for TinyVec<A> { + #[inline] fn from(array: A) -> Self { TinyVec::Inline(ArrayVec::from(array)) } @@ -1330,7 +1333,7 @@ } /// Iterator for consuming an `TinyVec` and returning owned elements. -#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] +#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] pub enum TinyVecIterator<A: Array> { #[allow(missing_docs)] Inline(ArrayVecIterator<A>),
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/tests/arrayvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/arrayvec.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/tests/arrayvec.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/arrayvec.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/tests/debugger_visualizer.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/debugger_visualizer.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/tests/debugger_visualizer.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/debugger_visualizer.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/tests/tinyvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/tinyvec.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/tests/tinyvec.rs rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/tinyvec.rs
diff --git a/third_party/rust/chromium_crates_io/vet_config.toml.hbs b/third_party/rust/chromium_crates_io/vet_config.toml.hbs index 876ed3e..1b79113 100644 --- a/third_party/rust/chromium_crates_io/vet_config.toml.hbs +++ b/third_party/rust/chromium_crates_io/vet_config.toml.hbs
@@ -145,7 +145,7 @@ """ [[exemptions.syn]] -version = "2.0.90" +version = "2.0.91" criteria = ["safe-to-deploy", "crypto-safe", "ub-risk-2"] notes = """ Grandparented-in when setting up `cargo vet` in Jan 2024 @@ -175,6 +175,7 @@ Exemption updated to 2.0.85 when updating the crate in October 2024. Exemption updated to 2.0.87 when updating the crate in November 2024. Exemption updated to 2.0.90 when updating the crate in November 2024. +Exemption updated to 2.0.91 when updating the crate in December 2024. """ [[exemptions.zerocopy]]
diff --git a/third_party/rust/crc32fast/v1/BUILD.gn b/third_party/rust/crc32fast/v1/BUILD.gn index f540152..2042a33 100644 --- a/third_party/rust/crc32fast/v1/BUILD.gn +++ b/third_party/rust/crc32fast/v1/BUILD.gn
@@ -40,7 +40,10 @@ proc_macro_configs -= [ "//build/config/compiler:chromium_code" ] proc_macro_configs += [ "//build/config/compiler:no_chromium_code" ] deps = [ "//third_party/rust/cfg_if/v1:lib" ] - features = [ "std" ] + features = [ + "nightly", + "std", + ] rustflags = [ "--cap-lints=allow", # Suppress all warnings in crates.io crates ]
diff --git a/third_party/rust/foldhash/v0_1/BUILD.gn b/third_party/rust/foldhash/v0_1/BUILD.gn index aa05eda8..1ec4aec 100644 --- a/third_party/rust/foldhash/v0_1/BUILD.gn +++ b/third_party/rust/foldhash/v0_1/BUILD.gn
@@ -13,17 +13,17 @@ epoch = "0.1" crate_type = "rlib" crate_root = - "//third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/lib.rs" + "//third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/convenience.rs", - "//third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/src/seed.rs", + "//third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/convenience.rs", + "//third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/src/seed.rs", ] inputs = [] build_native_rust_unit_tests = false edition = "2021" - cargo_pkg_version = "0.1.3" + cargo_pkg_version = "0.1.4" cargo_pkg_authors = "Orson Peters <orsonpeters@gmail.com>" cargo_pkg_name = "foldhash" cargo_pkg_description =
diff --git a/third_party/rust/foldhash/v0_1/README.chromium b/third_party/rust/foldhash/v0_1/README.chromium index 8d4ef21..51d369e8 100644 --- a/third_party/rust/foldhash/v0_1/README.chromium +++ b/third_party/rust/foldhash/v0_1/README.chromium
@@ -1,9 +1,9 @@ Name: foldhash URL: https://crates.io/crates/foldhash -Version: 0.1.3 -Revision: dd2392d7dcf01112f2a8c84944da724b7f9a9c5c +Version: 0.1.4 +Revision: f2f514c17eeec8e06277836bc2b49c9ca2bc24ce License: Zlib -License File: //third_party/rust/chromium_crates_io/vendor/foldhash-0.1.3/LICENSE +License File: //third_party/rust/chromium_crates_io/vendor/foldhash-0.1.4/LICENSE Shipped: yes Security Critical: yes
diff --git a/third_party/rust/libc/v0_2/BUILD.gn b/third_party/rust/libc/v0_2/BUILD.gn index 36e47b5..9e3a4f6e 100644 --- a/third_party/rust/libc/v0_2/BUILD.gn +++ b/third_party/rust/libc/v0_2/BUILD.gn
@@ -13,191 +13,191 @@ epoch = "0.2" crate_type = "rlib" crate_root = - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/lib.rs" + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fixed_width_ints.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/aarch64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/riscv64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/fuchsia/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/hermit.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/macros.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/psp.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/sgx.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/aarch64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/arm.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/solid/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/switch.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/teeos/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/trusty.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/aix/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/aix/powerpc64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b32/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b64/aarch64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/b64/x86_64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/apple/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/dragonfly/errno.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/dragonfly/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/aarch64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/arm.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/powerpc.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/riscv64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/x86.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/freebsdlike/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/aarch64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/arm.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mips.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/powerpc.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/riscv64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/sparc64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/x86.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/aarch64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/arm.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/mips64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/powerpc.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/riscv64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/sparc64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/x86.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/bsd/netbsdlike/openbsd/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/b32.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/b64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/native.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/haiku/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/hurd/b32.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/hurd/b64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/hurd/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b32/arm.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b32/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b32/x86/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/aarch64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/riscv64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/b64/x86_64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/android/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/emscripten/lfs64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/emscripten/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/generic/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/mips/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/powerpc/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/arch/sparc/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/arm/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/csky/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/mips/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/powerpc.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b32/x86/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/s390x.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/gnu/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/arm/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/hexagon.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/mips/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/powerpc.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b32/x86/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/mips64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/powerpc64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/s390x.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/lfs64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/musl/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/arm/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mips/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/linux/uclibc/x86_64/other.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/linux_like/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/aarch64/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/arm/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/espidf/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/generic.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/horizon/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/powerpc/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/rtems/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/newlib/vita/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/aarch64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/neutrino.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nto/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/nuttx/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/redox/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/compat.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/illumos.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/solaris.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/x86.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/unix/solarish/x86_common.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/aarch64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/arm.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/powerpc.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/powerpc64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/riscv32.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/riscv64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/x86.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/vxworks/x86_64.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/wasi/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/wasi/p2.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/windows/gnu/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/windows/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/windows/msvc/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/src/xous.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fixed_width_ints.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/aarch64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/riscv64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/fuchsia/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/hermit.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/macros.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/psp.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/sgx.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/solid/aarch64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/solid/arm.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/solid/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/switch.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/teeos/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/trusty.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/aix/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/aix/powerpc64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b32/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b64/aarch64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/b64/x86_64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/apple/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/errno.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/aarch64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/arm.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/riscv64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/freebsdlike/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/aarch64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/arm.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mips.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/powerpc.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/sparc64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/aarch64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/arm.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mips64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/riscv64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/sparc64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/b32.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/b64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/native.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/haiku/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/hurd/b32.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/hurd/b64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/hurd/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b32/arm.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b32/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b32/x86/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/aarch64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/riscv64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/b64/x86_64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/android/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/emscripten/lfs64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/emscripten/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/generic/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/mips/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/powerpc/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/arch/sparc/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/arm/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/csky/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mips/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/powerpc.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/x86/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/s390x.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/gnu/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/arm/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/hexagon.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mips/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/powerpc.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b32/x86/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mips64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/powerpc64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/s390x.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/lfs64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/musl/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/arm/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/other.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/linux_like/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/aarch64/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/arm/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/espidf/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/generic.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/horizon/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/powerpc/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/rtems/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/newlib/vita/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/aarch64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/neutrino.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nto/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/nuttx/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/redox/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/compat.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/illumos.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/solaris.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/x86.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/unix/solarish/x86_common.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/aarch64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/arm.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/powerpc.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/powerpc64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/riscv32.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/riscv64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/x86.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/vxworks/x86_64.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/wasi/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/wasi/p2.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/windows/gnu/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/windows/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/windows/msvc/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/src/xous.rs", ] inputs = [] build_native_rust_unit_tests = false edition = "2021" - cargo_pkg_version = "0.2.168" + cargo_pkg_version = "0.2.169" cargo_pkg_authors = "The Rust Project Developers" cargo_pkg_name = "libc" cargo_pkg_description = "Raw FFI bindings to platform libraries like libc." @@ -209,9 +209,9 @@ proc_macro_configs += [ "//build/config/compiler:no_chromium_code" ] features = [ "std" ] build_root = - "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/build.rs" + "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/build.rs" build_sources = - [ "//third_party/rust/chromium_crates_io/vendor/libc-0.2.168/build.rs" ] + [ "//third_party/rust/chromium_crates_io/vendor/libc-0.2.169/build.rs" ] rustflags = [ "--cap-lints=allow", # Suppress all warnings in crates.io crates ]
diff --git a/third_party/rust/libc/v0_2/README.chromium b/third_party/rust/libc/v0_2/README.chromium index 209d9ea..e43e5bcd 100644 --- a/third_party/rust/libc/v0_2/README.chromium +++ b/third_party/rust/libc/v0_2/README.chromium
@@ -1,9 +1,9 @@ Name: libc URL: https://crates.io/crates/libc -Version: 0.2.168 -Revision: e6082ef26096154e08ab0cb094d66d5ca116ee15 +Version: 0.2.169 +Revision: bb5944c67d6f7f3ead944120ec30561731b427de License: Apache-2.0 -License File: //third_party/rust/chromium_crates_io/vendor/libc-0.2.168/LICENSE-APACHE +License File: //third_party/rust/chromium_crates_io/vendor/libc-0.2.169/LICENSE-APACHE Shipped: yes Security Critical: yes
diff --git a/third_party/rust/png/v0_17/BUILD.gn b/third_party/rust/png/v0_17/BUILD.gn index 89cb8638..faaa088a 100644 --- a/third_party/rust/png/v0_17/BUILD.gn +++ b/third_party/rust/png/v0_17/BUILD.gn
@@ -13,33 +13,33 @@ epoch = "0.17" crate_type = "rlib" crate_root = - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/lib.rs" + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/adam7.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/benchable_apis.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/chunk.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/common.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/interlace_info.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/read_decoder.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/stream.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/transform.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/transform/palette.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/unfiltering_buffer.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/decoder/zlib.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/encoder.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/filter.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/srgb.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/test_utils.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/text_metadata.rs", - "//third_party/rust/chromium_crates_io/vendor/png-0.17.15/src/traits.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/adam7.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/benchable_apis.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/chunk.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/common.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/interlace_info.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/read_decoder.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/stream.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/transform.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/transform/palette.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/unfiltering_buffer.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/decoder/zlib.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/encoder.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/filter.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/srgb.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/test_utils.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/text_metadata.rs", + "//third_party/rust/chromium_crates_io/vendor/png-0.17.16/src/traits.rs", ] inputs = [] build_native_rust_unit_tests = false edition = "2018" - cargo_pkg_version = "0.17.15" + cargo_pkg_version = "0.17.16" cargo_pkg_authors = "The image-rs Developers" cargo_pkg_name = "png" cargo_pkg_description = "PNG decoding and encoding library in pure Rust"
diff --git a/third_party/rust/png/v0_17/README.chromium b/third_party/rust/png/v0_17/README.chromium index c2a4ec1..d09b0d6 100644 --- a/third_party/rust/png/v0_17/README.chromium +++ b/third_party/rust/png/v0_17/README.chromium
@@ -1,9 +1,9 @@ Name: png URL: https://crates.io/crates/png -Version: 0.17.15 -Revision: 10644dbff4d5b5614199cbc81145838abdafd98c +Version: 0.17.16 +Revision: fbf256669ff23594bf4c618b61fde6a52b79e088 License: Apache-2.0 -License File: //third_party/rust/chromium_crates_io/vendor/png-0.17.15/LICENSE-APACHE +License File: //third_party/rust/chromium_crates_io/vendor/png-0.17.16/LICENSE-APACHE Shipped: yes Security Critical: yes
diff --git a/third_party/rust/serde_json/v1/BUILD.gn b/third_party/rust/serde_json/v1/BUILD.gn index 30ac5bb..9bb54c2 100644 --- a/third_party/rust/serde_json/v1/BUILD.gn +++ b/third_party/rust/serde_json/v1/BUILD.gn
@@ -12,51 +12,51 @@ crate_name = "serde_json" epoch = "1" crate_type = "rlib" - crate_root = "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lib.rs" + crate_root = "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/de.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/error.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/io/core.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/io/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/iter.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/algorithm.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/bhcomp.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/bignum.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/cached.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/cached_float80.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/digit.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/errors.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/exponent.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/float.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/large_powers.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/large_powers32.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/large_powers64.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/math.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/num.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/parse.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/rounding.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/shift.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lexical/small_powers.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/macros.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/map.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/number.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/raw.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/read.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/ser.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/de.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/from.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/index.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/mod.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/partial_eq.rs", - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/src/value/ser.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/de.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/error.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/io/core.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/io/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/iter.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/algorithm.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/bhcomp.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/bignum.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/cached.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/cached_float80.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/digit.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/errors.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/exponent.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/float.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/large_powers.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/large_powers32.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/large_powers64.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/math.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/num.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/parse.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/rounding.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/shift.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lexical/small_powers.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/macros.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/map.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/number.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/raw.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/read.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/ser.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/de.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/from.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/index.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/mod.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/partial_eq.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/src/value/ser.rs", ] inputs = [] build_native_rust_unit_tests = false edition = "2021" - cargo_pkg_version = "1.0.133" + cargo_pkg_version = "1.0.134" cargo_pkg_authors = "Erick Tryzelaar <erick.tryzelaar@gmail.com>, David Tolnay <dtolnay@gmail.com>" cargo_pkg_name = "serde_json" cargo_pkg_description = "A JSON serialization file format" @@ -74,9 +74,9 @@ ] features = [ "std" ] build_root = - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/build.rs" + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/build.rs" build_sources = [ - "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/build.rs", + "//third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/build.rs", ] rustflags = [ "--cap-lints=allow", # Suppress all warnings in crates.io crates
diff --git a/third_party/rust/serde_json/v1/README.chromium b/third_party/rust/serde_json/v1/README.chromium index a145dbe8..e3dfe19f 100644 --- a/third_party/rust/serde_json/v1/README.chromium +++ b/third_party/rust/serde_json/v1/README.chromium
@@ -1,9 +1,9 @@ Name: serde_json URL: https://crates.io/crates/serde_json -Version: 1.0.133 -Revision: 0903de449c52c1b4a2271e909b7afb18909dc379 +Version: 1.0.134 +Revision: b2a1415aad0c76684c675d13a5746850d275c178 License: Apache-2.0 -License File: //third_party/rust/chromium_crates_io/vendor/serde_json-1.0.133/LICENSE-APACHE +License File: //third_party/rust/chromium_crates_io/vendor/serde_json-1.0.134/LICENSE-APACHE Shipped: no Security Critical: no
diff --git a/third_party/rust/syn/v2/BUILD.gn b/third_party/rust/syn/v2/BUILD.gn index 766c67f7..f5a275f 100644 --- a/third_party/rust/syn/v2/BUILD.gn +++ b/third_party/rust/syn/v2/BUILD.gn
@@ -13,69 +13,69 @@ epoch = "2" crate_type = "rlib" crate_root = - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lib.rs" + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/attr.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/bigint.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/buffer.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/classify.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/custom_keyword.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/custom_punctuation.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/data.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/derive.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/discouraged.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/drops.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/error.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/export.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/expr.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/ext.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/file.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/fixup.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/clone.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/debug.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/eq.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/fold.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/hash.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/visit.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/gen/visit_mut.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/generics.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/group.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/ident.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/item.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lifetime.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lit.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/lookahead.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/mac.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/macros.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/meta.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/op.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse_macro_input.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/parse_quote.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/pat.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/path.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/precedence.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/print.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/punctuated.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/restriction.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/scan_expr.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/sealed.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/span.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/spanned.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/stmt.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/thread.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/token.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/tt.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/ty.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/verbatim.rs", - "//third_party/rust/chromium_crates_io/vendor/syn-2.0.90/src/whitespace.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/attr.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/bigint.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/buffer.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/classify.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/custom_keyword.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/custom_punctuation.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/data.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/derive.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/discouraged.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/drops.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/error.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/export.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/expr.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/ext.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/file.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/fixup.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/clone.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/debug.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/eq.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/fold.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/hash.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/visit.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/gen/visit_mut.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/generics.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/group.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/ident.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/item.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lifetime.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lit.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/lookahead.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/mac.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/macros.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/meta.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/op.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse_macro_input.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/parse_quote.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/pat.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/path.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/precedence.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/print.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/punctuated.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/restriction.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/scan_expr.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/sealed.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/span.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/spanned.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/stmt.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/thread.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/token.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/tt.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/ty.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/verbatim.rs", + "//third_party/rust/chromium_crates_io/vendor/syn-2.0.91/src/whitespace.rs", ] inputs = [] build_native_rust_unit_tests = false edition = "2021" - cargo_pkg_version = "2.0.90" + cargo_pkg_version = "2.0.91" cargo_pkg_authors = "David Tolnay <dtolnay@gmail.com>" cargo_pkg_name = "syn" cargo_pkg_description = "Parser for Rust source code"
diff --git a/third_party/rust/syn/v2/README.chromium b/third_party/rust/syn/v2/README.chromium index ddc0b17..11284b6b 100644 --- a/third_party/rust/syn/v2/README.chromium +++ b/third_party/rust/syn/v2/README.chromium
@@ -1,9 +1,9 @@ Name: syn URL: https://crates.io/crates/syn -Version: 2.0.90 -Revision: ac5b41c852137c3d147202e3e6b2666c924cb87c +Version: 2.0.91 +Revision: 53de985062cbdc99ba002ac85a7926d49d92e611 License: Apache-2.0 -License File: //third_party/rust/chromium_crates_io/vendor/syn-2.0.90/LICENSE-APACHE +License File: //third_party/rust/chromium_crates_io/vendor/syn-2.0.91/LICENSE-APACHE Shipped: yes Security Critical: yes
diff --git a/third_party/rust/tinyvec/v1/BUILD.gn b/third_party/rust/tinyvec/v1/BUILD.gn index e7b0fdb..fc4803fe 100644 --- a/third_party/rust/tinyvec/v1/BUILD.gn +++ b/third_party/rust/tinyvec/v1/BUILD.gn
@@ -13,22 +13,22 @@ epoch = "1" crate_type = "rlib" crate_root = - "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/lib.rs" + "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/array.rs", - "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/array/const_generic_impl.rs", - "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/array/generated_impl.rs", - "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/arrayvec.rs", - "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/arrayvec_drain.rs", - "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/slicevec.rs", - "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/src/tinyvec.rs", + "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array.rs", + "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/const_generic_impl.rs", + "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/generated_impl.rs", + "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec.rs", + "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec_drain.rs", + "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/slicevec.rs", + "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/tinyvec.rs", ] inputs = [] build_native_rust_unit_tests = false edition = "2018" - cargo_pkg_version = "1.8.0" + cargo_pkg_version = "1.8.1" cargo_pkg_authors = "Lokathor <zefria@gmail.com>" cargo_pkg_name = "tinyvec" cargo_pkg_description = @@ -39,7 +39,10 @@ executable_configs += [ "//build/config/compiler:no_chromium_code" ] proc_macro_configs -= [ "//build/config/compiler:chromium_code" ] proc_macro_configs += [ "//build/config/compiler:no_chromium_code" ] - features = [ "rustc_1_55" ] + features = [ + "rustc_1_40", + "rustc_1_55", + ] rustflags = [ "--cap-lints=allow", # Suppress all warnings in crates.io crates ]
diff --git a/third_party/rust/tinyvec/v1/README.chromium b/third_party/rust/tinyvec/v1/README.chromium index b6042e0..ae0df96 100644 --- a/third_party/rust/tinyvec/v1/README.chromium +++ b/third_party/rust/tinyvec/v1/README.chromium
@@ -1,9 +1,9 @@ Name: tinyvec URL: https://crates.io/crates/tinyvec -Version: 1.8.0 -Revision: 4afac90195d3032eee7f1651111c0e78dd5b99a3 +Version: 1.8.1 +Revision: 659e6c1f1f683b7504e71b6773cf0cdb86b1faf3 License: Apache-2.0 -License File: //third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.0/LICENSE-APACHE.md +License File: //third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-APACHE.md Shipped: yes Security Critical: yes
diff --git a/third_party/skia b/third_party/skia index e011487..1c9c95e 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit e0114876f8a048dc5f1577938a03c14836d78763 +Subproject commit 1c9c95eb6f4341cca53936b4caddcb2d9546ed0d
diff --git a/third_party/webrtc b/third_party/webrtc index d243359..bee41a1 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit d243359901730e1c46e4b0bdf35baa0eb4b0198e +Subproject commit bee41a113add6a533f07d3bf77588e66fc39b4a0
diff --git a/tools/json_schema_compiler/cpp_bundle_generator.py b/tools/json_schema_compiler/cpp_bundle_generator.py index 54b0d3e..0526ad4 100644 --- a/tools/json_schema_compiler/cpp_bundle_generator.py +++ b/tools/json_schema_compiler/cpp_bundle_generator.py
@@ -38,7 +38,6 @@ _RemoveKey(ret, 'compiler_options', dict) _RemoveKey(ret, 'nodoc', bool) _RemoveKey(ret, 'nocompile', bool) - _RemoveKey(ret, 'noinline_doc', bool) _RemoveKey(ret, 'manifest_keys', object) return ret
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py index 02586154..cb7b8f46 100755 --- a/tools/json_schema_compiler/idl_schema.py +++ b/tools/json_schema_compiler/idl_schema.py
@@ -196,10 +196,6 @@ if self.node.GetProperty('nodoc'): result['nodoc'] = True - elif self.node.GetProperty('inline_doc'): - result['inline_doc'] = True - elif self.node.GetProperty('noinline_doc'): - result['noinline_doc'] = True return result @@ -420,9 +416,7 @@ 'type': 'string', 'enum': enum } - for property_name in [ - 'cpp_enum_prefix_override', 'inline_doc', 'noinline_doc', 'nodoc' - ]: + for property_name in ['cpp_enum_prefix_override', 'nodoc']: if self.node.GetProperty(property_name): result[property_name] = self.node.GetProperty(property_name) if self.node.GetProperty('deprecated'):
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 7bcc66c..e03cdf0 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -24578,6 +24578,7 @@ <int value="1646498561" label="OfflineBookmarks:disabled"/> <int value="1646500529" label="BacklightOcr:enabled"/> <int value="1649121568" label="DynamicTcmallocTuning:disabled"/> + <int value="1649168777" label="EdgeToEdgeSafeAreaConstraint:disabled"/> <int value="1649624189" label="PhoneHubFeatureSetupErrorHandling:disabled"/> <int value="1649986740" label="PrintManagementJelly:disabled"/> <int value="1650453540" label="ChipLocationIconOverride:disabled"/> @@ -24705,6 +24706,7 @@ <int value="1696139514" label="enable-ble-advertising-in-apps"/> <int value="1696579117" label="ForceOnDeviceAppControlsForAllRegions:enabled"/> + <int value="1696961375" label="EdgeToEdgeSafeAreaConstraint:enabled"/> <int value="1697189972" label="WebPaymentsSingleAppUiSkip:disabled"/> <int value="1697576315" label="ZeroSuggestPrefetchingOnWeb:enabled"/> <int value="1698089268" label="WebXRMultiGpu:disabled"/>
diff --git a/tools/metrics/histograms/metadata/android/enums.xml b/tools/metrics/histograms/metadata/android/enums.xml index 43f1b1f3..d55523c 100644 --- a/tools/metrics/histograms/metadata/android/enums.xml +++ b/tools/metrics/histograms/metadata/android/enums.xml
@@ -703,13 +703,15 @@ <int value="1" label="(XX) VR_DELEGATE (Deprecated)"/> <int value="2" label="(XX) AR_DELEGATE (Deprecated)"/> <int value="3" label="(02) SCENE_OVERLAY"/> - <int value="4" label="(05) START_SURFACE (with tab switcher if enabled)"/> + <int value="4" + label="(XX) START_SURFACE (with tab switcher if enabled. Deprecated)"/> <int value="5" label="(10) SELECTION_POPUP"/> <int value="6" label="(11) MANUAL_FILLING"/> <int value="7" label="(09) FULLSCREEN"/> <int value="8" label="(03) BOTTOM_SHEET"/> <int value="9" label="(13) TAB_MODAL_HANDLER"/> - <int value="10" label="(08) TAB_SWITCHER (if Start surface is disabled)"/> + <int value="10" + label="(XX) TAB_SWITCHER (if Start surface is disabled. Deprecated)"/> <int value="11" label="(14) CLOSE_WATCHER"/> <int value="12" label="(17) TAB_HISTORY"/> <int value="13" label="(XX) TAB_RETURN_TO_CHROME_START_SURFACE (Deprecated)"/>
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index 57f2b64e..8ce30316 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -4097,7 +4097,7 @@ </histogram> <histogram name="Ash.Float.FloatWindowCountsPerSession" units="windows" - expires_after="2025-02-10"> + expires_after="2025-12-23"> <owner>sammiequon@chromium.org</owner> <owner>chromeos-wm@google.com</owner> <summary> @@ -4109,7 +4109,7 @@ </histogram> <histogram name="Ash.Float.FloatWindowDuration" units="minutes" - expires_after="2025-04-13"> + expires_after="2025-12-23"> <owner>sammiequon@chromium.org</owner> <owner>chromeos-wm@chromium.org</owner> <summary> @@ -4123,7 +4123,7 @@ </histogram> <histogram name="Ash.Float.FloatWindowMoveToAnotherDeskCounts" units="windows" - expires_after="2025-01-05"> + expires_after="2025-12-23"> <owner>sammiequon@chromium.org</owner> <owner>chromeos-wm@chromium.org</owner> <summary> @@ -7689,7 +7689,7 @@ </histogram> <histogram name="Ash.PowerSoundsController.PluggedInBatteryLevel" units="%" - expires_after="2025-01-05"> + expires_after="2026-01-05"> <owner>hongyulong@chromium.org</owner> <owner>nupurjain@google.com</owner> <summary> @@ -7699,7 +7699,7 @@ </histogram> <histogram name="Ash.PowerSoundsController.UnpluggedBatteryLevel" units="%" - expires_after="2025-01-05"> + expires_after="2026-01-05"> <owner>hongyulong@chromium.org</owner> <owner>nupurjain@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index dacf447..d9c1017 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -179,7 +179,7 @@ <histogram base="true" name="Blink.AnchorElementMetricsIntersectionObserver.UpdateTime" - units="microseconds" expires_after="2025-04-13"> + units="microseconds" expires_after="2025-12-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeSuffixes" --> <owner>pdr@chromium.org</owner> @@ -1045,7 +1045,7 @@ </histogram> <histogram base="true" name="Blink.DisplayLockIntersectionObserver.UpdateTime" - units="microseconds" expires_after="2025-02-10"> + units="microseconds" expires_after="2025-12-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeSuffixes" --> <owner>pdr@chromium.org</owner> @@ -2865,7 +2865,7 @@ </histogram> <histogram base="true" name="Blink.IntersectionObservation.UpdateTime" - units="microseconds" expires_after="2025-06-15"> + units="microseconds" expires_after="2025-12-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeSuffixes" --> <owner>pdr@chromium.org</owner> @@ -2887,7 +2887,7 @@ <histogram base="true" name="Blink.IntersectionObservationInternalCount.UpdateTime" units="count" - expires_after="2024-12-08"> + expires_after="2025-12-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeSuffixes" --> <owner>szager@chromium.org</owner> @@ -2900,7 +2900,7 @@ <histogram base="true" name="Blink.IntersectionObservationJavascriptCount.UpdateTime" - units="count" expires_after="2024-12-08"> + units="count" expires_after="2025-12-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeSuffixes" --> <owner>szager@chromium.org</owner> @@ -2937,7 +2937,7 @@ </histogram> <histogram base="true" name="Blink.JavascriptIntersectionObserver.UpdateTime" - units="microseconds" expires_after="2025-02-10"> + units="microseconds" expires_after="2025-12-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeSuffixes" --> <owner>pdr@chromium.org</owner> @@ -3064,7 +3064,7 @@ </histogram> <histogram base="true" name="Blink.LazyLoadIntersectionObserver.UpdateTime" - units="microseconds" expires_after="2025-04-13"> + units="microseconds" expires_after="2025-12-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeSuffixes" --> <owner>pdr@chromium.org</owner> @@ -3727,7 +3727,7 @@ </histogram> <histogram base="true" name="Blink.MediaIntersectionObserver.UpdateTime" - units="microseconds" expires_after="2025-02-10"> + units="microseconds" expires_after="2025-12-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeSuffixes" --> <owner>pdr@chromium.org</owner> @@ -4030,7 +4030,7 @@ <histogram base="true" name="Blink.PermissionElementIntersectionObserver.UpdateTime" - units="microseconds" expires_after="2025-04-20"> + units="microseconds" expires_after="2025-12-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeSuffixes" --> <owner>tungnh@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/extensions/enums.xml b/tools/metrics/histograms/metadata/extensions/enums.xml index adadc08..fbc3a37 100644 --- a/tools/metrics/histograms/metadata/extensions/enums.xml +++ b/tools/metrics/histograms/metadata/extensions/enums.xml
@@ -2628,7 +2628,7 @@ label="DELETED_SMARTCARDPROVIDERPRIVATE_REPORTDISCONNECTRESULT"/> <int value="1770" label="WMDESKSPRIVATE_GETDESKBYID"/> <int value="1771" label="AUTOFILLPRIVATE_ISVALIDIBAN"/> - <int value="1772" label="ACCESSIBILITY_PRIVATE_ISLACROSPRIMARY"/> + <int value="1772" label="DELETED_ACCESSIBILITY_PRIVATE_ISLACROSPRIMARY"/> <int value="1773" label="POWER_REPORTACTIVITY"/> <int value="1774" label="PASSWORDSPRIVATE_CONTINUEIMPORT"/> <int value="1775" label="PASSWORDSPRIVATE_RESETIMPORTER"/> @@ -2689,7 +2689,7 @@ <int value="1828" label="OS_DIAGNOSTICS_CANCELROUTINE"/> <int value="1829" label="OS_DIAGNOSTICS_ISMEMORYROUTINEARGUMENTSUPPORTED"/> <int value="1830" - label="ACCESSIBILITY_PRIVATE_CLIPBOARDCOPYINACTIVELACROSGOOGLEDOC"/> + label="DELETED_ACCESSIBILITY_PRIVATE_CLIPBOARDCOPYINACTIVELACROSGOOGLEDOC"/> <int value="1831" label="USERSCRIPTS_UPDATE"/> <int value="1832" label="INPUTMETHODPRIVATE_GETLANGUAGEPACKSTATUS"/> <int value="1833" label="OS_DIAGNOSTICS_RUNFANROUTINE"/> @@ -2784,6 +2784,7 @@ <int value="1914" label="COOKIES_GETPARTITIONKEY"/> <int value="1915" label="CONTROLLEDFRAMEINTERNAL_SETCLIENTHINTSENABLED"/> <int value="1916" label="DEVELOPERPRIVATE_UPLOADEXTENSIONTOACCOUNT"/> + <int value="1917" label="USERSCRIPTS_EXECUTE"/> </enum> <enum name="ExtensionInstallationCrxInstallError">
diff --git a/tools/metrics/histograms/metadata/facilitated_payments/enums.xml b/tools/metrics/histograms/metadata/facilitated_payments/enums.xml index ff7f8b3..deec2c95 100644 --- a/tools/metrics/histograms/metadata/facilitated_payments/enums.xml +++ b/tools/metrics/histograms/metadata/facilitated_payments/enums.xml
@@ -40,6 +40,10 @@ <int value="8" label="InitiatePayment request failed"/> <int value="9" label="Action token not available"/> <int value="10" label="User logged out after selecting payment method"/> + <int value="11" + label="The FOP selector either wasn't shown, or was dismissed not as a + result of a user action"/> + <int value="12" label="The FOP selector was closed by the user"/> </enum> <!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:EwalletFlowExitedReason) -->
diff --git a/tools/metrics/histograms/metadata/facilitated_payments/histograms.xml b/tools/metrics/histograms/metadata/facilitated_payments/histograms.xml index 5f69c62..55f3fd2 100644 --- a/tools/metrics/histograms/metadata/facilitated_payments/histograms.xml +++ b/tools/metrics/histograms/metadata/facilitated_payments/histograms.xml
@@ -42,6 +42,39 @@ </variants> <histogram + name="FacilitatedPayments.Ewallet.FopSelectorShown.LatencyAfterDetectingPaymentLink" + units="ms" expires_after="2025-07-01"> + <owner>junhuihe@google.com</owner> + <owner>qihuizhao@google.com</owner> + <owner>rouslan@google.com</owner> + <owner>payments-autofill-team@google.com</owner> + <summary> + On a webpage with a valid payment link, this histogram logs the latency for + seeing the FOP selector since a payment link was detected. [Frequency] + Logged once per payflow. Ewallet payflow is triggered at most once per page + load. [Trigger] The histogram is logged when the eWallet FOP selector is + shown. + </summary> +</histogram> + +<histogram + name="FacilitatedPayments.Ewallet.FopSelectorShown.LatencyAfterDetectingPaymentLink.{Scheme}" + units="ms" expires_after="2025-07-01"> + <owner>junhuihe@google.com</owner> + <owner>qihuizhao@google.com</owner> + <owner>rouslan@google.com</owner> + <owner>payments-autofill-team@google.com</owner> + <summary> + On a webpage with a valid payment link, this histogram logs the latency for + seeing the FOP selector since a payment link was detected. The payment is + supported by {Scheme}. [Frequency] Logged once per payflow. Ewallet payflow + is triggered at most once per page load. [Trigger] The histogram is logged + when the eWallet FOP selector is shown. + </summary> + <token key="Scheme" variants="EwalletScheme"/> +</histogram> + +<histogram name="FacilitatedPayments.Ewallet.GetClientToken.{Result}.Latency.{Scheme}" units="ms" expires_after="2025-07-01"> <owner>junhuihe@google.com</owner> @@ -172,6 +205,22 @@ <token key="Scheme" variants="EwalletScheme"/> </histogram> +<histogram name="FacilitatedPayments.Ewallet.UiScreenShown.{Scheme}" + enum="FacilitatedPayments.UiScreen" expires_after="2025-07-01"> + <owner>junhuihe@google.com</owner> + <owner>qihuizhao@google.com</owner> + <owner>rouslan@google.com</owner> + <owner>payments-autofill-team@google.com</owner> + <summary> + On a webpage with a valid payment link, this histogram logs the UI screens + being shown to the user. The payment is supported by {Scheme}. [Frequency] + Each enum value is logged at most once per payflow. [Trigger] The browser + gets signal that a {Scheme} payment link exists on the page, and the user + clicks on the UI screens to proceed with payment. + </summary> + <token key="Scheme" variants="EwalletScheme"/> +</histogram> + <histogram name="FacilitatedPayments.Pix.FopSelector.UserAction" enum="FacilitatedPayments.FopSelectorAction" expires_after="2025-07-01"> <owner>siashah@google.com</owner> @@ -278,22 +327,6 @@ </summary> </histogram> -<histogram name="FacilitatedPayments.Pix.UiShown" - enum="FacilitatedPayments.UiScreen" expires_after="2025-07-01"> - <owner>siashah@google.com</owner> - <owner>vishwasuppoor@google.com</owner> - <owner>rouslan@google.com</owner> - <owner>payments-autofill-team@google.com</owner> - <summary> - On a webpage that is eligible for facilitated payments, this histogram logs - the UI screens being shown to the user. [Frequency] Each enum value is - logged at most once per Pix payflow. Pix payflow is triggered at most once - per page load. [Trigger] The Pix payflow could be triggered on pages that - have loaded, and the main frame contains a valid payment code for Pix. The - screens are shown during the payflow based on internal logic. - </summary> -</histogram> - <histogram name="FacilitatedPayments.SettingsPage.Shown" enum="BooleanShown" expires_after="2025-07-01"> <owner>siashah@google.com</owner> @@ -432,6 +465,22 @@ <token key="Result" variants="BooleanResult"/> </histogram> +<histogram name="FacilitatedPayments.{FacilitatedPaymentsType}.UiScreenShown" + enum="FacilitatedPayments.UiScreen" expires_after="2025-07-01"> + <owner>siashah@google.com</owner> + <owner>vishwasuppoor@google.com</owner> + <owner>rouslan@google.com</owner> + <owner>payments-autofill-team@google.com</owner> + <summary> + On a webpage that is eligible for facilitated payments, this histogram logs + the UI screens being shown to the user. [Frequency] Each enum value is + logged at most once per {FacilitatedPaymentsType} payflow. [Trigger] The + browser gets signal that a {FacilitatedPaymentsType} code exists on the + page, and the user clicks on the UI screens to proceed with payment. + </summary> + <token key="FacilitatedPaymentsType" variants="FacilitatedPaymentsTypes"/> +</histogram> + </histograms> </histogram-configuration>
diff --git a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml index fef408d..623512b 100644 --- a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml +++ b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml
@@ -1213,7 +1213,7 @@ <histogram name="NewTabPage.SearchResumptionModule.NotShown" enum="SearchResumptionModule.ModuleNotShownReason" - expires_after="2025-01-31"> + expires_after="2025-06-08"> <owner>hanxi@chromium.org</owner> <owner>xinyiji@chromium.org</owner> <summary> @@ -1235,7 +1235,7 @@ </histogram> <histogram name="NewTabPage.SearchResumptionModule.Show.Cached" - enum="SearchResumptionModule.ModuleShowStatus" expires_after="2025-01-31"> + enum="SearchResumptionModule.ModuleShowStatus" expires_after="2025-06-08"> <owner>hanxi@chromium.org</owner> <owner>xinyiji@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/stability/histograms.xml b/tools/metrics/histograms/metadata/stability/histograms.xml index 6f2ee45..2b0b3591 100644 --- a/tools/metrics/histograms/metadata/stability/histograms.xml +++ b/tools/metrics/histograms/metadata/stability/histograms.xml
@@ -507,19 +507,6 @@ </summary> </histogram> -<histogram name="Stability.iOS.UTE.BatteryCharge" units="%" - expires_after="2024-11-03"> - <owner>michaeldo@chromium.org</owner> - <owner>olivierrobin@chromium.org</owner> - <summary> - The last known battery charge before a crash occurred. This will only be - logged for devices which were last known to be in the "unplugged" - state because the intention is to identify devices which may have died - leading to unexpected terminations. Logged on application launch if the last - session terminated in an unclean state. - </summary> -</histogram> - <histogram name="Stability.iOS.UTE.DeviceThermalState" enum="IOSDeviceThermalState" expires_after="2025-03-09"> <owner>michaeldo@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/storage/histograms.xml b/tools/metrics/histograms/metadata/storage/histograms.xml index e3bc92e..5baf196 100644 --- a/tools/metrics/histograms/metadata/storage/histograms.xml +++ b/tools/metrics/histograms/metadata/storage/histograms.xml
@@ -309,6 +309,29 @@ </summary> </histogram> +<histogram name="IndexedDB.CalculateBlockingStatusLongTimes" units="ms" + expires_after="2025-04-20"> + <owner>estade@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> + <summary> + Logs the duration of Transaction::IsTransactionBlockingOtherClients, but + only if it takes over 2ms to execute. This is intended to facilitate + tracking down performance issues. See crbug.com/384476946 + </summary> +</histogram> + +<histogram name="IndexedDB.CalculateBlockingStatusRequestQueueSize" + units="count" expires_after="2025-04-20"> + <owner>estade@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> + <summary> + Logs the number of queued lock requests that exist in the + PartitionedLockManager when IsTransactionBlockingPtherClients() takes over + 2ms to complete. This is intended to facilitate tracking down performance + issues. See crbug.com/384476946 + </summary> +</histogram> + <histogram name="IndexedDB.ContextShutdownDuration" units="ms" expires_after="2025-06-08"> <owner>estade@chromium.org</owner> @@ -320,6 +343,29 @@ </summary> </histogram> +<histogram name="IndexedDB.GetUnacquirableLocksLongTimes" units="ms" + expires_after="2025-04-20"> + <owner>estade@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> + <summary> + Logs the duration of PartitionedLockManager::GetUnacquirableLocks, but only + if it takes over 2ms to execute. This is intended to facilitate tracking + down performance issues. See crbug.com/384476946 + </summary> +</histogram> + +<histogram name="IndexedDB.GetUnacquirableLocksRequestQueueSize" units="count" + expires_after="2025-04-20"> + <owner>estade@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> + <summary> + Logs the number of queued lock requests that exist in the + PartitionedLockManager when GetUnacquirableLocks() takes over 2ms to + complete. This is intended to facilitate tracking down performance issues. + See crbug.com/384476946 + </summary> +</histogram> + <histogram name="IndexedDB.LargeValueReadError" enum="FileErrorCode" expires_after="2025-05-04"> <owner>estade@chromium.org</owner> @@ -332,6 +378,29 @@ </summary> </histogram> +<histogram name="IndexedDB.LockRequestCancelledLongTimes" units="ms" + expires_after="2025-04-20"> + <owner>estade@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> + <summary> + Logs the duration of PartitionedLockManager::LockRequestCancelled, but only + if it takes over 2ms to execute. This is intended to facilitate tracking + down performance issues. See crbug.com/384476946 + </summary> +</histogram> + +<histogram name="IndexedDB.LockRequestCancelledRequestQueueSize" units="count" + expires_after="2025-04-20"> + <owner>estade@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> + <summary> + Logs the number of queued lock requests that exist in the + PartitionedLockManager when LockRequestCancelled() takes over 2ms to + complete. This is intended to facilitate tracking down performance issues. + See crbug.com/384476946 + </summary> +</histogram> + <histogram name="IndexedDB.QuotaCheckTime2.{QuotaCheckResult}" units="ms" expires_after="2025-04-20"> <owner>estade@chromium.org</owner> @@ -347,6 +416,40 @@ </token> </histogram> +<histogram name="IndexedDB.RemoveTransactionConnectionTxnCount" units="count" + expires_after="2025-04-20"> + <owner>estade@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> + <summary> + Logs the number of transactions remaining on a Connection when + Connection::RemoveTransaction() takes over 2ms to complete. This is intended + to facilitate tracking down performance issues. See crbug.com/384476946 + </summary> +</histogram> + +<histogram name="IndexedDB.RemoveTransactionLongTimes" units="ms" + expires_after="2025-04-20"> + <owner>estade@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> + <summary> + Logs the duration of Connection::RemoveTransaction(), but only if it takes + over 2ms to execute. This is intended to facilitate tracking down + performance issues. See crbug.com/384476946 + </summary> +</histogram> + +<histogram name="IndexedDB.RemoveTransactionRequestQueueSize" units="count" + expires_after="2025-04-20"> + <owner>estade@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> + <summary> + Logs the number of queued lock requests that exist in the + PartitionedLockManager when Connection::RemoveTransaction() takes over 2ms + to complete. This is intended to facilitate tracking down performance + issues. See crbug.com/384476946 + </summary> +</histogram> + <histogram name="IndexedDB.WrappedBlobLoadTime" units="ms" expires_after="2025-04-20"> <owner>estade@chromium.org</owner>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 6d6a5f7..f4be8c1f 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -6,7 +6,7 @@ }, "win": { "hash": "04dd5db3776b458e89df35bbf2a85659e6e53a02", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/11c2008484f84a80433f034abe744fc0c5bf449b/trace_processor_shell.exe" + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/146a77bab9680922a17d665a206e51891f644eae/trace_processor_shell.exe" }, "linux_arm": { "hash": "e250187786aa190a66288bc9443a5e1f5888f8d7",
diff --git a/tools/ubsan/ignorelist.txt b/tools/ubsan/ignorelist.txt index fa6dd8dc..940d9df1 100644 --- a/tools/ubsan/ignorelist.txt +++ b/tools/ubsan/ignorelist.txt
@@ -51,3 +51,7 @@ # has landed. [pointer-overflow] fun:*protozero*ScatteredStreamWriter*ReserveBytes* + +# Remove this once https://github.com/google/leveldb/pull/1222 has landed. +[pointer-overflow] +fun:*leveldb*Hash*