diff --git a/DEPS b/DEPS index d9b821ede..9f3afdd 100644 --- a/DEPS +++ b/DEPS
@@ -308,7 +308,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'src_internal_revision': '3ef0a2c8fc674eb40881314fef93f2de913accbd', + 'src_internal_revision': 'ee061f481382201645e2569b5cfb8bc70f5685ef', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. @@ -499,14 +499,14 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling beto-core # and whatever else without interference from each other. - 'betocore_revision': 'bd1f1272cd2a6605ec793b914ada2c4ebcc820f6', + 'betocore_revision': '8bd72cfb219344308ee857bcbe65a27fe91acfe8', # If you change this, also update the libc++ revision in # //buildtools/deps_revisions.gni. 'libcxx_revision': 'b5fe27de93814d35a026f7b6ff46a82045682e89', # GN CIPD package version. - 'gn_version': 'git_revision:e05c0aa00938adc0797bda1e8f2c15675aa13c30', + 'gn_version': 'git_revision:88e8054aff7bd0cb2295c7d9361d2be0b7355f27', # ninja CIPD package version. # https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja @@ -827,7 +827,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - 'e1cea4cbb1facae953cae4f052e196c367a636ce', + '5ac8fb250ea25c91a12158f768d4f5c03976f15e', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1205,7 +1205,7 @@ Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'e6a1cfc5b76dece414156ebbba15beb82dc47a7a', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '196ae62399105a2fe043fcd30a1446e2fe80d7b3', 'condition': 'checkout_src_internal', }, @@ -1463,7 +1463,7 @@ Var('chromium_git') + '/external/libaddressinput.git' + '@' + 'e8712e415627f22d0b00ebee8db99547077f39bd', 'src/third_party/libaom/source/libaom': - Var('aomedia_git') + '/aom.git' + '@' + 'a2d599c9750e3027d3104770fe74ff5d5d012c13', + Var('aomedia_git') + '/aom.git' + '@' + '14010c6f0f787b0c294a352823e34fe058674510', 'src/third_party/libavif/src': Var('chromium_git') + '/external/github.com/AOMediaCodec/libavif.git' + '@' + Var('libavif_revision'), @@ -1665,7 +1665,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '3fa1408bbc785c9e6c5d69ba5f807243fa9dc9fd', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '77ac4b7528eeb8444b6f829264a2e82be99a8cd0', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '8ef97ff3b7332e38e61b347a2fbed425a4617151', @@ -1850,7 +1850,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '98673cc24786be6c10dd8908e0b0b4ed27625c6a', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '015de612e925b0d43384fd3c589c115538bb399d', + Var('webrtc_git') + '/src.git' + '@' + 'e5ac106a357e2a1a088b732f0232d470de42f0cb', # 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. @@ -1984,7 +1984,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'fOiQ0dZkmZtsMjJGh6kX1Z8oTPuEUSsWCKIRDaxvC9QC', + 'version': 'oItR7uvFa3UzB1_FfURZN_oceZdbKAQBLtGiyOp7occC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4096,7 +4096,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - 'dc57479f6f79fd6b1858ac34da9580fa68a3fcd9', + 'c6c8dd839bf98b445061bd6198695cbb9124b663', 'condition': 'checkout_ios and checkout_src_internal', }, @@ -4172,7 +4172,7 @@ 'packages': [ { 'package': 'chromeos_internal/assistant/libassistant/libassistant_cros_device/x64/internal', - 'version': 'ONBUvln4HGgBn4B4uwD_GLKwHKk4XtyBTTcb0VqLqBUC', + 'version': 'sQlpA8YX9xqenXh1shzWPTjO-UbfG8RZBdjG4Bq6_JEC', }, ], 'condition': 'checkout_src_internal and checkout_chromeos', @@ -4183,7 +4183,7 @@ 'packages': [ { 'package': 'chromeos_internal/assistant/libassistant/libassistant_cros_device/arm64/internal', - 'version': '8tJ92R7a1cME_3Lb8dY17jMPhIZmJKGn74jRcvBwDA8C', + 'version': 'jBi2aiKUgOIsm4EySOUEOYcZVx1_vGQKdX624Sn7--cC', }, ], 'condition': 'checkout_src_internal and checkout_chromeos', @@ -4194,7 +4194,7 @@ 'packages': [ { 'package': 'chromeos_internal/assistant/libassistant/libassistant_cros_device/arm/internal', - 'version': 'HWbMkz4ukSFB4WDMHQokyqvncNrDQdykTNAFPxMiXSYC', + 'version': 'p4h4yK1oeCIH1yXn637uVBIZ82hFnGinKrdn4EZ9L8QC', }, ], 'condition': 'checkout_src_internal and checkout_chromeos', @@ -4205,7 +4205,7 @@ 'packages': [ { 'package': 'chromeos_internal/assistant/libassistant/libassistant_cros_glinux/x64/internal', - 'version': 'CHE67HLb-6imPXB3fBp_A_eFs2kf_lg-sU5xH2q_bmYC', + 'version': 'vsmFJIFJr5245jA8Zz67H6mJFahlkhwf_AYa00ay5fkC', }, ], 'condition': 'checkout_src_internal and checkout_chromeos', @@ -4216,7 +4216,7 @@ 'packages': [ { 'package': 'chromeos_internal/assistant/libassistant/fake_s3_server_cros_glinux/x64/internal', - 'version': 'IRweCdbYxKDjyJ0cm9uNuSdHydlV75Nrw3eUboDEAPYC', + 'version': '_9aXc-Ngn6ckUP5OFPt55-pAyP6Wgg0eiSKZaoN1LLAC', }, ], 'condition': 'checkout_src_internal and checkout_chromeos',
diff --git a/android_webview/browser/aw_contents_io_thread_client.cc b/android_webview/browser/aw_contents_io_thread_client.cc index da0ae217..68d2f44 100644 --- a/android_webview/browser/aw_contents_io_thread_client.cc +++ b/android_webview/browser/aw_contents_io_thread_client.cc
@@ -6,9 +6,9 @@ #include <map> #include <memory> +#include <optional> #include <utility> -#include <optional> #include "android_webview/browser/aw_settings.h" #include "android_webview/browser/network_service/aw_web_resource_intercept_response.h" #include "android_webview/browser/network_service/aw_web_resource_request.h"
diff --git a/android_webview/browser/aw_http_auth_handler.cc b/android_webview/browser/aw_http_auth_handler.cc index e8e271a..9c681fd 100644 --- a/android_webview/browser/aw_http_auth_handler.cc +++ b/android_webview/browser/aw_http_auth_handler.cc
@@ -4,9 +4,9 @@ #include "android_webview/browser/aw_http_auth_handler.h" +#include <optional> #include <utility> -#include <optional> #include "android_webview/browser/aw_contents.h" #include "android_webview/browser_jni_headers/AwHttpAuthHandler_jni.h" #include "base/android/jni_android.h"
diff --git a/android_webview/browser/cookie_manager.cc b/android_webview/browser/cookie_manager.cc index 6c0c7c5..bd43a3a2 100644 --- a/android_webview/browser/cookie_manager.cc +++ b/android_webview/browser/cookie_manager.cc
@@ -7,10 +7,10 @@ #include <stdint.h> #include <memory> +#include <optional> #include <utility> #include <vector> -#include <optional> #include "android_webview/browser/aw_browser_context.h" #include "android_webview/browser/aw_browser_context_store.h" #include "android_webview/browser/aw_client_hints_controller_delegate.h"
diff --git a/android_webview/browser/gfx/aw_draw_fn_impl.h b/android_webview/browser/gfx/aw_draw_fn_impl.h index 5fb458c..cc511e2 100644 --- a/android_webview/browser/gfx/aw_draw_fn_impl.h +++ b/android_webview/browser/gfx/aw_draw_fn_impl.h
@@ -6,6 +6,7 @@ #define ANDROID_WEBVIEW_BROWSER_GFX_AW_DRAW_FN_IMPL_H_ #include <optional> + #include "android_webview/browser/gfx/aw_vulkan_context_provider.h" #include "android_webview/browser/gfx/compositor_frame_consumer.h" #include "android_webview/browser/gfx/render_thread_manager.h"
diff --git a/android_webview/browser/gfx/aw_vulkan_context_provider.h b/android_webview/browser/gfx/aw_vulkan_context_provider.h index 683b09a..739a0fc 100644 --- a/android_webview/browser/gfx/aw_vulkan_context_provider.h +++ b/android_webview/browser/gfx/aw_vulkan_context_provider.h
@@ -6,8 +6,8 @@ #define ANDROID_WEBVIEW_BROWSER_GFX_AW_VULKAN_CONTEXT_PROVIDER_H_ #include <memory> - #include <optional> + #include "base/memory/raw_ptr.h" #include "components/viz/common/gpu/vulkan_context_provider.h" #include "gpu/vulkan/vulkan_device_queue.h"
diff --git a/android_webview/browser/gfx/browser_view_renderer.h b/android_webview/browser/gfx/browser_view_renderer.h index 7e7a4aaf..fc5d5a5 100644 --- a/android_webview/browser/gfx/browser_view_renderer.h +++ b/android_webview/browser/gfx/browser_view_renderer.h
@@ -8,9 +8,9 @@ #include <stddef.h> #include <map> +#include <optional> #include <set> -#include <optional> #include "android_webview/browser/gfx/begin_frame_source_webview.h" #include "android_webview/browser/gfx/child_frame.h" #include "android_webview/browser/gfx/compositor_frame_producer.h"
diff --git a/android_webview/browser/gfx/child_frame.h b/android_webview/browser/gfx/child_frame.h index 4177b76..3ee8e6d 100644 --- a/android_webview/browser/gfx/child_frame.h +++ b/android_webview/browser/gfx/child_frame.h
@@ -6,9 +6,9 @@ #define ANDROID_WEBVIEW_BROWSER_GFX_CHILD_FRAME_H_ #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/containers/circular_deque.h" #include "components/viz/common/frame_sinks/begin_frame_args.h" #include "components/viz/common/surfaces/frame_sink_id.h"
diff --git a/android_webview/browser/gfx/render_thread_manager.cc b/android_webview/browser/gfx/render_thread_manager.cc index 3680341..bbf22f3 100644 --- a/android_webview/browser/gfx/render_thread_manager.cc +++ b/android_webview/browser/gfx/render_thread_manager.cc
@@ -5,9 +5,9 @@ #include "android_webview/browser/gfx/render_thread_manager.h" #include <memory> +#include <optional> #include <utility> -#include <optional> #include "android_webview/browser/gfx/compositor_frame_producer.h" #include "android_webview/browser/gfx/gpu_service_webview.h" #include "android_webview/browser/gfx/hardware_renderer.h"
diff --git a/android_webview/browser/network_service/aw_proxying_url_loader_factory.cc b/android_webview/browser/network_service/aw_proxying_url_loader_factory.cc index 331b949..752799c 100644 --- a/android_webview/browser/network_service/aw_proxying_url_loader_factory.cc +++ b/android_webview/browser/network_service/aw_proxying_url_loader_factory.cc
@@ -5,11 +5,11 @@ #include "android_webview/browser/network_service/aw_proxying_url_loader_factory.h" #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "android_webview/browser/android_protocol_handler.h" #include "android_webview/browser/aw_browser_context.h" #include "android_webview/browser/aw_contents_client_bridge.h"
diff --git a/android_webview/browser/network_service/aw_proxying_url_loader_factory.h b/android_webview/browser/network_service/aw_proxying_url_loader_factory.h index 33708dd0..2150865 100644 --- a/android_webview/browser/network_service/aw_proxying_url_loader_factory.h +++ b/android_webview/browser/network_service/aw_proxying_url_loader_factory.h
@@ -6,6 +6,7 @@ #define ANDROID_WEBVIEW_BROWSER_NETWORK_SERVICE_AW_PROXYING_URL_LOADER_FACTORY_H_ #include <optional> + #include "android_webview/browser/network_service/aw_browser_context_io_thread_handle.h" #include "base/memory/weak_ptr.h" #include "components/embedder_support/android/util/android_stream_reader_url_loader.h"
diff --git a/android_webview/browser/network_service/aw_web_resource_request.h b/android_webview/browser/network_service/aw_web_resource_request.h index 69f4a51..9ef97ec 100644 --- a/android_webview/browser/network_service/aw_web_resource_request.h +++ b/android_webview/browser/network_service/aw_web_resource_request.h
@@ -5,10 +5,10 @@ #ifndef ANDROID_WEBVIEW_BROWSER_NETWORK_SERVICE_AW_WEB_RESOURCE_REQUEST_H_ #define ANDROID_WEBVIEW_BROWSER_NETWORK_SERVICE_AW_WEB_RESOURCE_REQUEST_H_ +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/android/scoped_java_ref.h" namespace net {
diff --git a/android_webview/browser/tracing/aw_background_tracing_metrics_provider.h b/android_webview/browser/tracing/aw_background_tracing_metrics_provider.h index 7052fd8..b17ad5c 100644 --- a/android_webview/browser/tracing/aw_background_tracing_metrics_provider.h +++ b/android_webview/browser/tracing/aw_background_tracing_metrics_provider.h
@@ -5,10 +5,10 @@ #ifndef ANDROID_WEBVIEW_BROWSER_TRACING_AW_BACKGROUND_TRACING_METRICS_PROVIDER_H_ #define ANDROID_WEBVIEW_BROWSER_TRACING_AW_BACKGROUND_TRACING_METRICS_PROVIDER_H_ -#include "components/tracing/common/background_tracing_metrics_provider.h" - #include <optional> + #include "base/memory/weak_ptr.h" +#include "components/tracing/common/background_tracing_metrics_provider.h" namespace tracing {
diff --git a/android_webview/browser/tracing/aw_tracing_delegate.h b/android_webview/browser/tracing/aw_tracing_delegate.h index aa63baf..0bfd8d8 100644 --- a/android_webview/browser/tracing/aw_tracing_delegate.h +++ b/android_webview/browser/tracing/aw_tracing_delegate.h
@@ -6,6 +6,7 @@ #define ANDROID_WEBVIEW_BROWSER_TRACING_AW_TRACING_DELEGATE_H_ #include <optional> + #include "content/public/browser/tracing_delegate.h" class PrefRegistrySimple;
diff --git a/android_webview/nonembedded/component_updater/aw_component_update_service.h b/android_webview/nonembedded/component_updater/aw_component_update_service.h index 93aa24e..3bff930 100644 --- a/android_webview/nonembedded/component_updater/aw_component_update_service.h +++ b/android_webview/nonembedded/component_updater/aw_component_update_service.h
@@ -6,10 +6,10 @@ #define ANDROID_WEBVIEW_NONEMBEDDED_COMPONENT_UPDATER_AW_COMPONENT_UPDATE_SERVICE_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/android/scoped_java_ref.h" #include "base/containers/flat_map.h" #include "base/functional/callback_forward.h"
diff --git a/android_webview/nonembedded/component_updater/aw_component_update_service_test.cc b/android_webview/nonembedded/component_updater/aw_component_update_service_test.cc index e3fa53c..d6f0e6c 100644 --- a/android_webview/nonembedded/component_updater/aw_component_update_service_test.cc +++ b/android_webview/nonembedded/component_updater/aw_component_update_service_test.cc
@@ -8,9 +8,9 @@ #include <iterator> #include <memory> +#include <optional> #include <utility> -#include <optional> #include "android_webview/common/aw_paths.h" #include "android_webview/nonembedded/component_updater/aw_component_updater_configurator.h" #include "base/android/path_utils.h"
diff --git a/ash/accessibility/accessibility_controller.cc b/ash/accessibility/accessibility_controller.cc index e8d9756..865b4ec8 100644 --- a/ash/accessibility/accessibility_controller.cc +++ b/ash/accessibility/accessibility_controller.cc
@@ -1273,6 +1273,9 @@ prefs::kAccessibilityFaceGazeCursorUseAcceleration, kDefaultFaceGazeCursorUseAcceleration, user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF); + registry->RegisterDictionaryPref( + prefs::kAccessibilityFaceGazeGesturesToMacros, + user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF); } }
diff --git a/ash/ambient/metrics/ambient_metrics.cc b/ash/ambient/metrics/ambient_metrics.cc index 6eb548d..f7e520a 100644 --- a/ash/ambient/metrics/ambient_metrics.cc +++ b/ash/ambient/metrics/ambient_metrics.cc
@@ -22,7 +22,6 @@ #include "base/metrics/histogram_functions.h" #include "base/numerics/safe_conversions.h" #include "base/strings/strcat.h" - #include "base/strings/stringprintf.h" #include "base/time/time.h" #include "base/values.h"
diff --git a/ash/ambient/metrics/ambient_metrics.h b/ash/ambient/metrics/ambient_metrics.h index 459a180..0efcca2c 100644 --- a/ash/ambient/metrics/ambient_metrics.h +++ b/ash/ambient/metrics/ambient_metrics.h
@@ -12,7 +12,6 @@ #include "ash/public/cpp/ambient/ambient_mode_photo_source.h" #include "base/functional/callback.h" #include "base/scoped_observation.h" - #include "base/time/time.h" #include "base/timer/elapsed_timer.h" #include "ui/views/view.h"
diff --git a/ash/ambient/model/ambient_animation_attribution_provider.cc b/ash/ambient/model/ambient_animation_attribution_provider.cc index 248fd97..48b5afa 100644 --- a/ash/ambient/model/ambient_animation_attribution_provider.cc +++ b/ash/ambient/model/ambient_animation_attribution_provider.cc
@@ -16,7 +16,6 @@ #include "base/no_destructor.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" - #include "base/strings/stringprintf.h" #include "cc/paint/skottie_wrapper.h" #include "third_party/re2/src/re2/re2.h"
diff --git a/ash/ambient/model/ambient_topic_queue_animation_delegate_unittest.cc b/ash/ambient/model/ambient_topic_queue_animation_delegate_unittest.cc index 4afbcc6..8bd84a6 100644 --- a/ash/ambient/model/ambient_topic_queue_animation_delegate_unittest.cc +++ b/ash/ambient/model/ambient_topic_queue_animation_delegate_unittest.cc
@@ -11,7 +11,6 @@ #include "ash/ambient/test/ambient_test_util.h" #include "base/check.h" #include "base/numerics/safe_conversions.h" - #include "cc/paint/skottie_resource_metadata.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/ash/ambient/ui/ambient_animation_frame_rate_schedule.cc b/ash/ambient/ui/ambient_animation_frame_rate_schedule.cc index 69a62d2f..2460193 100644 --- a/ash/ambient/ui/ambient_animation_frame_rate_schedule.cc +++ b/ash/ambient/ui/ambient_animation_frame_rate_schedule.cc
@@ -15,7 +15,6 @@ #include "base/no_destructor.h" #include "base/notreached.h" #include "base/strings/strcat.h" - #include "base/time/time.h" #include "cc/paint/skottie_marker.h" #include "third_party/re2/src/re2/re2.h"
diff --git a/ash/ambient/ui/ambient_animation_player.cc b/ash/ambient/ui/ambient_animation_player.cc index cac8e79..a122a05 100644 --- a/ash/ambient/ui/ambient_animation_player.cc +++ b/ash/ambient/ui/ambient_animation_player.cc
@@ -15,7 +15,6 @@ #include "base/logging.h" #include "base/no_destructor.h" #include "base/strings/strcat.h" - #include "base/time/time.h" #include "cc/paint/skottie_marker.h" #include "cc/paint/skottie_wrapper.h"
diff --git a/ash/app_list/views/apps_grid_view_unittest.cc b/ash/app_list/views/apps_grid_view_unittest.cc index c593567..714fcb0 100644 --- a/ash/app_list/views/apps_grid_view_unittest.cc +++ b/ash/app_list/views/apps_grid_view_unittest.cc
@@ -5,6 +5,7 @@ #include "ash/app_list/views/apps_grid_view.h" #include <stddef.h> + #include <algorithm> #include <list> #include <memory>
diff --git a/ash/birch/birch_item.cc b/ash/birch/birch_item.cc index 610bb07..94bfb8b 100644 --- a/ash/birch/birch_item.cc +++ b/ash/birch/birch_item.cc
@@ -153,9 +153,7 @@ } void BirchFileItem::PerformAction() { - // TODO(jamescook): Open the file using platform_util::OpenItem(), see - // chrome/browser/ash/app_list/search/files/file_result.cc. This will require - // delegating back to the chrome layer due to Profile dependencies. + NewWindowDelegate::GetInstance()->OpenFile(file_path); } ////////////////////////////////////////////////////////////////////////////////
diff --git a/ash/birch/birch_item_unittest.cc b/ash/birch/birch_item_unittest.cc index 55b1212d..c66156f 100644 --- a/ash/birch/birch_item_unittest.cc +++ b/ash/birch/birch_item_unittest.cc
@@ -8,6 +8,7 @@ #include <utility> #include "ash/public/cpp/test/test_new_window_delegate.h" +#include "base/files/file_path.h" #include "base/memory/raw_ptr.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/models/image_model.h" @@ -24,7 +25,12 @@ last_opened_url_ = url; } + void OpenFile(const base::FilePath& file_path) override { + last_opened_file_path_ = file_path; + } + GURL last_opened_url_; + base::FilePath last_opened_file_path_; }; class BirchItemTest : public testing::Test { @@ -80,6 +86,13 @@ EXPECT_EQ(new_window_delegate_->last_opened_url_, GURL()); } +TEST_F(BirchItemTest, File_PerformAction) { + BirchFileItem item(base::FilePath("file_path"), base::Time()); + item.PerformAction(); + EXPECT_EQ(new_window_delegate_->last_opened_file_path_, + base::FilePath("file_path")); +} + TEST_F(BirchItemTest, Weather_PerformAction) { BirchWeatherItem item(u"item", u"72 deg", ui::ImageModel()); item.PerformAction();
diff --git a/ash/components/arc/timer/arc_timer_bridge_unittest.cc b/ash/components/arc/timer/arc_timer_bridge_unittest.cc index 73e6a90..372e4c4 100644 --- a/ash/components/arc/timer/arc_timer_bridge_unittest.cc +++ b/ash/components/arc/timer/arc_timer_bridge_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 "ash/components/arc/timer/arc_timer_bridge.h" + #include <map> #include <memory> #include <optional> @@ -14,7 +16,6 @@ #include "ash/components/arc/session/connection_holder.h" #include "ash/components/arc/test/connection_holder_util.h" #include "ash/components/arc/test/fake_timer_instance.h" -#include "ash/components/arc/timer/arc_timer_bridge.h" #include "ash/components/arc/timer/arc_timer_mojom_traits.h" #include "base/files/file_descriptor_watcher_posix.h" #include "base/files/scoped_file.h"
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 3471f1c..aea364a 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -2289,11 +2289,6 @@ "PrintPreviewCrosApp", base::FEATURE_DISABLED_BY_DEFAULT); -// Enables the new OS Printer Settings UI. -BASE_FEATURE(kPrinterSettingsRevamp, - "PrinterSettingsRevamp", - base::FEATURE_ENABLED_BY_DEFAULT); - // Enables showing discovered printers in the Print Preview dialog. BASE_FEATURE(kPrintPreviewDiscoveredPrinters, "PrintPreviewDiscoveredPrinters", @@ -4121,10 +4116,6 @@ return base::FeatureList::IsEnabled(kPrinterSettingsPrinterStatus); } -bool IsPrinterSettingsRevampEnabled() { - return base::FeatureList::IsEnabled(kPrinterSettingsRevamp); -} - bool IsPrinterPreviewCrosAppEnabled() { return base::FeatureList::IsEnabled(kPrintPreviewCrosApp); } @@ -4513,4 +4504,10 @@ return base::FeatureList::IsEnabled(kUseAuthPanelInSettings); } +bool UseMixedFileLauncherContinueSection() { + return base::GetFieldTrialParamByFeatureAsBool( + ash::features::kLauncherContinueSectionWithRecents, "mix_local_and_drive", + false); +} + } // namespace ash::features
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 258fb2a..2fb4dea 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -696,7 +696,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kPreferConstantFrameRate); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kPrinterSettingsPrinterStatus); -COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kPrinterSettingsRevamp); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kPrintPreviewCrosApp); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kPrintPreviewDiscoveredPrinters); @@ -1191,7 +1190,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPrivacyIndicatorsEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsLocalPrinterObservingEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPrinterSettingsPrinterStatusEnabled(); -COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPrinterSettingsRevampEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPrinterPreviewCrosAppEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPrintPreviewDiscoveredPrintersEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsProductivityLauncherEnabled(); @@ -1310,6 +1308,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool ShouldShowPlayStoreInDemoMode(); COMPONENT_EXPORT(ASH_CONSTANTS) bool ShouldUseV1DeviceSync(); COMPONENT_EXPORT(ASH_CONSTANTS) bool ShouldUseV2DeviceSync(); +COMPONENT_EXPORT(ASH_CONSTANTS) bool UseMixedFileLauncherContinueSection(); // Keep alphabetized.
diff --git a/ash/constants/ash_pref_names.h b/ash/constants/ash_pref_names.h index 7fa9f522..3d6494f 100644 --- a/ash/constants/ash_pref_names.h +++ b/ash/constants/ash_pref_names.h
@@ -658,6 +658,12 @@ inline constexpr char kAccessibilityFaceGazeCursorUseAcceleration[] = "settings.a11y.face_gaze.cursor_use_acceleration"; +// A dictionary pref which maps facial gestures to action macros. Facial +// gestures are strings like 'browDownLeft', and actions are enums from +// macro_names. +inline constexpr char kAccessibilityFaceGazeGesturesToMacros[] = + "settings.a11y.face_gaze.gestures_to_macros"; + // A boolean pref which determines whether the accessibility menu shows // regardless of the state of a11y features. inline constexpr char kShouldAlwaysShowAccessibilityMenu[] =
diff --git a/ash/constants/ash_switches.cc b/ash/constants/ash_switches.cc index ed0c2eb..52e59d7 100644 --- a/ash/constants/ash_switches.cc +++ b/ash/constants/ash_switches.cc
@@ -141,6 +141,15 @@ // Install roster. Used manually by developers. const char kArcGeneratePlayAutoInstall[] = "arc-generate-play-auto-install"; +// Sets the mode of operation for ureadahead during ARC Container boot. +// readahead (default) - used during production and is equivalent to no switch +// being set. +// generate - used during Android Uprev data collector to pre-generate pack file +// and upload to Google Cloud as build artifact for CrOS build image. +// disabled - used for test purpose to disable ureadahead during ARC Container +// boot. +const char kArcHostUreadaheadMode[] = "arc-host-ureadahead-mode"; + // Write ARC++ install events to chrome log for integration test. const char kArcInstallEventChromeLogForTests[] = "arc-install-event-chrome-log-for-tests"; @@ -172,9 +181,6 @@ // Sets ARC Terms Of Service hostname url for testing. const char kArcTosHostForTests[] = "arc-tos-host-for-tests"; -// Sets Privacy Policy hostname url for testing. -const char kPrivacyPolicyHostForTests[] = "privacy-policy-host-for-tests"; - // Sets the mode of operation for ureadahead during ARCVM boot. If this switch // is not set, ARCVM ureadahead will check for the presence and age of pack // file and reads ahead files to page cache for improved boot performance. @@ -188,15 +194,6 @@ // parts of ureadahead. const char kArcVmUreadaheadMode[] = "arcvm-ureadahead-mode"; -// Sets the mode of operation for ureadahead during ARC Container boot. -// readahead (default) - used during production and is equivalent to no switch -// being set. -// generate - used during Android Uprev data collector to pre-generate pack file -// and upload to Google Cloud as build artifact for CrOS build image. -// disabled - used for test purpose to disable ureadahead during ARC Container -// boot. -const char kArcHostUreadaheadMode[] = "arc-host-ureadahead-mode"; - // Madvises the kernel to use Huge Pages for guest memory. const char kArcVmUseHugePages[] = "arcvm-use-hugepages"; @@ -258,10 +255,6 @@ // state. const char kAshForceStatusAreaCollapsible[] = "force-status-area-collapsible"; -// Path for which to load growth campaigns file for testing (instead of -// downloading from Omaha). -const char kGrowthCampaignsPath[] = "growth-campaigns-path"; - // Hides notifications that are irrelevant to Chrome OS device factory testing, // such as battery level updates. const char kAshHideNotificationsForFactory[] = @@ -425,6 +418,9 @@ const char kDisableFineGrainedTimeZoneDetection[] = "disable-fine-grained-time-zone-detection"; +// Disables first-run UI from being shown. +const char kDisableFirstRunUI[] = "disable-first-run-ui"; + // Disables GAIA services such as enrollment and OAuth session restore. Used by // 'fake' telemetry login. const char kDisableGaiaServices[] = "disable-gaia-services"; @@ -433,9 +429,6 @@ const char kDisableHIDDetectionOnOOBEForTesting[] = "disable-hid-detection-on-oobe"; -// Skip multidevice setup screen during tast tests. -const char kSkipMultideviceScreenForTesting[] = "skip-multidevice-screen"; - // Disables the Lacros keep alive for testing. const char kDisableLacrosKeepAliveForTesting[] = "disable-lacros-keep-alive"; @@ -651,9 +644,6 @@ // Forces first-run UI to be shown for every login. const char kForceFirstRunUI[] = "force-first-run-ui"; -// Disables first-run UI from being shown. -const char kDisableFirstRunUI[] = "disable-first-run-ui"; - // Forces Hardware ID check (happens during OOBE) to fail or succeed. Possible // values: "failure" or "success". Should be used only for testing. const char kForceHWIDCheckResultForTest[] = "force-hwid-check-result-for-test"; @@ -701,6 +691,10 @@ "\xe2\xcb"; const char kGlanceablesKeySwitch[] = "glanceables-key"; +// Path for which to load growth campaigns file for testing (instead of +// downloading from Omaha). +const char kGrowthCampaignsPath[] = "growth-campaigns-path"; + // Indicates that the browser is in "browse without sign-in" (Guest session) // mode. Should completely disable extensions, sync and bookmarks. const char kGuestSession[] = "bwsi"; @@ -953,6 +947,9 @@ const char kOobeTriggerSyncTimeoutForTests[] = "oobe-trigger-sync-timeout-for-tests"; +// If set, the overview button will be visible. +const char kOverviewButtonForTests[] = "overview-button-for-tests"; + // Controls how often the HiddenNetworkHandler class checks for wrongly hidden // networks. The interval should be provided in seconds, should follow the // format "--hidden-network-migration-interval=#", and should be >= 1. @@ -973,6 +970,9 @@ const char kPrintingPpdChannelDev[] = "dev"; const char kPrintingPpdChannelLocalhost[] = "localhost"; +// Sets Privacy Policy hostname url for testing. +const char kPrivacyPolicyHostForTests[] = "privacy-policy-host-for-tests"; + // If set to "true", the profile requires policy during restart (policy load // must succeed, otherwise session restart should fail). const char kProfileRequiresPolicy[] = "profile-requires-policy"; @@ -1051,6 +1051,9 @@ const char kSkipForceOnlineSignInForTesting[] = "skip-force-online-signin-for-testing"; +// Skip multidevice setup screen during tast tests. +const char kSkipMultideviceScreenForTesting[] = "skip-multidevice-screen"; + // Used to skip the threshold duration that the reorder nudge has to show before // the nudge is considered as shown. const char kSkipReorderNudgeShowThresholdDurationForTest[] = @@ -1264,6 +1267,11 @@ kEnableOOBEChromeVoxHintForDevMode); } +bool IsOverviewButtonEnabledForTests() { + return base::CommandLine::ForCurrentProcess()->HasSwitch( + kOverviewButtonForTests); +} + bool IsDeviceRequisitionConfigurable() { return base::CommandLine::ForCurrentProcess()->HasSwitch( kEnableRequisitionEdits);
diff --git a/ash/constants/ash_switches.h b/ash/constants/ash_switches.h index 2377b18e..b9ed96af 100644 --- a/ash/constants/ash_switches.h +++ b/ash/constants/ash_switches.h
@@ -49,6 +49,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcForcePostBootDexOpt[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcForceShowOptInUi[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcGeneratePlayAutoInstall[]; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcHostUreadaheadMode[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcInstallEventChromeLogForTests[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcPackagesCacheMode[]; @@ -56,10 +57,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcScale[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcStartMode[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcTosHostForTests[]; -COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kPrivacyPolicyHostForTests[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcVmMountDebugFs[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcVmUreadaheadMode[]; -COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcHostUreadaheadMode[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kArcVmUseHugePages[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kAshClearFastInkBuffer[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kAshBypassGlanceablesPref[]; @@ -81,7 +80,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kAshForceEnableStylusTools[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kAshForceStatusAreaCollapsible[]; -COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kGrowthCampaignsPath[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kAshHideNotificationsForFactory[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kAshNoNudges[]; @@ -131,12 +129,11 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kDisableDriveFsForTesting[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kDisableFineGrainedTimeZoneDetection[]; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kDisableFirstRunUI[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kDisableGaiaServices[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kDisableHIDDetectionOnOOBEForTesting[]; COMPONENT_EXPORT(ASH_CONSTANTS) -extern const char kSkipMultideviceScreenForTesting[]; -COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kDisableLacrosKeepAliveForTesting[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kDisableLoginAnimations[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kDisableLoginLacrosOpening[]; @@ -213,7 +210,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kForceCryptohomeRecoveryForTesting[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kForceFirstRunUI[]; -COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kDisableFirstRunUI[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kForceHWIDCheckResultForTest[]; COMPONENT_EXPORT(ASH_CONSTANTS) @@ -229,6 +225,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kFormFactor[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kGlanceablesKeyExpectedHash[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kGlanceablesKeySwitch[]; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kGrowthCampaignsPath[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kGuestSession[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kGuestWallpaperLarge[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kGuestWallpaperSmall[]; @@ -302,7 +299,7 @@ extern const char kOobeTimezoneOverrideForTests[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kOobeTriggerSyncTimeoutForTests[]; -COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kOrcaKey[]; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kOverviewButtonForTests[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kHiddenNetworkMigrationInterval[]; COMPONENT_EXPORT(ASH_CONSTANTS) @@ -315,6 +312,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kPrintingPpdChannelDev[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kPrintingPpdChannelLocalhost[]; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kPrivacyPolicyHostForTests[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kProfileRequiresPolicy[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kPublicAccountsSamlAclUrl[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kQsAddFakeBluetoothDevices[]; @@ -339,6 +337,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kSkipForceOnlineSignInForTesting[]; COMPONENT_EXPORT(ASH_CONSTANTS) +extern const char kSkipMultideviceScreenForTesting[]; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kSkipReorderNudgeShowThresholdDurationForTest[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kStabilizeTimeDependentViewForTests[]; @@ -465,6 +465,10 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsOOBEChromeVoxHintEnabledForDevMode(); +// Returns true if the overview button is set to be always visible. Mostly for +// dev purpose. +COMPONENT_EXPORT(ASH_CONSTANTS) bool IsOverviewButtonEnabledForTests(); + // Returns true if the OEM Device Requisition can be configured. COMPONENT_EXPORT(ASH_CONSTANTS) bool IsDeviceRequisitionConfigurable();
diff --git a/ash/events/peripheral_customization_event_rewriter.cc b/ash/events/peripheral_customization_event_rewriter.cc index c2dd764..9c30f057 100644 --- a/ash/events/peripheral_customization_event_rewriter.cc +++ b/ash/events/peripheral_customization_event_rewriter.cc
@@ -5,6 +5,7 @@ #include "ash/events/peripheral_customization_event_rewriter.h" #include <linux/input.h> + #include <iterator> #include <memory> #include <optional>
diff --git a/ash/login/ui/access_code_input_unittest.cc b/ash/login/ui/access_code_input_unittest.cc index 1709ca2..72dfcf1a4 100644 --- a/ash/login/ui/access_code_input_unittest.cc +++ b/ash/login/ui/access_code_input_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 "ash/login/ui/access_code_input.h" + #include <memory> #include <optional> #include <string> -#include "ash/login/ui/access_code_input.h" #include "ash/test/ash_test_base.h" #include "base/strings/string_number_conversions.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/ash/public/cpp/new_window_delegate.h b/ash/public/cpp/new_window_delegate.h index 5e98a17..620c6ac0 100644 --- a/ash/public/cpp/new_window_delegate.h +++ b/ash/public/cpp/new_window_delegate.h
@@ -16,6 +16,10 @@ class Window; } +namespace base { +class FilePath; +} + namespace ui { class OSExchangeData; } @@ -133,6 +137,9 @@ // Shows the a captive portal signin window. virtual void OpenCaptivePortalSignin(const GURL& url) = 0; + // Opens a file on the local file system (which may be DriveFS). + virtual void OpenFile(const base::FilePath& file_path) = 0; + protected: NewWindowDelegate(); NewWindowDelegate(const NewWindowDelegate&) = delete;
diff --git a/ash/public/cpp/test/test_new_window_delegate.cc b/ash/public/cpp/test/test_new_window_delegate.cc index 0ff2f7af..97863dc 100644 --- a/ash/public/cpp/test/test_new_window_delegate.cc +++ b/ash/public/cpp/test/test_new_window_delegate.cc
@@ -40,6 +40,7 @@ const std::string& description_template) {} void TestNewWindowDelegate::OpenPersonalizationHub() {} void TestNewWindowDelegate::OpenCaptivePortalSignin(const GURL& url) {} +void TestNewWindowDelegate::OpenFile(const base::FilePath& file_path) {} TestNewWindowDelegateProvider::TestNewWindowDelegateProvider( std::unique_ptr<TestNewWindowDelegate> delegate)
diff --git a/ash/public/cpp/test/test_new_window_delegate.h b/ash/public/cpp/test/test_new_window_delegate.h index d5eb507..6d55a71 100644 --- a/ash/public/cpp/test/test_new_window_delegate.h +++ b/ash/public/cpp/test/test_new_window_delegate.h
@@ -44,6 +44,7 @@ const std::string& description_template) override; void OpenPersonalizationHub() override; void OpenCaptivePortalSignin(const GURL& url) override; + void OpenFile(const base::FilePath& file_path) override; }; // NewWindowDelegateProvider implementation to provide TestNewWindowDelegate.
diff --git a/ash/quick_pair/feature_status_tracker/BUILD.gn b/ash/quick_pair/feature_status_tracker/BUILD.gn index 2c3f4d23..15ae06c 100644 --- a/ash/quick_pair/feature_status_tracker/BUILD.gn +++ b/ash/quick_pair/feature_status_tracker/BUILD.gn
@@ -75,6 +75,8 @@ "mock_power_connected_provider.h", "mock_quick_pair_feature_status_tracker.cc", "mock_quick_pair_feature_status_tracker.h", + "mock_scanning_enabled_provider.cc", + "mock_scanning_enabled_provider.h", "mock_screen_state_enabled_provider.cc", "mock_screen_state_enabled_provider.h", "quick_pair_feature_status_tracker.h",
diff --git a/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.cc b/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.cc index 9ab22b80a..d4fcd7a 100644 --- a/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.cc +++ b/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.cc
@@ -11,8 +11,7 @@ #include "base/functional/bind.h" #include "components/cross_device/logging/logging.h" -namespace ash { -namespace quick_pair { +namespace ash::quick_pair { FastPairEnabledProvider::FastPairEnabledProvider( std::unique_ptr<BluetoothEnabledProvider> bluetooth_enabled_provider, @@ -22,7 +21,8 @@ logged_in_user_enabled_provider, std::unique_ptr<ScreenStateEnabledProvider> screen_state_enabled_provider, std::unique_ptr<GoogleApiKeyAvailabilityProvider> - google_api_key_availability_provider) + google_api_key_availability_provider, + std::unique_ptr<ScanningEnabledProvider> scanning_enabled_provider) : bluetooth_enabled_provider_(std::move(bluetooth_enabled_provider)), fast_pair_pref_enabled_provider_( std::move(fast_pair_pref_enabled_provider)), @@ -33,23 +33,39 @@ std::move(google_api_key_availability_provider)) { // If the flag isn't enabled or if the API keys aren't available, // Fast Pair will never be enabled so don't hook up any callbacks. - if (features::IsFastPairEnabled() && - google_api_key_availability_provider_->is_enabled()) { - bluetooth_enabled_provider_->SetCallback(base::BindRepeating( - &FastPairEnabledProvider::OnSubProviderEnabledChanged, - weak_factory_.GetWeakPtr())); + if (features::IsFastPairEnabled() && AreAPIKeysAvailable()) { + if (features::IsFastPairSoftwareScanningSupportEnabled()) { + scanning_enabled_provider_ = std::move(scanning_enabled_provider); + if (scanning_enabled_provider_) { + scanning_enabled_provider_->SetCallback(base::BindRepeating( + &FastPairEnabledProvider::OnSubProviderEnabledChanged, + weak_factory_.GetWeakPtr())); + } + } - fast_pair_pref_enabled_provider_->SetCallback(base::BindRepeating( - &FastPairEnabledProvider::OnSubProviderEnabledChanged, - weak_factory_.GetWeakPtr())); + if (bluetooth_enabled_provider_) { + bluetooth_enabled_provider_->SetCallback(base::BindRepeating( + &FastPairEnabledProvider::OnSubProviderEnabledChanged, + weak_factory_.GetWeakPtr())); + } - logged_in_user_enabled_provider_->SetCallback(base::BindRepeating( - &FastPairEnabledProvider::OnSubProviderEnabledChanged, - weak_factory_.GetWeakPtr())); + if (fast_pair_pref_enabled_provider_) { + fast_pair_pref_enabled_provider_->SetCallback(base::BindRepeating( + &FastPairEnabledProvider::OnSubProviderEnabledChanged, + weak_factory_.GetWeakPtr())); + } - screen_state_enabled_provider_->SetCallback(base::BindRepeating( - &FastPairEnabledProvider::OnSubProviderEnabledChanged, - weak_factory_.GetWeakPtr())); + if (logged_in_user_enabled_provider_) { + logged_in_user_enabled_provider_->SetCallback(base::BindRepeating( + &FastPairEnabledProvider::OnSubProviderEnabledChanged, + weak_factory_.GetWeakPtr())); + } + + if (screen_state_enabled_provider_) { + screen_state_enabled_provider_->SetCallback(base::BindRepeating( + &FastPairEnabledProvider::OnSubProviderEnabledChanged, + weak_factory_.GetWeakPtr())); + } SetEnabledAndInvokeCallback(AreSubProvidersEnabled()); } @@ -57,28 +73,69 @@ FastPairEnabledProvider::~FastPairEnabledProvider() = default; -bool FastPairEnabledProvider::AreSubProvidersEnabled() { - CD_LOG(INFO, Feature::FP) - << __func__ - << ": Flag:" << base::FeatureList::IsEnabled(features::kFastPair) - << " Policy Pref:" << fast_pair_pref_enabled_provider_->is_enabled() - << " Google API Key:" - << google_api_key_availability_provider_->is_enabled() - << " Logged in User:" << logged_in_user_enabled_provider_->is_enabled() - << " Screen State:" << screen_state_enabled_provider_->is_enabled() - << " Bluetooth:" << bluetooth_enabled_provider_->is_enabled(); +bool FastPairEnabledProvider::IsBluetoothEnabled() { + return bluetooth_enabled_provider_ && + bluetooth_enabled_provider_->is_enabled(); +} - return base::FeatureList::IsEnabled(features::kFastPair) && - fast_pair_pref_enabled_provider_->is_enabled() && - google_api_key_availability_provider_->is_enabled() && - logged_in_user_enabled_provider_->is_enabled() && - bluetooth_enabled_provider_->is_enabled() && +bool FastPairEnabledProvider::AreAPIKeysAvailable() { + return google_api_key_availability_provider_ && + google_api_key_availability_provider_->is_enabled(); +} + +bool FastPairEnabledProvider::IsFastPairPrefEnabled() { + return fast_pair_pref_enabled_provider_ && + fast_pair_pref_enabled_provider_->is_enabled(); +} + +bool FastPairEnabledProvider::IsUserLoggedIn() { + return logged_in_user_enabled_provider_ && + logged_in_user_enabled_provider_->is_enabled(); +} + +bool FastPairEnabledProvider::IsDisplayScreenOn() { + return screen_state_enabled_provider_ && screen_state_enabled_provider_->is_enabled(); } +bool FastPairEnabledProvider::IsScanningEnabled() { + return scanning_enabled_provider_ && scanning_enabled_provider_->is_enabled(); +} + +bool FastPairEnabledProvider::AreSubProvidersEnabled() { + if (features::IsFastPairSoftwareScanningSupportEnabled()) { + CD_LOG(INFO, Feature::FP) + << __func__ + << ": Flag:" << base::FeatureList::IsEnabled(features::kFastPair) + << " Policy Pref:" << IsFastPairPrefEnabled() + << " Google API Key:" << AreAPIKeysAvailable() + << " Logged in User:" << IsUserLoggedIn() + << " Screen State:" << IsDisplayScreenOn() + << " Bluetooth:" << IsBluetoothEnabled() + << " Scanning Enabled: " << IsScanningEnabled(); + + return base::FeatureList::IsEnabled(features::kFastPair) && + IsFastPairPrefEnabled() && AreAPIKeysAvailable() && + IsUserLoggedIn() && IsDisplayScreenOn() && IsBluetoothEnabled() && + IsScanningEnabled(); + } else { + CD_LOG(INFO, Feature::FP) + << __func__ + << ": Flag:" << base::FeatureList::IsEnabled(features::kFastPair) + << " Policy Pref:" << IsFastPairPrefEnabled() + << " Google API Key:" << AreAPIKeysAvailable() + << " Logged in User:" << IsUserLoggedIn() + << " Screen State:" << IsDisplayScreenOn() + << " Bluetooth:" << IsBluetoothEnabled(); + + return base::FeatureList::IsEnabled(features::kFastPair) && + IsFastPairPrefEnabled() && AreAPIKeysAvailable() && + IsUserLoggedIn() && IsDisplayScreenOn() && IsBluetoothEnabled(); + } +} + void FastPairEnabledProvider::OnSubProviderEnabledChanged(bool) { SetEnabledAndInvokeCallback(AreSubProvidersEnabled()); } -} // namespace quick_pair -} // namespace ash +} // namespace ash::quick_pair
diff --git a/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.h b/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.h index 6068004..94feb6e7 100644 --- a/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.h +++ b/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.h
@@ -10,11 +10,11 @@ #include "ash/quick_pair/feature_status_tracker/fast_pair_pref_enabled_provider.h" #include "ash/quick_pair/feature_status_tracker/google_api_key_availability_provider.h" #include "ash/quick_pair/feature_status_tracker/logged_in_user_enabled_provider.h" +#include "ash/quick_pair/feature_status_tracker/scanning_enabled_provider.h" #include "ash/quick_pair/feature_status_tracker/screen_state_enabled_provider.h" #include "base/memory/weak_ptr.h" -namespace ash { -namespace quick_pair { +namespace ash::quick_pair { // Exposes an |is_enabled()| method and callback to query and observe when the // Fast Pair feature is enabled/disabled. @@ -28,10 +28,18 @@ logged_in_user_enabled_provider, std::unique_ptr<ScreenStateEnabledProvider> screen_state_enabled_provider, std::unique_ptr<GoogleApiKeyAvailabilityProvider> - google_api_key_availability_provider); + google_api_key_availability_provider, + std::unique_ptr<ScanningEnabledProvider> scanning_enabled_provider); ~FastPairEnabledProvider() override; private: + bool IsBluetoothEnabled(); + bool AreAPIKeysAvailable(); + bool IsFastPairPrefEnabled(); + bool IsUserLoggedIn(); + bool IsDisplayScreenOn(); + bool IsScanningEnabled(); + bool AreSubProvidersEnabled(); void OnSubProviderEnabledChanged(bool); @@ -41,10 +49,10 @@ std::unique_ptr<ScreenStateEnabledProvider> screen_state_enabled_provider_; std::unique_ptr<GoogleApiKeyAvailabilityProvider> google_api_key_availability_provider_; + std::unique_ptr<ScanningEnabledProvider> scanning_enabled_provider_; base::WeakPtrFactory<FastPairEnabledProvider> weak_factory_{this}; }; -} // namespace quick_pair -} // namespace ash +} // namespace ash::quick_pair #endif // ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_FAST_PAIR_ENABLED_PROVIDER_H_
diff --git a/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider_unittest.cc b/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider_unittest.cc index 31d162aa..5166be74 100644 --- a/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider_unittest.cc +++ b/ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider_unittest.cc
@@ -15,6 +15,7 @@ #include "ash/quick_pair/feature_status_tracker/mock_fast_pair_pref_enabled_provider.h" #include "ash/quick_pair/feature_status_tracker/mock_google_api_key_availability_provider.h" #include "ash/quick_pair/feature_status_tracker/mock_logged_in_user_enabled_provider.h" +#include "ash/quick_pair/feature_status_tracker/mock_scanning_enabled_provider.h" #include "ash/quick_pair/feature_status_tracker/mock_screen_state_enabled_provider.h" #include "ash/quick_pair/feature_status_tracker/screen_state_enabled_provider.h" #include "ash/test/ash_test_base.h" @@ -27,8 +28,11 @@ #include "testing/gtest/include/gtest/gtest-param-test.h" #include "testing/gtest/include/gtest/gtest.h" -namespace ash { -namespace quick_pair { +namespace { +constexpr int kNumFastPairEnabledProviderArgs = 6; +} // namespace + +namespace ash::quick_pair { class FastPairEnabledProviderTest : public AshTestBase { public: @@ -66,58 +70,54 @@ ON_CALL(*google_api_key_availability_provider, is_enabled) .WillByDefault(testing::Return(true)); + auto* scanning_enabled_provider = new MockScanningEnabledProvider(); + ON_CALL(*scanning_enabled_provider, is_enabled) + .WillByDefault(testing::Return(true)); + auto provider = std::make_unique<FastPairEnabledProvider>( std::make_unique<BluetoothEnabledProvider>(), base::WrapUnique(fast_pair_pref_enabled_provider), base::WrapUnique(logged_in_user_enabled_provider), base::WrapUnique(screen_state_enabled_provider), - base::WrapUnique(google_api_key_availability_provider)); + base::WrapUnique(google_api_key_availability_provider), + base::WrapUnique(scanning_enabled_provider)); provider->SetCallback(callback.Get()); adapter_->SetBluetoothIsPowered(true); } -// Represents: <is_flag_enabled, is_bt_enabled, is_pref_enabled, -// is_user_logged_in, is_screen_state_on, -// is_google_api_keys_available> -using TestParam = std::tuple<bool, bool, bool, bool, bool, bool>; - -class FastPairEnabledProviderTestWithParams - : public FastPairEnabledProviderTest, - public testing::WithParamInterface<TestParam> {}; - -TEST_P(FastPairEnabledProviderTestWithParams, IsEnabledWhenExpected) { - bool is_flag_enabled = std::get<0>(GetParam()); - bool is_bt_enabled = std::get<1>(GetParam()); - bool is_pref_enabled = std::get<2>(GetParam()); - bool is_user_logged_in = std::get<3>(GetParam()); - bool is_screen_state_on = std::get<4>(GetParam()); - bool is_google_api_keys_available = std::get<5>(GetParam()); - +TEST_F(FastPairEnabledProviderTest, IsEnabledWhenExpected) { base::test::ScopedFeatureList feature_list; - feature_list.InitWithFeatureState(features::kFastPair, is_flag_enabled); + const base::flat_map<base::test::FeatureRef, bool> feature_states{ + {features::kFastPair, true}, + {features::kFastPairSoftwareScanningSupport, true}}; + feature_list.InitWithFeatureStates(feature_states); auto* bluetooth_enabled_provider = new MockBluetoothEnabledProvider(); ON_CALL(*bluetooth_enabled_provider, is_enabled) - .WillByDefault(testing::Return(is_bt_enabled)); + .WillByDefault(testing::Return(true)); auto* fast_pair_pref_enabled_provider = new MockFastPairPrefEnabledProvider(); ON_CALL(*fast_pair_pref_enabled_provider, is_enabled) - .WillByDefault(testing::Return(is_pref_enabled)); + .WillByDefault(testing::Return(true)); auto* logged_in_user_enabled_provider = new MockLoggedInUserEnabledProvider(); ON_CALL(*logged_in_user_enabled_provider, is_enabled) - .WillByDefault(testing::Return(is_user_logged_in)); + .WillByDefault(testing::Return(true)); auto* screen_state_enabled_provider = new MockScreenStateEnabledProvider(); ON_CALL(*screen_state_enabled_provider, is_enabled) - .WillByDefault(testing::Return(is_screen_state_on)); + .WillByDefault(testing::Return(true)); auto* google_api_key_availability_provider = new MockGoogleApiKeyAvailabilityProvider(); ON_CALL(*google_api_key_availability_provider, is_enabled) - .WillByDefault(testing::Return(is_google_api_keys_available)); + .WillByDefault(testing::Return(true)); + + auto* scanning_enabled_provider = new MockScanningEnabledProvider(); + ON_CALL(*scanning_enabled_provider, is_enabled) + .WillByDefault(testing::Return(true)); auto provider = std::make_unique<FastPairEnabledProvider>( std::unique_ptr<BluetoothEnabledProvider>(bluetooth_enabled_provider), @@ -127,23 +127,78 @@ logged_in_user_enabled_provider), std::unique_ptr<ScreenStateEnabledProvider>( screen_state_enabled_provider), - base::WrapUnique(google_api_key_availability_provider)); + base::WrapUnique(google_api_key_availability_provider), + base::WrapUnique(scanning_enabled_provider)); - bool all_are_enabled = is_flag_enabled && is_bt_enabled && is_pref_enabled && - is_user_logged_in && is_screen_state_on && - is_google_api_keys_available; - - EXPECT_EQ(provider->is_enabled(), all_are_enabled); + EXPECT_TRUE(provider->is_enabled()); } -INSTANTIATE_TEST_SUITE_P(FastPairEnabledProviderTestWithParams, - FastPairEnabledProviderTestWithParams, - testing::Combine(testing::Bool(), - testing::Bool(), - testing::Bool(), - testing::Bool(), - testing::Bool(), - testing::Bool())); +class FastPairEnabledProviderTestNoCrashOnNullInputs + : public FastPairEnabledProviderTest, + public testing::WithParamInterface<size_t> {}; -} // namespace quick_pair -} // namespace ash +TEST_P(FastPairEnabledProviderTestNoCrashOnNullInputs, NoCrashOnNullInputs) { + base::test::ScopedFeatureList feature_list; + const base::flat_map<base::test::FeatureRef, bool> feature_states{ + {features::kFastPair, true}, + {features::kFastPairSoftwareScanningSupport, true}}; + feature_list.InitWithFeatureStates(feature_states); + + size_t args_mask = GetParam(); + bool is_bluetooth_provider_nonnull = args_mask & 1; + bool is_fast_pair_pref_nonnull = args_mask & 2; + bool is_user_enabled_provider_nonnull = args_mask & 4; + bool is_screen_enabled_provider_nonnull = args_mask & 8; + bool is_api_provider_nonnull = args_mask & 16; + bool is_scanning_provider_nonnull = args_mask & 32; + + std::unique_ptr<BluetoothEnabledProvider> bluetooth_enabled_provider; + if (is_bluetooth_provider_nonnull) { + bluetooth_enabled_provider = std::make_unique<BluetoothEnabledProvider>(); + } + + MockFastPairPrefEnabledProvider* fast_pair_pref_enabled_provider = nullptr; + if (is_fast_pair_pref_nonnull) { + fast_pair_pref_enabled_provider = new MockFastPairPrefEnabledProvider(); + } + + MockLoggedInUserEnabledProvider* logged_in_user_enabled_provider = nullptr; + if (is_user_enabled_provider_nonnull) { + logged_in_user_enabled_provider = new MockLoggedInUserEnabledProvider(); + } + + MockScreenStateEnabledProvider* screen_state_enabled_provider = nullptr; + if (is_screen_enabled_provider_nonnull) { + screen_state_enabled_provider = new MockScreenStateEnabledProvider(); + } + + MockGoogleApiKeyAvailabilityProvider* google_api_key_availability_provider = + nullptr; + if (is_api_provider_nonnull) { + google_api_key_availability_provider = + new MockGoogleApiKeyAvailabilityProvider(); + } + + MockScanningEnabledProvider* scanning_enabled_provider = nullptr; + if (is_scanning_provider_nonnull) { + scanning_enabled_provider = new MockScanningEnabledProvider(); + } + + std::unique_ptr<FastPairEnabledProvider> fast_pair_enabled_provider = + std::make_unique<FastPairEnabledProvider>( + std::move(bluetooth_enabled_provider), + base::WrapUnique(fast_pair_pref_enabled_provider), + base::WrapUnique(logged_in_user_enabled_provider), + base::WrapUnique(screen_state_enabled_provider), + base::WrapUnique(google_api_key_availability_provider), + base::WrapUnique(scanning_enabled_provider)); + + fast_pair_enabled_provider->is_enabled(); +} + +INSTANTIATE_TEST_SUITE_P( + FastPairEnabledProviderTestNoCrashOnNullInputs, + FastPairEnabledProviderTestNoCrashOnNullInputs, + testing::Range<size_t>(0, 1 << kNumFastPairEnabledProviderArgs)); + +} // namespace ash::quick_pair
diff --git a/ash/quick_pair/feature_status_tracker/mock_scanning_enabled_provider.cc b/ash/quick_pair/feature_status_tracker/mock_scanning_enabled_provider.cc new file mode 100644 index 0000000..8f0837d3 --- /dev/null +++ b/ash/quick_pair/feature_status_tracker/mock_scanning_enabled_provider.cc
@@ -0,0 +1,14 @@ +// 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 "ash/quick_pair/feature_status_tracker/mock_scanning_enabled_provider.h" + +namespace ash::quick_pair { + +MockScanningEnabledProvider::MockScanningEnabledProvider() + : ScanningEnabledProvider(nullptr, nullptr, nullptr, nullptr) {} + +MockScanningEnabledProvider::~MockScanningEnabledProvider() = default; + +} // namespace ash::quick_pair
diff --git a/ash/quick_pair/feature_status_tracker/mock_scanning_enabled_provider.h b/ash/quick_pair/feature_status_tracker/mock_scanning_enabled_provider.h new file mode 100644 index 0000000..c2b1395 --- /dev/null +++ b/ash/quick_pair/feature_status_tracker/mock_scanning_enabled_provider.h
@@ -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. + +#ifndef ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_MOCK_SCANNING_ENABLED_PROVIDER_H_ +#define ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_MOCK_SCANNING_ENABLED_PROVIDER_H_ + +#include "testing/gmock/include/gmock/gmock.h" + +#include "ash/quick_pair/feature_status_tracker/scanning_enabled_provider.h" + +namespace ash::quick_pair { + +class MockScanningEnabledProvider : public ScanningEnabledProvider { + public: + MockScanningEnabledProvider(); + + MockScanningEnabledProvider(const MockScanningEnabledProvider&) = delete; + MockScanningEnabledProvider& operator=(const MockScanningEnabledProvider&) = + delete; + ~MockScanningEnabledProvider() override; + + MOCK_METHOD(bool, is_enabled, (), (override)); +}; + +} // namespace ash::quick_pair + +#endif // ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_MOCK_SCANNING_ENABLED_PROVIDER_H_
diff --git a/ash/quick_pair/feature_status_tracker/quick_pair_feature_status_tracker_impl.cc b/ash/quick_pair/feature_status_tracker/quick_pair_feature_status_tracker_impl.cc index d4111c5..0a51a9ce 100644 --- a/ash/quick_pair/feature_status_tracker/quick_pair_feature_status_tracker_impl.cc +++ b/ash/quick_pair/feature_status_tracker/quick_pair_feature_status_tracker_impl.cc
@@ -6,11 +6,14 @@ #include <memory> +#include "ash/quick_pair/feature_status_tracker/battery_saver_active_provider.h" #include "ash/quick_pair/feature_status_tracker/bluetooth_enabled_provider.h" #include "ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.h" #include "ash/quick_pair/feature_status_tracker/fast_pair_pref_enabled_provider.h" #include "ash/quick_pair/feature_status_tracker/google_api_key_availability_provider.h" +#include "ash/quick_pair/feature_status_tracker/hardware_offloading_supported_provider.h" #include "ash/quick_pair/feature_status_tracker/logged_in_user_enabled_provider.h" +#include "ash/quick_pair/feature_status_tracker/power_connected_provider.h" #include "ash/quick_pair/feature_status_tracker/screen_state_enabled_provider.h" #include "base/functional/bind.h" @@ -23,7 +26,12 @@ std::make_unique<FastPairPrefEnabledProvider>(), std::make_unique<LoggedInUserEnabledProvider>(), std::make_unique<ScreenStateEnabledProvider>(), - std::make_unique<GoogleApiKeyAvailabilityProvider>())) { + std::make_unique<GoogleApiKeyAvailabilityProvider>(), + std::make_unique<ScanningEnabledProvider>( + std::make_unique<BatterySaverActiveProvider>(), + std::make_unique<FastPairPrefEnabledProvider>(), + std::make_unique<HardwareOffloadingSupportedProvider>(), + std::make_unique<PowerConnectedProvider>()))) { fast_pair_enabled_provider_->SetCallback( base::BindRepeating(&FeatureStatusTrackerImpl::OnFastPairEnabledChanged, weak_factory_.GetWeakPtr()));
diff --git a/ash/quick_pair/feature_status_tracker/scanning_enabled_provider.cc b/ash/quick_pair/feature_status_tracker/scanning_enabled_provider.cc index 3741a9e..e07ca09 100644 --- a/ash/quick_pair/feature_status_tracker/scanning_enabled_provider.cc +++ b/ash/quick_pair/feature_status_tracker/scanning_enabled_provider.cc
@@ -47,15 +47,18 @@ Shell* shell = Shell::Get(); CHECK(shell); PrefService* local_state = shell->local_state(); - CHECK(local_state); - pref_change_registrar_ = std::make_unique<PrefChangeRegistrar>(); - pref_change_registrar_->Init(local_state); - pref_change_registrar_->Add( - ash::prefs::kSoftwareScanningEnabled, - base::BindRepeating( - &ScanningEnabledProvider::OnSoftwareScanningStatusChanged, - weak_factory_.GetWeakPtr())); - OnSoftwareScanningStatusChanged(); + + // `local_state` may be null in unit tests. + if (local_state) { + pref_change_registrar_ = std::make_unique<PrefChangeRegistrar>(); + pref_change_registrar_->Init(local_state); + pref_change_registrar_->Add( + ash::prefs::kSoftwareScanningEnabled, + base::BindRepeating( + &ScanningEnabledProvider::OnSoftwareScanningStatusChanged, + weak_factory_.GetWeakPtr())); + OnSoftwareScanningStatusChanged(); + } } ScanningEnabledProvider::~ScanningEnabledProvider() = default;
diff --git a/ash/search_box/search_box_view_base.cc b/ash/search_box/search_box_view_base.cc index de088fe..54f7efdd 100644 --- a/ash/search_box/search_box_view_base.cc +++ b/ash/search_box/search_box_view_base.cc
@@ -514,7 +514,7 @@ filter_button_ = filter_and_close_button_container_->AddChildView( std::make_unique<SearchBoxImageButton>(button_callback)); filter_button_->GetViewAccessibility().SetRole(ax::mojom::Role::kPopUpButton); - filter_button_->GetViewAccessibility().OverrideHasPopup( + filter_button_->GetViewAccessibility().SetHasPopup( ax::mojom::HasPopup::kMenu); return filter_button_; }
diff --git a/ash/sensor_info/sensor_provider_unittest.cc b/ash/sensor_info/sensor_provider_unittest.cc index 8f08b24..ec57cce 100644 --- a/ash/sensor_info/sensor_provider_unittest.cc +++ b/ash/sensor_info/sensor_provider_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 "ash/sensor_info/sensor_provider.h" + #include <memory> #include <optional> #include <set> @@ -9,7 +11,6 @@ #include <vector> #include "ash/accelerometer/accelerometer_constants.h" -#include "ash/sensor_info/sensor_provider.h" #include "ash/sensor_info/sensor_types.h" #include "ash/test/ash_test_helper.h" #include "base/memory/scoped_refptr.h"
diff --git a/ash/system/input_device_settings/input_device_settings_controller_unittest.cc b/ash/system/input_device_settings/input_device_settings_controller_unittest.cc index 61b5cb4..8d753d4 100644 --- a/ash/system/input_device_settings/input_device_settings_controller_unittest.cc +++ b/ash/system/input_device_settings/input_device_settings_controller_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 "ash/public/cpp/input_device_settings_controller.h" + #include <cstdint> #include <memory> #include <optional> @@ -10,7 +12,6 @@ #include "ash/constants/ash_pref_names.h" #include "ash/events/event_rewriter_controller_impl.h" #include "ash/public/cpp/ash_prefs.h" -#include "ash/public/cpp/input_device_settings_controller.h" #include "ash/public/mojom/input_device_settings.mojom.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h"
diff --git a/ash/system/notification_center/views/message_view_container.cc b/ash/system/notification_center/views/message_view_container.cc index 17eab78..b130189 100644 --- a/ash/system/notification_center/views/message_view_container.cc +++ b/ash/system/notification_center/views/message_view_container.cc
@@ -7,7 +7,10 @@ #include "ash/constants/ash_features.h" #include "ash/system/notification_center/message_center_constants.h" #include "ash/system/notification_center/message_center_utils.h" +#include "ash/system/notification_center/metrics_utils.h" #include "ash/system/notification_center/notification_style_utils.h" +#include "ash/system/notification_center/views/notification_list_view.h" +#include "ash/system/notification_center/views/notification_swipe_control_view.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/message_center/public/cpp/notification.h" #include "ui/message_center/views/message_view.h" @@ -26,10 +29,24 @@ } // namespace MessageViewContainer::MessageViewContainer( - std::unique_ptr<message_center::MessageView> message_view) { + std::unique_ptr<message_center::MessageView> message_view, + NotificationListView* list_view) + : list_view_(list_view) { SetLayoutManager(std::make_unique<views::FillLayout>()); + control_view_ = AddChildView( + std::make_unique<NotificationSwipeControlView>(message_view.get())); + + // Load `MessageView` expand state. + message_center::ExpandState expand_state = + message_center::MessageCenter::Get()->GetNotificationExpandState( + message_view->notification_id()); + if (expand_state != message_center::ExpandState::DEFAULT) { + message_view->SetExpanded(expand_state == + message_center::ExpandState::USER_EXPANDED); + } + message_view_ = AddChildView(std::move(message_view)); - message_view_->SetPreferredSize(CalculatePreferredSize()); + message_view_->AddObserver(this); } int MessageViewContainer::CalculateHeight() const { @@ -55,10 +72,8 @@ message_view_->UpdateCornerRadius(top_radius, bottom_radius); - // Do not set background for arc notifications since they have their own - // custom background logic. - if (!features::IsRenderArcNotificationsByChromeEnabled() && - !message_center_utils::IsAshNotificationView(message_view_)) { + // Custom notifications handle their background separately. + if (disable_default_background_) { return; } @@ -77,10 +92,167 @@ message_view_->UpdateWithNotification(notification); } +base::TimeDelta MessageViewContainer::GetBoundsAnimationDuration() const { + auto* notification = + message_center::MessageCenter::Get()->FindNotificationById( + message_view()->notification_id()); + if (!notification) { + return base::Milliseconds(0); + } + return message_view()->GetBoundsAnimationDuration(*notification); +} + +void MessageViewContainer::SetExpandedBySystem(bool expanded) { + base::AutoReset<bool> scoped_reset(&expanding_by_system_, true); + message_view_->SetExpanded(expanded); +} + +void MessageViewContainer::SlideOutAndClose() { + is_slid_out_programatically_ = true; + message_view_->SlideOutAndClose(/*direction=*/1); +} + +void MessageViewContainer::CloseSwipeControl() { + message_view_->CloseSwipeControl(); +} + +void MessageViewContainer::TriggerPreferredSizeChangedForAnimation() { + views::View::PreferredSizeChanged(); +} + gfx::Size MessageViewContainer::CalculatePreferredSize() const { + if (list_view_ && list_view_->IsAnimatingExpandOrCollapseContainer(this)) { + // Width should never change, only height. + return gfx::Size(kNotificationInMessageCenterWidth, + gfx::Tween::IntValueBetween( + list_view_->GetCurrentAnimationValue(), + start_bounds_.height(), target_bounds_.height())); + } return gfx::Size(kNotificationInMessageCenterWidth, CalculateHeight()); } +void MessageViewContainer::ChildPreferredSizeChanged(views::View* child) { + // If we've already been removed, ignore new child size changes. + if (is_removed_) { + return; + } + + // PreferredSizeChanged will trigger + // NotificationListView::ChildPreferredSizeChanged. + base::ScopedClosureRunner defer_preferred_size_changed(base::BindOnce( + &MessageViewContainer::PreferredSizeChanged, base::Unretained(this))); + + // Ignore non-user triggered expand/collapses. + if (expanding_by_system_) { + return; + } + + auto* notification = + message_center::MessageCenter::Get()->FindNotificationById( + message_view()->notification_id()); + if (!notification) { + return; + } + + needs_bounds_animation_ = true; +} + +void MessageViewContainer::OnSlideChanged(const std::string& notification_id) { + control_view_->UpdateButtonsVisibility(); + + if (notification_id != GetNotificationId() || !list_view_ || + message_view_->GetSlideAmount() == 0 || !need_update_corner_radius_) { + return; + } + + need_update_corner_radius_ = false; + previous_is_top_ = is_top_; + previous_is_bottom_ = is_bottom_; + UpdateBorder(/*is_top=*/true, /*is_bottom=*/true); + size_t index = list_view_->GetIndexOf(this).value(); + + // Also update the corner radius for the views above and below when sliding. + auto list_child_views = list_view_->children(); + + auto* above_view = + (index == 0) + ? nullptr + : static_cast<MessageViewContainer*>(list_child_views[index - 1]); + auto* below_view = + (index == list_child_views.size() - 1) + ? nullptr + : static_cast<MessageViewContainer*>(list_child_views[index + 1]); + + if (above_view) { + above_view->UpdateBorder(above_view->is_top(), + /*is_bottom=*/true); + } + if (below_view) { + below_view->UpdateBorder(/*is_top=*/true, below_view->is_bottom()); + } +} + +void MessageViewContainer::OnSlideEnded(const std::string& notification_id) { + if (notification_id != GetNotificationId() || !list_view_) { + return; + } + + std::optional<size_t> index = list_view_->GetIndexOf(this); + if (!index.has_value()) { + return; + } + + // Also update the corner radius for the views above and below when sliding. + auto list_child_views = list_view_->children(); + auto* above_view = (index == size_t{0}) + ? nullptr + : static_cast<MessageViewContainer*>( + list_child_views[index.value() - 1]); + auto* below_view = (index == list_child_views.size() - 1) + ? nullptr + : static_cast<MessageViewContainer*>( + list_child_views[index.value() + 1]); + + // Reset the corner radius of views to their normal state. + UpdateBorder(previous_is_top_, previous_is_bottom_); + set_need_update_corner_radius(true); + + if (above_view && !above_view->is_slid_out()) { + above_view->UpdateBorder(above_view->is_top(), /*is_bottom=*/false); + above_view->set_need_update_corner_radius(true); + } + + if (below_view && !below_view->is_slid_out()) { + below_view->UpdateBorder(/*is_top=*/false, below_view->is_bottom()); + below_view->set_need_update_corner_radius(true); + } +} + +void MessageViewContainer::OnPreSlideOut(const std::string& notification_id) { + if (!is_slid_out_programatically_) { + metrics_utils::LogClosedByUser(notification_id, /*is_swipe=*/true, + /*is_popup=*/false); + } +} + +void MessageViewContainer::OnSlideOut(const std::string& notification_id) { + is_slid_out_ = true; + set_is_removed(true); + if (list_view_) { + list_view_->OnNotificationSlidOut(); + } +} + +bool MessageViewContainer::IsPinned() const { + return message_view_->GetMode() == message_center::MessageView::Mode::PINNED; +} + +bool MessageViewContainer::IsGroupParent() const { + return message_center::MessageCenter::Get() + ->FindNotificationById(GetNotificationId()) + ->group_parent(); +} + BEGIN_METADATA(MessageViewContainer); END_METADATA
diff --git a/ash/system/notification_center/views/message_view_container.h b/ash/system/notification_center/views/message_view_container.h index a142221e..a640e3d 100644 --- a/ash/system/notification_center/views/message_view_container.h +++ b/ash/system/notification_center/views/message_view_container.h
@@ -6,23 +6,28 @@ #define ASH_SYSTEM_NOTIFICATION_CENTER_VIEWS_MESSAGE_VIEW_CONTAINER_H_ #include "ui/base/metadata/metadata_header_macros.h" +#include "ui/message_center/views/message_view.h" #include "ui/views/view.h" namespace message_center { -class MessageView; class Notification; } // namespace message_center namespace ash { +class NotificationListView; +class NotificationSwipeControlView; + // Container view for `MessageView` objects, which are initialized with a // `message_center::Notification`. -class MessageViewContainer : public views::View { +class MessageViewContainer : public views::View, + public message_center::MessageView::Observer { METADATA_HEADER(MessageViewContainer, views::View) public: explicit MessageViewContainer( - std::unique_ptr<message_center::MessageView> message_view); + std::unique_ptr<message_center::MessageView> message_view, + NotificationListView* list_view = nullptr); MessageViewContainer(const MessageViewContainer&) = delete; MessageViewContainer& operator=(const MessageViewContainer&) = delete; ~MessageViewContainer() override = default; @@ -44,21 +49,123 @@ // Forwards call to `UpdateWithNotification` in `message_view_`. void UpdateWithNotification(const message_center::Notification& notification); - // views::View - gfx::Size CalculatePreferredSize() const override; - message_center::MessageView* message_view() { return message_view_; } const message_center::MessageView* message_view() const { return message_view_; } + base::TimeDelta GetBoundsAnimationDuration() const; + + void SetExpandedBySystem(bool expanded); + + void SlideOutAndClose(); + + void CloseSwipeControl(); + + // Allows NotificationListView to force preferred size to change during + // animations. + void TriggerPreferredSizeChangedForAnimation(); + + // views::View: + gfx::Size CalculatePreferredSize() const override; + void ChildPreferredSizeChanged(views::View* child) override; + + // MessageView::Observer: + void OnSlideChanged(const std::string& notification_id) override; + void OnSlideEnded(const std::string& notification_id) override; + void OnPreSlideOut(const std::string& notification_id) override; + void OnSlideOut(const std::string& notification_id) override; + + void set_start_bounds(const gfx::Rect& start_bounds) { + start_bounds_ = start_bounds; + } + + void set_target_bounds(const gfx::Rect& target_bounds) { + target_bounds_ = target_bounds; + } + + void set_is_removed(bool is_removed) { is_removed_ = is_removed; } + + void set_needs_bounds_animation(bool needs_bounds_animation) { + needs_bounds_animation_ = needs_bounds_animation; + } + + void set_disable_default_background(bool disable_default_background) { + disable_default_background_ = disable_default_background; + } + + void set_need_update_corner_radius(bool need_update_corner_radius) { + need_update_corner_radius_ = need_update_corner_radius; + } + + gfx::Rect start_bounds() const { return start_bounds_; } + gfx::Rect target_bounds() const { return target_bounds_; } + bool is_removed() const { return is_removed_; } + bool needs_bounds_animation() const { return needs_bounds_animation_; } + bool is_slid_out() { return is_slid_out_; } + + // Returns if the notification is pinned i.e. can be removed manually. + bool IsPinned() const; + + // Returns if the notification is a parent of other grouped notifications. + bool IsGroupParent() const; + + // Returns the direction that the notification is swiped out. If swiped to the + // left, it returns -1 and if sipwed to the right, it returns 1. By default + // (i.e. the notification is removed but not by touch gesture), it returns 1. + int GetSlideDirection() const { + return message_view_->GetSlideAmount() < 0 ? -1 : 1; + } + + bool is_top() { return is_top_; } + bool is_bottom() { return is_bottom_; } + private: // Used to track if this view is at the top or bottom of its parent list view // and prevent unnecessary updates. bool is_top_ = false; bool is_bottom_ = false; - // Owned by `this`. + // Cached to return to previous state after slide animation ends. + bool previous_is_bottom_ = false; + bool previous_is_top_ = false; + + // The bounds that the container starts animating from. If not animating, it's + // ignored. + gfx::Rect start_bounds_; + + // The final bounds of the container. If not animating, it's same as the + // actual bounds(). + gfx::Rect target_bounds_; + + // True when the notification is removed and during slide out animation. + bool is_removed_ = false; + + // True if the notification is slid out completely. + bool is_slid_out_ = false; + + // True if the notification is slid out through SlideOutAndClose() + // programagically. False if slid out manually by the user. + bool is_slid_out_programatically_ = false; + + // Whether expanded state is being set programmatically. Used to prevent + // animating programmatic expands which occur on open. + bool expanding_by_system_ = false; + + // Set to flag the view as requiring an expand or collapse animation. + bool needs_bounds_animation_ = false; + + // `need_update_corner_radius_` indicates that we need to update the corner + // radius of the view when sliding. + bool need_update_corner_radius_ = true; + + // Indicates if this view should not draw a background, used for custom + // notification views which handle their own background. + bool disable_default_background_ = false; + + // Owned by the views hierarchy. + const raw_ptr<NotificationListView> list_view_; + raw_ptr<NotificationSwipeControlView> control_view_; raw_ptr<message_center::MessageView> message_view_; };
diff --git a/ash/system/notification_center/views/notification_list_view.cc b/ash/system/notification_center/views/notification_list_view.cc index 26d540a..9983153 100644 --- a/ash/system/notification_center/views/notification_list_view.cc +++ b/ash/system/notification_center/views/notification_list_view.cc
@@ -15,6 +15,7 @@ #include "ash/system/notification_center/metrics_utils.h" #include "ash/system/notification_center/notification_style_utils.h" #include "ash/system/notification_center/views/ash_notification_view.h" +#include "ash/system/notification_center/views/message_view_container.h" #include "ash/system/notification_center/views/notification_center_view.h" #include "ash/system/notification_center/views/notification_swipe_control_view.h" #include "ash/system/tray/tray_constants.h" @@ -56,9 +57,6 @@ constexpr base::TimeDelta kClearAllVisibleAnimationDuration = base::Milliseconds(160); -constexpr char kMessageViewContainerClassName[] = - "NotificationListView::MessageViewContainer"; - constexpr char kMoveDownAnimationSmoothnessHistogramName[] = "Ash.Notification.MoveDown.AnimationSmoothness"; constexpr char kClearAllStackedAnimationSmoothnessHistogramName[] = @@ -89,333 +87,6 @@ } // namespace -// Container view of notification and swipe control. -// All children of NotificationListView should be MessageViewContainer. -class NotificationListView::MessageViewContainer : public MessageView::Observer, - public views::View { - METADATA_HEADER(MessageViewContainer, views::View) - - public: - MessageViewContainer(std::unique_ptr<MessageView> message_view, - NotificationListView* list_view) - : list_view_(list_view) { - message_view->AddObserver(this); - - message_center::ExpandState expand_state = - MessageCenter::Get()->GetNotificationExpandState( - message_view->notification_id()); - - if (expand_state != message_center::ExpandState::DEFAULT) { - message_view->SetExpanded(expand_state == - message_center::ExpandState::USER_EXPANDED); - } - - SetLayoutManager(std::make_unique<views::FillLayout>()); - control_view_ = AddChildView( - std::make_unique<NotificationSwipeControlView>(message_view.get())); - message_view_ = AddChildView(std::move(message_view)); - } - - MessageViewContainer(const MessageViewContainer&) = delete; - MessageViewContainer& operator=(const MessageViewContainer&) = delete; - - ~MessageViewContainer() override { message_view_->RemoveObserver(this); } - - base::TimeDelta GetBoundsAnimationDuration() const { - auto* notification = MessageCenter::Get()->FindNotificationById( - message_view()->notification_id()); - if (!notification) { - return base::Milliseconds(0); - } - return message_view()->GetBoundsAnimationDuration(*notification); - } - - void UpdateBackground(int top_radius, int bottom_radius) { - message_view_->UpdateCornerRadius(top_radius, bottom_radius); - - if (disable_default_background_) { - return; - } - message_view_->SetBackground( - notification_style_utils::CreateNotificationBackground( - top_radius, bottom_radius, false, false)); - } - - // Update the border and background corners based on if the notification is - // at the top or the bottom. If `force_update` is true, ignore previous states - // and always update the border. - void UpdateBorder(bool is_top, bool is_bottom, bool force_update) { - if (is_top_ == is_top && is_bottom_ == is_bottom && !force_update) { - return; - } - is_top_ = is_top; - is_bottom_ = is_bottom; - - // The entire scroll view has rounded corners. - const int top_bottom_corner_radius = kMessageCenterScrollViewCornerRadius; - const int inner_corner_radius = kMessageCenterNotificationInnerCornerRadius; - UpdateBackground( - is_top ? top_bottom_corner_radius : inner_corner_radius, - is_bottom ? top_bottom_corner_radius : inner_corner_radius); - } - - // Reset rounding the corner of the view. This is called when we end a slide. - void ResetCornerRadius() { - need_update_corner_radius_ = true; - - UpdateBackground(kMessageCenterNotificationInnerCornerRadius, - kMessageCenterNotificationInnerCornerRadius); - } - - void SetExpandedBySystem(bool expanded) { - base::AutoReset<bool> scoped_reset(&expanding_by_system_, true); - message_view_->SetExpanded(expanded); - } - - void SlideOutAndClose() { - is_slid_out_programatically = true; - message_view_->SlideOutAndClose(1 /* direction */); - } - - std::string GetNotificationId() const { - return message_view_->notification_id(); - } - - void UpdateWithNotification(const Notification& notification) { - message_view_->UpdateWithNotification(notification); - } - - void CloseSwipeControl() { message_view_->CloseSwipeControl(); } - - // Returns if the notification is pinned i.e. can be removed manually. - bool IsPinned() const { - return message_view_->GetMode() == MessageView::Mode::PINNED; - } - - bool IsGroupParent() const { - return MessageCenter::Get() - ->FindNotificationById(GetNotificationId()) - ->group_parent(); - } - - // Returns the direction that the notification is swiped out. If swiped to the - // left, it returns -1 and if sipwed to the right, it returns 1. By default - // (i.e. the notification is removed but not by touch gesture), it returns 1. - int GetSlideDirection() const { - return message_view_->GetSlideAmount() < 0 ? -1 : 1; - } - - // Allows NotificationListView to force preferred size to change during - // animations. - void TriggerPreferredSizeChangedForAnimation() { - views::View::PreferredSizeChanged(); - } - - // views::View: - void ChildPreferredSizeChanged(views::View* child) override { - // If we've already been removed, ignore new child size changes. - if (is_removed_) { - return; - } - - // PreferredSizeChanged will trigger - // NotificationListView::ChildPreferredSizeChanged. - base::ScopedClosureRunner defer_preferred_size_changed(base::BindOnce( - &MessageViewContainer::PreferredSizeChanged, base::Unretained(this))); - - // Ignore non-user triggered expand/collapses. - if (expanding_by_system_) { - return; - } - - auto* notification = MessageCenter::Get()->FindNotificationById( - message_view()->notification_id()); - if (!notification) { - return; - } - - needs_bounds_animation_ = true; - } - - gfx::Size CalculatePreferredSize() const override { - if (list_view_->IsAnimatingExpandOrCollapseContainer(this)) { - // Width should never change, only height. - return gfx::Size(list_view_->message_view_width_, - gfx::Tween::IntValueBetween( - list_view_->GetCurrentValue(), - start_bounds_.height(), target_bounds_.height())); - } - return gfx::Size(list_view_->message_view_width_, target_bounds_.height()); - } - - // MessageView::Observer: - void OnSlideChanged(const std::string& notification_id) override { - control_view_->UpdateButtonsVisibility(); - - if (notification_id != GetNotificationId() || - message_view_->GetSlideAmount() == 0 || !need_update_corner_radius_) { - return; - } - - need_update_corner_radius_ = false; - - const int top_bottom_corner_radius = kMessageCenterScrollViewCornerRadius; - const int inner_corner_radius = kMessageCenterNotificationInnerCornerRadius; - UpdateBackground(top_bottom_corner_radius, top_bottom_corner_radius); - - // Also update `above_view_`'s bottom and `below_view_`'s top corner radius - // when sliding. - size_t index = list_view_->GetIndexOf(this).value(); - auto list_child_views = list_view_->children(); - - above_view_ = (index == 0) ? nullptr : AsMVC(list_child_views[index - 1]); - if (above_view_) { - above_view_->UpdateBackground(inner_corner_radius, - top_bottom_corner_radius); - } - - below_view_ = (index == list_child_views.size() - 1) - ? nullptr - : AsMVC(list_child_views[index + 1]); - if (below_view_) { - below_view_->UpdateBackground(top_bottom_corner_radius, - inner_corner_radius); - } - } - - void OnSlideEnded(const std::string& notification_id) override { - if (notification_id != GetNotificationId()) { - return; - } - - std::optional<size_t> index = list_view_->GetIndexOf(this); - if (!index.has_value()) { - return; - } - auto list_child_views = list_view_->children(); - above_view_ = (index == size_t{0}) - ? nullptr - : AsMVC(list_child_views[index.value() - 1]); - below_view_ = (index == list_child_views.size() - 1) - ? nullptr - : AsMVC(list_child_views[index.value() + 1]); - - // Reset the corner radius of views to their normal state. - ResetCornerRadius(); - if (above_view_ && !above_view_->is_slid_out()) { - above_view_->ResetCornerRadius(); - } - if (below_view_ && !below_view_->is_slid_out()) { - below_view_->ResetCornerRadius(); - } - } - - void OnPreSlideOut(const std::string& notification_id) override { - if (!is_slid_out_programatically) { - metrics_utils::LogClosedByUser(notification_id, /*is_swipe=*/true, - /*is_popup=*/false); - } - } - - void OnSlideOut(const std::string& notification_id) override { - is_slid_out_ = true; - set_is_removed(); - list_view_->OnNotificationSlidOut(); - } - - void OnThemeChanged() override { - views::View::OnThemeChanged(); - // Do not try to update background when the theme changes for notifications - // rendered in arc since they handle theme changes separately. - if (!features::IsRenderArcNotificationsByChromeEnabled() && - !message_center_utils::IsAshNotificationView(message_view_)) { - return; - } - - UpdateBackground(is_top_ ? kMessageCenterScrollViewCornerRadius - : kMessageCenterNotificationInnerCornerRadius, - is_bottom_ ? kMessageCenterScrollViewCornerRadius - : kMessageCenterNotificationInnerCornerRadius); - } - - gfx::Rect start_bounds() const { return start_bounds_; } - gfx::Rect target_bounds() const { return target_bounds_; } - bool is_removed() const { return is_removed_; } - - void ResetNeedsBoundsAnimation() { needs_bounds_animation_ = false; } - bool needs_bounds_animation() const { return needs_bounds_animation_; } - - void set_start_bounds(const gfx::Rect& start_bounds) { - start_bounds_ = start_bounds; - } - - void set_target_bounds(const gfx::Rect& ideal_bounds) { - target_bounds_ = ideal_bounds; - } - - void set_is_removed() { is_removed_ = true; } - - void set_disable_default_background(bool disable_default_background) { - disable_default_background_ = disable_default_background; - } - - bool is_slid_out() { return is_slid_out_; } - - MessageView* message_view() { return message_view_; } - const MessageView* message_view() const { return message_view_; } - - private: - // The bounds that the container starts animating from. If not animating, it's - // ignored. - gfx::Rect start_bounds_; - - // The final bounds of the container. If not animating, it's same as the - // actual bounds(). - gfx::Rect target_bounds_; - - // True when the notification is removed and during slide out animation. - bool is_removed_ = false; - - // True if the notification is slid out completely. - bool is_slid_out_ = false; - - // True if the notification is slid out through SlideOutAndClose() - // programagically. False if slid out manually by the user. - bool is_slid_out_programatically = false; - - // Keeps track if this view is at the top or bottom of `list_view_`. Storing - // this to prevent unnecessary update. - bool is_top_ = false; - bool is_bottom_ = false; - - // Whether expanded state is being set programmatically. Used to prevent - // animating programmatic expands which occur on open. - bool expanding_by_system_ = false; - - // Set to flag the view as requiring an expand or collapse animation. - bool needs_bounds_animation_ = false; - - // The views directly above or below this view in the list. Used to update - // corner radius when sliding. - raw_ptr<MessageViewContainer, DanglingUntriaged> above_view_ = nullptr; - raw_ptr<MessageViewContainer> below_view_ = nullptr; - - // `need_update_corner_radius_` indicates that we need to update the corner - // radius of the view when sliding. - bool need_update_corner_radius_ = true; - - // Indicates if this view should not draw a background, used for custom - // notification views which handle their own background. - bool disable_default_background_ = false; - - const raw_ptr<NotificationListView> list_view_; - raw_ptr<NotificationSwipeControlView> control_view_; - raw_ptr<MessageView> message_view_; -}; - -BEGIN_METADATA(NotificationListView, MessageViewContainer) -END_METADATA - NotificationListView::NotificationListView( NotificationCenterView* message_center_view) : views::AnimationDelegateViews(this), @@ -439,7 +110,7 @@ const std::vector<message_center::Notification*>& notifications) { for (auto* notification : notifications) { auto message_view_container = std::make_unique<MessageViewContainer>( - CreateMessageView(*notification), this); + CreateMessageView(*notification), /*list_view=*/this); message_view_container->set_disable_default_background( notification->custom_view_type() == kArcNotificationCustomViewType); // The insertion order for notifications is reversed. @@ -601,14 +272,37 @@ return animation_->is_animating(); } +double NotificationListView::GetCurrentAnimationValue() const { + gfx::Tween::Type tween; + switch (state_) { + case State::IDLE: + // No animations are used for State::IDLE. + NOTREACHED(); + tween = gfx::Tween::LINEAR; + break; + case State::CLEAR_ALL_STACKED: + case State::MOVE_DOWN: + tween = gfx::Tween::FAST_OUT_SLOW_IN; + break; + case State::CLEAR_ALL_VISIBLE: + tween = gfx::Tween::EASE_IN; + break; + case State::EXPAND_OR_COLLAPSE: + tween = gfx::Tween::FAST_OUT_SLOW_IN_3; + break; + } + + return gfx::Tween::CalculateValue(tween, animation_->GetCurrentValue()); +} + bool NotificationListView::IsAnimatingExpandOrCollapseContainer( const views::View* view) const { if (!view || !expand_or_collapsing_container_) { return false; } - DCHECK(views::IsViewClass<NotificationListView::MessageViewContainer>(view)) - << view->GetClassName() << " is not a " << kMessageViewContainerClassName; + DCHECK(views::IsViewClass<MessageViewContainer>(view)) + << view->GetClassName() << " is not a MessageViewContainer."; const MessageViewContainer* message_view_container = AsMVC(view); return message_view_container == expand_or_collapsing_container_; } @@ -642,7 +336,7 @@ animation_->End(); } expand_or_collapsing_container_ = message_view_container; - expand_or_collapsing_container_->ResetNeedsBoundsAnimation(); + expand_or_collapsing_container_->set_needs_bounds_animation(false); UpdateBounds(); state_ = State::EXPAND_OR_COLLAPSE; StartAnimation(); @@ -670,8 +364,9 @@ view->SetBoundsRect(view->target_bounds()); continue; } - view->SetBoundsRect(gfx::Tween::RectValueBetween( - GetCurrentValue(), view->start_bounds(), view->target_bounds())); + view->SetBoundsRect(gfx::Tween::RectValueBetween(GetCurrentAnimationValue(), + view->start_bounds(), + view->target_bounds())); } } @@ -702,8 +397,8 @@ } return gfx::Size(message_view_width_, - gfx::Tween::IntValueBetween(GetCurrentValue(), start_height_, - target_height_)); + gfx::Tween::IntValueBetween(GetCurrentAnimationValue(), + start_height_, target_height_)); } void NotificationListView::AnimateResize() { @@ -714,8 +409,7 @@ message_center::MessageView* NotificationListView::GetMessageViewForNotificationId(const std::string& id) { auto it = base::ranges::find(children(), id, [](views::View* child) { - DCHECK( - views::IsViewClass<NotificationListView::MessageViewContainer>(child)); + DCHECK(views::IsViewClass<MessageViewContainer>(child)); return AsMVC(child)->message_view()->notification_id(); }); @@ -821,7 +515,8 @@ auto view = CreateMessageView(*notification); view->SetExpanded(view->IsAutoExpandingAllowed()); - AddChildViewAt(std::make_unique<MessageViewContainer>(std::move(view), this), + AddChildViewAt(std::make_unique<MessageViewContainer>(std::move(view), + /*list_view=*/this), index_to_insert); UpdateBorders(/*force_update=*/false); ResetBounds(); @@ -851,7 +546,7 @@ return; } - child->set_is_removed(); + child->set_is_removed(true); // If the MessageView is slid out, then do nothing here. The MOVE_DOWN // animation will be started in OnNotificationSlidOut(). @@ -1006,27 +701,24 @@ } // static -const NotificationListView::MessageViewContainer* NotificationListView::AsMVC( - const views::View* v) { +const MessageViewContainer* NotificationListView::AsMVC(const views::View* v) { return static_cast<const MessageViewContainer*>(v); } // static -NotificationListView::MessageViewContainer* NotificationListView::AsMVC( - views::View* v) { +MessageViewContainer* NotificationListView::AsMVC(views::View* v) { return static_cast<MessageViewContainer*>(v); } -const NotificationListView::MessageViewContainer* -NotificationListView::GetNotificationById(const std::string& id) const { +const MessageViewContainer* NotificationListView::GetNotificationById( + const std::string& id) const { const auto i = base::ranges::find(children(), id, [](const views::View* v) { return AsMVC(v)->GetNotificationId(); }); return (i == children().cend()) ? nullptr : AsMVC(*i); } -NotificationListView::MessageViewContainer* -NotificationListView::GetNextRemovableNotification() { +MessageViewContainer* NotificationListView::GetNextRemovableNotification() { const auto i = base::ranges::find_if_not( base::Reversed(children()), [](const views::View* v) { return AsMVC(v)->IsPinned(); }); @@ -1091,7 +783,7 @@ for (views::View* child : children()) { auto* view = AsMVC(child); if (!view->IsPinned()) { - view->set_is_removed(); + view->set_is_removed(true); } } @@ -1165,7 +857,7 @@ auto* view = GetNextRemovableNotification(); if (view) { - view->set_is_removed(); + view->set_is_removed(true); } if (state_ == State::CLEAR_ALL_STACKED) { @@ -1177,7 +869,7 @@ for (const auto& id : non_visible_notification_ids) { auto* message_view_container = GetNotificationById(id); if (message_view_container && !message_view_container->IsPinned()) { - message_view_container->set_is_removed(); + message_view_container->set_is_removed(true); } } @@ -1205,29 +897,6 @@ } } -double NotificationListView::GetCurrentValue() const { - gfx::Tween::Type tween; - switch (state_) { - case State::IDLE: - // No animations are used for State::IDLE. - NOTREACHED(); - tween = gfx::Tween::LINEAR; - break; - case State::CLEAR_ALL_STACKED: - case State::MOVE_DOWN: - tween = gfx::Tween::FAST_OUT_SLOW_IN; - break; - case State::CLEAR_ALL_VISIBLE: - tween = gfx::Tween::EASE_IN; - break; - case State::EXPAND_OR_COLLAPSE: - tween = gfx::Tween::FAST_OUT_SLOW_IN_3; - break; - } - - return gfx::Tween::CalculateValue(tween, animation_->GetCurrentValue()); -} - BEGIN_METADATA(NotificationListView); END_METADATA
diff --git a/ash/system/notification_center/views/notification_list_view.h b/ash/system/notification_center/views/notification_list_view.h index ee6bc5b..556cd00 100644 --- a/ash/system/notification_center/views/notification_list_view.h +++ b/ash/system/notification_center/views/notification_list_view.h
@@ -29,6 +29,7 @@ namespace ash { class NotificationCenterView; +class MessageViewContainer; // Manages list of notifications. The class doesn't know about the ScrollView // it's enclosed. This class is used only from NotificationCenterView. @@ -110,6 +111,10 @@ // Returns true if `animation_` is currently in progress. bool IsAnimating() const; + // Current progress of the animation between 0.0 and 1.0. Returns 1.0 when + // it's not animating. + double GetCurrentAnimationValue() const; + // Returns whether `message_view_container` is being animated for expand or // collapse. bool IsAnimatingExpandOrCollapseContainer(const views::View* view) const; @@ -179,7 +184,6 @@ friend class NotificationListViewTest; friend class UnifiedMessageCenterBubbleTest; class Background; - class MessageViewContainer; // NotificationListView always runs a single animation at one time. When // `state_` is IDLE, `animation_->is_animating()` is always false and vice @@ -218,10 +222,6 @@ // Returns the first removable notification from the top. MessageViewContainer* GetNextRemovableNotification(); - // Current progress of the animation between 0.0 and 1.0. Returns 1.0 when - // it's not animating. - double GetCurrentValue() const; - // Collapses all the existing notifications. It does not trigger // PreferredSizeChanged() (See |ignore_size_change_|). void CollapseAllNotifications();
diff --git a/ash/system/notification_center/views/notification_list_view_unittest.cc b/ash/system/notification_center/views/notification_list_view_unittest.cc index bc2f49f..e48721d 100644 --- a/ash/system/notification_center/views/notification_list_view_unittest.cc +++ b/ash/system/notification_center/views/notification_list_view_unittest.cc
@@ -126,6 +126,19 @@ std::vector<std::string> notification_id_list_; }; +// Returns true if the provided `corner_radius` has a value that is used for +// notification views on the edges of `NotificationListView`, or for +// notifications that are sliding out. +bool IsEdge(int corner_radius) { + return corner_radius == kMessageCenterScrollViewCornerRadius; +} + +// Returns true if the provided `corner_radius` has a value that is +// used for inner borders of `NotificationListView` child views. +bool IsInner(int corner_radius) { + return corner_radius == kMessageCenterNotificationInnerCornerRadius; +} + } // namespace // The base test class, has no params so tests with no params can inherit from @@ -1077,103 +1090,92 @@ auto id3 = AddNotification(); CreateMessageListView(); - // At first, there should be no fully rounded corners for the middle - // notification. - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(2)->top_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(2)->bottom_radius()); + // Ensure corners of all notifications are rounded properly. + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->top_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(0)->bottom_radius())); + for (int i = 1; i <= 2; i++) { + EXPECT_TRUE(IsInner(GetMessageViewAt(i)->top_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(i)->bottom_radius())); + } + EXPECT_TRUE(IsInner(GetMessageViewAt(3)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(3)->bottom_radius())); - // Start sliding notification 2 away. + // Start sliding a middle notification away. The top bottom and radius of the + // sliding notification should be rounded like an edge. StartSliding(2); - // The top bottom radius should be the same as the - // `kMessageCenterScrollViewCornerRadius`. - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(2)->bottom_radius()); + EXPECT_TRUE(IsEdge(GetMessageViewAt(2)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(2)->bottom_radius())); - // Notification 1's bottom corner and notification 3's top corner should also - // be rounded. - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(1)->top_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(1)->bottom_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(3)->top_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(3)->bottom_radius()); + // The adjacent notification corners should also be rounded like an edge. + EXPECT_TRUE(IsInner(GetMessageViewAt(1)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(1)->bottom_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(3)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(3)->bottom_radius())); - // Notification 0 should not change. - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(0)->top_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(0)->bottom_radius()); + // The non-adjacent notification should not change. + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->top_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(0)->bottom_radius())); - // Slide out notification 2, the 3 notifications left should have no rounded - // corner after slide out done. + // Slide out the middle notification. RemoveNotification(id2); FinishSlideOutAnimation(); AnimateUntilIdle(); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(0)->bottom_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(1)->top_radius()); + // The adjacent notification corners should not be rounded like an edge after + // the notification fully slid out. + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->top_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(0)->bottom_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(1)->top_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(1)->bottom_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(2)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(2)->bottom_radius())); - // Test with notification 1. Same behavior should happen. + // Test with the next middle notification. Same behavior should happen. StartSliding(1); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(1)->top_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(1)->bottom_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(0)->top_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(0)->bottom_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(2)->top_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(2)->bottom_radius()); + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->bottom_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(1)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(1)->bottom_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(2)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(2)->bottom_radius())); // Cancel the slide. Everything goes back to normal. GetMessageViewAt(1)->OnSlideChanged(/*in_progress=*/false); - for (int i = 0; i <= 2; i++) { - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(i)->top_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(i)->bottom_radius()); - } + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->top_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(0)->bottom_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(1)->top_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(1)->bottom_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(2)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(2)->bottom_radius())); - // Test with the top notification. + // Slide the top notification. StartSliding(0); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(0)->top_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(0)->bottom_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(1)->top_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(1)->bottom_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(2)->top_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(2)->bottom_radius()); - GetMessageViewAt(0)->OnSlideChanged(/*in_progress=*/false); + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->bottom_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(1)->top_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(1)->bottom_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(2)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(2)->bottom_radius())); - // Test with the bottom notification. - StartSliding(2); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(0)->top_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(0)->bottom_radius()); - EXPECT_EQ(kMessageCenterNotificationInnerCornerRadius, - GetMessageViewAt(1)->top_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(1)->bottom_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(2)->top_radius()); - EXPECT_EQ(kMessageCenterScrollViewCornerRadius, - GetMessageViewAt(2)->bottom_radius()); - GetMessageViewAt(2)->OnSlideChanged(/*in_progress=*/false); + // Remove the top notification. + RemoveNotification(id0); + FinishSlideOutAnimation(); + AnimateUntilIdle(); + + // Ensure corners are properly rounded for remaining notifications. + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->top_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(0)->bottom_radius())); + EXPECT_TRUE(IsInner(GetMessageViewAt(1)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(1)->bottom_radius())); + + // Remove previous to last notification. + RemoveNotification(id1); + FinishSlideOutAnimation(); + AnimateUntilIdle(); + + // All corners of the remaining notification should be edge-rounded. + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->top_radius())); + EXPECT_TRUE(IsEdge(GetMessageViewAt(0)->bottom_radius())); } } // namespace ash
diff --git a/ash/system/overview/overview_button_tray.cc b/ash/system/overview/overview_button_tray.cc index 5915fa1..545babe 100644 --- a/ash/system/overview/overview_button_tray.cc +++ b/ash/system/overview/overview_button_tray.cc
@@ -4,6 +4,7 @@ #include "ash/system/overview/overview_button_tray.h" +#include "ash/constants/ash_switches.h" #include "ash/constants/tray_background_view_catalog.h" #include "ash/public/cpp/shelf_config.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -47,6 +48,10 @@ return false; } + if (switches::IsOverviewButtonEnabledForTests()) { + return true; + } + return shell->tablet_mode_controller()->ShouldShowOverviewButton() && ShelfConfig::Get()->shelf_controls_shown(); }
diff --git a/ash/wallpaper/wallpaper_utils/sea_pen_metadata_utils_unittest.cc b/ash/wallpaper/wallpaper_utils/sea_pen_metadata_utils_unittest.cc index 376c0819..b9bdeb60 100644 --- a/ash/wallpaper/wallpaper_utils/sea_pen_metadata_utils_unittest.cc +++ b/ash/wallpaper/wallpaper_utils/sea_pen_metadata_utils_unittest.cc
@@ -130,6 +130,16 @@ } TEST(SeaPenMetadataUtilsTest, + SeaPenQueryDictToRecentImageInfoInvalidCreationTime) { + base::Value::Dict invalid_creation_time_query_dict = + GetTestFreeformQueryDict().Set("creation_time", "invalid creation time"); + auto recent_image_info = + SeaPenQueryDictToRecentImageInfo(invalid_creation_time_query_dict); + + EXPECT_FALSE(recent_image_info->creation_time); +} + +TEST(SeaPenMetadataUtilsTest, SeaPenQueryDictToRecentImageInfoValidTemplateData) { auto expected_user_visible_query = ash::personalization_app::mojom::SeaPenUserVisibleQuery::New(
diff --git a/ash/webui/common/mojom/sea_pen.mojom b/ash/webui/common/mojom/sea_pen.mojom index 507a138..740d661 100644 --- a/ash/webui/common/mojom/sea_pen.mojom +++ b/ash/webui/common/mojom/sea_pen.mojom
@@ -76,10 +76,18 @@ // Human-readable string representation of the date the image was // created, e.g., "Dec 30, 2023", translated into the user's current - // locale. `creation_time` is null on failure. + // locale. `creation_time` is null if its data has invalid time format. mojo_base.mojom.String16? creation_time; }; +// The thumbnail data includes the `url` and the image information `image_info` +// for the recent Sea Pen image. +// `image_info` is null if the image metadata has missing or invalid data. +struct RecentSeaPenThumbnailData { + url.mojom.Url url; + RecentSeaPenImageInfo? image_info; +}; + // Maximum allowable search text length, in bytes. // When validating length in Javascript, be careful of the difference between // UTF-16 (Javascript) length and UTF-8 length. @@ -130,10 +138,12 @@ // id from a previous call to `GetRecentSeaPenImages`. SelectRecentSeaPenImage(uint32 id) => (bool success); - // Fetch a thumbnail data url for the given recent SeaPen image id. - // `url` will be empty on failure. `id` must be a valid id from a previous - // call to `GetRecentSeaPenImages`. - GetRecentSeaPenImageThumbnail(uint32 id) => (url.mojom.Url url); + // Fetches the thumbnail data for the given recent Sea Pen image `id`. + // `id` must be a valid id from a previous call to `GetRecentSeaPenImages`. + // `thumbnail_data` is null if the `id` is invalid or the image fails to + // decode. + GetRecentSeaPenImageThumbnail(uint32 id) => + (RecentSeaPenThumbnailData? thumbnail_data); // Deletes the selected SeaPen image from SeaPen directory. `id` must be a // valid id from a previous call to `GetRecentSeaPenImages`.
diff --git a/ash/webui/common/resources/network/apn_selection_dialog.html b/ash/webui/common/resources/network/apn_selection_dialog.html index 36b3e59..a40818c 100644 --- a/ash/webui/common/resources/network/apn_selection_dialog.html +++ b/ash/webui/common/resources/network/apn_selection_dialog.html
@@ -13,15 +13,14 @@ margin-top: 20px; } </style> -<!-- TODO(b/325487350): Use localized strings. --> <cr-dialog id="apnSelectionDialog" show-on-attach> - <div slot="title" aria-live="polite"> - Choose from available APNs + <div id="apnSelectionDialogTitle" slot="title" aria-live="polite"> + [[i18n('apnSelectionDialogTitle')]] </div> <!-- TODO(b/325487350): Add a11y. --> <div slot="body"> - <div> - Invalid APNs could cause your mobile connection to be disabled. Only set APNs provided by your mobile provider or administrator. + <div id="apnSelectionDialogDescription"> + [[i18n('apnSelectionDialogDescription')]] </div> <div id="container" class="layout vertical flex" scrollable> <iron-list items="[[apnList]]" @@ -50,7 +49,7 @@ disabled="[[!selectedApn_]]" class="action-button" on-click="onActionButtonClicked_"> - Use this APN + [[i18n('apnSelectionDialogUseApn')]] </cr-button> </template> </div>
diff --git a/ash/webui/common/resources/sea_pen/constants.ts b/ash/webui/common/resources/sea_pen/constants.ts index f11d2d1..61fc19e 100644 --- a/ash/webui/common/resources/sea_pen/constants.ts +++ b/ash/webui/common/resources/sea_pen/constants.ts
@@ -14,14 +14,6 @@ // thumbnail, this is `SeaPenThumbnail.id`. export type SeaPenImageId = number; -/** - * An interface for the data of a recent sea pen image. - */ -export interface RecentSeaPenData { - url: Url; - queryInfo: string; -} - export interface SeaPenOption { // `value` is the actual option value to be sent to the server side. value: SeaPenTemplateOption;
diff --git a/ash/webui/common/resources/sea_pen/sea_pen_actions.ts b/ash/webui/common/resources/sea_pen/sea_pen_actions.ts index 337887b..05f57db 100644 --- a/ash/webui/common/resources/sea_pen/sea_pen_actions.ts +++ b/ash/webui/common/resources/sea_pen/sea_pen_actions.ts
@@ -5,8 +5,8 @@ import {assert} from 'chrome://resources/js/assert.js'; import {Action} from 'chrome://resources/js/store.js'; -import {RecentSeaPenData, SeaPenImageId} from './constants.js'; -import {MantaStatusCode, SeaPenQuery, SeaPenThumbnail} from './sea_pen.mojom-webui.js'; +import {SeaPenImageId} from './constants.js'; +import {MantaStatusCode, RecentSeaPenThumbnailData, SeaPenQuery, SeaPenThumbnail} from './sea_pen.mojom-webui.js'; /** * @fileoverview defines the actions to change SeaPen state. @@ -119,14 +119,15 @@ export interface SetRecentSeaPenImageDataAction extends Action { name: SeaPenActionName.SET_RECENT_SEA_PEN_IMAGE_DATA; id: SeaPenImageId; - data: RecentSeaPenData; + data: RecentSeaPenThumbnailData|null; } /** * Sets the recent sea pen image data. */ export function setRecentSeaPenImageDataAction( - id: SeaPenImageId, data: RecentSeaPenData): SetRecentSeaPenImageDataAction { + id: SeaPenImageId, + data: RecentSeaPenThumbnailData|null): SetRecentSeaPenImageDataAction { return { name: SeaPenActionName.SET_RECENT_SEA_PEN_IMAGE_DATA, id,
diff --git a/ash/webui/common/resources/sea_pen/sea_pen_controller.ts b/ash/webui/common/resources/sea_pen/sea_pen_controller.ts index 99d3b212..1f1288c2 100644 --- a/ash/webui/common/resources/sea_pen/sea_pen_controller.ts +++ b/ash/webui/common/resources/sea_pen/sea_pen_controller.ts
@@ -144,15 +144,12 @@ while (recentSeaPenImageDataToFetch.size) { await Promise.all(Array.from(recentSeaPenImageDataToFetch).map(async id => { recentSeaPenImageDataToFetch.delete(id); - const {url} = await provider.getRecentSeaPenImageThumbnail(id); - // TODO(b/312783231): add real API to get the image query info. - const queryInfo = - 'query ' + Math.floor(Math.random() * 100 + 1).toString(); - if (!url) { + const {thumbnailData} = await provider.getRecentSeaPenImageThumbnail(id); + if (!thumbnailData) { console.warn('Failed to fetch recent Sea Pen image data', id); } store.dispatch( - seaPenAction.setRecentSeaPenImageDataAction(id, {url, queryInfo})); + seaPenAction.setRecentSeaPenImageDataAction(id, thumbnailData)); })); } }
diff --git a/ash/webui/common/resources/sea_pen/sea_pen_recent_wallpapers_element.html b/ash/webui/common/resources/sea_pen/sea_pen_recent_wallpapers_element.html index a53b59ad..09ea2cc 100644 --- a/ash/webui/common/resources/sea_pen/sea_pen_recent_wallpapers_element.html +++ b/ash/webui/common/resources/sea_pen/sea_pen_recent_wallpapers_element.html
@@ -89,8 +89,7 @@ margin-inline-end: 8px; } - .more-like-this-option, - .wallpaper-info-option { + .more-like-this-option { display: none; } </style> @@ -135,20 +134,22 @@ <iron-icon icon="sea-pen:delete"></iron-icon> [[i18n('seaPenDeleteWallpaper')]] </button> - <button data-id$="[[index]]" class="dropdown-item wallpaper-info-option" - on-click="onClickWallpaperInfo_"> - <iron-icon icon="cr:info-outline"></iron-icon> - [[i18n('seaPenAbout')]] - </button> + <template is="dom-if" if="[[shouldShowWallpaperInfoButton_(image, recentImageData_, recentImageDataLoading_)]]"> + <button data-id$="[[index]]" class="dropdown-item wallpaper-info-option" + on-click="onClickWallpaperInfo_"> + <iron-icon icon="cr:info-outline"></iron-icon> + [[i18n('seaPenAbout')]] + </button> + </template> </cr-action-menu> <template is="dom-if" if="[[shouldShowWallpaperInfoDialog_(index, currentShowWallpaperInfoDialog_)]]" restamp> <cr-dialog id="wallpaperInfoDialog" data-id$="[[index]]" on-close="onCloseDialog_" show-on-attach> <div slot="body"> <h2>[[i18n('seaPenAboutDialogTitle')]]</h2> - <p> + <p class="about-prompt-info"> [[getWallpaperInfoPromptMessage_(image, recentImageData_, recentImageDataLoading_)]] </p> - <p> + <p class="about-date-info"> [[getWallpaperInfoDateMessage_(image, recentImageData_, recentImageDataLoading_)]] </p> </div>
diff --git a/ash/webui/common/resources/sea_pen/sea_pen_recent_wallpapers_element.ts b/ash/webui/common/resources/sea_pen/sea_pen_recent_wallpapers_element.ts index 936a5b0..d1792eb 100644 --- a/ash/webui/common/resources/sea_pen/sea_pen_recent_wallpapers_element.ts +++ b/ash/webui/common/resources/sea_pen/sea_pen_recent_wallpapers_element.ts
@@ -17,10 +17,11 @@ import {AnchorAlignment} from 'chrome://resources/ash/common/cr_elements/cr_action_menu/cr_action_menu.js'; import {WallpaperGridItemSelectedEvent} from 'chrome://resources/ash/common/personalization/wallpaper_grid_item_element.js'; import {assert} from 'chrome://resources/js/assert.js'; +import {mojoString16ToString} from 'chrome://resources/js/mojo_type_util.js'; import {Url} from 'chrome://resources/mojo/url/mojom/url.mojom-webui.js'; -import {RecentSeaPenData, SeaPenImageId} from './constants.js'; -import {SeaPenThumbnail} from './sea_pen.mojom-webui.js'; +import {SeaPenImageId} from './constants.js'; +import {RecentSeaPenThumbnailData, SeaPenThumbnail} from './sea_pen.mojom-webui.js'; import {deleteRecentSeaPenImage, fetchRecentSeaPenData, selectRecentSeaPenImage} from './sea_pen_controller.js'; import {getSeaPenProvider} from './sea_pen_interface_provider.js'; import {getTemplate} from './sea_pen_recent_wallpapers_element.html.js'; @@ -68,7 +69,8 @@ } private recentImages_: SeaPenImageId[]|null; - private recentImageData_: Record<SeaPenImageId, RecentSeaPenData>; + private recentImageData_: + Record<SeaPenImageId, RecentSeaPenThumbnailData|null>; private recentImageDataLoading_: Record<SeaPenImageId, boolean>; private recentImagesToDisplay_: SeaPenImageId[]; private currentShowWallpaperInfoDialog_: number|null; @@ -92,8 +94,6 @@ this.watch<SeaPenRecentWallpapersElement['pendingSelected_']>( 'pendingSelected_', state => state.pendingSelected); this.updateFromStore(); - // TODO(b/304576846): also refetch sea pen data when adding and deleting - // image. fetchRecentSeaPenData(getSeaPenProvider(), this.getStore()); } @@ -105,7 +105,7 @@ this.recentImagesToDisplay_ = (recentImages || []).filter(id => { if (this.recentImageDataLoading_[id] === false) { const data = this.recentImageData_[id]; - return data && data.queryInfo && data.url; + return data && data.url; } return true; }); @@ -116,7 +116,7 @@ * from the list of displayed images if it has failed to load. */ private onRecentImageLoaded_( - recentImageData: Record<SeaPenImageId, RecentSeaPenData>, + recentImageData: Record<SeaPenImageId, RecentSeaPenThumbnailData|null>, recentImageDataLoading: Record<SeaPenImageId, boolean>) { if (!recentImageData || !recentImageDataLoading) { return; @@ -126,8 +126,9 @@ // `recentImagesToDisplay` while iterating. for (let i = this.recentImagesToDisplay_.length - 1; i >= 0; i--) { const id = this.recentImagesToDisplay_[i]; - const failed = id && recentImageDataLoading[id] === false && - !isImageDataUrl(recentImageData[id].url); + const data = recentImageData[id]; + const validData = !!data && isImageDataUrl(data.url); + const failed = id && recentImageDataLoading[id] === false && !validData; if (failed) { this.recentImagesToDisplay_.splice(i, 1); } @@ -148,7 +149,7 @@ private getRecentImageUrl_( recentImage: SeaPenImageId, - recentImageData: Record<SeaPenImageId, RecentSeaPenData>, + recentImageData: Record<SeaPenImageId, RecentSeaPenThumbnailData|null>, recentImageDataLoading: Record<SeaPenImageId, boolean>): Url|null { if (!recentImage || this.isRecentImageLoading_(recentImage, recentImageDataLoading)) { @@ -163,26 +164,39 @@ private getWallpaperInfoPromptMessage_( recentImage: SeaPenImageId, - _recentImageData: Record<SeaPenImageId, RecentSeaPenData>, + recentImageData: Record<SeaPenImageId, RecentSeaPenThumbnailData|null>, recentImageDataLoading: Record<SeaPenImageId, boolean>): string|null { if (!recentImage || this.isRecentImageLoading_(recentImage, recentImageDataLoading)) { return null; } - // TODO(b/323597008): Replace with the actual prompt. - return this.i18n('seaPenAboutDialogPrompt', 'A radiant flower in bloom'); + + const data = recentImageData[recentImage]; + if (!data || !data.imageInfo || !data.imageInfo.userVisibleQuery) { + return null; + } + + return this.i18n( + 'seaPenAboutDialogPrompt', data.imageInfo.userVisibleQuery.text); } private getWallpaperInfoDateMessage_( recentImage: SeaPenImageId, - _recentImageData: Record<SeaPenImageId, RecentSeaPenData>, + recentImageData: Record<SeaPenImageId, RecentSeaPenThumbnailData|null>, recentImageDataLoading: Record<SeaPenImageId, boolean>): string|null { if (!recentImage || this.isRecentImageLoading_(recentImage, recentImageDataLoading)) { return null; } - // TODO(b/323597008): Replace with the actual date. - return this.i18n('seaPenAboutDialogDate', 'Aug 25, 2023'); + + const data = recentImageData[recentImage]; + if (!data || !data.imageInfo || !data.imageInfo.creationTime) { + return null; + } + + return this.i18n( + 'seaPenAboutDialogDate', + mojoString16ToString(data.imageInfo.creationTime)); } @@ -272,9 +286,23 @@ }); } + private shouldShowWallpaperInfoButton_( + recentImage: SeaPenImageId, + recentImageData: Record<SeaPenImageId, RecentSeaPenThumbnailData|null>, + recentImageDataLoading: Record<SeaPenImageId, boolean>): boolean { + if (!recentImage || + this.isRecentImageLoading_(recentImage, recentImageDataLoading)) { + return false; + } + + const data = recentImageData[recentImage]; + return !!data && !!data.imageInfo && !!data.imageInfo.creationTime && + !!data.imageInfo.userVisibleQuery; + } + private shouldShowWallpaperInfoDialog_( - _i: number, _currentShowWallpaperInfoDialog: number|null): boolean { - return false; + i: number, currentShowWallpaperInfoDialog: number|null): boolean { + return currentShowWallpaperInfoDialog === i; } private onCloseDialog_() {
diff --git a/ash/webui/common/resources/sea_pen/sea_pen_reducer.ts b/ash/webui/common/resources/sea_pen/sea_pen_reducer.ts index 330175d..d39f1c0 100644 --- a/ash/webui/common/resources/sea_pen/sea_pen_reducer.ts +++ b/ash/webui/common/resources/sea_pen/sea_pen_reducer.ts
@@ -4,8 +4,8 @@ import {assert} from 'chrome://resources/js/assert.js'; -import {RecentSeaPenData, SeaPenImageId} from './constants.js'; -import {MantaStatusCode, SeaPenThumbnail} from './sea_pen.mojom-webui.js'; +import {SeaPenImageId} from './constants.js'; +import {MantaStatusCode, RecentSeaPenThumbnailData, SeaPenThumbnail} from './sea_pen.mojom-webui.js'; import {SeaPenActionName, SeaPenActions} from './sea_pen_actions.js'; import {SeaPenLoadingState, SeaPenState} from './sea_pen_state.js'; @@ -164,8 +164,9 @@ } function recentImageDataReducer( - state: Record<SeaPenImageId, RecentSeaPenData>, - action: SeaPenActions): Record<SeaPenImageId, RecentSeaPenData> { + state: Record<SeaPenImageId, RecentSeaPenThumbnailData|null>, + action: SeaPenActions): + Record<SeaPenImageId, RecentSeaPenThumbnailData|null> { switch (action.name) { case SeaPenActionName.SET_RECENT_SEA_PEN_IMAGES: const newRecentImages: SeaPenImageId[] =
diff --git a/ash/webui/common/resources/sea_pen/sea_pen_state.ts b/ash/webui/common/resources/sea_pen/sea_pen_state.ts index ac5823e..bd5fa87 100644 --- a/ash/webui/common/resources/sea_pen/sea_pen_state.ts +++ b/ash/webui/common/resources/sea_pen/sea_pen_state.ts
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {RecentSeaPenData, SeaPenImageId} from './constants.js'; -import {MantaStatusCode, SeaPenThumbnail} from './sea_pen.mojom-webui.js'; +import {SeaPenImageId} from './constants.js'; +import {MantaStatusCode, RecentSeaPenThumbnailData, SeaPenThumbnail} from './sea_pen.mojom-webui.js'; export interface SeaPenLoadingState { recentImageData: Record<SeaPenImageId, boolean>; @@ -15,7 +15,7 @@ export interface SeaPenState { loading: SeaPenLoadingState; - recentImageData: Record<SeaPenImageId, RecentSeaPenData>; + recentImageData: Record<SeaPenImageId, RecentSeaPenThumbnailData|null>; recentImages: SeaPenImageId[]|null; thumbnails: SeaPenThumbnail[]|null; currentSelected: SeaPenImageId|null;
diff --git a/ash/webui/personalization_app/resources/js/personalization_app.ts b/ash/webui/personalization_app/resources/js/personalization_app.ts index 0918fdd..1d239c4 100644 --- a/ash/webui/personalization_app/resources/js/personalization_app.ts +++ b/ash/webui/personalization_app/resources/js/personalization_app.ts
@@ -118,7 +118,6 @@ export {GooglePhotosZeroStateElement} from './wallpaper/google_photos_zero_state_element.js'; export {DEFAULT_COLOR_SCHEME} from './theme/utils.js'; export {LocalImagesElement} from './wallpaper/local_images_element.js'; -export {RecentSeaPenData} from 'chrome://resources/ash/common/sea_pen/constants.js'; export * from 'chrome://resources/ash/common/sea_pen/sea_pen_actions.js'; export {getRecentSeaPenImages, selectRecentSeaPenImage, searchSeaPenThumbnails} from 'chrome://resources/ash/common/sea_pen/sea_pen_controller.js'; export {SeaPenImageLoadingElement} from 'chrome://resources/ash/common/sea_pen/sea_pen_image_loading_element.js';
diff --git a/ash/webui/print_preview_cros/resources/js/data/print_ticket_manager.ts b/ash/webui/print_preview_cros/resources/js/data/print_ticket_manager.ts index 02b8f515..0e38a7e 100644 --- a/ash/webui/print_preview_cros/resources/js/data/print_ticket_manager.ts +++ b/ash/webui/print_preview_cros/resources/js/data/print_ticket_manager.ts
@@ -49,4 +49,10 @@ // occurred. this.printPreviewPageHandler!.print(); } + + // Does cleanup for print request. + cancelPrintRequest(): void { + assert(this.printPreviewPageHandler); + this.printPreviewPageHandler!.cancel(); + } }
diff --git a/ash/webui/print_preview_cros/resources/js/fakes/fake_print_preview_page_handler.ts b/ash/webui/print_preview_cros/resources/js/fakes/fake_print_preview_page_handler.ts index 7729230..faa3414 100644 --- a/ash/webui/print_preview_cros/resources/js/fakes/fake_print_preview_page_handler.ts +++ b/ash/webui/print_preview_cros/resources/js/fakes/fake_print_preview_page_handler.ts
@@ -23,6 +23,8 @@ error: 'Invalid settings', }; +const CANCEL_METHOD = 'cancel'; + // Fake implementation of the PrintPreviewPageHandler for tests and UI. export class FakePrintPreviewPageHandler implements PrintPreviewPageHandler { private methods: FakeMethodResolver = new FakeMethodResolver(); @@ -35,6 +37,8 @@ this.methods.register(PRINT_METHOD); this.methods.setResult(PRINT_METHOD, FAKE_PRINT_REQUEST_SUCCESSFUL); this.callCount.set(PRINT_METHOD, 0); + this.methods.register(CANCEL_METHOD); + this.callCount.set(CANCEL_METHOD, 0); } // Handles restoring state of fake to initial state. @@ -58,4 +62,10 @@ getCallCount(method: string): number { return this.callCount.get(method) ?? 0; } + + // Mock implementation of cancel. + cancel(): void { + const prevCallCount = this.callCount.get(CANCEL_METHOD) ?? 0; + this.callCount.set(CANCEL_METHOD, prevCallCount + 1); + } }
diff --git a/ash/webui/print_preview_cros/resources/js/summary_panel.html b/ash/webui/print_preview_cros/resources/js/summary_panel.html index 371e98e9..1987bc7 100644 --- a/ash/webui/print_preview_cros/resources/js/summary_panel.html +++ b/ash/webui/print_preview_cros/resources/js/summary_panel.html
@@ -18,9 +18,11 @@ <span id="sheetsUsed">[[sheetsUsedText]]</span> <div class="control-container"> <!-- TODO(b/323585997): Replace label localized string. --> - <cros-button id="cancel" label="Cancel" button-style="secondary"> + <cros-button id="cancel" label="Cancel" button-style="secondary" + on-click="onCancelClicked"> </cros-button> <!-- TODO(b/323585997): Replace label localized string. --> - <cros-button id="print" label="Print" button-style="primary"> + <cros-button id="print" label="Print" button-style="primary" + on-click="onPrintClicked"> </cros-button> </div> \ No newline at end of file
diff --git a/ash/webui/print_preview_cros/resources/js/summary_panel.ts b/ash/webui/print_preview_cros/resources/js/summary_panel.ts index 2e3c4aa..6833507 100644 --- a/ash/webui/print_preview_cros/resources/js/summary_panel.ts +++ b/ash/webui/print_preview_cros/resources/js/summary_panel.ts
@@ -49,6 +49,16 @@ private onSheetsUsedChanged(_event: Event) { this.sheetsUsedText = this.controller.getSheetsUsedText(); } + + // Click event handler for `#print` button. + protected onPrintClicked(_event: Event): void { + this.controller.handlePrintClicked(); + } + + // Click event handler for `#cancel` button. + protected onCancelClicked(_event: Event): void { + this.controller.handleCancelClicked(); + } } declare global {
diff --git a/ash/webui/print_preview_cros/resources/js/summary_panel_controller.ts b/ash/webui/print_preview_cros/resources/js/summary_panel_controller.ts index b3b72ae1..afa2a75 100644 --- a/ash/webui/print_preview_cros/resources/js/summary_panel_controller.ts +++ b/ash/webui/print_preview_cros/resources/js/summary_panel_controller.ts
@@ -46,6 +46,12 @@ handlePrintClicked(): void { this.printTicketManger.sendPrintRequest(); } + + // Handles any required cleanup prior to sending a cancel request to the + // backend and closing the dialog when the cancel button is clicked. + handleCancelClicked(): void { + this.printTicketManger.cancelPrintRequest(); + } } declare global {
diff --git a/ash/webui/print_preview_cros/resources/js/utils/print_preview_cros_app_types.ts b/ash/webui/print_preview_cros/resources/js/utils/print_preview_cros_app_types.ts index 1975c8e..7c6ee47 100644 --- a/ash/webui/print_preview_cros/resources/js/utils/print_preview_cros_app_types.ts +++ b/ash/webui/print_preview_cros/resources/js/utils/print_preview_cros_app_types.ts
@@ -18,4 +18,7 @@ // Start the print job and close the window. Needs to wait for result to // display error messaging if starting the print job fails. print(): Promise<PrintRequestOutcome>; + + // Cancel the print preview and close the window. + cancel(): void; }
diff --git a/ash/wm/window_restore/pine_items_container_view.cc b/ash/wm/window_restore/pine_items_container_view.cc index 4be903b27..bb1e1fc 100644 --- a/ash/wm/window_restore/pine_items_container_view.cc +++ b/ash/wm/window_restore/pine_items_container_view.cc
@@ -63,7 +63,7 @@ pine::kItemTitleFontSize, gfx::Font::Weight::BOLD)) .SetHorizontalAlignment(gfx::ALIGN_LEFT) - .SetText(base::ASCIIToUTF16(app_title)) + .SetText(base::UTF8ToUTF16(app_title)) .Build()); SetFlexForView(app_title_label, 1);
diff --git a/base/BUILD.gn b/base/BUILD.gn index 4fadefb0..8ffd60e 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -2147,7 +2147,7 @@ "mac/mach_port_rendezvous.cc", "mac/mach_port_rendezvous.h", "process/kill_mac.cc", - "process/launch_mac.cc", + "process/launch_ios.cc", "process/memory_mac.mm", "process/port_provider_mac.cc", "process/port_provider_mac.h",
diff --git a/base/android/jni_conversions.cc b/base/android/jni_conversions.cc index 89092fd..a6dff6f8 100644 --- a/base/android/jni_conversions.cc +++ b/base/android/jni_conversions.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <jni.h> + #include <optional> #include <string>
diff --git a/base/android/pre_freeze_background_memory_trimmer.cc b/base/android/pre_freeze_background_memory_trimmer.cc index 3340fb1..55bc839 100644 --- a/base/android/pre_freeze_background_memory_trimmer.cc +++ b/base/android/pre_freeze_background_memory_trimmer.cc
@@ -4,6 +4,9 @@ #include "base/android/pre_freeze_background_memory_trimmer.h" +#include <optional> +#include <string> + #include "base/android/build_info.h" #include "base/android/pmf_utils.h" #include "base/check.h" @@ -18,9 +21,6 @@ #include "base/task/thread_pool/thread_pool_instance.h" #include "base/time/time.h" -#include <optional> -#include <string> - namespace base::android { namespace {
diff --git a/base/android/token_android.h b/base/android/token_android.h index 0f38a9f4..a7431e9 100644 --- a/base/android/token_android.h +++ b/base/android/token_android.h
@@ -6,6 +6,7 @@ #define BASE_ANDROID_TOKEN_ANDROID_H_ #include <jni.h> + #include <optional> #include "base/android/scoped_java_ref.h"
diff --git a/base/big_endian.h b/base/big_endian.h index 1a285f44..0aed135 100644 --- a/base/big_endian.h +++ b/base/big_endian.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <stdint.h> #include <string.h> + #include <optional> #include <type_traits>
diff --git a/base/json/json_reader_fuzzer.cc b/base/json/json_reader_fuzzer.cc index 43953a0..396b434 100644 --- a/base/json/json_reader_fuzzer.cc +++ b/base/json/json_reader_fuzzer.cc
@@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <string_view> - #include "base/json/json_reader.h" #include <optional> +#include <string_view> #include "base/json/json_writer.h" #include "base/values.h"
diff --git a/base/mac/mach_port_rendezvous.cc b/base/mac/mach_port_rendezvous.cc index 7b3b4c2..c9e6ad35 100644 --- a/base/mac/mach_port_rendezvous.cc +++ b/base/mac/mach_port_rendezvous.cc
@@ -28,9 +28,13 @@ namespace { +#if BUILDFLAG(IS_IOS) +static MachPortRendezvousClient* g_client = nullptr; +#else // The name to use in the bootstrap server, formatted with the BaseBundleID and // PID of the server. constexpr char kBootstrapNameFormat[] = "%s.MachPortRendezvousServer.%d"; +#endif // This limit is arbitrary and can be safely increased in the future. constexpr size_t kMaximumRendezvousPorts = 5; @@ -103,6 +107,130 @@ disposition_ = 0; } +MachPortRendezvousServerBase::MachPortRendezvousServerBase() = default; +MachPortRendezvousServerBase::~MachPortRendezvousServerBase() = default; + +void MachPortRendezvousServerBase::HandleRequest() { + // Receive the request message, using the kernel audit token to ascertain the + // PID of the sender. + struct : mach_msg_header_t { + mach_msg_audit_trailer_t trailer; + } request{}; + request.msgh_size = sizeof(request); + request.msgh_local_port = server_port_.get(); + + const mach_msg_option_t options = + MACH_RCV_MSG | MACH_RCV_TIMEOUT | + MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0) | + MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT); + + mach_msg_return_t mr = mach_msg(&request, options, 0, sizeof(request), + server_port_.get(), 0, MACH_PORT_NULL); + if (mr != KERN_SUCCESS) { + MACH_LOG(ERROR, mr) << "mach_msg receive"; + return; + } + + // Destroy the message in case of an early return, which will release + // any rights from a bad message. In the case of a disallowed sender, + // the destruction of the reply port will break them out of a mach_msg. + ScopedMachMsgDestroy scoped_message(&request); + + if (request.msgh_id != kMachRendezvousMsgIdRequest || + request.msgh_size != sizeof(mach_msg_header_t)) { + // Do not reply to messages that are unexpected. + return; + } + +#if BUILDFLAG(IS_IOS) + MachPortsForRendezvous ports_to_send = PortsForPid(0); +#else + pid_t sender_pid = audit_token_to_pid(request.trailer.msgh_audit); + MachPortsForRendezvous ports_to_send = PortsForPid(sender_pid); +#endif + + if (ports_to_send.empty()) { + return; + } + + std::unique_ptr<uint8_t[]> response = + CreateReplyMessage(request.msgh_remote_port, ports_to_send); + auto* header = reinterpret_cast<mach_msg_header_t*>(response.get()); + + mr = mach_msg(header, MACH_SEND_MSG, header->msgh_size, 0, MACH_PORT_NULL, + MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + + if (mr == KERN_SUCCESS) { + scoped_message.Disarm(); + } else { + MACH_LOG(ERROR, mr) << "mach_msg send"; + } +} + +std::unique_ptr<uint8_t[]> MachPortRendezvousServerBase::CreateReplyMessage( + mach_port_t reply_port, + const MachPortsForRendezvous& ports) { + const size_t port_count = ports.size(); + const size_t buffer_size = CalculateResponseSize(port_count); + auto buffer = std::make_unique<uint8_t[]>(buffer_size); + BufferIterator<uint8_t> iterator(buffer.get(), buffer_size); + + auto* message = iterator.MutableObject<mach_msg_base_t>(); + message->header.msgh_bits = + MACH_MSGH_BITS_REMOTE(MACH_MSG_TYPE_MOVE_SEND_ONCE) | + MACH_MSGH_BITS_COMPLEX; + message->header.msgh_size = checked_cast<mach_msg_size_t>(buffer_size); + message->header.msgh_remote_port = reply_port; + message->header.msgh_id = kMachRendezvousMsgIdResponse; + message->body.msgh_descriptor_count = + checked_cast<mach_msg_size_t>(port_count); + + auto descriptors = + iterator.MutableSpan<mach_msg_port_descriptor_t>(port_count); + auto port_identifiers = + iterator.MutableSpan<MachPortsForRendezvous::key_type>(port_count); + + auto port_it = ports.begin(); + for (size_t i = 0; i < port_count; ++i, ++port_it) { + const MachRendezvousPort& port_for_rendezvous = port_it->second; + mach_msg_port_descriptor_t* descriptor = &descriptors[i]; + descriptor->name = port_for_rendezvous.name(); + descriptor->disposition = port_for_rendezvous.disposition(); + descriptor->type = MACH_MSG_PORT_DESCRIPTOR; + + port_identifiers[i] = port_it->first; + } + + return buffer; +} + +MachPortRendezvousServer::~MachPortRendezvousServer() = default; + +#if BUILDFLAG(IS_IOS) +apple::ScopedMachSendRight MachPortRendezvousServer::GetMachSendRight() { + return apple::RetainMachSendRight(send_right_.get()); +} + +MachPortRendezvousServer::MachPortRendezvousServer( + const MachPortsForRendezvous& ports) + : ports_(ports) { + DCHECK_LT(ports_.size(), kMaximumRendezvousPorts); + bool res = apple::CreateMachPort(&server_port_, &send_right_); + CHECK(res) << "Failed to create mach server port"; + dispatch_source_ = std::make_unique<apple::DispatchSourceMach>( + "MachPortRendezvousServer", server_port_.get(), ^{ + HandleRequest(); + }); + dispatch_source_->Resume(); +} + +MachPortsForRendezvous MachPortRendezvousServer::PortsForPid(int pid) { + CHECK_EQ(pid, 0); + return ports_; +} + +#else + // static MachPortRendezvousServer* MachPortRendezvousServer::GetInstance() { static auto* instance = new MachPortRendezvousServer(); @@ -147,7 +275,6 @@ apple::ScopedMachReceiveRight::Receiver(server_port_).get()); BOOTSTRAP_CHECK(kr == KERN_SUCCESS, kr) << "bootstrap_check_in " << bootstrap_name; - dispatch_source_ = std::make_unique<apple::DispatchSourceMach>( bootstrap_name.c_str(), server_port_.get(), ^{ HandleRequest(); @@ -155,61 +282,7 @@ dispatch_source_->Resume(); } -MachPortRendezvousServer::~MachPortRendezvousServer() {} - -void MachPortRendezvousServer::HandleRequest() { - // Receive the request message, using the kernel audit token to ascertain the - // PID of the sender. - struct : mach_msg_header_t { - mach_msg_audit_trailer_t trailer; - } request{}; - request.msgh_size = sizeof(request); - request.msgh_local_port = server_port_.get(); - - const mach_msg_option_t options = - MACH_RCV_MSG | MACH_RCV_TIMEOUT | - MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0) | - MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT); - - mach_msg_return_t mr = mach_msg(&request, options, 0, sizeof(request), - server_port_.get(), 0, MACH_PORT_NULL); - if (mr != KERN_SUCCESS) { - MACH_LOG(ERROR, mr) << "mach_msg receive"; - return; - } - - // Destroy the message in case of an early return, which will release - // any rights from a bad message. In the case of a disallowed sender, - // the destruction of the reply port will break them out of a mach_msg. - ScopedMachMsgDestroy scoped_message(&request); - - if (request.msgh_id != kMachRendezvousMsgIdRequest || - request.msgh_size != sizeof(mach_msg_header_t)) { - // Do not reply to messages that are unexpected. - return; - } - - pid_t sender_pid = audit_token_to_pid(request.trailer.msgh_audit); - MachPortsForRendezvous ports_to_send = PortsForPid(sender_pid); - if (ports_to_send.empty()) { - return; - } - - std::unique_ptr<uint8_t[]> response = - CreateReplyMessage(request.msgh_remote_port, ports_to_send); - auto* header = reinterpret_cast<mach_msg_header_t*>(response.get()); - - mr = mach_msg(header, MACH_SEND_MSG, header->msgh_size, 0, MACH_PORT_NULL, - MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - - if (mr == KERN_SUCCESS) { - scoped_message.Disarm(); - } else { - MACH_LOG(ERROR, mr) << "mach_msg send"; - } -} - -MachPortsForRendezvous MachPortRendezvousServer::PortsForPid(pid_t pid) { +MachPortsForRendezvous MachPortRendezvousServer::PortsForPid(int pid) { MachPortsForRendezvous ports_to_send; AutoLock lock(lock_); auto it = client_data_.find(pid); @@ -220,52 +293,20 @@ return ports_to_send; } -std::unique_ptr<uint8_t[]> MachPortRendezvousServer::CreateReplyMessage( - mach_port_t reply_port, - const MachPortsForRendezvous& ports) { - const size_t port_count = ports.size(); - const size_t buffer_size = CalculateResponseSize(port_count); - auto buffer = std::make_unique<uint8_t[]>(buffer_size); - BufferIterator<uint8_t> iterator(buffer.get(), buffer_size); - - auto* message = iterator.MutableObject<mach_msg_base_t>(); - message->header.msgh_bits = - MACH_MSGH_BITS_REMOTE(MACH_MSG_TYPE_MOVE_SEND_ONCE) | - MACH_MSGH_BITS_COMPLEX; - message->header.msgh_size = checked_cast<mach_msg_size_t>(buffer_size); - message->header.msgh_remote_port = reply_port; - message->header.msgh_id = kMachRendezvousMsgIdResponse; - message->body.msgh_descriptor_count = - checked_cast<mach_msg_size_t>(port_count); - - auto descriptors = - iterator.MutableSpan<mach_msg_port_descriptor_t>(port_count); - auto port_identifiers = - iterator.MutableSpan<MachPortsForRendezvous::key_type>(port_count); - - auto port_it = ports.begin(); - for (size_t i = 0; i < port_count; ++i, ++port_it) { - const MachRendezvousPort& port_for_rendezvous = port_it->second; - mach_msg_port_descriptor_t* descriptor = &descriptors[i]; - descriptor->name = port_for_rendezvous.name(); - descriptor->disposition = port_for_rendezvous.disposition(); - descriptor->type = MACH_MSG_PORT_DESCRIPTOR; - - port_identifiers[i] = port_it->first; - } - - return buffer; -} - void MachPortRendezvousServer::OnClientExited(pid_t pid) { MachPortsForRendezvous ports = PortsForPid(pid); for (auto& pair : ports) { pair.second.Destroy(); } } +#endif // static MachPortRendezvousClient* MachPortRendezvousClient::GetInstance() { +#if BUILDFLAG(IS_IOS) + CHECK(g_client); + return g_client; +#else static MachPortRendezvousClient* client = []() -> auto* { auto* client = new MachPortRendezvousClient(); if (!client->AcquirePorts()) { @@ -276,6 +317,7 @@ } (); return client; +#endif } apple::ScopedMachSendRight MachPortRendezvousClient::TakeSendRight( @@ -300,6 +342,27 @@ return ports_.size(); } +#if BUILDFLAG(IS_IOS) + +bool MachPortRendezvousClient::Initialize( + apple::ScopedMachSendRight server_port) { + CHECK(!g_client); + g_client = new MachPortRendezvousClient(); + if (!g_client->AcquirePorts(std::move(server_port))) { + delete g_client; + g_client = nullptr; + } + return true; +} + +bool MachPortRendezvousClient::AcquirePorts( + apple::ScopedMachSendRight server_port) { + AutoLock lock(lock_); + return SendRequest(std::move(server_port)); +} + +#else + // static std::string MachPortRendezvousClient::GetBootstrapName() { return StringPrintf(kBootstrapNameFormat, apple::BaseBundleID(), getppid()); @@ -320,6 +383,7 @@ return SendRequest(std::move(server_port)); } +#endif bool MachPortRendezvousClient::SendRequest( apple::ScopedMachSendRight server_port) {
diff --git a/base/mac/mach_port_rendezvous.h b/base/mac/mach_port_rendezvous.h index 5c7ed0d4..a6c1b0a 100644 --- a/base/mac/mach_port_rendezvous.h +++ b/base/mac/mach_port_rendezvous.h
@@ -15,11 +15,15 @@ #include <string> #include "base/apple/dispatch_source_mach.h" -#include "base/apple/scoped_dispatch_object.h" #include "base/apple/scoped_mach_port.h" #include "base/base_export.h" #include "base/synchronization/lock.h" #include "base/thread_annotations.h" +#include "build/ios_buildflags.h" + +#if !BUILDFLAG(IS_IOS) +#include "base/apple/scoped_dispatch_object.h" +#endif namespace base { @@ -30,6 +34,9 @@ // which the child can then retrieve using Mach IPC by looking up the endpoint // in launchd's bootstrap namespace. // +// The same mechanism is used on iOS but the Mach IPC endpoint is not found +// via launchd's bootstrap namespace but via an initial XPC connection. +// // When launching a child process, the parent process' rendezvous server lets // calling code register a collection of ports for the new child. In order to // acquire the ports, a child looks up the rendezvous server in the bootstrap @@ -76,9 +83,64 @@ // collisions with other clients. using MachPortsForRendezvous = std::map<uint32_t, MachRendezvousPort>; -// Class that runs a Mach message server, from which client processes can -// acquire Mach port rights registered for them. -class BASE_EXPORT MachPortRendezvousServer { +// Base class that runs a Mach message server, listening to requests on +// mach server port. +class BASE_EXPORT MachPortRendezvousServerBase { + protected: + MachPortRendezvousServerBase(); + virtual ~MachPortRendezvousServerBase(); + + // The Mach receive right for the server. A send right to this is port is + // registered in the bootstrap server. + apple::ScopedMachReceiveRight server_port_; + + // Mach message dispatch source for |server_port_|. + std::unique_ptr<apple::DispatchSourceMach> dispatch_source_; + + // Ask for the associated ports associated with `pid`. `pid` will + // be 0 for iOS. + virtual MachPortsForRendezvous PortsForPid(int pid) = 0; + + // The server-side Mach message handler. Called by |dispatch_source_| when a + // message is received. + void HandleRequest(); + + // Returns a buffer containing a well-formed Mach message, destined for + // |reply_port| containing descriptors for the specified |ports|. + std::unique_ptr<uint8_t[]> CreateReplyMessage( + mach_port_t reply_port, + const MachPortsForRendezvous& ports); +}; + +#if BUILDFLAG(IS_IOS) +// An implementation class that works for a single process. It is intended +// that each process spawned will create a corresponding instance and the +// mach send right of this server will be sent using XPC to the process. +class BASE_EXPORT MachPortRendezvousServer + : public MachPortRendezvousServerBase { + public: + MachPortRendezvousServer(const MachPortsForRendezvous& ports); + ~MachPortRendezvousServer() override; + MachPortRendezvousServer(const MachPortRendezvousServer&) = delete; + MachPortRendezvousServer& operator=(const MachPortRendezvousServer&) = delete; + + // Retrieve the send right to be sent to the process. + apple::ScopedMachSendRight GetMachSendRight(); + + protected: + MachPortsForRendezvous PortsForPid(int pid) override; + + private: + apple::ScopedMachSendRight send_right_; + MachPortsForRendezvous ports_; +}; + +#else + +// An implementation class that uses bootstrap to register ports to many +// processes. +class BASE_EXPORT MachPortRendezvousServer + : public MachPortRendezvousServerBase { public: // Returns the instance of the server. Upon the first call to this method, // the server is created, which registers an endpoint in the Mach bootstrap @@ -104,10 +166,20 @@ // registered. Lock& GetLock() LOCK_RETURNED(lock_) { return lock_; } + protected: + // Returns the registered collection of ports for the specified |pid|. An + // empty collection indicates no ports were found, as it is invalid to + // register with an empty collection. This claims the collection of ports + // and removes the entry from |client_data_|. + MachPortsForRendezvous PortsForPid(int pid) override; + private: friend class MachPortRendezvousServerTest; friend struct MachPortRendezvousFuzzer; + MachPortRendezvousServer(); + ~MachPortRendezvousServer() override; + struct ClientData { ClientData(apple::ScopedDispatchObject<dispatch_source_t> exit_watcher, MachPortsForRendezvous ports); @@ -121,41 +193,16 @@ MachPortsForRendezvous ports; }; - MachPortRendezvousServer(); - ~MachPortRendezvousServer(); - - // The server-side Mach message handler. Called by |dispatch_source_| when a - // message is received. - void HandleRequest(); - - // Returns the registered collection of ports for the specified |pid|. An - // empty collection indicates no ports were found, as it is invalid to - // register with an empty collection. This claims the collection of ports - // and removes the entry from |client_data_|. - MachPortsForRendezvous PortsForPid(pid_t pid); - - // Returns a buffer containing a well-formed Mach message, destined for - // |reply_port| containing descriptors for the specified |ports|. - std::unique_ptr<uint8_t[]> CreateReplyMessage( - mach_port_t reply_port, - const MachPortsForRendezvous& ports); - // Called by the ClientData::exit_watcher dispatch sources when a process // for which ports have been registered exits. This releases port rights // that are strongly owned, in the event that the child has not claimed them. void OnClientExited(pid_t pid); - // The Mach receive right for the server. A send right to this is port is - // registered in the bootstrap server. - apple::ScopedMachReceiveRight server_port_; - - // Mach message dispatch source for |server_port_|. - std::unique_ptr<apple::DispatchSourceMach> dispatch_source_; - Lock lock_; // Association of pid-to-ports. std::map<pid_t, ClientData> client_data_ GUARDED_BY(lock_); }; +#endif // Client class for accessing the memory object exposed by the // MachPortRendezvousServer. @@ -190,8 +237,13 @@ // only reflects the number of remaining rights. size_t GetPortCount(); +#if BUILDFLAG(IS_IOS) + // Initialize the MacPortRendezvousClient using `server_port`. + static bool Initialize(apple::ScopedMachSendRight server_port); +#else // Returns the name of the server to look up in the bootstrap namespace. static std::string GetBootstrapName(); +#endif private: MachPortRendezvousClient(); @@ -199,7 +251,11 @@ // Helper method to look up the server in the bootstrap namespace and send // the acquisition request message. +#if BUILDFLAG(IS_IOS) + bool AcquirePorts(apple::ScopedMachSendRight server_port); +#else bool AcquirePorts(); +#endif // Sends the actual IPC message to |server_port| and parses the reply. bool SendRequest(apple::ScopedMachSendRight server_port)
diff --git a/cc/animation/animation_delegate.h b/cc/animation/animation_delegate.h index 6400635a..99535b7 100644 --- a/cc/animation/animation_delegate.h +++ b/cc/animation/animation_delegate.h
@@ -6,8 +6,8 @@ #define CC_ANIMATION_ANIMATION_DELEGATE_H_ #include <memory> - #include <optional> + #include "base/time/time.h" #include "cc/animation/animation_export.h" #include "ui/gfx/animation/keyframe/animation_curve.h"
diff --git a/cc/animation/scroll_offset_animation_curve.h b/cc/animation/scroll_offset_animation_curve.h index 753aa449..96be5a6a 100644 --- a/cc/animation/scroll_offset_animation_curve.h +++ b/cc/animation/scroll_offset_animation_curve.h
@@ -6,8 +6,8 @@ #define CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ #include <memory> - #include <optional> + #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" #include "base/time/time.h"
diff --git a/cc/animation/scroll_timeline.h b/cc/animation/scroll_timeline.h index 7df893f..bca729cd 100644 --- a/cc/animation/scroll_timeline.h +++ b/cc/animation/scroll_timeline.h
@@ -7,6 +7,7 @@ #include <optional> #include <vector> + #include "base/time/time.h" #include "cc/animation/animation_export.h" #include "cc/animation/animation_timeline.h"
diff --git a/cc/animation/worklet_animation.h b/cc/animation/worklet_animation.h index 5ce3b1ed..63de896 100644 --- a/cc/animation/worklet_animation.h +++ b/cc/animation/worklet_animation.h
@@ -6,9 +6,9 @@ #define CC_ANIMATION_WORKLET_ANIMATION_H_ #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/gtest_prod_util.h" #include "base/time/time.h" #include "cc/animation/animation.h"
diff --git a/cc/base/list_container.h b/cc/base/list_container.h index fdeae1b..c3b2f3b0 100644 --- a/cc/base/list_container.h +++ b/cc/base/list_container.h
@@ -9,9 +9,9 @@ #include <iterator> #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/check.h" #include "cc/base/list_container_helper.h"
diff --git a/cc/benchmarks/invalidation_benchmark.cc b/cc/benchmarks/invalidation_benchmark.cc index e08232b..e5c77d9 100644 --- a/cc/benchmarks/invalidation_benchmark.cc +++ b/cc/benchmarks/invalidation_benchmark.cc
@@ -8,10 +8,10 @@ #include <algorithm> #include <limits> +#include <optional> #include <string> #include <utility> -#include <optional> #include "base/rand_util.h" #include "base/values.h" #include "cc/base/math_util.h"
diff --git a/cc/benchmarks/rasterize_and_record_benchmark.cc b/cc/benchmarks/rasterize_and_record_benchmark.cc index a46e9c6..3a104fc 100644 --- a/cc/benchmarks/rasterize_and_record_benchmark.cc +++ b/cc/benchmarks/rasterize_and_record_benchmark.cc
@@ -8,9 +8,9 @@ #include <algorithm> #include <limits> +#include <optional> #include <string> -#include <optional> #include "base/functional/bind.h" #include "base/memory/ptr_util.h" #include "base/task/single_thread_task_runner.h"
diff --git a/cc/benchmarks/unittest_only_benchmark.cc b/cc/benchmarks/unittest_only_benchmark.cc index 2bb40d8..12b8e9bb 100644 --- a/cc/benchmarks/unittest_only_benchmark.cc +++ b/cc/benchmarks/unittest_only_benchmark.cc
@@ -4,9 +4,9 @@ #include "cc/benchmarks/unittest_only_benchmark.h" +#include <optional> #include <utility> -#include <optional> #include "base/functional/bind.h" #include "base/memory/ptr_util.h" #include "base/task/single_thread_task_runner.h"
diff --git a/cc/input/browser_controls_offset_manager.h b/cc/input/browser_controls_offset_manager.h index 700e8be..9ff0152 100644 --- a/cc/input/browser_controls_offset_manager.h +++ b/cc/input/browser_controls_offset_manager.h
@@ -6,9 +6,9 @@ #define CC_INPUT_BROWSER_CONTROLS_OFFSET_MANAGER_H_ #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "cc/input/browser_controls_state.h"
diff --git a/cc/input/scroll_snap_data.h b/cc/input/scroll_snap_data.h index ef3c251..4a425dc 100644 --- a/cc/input/scroll_snap_data.h +++ b/cc/input/scroll_snap_data.h
@@ -5,11 +5,11 @@ #ifndef CC_INPUT_SCROLL_SNAP_DATA_H_ #define CC_INPUT_SCROLL_SNAP_DATA_H_ +#include <optional> #include <set> #include <utility> #include <vector> -#include <optional> #include "base/gtest_prod_util.h" #include "cc/cc_export.h" #include "cc/paint/element_id.h"
diff --git a/cc/input/scrollbar_controller.h b/cc/input/scrollbar_controller.h index d236416..8cef7a2 100644 --- a/cc/input/scrollbar_controller.h +++ b/cc/input/scrollbar_controller.h
@@ -6,8 +6,8 @@ #define CC_INPUT_SCROLLBAR_CONTROLLER_H_ #include <memory> - #include <optional> + #include "base/cancelable_callback.h" #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h"
diff --git a/cc/layers/append_quads_data.h b/cc/layers/append_quads_data.h index 397d806fc..51cd5d96 100644 --- a/cc/layers/append_quads_data.h +++ b/cc/layers/append_quads_data.h
@@ -6,9 +6,10 @@ #define CC_LAYERS_APPEND_QUADS_DATA_H_ #include <stdint.h> -#include <vector> #include <optional> +#include <vector> + #include "cc/cc_export.h" #include "components/viz/common/surfaces/surface_id.h"
diff --git a/cc/layers/deadline_policy.h b/cc/layers/deadline_policy.h index 4e11c32..e4a15fc 100644 --- a/cc/layers/deadline_policy.h +++ b/cc/layers/deadline_policy.h
@@ -6,9 +6,9 @@ #define CC_LAYERS_DEADLINE_POLICY_H_ #include <cstdint> +#include <optional> #include <string> -#include <optional> #include "base/check.h" #include "cc/cc_export.h"
diff --git a/cc/layers/render_surface_impl.h b/cc/layers/render_surface_impl.h index ce8cd42b..bd82d1f 100644 --- a/cc/layers/render_surface_impl.h +++ b/cc/layers/render_surface_impl.h
@@ -8,11 +8,11 @@ #include <stddef.h> #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/memory/raw_ptr.h" #include "cc/cc_export.h" #include "cc/layers/draw_mode.h"
diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h index c69240f1..4e8d303 100644 --- a/cc/layers/texture_layer.h +++ b/cc/layers/texture_layer.h
@@ -6,10 +6,10 @@ #define CC_LAYERS_TEXTURE_LAYER_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h"
diff --git a/cc/layers/texture_layer_impl.h b/cc/layers/texture_layer_impl.h index 9f8171e..2d02b8dd8 100644 --- a/cc/layers/texture_layer_impl.h +++ b/cc/layers/texture_layer_impl.h
@@ -6,10 +6,10 @@ #define CC_LAYERS_TEXTURE_LAYER_IMPL_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/containers/flat_map.h" #include "base/functional/callback.h" #include "base/memory/ptr_util.h"
diff --git a/cc/metrics/compositor_frame_reporter.h b/cc/metrics/compositor_frame_reporter.h index 334b059..313e39c 100644 --- a/cc/metrics/compositor_frame_reporter.h +++ b/cc/metrics/compositor_frame_reporter.h
@@ -8,12 +8,12 @@ #include <bitset> #include <deque> #include <memory> +#include <optional> #include <queue> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/memory/raw_ptr.h" #include "base/memory/raw_ptr_exclusion.h" #include "base/rand_util.h"
diff --git a/cc/metrics/dropped_frame_counter.h b/cc/metrics/dropped_frame_counter.h index af7c289f..afdf57a 100644 --- a/cc/metrics/dropped_frame_counter.h +++ b/cc/metrics/dropped_frame_counter.h
@@ -6,12 +6,13 @@ #define CC_METRICS_DROPPED_FRAME_COUNTER_H_ #include <stddef.h> + #include <map> +#include <optional> #include <queue> #include <utility> #include <vector> -#include <optional> #include "base/containers/ring_buffer.h" #include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h"
diff --git a/cc/metrics/event_metrics.h b/cc/metrics/event_metrics.h index b247976..50c31af 100644 --- a/cc/metrics/event_metrics.h +++ b/cc/metrics/event_metrics.h
@@ -7,10 +7,10 @@ #include <cstdint> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/memory/raw_ptr.h" #include "base/time/tick_clock.h" #include "base/time/time.h"
diff --git a/cc/metrics/frame_sorter.h b/cc/metrics/frame_sorter.h index a8671c1..ced0946 100644 --- a/cc/metrics/frame_sorter.h +++ b/cc/metrics/frame_sorter.h
@@ -8,8 +8,8 @@ #include <stddef.h> #include <map> - #include <optional> + #include "base/containers/circular_deque.h" #include "base/functional/callback.h" #include "cc/cc_export.h"
diff --git a/cc/metrics/predictor_jank_tracker.h b/cc/metrics/predictor_jank_tracker.h index 018655b..fca2045 100644 --- a/cc/metrics/predictor_jank_tracker.h +++ b/cc/metrics/predictor_jank_tracker.h
@@ -6,6 +6,7 @@ #define CC_METRICS_PREDICTOR_JANK_TRACKER_H_ #include <optional> + #include "base/time/time.h" #include "cc/cc_export.h" #include "cc/metrics/event_metrics.h"
diff --git a/cc/metrics/scroll_jank_dropped_frame_tracker.h b/cc/metrics/scroll_jank_dropped_frame_tracker.h index 6acc173..86914c9d 100644 --- a/cc/metrics/scroll_jank_dropped_frame_tracker.h +++ b/cc/metrics/scroll_jank_dropped_frame_tracker.h
@@ -6,6 +6,7 @@ #define CC_METRICS_SCROLL_JANK_DROPPED_FRAME_TRACKER_H_ #include <optional> + #include "base/time/time.h" #include "cc/cc_export.h" #include "cc/metrics/event_metrics.h"
diff --git a/cc/metrics/scroll_jank_ukm_reporter.h b/cc/metrics/scroll_jank_ukm_reporter.h index fd505c0..e579232 100644 --- a/cc/metrics/scroll_jank_ukm_reporter.h +++ b/cc/metrics/scroll_jank_ukm_reporter.h
@@ -6,6 +6,7 @@ #define CC_METRICS_SCROLL_JANK_UKM_REPORTER_H_ #include <optional> + #include "base/memory/raw_ptr.h" #include "cc/cc_export.h"
diff --git a/cc/metrics/video_playback_roughness_reporter.h b/cc/metrics/video_playback_roughness_reporter.h index c407352..57cda82 100644 --- a/cc/metrics/video_playback_roughness_reporter.h +++ b/cc/metrics/video_playback_roughness_reporter.h
@@ -6,6 +6,7 @@ #define CC_METRICS_VIDEO_PLAYBACK_ROUGHNESS_REPORTER_H_ #include <optional> + #include "base/containers/circular_deque.h" #include "base/containers/flat_set.h" #include "base/functional/callback.h"
diff --git a/cc/mojom/render_frame_metadata_mojom_traits.h b/cc/mojom/render_frame_metadata_mojom_traits.h index 5cee93f..20d681c 100644 --- a/cc/mojom/render_frame_metadata_mojom_traits.h +++ b/cc/mojom/render_frame_metadata_mojom_traits.h
@@ -6,6 +6,7 @@ #define CC_MOJOM_RENDER_FRAME_METADATA_MOJOM_TRAITS_H_ #include <optional> + #include "base/component_export.h" #include "build/build_config.h" #include "cc/mojom/render_frame_metadata.mojom-shared.h"
diff --git a/cc/paint/decoded_draw_image.h b/cc/paint/decoded_draw_image.h index 634098a..ff33928 100644 --- a/cc/paint/decoded_draw_image.h +++ b/cc/paint/decoded_draw_image.h
@@ -7,8 +7,8 @@ #include <cfloat> #include <cmath> - #include <optional> + #include "cc/paint/paint_export.h" #include "cc/paint/paint_flags.h" #include "gpu/command_buffer/common/mailbox.h"
diff --git a/cc/paint/draw_image.h b/cc/paint/draw_image.h index a2ad0fdc..d90821b 100644 --- a/cc/paint/draw_image.h +++ b/cc/paint/draw_image.h
@@ -6,6 +6,7 @@ #define CC_PAINT_DRAW_IMAGE_H_ #include <optional> + #include "cc/paint/paint_export.h" #include "cc/paint/paint_flags.h" #include "cc/paint/paint_image.h"
diff --git a/cc/paint/image_provider.cc b/cc/paint/image_provider.cc index c9e4217f..66da01c 100644 --- a/cc/paint/image_provider.cc +++ b/cc/paint/image_provider.cc
@@ -4,9 +4,9 @@ #include "cc/paint/image_provider.h" +#include <optional> #include <utility> -#include <optional> #include "cc/paint/paint_record.h" namespace cc {
diff --git a/cc/paint/image_provider.h b/cc/paint/image_provider.h index 0835fe7d..76107fb 100644 --- a/cc/paint/image_provider.h +++ b/cc/paint/image_provider.h
@@ -5,9 +5,9 @@ #ifndef CC_PAINT_IMAGE_PROVIDER_H_ #define CC_PAINT_IMAGE_PROVIDER_H_ +#include <optional> #include <utility> -#include <optional> #include "base/functional/callback.h" #include "base/types/optional_util.h" #include "cc/paint/decoded_draw_image.h"
diff --git a/cc/paint/image_transfer_cache_entry.h b/cc/paint/image_transfer_cache_entry.h index 95db874..b2c768d1 100644 --- a/cc/paint/image_transfer_cache_entry.h +++ b/cc/paint/image_transfer_cache_entry.h
@@ -8,9 +8,9 @@ #include <stddef.h> #include <stdint.h> +#include <optional> #include <vector> -#include <optional> #include "base/atomic_sequence_num.h" #include "base/containers/span.h" #include "base/memory/raw_ptr.h"
diff --git a/cc/paint/paint_filter.h b/cc/paint/paint_filter.h index a32fad8..8cfae46c 100644 --- a/cc/paint/paint_filter.h +++ b/cc/paint/paint_filter.h
@@ -5,9 +5,9 @@ #ifndef CC_PAINT_PAINT_FILTER_H_ #define CC_PAINT_PAINT_FILTER_H_ +#include <optional> #include <string> -#include <optional> #include "base/check_op.h" #include "cc/paint/color_filter.h" #include "cc/paint/paint_export.h"
diff --git a/cc/paint/paint_image.h b/cc/paint/paint_image.h index c3b11c36..74b8af6e 100644 --- a/cc/paint/paint_image.h +++ b/cc/paint/paint_image.h
@@ -5,10 +5,10 @@ #ifndef CC_PAINT_PAINT_IMAGE_H_ #define CC_PAINT_PAINT_IMAGE_H_ +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/gtest_prod_util.h" #include "base/memory/scoped_refptr.h" #include "cc/paint/frame_metadata.h"
diff --git a/cc/paint/paint_op_buffer.h b/cc/paint/paint_op_buffer.h index a44f003..7e9cb40 100644 --- a/cc/paint/paint_op_buffer.h +++ b/cc/paint/paint_op_buffer.h
@@ -7,10 +7,10 @@ #include <limits> #include <memory> +#include <optional> #include <utility> #include <vector> -#include <optional> #include "base/bits.h" #include "base/check_op.h" #include "base/functional/callback.h"
diff --git a/cc/paint/paint_shader.h b/cc/paint/paint_shader.h index 8ab0504..0ff1289 100644 --- a/cc/paint/paint_shader.h +++ b/cc/paint/paint_shader.h
@@ -6,9 +6,9 @@ #define CC_PAINT_PAINT_SHADER_H_ #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/gtest_prod_util.h" #include "base/types/optional_util.h" #include "cc/paint/image_analysis_state.h"
diff --git a/cc/paint/paint_worklet_input.h b/cc/paint/paint_worklet_input.h index 8f641038..e2dddc7 100644 --- a/cc/paint/paint_worklet_input.h +++ b/cc/paint/paint_worklet_input.h
@@ -5,11 +5,11 @@ #ifndef CC_PAINT_PAINT_WORKLET_INPUT_H_ #define CC_PAINT_PAINT_WORKLET_INPUT_H_ +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/containers/flat_map.h" #include "base/memory/ref_counted.h" #include "cc/paint/element_id.h"
diff --git a/cc/paint/record_paint_canvas.h b/cc/paint/record_paint_canvas.h index 008290d..eb68fc6 100644 --- a/cc/paint/record_paint_canvas.h +++ b/cc/paint/record_paint_canvas.h
@@ -6,6 +6,7 @@ #define CC_PAINT_RECORD_PAINT_CANVAS_H_ #include <optional> + #include "base/compiler_specific.h" #include "base/memory/raw_ptr.h" #include "build/build_config.h"
diff --git a/cc/paint/scoped_raster_flags.h b/cc/paint/scoped_raster_flags.h index 194b9c12..b819f782 100644 --- a/cc/paint/scoped_raster_flags.h +++ b/cc/paint/scoped_raster_flags.h
@@ -6,6 +6,7 @@ #define CC_PAINT_SCOPED_RASTER_FLAGS_H_ #include <optional> + #include "base/memory/raw_ptr.h" #include "cc/paint/decode_stashing_image_provider.h" #include "cc/paint/paint_export.h"
diff --git a/cc/paint/solid_color_analyzer.h b/cc/paint/solid_color_analyzer.h index fd3fb6e..91e1c1a6 100644 --- a/cc/paint/solid_color_analyzer.h +++ b/cc/paint/solid_color_analyzer.h
@@ -5,9 +5,9 @@ #ifndef CC_PAINT_SOLID_COLOR_ANALYZER_H_ #define CC_PAINT_SOLID_COLOR_ANALYZER_H_ +#include <optional> #include <vector> -#include <optional> #include "cc/paint/paint_export.h" #include "cc/paint/paint_flags.h" #include "third_party/skia/include/core/SkColor.h"
diff --git a/cc/paint/solid_color_analyzer_unittest.cc b/cc/paint/solid_color_analyzer_unittest.cc index 7835518a..77bc530 100644 --- a/cc/paint/solid_color_analyzer_unittest.cc +++ b/cc/paint/solid_color_analyzer_unittest.cc
@@ -5,6 +5,7 @@ #include "cc/paint/solid_color_analyzer.h" #include <optional> + #include "base/memory/ref_counted.h" #include "build/build_config.h" #include "cc/paint/display_item_list.h"
diff --git a/cc/paint/target_color_params.h b/cc/paint/target_color_params.h index 5dc4fcd..d672d29d 100644 --- a/cc/paint/target_color_params.h +++ b/cc/paint/target_color_params.h
@@ -5,9 +5,9 @@ #ifndef CC_PAINT_TARGET_COLOR_PARAMS_H_ #define CC_PAINT_TARGET_COLOR_PARAMS_H_ +#include <optional> #include <string> -#include <optional> #include "cc/paint/paint_export.h" #include "ui/gfx/color_space.h" #include "ui/gfx/hdr_metadata.h"
diff --git a/cc/raster/categorized_worker_pool.h b/cc/raster/categorized_worker_pool.h index 0a19bae..b80ea4d 100644 --- a/cc/raster/categorized_worker_pool.h +++ b/cc/raster/categorized_worker_pool.h
@@ -6,9 +6,9 @@ #define CC_RASTER_CATEGORIZED_WORKER_POOL_H_ #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/containers/span.h" #include "base/functional/callback.h" #include "base/memory/raw_ptr.h"
diff --git a/cc/slim/delayer_scheduler_unittest.cc b/cc/slim/delayer_scheduler_unittest.cc index 3873cb9..8a6e533 100644 --- a/cc/slim/delayer_scheduler_unittest.cc +++ b/cc/slim/delayer_scheduler_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <optional> + #include "cc/slim/delayed_scheduler.h" #include "cc/slim/scheduler.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/cc/slim/frame_data.h b/cc/slim/frame_data.h index 6084e14d..94a96ab 100644 --- a/cc/slim/frame_data.h +++ b/cc/slim/frame_data.h
@@ -5,9 +5,9 @@ #ifndef CC_SLIM_FRAME_DATA_H_ #define CC_SLIM_FRAME_DATA_H_ +#include <optional> #include <vector> -#include <optional> #include "base/containers/flat_set.h" #include "base/memory/raw_ref.h" #include "cc/base/simple_enclosed_region.h"
diff --git a/cc/slim/frame_sink_impl.h b/cc/slim/frame_sink_impl.h index e62e263..bf9b016 100644 --- a/cc/slim/frame_sink_impl.h +++ b/cc/slim/frame_sink_impl.h
@@ -6,10 +6,10 @@ #define CC_SLIM_FRAME_SINK_IMPL_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h"
diff --git a/cc/slim/layer.h b/cc/slim/layer.h index 11c8ede..a2da7f2 100644 --- a/cc/slim/layer.h +++ b/cc/slim/layer.h
@@ -5,9 +5,9 @@ #ifndef CC_SLIM_LAYER_H_ #define CC_SLIM_LAYER_H_ +#include <optional> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h"
diff --git a/cc/slim/layer_tree_impl.h b/cc/slim/layer_tree_impl.h index 19b5f39..b03e3a8 100644 --- a/cc/slim/layer_tree_impl.h +++ b/cc/slim/layer_tree_impl.h
@@ -7,11 +7,11 @@ #include <cstdint> #include <memory> +#include <optional> #include <unordered_map> #include <utility> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/containers/circular_deque.h" #include "base/functional/callback.h"
diff --git a/cc/slim/surface_layer.h b/cc/slim/surface_layer.h index 5a14418..4d860553 100644 --- a/cc/slim/surface_layer.h +++ b/cc/slim/surface_layer.h
@@ -6,6 +6,7 @@ #define CC_SLIM_SURFACE_LAYER_H_ #include <optional> + #include "base/component_export.h" #include "cc/layers/deadline_policy.h" #include "cc/slim/layer.h"
diff --git a/cc/test/paint_op_matchers.h b/cc/test/paint_op_matchers.h index 30d1dde..9fbc3a0 100644 --- a/cc/test/paint_op_matchers.h +++ b/cc/test/paint_op_matchers.h
@@ -5,12 +5,12 @@ #ifndef CC_TEST_PAINT_OP_MATCHERS_H_ #define CC_TEST_PAINT_OP_MATCHERS_H_ +#include <optional> #include <ostream> #include <sstream> #include <string> #include <utility> -#include <optional> #include "base/memory/ref_counted.h" #include "base/strings/stringprintf.h" #include "cc/paint/paint_op_buffer.h"
diff --git a/cc/tiles/checker_image_tracker.h b/cc/tiles/checker_image_tracker.h index 5b17d44..7a26fc62 100644 --- a/cc/tiles/checker_image_tracker.h +++ b/cc/tiles/checker_image_tracker.h
@@ -6,10 +6,10 @@ #define CC_TILES_CHECKER_IMAGE_TRACKER_H_ #include <memory> +#include <optional> #include <unordered_map> #include <vector> -#include <optional> #include "base/containers/contains.h" #include "base/memory/raw_ptr.h" #include "cc/cc_export.h"
diff --git a/cc/tiles/gpu_image_decode_cache.h b/cc/tiles/gpu_image_decode_cache.h index b3b1589..dc01a8d 100644 --- a/cc/tiles/gpu_image_decode_cache.h +++ b/cc/tiles/gpu_image_decode_cache.h
@@ -6,13 +6,13 @@ #define CC_TILES_GPU_IMAGE_DECODE_CACHE_H_ #include <memory> +#include <optional> #include <string> #include <tuple> #include <unordered_map> #include <utility> #include <vector> -#include <optional> #include "base/containers/flat_map.h" #include "base/containers/lru_cache.h" #include "base/feature_list.h"
diff --git a/cc/tiles/image_controller_unittest.cc b/cc/tiles/image_controller_unittest.cc index 47f5c79..95a1f42 100644 --- a/cc/tiles/image_controller_unittest.cc +++ b/cc/tiles/image_controller_unittest.cc
@@ -5,9 +5,9 @@ #include "cc/tiles/image_controller.h" #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/run_loop.h"
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc index c58f8b5..e6b977b9 100644 --- a/cc/tiles/tile_manager.cc +++ b/cc/tiles/tile_manager.cc
@@ -8,9 +8,9 @@ #include <stdint.h> #include <limits> +#include <optional> #include <string> -#include <optional> #include "base/containers/contains.h" #include "base/feature_list.h" #include "base/functional/bind.h"
diff --git a/cc/tiles/tiles_with_resource_iterator.h b/cc/tiles/tiles_with_resource_iterator.h index 2735653..54a8c98 100644 --- a/cc/tiles/tiles_with_resource_iterator.h +++ b/cc/tiles/tiles_with_resource_iterator.h
@@ -5,10 +5,10 @@ #ifndef CC_TILES_TILES_WITH_RESOURCE_ITERATOR_H_ #define CC_TILES_TILES_WITH_RESOURCE_ITERATOR_H_ +#include <optional> #include <set> #include <vector> -#include <optional> #include "base/memory/raw_ptr.h" #include "cc/cc_export.h" #include "cc/tiles/picture_layer_tiling.h"
diff --git a/cc/trees/compositor_commit_data.h b/cc/trees/compositor_commit_data.h index 5681ed7..12e73ec 100644 --- a/cc/trees/compositor_commit_data.h +++ b/cc/trees/compositor_commit_data.h
@@ -6,9 +6,9 @@ #define CC_TREES_COMPOSITOR_COMMIT_DATA_H_ #include <memory> +#include <optional> #include <vector> -#include <optional> #include "cc/cc_export.h" #include "cc/input/browser_controls_state.h" #include "cc/input/scroll_snap_data.h"
diff --git a/cc/trees/effect_node.h b/cc/trees/effect_node.h index acd333c..e6b9662 100644 --- a/cc/trees/effect_node.h +++ b/cc/trees/effect_node.h
@@ -6,6 +6,7 @@ #define CC_TREES_EFFECT_NODE_H_ #include <optional> + #include "cc/cc_export.h" #include "cc/paint/element_id.h" #include "cc/paint/filter_operations.h"
diff --git a/cc/trees/layer_tree_frame_sink_client.h b/cc/trees/layer_tree_frame_sink_client.h index f1e50b0..ea1e866 100644 --- a/cc/trees/layer_tree_frame_sink_client.h +++ b/cc/trees/layer_tree_frame_sink_client.h
@@ -7,6 +7,7 @@ #include <optional> #include <vector> + #include "base/functional/callback.h" #include "cc/cc_export.h" #include "components/viz/common/resources/returned_resource.h"
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index d83833e..0429782 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h
@@ -10,13 +10,13 @@ #include <limits> #include <memory> +#include <optional> #include <set> #include <string> #include <unordered_map> #include <utility> #include <vector> -#include <optional> #include "base/cancelable_callback.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h"
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 657f1cc..d099028 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -11,10 +11,10 @@ #include <limits> #include <map> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/auto_reset.h" #include "base/command_line.h" #include "base/compiler_specific.h"
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 887c9a3..4e81896a8 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -8,13 +8,13 @@ #include <stddef.h> #include <memory> +#include <optional> #include <set> #include <string> #include <unordered_map> #include <utility> #include <vector> -#include <optional> #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/containers/lru_cache.h"
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 11359a37..ca6db31 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -8,9 +8,9 @@ #include <cmath> #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/memory/memory_pressure_listener.h"
diff --git a/cc/trees/layer_tree_mutator.h b/cc/trees/layer_tree_mutator.h index d1d7ccff..364145d 100644 --- a/cc/trees/layer_tree_mutator.h +++ b/cc/trees/layer_tree_mutator.h
@@ -6,11 +6,11 @@ #define CC_TREES_LAYER_TREE_MUTATOR_H_ #include <memory> +#include <optional> #include <string> #include <unordered_map> #include <vector> -#include <optional> #include "base/check.h" #include "base/functional/callback_forward.h" #include "base/time/time.h"
diff --git a/cc/trees/mutator_host_client.h b/cc/trees/mutator_host_client.h index 461162c..55d80747 100644 --- a/cc/trees/mutator_host_client.h +++ b/cc/trees/mutator_host_client.h
@@ -6,6 +6,7 @@ #define CC_TREES_MUTATOR_HOST_CLIENT_H_ #include <optional> + #include "cc/base/protected_sequence_synchronizer.h" #include "cc/paint/element_id.h" #include "cc/paint/paint_worklet_input.h"
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h index d2be4c4..8dbc271 100644 --- a/cc/trees/property_tree.h +++ b/cc/trees/property_tree.h
@@ -8,13 +8,13 @@ #include <stddef.h> #include <memory> +#include <optional> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> -#include <optional> #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/functional/callback.h"
diff --git a/cc/trees/render_frame_metadata.h b/cc/trees/render_frame_metadata.h index 65d7e811..a7d638a4 100644 --- a/cc/trees/render_frame_metadata.h +++ b/cc/trees/render_frame_metadata.h
@@ -6,6 +6,7 @@ #define CC_TREES_RENDER_FRAME_METADATA_H_ #include <optional> + #include "build/build_config.h" #include "cc/cc_export.h" #include "components/viz/common/quads/selection.h"
diff --git a/cc/trees/scroll_node.h b/cc/trees/scroll_node.h index 985b371..40d07cce 100644 --- a/cc/trees/scroll_node.h +++ b/cc/trees/scroll_node.h
@@ -6,6 +6,7 @@ #define CC_TREES_SCROLL_NODE_H_ #include <optional> + #include "cc/base/region.h" #include "cc/cc_export.h" #include "cc/input/main_thread_scrolling_reason.h"
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index fa6fa6c..37b926b2 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -378,6 +378,7 @@ "java/src/org/chromium/chrome/browser/compositor/layouts/phone/SimpleAnimationLayout.java", "java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java", "java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java", + "java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutGroupTitle.java", "java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java", "java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java", "java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutTab.java",
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java index f095cd7..4fe0a4f 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java
@@ -560,7 +560,8 @@ // The feed header may not be visible for smaller screens or landscape mode. // Scroll to show the header before showing the IPH. mMediator.scrollToViewIfNecessary(getSectionHeaderPosition()); - UserEducationHelper helper = new UserEducationHelper(mActivity, mHandler); + UserEducationHelper helper = + new UserEducationHelper(mActivity, mProfile, mHandler); mSectionHeaderView.showHeaderIph(helper); }, DELAY_FEED_HEADER_IPH_MS); @@ -570,7 +571,7 @@ if (mWebFeedHasContent && FeedFeatures.shouldUseWebFeedAwarenessIPH() && !FeedFeatures.isFeedFollowUiUpdateEnabled()) { - UserEducationHelper helper = new UserEducationHelper(mActivity, mHandler); + UserEducationHelper helper = new UserEducationHelper(mActivity, mProfile, mHandler); mSectionHeaderView.showWebFeedAwarenessIph( helper, StreamTabId.FOLLOWING, new Scroller()); } @@ -1070,7 +1071,7 @@ mScrollableContainerDelegate, () -> { UserEducationHelper helper = - new UserEducationHelper(mActivity, mHandler); + new UserEducationHelper(mActivity, mProfile, mHandler); mSectionHeaderView.showMenuIph(helper); }); mScrollableContainerDelegate.addScrollListener(mHeaderIphScrollListener); @@ -1083,7 +1084,7 @@ mScrollableContainerDelegate, () -> { UserEducationHelper helper = - new UserEducationHelper(mActivity, mHandler); + new UserEducationHelper(mActivity, mProfile, mHandler); mSwipeRefreshLayout.showIPH(helper); }); mScrollableContainerDelegate.addScrollListener(mRefreshIphScrollListener);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActionModeHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActionModeHandler.java index 98c37991..ec41f47 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActionModeHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActionModeHandler.java
@@ -190,7 +190,8 @@ .getDimensionPixelSize(R.dimen.iph_shared_highlighting_padding_top); Rect anchorRect = new Rect(view.getWidth() / 2, padding, view.getWidth() / 2, padding); UserEducationHelper mUserEducationHelper = - new UserEducationHelper(TabUtils.getActivity(mTab), new Handler()); + new UserEducationHelper( + TabUtils.getActivity(mTab), mTab.getProfile(), new Handler()); mUserEducationHelper.requestShowIPH( new IPHCommandBuilder( view.getResources(),
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/PageZoomIPHController.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/PageZoomIPHController.java index 523a5e26..c0af459a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/PageZoomIPHController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/PageZoomIPHController.java
@@ -10,6 +10,7 @@ import android.view.View; import org.chromium.chrome.R; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; import org.chromium.chrome.browser.user_education.IPHCommandBuilder; import org.chromium.chrome.browser.user_education.UserEducationHelper; @@ -22,11 +23,14 @@ private final UserEducationHelper mUserEducationHelper; public PageZoomIPHController( - Activity mActivity, AppMenuHandler mAppMenuHandler, View mToolbarMenuButton) { + Activity mActivity, + Profile profile, + AppMenuHandler mAppMenuHandler, + View mToolbarMenuButton) { this( mAppMenuHandler, mToolbarMenuButton, - new UserEducationHelper(mActivity, new Handler(Looper.getMainLooper()))); + new UserEducationHelper(mActivity, profile, new Handler(Looper.getMainLooper()))); } protected PageZoomIPHController(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java index c021ea7..c2af5d3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
@@ -161,7 +161,7 @@ ShoppingService shoppingService = ShoppingServiceFactory.getForProfile(profile); UserEducationHelper userEducationHelper = - new UserEducationHelper(activity, new Handler(Looper.myLooper())); + new UserEducationHelper(activity, profile, new Handler(Looper.myLooper())); IdentityManager identityManager = IdentityServicesProvider.get().getIdentityManager(profile);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/components/CompositorButton.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/components/CompositorButton.java index 8f5d6ce0..05998a2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/components/CompositorButton.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/components/CompositorButton.java
@@ -74,7 +74,6 @@ private boolean mIsPressed; private boolean mIsPressedFromMouse; private boolean mIsHovered; - private boolean mIsVisible; private boolean mIsIncognito; private boolean mIsEnabled; private String mAccessibilityDescription = ""; @@ -93,9 +92,9 @@ mOpacity = 1.f; mIsPressed = false; - mIsVisible = true; mIsIncognito = false; mIsEnabled = true; + setVisible(true); Resources res = context.getResources(); float sPxToDp = 1.0f / res.getDisplayMetrics().density; @@ -150,7 +149,7 @@ */ @Override public boolean checkClickedOrHovered(float x, float y) { - if (mOpacity < 1.f || !mIsVisible || !mIsEnabled) return false; + if (mOpacity < 1.f || !isVisible() || !mIsEnabled) return false; mCacheBounds.set(mBounds); mCacheBounds.inset(-mClickSlop, -mClickSlop); @@ -255,20 +254,6 @@ } /** - * @return The visibility of the button. - */ - public boolean isVisible() { - return mIsVisible; - } - - /** - * @param state The visibility of the button. - */ - public void setVisible(boolean state) { - mIsVisible = state; - } - - /** * @return The incognito state of the button. */ public boolean isIncognito() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java index d550794..9d33f3c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java
@@ -41,12 +41,12 @@ @Override public void performOcclusionPass( - StripLayoutTab[] indexOrderedTabs, float xOffset, float visibleWidth) { - for (int i = 0; i < indexOrderedTabs.length; i++) { - StripLayoutTab tab = indexOrderedTabs[i]; - tab.setVisible( - (tab.getDrawX() + tab.getWidth()) >= xOffset - && tab.getDrawX() <= xOffset + visibleWidth); + StripLayoutView[] indexOrderedViews, float xOffset, float visibleWidth) { + for (int i = 0; i < indexOrderedViews.length; i++) { + StripLayoutView view = indexOrderedViews[i]; + view.setVisible( + (view.getDrawX() + view.getWidth()) >= xOffset + && view.getDrawX() <= xOffset + visibleWidth); } } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutGroupTitle.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutGroupTitle.java new file mode 100644 index 0000000..d01eb4f --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutGroupTitle.java
@@ -0,0 +1,150 @@ +// 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.compositor.overlays.strip; + +import android.content.Context; +import android.graphics.RectF; + +import androidx.annotation.ColorInt; +import androidx.annotation.DrawableRes; + +import org.chromium.base.MathUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tasks.tab_groups.TabGroupTitleUtils; +import org.chromium.chrome.browser.tasks.tab_management.TabUiThemeUtil; + +/** + * {@link StripLayoutGroupTitle} is used to keep track of the strip position and rendering + * information for a particular tab group title indicator on the tab strip so it can draw itself + * onto the GL canvas. + */ +public class StripLayoutGroupTitle extends StripLayoutView { + // Position constants. + // TODO(crbug.com/326492662): Update min/max width once finalized. + private static final int MIN_WIDTH = 54; + private static final int MAX_WIDTH = 156; + + // External dependencies. + private Context mContext; + + // Position variables. + private float mDrawX; + private float mDrawY; + private float mWidth; + private float mHeight; + + // Tab group variables + int mRootId; + String mTitle = ""; + + public StripLayoutGroupTitle(Context context, int rootId) { + assert rootId != Tab.INVALID_TAB_ID : "Tried to create a group title for an invalid group."; + + mContext = context; + mRootId = rootId; + updateTitle(TabGroupTitleUtils.getTabGroupTitle(mRootId)); + } + + @Override + public float getDrawX() { + return mDrawX; + } + + @Override + public void setDrawX(float x) { + mDrawX = x; + } + + @Override + public float getDrawY() { + return mDrawY; + } + + @Override + public void setDrawY(float y) { + mDrawY = y; + } + + @Override + public float getWidth() { + return mWidth; + } + + @Override + public void setWidth(float width) { + width = MathUtils.clamp(width, MIN_WIDTH, MAX_WIDTH); + mWidth = width; + } + + @Override + public float getHeight() { + return mHeight; + } + + @Override + public void setHeight(float height) { + mHeight = height; + } + + @Override + public String getAccessibilityDescription() { + // TODO(crbug.com/326494015): Update when official descriptions are finalized. + return "Tab group: " + mTitle; + } + + @Override + public void getTouchTarget(RectF outTarget) { + // TODO(crbug.com/326492955): Add touch target. + } + + @Override + public boolean checkClickedOrHovered(float x, float y) { + // TODO(crbug.com/326492955): Implement click to collapse/expand. + return false; + } + + @Override + public void handleClick(long time) { + // No-op for now. We eventually plan to add functionality, such as collapsing a tab group. + } + + /** + * @return The Android resource that represents the tab group title indicator background. + */ + public @DrawableRes int getResourceId() { + // TODO(crbug.com/326492662): Replace with new 9-patch if needed. + return TabUiThemeUtil.getDetachedResource(); + } + + /** + * @return The tint color resource that represents the tab group title indicator background. + */ + public @ColorInt int getTint() { + // TODO(crbug.com/326488897): Pull color from Tab Group API. + return mContext.getColor(R.color.google_red_600); + } + + protected void updateTitle(String title) { + mTitle = title; + // TODO(crbug.com/326488897): Generate title bitmap and update width if necessary. + setWidth(0); + } + + /** + * @return The group's root ID. + */ + protected int getRootId() { + return mRootId; + } + + /** + * @param rootId The tab group's new rootId. Should be synced with the {@link + * org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter}. + */ + protected void updateRootId(int rootId) { + mRootId = rootId; + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java index 4bdd7af..cf007c9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
@@ -186,6 +186,8 @@ private StripLayoutTab[] mStripTabs = new StripLayoutTab[0]; private StripLayoutTab[] mStripTabsVisuallyOrdered = new StripLayoutTab[0]; private StripLayoutTab[] mStripTabsToRender = new StripLayoutTab[0]; + private StripLayoutGroupTitle[] mStripGroupTitles = new StripLayoutGroupTitle[0]; + private StripLayoutGroupTitle[] mStripGroupTitlesToRender = new StripLayoutGroupTitle[0]; private StripLayoutTab mTabAtPositionForTesting; private final StripTabEventHandler mStripTabEventHandler = new StripTabEventHandler(); private final TabLoadTrackerCallback mTabLoadTrackerHost = new TabLoadTrackerCallbackImpl(); @@ -490,6 +492,13 @@ } /** + * @return The visually ordered list of visible {@link StripLayoutGroupTitle}s. + */ + public StripLayoutGroupTitle[] getStripLayoutGroupTitlesToRender() { + return mStripGroupTitlesToRender; + } + + /** * @return A {@link TintedCompositorButton} that represents the positioning of the new tab * button. */ @@ -751,6 +760,7 @@ */ public void setTabGroupModelFilter(TabGroupModelFilter tabGroupModelFilter) { mTabGroupModelFilter = tabGroupModelFilter; + rebuildStripViews(); } /** @@ -989,7 +999,7 @@ for (int i = 0; i < mStripTabs.length; i++) { mStripTabs[i] = createPlaceholderStripTab(); } - rebuildNonTabViews(); + rebuildStripViews(); // 2. Initialize the draw parameters. computeAndUpdateTabWidth(false, false); @@ -2079,7 +2089,7 @@ int oldTabsLength = mStripTabs.length; mStripTabs = tabs; - rebuildNonTabViews(); + rebuildStripViews(); List<Animator> animationList = null; // If multi-step animation is running, the resize will be handled elsewhere. @@ -2092,8 +2102,81 @@ return animationList; } - private void rebuildNonTabViews() { - // TODO(crbug.com/1524186): Rebuild the title indicators if necessary here. + private StripLayoutGroupTitle findOrCreateGroupTitle(int rootId) { + for (int i = 0; i < mStripGroupTitles.length; i++) { + final StripLayoutGroupTitle groupTitle = mStripGroupTitles[i]; + if (groupTitle.getRootId() == rootId) return groupTitle; + } + return createGroupTitle(rootId); + } + + private StripLayoutGroupTitle createGroupTitle(int rootId) { + StripLayoutGroupTitle groupTitle = new StripLayoutGroupTitle(mContext, rootId); + pushPropertiesToGroupTitle(groupTitle); + return groupTitle; + } + + private void pushPropertiesToGroupTitle(StripLayoutGroupTitle groupTitle) { + groupTitle.setDrawY(0); + groupTitle.setHeight(mHeight); + } + + @VisibleForTesting + void rebuildStripViews() { + if (mTabGroupModelFilter != null + && mTabStateInitialized + && ChromeFeatureList.sTabStripGroupIndicators.isEnabled()) { + copyTabsWithGroupTitles(); + } else { + copyTabs(); + } + } + + private void copyTabsWithGroupTitles() { + if (mStripTabs.length == 0) return; + + int numGroups = mTabGroupModelFilter.getTabGroupCount(); + int groupTitleIndex = 0; + StripLayoutGroupTitle[] groupTitles = new StripLayoutGroupTitle[numGroups]; + + int numViews = mStripTabs.length + numGroups; + if (numViews != mStripViews.length) { + mStripViews = new StripLayoutView[numViews]; + } + + int viewIndex = 0; + // First view will be tab group title if first tab is grouped. + Tab firstTab = mModel.getTabAt(0); + if (mTabGroupModelFilter.isTabInTabGroup(firstTab)) { + int rootId = firstTab.getRootId(); + StripLayoutGroupTitle groupTitle = findOrCreateGroupTitle(rootId); + groupTitles[groupTitleIndex++] = groupTitle; + mStripViews[viewIndex++] = groupTitle; + } + // Copy the StripLayoutTabs and create group titles where needed. + for (int i = 0; i < mStripTabs.length - 1; i++) { + final StripLayoutTab stripTab = mStripTabs[i]; + mStripViews[viewIndex++] = stripTab; + + Tab currTab = getTabById(stripTab.getId()); + Tab nextTab = getTabById(mStripTabs[i + 1].getId()); + int nextRootId = nextTab.getRootId(); + boolean nextTabInGroup = mTabGroupModelFilter.isTabInTabGroup(nextTab); + boolean areRelatedTabs = currTab.getRootId() == nextRootId; + if (nextTabInGroup && !areRelatedTabs) { + StripLayoutGroupTitle groupTitle = findOrCreateGroupTitle(nextRootId); + groupTitles[groupTitleIndex++] = groupTitle; + mStripViews[viewIndex++] = groupTitle; + } + } + // Final view will be the last tab. + assert viewIndex == mStripViews.length - 1 : "Did not find all tab groups."; + mStripViews[viewIndex] = mStripTabs[mStripTabs.length - 1]; + + mStripGroupTitles = groupTitles; + } + + private void copyTabs() { int numViews = mStripTabs.length; if (numViews != mStripViews.length) { mStripViews = new StripLayoutView[numViews]; @@ -2346,25 +2429,38 @@ } } + private int getVisibleViewCount(StripLayoutView[] views) { + int renderCount = 0; + for (int i = 0; i < views.length; ++i) { + if (views[i].isVisible()) renderCount++; + } + return renderCount; + } + + private void populateVisibleViews(StripLayoutView[] allViews, StripLayoutView[] viewsToRender) { + int renderIndex = 0; + for (int i = 0; i < allViews.length; ++i) { + final StripLayoutView view = allViews[i]; + if (view.isVisible()) viewsToRender[renderIndex++] = view; + } + } + private void createRenderList() { // 1. Figure out how many tabs will need to be rendered. - int renderCount = 0; - for (int i = 0; i < mStripTabsVisuallyOrdered.length; ++i) { - if (mStripTabsVisuallyOrdered[i].isVisible()) renderCount++; - } + int tabRenderCount = getVisibleViewCount(mStripTabsVisuallyOrdered); + int groupTitleRenderCount = getVisibleViewCount(mStripGroupTitles); // 2. Reallocate the render list if necessary. - if (mStripTabsToRender.length != renderCount) { - mStripTabsToRender = new StripLayoutTab[renderCount]; + if (mStripTabsToRender.length != tabRenderCount) { + mStripTabsToRender = new StripLayoutTab[tabRenderCount]; + } + if (mStripGroupTitlesToRender.length != groupTitleRenderCount) { + mStripGroupTitlesToRender = new StripLayoutGroupTitle[groupTitleRenderCount]; } // 3. Populate it with the visible tabs. - int renderIndex = 0; - for (int i = 0; i < mStripTabsVisuallyOrdered.length; ++i) { - if (mStripTabsVisuallyOrdered[i].isVisible()) { - mStripTabsToRender[renderIndex++] = mStripTabsVisuallyOrdered[i]; - } - } + populateVisibleViews(mStripTabsVisuallyOrdered, mStripTabsToRender); + populateVisibleViews(mStripGroupTitles, mStripGroupTitlesToRender); } private CompositorAnimator updateNewTabButtonState(boolean animate) { @@ -3336,7 +3432,7 @@ // 4. Swap the tabs. moveElement(mStripTabs, index, newIndex); - rebuildNonTabViews(); + rebuildStripViews(); } private void handleReorderAutoScrolling(long time) { @@ -3673,6 +3769,13 @@ } /** + * @return An array containing the StripLayoutViews. + */ + StripLayoutView[] getStripLayoutViewsForTesting() { + return mStripViews; + } + + /** * @return The amount tabs overlap. */ float getTabOverlapWidthForTesting() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java index 801d6ba..51746fb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
@@ -626,6 +626,7 @@ mLayerTitleCacheSupplier.get(), resourceManager, getActiveStripLayoutHelper().getStripLayoutTabsToRender(), + getActiveStripLayoutHelper().getStripLayoutGroupTitlesToRender(), yOffset, selectedTabId, hoveredTabId,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutTab.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutTab.java index f88556e..3f72f5d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutTab.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutTab.java
@@ -191,7 +191,6 @@ private final LayoutUpdateHost mUpdateHost; private TintedCompositorButton mCloseButton; - private boolean mVisible = true; private boolean mIsDying; private boolean mIsReordering; private boolean mIsDraggedOffStrip; @@ -518,27 +517,18 @@ return mEndDividerVisible; } - /** - * @param visible Whether or not this {@link StripLayoutTab} should be drawn. - */ + @Override public void setVisible(boolean visible) { - mVisible = visible; + super.setVisible(visible); if (!visible) { mUpdateHost.releaseResourcesForTab(mId); } for (Observer observer : mObservers) { - observer.onVisibilityChanged(mVisible); + observer.onVisibilityChanged(isVisible()); } } /** - * @return Whether or not this {@link StripLayoutTab} should be drawn. - */ - public boolean isVisible() { - return mVisible; - } - - /** * Mark this tab as in the process of dying. This lets us track which tabs are dead after * animations. * @param isDying Whether or not the tab is dying.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutView.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutView.java index 1f4265c..2b0ca61b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutView.java
@@ -14,6 +14,8 @@ * the GL canvas. */ public abstract class StripLayoutView implements VirtualView { + boolean mVisible = true; + /** * @return The horizontal position of the view. */ @@ -55,6 +57,20 @@ public abstract void setHeight(float height); /** + * @return Whether or not this {@link StripLayoutView} should be drawn. + */ + public boolean isVisible() { + return mVisible; + } + + /** + * @param visible Whether or not this {@link StripLayoutView} should be drawn. + */ + public void setVisible(boolean visible) { + mVisible = visible; + } + + /** * Get a list of virtual views for accessibility events. * * @param views A List to populate with virtual views.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripStacker.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripStacker.java index 3649990..e761876 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripStacker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripStacker.java
@@ -160,10 +160,10 @@ * Performs an occlusion pass, setting the visibility on tabs. This is relegated to this * interface because the implementing class knows the proper visual order to optimize this pass. * - * @param indexOrderedTabs A list of tabs ordered by index. + * @param indexOrderedViews A list of views ordered by index. * @param xOffset The xOffset for the start of the strip. * @param visibleWidth The width of the visible space on the tab strip. */ public abstract void performOcclusionPass( - StripLayoutTab[] indexOrderedTabs, float xOffset, float visibleWidth); + StripLayoutView[] indexOrderedViews, float xOffset, float visibleWidth); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java index bb6b53d..da46b45 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
@@ -15,6 +15,7 @@ import org.chromium.chrome.browser.compositor.LayerTitleCache; import org.chromium.chrome.browser.compositor.layouts.components.CompositorButton; import org.chromium.chrome.browser.compositor.layouts.components.TintedCompositorButton; +import org.chromium.chrome.browser.compositor.overlays.strip.StripLayoutGroupTitle; import org.chromium.chrome.browser.compositor.overlays.strip.StripLayoutHelperManager; import org.chromium.chrome.browser.compositor.overlays.strip.StripLayoutTab; import org.chromium.chrome.browser.layouts.scene_layer.SceneLayer; @@ -79,6 +80,7 @@ LayerTitleCache layerTitleCache, ResourceManager resourceManager, StripLayoutTab[] stripLayoutTabsToRender, + StripLayoutGroupTitle[] stripLayoutGroupTitlesToRender, float yOffset, int selectedTabId, int hoveredTabId,
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 f718aa1..1ead240 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
@@ -1962,6 +1962,11 @@ return mClientManager.getEngagementSignalsCallbackForSession(session) != null; } + /** Whether a CustomTabs instance should include interactive Omnibox. */ + public boolean shouldEnableOmniboxForIntent(BrowserServicesIntentDataProvider intentData) { + return false; + } + /** * Whether PageInsight Hub is enabled by the launching Intent. False by default. * @param intentData {@link BrowserServicesIntentDataProvider} built from the Intent that
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/minimizedcustomtab/CustomTabMinimizationManagerHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/minimizedcustomtab/CustomTabMinimizationManagerHolder.java index 447595ae..ae1b9b8c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/minimizedcustomtab/CustomTabMinimizationManagerHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/minimizedcustomtab/CustomTabMinimizationManagerHolder.java
@@ -75,7 +75,10 @@ new MinimizedCustomTabIPHController( mActivity, mActivityTabProvider, - new UserEducationHelper(mActivity, new Handler(Looper.getMainLooper())), + new UserEducationHelper( + mActivity, + profileSupplier, + new Handler(Looper.getMainLooper())), profileSupplier); Runnable closeTabRunnable = mNavigationController::navigateOnClose; mMinimizationManager =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java index f971b3e..bc730e4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java
@@ -22,6 +22,7 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.os.Handler; +import android.os.Looper; import android.text.SpannableString; import android.text.TextUtils; import android.text.style.ForegroundColorSpan; @@ -95,6 +96,7 @@ import org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator.ToolbarColorObserver; import org.chromium.chrome.browser.ui.native_page.NativePage; import org.chromium.chrome.browser.ui.theme.BrandedColorScheme; +import org.chromium.chrome.browser.user_education.UserEducationHelper; import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.TintedDrawable; @@ -1392,7 +1394,13 @@ if (currentTab == null) return; Activity activity = currentTab.getWindowAndroid().getActivity().get(); if (activity == null) return; - mPageInfoIPHController = new PageInfoIPHController(activity, getSecurityIconView()); + mPageInfoIPHController = + new PageInfoIPHController( + new UserEducationHelper( + activity, + currentTab.getProfile(), + new Handler(Looper.getMainLooper())), + getSecurityIconView()); } if (mBlockingStatus3pcd != CookieBlocking3pcdStatus.NOT_IN3PCD) { if (!mCookieControlsVisible || !mThirdPartyCookiesBlocked) return;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/desktop_site/DesktopSiteSettingsIPHController.java b/chrome/android/java/src/org/chromium/chrome/browser/desktop_site/DesktopSiteSettingsIPHController.java index 52f8c36..a2bc6fc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/desktop_site/DesktopSiteSettingsIPHController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/desktop_site/DesktopSiteSettingsIPHController.java
@@ -84,7 +84,7 @@ profile, toolbarMenuButton, appMenuHandler, - new UserEducationHelper(activity, new Handler(Looper.getMainLooper())), + new UserEducationHelper(activity, profile, new Handler(Looper.getMainLooper())), new WebsitePreferenceBridge(), MessageDispatcherProvider.from(windowAndroid)); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java index ff51c2c..b859aaa 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
@@ -99,6 +99,7 @@ private NewTabPageManager mManager; private Activity mActivity; + private Profile mProfile; private UiConfig mUiConfig; private @Nullable DisplayStyleObserver mDisplayStyleObserver; private CallbackController mCallbackController = new CallbackController(); @@ -241,6 +242,7 @@ mScrollDelegate = scrollDelegate; mManager = manager; mActivity = activity; + mProfile = ProfileManager.getLastUsedRegularProfile(); mUiConfig = uiConfig; mNewTabPageUma = uma; mIsIncognito = isIncognito; @@ -248,7 +250,6 @@ mIsNtpAsHomeSurfaceOnTablet = isNtpAsHomeSurfaceOnTablet; mIsSurfacePolishEnabled = isSurfacePolishEnabled; mIsSurfacePolishOmniboxColorEnabled = isSurfacePolishOmniboxColorEnabled; - Profile profile = ProfileManager.getLastUsedRegularProfile(); mIsTablet = isTablet; mTabStripHeightSupplier = tabStripHeightSupplier; @@ -302,7 +303,7 @@ } initializeLogoCoordinator(searchProviderHasLogo, searchProviderIsGoogle); initializeMostVisitedTilesCoordinator( - profile, + mProfile, lifecycleDispatcher, tileGroupDelegate, touchEnabledDelegate, @@ -1055,7 +1056,8 @@ R.string.feature_notification_guide_tooltip_message_voice_search, mSearchBoxCoordinator.getVoiceSearchButton(), true); - UserEducationHelper userEducationHelper = new UserEducationHelper(mActivity, new Handler()); + UserEducationHelper userEducationHelper = + new UserEducationHelper(mActivity, mProfile, new Handler()); userEducationHelper.requestShowIPH(iphCommandBuilder.build()); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorInProductHelpController.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorInProductHelpController.java index 23083eb..8d0d61b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorInProductHelpController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorInProductHelpController.java
@@ -9,6 +9,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.download.OfflineContentAvailabilityStatusProvider; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.status_indicator.StatusIndicatorCoordinator; import org.chromium.chrome.browser.toolbar.ToolbarManager; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; @@ -31,13 +32,14 @@ public OfflineIndicatorInProductHelpController( final Activity activity, + Profile profile, final ToolbarManager toolbarManager, final AppMenuHandler appMenuHandler, final StatusIndicatorCoordinator coordinator) { mActivity = activity; mToolbarManager = toolbarManager; mAppMenuHandler = appMenuHandler; - mUserEducationHelper = new UserEducationHelper(mActivity, mHandler); + mUserEducationHelper = new UserEducationHelper(mActivity, profile, mHandler); assert coordinator != null; mCoordinator = coordinator;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/read_later/ReadLaterIPHController.java b/chrome/android/java/src/org/chromium/chrome/browser/read_later/ReadLaterIPHController.java index e23d97a..c702e32d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/read_later/ReadLaterIPHController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/read_later/ReadLaterIPHController.java
@@ -10,6 +10,7 @@ import android.view.View; import org.chromium.chrome.R; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; import org.chromium.chrome.browser.user_education.IPHCommandBuilder; import org.chromium.chrome.browser.user_education.UserEducationHelper; @@ -23,17 +24,22 @@ /** * Constructor. + * * @param activity The current activity. + * @param profile The current Profile. * @param toolbarMenuButton The toolbar menu button to which IPH will be anchored. * @param appMenuHandler The app menu handler */ public ReadLaterIPHController( - Activity activity, View toolbarMenuButton, AppMenuHandler appMenuHandler) { + Activity activity, + Profile profile, + View toolbarMenuButton, + AppMenuHandler appMenuHandler) { this( activity, toolbarMenuButton, appMenuHandler, - new UserEducationHelper(activity, new Handler(Looper.getMainLooper()))); + new UserEducationHelper(activity, profile, new Handler(Looper.getMainLooper()))); } ReadLaterIPHController(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java index ee96e4a..c5fb3bf 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
@@ -826,7 +826,7 @@ mWindowAndroid, mAppMenuCoordinator, mActivityLifecycleDispatcher, - mProfileSupplier, + profile, mActivityTabProvider, mIsInOverviewModeSupplier, mToolbarManager.getMenuButtonView(), @@ -834,6 +834,7 @@ mReadAloudIPHController = new ReadAloudIPHController( mActivity, + profile, getToolbarManager().getMenuButtonView(), mAppMenuCoordinator.getAppMenuHandler(), mActivityTabProvider, @@ -841,6 +842,7 @@ mReadLaterIPHController = new ReadLaterIPHController( mActivity, + profile, getToolbarManager().getMenuButtonView(), mAppMenuCoordinator.getAppMenuHandler()); @@ -933,6 +935,7 @@ && MultiWindowUtils.shouldShowManageWindowsMenu()) { MultiInstanceIphController.maybeShowInProductHelp( mActivity, + profile, getToolbarManager().getMenuButtonView(), mAppMenuCoordinator.getAppMenuHandler(), R.id.manage_all_windows_menu_id); @@ -955,6 +958,7 @@ mOfflineIndicatorInProductHelpController = new OfflineIndicatorInProductHelpController( mActivity, + profile, mToolbarManager, mAppMenuCoordinator.getAppMenuHandler(), mStatusIndicatorCoordinator); @@ -976,6 +980,7 @@ mAppBannerInProductHelpController = AppBannerInProductHelpControllerFactory.createAppBannerInProductHelpController( mActivity, + profile, mAppMenuCoordinator.getAppMenuHandler(), () -> mToolbarManager.getMenuButtonView(), R.id.add_to_homescreen_id); @@ -1022,6 +1027,7 @@ PageZoomIPHController mPageZoomIPHController = new PageZoomIPHController( mActivity, + profile, mAppMenuCoordinator.getAppMenuHandler(), mToolbarManager.getMenuButtonView()); mPageZoomIPHController.showColdStartIPH();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java index 4415441c..0455e22 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java
@@ -66,7 +66,7 @@ private final View mSecurityIconAnchorView; private final AppMenuHandler mAppMenuHandler; private final UserEducationHelper mUserEducationHelper; - private final ObservableSupplier<Profile> mProfileSupplier; + private final Profile mProfile; private final Supplier<Tab> mCurrentTabSupplier; private final Supplier<Boolean> mIsInOverviewModeSupplier; @@ -76,7 +76,7 @@ * @param appMenuCoordinator {@link AppMenuCoordinator} whose visual state is to be updated * accordingly. * @param lifecycleDispatcher {@link LifecycleDispatcher} that helps observe activity lifecycle. - * @param profileSupplier A supplier of the Profile associated with the current visible state. + * @param profile The current Profile. * @param tabSupplier An observable supplier of the current {@link Tab}. * @param isInOverviewModeSupplier Supplies whether the app is in overview mode. * @param menuButtonAnchorView The menu button view to serve as an anchor. @@ -87,7 +87,7 @@ @NonNull WindowAndroid windowAndroid, @NonNull AppMenuCoordinator appMenuCoordinator, @NonNull ActivityLifecycleDispatcher lifecycleDispatcher, - @NonNull ObservableSupplier<Profile> profileSupplier, + @NonNull Profile profile, @NonNull ObservableSupplier<Tab> tabSupplier, @NonNull Supplier<Boolean> isInOverviewModeSupplier, @NonNull View menuButtonAnchorView, @@ -99,13 +99,13 @@ mMenuButtonAnchorView = menuButtonAnchorView; mSecurityIconAnchorView = securityIconAnchorView; mIsInOverviewModeSupplier = isInOverviewModeSupplier; - mUserEducationHelper = new UserEducationHelper(mActivity, new Handler()); + mUserEducationHelper = new UserEducationHelper(mActivity, profile, new Handler()); if (!BuildInfo.getInstance().isAutomotive) { mScreenshotMonitor = new ScreenshotMonitorImpl(this, mActivity); } mLifecycleDispatcher = lifecycleDispatcher; mLifecycleDispatcher.register(this); - mProfileSupplier = profileSupplier; + mProfile = profile; mCurrentTabSupplier = tabSupplier; mPageLoadObserver = new CurrentTabObserver( @@ -231,8 +231,7 @@ @Override public void onScreenshotTaken() { Tab currentTab = mCurrentTabSupplier.get(); - Profile currentProfile = - currentTab != null ? currentTab.getProfile() : mProfileSupplier.get(); + Profile currentProfile = currentTab != null ? currentTab.getProfile() : mProfile; Tracker tracker = TrackerFactory.getTrackerForProfile(currentProfile); tracker.notifyEvent(EventConstants.SCREENSHOT_TAKEN_CHROME_IN_FOREGROUND);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java index f48e1af..d7c4376 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
@@ -592,7 +592,7 @@ mSnackbarManager = snackbarManager; mTabReparentingControllerSupplier = tabReparentingControllerSupplier; mEphemeralTabCoordinatorSupplier = ephemeralTabCoordinatorSupplier; - mUserEducationHelper = new UserEducationHelper(mActivity, mHandler); + mUserEducationHelper = new UserEducationHelper(mActivity, profileSupplier, mHandler); ToolbarLayout toolbarLayout = mActivity.findViewById(R.id.toolbar); NewTabPageDelegate ntpDelegate = createNewTabPageDelegate(toolbarLayout);
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManagerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManagerTest.java index f2ebe99e..20f21566 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManagerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManagerTest.java
@@ -509,6 +509,7 @@ mLayerTitleCacheSupplier.get(), mRenderHost.getResourceManager(), activeLayoutHelper.getStripLayoutTabsToRender(), + activeLayoutHelper.getStripLayoutGroupTitlesToRender(), 0f, selectedTabId, hoveredTabId, @@ -573,6 +574,7 @@ any(), any(), any(), + any(), /* yOffset= */ eq(yOffset), anyInt(), anyInt(), @@ -594,6 +596,7 @@ any(), any(), any(), + any(), /* yOffset= */ eq(0f), anyInt(), anyInt(), @@ -611,6 +614,7 @@ any(), any(), any(), + any(), /* yOffset= */ eq(yOffset - TAB_STRIP_HEIGHT_PX), anyInt(), anyInt(), @@ -743,6 +747,7 @@ any(), any(), any(), + any(), /* yOffset= */ eq(yOffset - TAB_STRIP_HEIGHT_PX), anyInt(), anyInt(), @@ -765,6 +770,7 @@ any(), any(), any(), + any(), /* yOffset= */ eq(0f), anyInt(), anyInt(), @@ -782,6 +788,7 @@ any(), any(), any(), + any(), /* yOffset= */ eq(yOffset), anyInt(), anyInt(),
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperTest.java index bea3b85..12863f2 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperTest.java
@@ -126,6 +126,8 @@ private static final String[] TEST_TAB_TITLES = {"Tab 1", "Tab 2", "Tab 3", "", null}; private static final String EXPECTED_MARGIN = "The tab should have a trailing margin."; private static final String EXPECTED_NO_MARGIN = "The tab should not have a trailing margin."; + private static final String EXPECTED_TAB = "The view should be a tab."; + private static final String EXPECTED_TITLE = "The view should be a title."; private static final String CLOSE_TAB = "Close %1$s tab"; private static final String IDENTIFIER = "Tab"; private static final String IDENTIFIER_SELECTED = "Selected Tab"; @@ -3024,6 +3026,55 @@ } @Test + @DisableFeatures(ChromeFeatureList.TAB_STRIP_GROUP_INDICATORS) + public void testRebuildNonTabViews_IndicatorsDisabled() { + // Initialize with 10 tabs. Group tabs 2 through 3. Group tabs 5 through 8. + initializeTest(false, false, true, 0, 10); + groupTabs(1, 3); + groupTabs(4, 8); + when(mTabGroupModelFilter.getTabGroupCount()).thenReturn(2); + + // Rebuild views. + mStripLayoutHelper.rebuildStripViews(); + + // Verify. + StripLayoutView[] views = mStripLayoutHelper.getStripLayoutViewsForTesting(); + assertEquals("Should be 10 views (10 tabs).", 10, views.length); + for (StripLayoutView view : views) { + assertTrue(EXPECTED_TAB, view instanceof StripLayoutTab); + } + } + + @Test + @EnableFeatures(ChromeFeatureList.TAB_STRIP_GROUP_INDICATORS) + public void testRebuildNonTabViews_IndicatorsEnabled() { + // Initialize with 10 tabs. Group tabs 2 through 3. Group tabs 5 through 8. + initializeTest(false, false, true, 0, 10); + groupTabs(1, 3); + groupTabs(4, 8); + when(mTabGroupModelFilter.getTabGroupCount()).thenReturn(2); + + // Rebuild views. + mStripLayoutHelper.rebuildStripViews(); + + // Verify. + StripLayoutView[] views = mStripLayoutHelper.getStripLayoutViewsForTesting(); + assertEquals("Should be 12 views (10 tabs and 2 titles).", 12, views.length); + assertTrue(EXPECTED_TAB, views[0] instanceof StripLayoutTab); + assertTrue(EXPECTED_TITLE, views[1] instanceof StripLayoutGroupTitle); + assertTrue(EXPECTED_TAB, views[2] instanceof StripLayoutTab); + assertTrue(EXPECTED_TAB, views[3] instanceof StripLayoutTab); + assertTrue(EXPECTED_TAB, views[4] instanceof StripLayoutTab); + assertTrue(EXPECTED_TITLE, views[5] instanceof StripLayoutGroupTitle); + assertTrue(EXPECTED_TAB, views[6] instanceof StripLayoutTab); + assertTrue(EXPECTED_TAB, views[7] instanceof StripLayoutTab); + assertTrue(EXPECTED_TAB, views[8] instanceof StripLayoutTab); + assertTrue(EXPECTED_TAB, views[9] instanceof StripLayoutTab); + assertTrue(EXPECTED_TAB, views[10] instanceof StripLayoutTab); + assertTrue(EXPECTED_TAB, views[11] instanceof StripLayoutTab); + } + + @Test public void testUpdateLastHoveredTab() { // Assume tab0 is selected, tab1 is hovered on. initializeTabHoverTest();
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripStackerUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripStackerUnitTest.java index 566eb1be..fb72387 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripStackerUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripStackerUnitTest.java
@@ -116,6 +116,6 @@ @Override public void performOcclusionPass( - StripLayoutTab[] indexOrderedTabs, float xOffset, float visibleWidth) {} + StripLayoutView[] indexOrderedViews, float xOffset, float visibleWidth) {} } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayerTest.java index 464fc66f..2ef0c84e 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayerTest.java
@@ -133,6 +133,7 @@ mLayerTitleCache, mResourceManager, mStripLayoutTabs, + null, 1.f, 0, -1,
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 943031d3..567d5bdc 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
@@ -52,6 +52,7 @@ import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Features; +import org.chromium.base.test.util.Features.DisableFeatures; import org.chromium.base.test.util.Features.EnableFeatures; import org.chromium.chrome.browser.ChromeApplicationImpl; import org.chromium.chrome.browser.browserservices.SessionHandler; @@ -219,5 +220,20 @@ mConnection.mClientManager.newSession(mSession, uid, null, null, null, handler); } + @Test + @DisableFeatures(ChromeFeatureList.SEARCH_IN_CCT) + public void shouldEnableOmniboxForIntent_featureDisabled() { + // The logic is currently expected to not even peek in the intent. + assertFalse(mConnection.shouldEnableOmniboxForIntent(null)); + } + + @Test + @EnableFeatures(ChromeFeatureList.SEARCH_IN_CCT) + public void shouldEnableOmniboxForIntent_featureEnabled() { + // The logic is currently expected to not even peek in the intent. + // Omnibox must remain disabled even if the feature flag is on. + assertFalse(mConnection.shouldEnableOmniboxForIntent(null)); + } + // TODO(https://crrev.com/c/4118209) Add more tests for Feature enabling/disabling. }
diff --git a/chrome/app/os_settings_strings.grdp b/chrome/app/os_settings_strings.grdp index 949e1d7d..5b2b18a 100644 --- a/chrome/app/os_settings_strings.grdp +++ b/chrome/app/os_settings_strings.grdp
@@ -3652,21 +3652,12 @@ <message name="IDS_SETTINGS_PRINTING_CUPS_PRINTERS_LEARN_MORE_LABEL" desc="Label for the link that teaches users how to use CUPS printing."> Set up or manage CUPS printers. <ph name="LINK_BEGIN"><a></ph>Learn more<ph name="LINK_END"></a></ph> </message> - <message name="IDS_SETTINGS_PRINTING_CUPS_PRINTERS_ADD_PRINTER" desc="In CUPS printing settings subpage, text for the link adding a new CUPS printer."> - Add printer - </message> <message name="IDS_SETTINGS_PRINTING_CUPS_PRINTERS_ADD_PRINTER_MANUALLY" desc="In CUPS printing settings subpage, text for the link adding a new CUPS printer."> Add printer manually </message> - <message name="IDS_SETTINGS_PRINTING_CUPS_PRINTERS_ADD_DETECTED_OR_NEW_PRINTER" desc="In CUPS printing settings subpage, explanatory text for the nearby printers list."> - Save detected printers to your profile, or add a new printer. <ph name="LINK_BEGIN"><a></ph>Learn more<ph name="LINK_END"></a></ph> - </message> <message name="IDS_SETTINGS_PRINTING_CUPS_PRINTERS_AVAILABLE_PRINTERS_READY_SUBTEXT" desc="In CUPS printing settings subpage, explanatory text for the nearby printers list."> These printers are connected and ready to use. Save to your profile for easier access. </message> - <message name="IDS_SETTINGS_PRINTING_CUPS_PRINTERS_AVAILABLE_PRINTERS" desc="In CUPS printing settings subpage, title for the nearby printers list."> - Add printers to your profile - </message> <message name="IDS_SETTINGS_PRINTING_CUPS_PRINTERS_AVAILABLE_PRINTERS_READY" desc="In CUPS printing settings subpage, title for the nearby printers list."> Other available printers </message>
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_PRINTING_CUPS_PRINTERS_ADD_PRINTER.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_PRINTING_CUPS_PRINTERS_ADD_PRINTER.png.sha1 deleted file mode 100644 index 6141924..0000000 --- a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_PRINTING_CUPS_PRINTERS_ADD_PRINTER.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -2d222a5fe231ab9ec48b41e637af5a683311f8cb \ No newline at end of file
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index a7cc672..2edfce6 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -5802,9 +5802,6 @@ flag_descriptions::kPrinterSettingsPrinterStatusName, flag_descriptions::kPrinterSettingsPrinterStatusDescription, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kPrinterSettingsPrinterStatus)}, - {"printer-settings-revamp", flag_descriptions::kPrinterSettingsRevampName, - flag_descriptions::kPrinterSettingsRevampDescription, kOsCrOS, - FEATURE_VALUE_TYPE(ash::features::kPrinterSettingsRevamp)}, {kGlanceablesV2InternalName, flag_descriptions::kGlanceablesV2Name, flag_descriptions::kGlanceablesV2Description, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kGlanceablesV2)}, @@ -6212,10 +6209,6 @@ kJourneysVariations, "HistoryJourneys")}, - {"rename-history-journeys", flag_descriptions::kRenameJourneysName, - flag_descriptions::kRenameJourneysDescription, kOsDesktop | kOsAndroid, - FEATURE_VALUE_TYPE(history_clusters::kRenameJourneys)}, - {"history-journeys-labels", flag_descriptions::kJourneysLabelsName, flag_descriptions::kJourneysLabelsDescription, kOsDesktop | kOsAndroid, FEATURE_WITH_PARAMS_VALUE_TYPE(history_clusters::internal::kJourneysLabels, @@ -6731,6 +6724,12 @@ flag_descriptions::kNtpWallpaperSearchButtonDescription, kOsDesktop, FEATURE_VALUE_TYPE(ntp_features::kNtpWallpaperSearchButton)}, + {"ntp-wallpaper-search-button-animation", + flag_descriptions::kNtpWallpaperSearchButtonAnimationName, + flag_descriptions::kNtpWallpaperSearchButtonAnimationDescription, + kOsDesktop, + FEATURE_VALUE_TYPE(ntp_features::kNtpWallpaperSearchButtonAnimation)}, + {"shopping-page-types", commerce::flag_descriptions::kShoppingPageTypesName, commerce::flag_descriptions::kShoppingPageTypesDescription, kOsDesktop, FEATURE_VALUE_TYPE(commerce::kShoppingPageTypes)}, @@ -6858,12 +6857,6 @@ flag_descriptions::kAddPrinterViaPrintscanmgrDescription, kOsCrOS | kOsLacros, FEATURE_VALUE_TYPE(printing::features::kAddPrinterViaPrintscanmgr)}, - - {"enable-borderless-printing", - flag_descriptions::kEnableBorderlessPrintingName, - flag_descriptions::kEnableBorderlessPrintingDescription, - kOsCrOS | kOsLacros, - FEATURE_VALUE_TYPE(printing::features::kEnableBorderlessPrinting)}, #endif // BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_MAC)
diff --git a/chrome/browser/android/webapk/webapk_info.h b/chrome/browser/android/webapk/webapk_info.h index b126d261..7fb730d 100644 --- a/chrome/browser/android/webapk/webapk_info.h +++ b/chrome/browser/android/webapk/webapk_info.h
@@ -5,9 +5,8 @@ #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INFO_H_ #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INFO_H_ -#include <string> - #include <optional> +#include <string> #include "base/time/time.h" #include "services/device/public/mojom/screen_orientation_lock_types.mojom-shared.h"
diff --git a/chrome/browser/android/webapk/webapk_installer.h b/chrome/browser/android/webapk/webapk_installer.h index 0e6ff176..a9c36ce6 100644 --- a/chrome/browser/android/webapk/webapk_installer.h +++ b/chrome/browser/android/webapk/webapk_installer.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ #include <jni.h> + #include <map> #include <memory> #include <optional>
diff --git a/chrome/browser/android/webapk/webapk_update_data_fetcher.cc b/chrome/browser/android/webapk/webapk_update_data_fetcher.cc index 24676148..4241fda 100644 --- a/chrome/browser/android/webapk/webapk_update_data_fetcher.cc +++ b/chrome/browser/android/webapk/webapk_update_data_fetcher.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/android/webapk/webapk_update_data_fetcher.h" #include <jni.h> + #include <optional> #include <set> #include <string>
diff --git a/chrome/browser/apps/almanac_api_client/almanac_api_util_unittest.cc b/chrome/browser/apps/almanac_api_client/almanac_api_util_unittest.cc index 567894b..69f5811 100644 --- a/chrome/browser/apps/almanac_api_client/almanac_api_util_unittest.cc +++ b/chrome/browser/apps/almanac_api_client/almanac_api_util_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/apps/almanac_api_client/almanac_api_util.h" + #include <optional> #include <string>
diff --git a/chrome/browser/apps/app_service/app_launch_params.h b/chrome/browser/apps/app_service/app_launch_params.h index 997847a..b963750 100644 --- a/chrome/browser/apps/app_service/app_launch_params.h +++ b/chrome/browser/apps/app_service/app_launch_params.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_APPS_APP_SERVICE_APP_LAUNCH_PARAMS_H_ #include <stdint.h> + #include <optional> #include <string> #include <vector>
diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.h b/chrome/browser/apps/app_service/app_service_proxy_base.h index 8269094..f50a45d 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.h +++ b/chrome/browser/apps/app_service/app_service_proxy_base.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_APPS_APP_SERVICE_APP_SERVICE_PROXY_BASE_H_ #include <stdint.h> + #include <memory> #include <optional> #include <ostream>
diff --git a/chrome/browser/apps/app_service/metrics/website_metrics.cc b/chrome/browser/apps/app_service/metrics/website_metrics.cc index a511743..7057e7e 100644 --- a/chrome/browser/apps/app_service/metrics/website_metrics.cc +++ b/chrome/browser/apps/app_service/metrics/website_metrics.cc
@@ -529,17 +529,12 @@ // the url. return; } - // WebContents in app windows are filtered out in OnBrowserAdded. Installed // web apps opened in tabs are filtered out too. So every WebContents here - // must be a website not installed. Check the manifest to get the scope or the - // start url if there is a manifest. - if (!data || blink::IsEmptyManifest(data->manifest()) || - data->manifest().scope.is_empty()) { - return; + // must be a website not installed. + if (result == webapps::InstallableWebAppCheckResult::kYes_Promotable) { + UpdateUrlInfo(it->second, /*promotable=*/true); } - - UpdateUrlInfo(it->second, /*promotable=*/true); } void WebsiteMetrics::AddUrlInfo(const GURL& url,
diff --git a/chrome/browser/apps/app_service/metrics/website_metrics_browsertest.cc b/chrome/browser/apps/app_service/metrics/website_metrics_browsertest.cc index b094d7d..a74b6091 100644 --- a/chrome/browser/apps/app_service/metrics/website_metrics_browsertest.cc +++ b/chrome/browser/apps/app_service/metrics/website_metrics_browsertest.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/apps/app_service/metrics/website_metrics.h" + #include <memory> #include <optional> #include <set> @@ -12,7 +14,6 @@ #include "base/run_loop.h" #include "base/time/time.h" #include "build/chromeos_buildflags.h" -#include "chrome/browser/apps/app_service/metrics/website_metrics.h" #include "chrome/browser/apps/app_service/metrics/website_metrics_browser_test_mixin.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h"
diff --git a/chrome/browser/apps/app_service/publishers/extension_apps_base.cc b/chrome/browser/apps/app_service/publishers/extension_apps_base.cc index c2dfedc..e41520a 100644 --- a/chrome/browser/apps/app_service/publishers/extension_apps_base.cc +++ b/chrome/browser/apps/app_service/publishers/extension_apps_base.cc
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/apps/app_service/publishers/extension_apps.h" - #include <optional> #include <string> #include <utility> @@ -19,6 +17,7 @@ #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/apps/app_service/launch_utils.h" +#include "chrome/browser/apps/app_service/publishers/extension_apps.h" #include "chrome/browser/apps/app_service/publishers/extension_apps_enable_flow.h" #include "chrome/browser/apps/app_service/publishers/extension_apps_util.h" #include "chrome/browser/ash/app_list/extension_app_utils.h"
diff --git a/chrome/browser/ash/accessibility/accessibility_manager_browsertest.cc b/chrome/browser/ash/accessibility/accessibility_manager_browsertest.cc index 16779223..ca08c0d 100644 --- a/chrome/browser/ash/accessibility/accessibility_manager_browsertest.cc +++ b/chrome/browser/ash/accessibility/accessibility_manager_browsertest.cc
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/shell.h" #include "chrome/browser/ash/accessibility/accessibility_manager.h" #include <optional> @@ -11,6 +10,7 @@ #include "ash/constants/ash_pref_names.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/test/accessibility_controller_test_api.h" +#include "ash/shell.h" #include "base/command_line.h" #include "base/functional/bind.h" #include "base/functional/callback_helpers.h"
diff --git a/chrome/browser/ash/accessibility/service/accessibility_service_client_browsertest.cc b/chrome/browser/ash/accessibility/service/accessibility_service_client_browsertest.cc index e136704a1..af1183d 100644 --- a/chrome/browser/ash/accessibility/service/accessibility_service_client_browsertest.cc +++ b/chrome/browser/ash/accessibility/service/accessibility_service_client_browsertest.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/ash/accessibility/service/accessibility_service_client.h" + #include <optional> #include "ash/accessibility/accessibility_controller.h" @@ -23,7 +25,6 @@ #include "base/test/bind.h" #include "chrome/browser/accessibility/service/accessibility_service_router_factory.h" #include "chrome/browser/ash/accessibility/accessibility_manager.h" -#include "chrome/browser/ash/accessibility/service/accessibility_service_client.h" #include "chrome/browser/ash/accessibility/service/automation_client_impl.h" #include "chrome/browser/ash/accessibility/service/fake_accessibility_service.h" #include "chrome/browser/ash/accessibility/service/speech_recognition_impl.h"
diff --git a/chrome/browser/ash/app_list/search/files/zero_state_drive_provider.cc b/chrome/browser/ash/app_list/search/files/zero_state_drive_provider.cc index e07d1943..ac512cb 100644 --- a/chrome/browser/ash/app_list/search/files/zero_state_drive_provider.cc +++ b/chrome/browser/ash/app_list/search/files/zero_state_drive_provider.cc
@@ -7,6 +7,7 @@ #include <memory> #include <optional> +#include "ash/constants/ash_features.h" #include "ash/public/cpp/app_list/app_list_types.h" #include "base/metrics/histogram_functions.h" #include "base/task/single_thread_task_runner.h" @@ -157,13 +158,23 @@ // Assign scores to results by simply using their position in the results // list. The order of results from the ItemSuggest API is significant: // the first is better than the second, etc. Resulting scores are in [0, 1]. + // + // If drive files and local files need to be mixed in continue section, create + // ranking using time stamps, so local and drive files are consistently + // ranked. + const bool timestamp_based_score = + ash::features::UseMixedFileLauncherContinueSection(); + const double total_items = static_cast<double>(suggest_results.size()); int item_index = 0; + + const base::TimeDelta max_recency = ash::GetMaxFileSuggestionRecency(); SearchProvider::Results provider_results; for (const auto& result : suggest_results) { - const double score = 1.0 - (item_index / total_items); + const double score = timestamp_based_score + ? ash::ToTimestampBasedScore(result, max_recency) + : (1.0 - item_index / total_items); ++item_index; - provider_results.emplace_back(MakeListResult( result.id, result.file_path, result.prediction_reason, score)); }
diff --git a/chrome/browser/ash/app_list/search/files/zero_state_file_provider.cc b/chrome/browser/ash/app_list/search/files/zero_state_file_provider.cc index e6e9a2e..efec337 100644 --- a/chrome/browser/ash/app_list/search/files/zero_state_file_provider.cc +++ b/chrome/browser/ash/app_list/search/files/zero_state_file_provider.cc
@@ -100,17 +100,25 @@ void ZeroStateFileProvider::SetSearchResults( const std::vector<ash::FileSuggestData>& results) { + const bool timestamp_based_score = + ash::features::UseMixedFileLauncherContinueSection(); + const base::TimeDelta max_recency = ash::GetMaxFileSuggestionRecency(); + // Use valid results for search results. SearchProvider::Results new_results; for (size_t i = 0; i < std::min(results.size(), kMaxLocalFiles); ++i) { const auto& filepath = results[i].file_path; if (!IsScreenshot(filepath, downloads_path_)) { DCHECK(results[i].score.has_value()); + + const double score = timestamp_based_score ? ash::ToTimestampBasedScore( + results[i], max_recency) + : *results[i].score; auto result = std::make_unique<FileResult>( results[i].id, filepath, results[i].prediction_reason, ash::AppListSearchResultType::kZeroStateFile, - ash::SearchResultDisplayType::kContinue, results[i].score.value(), - std::u16string(), FileResult::Type::kFile, profile_); + ash::SearchResultDisplayType::kContinue, score, std::u16string(), + FileResult::Type::kFile, profile_); new_results.push_back(std::move(result)); } }
diff --git a/chrome/browser/ash/app_list/search/ranking/continue_ranker.cc b/chrome/browser/ash/app_list/search/ranking/continue_ranker.cc index 0fe8b5c..754fe15b 100644 --- a/chrome/browser/ash/app_list/search/ranking/continue_ranker.cc +++ b/chrome/browser/ash/app_list/search/ranking/continue_ranker.cc
@@ -4,12 +4,16 @@ #include "chrome/browser/ash/app_list/search/ranking/continue_ranker.h" +#include "ash/constants/ash_features.h" #include "ash/public/cpp/app_list/app_list_types.h" #include "chrome/browser/ash/app_list/search/chrome_search_result.h" namespace app_list { -ContinueRanker::ContinueRanker() = default; +ContinueRanker::ContinueRanker() + : mix_local_and_drive_files_( + ash::features::UseMixedFileLauncherContinueSection()) {} + ContinueRanker::~ContinueRanker() = default; void ContinueRanker::UpdateResultRanks(ResultsMap& results, @@ -23,7 +27,7 @@ int continue_rank = -1; switch (provider) { case ProviderType::kZeroStateFile: - continue_rank = 1; + continue_rank = mix_local_and_drive_files_ ? 2 : 1; break; case ProviderType::kZeroStateDrive: continue_rank = 2;
diff --git a/chrome/browser/ash/app_list/search/ranking/continue_ranker.h b/chrome/browser/ash/app_list/search/ranking/continue_ranker.h index 6c825ab..83cb0d5 100644 --- a/chrome/browser/ash/app_list/search/ranking/continue_ranker.h +++ b/chrome/browser/ash/app_list/search/ranking/continue_ranker.h
@@ -21,6 +21,9 @@ // Ranker: void UpdateResultRanks(ResultsMap& results, ProviderType provider) override; + + private: + const bool mix_local_and_drive_files_; }; } // namespace app_list
diff --git a/chrome/browser/ash/app_list/search/ranking/score_normalizing_ranker.cc b/chrome/browser/ash/app_list/search/ranking/score_normalizing_ranker.cc index c905009..e1740e39 100644 --- a/chrome/browser/ash/app_list/search/ranking/score_normalizing_ranker.cc +++ b/chrome/browser/ash/app_list/search/ranking/score_normalizing_ranker.cc
@@ -23,6 +23,8 @@ case ProviderType::kAnswerCard: // Types that only ever create one result: case ProviderType::kPlayStoreReinstallApp: + case ProviderType::kZeroStateHelpApp: + case ProviderType::kDesksAdminTemplate: // Internal types: case ProviderType::kUnknown: case ProviderType::kInternalPrivacyInfo: @@ -47,12 +49,27 @@ void ScoreNormalizingRanker::UpdateResultRanks(ResultsMap& results, ProviderType provider) { - if (ShouldIgnoreProvider(provider)) + if (ShouldIgnoreProvider(provider)) { return; + } auto it = results.find(provider); DCHECK(it != results.end()); + // Skip normalization for continue section files - in continue section, files + // are either + // * scored consistently based on the file timestamps (for + // `ash::features::UseMixedFileLauncherContinueSection()`), or + // * results from one provider are always preferred over the other, so + // keeping existing scoring within the provider is sufficient. + if (provider == ProviderType::kZeroStateDrive || + provider == ProviderType::kZeroStateFile) { + for (auto& result : it->second) { + result->scoring().set_normalized_relevance(result->relevance()); + } + return; + } + std::string provider_string = ProviderToString(provider); for (auto& result : it->second) { normalizer_.Update(provider_string, result->relevance());
diff --git a/chrome/browser/ash/app_mode/kiosk_system_session.cc b/chrome/browser/ash/app_mode/kiosk_system_session.cc index 0f3d3df..9374454 100644 --- a/chrome/browser/ash/app_mode/kiosk_system_session.cc +++ b/chrome/browser/ash/app_mode/kiosk_system_session.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ash/app_mode/kiosk_system_session.h" + #include <memory> #include <optional>
diff --git a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.cc b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.cc index 6c5c9ae..df6a1ec 100644 --- a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.cc +++ b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.h" + #include <memory> #include <optional>
diff --git a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc index b7d09e1e..78c2262 100644 --- a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc +++ b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.h" + #include <sys/types.h> #include <memory>
diff --git a/chrome/browser/ash/arc/auth/arc_auth_service_browsertest.cc b/chrome/browser/ash/arc/auth/arc_auth_service_browsertest.cc index d4a032e..76292605 100644 --- a/chrome/browser/ash/arc/auth/arc_auth_service_browsertest.cc +++ b/chrome/browser/ash/arc/auth/arc_auth_service_browsertest.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/ash/arc/auth/arc_auth_service.h" + #include <memory> #include <optional> #include <string> @@ -36,7 +38,6 @@ #include "chrome/browser/ash/app_list/arc/arc_data_removal_dialog.h" #include "chrome/browser/ash/arc/arc_util.h" #include "chrome/browser/ash/arc/auth/arc_auth_context.h" -#include "chrome/browser/ash/arc/auth/arc_auth_service.h" #include "chrome/browser/ash/arc/auth/arc_background_auth_code_fetcher.h" #include "chrome/browser/ash/arc/session/arc_service_launcher.h" #include "chrome/browser/ash/arc/session/arc_session_manager.h"
diff --git a/chrome/browser/ash/arc/tracing/arc_system_model.cc b/chrome/browser/ash/arc/tracing/arc_system_model.cc index 4348978..b59d5dd 100644 --- a/chrome/browser/ash/arc/tracing/arc_system_model.cc +++ b/chrome/browser/ash/arc/tracing/arc_system_model.cc
@@ -5,7 +5,6 @@ #include "chrome/browser/ash/arc/tracing/arc_system_model.h" #include <cstdio> - #include <optional> #include <set>
diff --git a/chrome/browser/ash/attestation/machine_certificate_uploader_impl_unittest.cc b/chrome/browser/ash/attestation/machine_certificate_uploader_impl_unittest.cc index 549de5d7..63b971ed 100644 --- a/chrome/browser/ash/attestation/machine_certificate_uploader_impl_unittest.cc +++ b/chrome/browser/ash/attestation/machine_certificate_uploader_impl_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/ash/attestation/machine_certificate_uploader_impl.h" + #include <stdint.h> #include <optional> @@ -14,7 +16,6 @@ #include "base/task/single_thread_task_runner.h" #include "base/time/time.h" #include "chrome/browser/ash/attestation/attestation_key_payload.pb.h" -#include "chrome/browser/ash/attestation/machine_certificate_uploader_impl.h" #include "chrome/browser/ash/settings/scoped_cros_settings_test_helper.h" #include "chromeos/ash/components/attestation/fake_certificate.h" #include "chromeos/ash/components/attestation/mock_attestation_flow.h"
diff --git a/chrome/browser/ash/bruschetta/bruschetta_launcher.h b/chrome/browser/ash/bruschetta/bruschetta_launcher.h index ada43e4f..45f4bc9 100644 --- a/chrome/browser/ash/bruschetta/bruschetta_launcher.h +++ b/chrome/browser/ash/bruschetta/bruschetta_launcher.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/callback_list.h" #include "base/files/file.h" #include "base/functional/callback_forward.h"
diff --git a/chrome/browser/ash/bruschetta/bruschetta_network_context.cc b/chrome/browser/ash/bruschetta/bruschetta_network_context.cc index c83da704..5030cd9 100644 --- a/chrome/browser/ash/bruschetta/bruschetta_network_context.cc +++ b/chrome/browser/ash/bruschetta/bruschetta_network_context.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ash/bruschetta/bruschetta_network_context.h" #include <stdint.h> + #include <memory> #include <optional> #include <vector>
diff --git a/chrome/browser/ash/bruschetta/bruschetta_util.h b/chrome/browser/ash/bruschetta/bruschetta_util.h index 44e37e68..982ef8b 100644 --- a/chrome/browser/ash/bruschetta/bruschetta_util.h +++ b/chrome/browser/ash/bruschetta/bruschetta_util.h
@@ -5,12 +5,12 @@ #ifndef CHROME_BROWSER_ASH_BRUSCHETTA_BRUSCHETTA_UTIL_H_ #define CHROME_BROWSER_ASH_BRUSCHETTA_BRUSCHETTA_UTIL_H_ +#include <optional> + #include "base/files/file_path.h" #include "chrome/browser/ash/bruschetta/bruschetta_pref_names.h" #include "chrome/browser/ash/guest_os/guest_id.h" -#include <optional> - class Profile; namespace bruschetta {
diff --git a/chrome/browser/ash/chromebox_for_meetings/xu_camera/xu_camera_service_unittest.cc b/chrome/browser/ash/chromebox_for_meetings/xu_camera/xu_camera_service_unittest.cc index c2130bc..0a6e7b3 100644 --- a/chrome/browser/ash/chromebox_for_meetings/xu_camera/xu_camera_service_unittest.cc +++ b/chrome/browser/ash/chromebox_for_meetings/xu_camera/xu_camera_service_unittest.cc
@@ -7,6 +7,7 @@ #include <asm-generic/errno.h> #include <linux/uvcvideo.h> #include <linux/videodev2.h> + #include <cstdint> #include <optional>
diff --git a/chrome/browser/ash/crosapi/crosapi_util.cc b/chrome/browser/ash/crosapi/crosapi_util.cc index 242bc0f..a655bbad 100644 --- a/chrome/browser/ash/crosapi/crosapi_util.cc +++ b/chrome/browser/ash/crosapi/crosapi_util.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ash/crosapi/crosapi_util.h" #include <sys/mman.h> + #include <optional> #include <string>
diff --git a/chrome/browser/ash/extensions/input_method_apitest_chromeos.cc b/chrome/browser/ash/extensions/input_method_apitest_chromeos.cc index 6c8d93b7..185e416c 100644 --- a/chrome/browser/ash/extensions/input_method_apitest_chromeos.cc +++ b/chrome/browser/ash/extensions/input_method_apitest_chromeos.cc
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/extension_apitest.h" - #include <optional> #include <vector> @@ -12,6 +10,7 @@ #include "base/memory/ref_counted.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/ash/extensions/input_method_event_router.h" +#include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/ui_test_utils.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/extensions/speech/speech_recognition_private_api.cc b/chrome/browser/ash/extensions/speech/speech_recognition_private_api.cc index 94a345a..ee394c3 100644 --- a/chrome/browser/ash/extensions/speech/speech_recognition_private_api.cc +++ b/chrome/browser/ash/extensions/speech/speech_recognition_private_api.cc
@@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <string> - #include "chrome/browser/ash/extensions/speech/speech_recognition_private_api.h" #include <optional> +#include <string> #include "chrome/browser/ash/extensions/speech/speech_recognition_private_manager.h" #include "chrome/browser/speech/speech_recognition_constants.h"
diff --git a/chrome/browser/ash/file_manager/extract_io_task.cc b/chrome/browser/ash/file_manager/extract_io_task.cc index b970e08..a1d8f4b 100644 --- a/chrome/browser/ash/file_manager/extract_io_task.cc +++ b/chrome/browser/ash/file_manager/extract_io_task.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ash/file_manager/extract_io_task.h" #include <grp.h> + #include <optional> #include <utility>
diff --git a/chrome/browser/ash/file_suggest/file_suggest_util.cc b/chrome/browser/ash/file_suggest/file_suggest_util.cc index ed7f6b0..553ce0357 100644 --- a/chrome/browser/ash/file_suggest/file_suggest_util.cc +++ b/chrome/browser/ash/file_suggest/file_suggest_util.cc
@@ -38,6 +38,30 @@ kDefaultMaxRecencyInDays)); } +double ToTimestampBasedScore(const FileSuggestData& data, + base::TimeDelta max_recency) { + auto score_timestamp = [&](const base::Time& timestamp, double interval_max, + double interval_size) { + return interval_max - + interval_size * + std::min( + 1.0, + (base::Time::Now() - timestamp).magnitude().InSeconds() / + static_cast<double>(max_recency.InSeconds())); + }; + + if (data.timestamp) { + return score_timestamp(*data.timestamp, + /*interval_max=*/1.0, /*interval_size=*/0.5); + } + + if (data.secondary_timestamp) { + return score_timestamp(*data.secondary_timestamp, + /*interval_max=*/0.5, /*interval_size=*/0.5); + } + return 0.0; +} + // FileSuggestData ------------------------------------------------------------- FileSuggestData::FileSuggestData(
diff --git a/chrome/browser/ash/file_suggest/file_suggest_util.h b/chrome/browser/ash/file_suggest/file_suggest_util.h index ea13007..af6f7ab 100644 --- a/chrome/browser/ash/file_suggest/file_suggest_util.h +++ b/chrome/browser/ash/file_suggest/file_suggest_util.h
@@ -43,6 +43,11 @@ // be available as a file suggestion. base::TimeDelta GetMaxFileSuggestionRecency(); +// Creates a suggestion score in interval [0, 1] based on the suggestion +// timestamps. Assumes that the timestamps are at most `max_recency` old. +double ToTimestampBasedScore(const FileSuggestData& suggestion_data, + base::TimeDelta max_recency); + // The data of an individual file suggested by `FileSuggestKeyedService`. struct FileSuggestData { FileSuggestData(FileSuggestionType new_type,
diff --git a/chrome/browser/ash/login/enrollment/enrollment_screen_browsertest.cc b/chrome/browser/ash/login/enrollment/enrollment_screen_browsertest.cc index ccf0090..c96e5e50 100644 --- a/chrome/browser/ash/login/enrollment/enrollment_screen_browsertest.cc +++ b/chrome/browser/ash/login/enrollment/enrollment_screen_browsertest.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/ash/login/enrollment/enrollment_screen.h" + #include <optional> #include "ash/constants/ash_paths.h" @@ -11,7 +13,6 @@ #include "base/files/file_util.h" #include "base/path_service.h" #include "base/run_loop.h" -#include "chrome/browser/ash/login/enrollment/enrollment_screen.h" #include "chrome/browser/ash/login/oobe_screen.h" #include "chrome/browser/ash/login/startup_utils.h" #include "chrome/browser/ash/login/test/device_state_mixin.h"
diff --git a/chrome/browser/ash/login/osauth/auth_factor_migrator_unittest.cc b/chrome/browser/ash/login/osauth/auth_factor_migrator_unittest.cc index 6e7ebe8..6a8952a9 100644 --- a/chrome/browser/ash/login/osauth/auth_factor_migrator_unittest.cc +++ b/chrome/browser/ash/login/osauth/auth_factor_migrator_unittest.cc
@@ -3,11 +3,11 @@ // found in the LICENSE file. #include "chrome/browser/ash/login/osauth/auth_factor_migrator.h" -#include "base/functional/bind.h" #include <memory> #include <optional> +#include "base/functional/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" #include "base/test/test_future.h"
diff --git a/chrome/browser/ash/login/quick_unlock/fingerprint_storage.cc b/chrome/browser/ash/login/quick_unlock/fingerprint_storage.cc index 0a05f71..ca69ec4 100644 --- a/chrome/browser/ash/login/quick_unlock/fingerprint_storage.cc +++ b/chrome/browser/ash/login/quick_unlock/fingerprint_storage.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ash/login/quick_unlock/fingerprint_storage.h" + #include <memory> #include <optional>
diff --git a/chrome/browser/ash/login/quickstart_controller.cc b/chrome/browser/ash/login/quickstart_controller.cc index d2deb34..f6cb8346 100644 --- a/chrome/browser/ash/login/quickstart_controller.cc +++ b/chrome/browser/ash/login/quickstart_controller.cc
@@ -544,6 +544,7 @@ /*sync_trusted_vault_keys=*/std::nullopt, /*challenge_response_key=*/std::nullopt, /*user_context=*/user_context.get()); + user_context->SetAuthCode(gaia_creds_.auth_code); if (LoginDisplayHost::default_host()) { LoginDisplayHost::default_host()->CompleteLogin(*user_context);
diff --git a/chrome/browser/ash/mahi/mahi_browser_delegate_ash.cc b/chrome/browser/ash/mahi/mahi_browser_delegate_ash.cc index 8909179..97d65f5 100644 --- a/chrome/browser/ash/mahi/mahi_browser_delegate_ash.cc +++ b/chrome/browser/ash/mahi/mahi_browser_delegate_ash.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ash/mahi/mahi_browser_delegate_ash.h" + #include <optional> #include "base/check.h"
diff --git a/chrome/browser/ash/passkeys/passkey_authenticator_service_ash_unittest.cc b/chrome/browser/ash/passkeys/passkey_authenticator_service_ash_unittest.cc index b266a8b..cbe5e0ca 100644 --- a/chrome/browser/ash/passkeys/passkey_authenticator_service_ash_unittest.cc +++ b/chrome/browser/ash/passkeys/passkey_authenticator_service_ash_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/ash/passkeys/passkey_authenticator_service_ash.h" + #include <array> #include <cstdint> #include <memory> @@ -17,7 +19,6 @@ #include "base/test/task_environment.h" #include "base/test/test_future.h" #include "base/types/expected.h" -#include "chrome/browser/ash/passkeys/passkey_authenticator_service_ash.h" #include "chromeos/crosapi/mojom/passkeys.mojom.h" #include "components/signin/public/identity_manager/account_info.h" #include "components/signin/public/identity_manager/identity_test_environment.h"
diff --git a/chrome/browser/ash/platform_keys/platform_keys_service_nss.cc b/chrome/browser/ash/platform_keys/platform_keys_service_nss.cc index c04b390..06f0c64 100644 --- a/chrome/browser/ash/platform_keys/platform_keys_service_nss.cc +++ b/chrome/browser/ash/platform_keys/platform_keys_service_nss.cc
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ash/platform_keys/platform_keys_service.h" - #include <cert.h> #include <certdb.h> #include <cryptohi.h> @@ -29,6 +27,7 @@ #include "base/task/single_thread_task_runner.h" #include "base/task/thread_pool.h" #include "chrome/browser/ash/net/client_cert_store_ash.h" +#include "chrome/browser/ash/platform_keys/platform_keys_service.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part_ash.h" #include "chrome/browser/chromeos/platform_keys/platform_keys.h"
diff --git a/chrome/browser/ash/policy/core/device_attributes_browsertest.cc b/chrome/browser/ash/policy/core/device_attributes_browsertest.cc index d59c58d..134bbdc 100644 --- a/chrome/browser/ash/policy/core/device_attributes_browsertest.cc +++ b/chrome/browser/ash/policy/core/device_attributes_browsertest.cc
@@ -2,13 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ash/policy/core/device_attributes_impl.h" - -#include "base/run_loop.h" - #include <optional> +#include "base/run_loop.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" +#include "chrome/browser/ash/policy/core/device_attributes_impl.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_store_ash.h" #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h"
diff --git a/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc b/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc index 7ed1e0f..1127fb1 100644 --- a/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc +++ b/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc
@@ -2,11 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/memory/raw_ptr.h" -#include "base/time/time.h" #include "chrome/browser/ash/policy/dlp/dlp_content_manager_ash.h" -#include "content/public/browser/render_process_host.h" -#include "content/public/test/browser_test_utils.h" #include <functional> #include <memory> @@ -15,6 +11,7 @@ #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/task/sequenced_task_runner.h" #include "base/task/thread_pool/thread_pool_instance.h" @@ -22,6 +19,7 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/mock_callback.h" #include "base/test/test_future.h" +#include "base/time/time.h" #include "chrome/browser/chromeos/policy/dlp/dialogs/dlp_warn_dialog.h" #include "chrome/browser/chromeos/policy/dlp/dialogs/dlp_warn_notifier.h" #include "chrome/browser/chromeos/policy/dlp/dialogs/mock_dlp_warn_notifier.h" @@ -59,8 +57,10 @@ #include "content/public/browser/desktop_media_id.h" #include "content/public/browser/desktop_streams_registry.h" #include "content/public/browser/media_stream_request.h" +#include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test.h" +#include "content/public/test/browser_test_utils.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/mojom/mediastream/media_stream.mojom-forward.h"
diff --git a/chrome/browser/ash/policy/dlp/dlp_files_controller_ash_unittest.cc b/chrome/browser/ash/policy/dlp/dlp_files_controller_ash_unittest.cc index 66e40c6b..510e080 100644 --- a/chrome/browser/ash/policy/dlp/dlp_files_controller_ash_unittest.cc +++ b/chrome/browser/ash/policy/dlp/dlp_files_controller_ash_unittest.cc
@@ -6,6 +6,7 @@ #include <sys/stat.h> #include <sys/types.h> + #include <memory> #include <optional> #include <string>
diff --git a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc index aeaa7f0..c93ba7d 100644 --- a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc +++ b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.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/ash/policy/handlers/minimum_version_policy_handler.h" + #include <optional> #include <string> @@ -37,7 +39,6 @@ #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chrome/browser/ash/policy/core/device_policy_builder.h" #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h" -#include "chrome/browser/ash/policy/handlers/minimum_version_policy_handler.h" #include "chrome/browser/ash/policy/handlers/minimum_version_policy_handler_delegate_impl.h" #include "chrome/browser/ash/policy/handlers/minimum_version_policy_test_helpers.h" #include "chrome/browser/browser_process.h"
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/network/https_latency_events_unittest.cc b/chrome/browser/ash/policy/reporting/metrics_reporting/network/https_latency_events_unittest.cc index d69b783..3fa22d0 100644 --- a/chrome/browser/ash/policy/reporting/metrics_reporting/network/https_latency_events_unittest.cc +++ b/chrome/browser/ash/policy/reporting/metrics_reporting/network/https_latency_events_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <sys/types.h> + #include <memory> #include <optional> #include <utility>
diff --git a/chrome/browser/ash/policy/scheduled_task_handler/test/scheduled_task_util_unittest.cc b/chrome/browser/ash/policy/scheduled_task_handler/test/scheduled_task_util_unittest.cc index 31a9e6d..582ab4f 100644 --- a/chrome/browser/ash/policy/scheduled_task_handler/test/scheduled_task_util_unittest.cc +++ b/chrome/browser/ash/policy/scheduled_task_handler/test/scheduled_task_util_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ash/policy/scheduled_task_handler/scheduled_task_util.h" + #include <memory> #include <optional>
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector.cc b/chrome/browser/ash/policy/status_collector/device_status_collector.cc index 8f46f9e..8eebb14 100644 --- a/chrome/browser/ash/policy/status_collector/device_status_collector.cc +++ b/chrome/browser/ash/policy/status_collector/device_status_collector.cc
@@ -8,7 +8,6 @@ #include <stdint.h> #include <sys/types.h> #include <unistd.h> -#include <string_view> #include <algorithm> #include <cstdint> @@ -17,6 +16,7 @@ #include <optional> #include <set> #include <sstream> +#include <string_view> #include <utility> #include "ash/components/arc/mojom/enterprise_reporting.mojom.h"
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc index 373c66b..48c12f3 100644 --- a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc +++ b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ash/login/demo_mode/demo_mode_test_utils.h" #include "chrome/browser/ash/policy/status_collector/device_status_collector.h" #include <stddef.h> @@ -53,6 +52,7 @@ #include "chrome/browser/ash/crostini/crostini_test_helper.h" #include "chrome/browser/ash/guest_os/guest_os_registry_service.h" #include "chrome/browser/ash/guest_os/guest_os_registry_service_factory.h" +#include "chrome/browser/ash/login/demo_mode/demo_mode_test_utils.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/ownership/fake_owner_settings_service.h" #include "chrome/browser/ash/policy/core/device_local_account.h"
diff --git a/chrome/browser/ash/printing/cups_print_job_manager_impl.cc b/chrome/browser/ash/printing/cups_print_job_manager_impl.cc index 1e8849de..70d674c 100644 --- a/chrome/browser/ash/printing/cups_print_job_manager_impl.cc +++ b/chrome/browser/ash/printing/cups_print_job_manager_impl.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 "chrome/browser/ash/printing/cups_print_job_manager.h" - #include <cups/cups.h> + #include <optional> #include <set> #include <string> @@ -24,6 +23,7 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "chrome/browser/ash/printing/cups_print_job.h" +#include "chrome/browser/ash/printing/cups_print_job_manager.h" #include "chrome/browser/ash/printing/cups_print_job_manager_utils.h" #include "chrome/browser/ash/printing/cups_printers_manager.h" #include "chrome/browser/ash/printing/cups_printers_manager_factory.h"
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_base.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_base.cc index 62641b0..6575befa 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_base.cc +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_base.cc
@@ -14,6 +14,7 @@ #include "ash/controls/contextual_tooltip.h" #include "ash/public/cpp/image_util.h" #include "ash/wallpaper/wallpaper_constants.h" +#include "ash/wallpaper/wallpaper_utils/sea_pen_metadata_utils.h" #include "ash/wallpaper/wallpaper_utils/wallpaper_resizer.h" #include "ash/webui/common/mojom/sea_pen.mojom-forward.h" #include "ash/webui/common/mojom/sea_pen.mojom.h" @@ -151,7 +152,7 @@ GetRecentSeaPenImageThumbnailCallback callback) { if (recent_sea_pen_image_ids_.count(id) == 0) { LOG(ERROR) << __func__ << " Invalid sea pen image received"; - std::move(callback).Run(GURL()); + std::move(callback).Run(nullptr); return; } @@ -217,16 +218,36 @@ void PersonalizationAppSeaPenProviderBase::OnGetRecentSeaPenImageThumbnail( GetRecentSeaPenImageThumbnailCallback callback, - const gfx::ImageSkia& image) { + const gfx::ImageSkia& image, + std::optional<base::Value::Dict> sea_pen_metadata) { if (image.isNull()) { - // Do not call |mojom::ReportBadMessage| here. The message is valid, but - // the jpeg file may be corrupt or unreadable. - std::move(callback).Run(GURL()); + DVLOG(1) << __func__ << " failed to decode image"; + std::move(callback).Run(nullptr); return; } - std::move(callback).Run(GURL(webui::GetBitmapDataUrl( + + auto thumbnail_url = GURL(webui::GetBitmapDataUrl( *WallpaperResizer::GetResizedImage(image, kSeaPenImageThumbnailSizeDip) - .bitmap()))); + .bitmap())); + + if (!sea_pen_metadata.has_value()) { + DVLOG(1) << __func__ << " the extracted metadata is not in JSON format"; + std::move(callback).Run(mojom::RecentSeaPenThumbnailData::New( + std::move(thumbnail_url), nullptr)); + return; + } + + auto sea_pen_image_info = + ash::SeaPenQueryDictToRecentImageInfo(std::move(*sea_pen_metadata)); + if (!sea_pen_image_info) { + DVLOG(1) << __func__ << " invalid extracted metadata"; + std::move(callback).Run(mojom::RecentSeaPenThumbnailData::New( + std::move(thumbnail_url), nullptr)); + return; + } + + std::move(callback).Run(mojom::RecentSeaPenThumbnailData::New( + std::move(thumbnail_url), std::move(sea_pen_image_info))); } void PersonalizationAppSeaPenProviderBase::OpenFeedbackDialog(
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_base.h b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_base.h index 8e1d0bf..f89f024d 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_base.h +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_base.h
@@ -13,6 +13,7 @@ #include "ash/webui/common/sea_pen_provider.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" +#include "base/values.h" #include "components/manta/manta_status.h" #include "components/manta/proto/manta.pb.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -31,7 +32,9 @@ namespace ash::personalization_app { -using DecodeImageCallback = base::OnceCallback<void(const gfx::ImageSkia&)>; +using DecodeImageCallback = + base::OnceCallback<void(const gfx::ImageSkia&, + std::optional<base::Value::Dict> sea_pen_metadata)>; // Base class for PersonalizationApp and VcBackground SeaPen providers. // The public functions are the interface required for both PersonalizationApp @@ -127,7 +130,8 @@ void OnGetRecentSeaPenImageThumbnail( GetRecentSeaPenImageThumbnailCallback callback, - const gfx::ImageSkia& image); + const gfx::ImageSkia& image, + std::optional<base::Value::Dict> sea_pen_metadata); SelectRecentSeaPenImageCallback pending_select_recent_sea_pen_image_callback_;
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl.cc index 833eebe..50b205af 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl.cc +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl.cc
@@ -78,11 +78,23 @@ void PersonalizationAppSeaPenProviderImpl:: GetRecentSeaPenImageThumbnailInternal(uint32_t id, DecodeImageCallback callback) { - // TODO(b/324297539) move file loading to SeaPenWallpaperManager. - image_util::DecodeImageFile(std::move(callback), - GetSeaPenDir(GetAccountId(profile_)) - .Append(base::NumberToString(id)) - .AddExtension(".jpg")); + image_util::DecodeImageFile( + base::BindOnce( + &PersonalizationAppSeaPenProviderImpl::GetRecentSeaPenImageInfo, + weak_ptr_factory_.GetWeakPtr(), id, std::move(callback)), + GetSeaPenDir(GetAccountId(profile_)) + .Append(base::NumberToString(id)) + .AddExtension(".jpg")); +} + +void PersonalizationAppSeaPenProviderImpl::GetRecentSeaPenImageInfo( + uint32_t id, + DecodeImageCallback callback, + const gfx::ImageSkia& image) { + ash::WallpaperController* wallpaper_controller = WallpaperController::Get(); + DCHECK(wallpaper_controller); + wallpaper_controller->GetSeaPenMetadata( + GetAccountId(profile_), id, base::BindOnce(std::move(callback), image)); } void PersonalizationAppSeaPenProviderImpl::DeleteRecentSeaPenImage(
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl.h b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl.h index 493f75d..300b585f 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl.h +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl.h
@@ -9,6 +9,7 @@ #include "ash/public/cpp/wallpaper/sea_pen_image.h" #include "ash/webui/common/mojom/sea_pen.mojom-forward.h" +#include "base/files/file_path.h" #include "chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_base.h" #include "mojo/public/cpp/bindings/pending_receiver.h" @@ -55,10 +56,17 @@ uint32_t id, DecodeImageCallback callback) override; + void GetRecentSeaPenImageInfo(uint32_t id, + DecodeImageCallback callback, + const gfx::ImageSkia& image); + void OnFetchWallpaperDoneInternal( const SeaPenImage& sea_pen_image, const mojom::SeaPenQueryPtr& query, base::OnceCallback<void(bool success)> callback) override; + + base::WeakPtrFactory<PersonalizationAppSeaPenProviderImpl> weak_ptr_factory_{ + this}; }; } // namespace ash::personalization_app
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl_unittest.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl_unittest.cc index 635fd79..373b125 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl_unittest.cc +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl_unittest.cc
@@ -12,18 +12,22 @@ #include <vector> #include "ash/constants/ash_features.h" +#include "ash/public/cpp/test/in_process_data_decoder.h" #include "ash/webui/common/mojom/sea_pen.mojom.h" #include "base/containers/flat_map.h" #include "base/files/file_path.h" #include "base/files/file_util.h" +#include "base/i18n/rtl.h" #include "base/json/json_writer.h" #include "base/json/values_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" +#include "base/test/icu_test_util.h" #include "base/test/scoped_feature_list.h" #include "base/test/scoped_path_override.h" #include "base/test/test_future.h" +#include "base/time/time.h" #include "base/time/time_override.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_utils.h" @@ -48,6 +52,8 @@ #include "mojo/public/cpp/test_support/test_utils.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "ui/gfx/codec/jpeg_codec.h" namespace ash::personalization_app { @@ -61,6 +67,23 @@ constexpr char kTestGaiaId2[] = "9876543210"; constexpr char kGooglerEmail[] = "user@google.com"; constexpr char kGooglerGaiaId[] = "123459876"; +constexpr uint32_t kSeaPenId1 = 111; +constexpr uint32_t kSeaPenId2 = 222; + +SkBitmap CreateBitmap() { + SkBitmap bitmap; + bitmap.allocN32Pixels(1, 1); + bitmap.eraseARGB(255, 31, 63, 127); + return bitmap; +} + +// Create fake Jpg image bytes. +std::string CreateJpgBytes() { + SkBitmap bitmap = CreateBitmap(); + std::vector<unsigned char> data; + gfx::JPEGCodec::Encode(bitmap, /*quality=*/100, &data); + return std::string(data.begin(), data.end()); +} // Repeat `string_view` until the output is size `target_size` or as close as // possible to `target_size` without being longer. @@ -163,6 +186,7 @@ testing::Test::SetUp(); ASSERT_TRUE(profile_manager_.SetUp()); + ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); } // Set up the profile for an account. This can be used to set up the profile @@ -201,6 +225,30 @@ TestingProfile* profile() { return profile_; } + const base::FilePath& GetTempFileDirectory() { + return scoped_temp_dir_.GetPath(); + } + + base::FilePath GetSeaPenFileDirectory(const AccountId& account_id) { + return GetTempFileDirectory().Append("sea_pen").Append( + account_id.GetAccountIdKey()); + } + + void CreateSeaPenFilesForTesting( + const AccountId& account_id, + std::vector<uint32_t> sea_pen_ids, + const std::string& file_content = CreateJpgBytes()) { + base::FilePath sea_pen_dir = GetSeaPenFileDirectory(account_id); + ASSERT_TRUE(base::CreateDirectory(sea_pen_dir)); + + for (const uint32_t& sea_pen_id : sea_pen_ids) { + base::FilePath sea_pen_file_path = + sea_pen_dir.Append(base::NumberToString(sea_pen_id)) + .AddExtension(".jpg"); + ASSERT_TRUE(base::WriteFile(sea_pen_file_path, file_content)); + } + } + private: void AddProfile(const std::string& name, user_manager::UserType user_type) { switch (user_type) { @@ -224,9 +272,11 @@ } base::test::ScopedFeatureList scoped_feature_list_; + base::ScopedTempDir scoped_temp_dir_; content::BrowserTaskEnvironment task_environment_; TestWallpaperController test_wallpaper_controller_; content::TestWebUI web_ui_; + InProcessDataDecoder in_process_data_decoder_; user_manager::ScopedUserManager scoped_user_manager_; TestingProfileManager profile_manager_; raw_ptr<TestingProfile> profile_; @@ -368,26 +418,14 @@ TEST_F(PersonalizationAppSeaPenProviderImplTest, GetRecentSeaPenImages) { SetUpProfileForTesting(kFakeTestEmail, GetTestAccountId()); - base::ScopedTempDir scoped_temp_dir; - ASSERT_TRUE(scoped_temp_dir.CreateUniqueTempDir()); + auto chromeos_wallpaper_dir_override_ = std::make_unique<base::ScopedPathOverride>( - chrome::DIR_CHROMEOS_WALLPAPERS, scoped_temp_dir.GetPath()); + chrome::DIR_CHROMEOS_WALLPAPERS, GetTempFileDirectory()); - base::FilePath sea_pen_dir1 = - scoped_temp_dir.GetPath().Append("sea_pen").Append( - GetTestAccountId().GetAccountIdKey()); - ASSERT_TRUE(base::CreateDirectory(sea_pen_dir1)); - uint32_t sea_pen_id_1 = 111; - base::FilePath sea_pen_file_path_1 = - sea_pen_dir1.Append(base::NumberToString(sea_pen_id_1)) - .AddExtension(".jpg"); - ASSERT_TRUE(base::WriteFile(sea_pen_file_path_1, "test image 1")); - uint32_t sea_pen_id_2 = 222; - base::FilePath sea_pen_file_path_2 = - sea_pen_dir1.Append(base::NumberToString(sea_pen_id_2)) - .AddExtension(".jpg"); - ASSERT_TRUE(base::WriteFile(sea_pen_file_path_2, "test image 2")); + // Create two images in the Sea Pen directory for the 1st user, then get the + // list of the recent images. + CreateSeaPenFilesForTesting(GetTestAccountId(), {kSeaPenId1, kSeaPenId2}); base::test::TestFuture<const std::vector<uint32_t>&> recent_images_future; sea_pen_provider_remote()->GetRecentSeaPenImages( @@ -395,33 +433,24 @@ std::vector<uint32_t> recent_images = recent_images_future.Take(); EXPECT_THAT(recent_images, - testing::UnorderedElementsAre(sea_pen_id_1, sea_pen_id_2)); + testing::UnorderedElementsAre(kSeaPenId1, kSeaPenId2)); // Log in the second user, get the list of recent images. SetUpProfileForTesting(kFakeTestEmail2, GetTestAccountId2()); + sea_pen_provider_remote()->GetRecentSeaPenImages( recent_images_future.GetCallback()); ASSERT_EQ(0u, recent_images_future.Take().size()); - // The images still exist in first user's folder. - ASSERT_TRUE(base::PathExists(sea_pen_file_path_1)); - ASSERT_TRUE(base::PathExists(sea_pen_file_path_2)); // Create an image in the Sea Pen directory for second user, then get the list // of recent images again. - base::FilePath sea_pen_dir2 = - scoped_temp_dir.GetPath().Append("sea_pen").Append( - GetTestAccountId2().GetAccountIdKey()); - ASSERT_TRUE(base::CreateDirectory(sea_pen_dir2)); - uint32_t sea_pen_id_3 = 111; - base::FilePath sea_pen_file_path_3 = - sea_pen_dir2.Append(base::NumberToString(111)).AddExtension(".jpg"); - ASSERT_TRUE(base::WriteFile(sea_pen_file_path_3, "test image 3")); + CreateSeaPenFilesForTesting(GetTestAccountId2(), {kSeaPenId1}); sea_pen_provider_remote()->GetRecentSeaPenImages( recent_images_future.GetCallback()); recent_images = recent_images_future.Take(); EXPECT_THAT(recent_images, - testing::ContainerEq(std::vector<uint32_t>({sea_pen_id_3}))); + testing::ContainerEq(std::vector<uint32_t>({kSeaPenId1}))); } TEST_F(PersonalizationAppSeaPenProviderImplTest, @@ -499,6 +528,165 @@ } TEST_F(PersonalizationAppSeaPenProviderImplTest, + GetRecentSeaPenImageThumbnailWithValidMetadata) { + SetUpProfileForTesting(kFakeTestEmail, GetTestAccountId()); + const base::test::ScopedRestoreICUDefaultLocale locale("en_US"); + const base::test::ScopedRestoreDefaultTimezone la_time("America/Los_Angeles"); + + auto chromeos_wallpaper_dir_override_ = + std::make_unique<base::ScopedPathOverride>( + chrome::DIR_CHROMEOS_WALLPAPERS, GetTempFileDirectory()); + + CreateSeaPenFilesForTesting(GetTestAccountId(), {kSeaPenId1}); + + base::test::TestFuture<const std::vector<uint32_t>&> recent_images_future; + sea_pen_provider_remote()->GetRecentSeaPenImages( + recent_images_future.GetCallback()); + + std::vector<uint32_t> recent_images = recent_images_future.Take(); + EXPECT_THAT(recent_images, + testing::ContainerEq(std::vector<uint32_t>({kSeaPenId1}))); + + test_wallpaper_controller()->set_sea_pen_metadata( + /*metadata=*/R"({"creation_time":"13349580387513653", + "user_visible_query_text":"test template query", + "user_visible_query_template":"test template title", + "options":{"4":"55","5":"64"},"template_id":"2"})"); + + base::test::TestFuture<mojom::RecentSeaPenThumbnailDataPtr> + thumbnail_info_future; + sea_pen_provider_remote()->GetRecentSeaPenImageThumbnail( + recent_images[0], thumbnail_info_future.GetCallback()); + + GURL url(thumbnail_info_future.Get()->url); + EXPECT_FALSE(url.is_empty()); + EXPECT_EQ(u"Jan 12, 2024", + thumbnail_info_future.Get()->image_info->creation_time); + EXPECT_TRUE( + thumbnail_info_future.Get()->image_info->user_visible_query.Equals( + mojom::SeaPenUserVisibleQuery::New("test template query", + "test template title"))); +} + +TEST_F(PersonalizationAppSeaPenProviderImplTest, + GetRecentSeaPenImageThumbnailWithInvalidFilePath) { + SetUpProfileForTesting(kFakeTestEmail, GetTestAccountId()); + + auto chromeos_wallpaper_dir_override_ = + std::make_unique<base::ScopedPathOverride>( + chrome::DIR_CHROMEOS_WALLPAPERS, GetTempFileDirectory()); + + CreateSeaPenFilesForTesting(GetTestAccountId(), {kSeaPenId1}); + + base::test::TestFuture<const std::vector<uint32_t>&> recent_images_future; + sea_pen_provider_remote()->GetRecentSeaPenImages( + recent_images_future.GetCallback()); + + std::vector<uint32_t> recent_images = recent_images_future.Take(); + EXPECT_THAT(recent_images, + testing::ContainerEq(std::vector<uint32_t>({kSeaPenId1}))); + + base::test::TestFuture<mojom::RecentSeaPenThumbnailDataPtr> + thumbnail_info_future; + // Try to get thumbnail data for an invalid Sea Pen id (not in the + // `recent_images` list). + sea_pen_provider_remote()->GetRecentSeaPenImageThumbnail( + 333, thumbnail_info_future.GetCallback()); + + EXPECT_FALSE(thumbnail_info_future.Take()); +} + +TEST_F(PersonalizationAppSeaPenProviderImplTest, + GetRecentSeaPenImageThumbnailWithDecodingFailure) { + SetUpProfileForTesting(kFakeTestEmail, GetTestAccountId()); + + auto chromeos_wallpaper_dir_override_ = + std::make_unique<base::ScopedPathOverride>( + chrome::DIR_CHROMEOS_WALLPAPERS, GetTempFileDirectory()); + + CreateSeaPenFilesForTesting(GetTestAccountId(), {kSeaPenId1}, + "invalid image data"); + + base::test::TestFuture<const std::vector<uint32_t>&> recent_images_future; + sea_pen_provider_remote()->GetRecentSeaPenImages( + recent_images_future.GetCallback()); + + std::vector<uint32_t> recent_images = recent_images_future.Take(); + EXPECT_THAT(recent_images, + testing::ContainerEq(std::vector<uint32_t>({kSeaPenId1}))); + + base::test::TestFuture<mojom::RecentSeaPenThumbnailDataPtr> + thumbnail_info_future; + // Try to get thumbnail data for an invalid file path. + sea_pen_provider_remote()->GetRecentSeaPenImageThumbnail( + recent_images[0], thumbnail_info_future.GetCallback()); + + EXPECT_FALSE(thumbnail_info_future.Take()); +} + +TEST_F(PersonalizationAppSeaPenProviderImplTest, + GetRecentSeaPenImageThumbnailWithInvalidFormatMetadata) { + SetUpProfileForTesting(kFakeTestEmail, GetTestAccountId()); + + auto chromeos_wallpaper_dir_override_ = + std::make_unique<base::ScopedPathOverride>( + chrome::DIR_CHROMEOS_WALLPAPERS, GetTempFileDirectory()); + + CreateSeaPenFilesForTesting(GetTestAccountId(), {kSeaPenId1}); + + base::test::TestFuture<const std::vector<uint32_t>&> recent_images_future; + sea_pen_provider_remote()->GetRecentSeaPenImages( + recent_images_future.GetCallback()); + + std::vector<uint32_t> recent_images = recent_images_future.Take(); + EXPECT_THAT(recent_images, + testing::ContainerEq(std::vector<uint32_t>({kSeaPenId1}))); + + test_wallpaper_controller()->set_sea_pen_metadata( + /*metadata=*/"invalid format metadata"); + + base::test::TestFuture<mojom::RecentSeaPenThumbnailDataPtr> + thumbnail_info_future; + sea_pen_provider_remote()->GetRecentSeaPenImageThumbnail( + recent_images[0], thumbnail_info_future.GetCallback()); + + GURL url(thumbnail_info_future.Get()->url); + EXPECT_FALSE(url.is_empty()); + EXPECT_FALSE(thumbnail_info_future.Get()->image_info); +} + +TEST_F(PersonalizationAppSeaPenProviderImplTest, + GetRecentSeaPenImageThumbnailWithMissingFieldMetadata) { + SetUpProfileForTesting(kFakeTestEmail, GetTestAccountId()); + + auto chromeos_wallpaper_dir_override_ = + std::make_unique<base::ScopedPathOverride>( + chrome::DIR_CHROMEOS_WALLPAPERS, GetTempFileDirectory()); + + CreateSeaPenFilesForTesting(GetTestAccountId(), {kSeaPenId1}); + + base::test::TestFuture<const std::vector<uint32_t>&> recent_images_future; + sea_pen_provider_remote()->GetRecentSeaPenImages( + recent_images_future.GetCallback()); + + std::vector<uint32_t> recent_images = recent_images_future.Take(); + EXPECT_THAT(recent_images, + testing::ContainerEq(std::vector<uint32_t>({kSeaPenId1}))); + + test_wallpaper_controller()->set_sea_pen_metadata( + /*metadata=*/R"({"creation_time":"13349580387513653"})"); + + base::test::TestFuture<mojom::RecentSeaPenThumbnailDataPtr> + thumbnail_info_future; + sea_pen_provider_remote()->GetRecentSeaPenImageThumbnail( + recent_images[0], thumbnail_info_future.GetCallback()); + + GURL url(thumbnail_info_future.Get()->url); + EXPECT_FALSE(url.is_empty()); + EXPECT_FALSE(thumbnail_info_future.Get()->image_info); +} + +TEST_F(PersonalizationAppSeaPenProviderImplTest, ShouldShowSeaPenTermsOfServiceDialog) { SetUpProfileForTesting(kFakeTestEmail, GetTestAccountId()); test_wallpaper_controller()->ClearCounts();
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl.h b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl.h index 04b9f40a..790536882 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl.h +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl.h
@@ -5,8 +5,6 @@ #ifndef CHROME_BROWSER_ASH_SYSTEM_WEB_APPS_APPS_PERSONALIZATION_APP_PERSONALIZATION_APP_WALLPAPER_PROVIDER_IMPL_H_ #define CHROME_BROWSER_ASH_SYSTEM_WEB_APPS_APPS_PERSONALIZATION_APP_PERSONALIZATION_APP_WALLPAPER_PROVIDER_IMPL_H_ -#include "ash/webui/personalization_app/personalization_app_wallpaper_provider.h" - #include <stdint.h> #include <memory> @@ -20,6 +18,7 @@ #include "ash/public/cpp/wallpaper/wallpaper_info.h" #include "ash/public/cpp/wallpaper/wallpaper_types.h" #include "ash/webui/personalization_app/mojom/personalization_app.mojom.h" +#include "ash/webui/personalization_app/personalization_app_wallpaper_provider.h" #include "base/files/file.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h"
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc index a1328ea..3ae5a501 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc
@@ -407,6 +407,11 @@ TEST_F(PersonalizationAppWallpaperProviderImplTest, SendsSeaPenWallpaperFromFile) { SetWallpaperObserver(); + test_wallpaper_controller()->set_sea_pen_metadata( + /*metadata=*/R"({"creation_time":"13349580387513653", + "user_visible_query_text":"test template query", + "user_visible_query_template":"test template title", + "options":{"4":"55","5":"64"},"template_id":"2"})"); test_wallpaper_controller()->SetSeaPenWallpaperFromFile( GetTestAccountId(), 111u, base::DoNothing());
diff --git a/chrome/browser/ash/system_web_apps/apps/vc_background_ui/vc_background_ui_sea_pen_provider_impl.cc b/chrome/browser/ash/system_web_apps/apps/vc_background_ui/vc_background_ui_sea_pen_provider_impl.cc index 33ac8413..0389066 100644 --- a/chrome/browser/ash/system_web_apps/apps/vc_background_ui/vc_background_ui_sea_pen_provider_impl.cc +++ b/chrome/browser/ash/system_web_apps/apps/vc_background_ui/vc_background_ui_sea_pen_provider_impl.cc
@@ -32,7 +32,7 @@ personalization_app::DecodeImageCallback callback, const std::optional<CameraEffectsController::BackgroundImageInfo>& info) { if (!info.has_value()) { - std::move(callback).Run(gfx::ImageSkia()); + std::move(callback).Run(gfx::ImageSkia(), base::Value::Dict()); return; } @@ -43,7 +43,8 @@ auto image = gfx::ImageSkia::CreateFrom1xBitmap(*bitmap); - std::move(callback).Run(image); + // TODO(b/325393647): update the value for sea_pen_metadata param. + std::move(callback).Run(image, /*sea_pen_metadata=*/base::Value::Dict()); } } // namespace
diff --git a/chrome/browser/ash/system_web_apps/apps/vc_background_ui/vc_background_ui_sea_pen_provider_impl_browsertest.cc b/chrome/browser/ash/system_web_apps/apps/vc_background_ui/vc_background_ui_sea_pen_provider_impl_browsertest.cc index ef23f8b..9296355 100644 --- a/chrome/browser/ash/system_web_apps/apps/vc_background_ui/vc_background_ui_sea_pen_provider_impl_browsertest.cc +++ b/chrome/browser/ash/system_web_apps/apps/vc_background_ui/vc_background_ui_sea_pen_provider_impl_browsertest.cc
@@ -141,10 +141,12 @@ base::RunLoop run_loop3; sea_pen_provider_->GetRecentSeaPenImageThumbnail( existing_image_ids_[0], - base::BindLambdaForTesting([&](const ::GURL& url) { - EXPECT_FALSE(url.is_empty()); - run_loop3.Quit(); - })); + base::BindLambdaForTesting( + [&](personalization_app::mojom::RecentSeaPenThumbnailDataPtr + thumbnail_data) { + EXPECT_FALSE(thumbnail_data->url.is_empty()); + run_loop3.Quit(); + })); run_loop3.Run(); @@ -170,14 +172,16 @@ })); run_loop5.Run(); - // Get content of an deleted image should return empty + // Get content of an deleted image should return nullptr. base::RunLoop run_loop6; sea_pen_provider_->GetRecentSeaPenImageThumbnail( existing_image_ids_[1], - base::BindLambdaForTesting([&](const ::GURL& url) { - EXPECT_TRUE(url.is_empty()); - run_loop6.Quit(); - })); + base::BindLambdaForTesting( + [&](personalization_app::mojom::RecentSeaPenThumbnailDataPtr + thumbnail_data) { + EXPECT_FALSE(thumbnail_data); + run_loop6.Quit(); + })); run_loop6.Run(); }
diff --git a/chrome/browser/banners/android/java/src/org/chromium/chrome/browser/banners/AppBannerInProductHelpController.java b/chrome/browser/banners/android/java/src/org/chromium/chrome/browser/banners/AppBannerInProductHelpController.java index 622f081..ad50fa8 100644 --- a/chrome/browser/banners/android/java/src/org/chromium/chrome/browser/banners/AppBannerInProductHelpController.java +++ b/chrome/browser/banners/android/java/src/org/chromium/chrome/browser/banners/AppBannerInProductHelpController.java
@@ -12,6 +12,7 @@ import org.chromium.base.UnownedUserData; import org.chromium.base.supplier.Supplier; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; import org.chromium.chrome.browser.user_education.IPHCommandBuilder; import org.chromium.chrome.browser.user_education.UserEducationHelper; @@ -30,12 +31,14 @@ * Constructs an AppBannerInProductHelpController. * * @param activity The current activity. + * @param profile The current profile. * @param appMenuHandler The app menu containing the menu entry to highlight. * @param menuButtonView The menu button view to anchor the bubble to. * @param higlightMenuItemId The id of the menu item to highlight. */ public AppBannerInProductHelpController( Activity activity, + Profile profile, AppMenuHandler appMenuHandler, Supplier<View> menuButtonView, @IdRes int higlightMenuItemId) { @@ -43,7 +46,7 @@ mAppMenuHandler = appMenuHandler; mMenuButtonView = menuButtonView; mHiglightMenuItemId = higlightMenuItemId; - mUserEducationHelper = new UserEducationHelper(mActivity, mHandler); + mUserEducationHelper = new UserEducationHelper(mActivity, profile, mHandler); } /** Makes an asynchronous request to show the in-product help, anchored to app menu. */
diff --git a/chrome/browser/banners/android/java/src/org/chromium/chrome/browser/banners/AppBannerInProductHelpControllerFactory.java b/chrome/browser/banners/android/java/src/org/chromium/chrome/browser/banners/AppBannerInProductHelpControllerFactory.java index a2a7286..9884e95 100644 --- a/chrome/browser/banners/android/java/src/org/chromium/chrome/browser/banners/AppBannerInProductHelpControllerFactory.java +++ b/chrome/browser/banners/android/java/src/org/chromium/chrome/browser/banners/AppBannerInProductHelpControllerFactory.java
@@ -10,6 +10,7 @@ import androidx.annotation.IdRes; import org.chromium.base.supplier.Supplier; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; import org.chromium.ui.base.WindowAndroid; @@ -17,11 +18,12 @@ public class AppBannerInProductHelpControllerFactory { public static AppBannerInProductHelpController createAppBannerInProductHelpController( Activity activity, + Profile profile, AppMenuHandler appMenuHandler, Supplier<View> menuButtonView, @IdRes int higlightMenuItemId) { return new AppBannerInProductHelpController( - activity, appMenuHandler, menuButtonView, higlightMenuItemId); + activity, profile, appMenuHandler, menuButtonView, higlightMenuItemId); } public static void attach(
diff --git a/chrome/browser/banners/app_banner_manager_browsertest.cc b/chrome/browser/banners/app_banner_manager_browsertest.cc index c53a7504..9723902 100644 --- a/chrome/browser/banners/app_banner_manager_browsertest.cc +++ b/chrome/browser/banners/app_banner_manager_browsertest.cc
@@ -29,6 +29,8 @@ #include "components/site_engagement/content/site_engagement_service.h" #include "components/webapps/browser/banners/app_banner_metrics.h" #include "components/webapps/browser/banners/app_banner_settings_helper.h" +#include "components/webapps/browser/banners/installable_web_app_check_result.h" +#include "components/webapps/browser/banners/web_app_banner_data.h" #include "components/webapps/browser/features.h" #include "components/webapps/browser/installable/installable_data.h" #include "components/webapps/browser/installable/installable_logging.h" @@ -48,6 +50,7 @@ #include "net/test/embedded_test_server/embedded_test_server.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/features.h" +#include "third_party/blink/public/common/manifest/manifest_util.h" #if !BUILDFLAG(IS_ANDROID) #include "chrome/browser/ui/browser.h" #endif @@ -262,8 +265,9 @@ if (is_off_the_record || !expected_code_for_histogram) { histograms.ExpectTotalCount(kInstallableStatusCodeHistogram, 0); } else { - histograms.ExpectUniqueSample(kInstallableStatusCodeHistogram, - *expected_code_for_histogram, 1); + EXPECT_THAT(histograms.GetAllSamples(kInstallableStatusCodeHistogram), + base::BucketsAre(base::Bucket( + expected_code_for_histogram.value(), /*count=*/1))); } } @@ -345,7 +349,10 @@ manager.get(), base::BindLambdaForTesting([&]() { EXPECT_TRUE(content::ExecJs(web_contents(), "addManifestLinkTag()")); }), - false, AppBannerManager::State::PENDING_PROMPT_NOT_CANCELED); + /*expected_will_show=*/false, std::nullopt); + TriggerBannerFlow(manager.get(), base::DoNothing(), + /*expected_will_show=*/false, + AppBannerManager::State::PENDING_PROMPT_NOT_CANCELED); histograms.ExpectTotalCount(kInstallableStatusCodeHistogram, 0); } @@ -368,7 +375,7 @@ false, AppBannerManager::State::COMPLETE); histograms.ExpectTotalCount(kInstallableStatusCodeHistogram, 1); histograms.ExpectUniqueSample(kInstallableStatusCodeHistogram, - InstallableStatusCode::RENDERER_CANCELLED, 1); + InstallableStatusCode::NO_MANIFEST, 1); } IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, @@ -385,7 +392,7 @@ AppBannerManager::State::PENDING_PROMPT_NOT_CANCELED); // Dynamically change the manifest, which results in a - // Stop(RENDERER_CANCELLED), and a restart of the pipeline. + // Stop(MANIFEST_URL_CHANGED), and a restart of the pipeline. { base::HistogramTester histograms; // Note - The state of the appbannermanager here will be racy, so don't @@ -399,7 +406,8 @@ false, std::nullopt); histograms.ExpectTotalCount(kInstallableStatusCodeHistogram, 1); histograms.ExpectUniqueSample(kInstallableStatusCodeHistogram, - InstallableStatusCode::RENDERER_CANCELLED, 1); + InstallableStatusCode::MANIFEST_URL_CHANGED, + 1); } // The pipeline should either have completed, or it is scheduled in the // background. Wait for the next prompt request if so. @@ -415,27 +423,39 @@ AppBannerManager::State::PENDING_PROMPT_NOT_CANCELED); } -IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, NoManifest) { +IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, + NoPageManifestProvidesDefaultManifest) { std::unique_ptr<AppBannerManagerTest> manager(CreateAppBannerManager()); - RunBannerTest( - web_contents(), manager.get(), - embedded_test_server()->GetURL("/banners/no_manifest_test_page.html"), - InstallableStatusCode::NO_MANIFEST); + GURL page_url = + embedded_test_server()->GetURL("/banners/no_manifest_test_page.html"); + RunBannerTest(web_contents(), manager.get(), page_url, + InstallableStatusCode::NO_MANIFEST); + std::optional<WebAppBannerData> banner = + manager->GetCurrentWebAppBannerData(); + // Check the default manifest was populated. + ASSERT_TRUE(banner); + EXPECT_TRUE(blink::IsDefaultManifest(banner->manifest(), page_url)); } IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, MissingManifest) { std::unique_ptr<AppBannerManagerTest> manager(CreateAppBannerManager()); RunBannerTest(web_contents(), manager.get(), GetBannerURLWithManifest("/banners/manifest_missing.json"), - InstallableStatusCode::MANIFEST_EMPTY); + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR); } IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, WebAppBannerInIFrame) { std::unique_ptr<AppBannerManagerTest> manager(CreateAppBannerManager()); - RunBannerTest( - web_contents(), manager.get(), - embedded_test_server()->GetURL("/banners/iframe_test_page.html"), - InstallableStatusCode::NO_MANIFEST); + GURL url = embedded_test_server()->GetURL("/banners/iframe_test_page.html"); + RunBannerTest(web_contents(), manager.get(), url, + InstallableStatusCode::NO_MANIFEST); + EXPECT_EQ(manager->GetInstallableWebAppCheckResult(), + webapps::InstallableWebAppCheckResult::kNo); + // The banner will be the default one for the current page. + std::optional<WebAppBannerData> banner = + manager->GetCurrentWebAppBannerData(); + ASSERT_TRUE(banner); + EXPECT_TRUE(blink::IsDefaultManifest(banner->manifest(), url)); } #if !BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browser/bookmarks/android/bookmark_bridge.cc index fcd4bad..e71609e 100644 --- a/chrome/browser/bookmarks/android/bookmark_bridge.cc +++ b/chrome/browser/bookmarks/android/bookmark_bridge.cc
@@ -197,7 +197,6 @@ CHECK(partner_bookmarks_shim); // TODO(crbug.com/1503231): CHECK image_service once a mock is available. CHECK(dual_reading_list_model); - CHECK(identity_manager); profile_observation_.Observe(profile_); bookmark_model_observation_.Observe(bookmark_model_); @@ -205,7 +204,9 @@ reading_list_manager_observations_.AddObservation( local_or_syncable_reading_list_manager_.get()); dual_reading_list_model_observation_.Observe(dual_reading_list_model_); - identity_manager_observation_.Observe(identity_manager_); + if (identity_manager_) { + identity_manager_observation_.Observe(identity_manager_); + } pref_change_registrar_.Init(profile_->GetPrefs()); pref_change_registrar_.Add(
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 8c49ecc..40958a6 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ #include <stddef.h> + #include <memory> #include <optional> #include <set>
diff --git a/chrome/browser/compose/chrome_compose_client.cc b/chrome/browser/compose/chrome_compose_client.cc index 686d86ee..7da8f5aa 100644 --- a/chrome/browser/compose/chrome_compose_client.cc +++ b/chrome/browser/compose/chrome_compose_client.cc
@@ -37,7 +37,6 @@ #include "components/autofill/content/browser/content_autofill_driver_factory.h" #include "components/autofill/core/common/aliases.h" #include "components/autofill/core/common/form_field_data.h" -#include "components/autofill/core/common/unique_ids.h" #include "components/compose/core/browser/compose_features.h" #include "components/compose/core/browser/compose_manager_impl.h" #include "components/compose/core/browser/compose_metrics.h" @@ -446,33 +445,14 @@ return; } - autofill::AutofillDriver* driver = - autofill::ContentAutofillDriverFactory::FromWebContents(&GetWebContents()) - ->DriverForFrame(GetWebContents().GetPrimaryMainFrame()); - if (!driver) { - return; + if (autofill::AutofillDriver* driver = + autofill::ContentAutofillDriverFactory::FromWebContents( + &GetWebContents()) + ->DriverForFrame(GetWebContents().GetPrimaryMainFrame())) { + driver->RendererShouldTriggerSuggestions( + /*field_id=*/active_compose_ids_->first, + autofill::AutofillSuggestionTriggerSource::kComposeDialogLostFocus); } - // AutofillDriver forwards ExtractForm to the AutofillDriverRouter which can - // find the correct driver to use for the form. - driver->ExtractForm( - /*form=*/active_compose_ids_->second, /*response_handler=*/base::BindOnce( - [](autofill::FieldGlobalId trigger_field, - autofill::AutofillDriver* host_frame_driver, - const std::optional<autofill::FormData>& form) { - if (!form) { - return; - } - CHECK(host_frame_driver); - const autofill::FormFieldData* form_field = - form->FindFieldByGlobalId(trigger_field); - if (form_field != nullptr) { - host_frame_driver->GetAutofillManager().OnAskForValuesToFill( - *form, *form_field, form_field->bounds, - autofill::AutofillSuggestionTriggerSource:: - kComposeDialogLostFocus); - } - }, - /*field_id=*/active_compose_ids_->first)); } ComposeSession* ChromeComposeClient::GetSessionForActiveComposeField() {
diff --git a/chrome/browser/compose/compose_dialog_browsertest.cc b/chrome/browser/compose/compose_dialog_browsertest.cc index f132eb00..0544007a 100644 --- a/chrome/browser/compose/compose_dialog_browsertest.cc +++ b/chrome/browser/compose/compose_dialog_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/browser/compose/compose_session.h" - #include <optional> #include "base/test/metrics/user_action_tester.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/compose/compose_enabling.h" +#include "chrome/browser/compose/compose_session.h" #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_enums.h"
diff --git a/chrome/browser/devtools/protocol/page_handler.cc b/chrome/browser/devtools/protocol/page_handler.cc index e38d656a..baeb8b7 100644 --- a/chrome/browser/devtools/protocol/page_handler.cc +++ b/chrome/browser/devtools/protocol/page_handler.cc
@@ -317,7 +317,7 @@ void PageHandler::OnDidGetManifest(std::unique_ptr<GetAppIdCallback> callback, const webapps::InstallableData& data) { - if (blink::IsEmptyManifest(*data.manifest)) { + if (data.manifest_url->is_empty()) { callback->sendSuccess(protocol::Maybe<protocol::String>(), protocol::Maybe<protocol::String>()); return;
diff --git a/chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_service.h b/chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_service.h index 478a3ac..cec5c52 100644 --- a/chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_service.h +++ b/chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_service.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_ENTERPRISE_REPORTING_LEGACY_TECH_LEGACY_TECH_SERVICE_H_ #include <optional> + #include "base/no_destructor.h" #include "chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_report_generator.h" #include "chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_url_matcher.h"
diff --git a/chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_service_unittest.cc b/chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_service_unittest.cc index 610204a..edbfee7 100644 --- a/chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_service_unittest.cc +++ b/chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_service_unittest.cc
@@ -6,11 +6,11 @@ #include <functional> #include <optional> -#include "base/functional/callback_forward.h" -#include "chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_report_generator.h" +#include "base/functional/callback_forward.h" #include "base/test/mock_callback.h" #include "base/test/task_environment.h" +#include "chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_report_generator.h" #include "chrome/browser/enterprise/reporting/prefs.h" #include "chrome/test/base/testing_profile.h" #include "components/sync_preferences/testing_pref_service_syncable.h"
diff --git a/chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc index 127209b..f6bc1ea3 100644 --- a/chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc +++ b/chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc
@@ -8,7 +8,7 @@ #include "chrome/browser/extensions/activity_log/activity_action_constants.h" #include "chrome/browser/extensions/activity_log/activity_actions.h" #include "chrome/browser/extensions/activity_log/activity_log_policy.h" -#include "extensions/browser/api/activity_log/web_request_constants.h" +#include "extensions/common/api/web_request/web_request_activity_log_constants.h" #include "testing/gtest/include/gtest/gtest.h" namespace extensions { @@ -43,9 +43,9 @@ scoped_refptr<Action> action = new Action( "punky", base::Time::Now(), Action::ACTION_WEB_REQUEST, "webRequest"); base::Value::Dict root; - root.Set(activity_log_web_request_constants::kNewUrlKey, + root.Set(web_request_activity_log_constants::kNewUrlKey, "http://www.youtube.com/"); - root.Set(activity_log_web_request_constants::kAddedRequestHeadersKey, + root.Set(web_request_activity_log_constants::kAddedRequestHeadersKey, base::Value::List()); action->mutable_other().Set(activity_log_constants::kActionWebRequest, std::move(root));
diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc index cc76862..3af70b0 100644 --- a/chrome/browser/extensions/api/settings_private/prefs_util.cc +++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -719,6 +719,8 @@ settings_api::PrefType::kNumber; (*s_allowlist)[ash::prefs::kAccessibilityFaceGazeCursorUseAcceleration] = settings_api::PrefType::kBoolean; + (*s_allowlist)[ash::prefs::kAccessibilityFaceGazeGesturesToMacros] = + settings_api::PrefType::kDictionary; // Text to Speech. (*s_allowlist)[::prefs::kTextToSpeechLangToVoiceName] =
diff --git a/chrome/browser/external_protocol/external_protocol_handler.cc b/chrome/browser/external_protocol/external_protocol_handler.cc index bad6ac7..e5384635 100644 --- a/chrome/browser/external_protocol/external_protocol_handler.cc +++ b/chrome/browser/external_protocol/external_protocol_handler.cc
@@ -249,9 +249,16 @@ // If we get here, either we are not the default or we cannot work out // what the default is, so we proceed. if (prompt_user) { - // Never prompt the user without a web_contents or dialog manager. - if (!web_contents || - !web_modal::WebContentsModalDialogManager::FromWebContents( + // Never prompt the user without a web_contents. + if (!web_contents) { + return; + } + + // Anchor to the outermost WebContents, for e.g. embedded <webview>s. + web_contents = web_contents->GetOutermostWebContents(); + + // Skip if the WebContents instance is not prepared to show a dialog. + if (!web_modal::WebContentsModalDialogManager::FromWebContents( web_contents)) { LOG(ERROR) << "Skipping ExternalProtocolDialog" << ", escaped_url=" << escaped_url.possibly_invalid_spec()
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedFollowIntroController.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedFollowIntroController.java index 2f9d886..70b846d 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedFollowIntroController.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedFollowIntroController.java
@@ -95,6 +95,7 @@ private Clock mClock = System::currentTimeMillis; private final Activity mActivity; + private final Profile mProfile; private final CurrentTabObserver mCurrentTabObserver; private final EmptyTabObserver mTabObserver; private final PrefService mPrefService; @@ -153,6 +154,7 @@ snackbarManager); mActivity = activity; + mProfile = profile; mTabSupplier = tabSupplier; mFeatureEngagementTracker = TrackerFactory.getTrackerForProfile(profile); mWebFeedSnackbarController = @@ -286,7 +288,7 @@ } private void maybeShowIPH(RecommendedWebFeedInfo recommendedInfo) { - UserEducationHelper helper = new UserEducationHelper(mActivity, new Handler()); + UserEducationHelper helper = new UserEducationHelper(mActivity, mProfile, new Handler()); mWebFeedFollowIntroView.showIPH( helper, () -> introWasShown(recommendedInfo), this::introWasNotShown); }
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedFollowIntroControllerTest.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedFollowIntroControllerTest.java index 5e35074..5d27be4 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedFollowIntroControllerTest.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedFollowIntroControllerTest.java
@@ -45,7 +45,6 @@ import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.profiles.ProfileManager; import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; @@ -115,7 +114,7 @@ mJniMocker.mock(WebFeedBridge.getTestHooksForTesting(), mWebFeedBridgeJniMock); mJniMocker.mock(UserPrefsJni.TEST_HOOKS, mUserPrefsJniMock); - ProfileManager.setLastUsedProfileForTesting(mProfile); + Mockito.when(mProfile.getOriginalProfile()).thenReturn(mProfile); Mockito.when(mUserPrefsJniMock.get(mProfile)).thenReturn(mPrefService); // Required for resolving an attribute used in AppMenuItemText.
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index d3632d74..4f275c66 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -2237,11 +2237,6 @@ "expiry_milestone": -1 }, { - "name": "enable-borderless-printing", - "owners": [ "bryancain@chromium.org", "project-bolton-eng@google.com" ], - "expiry_milestone": 122 - }, - { "name": "enable-bound-session-credentials", "owners": [ "alexilin@chromium.org", "msalama@chromium.org", "chrome-signin-team@google.com" ], "expiry_milestone": 125 @@ -5782,6 +5777,11 @@ "expiry_milestone": 125 }, { + "name": "ntp-wallpaper-search-button-animation", + "owners": [ "pauladedeji@google.com", "tiborg@chromium.org" ], + "expiry_milestone": 125 + }, + { "name": "ntp-wide-modules", "owners": [ "//components/search/OWNERS" ], "expiry_milestone": 122 @@ -6604,13 +6604,6 @@ "expiry_milestone": 130 }, { - "name": "printer-settings-revamp", - "owners": [ - "//ash/webui/print_management/OWNERS" - ], - "expiry_milestone": 130 - }, - { "name": "printing-ppd-channel", "owners": [ "bmgordon@chromium.org", @@ -7065,11 +7058,6 @@ "expiry_milestone": 125 }, { - "name": "rename-history-journeys", - "owners": [ "mahmadi@chromium.org", "chrome-journeys@google.com" ], - "expiry_milestone": 120 - }, - { "name": "render-arc-notifications-by-chrome", "owners": [ "shuminghao@google.com", "arc-framework@google.com" ], "expiry_milestone": 128
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index b40c95d4..cbb0132 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2202,9 +2202,6 @@ const char kJourneysName[] = "History Journeys"; const char kJourneysDescription[] = "Enables the History Journeys UI."; -const char kRenameJourneysName[] = "Rename History Journeys"; -const char kRenameJourneysDescription[] = "Renames History Journeys in the UI."; - const char kJourneysLabelsName[] = "History Journeys Labels"; const char kJourneysLabelsDescription[] = "Enables labels for Journeys within the History Journeys UI."; @@ -5030,6 +5027,12 @@ "Enables entry point on New Tab Page for Customize Chrome Side Panel " "Wallpaper Search."; +const char kNtpWallpaperSearchButtonAnimationName[] = + "NTP Wallpaper Search Button Animation"; +const char kNtpWallpaperSearchButtonAnimationDescription[] = + "Enables animation for New Tab Page's Wallpaper Search button. Requires " + "#ntp-wallpaper-search-button to be enabled too."; + const char kNtpWideModulesName[] = "NTP Wide Modules"; const char kNtpWideModulesDescription[] = "Shows wide NTP modules if NTP provides enough space."; @@ -5799,7 +5802,7 @@ "bluetooth-use-floss is set. Enable this flag will bypass the check so " "that users can still enable Floss by bluetooth-use-floss."; -const char kBluetoothUseLLPrivacyName[] = "Enable LL Privacy in BlueZ"; +const char kBluetoothUseLLPrivacyName[] = "Enable LL Privacy in Floss"; const char kBluetoothUseLLPrivacyDescription[] = "Enable address resolution offloading to Bluetooth Controller if " "supported. Modifying this flag will cause Bluetooth Controller to reset."; @@ -6976,10 +6979,6 @@ "Enables printer status querying and displaying from the OS Printer " "settings page."; -const char kPrinterSettingsRevampName[] = "Enable Printer Settings Revamped UI"; -const char kPrinterSettingsRevampDescription[] = - "Show the enhanced UI for the OS Printer settings page."; - const char kPrintPreviewDiscoveredPrintersName[] = "Enables showing discovered printers in the Print Preview dialog."; const char kPrintPreviewDiscoveredPrintersDescription[] = @@ -7536,11 +7535,6 @@ "handlers won't be registered, making it possible to install another " "version for testing."; -const char kEnableBorderlessPrintingName[] = "Borderless printing"; -const char kEnableBorderlessPrintingDescription[] = - "Enable borderless printing and paper type selection in the print preview " - "dialog."; - const char kLacrosColorManagementName[] = "Enable Chrome Color Management."; const char kLacrosColorManagementDescription[] = "Uses chrome-color-management wayland protocol to manage color spaces "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index ab6ab8c..bdeb74c3 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1243,9 +1243,6 @@ extern const char kJourneysName[]; extern const char kJourneysDescription[]; -extern const char kRenameJourneysName[]; -extern const char kRenameJourneysDescription[]; - extern const char kJourneysLabelsName[]; extern const char kJourneysLabelsDescription[]; @@ -2928,6 +2925,9 @@ extern const char kNtpWallpaperSearchButtonName[]; extern const char kNtpWallpaperSearchButtonDescription[]; +extern const char kNtpWallpaperSearchButtonAnimationName[]; +extern const char kNtpWallpaperSearchButtonAnimationDescription[]; + extern const char kNtpWideModulesName[]; extern const char kNtpWideModulesDescription[]; @@ -4018,9 +4018,6 @@ extern const char kPrinterSettingsPrinterStatusName[]; extern const char kPrinterSettingsPrinterStatusDescription[]; -extern const char kPrinterSettingsRevampName[]; -extern const char kPrinterSettingsRevampDescription[]; - extern const char kPrintPreviewDiscoveredPrintersName[]; extern const char kPrintPreviewDiscoveredPrintersDescription[]; @@ -4336,9 +4333,6 @@ extern const char kDisableOfficeEditingComponentAppName[]; extern const char kDisableOfficeEditingComponentAppDescription[]; -extern const char kEnableBorderlessPrintingName[]; -extern const char kEnableBorderlessPrintingDescription[]; - extern const char kLacrosColorManagementName[]; extern const char kLacrosColorManagementDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 005e021e..05b29d6 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -144,7 +144,6 @@ &feed::kWebFeedSort, &feed::kXsurfaceMetricsReporting, &history::kOrganicRepeatableQueries, - &history_clusters::kRenameJourneys, &history_clusters::internal::kJourneys, &history_clusters::internal::kOmniboxAction, &history_clusters::internal::kOmniboxHistoryClusterProvider,
diff --git a/chrome/browser/installable/installable_manager_browsertest.cc b/chrome/browser/installable/installable_manager_browsertest.cc index f01d45cf..3edd3b9 100644 --- a/chrome/browser/installable/installable_manager_browsertest.cc +++ b/chrome/browser/installable/installable_manager_browsertest.cc
@@ -35,6 +35,7 @@ #include "content/public/test/prerender_test_util.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/manifest/manifest_util.h" #include "third_party/blink/public/mojom/manifest/manifest.mojom.h" @@ -139,9 +140,10 @@ class CallbackTester { public: - CallbackTester(base::RepeatingClosure quit_closure, - scoped_refptr<base::SequencedTaskRunner> test_task_runner = - base::SequencedTaskRunner::GetCurrentDefault()) + explicit CallbackTester( + base::RepeatingClosure quit_closure, + scoped_refptr<base::SequencedTaskRunner> test_task_runner = + base::SequencedTaskRunner::GetCurrentDefault()) : quit_closure_(quit_closure), test_task_runner_(test_task_runner) {} void OnDidFinishInstallableCheck(const InstallableData& data) { @@ -429,27 +431,21 @@ new CallbackTester(run_loop.QuitClosure())); // Navigating resets histogram state, so do it before recording a histogram. - ASSERT_TRUE(content::NavigateToURL( - web_contents(), - embedded_test_server()->GetURL("/banners/no_manifest_test_page.html"))); + GURL url = + embedded_test_server()->GetURL("/banners/no_manifest_test_page.html"); + ASSERT_TRUE(content::NavigateToURL(web_contents(), url)); RunInstallableManager(tester.get(), GetManifestParams()); run_loop.Run(); - // If there is no manifest, everything should be empty. - EXPECT_TRUE(blink::IsEmptyManifest(tester->manifest())); + // If there is no manifest, it should be the default one. + EXPECT_FALSE(blink::IsEmptyManifest(tester->manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(tester->manifest(), url)); EXPECT_TRUE(tester->manifest_url().is_empty()); EXPECT_TRUE(tester->primary_icon_url().is_empty()); EXPECT_EQ(nullptr, tester->primary_icon()); EXPECT_FALSE(tester->has_maskable_primary_icon()); EXPECT_FALSE(tester->installable_check_passed()); - if (base::FeatureList::IsEnabled( - features::kUniversalInstallRootScopeNoManifest)) { - EXPECT_EQ(std::vector<InstallableStatusCode>{}, tester->errors()); - } else { - EXPECT_EQ( - std::vector<InstallableStatusCode>{InstallableStatusCode::NO_MANIFEST}, - tester->errors()); - } + EXPECT_THAT(tester->errors(), testing::IsEmpty()); } IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest, CheckManifest404) { @@ -471,15 +467,10 @@ EXPECT_EQ(nullptr, tester->primary_icon()); EXPECT_FALSE(tester->has_maskable_primary_icon()); EXPECT_FALSE(tester->installable_check_passed()); - if (base::FeatureList::IsEnabled( - features::kUniversalInstallRootScopeNoManifest)) { - EXPECT_EQ(std::vector<InstallableStatusCode>{}, tester->errors()); - } else { - EXPECT_EQ( - std::vector<InstallableStatusCode>{ - InstallableStatusCode::MANIFEST_EMPTY}, - tester->errors()); - } + EXPECT_EQ( + std::vector<InstallableStatusCode>{ + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR}, + tester->errors()); } IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest, CheckManifestOnly) { @@ -563,26 +554,18 @@ std::unique_ptr<CallbackTester> tester( new CallbackTester(run_loop.QuitClosure())); - NavigateAndRunInstallableManager( - tester.get(), params, - GetUrlOfPageWithTags("/banners/no_manifest_test_page.html", meta_tags)); + std::string path = + GetUrlOfPageWithTags("/banners/no_manifest_test_page.html", meta_tags); + NavigateAndRunInstallableManager(tester.get(), params, path); run_loop.Run(); EXPECT_FALSE(tester->metadata().application_name.empty()); - EXPECT_TRUE(blink::IsEmptyManifest(tester->manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(tester->manifest(), + embedded_test_server()->GetURL(path))); EXPECT_TRUE(tester->manifest_url().is_empty()); - - if (base::FeatureList::IsEnabled( - features::kUniversalInstallRootScopeNoManifest)) { - EXPECT_EQ(std::vector<InstallableStatusCode>{}, tester->errors()); - } else { - EXPECT_EQ( - std::vector<InstallableStatusCode>{ - InstallableStatusCode::NO_MANIFEST}, - tester->errors()); - } + EXPECT_THAT(tester->errors(), testing::IsEmpty()); } } @@ -1168,9 +1151,13 @@ "/banners/iframe_test_page.html"); run_loop.Run(); - // The installable manager should only retrieve items in the main frame; - // everything should be empty here. - EXPECT_TRUE(blink::IsEmptyManifest(tester->manifest())); + // The installable manager should only retrieve items in the main frame. + // The manifest should be the default one for the main frame, and not the + // one in the iframe inside of iframe_test_page.html (which points to the + // `manifest_test_page.html`). + EXPECT_TRUE(blink::IsDefaultManifest( + tester->manifest(), + embedded_test_server()->GetURL("/banners/iframe_test_page.html"))); EXPECT_TRUE(tester->manifest_url().is_empty()); EXPECT_TRUE(tester->primary_icon_url().is_empty()); EXPECT_EQ(nullptr, tester->primary_icon()); @@ -1569,9 +1556,9 @@ // Start on a page with no manifest. - ASSERT_TRUE(content::NavigateToURL( - web_contents(), - embedded_test_server()->GetURL("/banners/no_manifest_test_page.html"))); + GURL url = + embedded_test_server()->GetURL("/banners/no_manifest_test_page.html"); + ASSERT_TRUE(content::NavigateToURL(web_contents(), url)); { // Fetch the data. This should return an empty manifest. @@ -1585,17 +1572,12 @@ base::Unretained(tester.get()))); run_loop.Run(); - EXPECT_TRUE(blink::IsEmptyManifest(tester->manifest())); - if (base::FeatureList::IsEnabled( - features::kUniversalInstallRootScopeNoManifest)) { - EXPECT_EQ(InstallableStatusCode::NO_ERROR_DETECTED, - manager->manifest_error()); - } else { - EXPECT_EQ(InstallableStatusCode::NO_MANIFEST, manager->manifest_error()); - } - EXPECT_EQ( - std::vector<InstallableStatusCode>{InstallableStatusCode::NO_MANIFEST}, - tester->errors()); + EXPECT_FALSE(blink::IsEmptyManifest(tester->manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(tester->manifest(), url)); + EXPECT_EQ(InstallableStatusCode::NO_ERROR_DETECTED, + manager->manifest_error()); + EXPECT_THAT(tester->errors(), + testing::ElementsAre(InstallableStatusCode::NO_MANIFEST)); } { @@ -1677,9 +1659,9 @@ RunInstallableManager(tester.get(), params); run_loop.Run(); - EXPECT_EQ( - std::vector<InstallableStatusCode>({InstallableStatusCode::NO_MANIFEST}), - tester->errors()); + // The default manifest is created, but we still report no manifest. + EXPECT_THAT(tester->errors(), + testing::ElementsAre(InstallableStatusCode::NO_MANIFEST)); } IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest, @@ -1695,13 +1677,13 @@ "/banners/play_app_manifest.json")); run_loop.Run(); - EXPECT_EQ(std::vector<InstallableStatusCode>( - {InstallableStatusCode::START_URL_NOT_VALID, - InstallableStatusCode::MANIFEST_MISSING_NAME_OR_SHORT_NAME, - InstallableStatusCode::MANIFEST_DISPLAY_NOT_SUPPORTED, - InstallableStatusCode::MANIFEST_MISSING_SUITABLE_ICON, - InstallableStatusCode::NO_ACCEPTABLE_ICON}), - tester->errors()); + EXPECT_THAT(tester->errors(), + testing::UnorderedElementsAre( + InstallableStatusCode::START_URL_NOT_VALID, + InstallableStatusCode::MANIFEST_MISSING_NAME_OR_SHORT_NAME, + InstallableStatusCode::MANIFEST_DISPLAY_NOT_SUPPORTED, + InstallableStatusCode::MANIFEST_MISSING_SUITABLE_ICON, + InstallableStatusCode::NO_ACCEPTABLE_ICON)); } IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest, @@ -1736,26 +1718,25 @@ IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest, GetAllInstallabilityErrorsNoErrors) { - EXPECT_EQ(std::vector<content::InstallabilityError>{}, - NavigateAndGetAllInstallabilityErrors( - "/banners/manifest_test_page.html")); + EXPECT_THAT( + NavigateAndGetAllInstallabilityErrors("/banners/manifest_test_page.html"), + testing::IsEmpty()); // Should pass a second time with no issues. - EXPECT_EQ(std::vector<content::InstallabilityError>{}, - GetAllInstallabilityErrors()); + EXPECT_THAT(GetAllInstallabilityErrors(), testing::IsEmpty()); } IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest, GetAllInstallabilityErrorsWithNoManifest) { - EXPECT_EQ(std::vector<content::InstallabilityError>{GetInstallabilityError( - InstallableStatusCode::NO_MANIFEST)}, - NavigateAndGetAllInstallabilityErrors( - "/banners/no_manifest_test_page.html")); + EXPECT_THAT(NavigateAndGetAllInstallabilityErrors( + "/banners/no_manifest_test_page.html"), + testing::UnorderedElementsAre( + GetInstallabilityError(InstallableStatusCode::NO_MANIFEST))); - // Should pass a second time with no issues. - EXPECT_EQ(std::vector<content::InstallabilityError>{GetInstallabilityError( - InstallableStatusCode::NO_MANIFEST)}, - GetAllInstallabilityErrors()); + // Should return a second time with no issues. + EXPECT_THAT(GetAllInstallabilityErrors(), + testing::UnorderedElementsAre( + GetInstallabilityError(InstallableStatusCode::NO_MANIFEST))); } IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest, @@ -2086,9 +2067,9 @@ base::BindOnce(&CallbackTester::OnDidFinishInstallableCheck, base::Unretained(tester.get()))); run_loop.Run(); - // It should have no data since manifest_test_page.html is loaded in the - // prerendering. - EXPECT_TRUE(blink::IsEmptyManifest(manager->manifest())); + // It should have the default manifest for `url` since no data since + // manifest_test_page.html is loaded in the prerendering. + EXPECT_TRUE(blink::IsDefaultManifest(manager->manifest(), url)); EXPECT_EQ( std::vector<InstallableStatusCode>{InstallableStatusCode::NO_MANIFEST}, tester->errors()); @@ -2186,9 +2167,9 @@ base::BindOnce(&CallbackTester::OnDidFinishInstallableCheck, base::Unretained(tester.get()))); run_loop.Run(); - // It should have no data since manifest_test_page.html is loaded in the - // prerendering. - EXPECT_TRUE(blink::IsEmptyManifest(manager->manifest())); + // It should have default data for the original `url` since + // manifest_test_page.html is loaded in the prerendering. + EXPECT_TRUE(blink::IsDefaultManifest(manager->manifest(), url)); EXPECT_EQ( std::vector<InstallableStatusCode>{InstallableStatusCode::NO_MANIFEST}, tester->errors()); @@ -2265,7 +2246,9 @@ base::BindOnce(&CallbackTester::OnDidFinishInstallableCheck, base::Unretained(tester.get()))); run_loop.Run(); - EXPECT_TRUE(blink::IsEmptyManifest(manager->manifest())); + // It should have default data for the original `url` since + // manifest_test_page.html is loaded in the prerendering. + EXPECT_TRUE(blink::IsDefaultManifest(manager->manifest(), url)); EXPECT_EQ( std::vector<InstallableStatusCode>{InstallableStatusCode::NO_MANIFEST}, tester->errors()); @@ -2284,8 +2267,8 @@ manager->manifest_error()); { - // Fetch the data again. This should return the same empty result as - // earlier. + // Fetch the data again. This should return the default manifest for the + // prerendered page now. base::RunLoop run_loop; std::unique_ptr<CallbackTester> tester( new CallbackTester(run_loop.QuitClosure())); @@ -2295,17 +2278,11 @@ base::BindOnce(&CallbackTester::OnDidFinishInstallableCheck, base::Unretained(tester.get()))); run_loop.Run(); - EXPECT_TRUE(blink::IsEmptyManifest(tester->manifest())); - if (base::FeatureList::IsEnabled( - features::kUniversalInstallRootScopeNoManifest)) { - EXPECT_EQ(InstallableStatusCode::NO_ERROR_DETECTED, - manager->manifest_error()); - } else { - EXPECT_EQ(InstallableStatusCode::NO_MANIFEST, manager->manifest_error()); - } - EXPECT_EQ( - std::vector<InstallableStatusCode>{InstallableStatusCode::NO_MANIFEST}, - tester->errors()); + EXPECT_TRUE(blink::IsDefaultManifest(manager->manifest(), prerender_url)); + EXPECT_EQ(InstallableStatusCode::NO_ERROR_DETECTED, + manager->manifest_error()); + EXPECT_THAT(tester->errors(), + testing::ElementsAre(InstallableStatusCode::NO_MANIFEST)); } } @@ -2322,49 +2299,40 @@ std::unique_ptr<CallbackTester> tester( new CallbackTester(run_loop.QuitClosure())); - NavigateAndRunInstallableManager( - tester.get(), params, - GetUrlOfPageWithTags("/no_manifest_test_page.html", meta_tags)); + std::string path = + GetUrlOfPageWithTags("/no_manifest_test_page.html", meta_tags); + NavigateAndRunInstallableManager(tester.get(), params, path); run_loop.Run(); - EXPECT_TRUE(blink::IsEmptyManifest(tester->manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(tester->manifest(), + embedded_test_server()->GetURL(path))); EXPECT_TRUE(tester->manifest_url().is_empty()); EXPECT_EQ(u"Test App Name", tester->metadata().application_name); EXPECT_TRUE(tester->manifest().icons.empty()); EXPECT_FALSE(web_contents()->GetFaviconURLs().empty()); - if (base::FeatureList::IsEnabled( - features::kUniversalInstallRootScopeNoManifest)) { - EXPECT_TRUE(tester->installable_check_passed()); - EXPECT_EQ(std::vector<InstallableStatusCode>{}, tester->errors()); - } else { - EXPECT_FALSE(tester->installable_check_passed()); - EXPECT_EQ( - std::vector<InstallableStatusCode>{ - InstallableStatusCode::NO_MANIFEST}, - tester->errors()); - } + EXPECT_TRUE(tester->installable_check_passed()); + EXPECT_THAT(tester->errors(), testing::IsEmpty()); } { base::RunLoop run_loop; std::unique_ptr<CallbackTester> tester( new CallbackTester(run_loop.QuitClosure())); - NavigateAndRunInstallableManager( - tester.get(), params, - GetUrlOfPageWithTags("/banners/no_manifest_test_page.html", meta_tags)); + std::string path = + GetUrlOfPageWithTags("/no_manifest_test_page.html", meta_tags); + NavigateAndRunInstallableManager(tester.get(), params, path); run_loop.Run(); - EXPECT_TRUE(blink::IsEmptyManifest(tester->manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(tester->manifest(), + embedded_test_server()->GetURL(path))); EXPECT_TRUE(tester->manifest_url().is_empty()); EXPECT_EQ(u"Test App Name", tester->metadata().application_name); EXPECT_TRUE(tester->manifest().icons.empty()); EXPECT_FALSE(web_contents()->GetFaviconURLs().empty()); - EXPECT_FALSE(tester->installable_check_passed()); - EXPECT_EQ( - std::vector<InstallableStatusCode>{InstallableStatusCode::NO_MANIFEST}, - tester->errors()); + EXPECT_TRUE(tester->installable_check_passed()); + EXPECT_THAT(tester->errors(), testing::IsEmpty()); } } } // namespace webapps
diff --git a/chrome/browser/keyboard_accessory/android/manual_filling_controller_impl.cc b/chrome/browser/keyboard_accessory/android/manual_filling_controller_impl.cc index d89eaf7..324b038 100644 --- a/chrome/browser/keyboard_accessory/android/manual_filling_controller_impl.cc +++ b/chrome/browser/keyboard_accessory/android/manual_filling_controller_impl.cc
@@ -18,11 +18,11 @@ #include "base/trace_event/memory_dump_manager.h" #include "base/trace_event/memory_usage_estimator.h" #include "base/trace_event/process_memory_dump.h" -#include "chrome/browser/keyboard_accessory/android/address_accessory_controller.h" -#include "chrome/browser/keyboard_accessory/android/credit_card_accessory_controller.h" #include "chrome/browser/autofill/manual_filling_view_interface.h" #include "chrome/browser/keyboard_accessory/android/accessory_sheet_data.h" #include "chrome/browser/keyboard_accessory/android/accessory_sheet_enums.h" +#include "chrome/browser/keyboard_accessory/android/address_accessory_controller.h" +#include "chrome/browser/keyboard_accessory/android/credit_card_accessory_controller.h" #include "chrome/browser/keyboard_accessory/android/password_accessory_controller.h" #include "chrome/browser/password_manager/chrome_password_manager_client.h" #include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/keyboard_accessory/android/password_accessory_controller_impl.cc b/chrome/browser/keyboard_accessory/android/password_accessory_controller_impl.cc index 029d2cb..8833afc 100644 --- a/chrome/browser/keyboard_accessory/android/password_accessory_controller_impl.cc +++ b/chrome/browser/keyboard_accessory/android/password_accessory_controller_impl.cc
@@ -18,12 +18,12 @@ #include "base/notreached.h" #include "base/ranges/algorithm.h" #include "base/trace_event/trace_event.h" -#include "chrome/browser/keyboard_accessory/android/manual_filling_controller.h" -#include "chrome/browser/keyboard_accessory/android/manual_filling_utils.h" #include "chrome/browser/keyboard_accessory/android/accessory_sheet_data.h" #include "chrome/browser/keyboard_accessory/android/accessory_sheet_enums.h" -#include "chrome/browser/password_manager/android/all_passwords_bottom_sheet_controller.h" +#include "chrome/browser/keyboard_accessory/android/manual_filling_controller.h" +#include "chrome/browser/keyboard_accessory/android/manual_filling_utils.h" #include "chrome/browser/keyboard_accessory/android/password_accessory_controller.h" +#include "chrome/browser/password_manager/android/all_passwords_bottom_sheet_controller.h" #include "chrome/browser/password_manager/android/password_generation_controller.h" #include "chrome/browser/password_manager/android/password_manager_launcher_android.h" #include "chrome/browser/password_manager/chrome_password_manager_client.h"
diff --git a/chrome/browser/lacros/browser_service_lacros_browsertest.cc b/chrome/browser/lacros/browser_service_lacros_browsertest.cc index e47b2b40..7e54a2b 100644 --- a/chrome/browser/lacros/browser_service_lacros_browsertest.cc +++ b/chrome/browser/lacros/browser_service_lacros_browsertest.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/lacros/browser_service_lacros.h" + #include <cstdint> #include <memory> #include <optional> @@ -17,7 +19,6 @@ #include "chrome/browser/chromeos/app_mode/kiosk_browser_session.h" #include "chrome/browser/chromeos/network/network_portal_signin_window.h" #include "chrome/browser/lacros/app_mode/kiosk_session_service_lacros.h" -#include "chrome/browser/lacros/browser_service_lacros.h" #include "chrome/browser/lacros/profile_util.h" #include "chrome/browser/lifetime/application_lifetime_desktop.h" #include "chrome/browser/prefs/incognito_mode_prefs.h"
diff --git a/chrome/browser/mandatory_reauth/android/internal/java/src/org/chromium/chrome/browser/mandatory_reauth/MandatoryReauthOptInBottomSheetModuleTest.java b/chrome/browser/mandatory_reauth/android/internal/java/src/org/chromium/chrome/browser/mandatory_reauth/MandatoryReauthOptInBottomSheetModuleTest.java index f94b2f7..1cb7bd9 100644 --- a/chrome/browser/mandatory_reauth/android/internal/java/src/org/chromium/chrome/browser/mandatory_reauth/MandatoryReauthOptInBottomSheetModuleTest.java +++ b/chrome/browser/mandatory_reauth/android/internal/java/src/org/chromium/chrome/browser/mandatory_reauth/MandatoryReauthOptInBottomSheetModuleTest.java
@@ -98,18 +98,18 @@ TextView explanationView = (TextView) getView(R.id.mandatory_reauth_opt_in_explanation); // Check that the custom view contains the expected title and explanation. - assertThat(titleView.getText(), is("Always verify?")); + assertThat(titleView.getText(), is("Turn on manual verification?")); assertThat( explanationView.getText(), is( - "For added security on shared devices, turn on verification every time you" - + " pay using autofill.")); + "If you share this device, Chromium can ask you to verify every time you" + + " pay using autofill")); Button acceptButton = (Button) getView(R.id.mandatory_reauth_opt_in_accept_button); Button cancelButton = (Button) getView(R.id.mandatory_reauth_opt_in_cancel_button); // Check that the accept/cancel buttons are correctly shown. - assertThat(acceptButton.getText(), is("Yes")); + assertThat(acceptButton.getText(), is("Turn on")); assertThat(cancelButton.getText(), is("No thanks")); }
diff --git a/chrome/browser/net/cookie_encryption_provider_browsertest.cc b/chrome/browser/net/cookie_encryption_provider_browsertest.cc index f1af63b..7e3ecd3 100644 --- a/chrome/browser/net/cookie_encryption_provider_browsertest.cc +++ b/chrome/browser/net/cookie_encryption_provider_browsertest.cc
@@ -2,12 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/net/cookie_encryption_provider_impl.h" +#include <optional> +#include <string> +#include <vector> #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/test_future.h" #include "chrome/browser/browser_features.h" +#include "chrome/browser/net/cookie_encryption_provider_impl.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" @@ -20,10 +23,6 @@ #include "services/network/public/mojom/network_context.mojom.h" #include "testing/gtest/include/gtest/gtest.h" -#include <optional> -#include <string> -#include <vector> - namespace { enum TestConfiguration {
diff --git a/chrome/browser/password_manager/android/password_infobar_utils.cc b/chrome/browser/password_manager/android/password_infobar_utils.cc index 45c4894f..e45861a 100644 --- a/chrome/browser/password_manager/android/password_infobar_utils.cc +++ b/chrome/browser/password_manager/android/password_infobar_utils.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/password_manager/android/password_infobar_utils.h" + #include <optional> #include "chrome/browser/profiles/profile.h"
diff --git a/chrome/browser/password_manager/android/save_update_password_message_delegate.cc b/chrome/browser/password_manager/android/save_update_password_message_delegate.cc index 3f298fbe..60ee169a6 100644 --- a/chrome/browser/password_manager/android/save_update_password_message_delegate.cc +++ b/chrome/browser/password_manager/android/save_update_password_message_delegate.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/password_manager/android/save_update_password_message_delegate.h" + #include <optional> #include <utility>
diff --git a/chrome/browser/policy/messaging_layer/upload/event_upload_size_controller_unittest.cc b/chrome/browser/policy/messaging_layer/upload/event_upload_size_controller_unittest.cc index 06d02e22..5a7ed41 100644 --- a/chrome/browser/policy/messaging_layer/upload/event_upload_size_controller_unittest.cc +++ b/chrome/browser/policy/messaging_layer/upload/event_upload_size_controller_unittest.cc
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/policy/messaging_layer/upload/event_upload_size_controller.h" + #include <algorithm> #include <cstdint> #include <optional> #include <string> #include "base/test/protobuf_matchers.h" -#include "chrome/browser/policy/messaging_layer/upload/event_upload_size_controller.h" #include "chrome/browser/policy/messaging_layer/upload/testing_network_condition_service.h" #include "components/reporting/proto/synced/record.pb.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/chrome/browser/policy/test/history_clusters_policy_browsertest.cc b/chrome/browser/policy/test/history_clusters_policy_browsertest.cc index 5a84d1e..2beb16f 100644 --- a/chrome/browser/policy/test/history_clusters_policy_browsertest.cc +++ b/chrome/browser/policy/test/history_clusters_policy_browsertest.cc
@@ -21,19 +21,8 @@ namespace policy { // Tests setting the visibility of the History Clusters by policy. -class HistoryClustersPolicyTest : public PolicyTest, - public testing::WithParamInterface<bool> { +class HistoryClustersPolicyTest : public PolicyTest { public: - HistoryClustersPolicyTest() { - if (GetParam()) { - scoped_feature_list_.InitAndEnableFeature( - history_clusters::kRenameJourneys); - } else { - scoped_feature_list_.InitAndDisableFeature( - history_clusters::kRenameJourneys); - } - } - void SetUp() override { PolicyTest::SetUp(); @@ -42,15 +31,10 @@ } private: - base::test::ScopedFeatureList scoped_feature_list_; history_clusters::Config config_; }; -INSTANTIATE_TEST_SUITE_P(RenameJourneys, - HistoryClustersPolicyTest, - testing::Bool()); - -IN_PROC_BROWSER_TEST_P(HistoryClustersPolicyTest, HistoryClustersVisible) { +IN_PROC_BROWSER_TEST_F(HistoryClustersPolicyTest, HistoryClustersVisible) { auto* history_clusters_service = HistoryClustersServiceFactory::GetForBrowserContext(browser()->profile()); PrefService* prefs = browser()->profile()->GetPrefs(); @@ -66,10 +50,9 @@ EXPECT_FALSE(prefs->GetBoolean(history_clusters::prefs::kVisible)); EXPECT_FALSE(prefs->IsManagedPreference(history_clusters::prefs::kVisible)); - // When history_clusters::kRenameJourneys is enabled, history clusters are - // always visible unless the visibility prefs is set to false by policy. - EXPECT_EQ(history_clusters_service->IsJourneysEnabledAndVisible(), - GetParam()); + // History clusters are always visible unless the visibility prefs is set to + // false by policy. + EXPECT_TRUE(history_clusters_service->IsJourneysEnabledAndVisible()); // Verify that history clusters can be hidden by policy. policies.Set(key::kHistoryClustersVisible, POLICY_LEVEL_MANDATORY, @@ -97,10 +80,9 @@ EXPECT_FALSE(prefs->GetBoolean(history_clusters::prefs::kVisible)); EXPECT_FALSE(prefs->IsManagedPreference(history_clusters::prefs::kVisible)); - // When history_clusters::kRenameJourneys is enabled, history clusters are - // always visible unless the visibility prefs is set to false by policy. - EXPECT_EQ(history_clusters_service->IsJourneysEnabledAndVisible(), - GetParam()); + // History clusters are always visible unless the visibility prefs is set to + // false by policy. + EXPECT_TRUE(history_clusters_service->IsJourneysEnabledAndVisible()); } } // namespace policy
diff --git a/chrome/browser/prefs/pref_service_incognito_allowlist.cc b/chrome/browser/prefs/pref_service_incognito_allowlist.cc index 3fbcb94..69c72c4b 100644 --- a/chrome/browser/prefs/pref_service_incognito_allowlist.cc +++ b/chrome/browser/prefs/pref_service_incognito_allowlist.cc
@@ -74,6 +74,7 @@ ash::prefs::kAccessibilityFaceGazeCursorSpeedRight, ash::prefs::kAccessibilityFaceGazeCursorSmoothing, ash::prefs::kAccessibilityFaceGazeCursorUseAcceleration, + ash::prefs::kAccessibilityFaceGazeGesturesToMacros, ash::prefs::kAccessibilityHighContrastEnabled, ash::prefs::kAccessibilityScreenMagnifierCenterFocus, ash::prefs::kAccessibilityScreenMagnifierEnabled,
diff --git a/chrome/browser/privacy_sandbox/tracking_protection_notice_browsertest.cc b/chrome/browser/privacy_sandbox/tracking_protection_notice_browsertest.cc index 8a905cfd..990ca0e2 100644 --- a/chrome/browser/privacy_sandbox/tracking_protection_notice_browsertest.cc +++ b/chrome/browser/privacy_sandbox/tracking_protection_notice_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <optional> + #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/time/time.h"
diff --git a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudIPHController.java b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudIPHController.java index 732a141..15d6dc6 100644 --- a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudIPHController.java +++ b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudIPHController.java
@@ -13,6 +13,7 @@ import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.Supplier; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; import org.chromium.chrome.browser.user_education.IPHCommandBuilder; @@ -35,6 +36,7 @@ * Constructor. * * @param activity The current activity. + * @param profile The current Profile. * @param toolbarMenuButton The toolbar menu button to which IPH will be anchored. * @param appMenuHandler The app menu handler * @param tabSupplier The tab supplier @@ -42,6 +44,7 @@ */ public ReadAloudIPHController( Activity activity, + Profile profile, View toolbarMenuButton, AppMenuHandler appMenuHandler, ObservableSupplier<Tab> tabSupplier, @@ -50,7 +53,7 @@ activity, toolbarMenuButton, appMenuHandler, - new UserEducationHelper(activity, new Handler(Looper.getMainLooper())), + new UserEducationHelper(activity, profile, new Handler(Looper.getMainLooper())), tabSupplier, readAloudControllerSupplier); }
diff --git a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerCoordinator.java b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerCoordinator.java index 63cb835..74bb059 100644 --- a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerCoordinator.java +++ b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerCoordinator.java
@@ -174,6 +174,11 @@ } } + /** Collapses the expanded player and shows mini player */ + void hideExpandedPlayer() { + mExpandedPlayer.dismiss(true); + } + @Override public void hidePlayers() { int expandedSheetVisibility = mExpandedPlayer.getVisibility();
diff --git a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerCoordinatorUnitTest.java b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerCoordinatorUnitTest.java index 1f4e0e0..dad45651 100644 --- a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerCoordinatorUnitTest.java +++ b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerCoordinatorUnitTest.java
@@ -333,4 +333,12 @@ verify(mExpandedPlayer).dismiss(); verify(mObserver, never()).onRequestClosePlayers(); } + + @Test + public void testHideExpandedPlayer() { + mPlayerCoordinator.hideExpandedPlayer(); + + verify(mExpandedPlayer).dismiss(true); + verify(mMiniPlayer, never()).dismiss(anyBoolean()); + } }
diff --git a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerMediator.java b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerMediator.java index 0c5fafc..a12074d 100644 --- a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerMediator.java +++ b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerMediator.java
@@ -219,6 +219,7 @@ @Override public void onPublisherClick() { + mCoordinator.hideExpandedPlayer(); mDelegate.navigateToPlayingTab(); }
diff --git a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerMediatorUnitTest.java b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerMediatorUnitTest.java index bc3a71a7..9b443b9 100644 --- a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerMediatorUnitTest.java +++ b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/PlayerMediatorUnitTest.java
@@ -393,6 +393,7 @@ @Test public void testOnPublisherClick() { mMediator.onPublisherClick(); + verify(mPlayerCoordinator).hideExpandedPlayer(); verify(mDelegate).navigateToPlayingTab(); }
diff --git a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/expanded/ExpandedPlayerCoordinator.java b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/expanded/ExpandedPlayerCoordinator.java index 4ddfcbb..26a05c51 100644 --- a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/expanded/ExpandedPlayerCoordinator.java +++ b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/player/expanded/ExpandedPlayerCoordinator.java
@@ -131,8 +131,12 @@ } public void dismiss() { + dismiss(/* showMiniPlayer= */ false); + } + + public void dismiss(boolean showMiniPlayer) { if (mMediator != null) { - mMediator.setShowMiniPlayerOnDismiss(false); + mMediator.setShowMiniPlayerOnDismiss(showMiniPlayer); mMediator.dismiss(); } }
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_enterprise_printers.html b/chrome/browser/resources/ash/settings/os_printing_page/cups_enterprise_printers.html index a7a8817..95bb503 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_enterprise_printers.html +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_enterprise_printers.html
@@ -32,7 +32,7 @@ flex: 1; } - :host([is-printer-settings-revamp-enabled_]) .list-frame { + .list-frame { padding-inline: 0; } </style>
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_enterprise_printers.ts b/chrome/browser/resources/ash/settings/os_printing_page/cups_enterprise_printers.ts index 394e324..636d477 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_enterprise_printers.ts +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_enterprise_printers.ts
@@ -18,7 +18,6 @@ import {CrActionMenuElement} from 'chrome://resources/ash/common/cr_elements/cr_action_menu/cr_action_menu.js'; import {WebUiListenerMixin} from 'chrome://resources/ash/common/cr_elements/web_ui_listener_mixin.js'; -import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {castExists} from '../assert_extras.js'; @@ -113,18 +112,6 @@ * Used by FocusRowBehavior to track if the list has been blurred. */ listBlurred_: Boolean, - - /** - * True when the "printer-settings-revamp" feature flag is enabled. - */ - isPrinterSettingsRevampEnabled_: { - type: Boolean, - value: () => { - return loadTimeData.getBoolean('isPrinterSettingsRevampEnabled'); - }, - readOnly: true, - reflectToAttribute: true, - }, }; }
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_nearby_printers.html b/chrome/browser/resources/ash/settings/os_printing_page/cups_nearby_printers.html index 36cb9c003..0552763 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_nearby_printers.html +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_nearby_printers.html
@@ -8,7 +8,7 @@ margin-top: 20px; } - :host([is-printer-settings-revamp-enabled_]) .list-frame { + .list-frame { padding-inline: 0; } </style>
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_nearby_printers.ts b/chrome/browser/resources/ash/settings/os_printing_page/cups_nearby_printers.ts index c9ead63..2a6f233b 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_nearby_printers.ts +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_nearby_printers.ts
@@ -13,7 +13,6 @@ import './cups_printers_entry.js'; import {WebUiListenerMixin} from 'chrome://resources/ash/common/cr_elements/web_ui_listener_mixin.js'; -import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {IronListElement} from 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -99,18 +98,6 @@ type: Boolean, value: false, }, - - /** - * True when the "printer-settings-revamp" feature flag is enabled. - */ - isPrinterSettingsRevampEnabled_: { - type: Boolean, - value: () => { - return loadTimeData.getBoolean('isPrinterSettingsRevampEnabled'); - }, - readOnly: true, - reflectToAttribute: true, - }, }; }
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_printers.html b/chrome/browser/resources/ash/settings/os_printing_page/cups_printers.html index bd5ea25..cefa5e9 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_printers.html +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_printers.html
@@ -17,15 +17,6 @@ padding: 20px; } - #addPrinterText { - flex: 1; - } - - .add-manual-printer-icon { - --cr-icon-button-fill-color: var(--cros-sys-primary); - --cr-icon-button-margin-end: 0; - } - #addManualPrinterButtonRevamp { background: none; } @@ -55,26 +46,17 @@ #savedPrintersContainer { border-bottom: var(--cr-separator-line); padding-bottom: 8px; - } - - :host([is-printer-settings-revamp-enabled_]) #savedPrintersContainer { padding-inline-start: var(--cr-section-padding); } #savedPrintersDescription { height: 64px; margin-bottom: 8px; - } - - :host([is-printer-settings-revamp-enabled_]) #savedPrintersDescription { padding-inline-start: 0; } #enterprisePrintersContainer { border-top: var(--cr-separator-line); - } - - :host([is-printer-settings-revamp-enabled_]) #enterprisePrintersContainer { padding-inline-start: var(--cr-section-padding); } @@ -96,7 +78,7 @@ margin: 0; } - :host([is-printer-settings-revamp-enabled_]) #collapsibleSection { + #collapsibleSection { padding-inline-end: 0; padding-inline-start: 20px; padding-bottom: 20px; @@ -156,7 +138,7 @@ padding-inline: 12px 16px; } - :host([is-printer-settings-revamp-enabled_]) .section-title { + .section-title { font: var(--cros-button-2-font); } </style> @@ -185,54 +167,31 @@ </div> </template> -<template is="dom-if" if="[[showSavedPrintersSection_(savedPrinters_)]]" - restamp> - <div id="savedPrintersContainer"> - <div id="savedPrintersDescription" class="settings-box first"> - <div class="start"> - <span aria-label$="[[savedPrintersAriaLabel_]]" class="section-title"> - $i18n{savedPrintersTitle} - </span> - <div class="secondary" hidden="[[!isPrinterSettingsRevampEnabled_]]" - aria-hidden="true"> - $i18n{savedPrintersSubtext} - </div> +<div id="savedPrintersContainer"> + <div id="savedPrintersDescription" class="settings-box first"> + <div class="start"> + <span aria-label$="[[savedPrintersAriaLabel_]]" class="section-title"> + $i18n{savedPrintersTitle} + </span> + <div class="secondary" aria-hidden="true"> + $i18n{savedPrintersSubtext} </div> </div> - <div id="noSavedPrinters" class="list-frame secondary" - hidden="[[doesAccountHaveSavedPrinters_(savedPrinters_)]]"> - $i18n{noSavedPrinters} - </div> + </div> + <div id="noSavedPrinters" class="list-frame secondary" + hidden="[[doesAccountHaveSavedPrinters_(savedPrinters_)]]"> + $i18n{noSavedPrinters} + </div> - <settings-cups-saved-printers id="savedPrinters" - active-printer="{{activePrinter}}" - search-term="[[searchTerm]]" - printers-count="{{savedPrinterCount_}}"> - </settings-cups-saved-printers> - </div> -</template> + <settings-cups-saved-printers id="savedPrinters" + active-printer="{{activePrinter}}" + search-term="[[searchTerm]]" + printers-count="{{savedPrinterCount_}}"> + </settings-cups-saved-printers> +</div> <template is="dom-if" if="[[attemptedLoadingPrinters_]]"> - <div id="nearbyPrinters" class="padded first nearby-printers-section" - hidden="[[isPrinterSettingsRevampEnabled_]]"> - <div aria-label$="[[nearbyPrintersAriaLabel_]]" class="section-title"> - $i18n{nearbyPrintersListTitle} - </div> - <localized-link class="secondary" - localized-string="$i18n{nearbyPrintersListDescription}" - link-url="$i18n{printingCUPSPrintLearnMoreUrl}"> - </localized-link> - <template is="dom-if" if="[[!addPrinterButtonActive_( - hasActiveNetworkConnection, - prefs.native_printing.user_native_printers_allowed.value)]]"> - <cr-policy-pref-indicator - pref="[[prefs.native_printing.user_native_printers_allowed]]" - icon-aria-label="$i18n{printingPageTitle}"> - </cr-policy-pref-indicator> - </template> - </div> <div id="nearbyPrintersRevamp" class="padded first nearby-printers-section" - hidden="[[!showNearbyPrintersRevampSection_( - isPrinterSettingsRevampEnabled_, hasActiveNetworkConnection)]]"> + hidden="[[!hasActiveNetworkConnection]]"> <div id="nearbyPrintersDescription" aria-hidden="true"> <div id="availablePrintersReadyTitle" aria-label$="[[nearbyPrintersAriaLabel_]]" @@ -260,30 +219,10 @@ </cr-policy-pref-indicator> </div> - <!-- When the revamp flag is enabled hide this Add printer section so - the revamp Add printer section will be shown in the correct order. --> - <div id="addPrinterSection" class="list-frame add-printer-section" - hidden="[[isPrinterSettingsRevampEnabled_]]"> - <div class="layout horizontal center custom-list-item-bottom"> - <div id="addPrinterText" aria-hidden="true"> - $i18n{addCupsPrinter} - </div> - <cr-icon-button id="addManualPrinterIcon" - class="action-button add-manual-printer-icon" - iron-icon="os-settings:printer-add" - on-click="onAddPrinterClick_" - disabled="[[!addPrinterButtonActive_(hasActiveNetworkConnection, - prefs.native_printing.user_native_printers_allowed.value)]]" - title="$i18n{addCupsPrinter}" - deep-link-focus-id$="[[Setting.kAddPrinter]]"> - </cr-icon-button> - </div> - </div> - <template is="dom-if" if="[[hasActiveNetworkConnection]]" restamp> <div id="collapsibleSection" hidden="[[!nearbyPrintersExpanded_]]"> - <div id="helpSection" hidden="[[!isPrinterSettingsRevampEnabled_]]"> + <div id="helpSection"> <div id="helpIconSection"> <iron-icon icon="os-settings:printer-setup"></iron-icon> </div> @@ -306,8 +245,7 @@ active-printer="{{activePrinter}}" printers-count="{{nearbyPrinterCount_}}"> </settings-cups-nearby-printers> - <div id="addPrinterSectionRevamp" class="list-frame add-printer-section" - hidden="[[!isPrinterSettingsRevampEnabled_]]"> + <div id="addPrinterSectionRevamp" class="list-frame add-printer-section"> <div id="addPrinterSectionRevampContainer" class="layout horizontal center custom-list-item-top"> <cr-button id="addManualPrinterButtonRevamp"
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_printers.ts b/chrome/browser/resources/ash/settings/os_printing_page/cups_printers.ts index dc73c6da..2f54a375 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_printers.ts +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_printers.ts
@@ -227,18 +227,6 @@ reflectToAttribute: true, }, - /** - * True when the "printer-settings-revamp" feature flag is enabled. - */ - isPrinterSettingsRevampEnabled_: { - type: Boolean, - value: () => { - return loadTimeData.getBoolean('isPrinterSettingsRevampEnabled'); - }, - readOnly: true, - reflectToAttribute: true, - }, - isRevampWayfindingEnabled_: { type: Boolean, value: () => { @@ -274,7 +262,6 @@ private showCupsEditPrinterDialog_: boolean; private nearbyPrintersExpanded_: boolean; private nearbyPrintersEmpty_: boolean; - private isPrinterSettingsRevampEnabled_: boolean; constructor() { super(); @@ -289,17 +276,12 @@ this.browserProxy_ = CupsPrintersBrowserProxyImpl.getInstance(); - if (this.isPrinterSettingsRevampEnabled_) { - // This request is made in the constructor to fetch the # of saved - // printers for determining whether the nearby printers section should - // start open or closed. - this.browserProxy_.getCupsSavedPrintersList().then( - savedPrinters => this.nearbyPrintersExpanded_ = - savedPrinters.printerList.length === 0); - } else { - // Nearby printers should always show when the revamp flag is disabled. - this.nearbyPrintersExpanded_ = true; - } + // This request is made in the constructor to fetch the # of saved + // printers for determining whether the nearby printers section should + // start open or closed. + this.browserProxy_.getCupsSavedPrintersList().then( + savedPrinters => this.nearbyPrintersExpanded_ = + savedPrinters.printerList.length === 0); } override connectedCallback(): void { @@ -489,7 +471,7 @@ private onAddPrinterDialogClose_(): void { const icon = this.shadowRoot!.querySelector<CrIconButtonElement>( - '#addManualPrinterIcon'); + '#addManualPrinterButtonRevamp'); assert(icon); focusWithoutInk(icon); } @@ -521,11 +503,6 @@ return connectedToNetwork && userPrintersAllowed; } - private showSavedPrintersSection_(): boolean { - return this.isPrinterSettingsRevampEnabled_ || - this.doesAccountHaveSavedPrinters_(); - } - private doesAccountHaveSavedPrinters_(): boolean { return !!this.savedPrinters_.length; } @@ -571,7 +548,6 @@ } private toggleClicked_(): void { - assert(this.isPrinterSettingsRevampEnabled_); this.nearbyPrintersExpanded_ = !this.nearbyPrintersExpanded_; // The iron list containing nearby printers does not get rendered while @@ -595,11 +571,6 @@ return this.nearbyPrinterCount_ === 0; } - private showNearbyPrintersRevampSection_(): boolean { - return this.isPrinterSettingsRevampEnabled_ && - this.hasActiveNetworkConnection; - } - private onClickPrintManagement_(): void { this.browserProxy_.openPrintManagementApp(); }
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_printers_entry.html b/chrome/browser/resources/ash/settings/os_printing_page/cups_printers_entry.html index 8425382..89e9daed 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_printers_entry.html +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_printers_entry.html
@@ -15,10 +15,6 @@ } .entry-icon { - flex-basis: 40px; - } - - :host([is-printer-settings-revamp-enabled_]) .entry-icon { flex-basis: 20px; padding-inline: 20px 16px; }
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_printers_entry.ts b/chrome/browser/resources/ash/settings/os_printing_page/cups_printers_entry.ts index 5d2131ec..b07223e 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_printers_entry.ts +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_printers_entry.ts
@@ -82,18 +82,6 @@ }, /** - * True when the "printer-settings-revamp" feature flag is enabled. - */ - isPrinterSettingsRevampEnabled_: { - type: Boolean, - value: () => { - return loadTimeData.getBoolean('isPrinterSettingsRevampEnabled'); - }, - readOnly: true, - reflectToAttribute: true, - }, - - /** * True when the "print-preview-discovered-printers" feature flag is * enabled. */ @@ -114,7 +102,6 @@ printerStatusReasonCache: Map<string, PrinterStatusReason>; numPrinters: number; private hasHighSeverityError_: boolean; - private isPrinterSettingsRevampEnabled_: boolean; private isPrinterSettingsPrinterStatusEnabled_: boolean; private isPrintPreviewDiscoveredPrintersEnabled_: boolean; @@ -208,8 +195,7 @@ // printers. An exception is enterprise printers which display the managed // icon. private showNearbyPrinterIcon_(): boolean { - return !this.isSavedPrinter_() && !this.isEnterprisePrinter_() && - this.isPrinterSettingsRevampEnabled_; + return !this.isSavedPrinter_() && !this.isEnterprisePrinter_(); } // Printer status icons are only shown for saved printers.
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_saved_printers.html b/chrome/browser/resources/ash/settings/os_printing_page/cups_saved_printers.html index 1f488744..ce2ca83 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_saved_printers.html +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_saved_printers.html
@@ -11,25 +11,16 @@ #show-more-container { align-items: center; + margin-inline-end: 20px; /** Height of iron list row entry. */ min-height: var(--cr-section-min-height); } - :host([is-printer-settings-revamp-enabled_]) #show-more-container { - margin-inline-end: 20px; - } - /** Border line that is the same size as a list entry's border. */ #show-more-line-separator { border-bottom: var(--cr-separator-line); - margin-inline-end: 20px; - margin-inline-start: 60px; - position: relative; - width: 596px; - } - - :host([is-printer-settings-revamp-enabled_]) #show-more-line-separator { margin-inline: 0; + position: relative; width: auto; } @@ -41,7 +32,7 @@ flex: 1; } - :host([is-printer-settings-revamp-enabled_]) .list-frame { + .list-frame { padding-inline: 0; } </style>
diff --git a/chrome/browser/resources/ash/settings/os_printing_page/cups_saved_printers.ts b/chrome/browser/resources/ash/settings/os_printing_page/cups_saved_printers.ts index d3ed831..d18140c5 100644 --- a/chrome/browser/resources/ash/settings/os_printing_page/cups_saved_printers.ts +++ b/chrome/browser/resources/ash/settings/os_printing_page/cups_saved_printers.ts
@@ -190,18 +190,6 @@ }, /** - * True when the "printer-settings-revamp" feature flag is enabled. - */ - isPrinterSettingsRevampEnabled_: { - type: Boolean, - value: () => { - return loadTimeData.getBoolean('isPrinterSettingsRevampEnabled'); - }, - readOnly: true, - reflectToAttribute: true, - }, - - /** * True when the "local-printer-observing" feature flag is enabled. */ isLocalPrinterObservingEnabled_: {
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test.js index a355e90..e206581 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test.js +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test.js
@@ -498,7 +498,7 @@ // The BrowDown gesture is special because it is the combination of two // separate facial gestures. This test ensures that the associated action is -// only performed when both gestures are detected. +// performed if either of the gestures is detected. AX_TEST_F('FaceGazeTest', 'BrowDownGesture', async function() { const gestureToMacroName = new Map().set(FacialGesture.BROWS_DOWN, MacroName.RESET_CURSOR); @@ -512,7 +512,7 @@ let result = new MockFaceLandmarkerResult() - .addGestureWithConfidence(MediapipeFacialGesture.BROW_DOWN_LEFT, 0.9) + .addGestureWithConfidence(MediapipeFacialGesture.BROW_DOWN_LEFT, 0.3) .addGestureWithConfidence( MediapipeFacialGesture.BROW_DOWN_RIGHT, 0.3); this.processFaceLandmarkerResult( @@ -521,12 +521,27 @@ result = new MockFaceLandmarkerResult() + .addGestureWithConfidence(MediapipeFacialGesture.BROW_DOWN_LEFT, 0.9) + .addGestureWithConfidence( + MediapipeFacialGesture.BROW_DOWN_RIGHT, 0.3); + this.processFaceLandmarkerResult( + result, /*triggerMouseControllerInterval=*/ true); + assertEquals(600, this.mockAccessibilityPrivate.getLatestCursorPosition().x); + assertEquals(400, this.mockAccessibilityPrivate.getLatestCursorPosition().y); + this.mockAccessibilityPrivate.clearCursorPosition(); + this.clearGestureLastRecognizedTime(); + + result = + new MockFaceLandmarkerResult() .addGestureWithConfidence(MediapipeFacialGesture.BROW_DOWN_LEFT, 0.3) .addGestureWithConfidence( MediapipeFacialGesture.BROW_DOWN_RIGHT, 0.9); this.processFaceLandmarkerResult( result, /*triggerMouseControllerInterval=*/ true); - assertEquals(null, this.mockAccessibilityPrivate.getLatestCursorPosition()); + assertEquals(600, this.mockAccessibilityPrivate.getLatestCursorPosition().x); + assertEquals(400, this.mockAccessibilityPrivate.getLatestCursorPosition().y); + this.mockAccessibilityPrivate.clearCursorPosition(); + this.clearGestureLastRecognizedTime(); result = new MockFaceLandmarkerResult()
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test_base.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test_base.js index 7f25572..d35c5579 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test_base.js +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test_base.js
@@ -152,6 +152,7 @@ assertNotNullNorUndefined(accessibilityCommon); assertNotNullNorUndefined(FaceGaze); assertNotNullNorUndefined(FacialGesture); + assertNotNullNorUndefined(GestureHandler); assertNotNullNorUndefined(MediapipeFacialGesture); assertNotNullNorUndefined(FacialGesturesToMediapipeGestures); assertNotNullNorUndefined(MouseController); @@ -200,8 +201,14 @@ } if (config.gestureToMacroName) { - faceGaze.gestureHandler_.gestureToMacroName_ = - new Map(config.gestureToMacroName); + const gestureToMacroName = {}; + for (const [gesture, macroName] of config.gestureToMacroName) { + // Map from enums to the string version of the macro name. + gestureToMacroName[gesture] = + Object.keys(MacroName).find(key => MacroName[key] === macroName); + } + await this.setPref( + GestureHandler.GESTURE_TO_MACRO_PREF, gestureToMacroName); } if (config.gestureToConfidence) { @@ -252,4 +259,9 @@ this.triggerMouseControllerInterval(); } } + + /** Clears the timestamps at which gestures were last recognized. */ + clearGestureLastRecognizedTime() { + this.getFaceGaze().gestureHandler_.gestureLastRecognized_.clear(); + } };
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/gesture_detector.ts b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/gesture_detector.ts index c033f7c..40b0da3 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/gesture_detector.ts +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/gesture_detector.ts
@@ -8,12 +8,18 @@ /** * The facial gestures that are supported by FaceGaze. New values should also * be added to FacialGesturesToMediapipeGestures. + * Note that these correspond to values in + * facegaze_facial_expression_subpage.ts, and if these values get changed, those + * should too. */ export enum FacialGesture { BROWS_DOWN = 'browsDown', BROW_INNER_UP = 'browInnerUp', + EYES_LOOK_DOWN = 'eyesLookDown', + EYES_LOOK_UP = 'eyesLookUp', JAW_OPEN = 'jawOpen', MOUTH_LEFT = 'mouthLeft', + MOUTH_PUCKER = 'mouthPucker', MOUTH_RIGHT = 'mouthRight', } @@ -22,8 +28,13 @@ BROW_DOWN_LEFT = 'browDownLeft', BROW_DOWN_RIGHT = 'browDownRight', BROW_INNER_UP = 'browInnerUp', + EYE_LOOK_DOWN_LEFT = 'eyeLookDownLeft', + EYE_LOOK_DOWN_RIGHT = 'eyeLookDownRight', + EYE_LOOK_UP_LEFT = 'eyeLookUpLeft', + EYE_LOOK_UP_RIGHT = 'eyeLookUpRight', JAW_OPEN = 'jawOpen', MOUTH_LEFT = 'mouthLeft', + MOUTH_PUCKER = 'mouthPucker', MOUTH_RIGHT = 'mouthRight', } @@ -43,6 +54,21 @@ [FacialGesture.JAW_OPEN, [MediapipeFacialGesture.JAW_OPEN]], [FacialGesture.MOUTH_LEFT, [MediapipeFacialGesture.MOUTH_LEFT]], [FacialGesture.MOUTH_RIGHT, [MediapipeFacialGesture.MOUTH_RIGHT]], + [FacialGesture.MOUTH_PUCKER, [MediapipeFacialGesture.MOUTH_PUCKER]], + [ + FacialGesture.EYES_LOOK_DOWN, + [ + MediapipeFacialGesture.EYE_LOOK_DOWN_LEFT, + MediapipeFacialGesture.EYE_LOOK_DOWN_RIGHT, + ], + ], + [ + FacialGesture.EYES_LOOK_UP, + [ + MediapipeFacialGesture.EYE_LOOK_UP_LEFT, + MediapipeFacialGesture.EYE_LOOK_UP_RIGHT, + ], + ], ]); export class GestureDetector { @@ -85,16 +111,17 @@ } // Score will be the minimum from among the compound gestures. - let score = 100; + let score = -1; let hasCompoundGesture = true; for (const mediapipeGesture of mediapipeGestures) { if (!recognizedGestures.has(mediapipeGesture)) { hasCompoundGesture = false; break; } - // The score of a compound gesture is the minimum of its component - // parts. - score = Math.min(score, recognizedGestures.get(mediapipeGesture)); + // The score of a compound gesture is the maximum of its component + // parts. This is max instead of min in case people have uneven + // facial strength or dexterity. + score = Math.max(score, recognizedGestures.get(mediapipeGesture)); } if (!hasCompoundGesture) { continue;
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/gesture_handler.ts b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/gesture_handler.ts index 67f7db3e..1f583ad 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/gesture_handler.ts +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/gesture_handler.ts
@@ -6,12 +6,15 @@ import {MacroName} from '/common/action_fulfillment/macros/macro_names.js'; import {MouseClickMacro} from '/common/action_fulfillment/macros/mouse_click_macro.js'; import {ToggleDictationMacro} from '/common/action_fulfillment/macros/toggle_dictation_macro.js'; +import {TestImportManager} from '/common/testing/test_import_manager.js'; import type {FaceLandmarkerResult} from '/third_party/mediapipe/vision.js'; import {FacialGesture, GestureDetector} from './gesture_detector.js'; import {ResetCursorMacro} from './macros/reset_cursor_macro.js'; import {MouseController} from './mouse_controller.js'; +type PrefObject = chrome.settingsPrivate.PrefObject; + /** * Handles converting facial gestures to Macros. */ @@ -20,29 +23,49 @@ private gestureToConfidence_: Map<FacialGesture, number> = new Map(); private gestureLastRecognized_: Map<FacialGesture, number> = new Map(); private mouseController_: MouseController; + private prefsListener_: (prefs: any) => void; constructor(mouseController: MouseController) { this.mouseController_ = mouseController; - // Initialize default mapping of facial gestures to actions. - // TODO(b/309121742): Set this using the user's preferences. - this.gestureToMacroName_ - .set(FacialGesture.JAW_OPEN, MacroName.MOUSE_CLICK_LEFT) - .set(FacialGesture.BROW_INNER_UP, MacroName.MOUSE_CLICK_RIGHT) - .set(FacialGesture.BROWS_DOWN, MacroName.RESET_CURSOR); + this.prefsListener_ = prefs => this.updateFromPrefs_(prefs); + chrome.settingsPrivate.getAllPrefs(prefs => this.updateFromPrefs_(prefs)); + chrome.settingsPrivate.onPrefsChanged.addListener(this.prefsListener_); + } - // Initialize default mapping of facial gestures to confidence - // threshold. - // TODO(b/309121742): Set this using the user's preferences. - this.gestureToConfidence_ - .set( - FacialGesture.JAW_OPEN, GestureHandler.DEFAULT_CONFIDENCE_THRESHOLD) - .set( - FacialGesture.BROW_INNER_UP, - GestureHandler.DEFAULT_CONFIDENCE_THRESHOLD) - .set( - FacialGesture.BROWS_DOWN, - GestureHandler.DEFAULT_CONFIDENCE_THRESHOLD); + private updateFromPrefs_(prefs: PrefObject[]): void { + prefs.forEach(pref => { + switch (pref.key) { + case GestureHandler.GESTURE_TO_MACRO_PREF: + if (pref.value) { + // Update the whole map from this preference. + this.gestureToMacroName_.clear(); + if (Object.entries(pref.value).length === 0) { + // TODO(b:322510392): Remove this hard-coded mapping after + // settings page lands when users can pick their own mappings. + pref.value[FacialGesture.JAW_OPEN] = 'MOUSE_CLICK_LEFT'; + pref.value[FacialGesture.BROW_INNER_UP] = 'MOUSE_CLICK_RIGHT'; + pref.value[FacialGesture.BROWS_DOWN] = 'RESET_CURSOR'; + } + for (const [gesture, assignedAction] of Object.entries( + pref.value)) { + if (assignedAction === '') { + continue; + } + this.gestureToMacroName_.set( + gesture as FacialGesture, + MacroName[assignedAction as keyof typeof MacroName]); + // TODO(b/309121742): Set this using the user's preferences. + this.gestureToConfidence_.set( + gesture as FacialGesture, + GestureHandler.DEFAULT_CONFIDENCE_THRESHOLD); + } + } + break; + default: + return; + } + }); } detectMacros(result: FaceLandmarkerResult): Macro[] { @@ -103,4 +126,12 @@ /** Minimum repeat rate of a gesture. */ // TODO(b:322511275): Move to a pref in settings. export const DEFAULT_REPEAT_DELAY_MS = 500; + + /** + * Pref name of preference mapping facegaze gestures to macro action names. + */ + export const GESTURE_TO_MACRO_PREF = + 'settings.a11y.face_gaze.gestures_to_macros'; } + +TestImportManager.exportForTesting(GestureHandler);
diff --git a/chrome/browser/resources/chromeos/accessibility/common/testing/assert_additions.js b/chrome/browser/resources/chromeos/accessibility/common/testing/assert_additions.js index baf0c542..11350a7 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/testing/assert_additions.js +++ b/chrome/browser/resources/chromeos/accessibility/common/testing/assert_additions.js
@@ -142,5 +142,33 @@ } } +/** + * Asserts two objects have the same key/value pairs. + * @param {Object} objectA + * @param {Object} objectB + */ +function assertObjectEquals(objectA, objectB) { + const keysA = Object.keys(objectA); + const keysB = Object.keys(objectB); + assertEquals( + keysA.length, keysB.length, 'Expected ', keysA.length, ' keys, but got ', + keysB.length, 'keys.'); + for (const key of keysA) { + assertTrue(key in objectB, 'Key in expected not present in actual', key); + const type = typeof (objectA[key]); + if (type === 'array') { + assertArraysEquals(objectA[key], objectB[key]); + } else if (type === 'object') { + assertObjectEquals(objectA[key], objectB[key]); + } else { + assertEquals( + objectA[key], objectB[key], + 'Expected key ' + key + ' to have value ' + objectA[key] + + ', actual: ', + objectB[key]); + } + } +} + assertSame = assertEquals; assertNotSame = assertNotEquals;
diff --git a/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js b/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js index f7955dcf..b7fb11aa 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js +++ b/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js
@@ -425,7 +425,11 @@ // Wait for changes to fully propagate. const result = await (this.getPref(name)); assertEquals(result.key, name); - assertEquals(result.value, value); + if (typeof (value) === 'object') { + assertObjectEquals(value, result.value); + } else { + assertEquals(value, result.value); + } resolve(); }); });
diff --git a/chrome/browser/resources/chromeos/login/screens/osauth/password_selection.html b/chrome/browser/resources/chromeos/login/screens/osauth/password_selection.html index b18025ff..1c0faa7 100644 --- a/chrome/browser/resources/chromeos/login/screens/osauth/password_selection.html +++ b/chrome/browser/resources/chromeos/login/screens/osauth/password_selection.html
@@ -24,7 +24,7 @@ </h1> <div slot="content" class="layout vertical landscape-vertical-centered"> <cr-radio-group id="userType" selected="{{selectedPasswordType}}"> - <cr-card-radio-button id="localPasswordButton" class="flex" + <cr-card-radio-button id="localPasswordButton" class="focus-on-show" name="[[passwordTypeEnum.LOCAL_PASSWORD]]"> <div class="card-container"> <iron-icon icon="oobe-32:password" class="card-icon"> @@ -55,7 +55,7 @@ </oobe-back-button> </div> <div slot="bottom-buttons"> - <oobe-next-button id="nextButton" class="focus-on-show" + <oobe-next-button id="nextButton" on-click="onNextClicked" disabled="[[!selectedPasswordType]]"> </oobe-next-button> </div>
diff --git a/chrome/browser/resources/extensions/activity_log/activity_log.html b/chrome/browser/resources/extensions/activity_log/activity_log.html index e1b095b..2b081d6 100644 --- a/chrome/browser/resources/extensions/activity_log/activity_log.html +++ b/chrome/browser/resources/extensions/activity_log/activity_log.html
@@ -51,7 +51,8 @@ [[getActivityLogHeading_(extensionInfo)]] </div> </div> - <cr-tabs selected="{{selectedSubpage_}}" tab-names="[[tabNames_]]"> + <cr-tabs id="tabs" selected="{{selectedSubpage_}}" + tab-names="[[tabNames_]]"> </cr-tabs> <iron-pages selected="[[selectedSubpage_]]"> <div>
diff --git a/chrome/browser/resources/extensions/activity_log/activity_log.ts b/chrome/browser/resources/extensions/activity_log/activity_log.ts index e728542d..f89812f 100644 --- a/chrome/browser/resources/extensions/activity_log/activity_log.ts +++ b/chrome/browser/resources/extensions/activity_log/activity_log.ts
@@ -14,6 +14,8 @@ import '../shared_style.css.js'; import '../shared_vars.css.js'; +import {NONE_SELECTED} from 'chrome://resources/cr_elements/cr_tabs/cr_tabs.js'; +import type {CrTabsElement} from 'chrome://resources/cr_elements/cr_tabs/cr_tabs.js'; import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'; import {focusWithoutInk} from 'chrome://resources/js/focus_without_ink.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; @@ -31,7 +33,6 @@ * real time. NONE is used when user is away from the page. */ const enum ActivityLogSubpage { - NONE = -1, HISTORY = 0, STREAM = 1, } @@ -50,6 +51,7 @@ export interface ExtensionsActivityLogElement { $: { closeButton: HTMLElement, + tabs: CrTabsElement, }; } @@ -76,7 +78,7 @@ selectedSubpage_: { type: Number, - value: ActivityLogSubpage.NONE, + value: NONE_SELECTED, observer: 'onSelectedSubpageChanged_', }, @@ -112,10 +114,11 @@ } /** - * Set |selectedSubpage_| to NONE to remove the active view from the DOM. + * Set |selectedSubpage_| to NONE_SELECTED to remove the active view from the + * DOM. */ private onViewExitFinish_() { - this.selectedSubpage_ = ActivityLogSubpage.NONE; + this.selectedSubpage_ = NONE_SELECTED; // clear the stream if the user is exiting the activity log page. const activityLogStream = this.shadowRoot!.querySelector('activity-log-stream');
diff --git a/chrome/browser/resources/history/app.ts b/chrome/browser/resources/history/app.ts index 245aaab7..84386650 100644 --- a/chrome/browser/resources/history/app.ts +++ b/chrome/browser/resources/history/app.ts
@@ -201,8 +201,7 @@ historyClustersPath_: { type: String, - value: () => - loadTimeData.getBoolean('renameJourneys') ? 'grouped' : 'journeys', + value: 'grouped', }, showHistoryClusters_: {
diff --git a/chrome/browser/resources/history/router.ts b/chrome/browser/resources/history/router.ts index 5ebdf66..0068f82 100644 --- a/chrome/browser/resources/history/router.ts +++ b/chrome/browser/resources/history/router.ts
@@ -5,7 +5,6 @@ import 'chrome://resources/polymer/v3_0/iron-location/iron-location.js'; import 'chrome://resources/polymer/v3_0/iron-location/iron-query-params.js'; -import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {Debouncer, microTask, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import type {QueryState} from './externs.js'; @@ -16,8 +15,7 @@ // these values for better type check when `loadTimeData` is no longer needed. export const Page = { HISTORY: 'history', - HISTORY_CLUSTERS: loadTimeData.getBoolean('renameJourneys') ? 'grouped' : - 'journeys', + HISTORY_CLUSTERS: 'grouped', SYNCED_TABS: 'syncedTabs', };
diff --git a/chrome/browser/resources/history/side_bar.html b/chrome/browser/resources/history/side_bar.html index d1a8a5d95c..a0b4f34 100644 --- a/chrome/browser/resources/history/side_bar.html +++ b/chrome/browser/resources/history/side_bar.html
@@ -96,19 +96,6 @@ </a> <!-- tabindex is needed below because <a> without href attribute is not focusable in sequential keyboard navigation by default. --> - <a role="menuitem" id="toggle-history-clusters" - class="cr-nav-menu-item" - tabindex="0" - on-click="onToggleHistoryClustersClick_" - on-keydown="onToggleHistoryClustersKeydown_" - on-mousedown="onToggleHistoryClustersMousedown_" - hidden="[[!showToggleHistoryClusters_]]"> - <iron-icon icon="[[getToggleHistoryClustersItemIcon_( - historyClustersVisible)]]"> - </iron-icon> - [[getToggleHistoryClustersItemLabel_(historyClustersVisible)]] - <paper-ripple id="thc-ripple"></paper-ripple> - </a> <a role="menuitem" id="clear-browsing-data" class="cr-nav-menu-item" href="chrome://settings/clearBrowserData"
diff --git a/chrome/browser/resources/history/side_bar.ts b/chrome/browser/resources/history/side_bar.ts index 564a884..b20051b 100644 --- a/chrome/browser/resources/history/side_bar.ts +++ b/chrome/browser/resources/history/side_bar.ts
@@ -16,8 +16,6 @@ import './shared_vars.css.js'; import './strings.m.js'; -import {BrowserProxyImpl} from 'chrome://resources/cr_components/history_clusters/browser_proxy.js'; -import {MetricsProxyImpl} from 'chrome://resources/cr_components/history_clusters/metrics_proxy.js'; import type {CrMenuSelector} from 'chrome://resources/cr_elements/cr_menu_selector/cr_menu_selector.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import type {PaperRippleElement} from 'chrome://resources/polymer/v3_0/paper-ripple/paper-ripple.js'; @@ -85,11 +83,6 @@ }, }, - renameJourneys_: { - type: Boolean, - value: () => loadTimeData.getBoolean('renameJourneys'), - }, - /** * Used to display notices for profile sign-in status and managed status. */ @@ -104,13 +97,6 @@ computed: 'computeShowHistoryClusters_(' + 'historyClustersEnabled, historyClustersVisible)', }, - - showToggleHistoryClusters_: { - type: Boolean, - computed: 'computeShowToggleHistoryClusters_(' + - 'historyClustersEnabled, historyClustersVisibleManagedByPolicy_, ' + - 'renameJourneys_)', - }, }; } @@ -121,7 +107,6 @@ selectedTab: number; private guestSession_ = loadTimeData.getBoolean('isGuestSession'); private historyClustersVisibleManagedByPolicy_: boolean; - private renameJourneys_: boolean; private showFooter_: boolean; private showHistoryClusters_: boolean; @@ -186,43 +171,6 @@ Page.HISTORY; } - private getToggleHistoryClustersItemIcon_(): string { - return `history:journeys-${this.historyClustersVisible ? 'off' : 'on'}`; - } - - private getToggleHistoryClustersItemLabel_(): string { - return loadTimeData.getString( - this.historyClustersVisible ? 'disableHistoryClusters' : - 'enableHistoryClusters'); - } - - private onToggleHistoryClustersClick_() { - MetricsProxyImpl.getInstance().recordToggledVisibility( - !this.historyClustersVisible); - BrowserProxyImpl.getInstance() - .handler.toggleVisibility(!this.historyClustersVisible) - .then(({visible}) => { - this.historyClustersVisible = visible; - this.selectedTab = TABBED_PAGES.indexOf( - visible ? Page.HISTORY_CLUSTERS : Page.HISTORY); - }); - - this.$['thc-ripple'].upAction(); - } - - private onToggleHistoryClustersKeydown_(e: KeyboardEvent) { - // Handle 'Enter' keypress because the menu item is missing href attribute. - if (e.key === 'Enter') { - this.onToggleHistoryClustersClick_(); - } - } - - private onToggleHistoryClustersMousedown_(e: MouseEvent) { - // The menu item steals the focus on mousedown event because it is given a - // tabindex="0" so that it is focusable in sequential keyboard navigation. - e.preventDefault(); - } - private computeShowFooter_( includeOtherFormsOfBrowsingHistory: boolean, managed: boolean): boolean { return includeOtherFormsOfBrowsingHistory || managed; @@ -231,11 +179,6 @@ private computeShowHistoryClusters_(): boolean { return this.historyClustersEnabled && this.historyClustersVisible; } - - private computeShowToggleHistoryClusters_(): boolean { - return this.historyClustersEnabled && - !this.historyClustersVisibleManagedByPolicy_ && !this.renameJourneys_; - } } declare global {
diff --git a/chrome/browser/resources/new_tab_page/modules/v2/tab_resumption/module.html b/chrome/browser/resources/new_tab_page/modules/v2/tab_resumption/module.html index f96b98a..501efcc 100644 --- a/chrome/browser/resources/new_tab_page/modules/v2/tab_resumption/module.html +++ b/chrome/browser/resources/new_tab_page/modules/v2/tab_resumption/module.html
@@ -134,6 +134,7 @@ .tab-device { height: 14px; + margin-bottom: auto; margin-inline: 0 4px; margin-top: auto; width: 14px;
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html index 0ae652b4d..39c2b8d 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html
@@ -145,12 +145,13 @@ <div>$i18n{clearBrowsingData}</div> </div> <div slot="header"> - <cr-tabs tab-names="[[tabsNames_]]" selected="{{selectedTabIndex_}}" + <cr-tabs id="tabs" tab-names="[[tabsNames_]]" + selected="{{selectedTabIndex_}}" on-selected-changed="recordTabChange_"> </cr-tabs> </div> <div slot="body"> - <iron-pages id="tabs" selected="[[selectedTabIndex_]]" + <iron-pages id="pages" selected="[[selectedTabIndex_]]" on-selected-item-changed="updateClearButtonState_"> <div id="basic-tab"> <div class="row time-range-row">
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.ts b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.ts index 41957c5..879f2d3 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.ts +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.ts
@@ -24,6 +24,7 @@ import {PrefsMixin} from 'chrome://resources/cr_components/settings_prefs/prefs_mixin.js'; import {getInstance as getAnnouncerInstance} from 'chrome://resources/cr_elements/cr_a11y_announcer/cr_a11y_announcer.js'; import type {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; +import type {CrTabsElement} from 'chrome://resources/cr_elements/cr_tabs/cr_tabs.js'; import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'; import {WebUiListenerMixin} from 'chrome://resources/cr_elements/web_ui_listener_mixin.js'; import {assert} from 'chrome://resources/js/assert.js'; @@ -64,7 +65,8 @@ cookiesCheckbox: SettingsCheckboxElement, cookiesCheckboxBasic: SettingsCheckboxElement, clearBrowsingDataDialog: CrDialogElement, - tabs: IronPagesElement, + pages: IronPagesElement, + tabs: CrTabsElement, }; } @@ -419,12 +421,12 @@ private updateClearButtonState_() { // on-select-item-changed gets called with undefined during a tab change. // https://github.com/PolymerElements/iron-selector/issues/95 - const tab = this.$.tabs.selectedItem; - if (!tab) { + const page = this.$.pages.selectedItem; + if (!page) { return; } this.clearButtonDisabled_ = - this.getSelectedDataTypes_(tab as HTMLElement).length === 0; + this.getSelectedDataTypes_(page as HTMLElement).length === 0; } /** @@ -522,8 +524,8 @@ /** * @return A list of selected data types. */ - private getSelectedDataTypes_(tab: HTMLElement): string[] { - const checkboxes = tab.querySelectorAll('settings-checkbox'); + private getSelectedDataTypes_(page: HTMLElement): string[] { + const checkboxes = page.querySelectorAll('settings-checkbox'); const dataTypes: string[] = []; checkboxes.forEach((checkbox) => { if (checkbox.checked && !checkbox.hidden) { @@ -551,14 +553,14 @@ 'settings-dropdown-menu[no-set-pref]') .forEach(dropdown => dropdown.sendPrefChange()); - const tab = this.$.tabs.selectedItem as HTMLElement; - const dataTypes = this.getSelectedDataTypes_(tab); + const page = this.$.pages.selectedItem as HTMLElement; + const dataTypes = this.getSelectedDataTypes_(page); const dropdownMenu = - tab.querySelector<SettingsDropdownMenuElement>('.time-range-select'); + page.querySelector<SettingsDropdownMenuElement>('.time-range-select'); assert(dropdownMenu); const timePeriod = dropdownMenu.pref!.value; - if (tab.id === 'basic-tab') { + if (page.id === 'basic-tab') { chrome.metricsPrivate.recordUserAction('ClearBrowsingData_BasicTab'); } else { chrome.metricsPrivate.recordUserAction('ClearBrowsingData_AdvancedTab');
diff --git a/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_manage_topics_subpage.html b/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_manage_topics_subpage.html index d6cf20c..c7b7d11 100644 --- a/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_manage_topics_subpage.html +++ b/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_manage_topics_subpage.html
@@ -1,14 +1,12 @@ <style include="cr-shared-style settings-shared iron-flex"> #explanationText { - padding: 0 var(--cr-section-padding); + padding: 4px var(--cr-section-padding) 12px; } .outer-row { align-items: center; display: flex; min-height: var(--cr-section-two-line-min-height); - --cr-icon-button-margin-end: 20px; - padding: 0 var(--cr-section-padding); width: 100%; } @@ -17,9 +15,8 @@ } .topic-toggle-row { - align-items: center; - display: flex; - width: 100% + --cr-icon-button-margin-end: 20px; + padding: 0 var(--cr-section-padding); } .icon { @@ -27,7 +24,7 @@ } .label-wrapper { - padding: var(--cr-section-vertical-padding) 0; + padding: 16px 0; margin-inline-end: 20px; }
diff --git a/chrome/browser/resources/side_panel/read_anything/app.html b/chrome/browser/resources/side_panel/read_anything/app.html index bf4f52c..0f00a1e4 100644 --- a/chrome/browser/resources/side_panel/read_anything/app.html +++ b/chrome/browser/resources/side_panel/read_anything/app.html
@@ -79,10 +79,11 @@ <div id="flexParent" on-keydown="onKeyDown_"> <div id="toolbar-container" hidden="[[!isWebUIToolbarVisible_]]"> <read-anything-toolbar - paused="[[speechPlayngState.paused]]" + paused="[[speechPlayingState.paused]]" selected-voice="[[selectedVoice]]" available-voices="[[availableVoices]]" preview-voice-playing="[[previewVoicePlaying]]" + locale-to-display-name="[[localeToDisplayName]]" on-select-voice="onSelectVoice_" on-preview-voice="onPreviewVoice_" on-voice-menu-close="onVoiceMenuClose_"
diff --git a/chrome/browser/resources/side_panel/read_anything/app.ts b/chrome/browser/resources/side_panel/read_anything/app.ts index f02d618..a9cf8a3 100644 --- a/chrome/browser/resources/side_panel/read_anything/app.ts +++ b/chrome/browser/resources/side_panel/read_anything/app.ts
@@ -226,10 +226,12 @@ // Otherwise, this is undefined. private previewVoicePlaying: SpeechSynthesisVoice|null; + private localeToDisplayName: {[locale: string]: string}; + // State for speech synthesis paused/play state needs to be tracked explicitly // because there are bugs with window.speechSynthesis.paused and // window.speechSynthesis.speaking on some platforms. - speechPlayngState: SpeechPlayingState = { + speechPlayingState: SpeechPlayingState = { paused: true, pauseSource: PauseActionSource.DEFAULT, speechStarted: false, @@ -372,7 +374,7 @@ // TODO(crbug.com/1442693): Potentially hide links during distillation. private shouldShowLinks(): boolean { // Links should only show when Read Aloud is paused. - return chrome.readingMode.linksEnabled && this.speechPlayngState.paused; + return chrome.readingMode.linksEnabled && this.speechPlayingState.paused; } private appendChildSubtrees_(node: Node, nodeId: number) { @@ -637,10 +639,26 @@ private getVoices(): SpeechSynthesisVoice[] { if (!this.availableVoices) { this.availableVoices = this.synth.getVoices(); + this.populateDisplayNamesForLocaleCodes(); } return this.availableVoices; } + private populateDisplayNamesForLocaleCodes() { + this.localeToDisplayName = {}; + + for (const {lang} of this.availableVoices) { + if (!(lang in this.localeToDisplayName)) { + const langDisplayName = + chrome.readingMode.getDisplayNameForLocale(lang, lang); + if (langDisplayName) { + this.localeToDisplayName = + {...this.localeToDisplayName, [lang]: langDisplayName}; + } + } + } + } + private replaceElement(current: HTMLElement, replacer: Node) { const nodeId = this.domNodeToAxNodeIdMap_.get(current); assert(nodeId !== undefined); @@ -689,13 +707,13 @@ // TODO(b/323912186) Handle when menu is closed mid-preview and the user // presses play/pause button. - if (this.speechPlayngState.paused && + if (this.speechPlayingState.paused && event.detail.voicePlayingWhenMenuOpened) { this.playSpeech(); } } private onPlayPauseClick_() { - if (this.speechPlayngState.paused) { + if (this.speechPlayingState.paused) { this.playSpeech(); } else { this.stopSpeech(PauseActionSource.BUTTON_CLICK); @@ -705,8 +723,8 @@ stopSpeech(pauseSource: PauseActionSource) { // TODO(crbug.com/1474951): When pausing, can we pause on a word boundary // and continue playing from the previous word? - this.speechPlayngState = { - ...this.speechPlayngState, + this.speechPlayingState = { + ...this.speechPlayingState, paused: true, pauseSource, }; @@ -762,9 +780,10 @@ playSpeech() { const container = this.$.container; - if (this.speechPlayngState.speechStarted && this.speechPlayngState.paused) { - const pausedFromButton = - this.speechPlayngState.pauseSource === PauseActionSource.BUTTON_CLICK; + if (this.speechPlayingState.speechStarted && + this.speechPlayingState.paused) { + const pausedFromButton = this.speechPlayingState.pauseSource === + PauseActionSource.BUTTON_CLICK; if (pausedFromButton) { this.synth.resume(); @@ -772,7 +791,7 @@ this.highlightAndPlayMessage(); } - this.speechPlayngState = {paused: false, speechStarted: true}; + this.speechPlayingState = {paused: false, speechStarted: true}; // Hide links when speech resumes. We only hide links when the page was // paused from the play/pause button. @@ -793,7 +812,7 @@ return; } if (container.textContent) { - this.speechPlayngState = {paused: false, speechStarted: true}; + this.speechPlayingState = {paused: false, speechStarted: true}; // Hide links when speech begins playing. if (chrome.readingMode.linksEnabled) { this.updateLinks(); @@ -1042,7 +1061,7 @@ } private clearReadAloudState() { - this.speechPlayngState = { + this.speechPlayingState = { paused: true, pauseSource: PauseActionSource.DEFAULT, speechStarted: false, @@ -1064,11 +1083,11 @@ private resetSpeechPostSettingChange_() { // Don't call stopSpeech() if initAxPositionWithNode hasn't been called - if (!this.speechPlayngState.speechStarted) { + if (!this.speechPlayingState.speechStarted) { return; } - const playSpeechOnChange = !this.speechPlayngState.paused; + const playSpeechOnChange = !this.speechPlayingState.paused; // Cancel the queued up Utterance using the old speech settings this.stopSpeech(PauseActionSource.VOICE_SETTINGS_CHANGE);
diff --git a/chrome/browser/resources/side_panel/read_anything/read_anything.d.ts b/chrome/browser/resources/side_panel/read_anything/read_anything.d.ts index 16ad25d5..081f4d5f 100644 --- a/chrome/browser/resources/side_panel/read_anything/read_anything.d.ts +++ b/chrome/browser/resources/side_panel/read_anything/read_anything.d.ts
@@ -298,5 +298,9 @@ // Gets the stored image data url from the AXNode. function getImageDataUrl(nodeId: number): string; + + // Gets the readable name for a locale code + function getDisplayNameForLocale(locale: string, displayLocale: string): + string; } }
diff --git a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html index 159bb17..0248ee8717 100644 --- a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html +++ b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html
@@ -147,6 +147,7 @@ id="voiceSelectionMenu" selected-voice="[[selectedVoice]]" available-voices="[[availableVoices]]" + locale-to-display-name="[[localeToDisplayName]]" paused="[[paused]]" preview-voice-playing="[[previewVoicePlaying]]"> </voice-selection-menu>
diff --git a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts index c02b2726..e649c234 100644 --- a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts +++ b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts
@@ -112,6 +112,7 @@ paused: Boolean, selectedVoice: Object, availableVoices: Array, + localeToDisplayName: Object, previewVoicePlaying: Object, }; }
diff --git a/chrome/browser/resources/side_panel/read_anything/voice_selection_menu.html b/chrome/browser/resources/side_panel/read_anything/voice_selection_menu.html index 789925df..b6fdfaf 100644 --- a/chrome/browser/resources/side_panel/read_anything/voice_selection_menu.html +++ b/chrome/browser/resources/side_panel/read_anything/voice_selection_menu.html
@@ -78,7 +78,7 @@ <cr-action-menu id="voiceSelectionMenu" on-close="onClose_"> <template is="dom-repeat" items="[[voiceSelectionOptions_]]"> - <div id$="group-[[item.language]]"> + <div data-test-id$="group-[[stringToHtmlTestId_(item.language)]]"> <span class="dropdown-line lang-group-title"> [[item.language]] </span>
diff --git a/chrome/browser/resources/side_panel/read_anything/voice_selection_menu.ts b/chrome/browser/resources/side_panel/read_anything/voice_selection_menu.ts index 22c26d6..a6e27da 100644 --- a/chrome/browser/resources/side_panel/read_anything/voice_selection_menu.ts +++ b/chrome/browser/resources/side_panel/read_anything/voice_selection_menu.ts
@@ -23,10 +23,6 @@ }; } -// This ID does not ensure uniqueness and is just used for testing purposes. -export function voiceToHtmlTestId(voice: SpeechSynthesisVoice): string { - return voice.name.replace(/\s/g, '-'); -} interface VoiceDropdownGroup { language: string; voices: VoiceDropdownItem[]; @@ -68,10 +64,11 @@ availableVoices: Array, previewVoicePlaying: Object, paused: Boolean, + localeToDisplayName: Object, voiceSelectionOptions_: { type: Object, - computed: - 'computeVoiceDropdown_(selectedVoice, availableVoices, previewVoicePlaying)', + computed: 'computeVoiceDropdown_(selectedVoice, availableVoices,' + + ' previewVoicePlaying, localeToDisplayName)', }, }; } @@ -79,34 +76,43 @@ private computeVoiceDropdown_( selectedVoice: SpeechSynthesisVoice, availableVoices: SpeechSynthesisVoice[], - previewVoicePlaying: SpeechSynthesisVoice|null): VoiceDropdownGroup[] { + previewVoicePlaying: SpeechSynthesisVoice|null, + localeToDisplayName: {[lang: string]: string}): VoiceDropdownGroup[] { const languageToVoices = availableVoices.reduce((languageToDropdownItems, voice) => { const dropdownItem: VoiceDropdownItem = { title: voice.name, voice, - id: voiceToHtmlTestId(voice), + id: this.stringToHtmlTestId_(voice.name), selected: voicesAreEqual(selectedVoice, voice), previewPlaying: voicesAreEqual(previewVoicePlaying, voice), }; - if (languageToDropdownItems[voice.lang]) { - languageToDropdownItems[voice.lang].push(dropdownItem); + const lang = + (localeToDisplayName && voice.lang in localeToDisplayName) ? + localeToDisplayName[voice.lang] : + voice.lang; + + if (languageToDropdownItems[lang]) { + languageToDropdownItems[lang].push(dropdownItem); } else { - languageToDropdownItems[voice.lang] = [dropdownItem]; + languageToDropdownItems[lang] = [dropdownItem]; } return languageToDropdownItems; }, {} as {[language: string]: VoiceDropdownItem[]}); - // TODO(crbug.com/1474951) Use readable language instead of ISO language - // codes (e.g. en-US) return Object.entries(languageToVoices).map(([ language, voices, ]) => ({language, voices})); } + // This ID does not ensure uniqueness and is just used for testing purposes. + private stringToHtmlTestId_(s: string): string { + return s.replace(/\s/g, '-').replace(/[()]/g, ''); + } + private onVoiceSelectionMenuClick_(event: MouseEvent) { const target = event.target as HTMLElement; const minY = target.getBoundingClientRect().bottom;
diff --git a/chrome/browser/resources/webui_gallery/app.ts b/chrome/browser/resources/webui_gallery/app.ts index 539ad2fd..547437dc3 100644 --- a/chrome/browser/resources/webui_gallery/app.ts +++ b/chrome/browser/resources/webui_gallery/app.ts
@@ -129,12 +129,12 @@ src: 'cr_slider/cr_slider_demo.js', }, { - name: 'Tabs, non-Polymer', + name: 'Tabs, native', path: 'tabs1', src: 'cr_tab_box/cr_tab_box_demo.js', }, { - name: 'Tabs, Polymer', + name: 'Tabs, Lit', path: 'tabs2', src: 'cr_tabs/cr_tabs_demo.js', },
diff --git a/chrome/browser/resources/webui_gallery/demos/cr_tabs/cr_tabs_demo.html b/chrome/browser/resources/webui_gallery/demos/cr_tabs/cr_tabs_demo.html index c922ad3..2db1720 100644 --- a/chrome/browser/resources/webui_gallery/demos/cr_tabs/cr_tabs_demo.html +++ b/chrome/browser/resources/webui_gallery/demos/cr_tabs/cr_tabs_demo.html
@@ -14,7 +14,8 @@ <h1>cr-tabs</h1> <div class="demos"> - <cr-tabs tab-names="[[tabNames_]]" selected="{{selectedTabIndex_}}"></cr-tabs> + <cr-tabs id="tabs" tab-names="[[tabNames_]]" selected="{{selectedTabIndex_}}"> + </cr-tabs> <iron-pages selected="[[selectedTabIndex_]]"> <template is="dom-repeat" items="[[tabNames_]]" as="tabName"> <div class="tab-contents">
diff --git a/chrome/browser/resources/webui_gallery/demos/cr_tabs/cr_tabs_demo.ts b/chrome/browser/resources/webui_gallery/demos/cr_tabs/cr_tabs_demo.ts index 5af947c..15fd28c6 100644 --- a/chrome/browser/resources/webui_gallery/demos/cr_tabs/cr_tabs_demo.ts +++ b/chrome/browser/resources/webui_gallery/demos/cr_tabs/cr_tabs_demo.ts
@@ -7,10 +7,17 @@ import '//resources/polymer/v3_0/iron-pages/iron-pages.js'; import '../demo.css.js'; +import type {CrTabsElement} from '//resources/cr_elements/cr_tabs/cr_tabs.js'; import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {getTemplate} from './cr_tabs_demo.html.js'; +interface CrTabsDemoElement { + $: { + tabs: CrTabsElement, + }; +} + class CrTabsDemoElement extends PolymerElement { static get is() { return 'cr-tabs-demo'; @@ -32,10 +39,12 @@ private onAddClick_() { this.push('tabNames_', 'Added'); + this.$.tabs.requestUpdate(); } private onAddAt1Click_() { this.splice('tabNames_', 1, 0, 'Added at 1'); + this.$.tabs.requestUpdate(); } private onSelectAt1Click_() {
diff --git a/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc b/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc index 93f24b7..fec0c51 100644 --- a/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc +++ b/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc
@@ -11,6 +11,9 @@ #include <memory> #include <utility> +#include "base/check.h" +#include "base/check_op.h" +#include "base/debug/dump_without_crashing.h" #include "base/files/file.h" #include "base/files/file_util.h" #include "base/files/important_file_writer.h" @@ -211,6 +214,12 @@ // corresponding DownloadManager has gone away. DETACHED_WAIT, + // The context is waiting for observed DownloadItems to be destroyed. This + // state is a debugging aid to understand why an instance seems to be + // observing a DownloadItem that is not present in the DownloadManager's + // collection; see https://crbug.com/40072145. + DETACHED_OBSERVING, + // The context has loaded the metadata file. LOAD_COMPLETE, }; @@ -406,13 +415,18 @@ download_item->RemoveObserver(this); } - // Delete the instance immediately if there's no work to process after a - // pending read completes. - if (get_details_callbacks_.empty() && pending_items_.empty()) { - delete this; - } else { - // delete the instance in OnMetadataReady. + // Keep the instance alive if there is pending work to do. + if (!get_details_callbacks_.empty() || !pending_items_.empty()) { + // Next state transition in OnMetadataReady. state_ = DETACHED_WAIT; + } else if (IsInObserverList()) { + // This should never happen, but somehow does. Keep the instance alive until + // it observes destruction of the last DownloadItem; see + // OnDownloadDestroyed. + state_ = DETACHED_OBSERVING; + } else { + // No outstanding work, so delete the instance at once. + delete this; } } @@ -436,6 +450,7 @@ void DownloadMetadataManager::ManagerContext::GetDownloadDetails( GetDownloadDetailsCallback callback) { if (state_ != LOAD_COMPLETE) { + CHECK_EQ(state_, WAITING_FOR_LOAD); get_details_callbacks_.push_back(std::move(callback)); } else { std::move(callback).Run( @@ -448,6 +463,12 @@ void DownloadMetadataManager::ManagerContext::OnDownloadUpdated( download::DownloadItem* download) { + if (state_ == DETACHED_OBSERVING) { + // How could the context be notified after removing itself as an observer of + // all download items? https://crbug.com/40072145. + base::debug::DumpWithoutCrashing(); + return; + } // Persist metadata for this download if it has just completed. if (download->GetState() == download::DownloadItem::COMPLETE) { // Ignore downloads we don't have a ClientDownloadRequest for. @@ -460,26 +481,52 @@ void DownloadMetadataManager::ManagerContext::OnDownloadOpened( download::DownloadItem* download) { + if (state_ == DETACHED_OBSERVING) { + // How could the context be notified after removing itself as an observer of + // all download items? https://crbug.com/40072145. + base::debug::DumpWithoutCrashing(); + return; + } const base::Time now = base::Time::Now(); - if (state_ != LOAD_COMPLETE) + if (state_ != LOAD_COMPLETE) { + CHECK_EQ(state_, WAITING_FOR_LOAD); pending_items_[download->GetId()].last_opened_time = now; - else if (HasMetadataFor(download)) + } else if (HasMetadataFor(download)) { UpdateLastOpenedTime(now); + } } void DownloadMetadataManager::ManagerContext::OnDownloadRemoved( download::DownloadItem* download) { + if (state_ == DETACHED_OBSERVING) { + // How could the context be notified after removing itself as an observer of + // all download items? https://crbug.com/40072145. + base::debug::DumpWithoutCrashing(); + return; + } download->RemoveObserver(this); - if (state_ != LOAD_COMPLETE) + if (state_ != LOAD_COMPLETE) { + CHECK_EQ(state_, WAITING_FOR_LOAD); pending_items_[download->GetId()].removed = true; - else if (HasMetadataFor(download)) + } else if (HasMetadataFor(download)) { RemoveMetadata(); + } } void DownloadMetadataManager::ManagerContext::OnDownloadDestroyed( download::DownloadItem* download) { + if (state_ == DETACHED_OBSERVING) { + // How could the context be notified after removing itself as an observer of + // all download items? https://crbug.com/40072145. + base::debug::DumpWithoutCrashing(); + } download->RemoveObserver(this); + if (state_ == DETACHED_OBSERVING && !IsInObserverList()) { + // This instance is no longer observing any download items, so it can safely + // be destroyed. + delete this; + } } DownloadMetadataManager::ManagerContext::~ManagerContext() { @@ -565,7 +612,8 @@ bool DownloadMetadataManager::ManagerContext::HasMetadataFor( const download::DownloadItem* item) const { // There must not be metadata if the load is not complete. - DCHECK(state_ == LOAD_COMPLETE || !download_metadata_); + DCHECK(state_ == LOAD_COMPLETE || + (state_ == WAITING_FOR_LOAD && !download_metadata_)); return (download_metadata_ && download_metadata_->download_id() == item->GetId()); } @@ -573,6 +621,7 @@ void DownloadMetadataManager::ManagerContext::OnMetadataReady( std::unique_ptr<DownloadMetadata> download_metadata) { DCHECK_NE(state_, LOAD_COMPLETE); + DCHECK_NE(state_, DETACHED_OBSERVING); const bool is_detached = (state_ == DETACHED_WAIT); @@ -601,9 +650,18 @@ // Run callbacks. RunCallbacks(); - // Delete the context now if it has been detached. - if (is_detached) - delete this; + // Delete the context now if it has been detached and is no longer observing + // any download items. + if (is_detached) { + if (IsInObserverList()) { + // This should never happen, but somehow does. Keep the instance alive + // until it observes destruction of the last DownloadItem; see + // OnDownloadDestroyed. + state_ = DETACHED_OBSERVING; + } else { + delete this; + } + } } void DownloadMetadataManager::ManagerContext::UpdateLastOpenedTime(
diff --git a/chrome/browser/screen_ai/screen_ai_service_router_browsertest.cc b/chrome/browser/screen_ai/screen_ai_service_router_browsertest.cc index 82f4f3d66..a70fc1c3 100644 --- a/chrome/browser/screen_ai/screen_ai_service_router_browsertest.cc +++ b/chrome/browser/screen_ai/screen_ai_service_router_browsertest.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/screen_ai/screen_ai_service_router.h" + #include <optional> #include "base/files/file_util.h" @@ -13,7 +15,6 @@ #include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/screen_ai/screen_ai_service_router.h" #include "chrome/browser/screen_ai/screen_ai_service_router_factory.h" #include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h"
diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetBottomSheetContent.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetBottomSheetContent.java index f03e54f..4d0b0d5 100644 --- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetBottomSheetContent.java +++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetBottomSheetContent.java
@@ -34,6 +34,7 @@ import org.chromium.base.ContextUtils; import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.R; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.share.ChromeShareExtras.DetailedContentType; import org.chromium.chrome.browser.share.ShareContentTypeHelper.ContentType; import org.chromium.chrome.browser.share.link_to_text.LinkToTextCoordinator.LinkGeneration; @@ -74,6 +75,7 @@ private static final int SHARE_SHEET_ITEM = 0; private final Activity mActivity; + private final Profile mProfile; private final LargeIconBridge mIconBridge; private final ShareSheetCoordinator mShareSheetCoordinator; private final Tracker mFeatureEngagementTracker; @@ -88,6 +90,7 @@ * Creates a ShareSheetBottomSheetContent (custom share sheet) opened from the given activity. * * @param activity The containing {@link Activity}. + * @param profile The active {@link Profile}. * @param iconBridge The {@link LargeIconBridge} to generate the icon in the preview. * @param shareSheetCoordinator The Coordinator that instantiated this BottomSheetContent. * @param params The {@link ShareParams} for the current share. @@ -95,11 +98,13 @@ */ ShareSheetBottomSheetContent( Activity activity, + Profile profile, LargeIconBridge iconBridge, ShareSheetCoordinator shareSheetCoordinator, ShareParams params, Tracker featureEngagementTracker) { mActivity = activity; + mProfile = profile; mIconBridge = iconBridge; mShareSheetCoordinator = shareSheetCoordinator; mParams = params; @@ -486,7 +491,7 @@ Rect insetRect = new Rect(0, -yInsetPx, 0, -yInsetPx); UserEducationHelper userEducationHelper = - new UserEducationHelper(mActivity, new Handler(Looper.getMainLooper())); + new UserEducationHelper(mActivity, mProfile, new Handler(Looper.getMainLooper())); userEducationHelper.requestShowIPH( new IPHCommandBuilder( mActivity.getResources(),
diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetCoordinator.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetCoordinator.java index 4358d93..de0fce460 100644 --- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetCoordinator.java +++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetCoordinator.java
@@ -203,7 +203,7 @@ mBottomSheet = new ShareSheetBottomSheetContent( - mActivity, mIconBridge, this, params, mFeatureEngagementTracker); + mActivity, mProfile, mIconBridge, this, params, mFeatureEngagementTracker); mShareStartTime = shareStartTime; mLinkGenerationStatusForMetrics = mBottomSheet.getLinkGenerationState();
diff --git a/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProviderTest.java b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProviderTest.java index df843bc2..986d2d21 100644 --- a/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProviderTest.java +++ b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProviderTest.java
@@ -446,10 +446,11 @@ mBottomSheetController, new ShareSheetBottomSheetContent( mActivity, + mProfile, null, mShareSheetCoordinator, - shareParams, - /* featureEngagementTracker= */ null), + /* featureEngagementTracker= */ shareParams, + null), shareParams, /* TabPrinterDelegate= */ null, isIncognito,
diff --git a/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetBottomSheetContentTest.java b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetBottomSheetContentTest.java index c322772..e6eb10e 100644 --- a/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetBottomSheetContentTest.java +++ b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetBottomSheetContentTest.java
@@ -31,6 +31,7 @@ import org.junit.rules.TestRule; import org.junit.runner.RunWith; import org.mockito.Mock; +import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.chromium.base.Callback; @@ -114,10 +115,12 @@ .addOnInitializedCallback(any()); TrackerFactory.setTrackerForTests(mFeatureEngagementTracker); ProfileManager.setLastUsedProfileForTesting(mProfile); + Mockito.when(mProfile.getOriginalProfile()).thenReturn(mProfile); mShareSheetBottomSheetContent = new ShareSheetBottomSheetContent( mActivity, + mProfile, new MockLargeIconBridge(), null, mShareParams, @@ -131,6 +134,7 @@ ShareSheetBottomSheetContent shareSheetBottomSheetContent = new ShareSheetBottomSheetContent( mActivity, + mProfile, new MockLargeIconBridge(), null, new ShareParams.Builder(/* window= */ null, /* title= */ "", /* url= */ "") @@ -162,6 +166,7 @@ ShareSheetBottomSheetContent shareSheetBottomSheetContent = new ShareSheetBottomSheetContent( mActivity, + mProfile, new MockLargeIconBridge(), null, new ShareParams.Builder(/* window= */ null, /* title= */ "", /* url= */ "") @@ -193,6 +198,7 @@ ShareSheetBottomSheetContent shareSheetBottomSheetContent = new ShareSheetBottomSheetContent( mActivity, + mProfile, new MockLargeIconBridge(), null, new ShareParams.Builder(/* window= */ null, /* title= */ "", /* url= */ "") @@ -332,6 +338,7 @@ ShareSheetBottomSheetContent shareSheetBottomSheetContent = new ShareSheetBottomSheetContent( mActivity, + mProfile, new MockLargeIconBridge(), null, new ShareParams.Builder(/* window= */ null, /* title= */ "", sUrl).build(), @@ -363,6 +370,7 @@ ShareSheetBottomSheetContent shareSheetBottomSheetContent = new ShareSheetBottomSheetContent( mActivity, + mProfile, new MockLargeIconBridge(), null, new ShareParams.Builder(/* window= */ null, /* title= */ "", /* url= */ "") @@ -397,6 +405,7 @@ ShareSheetBottomSheetContent shareSheetBottomSheetContent = new ShareSheetBottomSheetContent( mActivity, + mProfile, new MockLargeIconBridge(), null, new ShareParams.Builder(/* window= */ null, /* title= */ "", /* url= */ "") @@ -431,6 +440,7 @@ ShareSheetBottomSheetContent shareSheetBottomSheetContent = new ShareSheetBottomSheetContent( mActivity, + mProfile, new MockLargeIconBridge(), null, new ShareParams.Builder(/* window= */ null, /* title= */ "", /* url= */ "") @@ -476,6 +486,7 @@ ShareSheetBottomSheetContent shareSheetBottomSheetContent = new ShareSheetBottomSheetContent( mActivity, + mProfile, new MockLargeIconBridge(), null, new ShareParams.Builder(/* window= */ null, /* title= */ "", /* url= */ "")
diff --git a/chrome/browser/storage/shared_storage_browsertest.cc b/chrome/browser/storage/shared_storage_browsertest.cc index 36eb6eb..8807216 100644 --- a/chrome/browser/storage/shared_storage_browsertest.cc +++ b/chrome/browser/storage/shared_storage_browsertest.cc
@@ -833,7 +833,9 @@ "Finish executing customizable_module.js", base::UTF16ToUTF8(add_module_console_observer.messages()[0].message)); - WaitForHistograms({kTimingDocumentAddModuleHistogram}); + WaitForHistograms({kErrorTypeHistogram, kTimingDocumentAddModuleHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); content::WebContentsConsoleObserver script_console_observer( @@ -966,8 +968,10 @@ // Navigate away to record `kWorkletNumPerPageHistogram` histogram. EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); - WaitForHistograms( - {kTimingDocumentAddModuleHistogram, kWorkletNumPerPageHistogram}); + WaitForHistograms({kErrorTypeHistogram, kTimingDocumentAddModuleHistogram, + kWorkletNumPerPageHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); } @@ -987,7 +991,11 @@ 'test-operation', {data: {'customKey': 'customValue'}}); )"); - WaitForHistograms({kTimingDocumentAddModuleHistogram}); + WaitForHistograms({kErrorTypeHistogram, kTimingDocumentAddModuleHistogram}); + EXPECT_GE( + histogram_tester_.GetBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess), + 1); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); if (!SuccessExpected()) { @@ -1000,7 +1008,9 @@ EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); WaitForHistograms({kErrorTypeHistogram, kWorkletNumPerPageHistogram}); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -1019,8 +1029,10 @@ // Navigate away to record `kWorkletNumPerPageHistogram` histogram. EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); - WaitForHistograms({kTimingDocumentAddModuleHistogram, + WaitForHistograms({kErrorTypeHistogram, kTimingDocumentAddModuleHistogram, kTimingDocumentRunHistogram, kWorkletNumPerPageHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); } @@ -1074,7 +1086,11 @@ })() )"); - WaitForHistograms({kTimingDocumentAddModuleHistogram}); + WaitForHistograms({kErrorTypeHistogram, kTimingDocumentAddModuleHistogram}); + EXPECT_GE( + histogram_tester_.GetBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess), + 1); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); if (!SuccessExpected()) { @@ -1088,7 +1104,9 @@ EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); WaitForHistograms({kErrorTypeHistogram, kWorkletNumPerPageHistogram}); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -1117,9 +1135,11 @@ // Navigate away to record `kWorkletNumPerPageHistogram` histogram. EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); - WaitForHistograms({kTimingDocumentAddModuleHistogram, + WaitForHistograms({kErrorTypeHistogram, kTimingDocumentAddModuleHistogram, kTimingDocumentSelectUrlHistogram, kWorkletNumPerPageHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentSelectUrlHistogram, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -1492,13 +1512,15 @@ EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); WaitForHistograms( - {kWorkletNumPerPageHistogram, kTimingDocumentAddModuleHistogram, - kTimingDocumentRunHistogram, kTimingWorkletKeysHistogram, - kTimingWorkletEntriesHistogram, kEntriesQueuedCountHistogram, - kReceivedEntriesBenchmarksHistogram, + {kWorkletNumPerPageHistogram, kErrorTypeHistogram, + kTimingDocumentAddModuleHistogram, kTimingDocumentRunHistogram, + kTimingWorkletKeysHistogram, kTimingWorkletEntriesHistogram, + kEntriesQueuedCountHistogram, kReceivedEntriesBenchmarksHistogram, kIteratedEntriesBenchmarksHistogram}); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingWorkletKeysHistogram, 151); @@ -1584,13 +1606,16 @@ // Navigate away to record `kWorkletNumPerPageHistogram` histogram. EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); - WaitForHistograms( - {kWorkletNumPerPageHistogram, kTimingDocumentAddModuleHistogram, - kTimingDocumentRunHistogram, kTimingWorkletKeysHistogram, - kEntriesQueuedCountHistogram, kReceivedEntriesBenchmarksHistogram, - kIteratedEntriesBenchmarksHistogram}); + WaitForHistograms({kWorkletNumPerPageHistogram, kErrorTypeHistogram, + kTimingDocumentAddModuleHistogram, + kTimingDocumentRunHistogram, kTimingWorkletKeysHistogram, + kEntriesQueuedCountHistogram, + kReceivedEntriesBenchmarksHistogram, + kIteratedEntriesBenchmarksHistogram}); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingWorkletKeysHistogram, 150 + 243); @@ -1676,12 +1701,15 @@ EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); WaitForHistograms( - {kWorkletNumPerPageHistogram, kTimingDocumentAddModuleHistogram, - kTimingDocumentRunHistogram, kTimingWorkletEntriesHistogram, - kEntriesQueuedCountHistogram, kReceivedEntriesBenchmarksHistogram, + {kWorkletNumPerPageHistogram, kErrorTypeHistogram, + kTimingDocumentAddModuleHistogram, kTimingDocumentRunHistogram, + kTimingWorkletEntriesHistogram, kEntriesQueuedCountHistogram, + kReceivedEntriesBenchmarksHistogram, kIteratedEntriesBenchmarksHistogram}); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingWorkletEntriesHistogram, 101 + 299); @@ -1755,13 +1783,15 @@ EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); WaitForHistograms( - {kWorkletNumPerPageHistogram, kTimingDocumentAddModuleHistogram, - kTimingDocumentRunHistogram, kTimingWorkletKeysHistogram, - kTimingWorkletEntriesHistogram, kEntriesQueuedCountHistogram, - kReceivedEntriesBenchmarksHistogram, + {kWorkletNumPerPageHistogram, kErrorTypeHistogram, + kTimingDocumentAddModuleHistogram, kTimingDocumentRunHistogram, + kTimingWorkletKeysHistogram, kTimingWorkletEntriesHistogram, + kEntriesQueuedCountHistogram, kReceivedEntriesBenchmarksHistogram, kIteratedEntriesBenchmarksHistogram}); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingWorkletKeysHistogram, 6); @@ -1850,13 +1880,15 @@ EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); WaitForHistograms( - {kWorkletNumPerPageHistogram, kTimingDocumentAddModuleHistogram, - kTimingDocumentRunHistogram, kTimingWorkletKeysHistogram, - kTimingWorkletEntriesHistogram, kEntriesQueuedCountHistogram, - kReceivedEntriesBenchmarksHistogram, + {kWorkletNumPerPageHistogram, kErrorTypeHistogram, + kTimingDocumentAddModuleHistogram, kTimingDocumentRunHistogram, + kTimingWorkletKeysHistogram, kTimingWorkletEntriesHistogram, + kEntriesQueuedCountHistogram, kReceivedEntriesBenchmarksHistogram, kIteratedEntriesBenchmarksHistogram}); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingWorkletKeysHistogram, 4 + 3); @@ -1927,13 +1959,15 @@ EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); WaitForHistograms( - {kWorkletNumPerPageHistogram, kTimingDocumentAddModuleHistogram, - kTimingDocumentRunHistogram, kTimingWorkletKeysHistogram, - kTimingWorkletEntriesHistogram, kEntriesQueuedCountHistogram, - kReceivedEntriesBenchmarksHistogram, + {kWorkletNumPerPageHistogram, kErrorTypeHistogram, + kTimingDocumentAddModuleHistogram, kTimingDocumentRunHistogram, + kTimingWorkletKeysHistogram, kTimingWorkletEntriesHistogram, + kEntriesQueuedCountHistogram, kReceivedEntriesBenchmarksHistogram, kIteratedEntriesBenchmarksHistogram}); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingWorkletKeysHistogram, 1); @@ -2101,7 +2135,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kAddModuleWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2147,7 +2183,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2174,7 +2212,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2201,7 +2241,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2229,7 +2271,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2317,7 +2361,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2374,7 +2420,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2422,7 +2470,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2470,7 +2520,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2518,7 +2570,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2566,7 +2620,9 @@ WaitForHistograms({kTimingDocumentAddModuleHistogram, kErrorTypeHistogram, kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLNonWebVisible, 1); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 1, 1); @@ -2652,12 +2708,14 @@ GetActiveWebContents(), https_server()->GetURL(kCrossOriginHost, kSimplePagePath))); WaitForHistograms( - {kTimingDocumentAddModuleHistogram, kTimingDocumentRunHistogram, - kTimingWorkletSetHistogram, kTimingWorkletAppendHistogram, - kTimingWorkletGetHistogram, kTimingWorkletLengthHistogram, - kTimingWorkletDeleteHistogram, kTimingWorkletClearHistogram, - kWorkletNumPerPageHistogram}); + {kErrorTypeHistogram, kTimingDocumentAddModuleHistogram, + kTimingDocumentRunHistogram, kTimingWorkletSetHistogram, + kTimingWorkletAppendHistogram, kTimingWorkletGetHistogram, + kTimingWorkletLengthHistogram, kTimingWorkletDeleteHistogram, + kTimingWorkletClearHistogram, kWorkletNumPerPageHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingWorkletSetHistogram, 6); @@ -2697,9 +2755,11 @@ // Navigate away to record `kWorkletNumPerPageHistogram` histogram. EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); - WaitForHistograms({kTimingDocumentAddModuleHistogram, + WaitForHistograms({kErrorTypeHistogram, kTimingDocumentAddModuleHistogram, kTimingDocumentRunHistogram, kTimingWorkletSetHistogram, kWorkletNumPerPageHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 4); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 2); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 2, 1); @@ -2745,9 +2805,11 @@ // Navigate away to record `kWorkletNumPerPageHistogram` histogram. EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); - WaitForHistograms({kTimingDocumentAddModuleHistogram, + WaitForHistograms({kErrorTypeHistogram, kTimingDocumentAddModuleHistogram, kTimingDocumentRunHistogram, kTimingWorkletSetHistogram, kWorkletNumPerPageHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 6); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 3); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 3); histogram_tester_.ExpectUniqueSample(kWorkletNumPerPageHistogram, 3, 1); @@ -2935,9 +2997,11 @@ EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); WaitForHistograms( - {kTimingDocumentAddModuleHistogram, kTimingDocumentSelectUrlHistogram, - kTimingDocumentRunHistogram, kTimingRemainingBudgetHistogram, - kWorkletNumPerPageHistogram}); + {kErrorTypeHistogram, kTimingDocumentAddModuleHistogram, + kTimingDocumentSelectUrlHistogram, kTimingDocumentRunHistogram, + kTimingRemainingBudgetHistogram, kWorkletNumPerPageHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 5); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentSelectUrlHistogram, 1); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 2); @@ -2999,9 +3063,11 @@ EXPECT_TRUE(content::NavigateToURL(GetActiveWebContents(), GURL(url::kAboutBlankURL))); WaitForHistograms( - {kTimingDocumentAddModuleHistogram, kTimingDocumentSelectUrlHistogram, - kTimingDocumentRunHistogram, kTimingRemainingBudgetHistogram, - kWorkletNumPerPageHistogram}); + {kErrorTypeHistogram, kTimingDocumentAddModuleHistogram, + kTimingDocumentSelectUrlHistogram, kTimingDocumentRunHistogram, + kTimingRemainingBudgetHistogram, kWorkletNumPerPageHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 9); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 3); histogram_tester_.ExpectTotalCount(kTimingDocumentSelectUrlHistogram, 2); histogram_tester_.ExpectTotalCount(kTimingDocumentRunHistogram, 4);
diff --git a/chrome/browser/subresource_filter/ad_heuristic_tpcd_browsertest.cc b/chrome/browser/subresource_filter/ad_heuristic_tpcd_browsertest.cc index dfef72fb..4e76d77 100644 --- a/chrome/browser/subresource_filter/ad_heuristic_tpcd_browsertest.cc +++ b/chrome/browser/subresource_filter/ad_heuristic_tpcd_browsertest.cc
@@ -570,6 +570,10 @@ {"SkipTpcdMitigationsForAdsMetadata", "true"}, {"SkipTpcdMitigationsForAdsHeuristics", "true"}}}}, {}); + + // Disable the validity service so it doesn't remove manually created + // trial settings. + tpcd::trial::ValidityService::DisableForTesting(); } private: @@ -607,6 +611,10 @@ {"SkipTpcdMitigationsForAdsMetadata", "false"}, {"SkipTpcdMitigationsForAdsHeuristics", "false"}}}}, {}); + + // Disable the validity service so it doesn't remove manually created + // trial settings. + tpcd::trial::ValidityService::DisableForTesting(); } private:
diff --git a/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc b/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc index 85d0a55..10d652f 100644 --- a/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc +++ b/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc
@@ -327,6 +327,7 @@ kAccessibilityFaceGazeCursorSmoothing = 100267, kAccessibilityFaceGazeCursorUseAcceleration = 100268, kAntiFingerprintingEnabled = 100269, + kAccessibilityFaceGazeGesturesToMacros = 100270, // See components/sync_preferences/README.md about adding new entries here. // vvvvv IMPORTANT! vvvvv // Note to the reviewer: IT IS YOUR RESPONSIBILITY to ensure that new syncable @@ -1093,6 +1094,10 @@ {syncable_prefs_ids::kAccessibilityFaceGazeCursorUseAcceleration, syncer::OS_PREFERENCES, sync_preferences::PrefSensitivity::kNone, sync_preferences::MergeBehavior::kNone}}, + {ash::prefs::kAccessibilityFaceGazeGesturesToMacros, + {syncable_prefs_ids::kAccessibilityFaceGazeGesturesToMacros, + syncer::OS_PREFERENCES, sync_preferences::PrefSensitivity::kNone, + sync_preferences::MergeBehavior::kMergeableDict}}, #endif // BUILDFLAG(IS_CHROMEOS_ASH) {performance_manager::user_tuning::prefs::kTabDiscardingExceptions, {syncable_prefs_ids::kTabDiscardingExceptions, syncer::PREFERENCES,
diff --git a/chrome/browser/tpcd/support/top_level_trial_service_browsertest.cc b/chrome/browser/tpcd/support/top_level_trial_service_browsertest.cc index fb3d5a4..c0cbd191 100644 --- a/chrome/browser/tpcd/support/top_level_trial_service_browsertest.cc +++ b/chrome/browser/tpcd/support/top_level_trial_service_browsertest.cc
@@ -39,49 +39,6 @@ using content::WebContents; namespace tpcd::trial { -namespace { - -// Origin Trials token for `kTrialEnabledSite` generated with: -// tools/origin_trials/generate_token.py https://example.test TopLevelTpcd -// --expire-days 5000 -const char kTopLevelTrialToken[] = - "A5sGfiy3qkhJES3yFHkBd7i0jX8rC+" - "pCA2M0tAhfmetOLkvOVTAR2589eHxZHbdv3QgX7BtANaw3A+" - "A3NvgAtwIAAABXeyJvcmlnaW4iOiAiaHR0cHM6Ly9leGFtcGxlLnRlc3Q6NDQzIiwgImZlYXR1" - "cmUiOiAiVG9wTGV2ZWxUcGNkIiwgImV4cGlyeSI6IDIxMzkzMjU5MjZ9"; - -// Origin Trials token for `kTrialEnabledSite` (and all its subdomains) -// generated with: -// tools/origin_trials/generate_token.py https://example.test TopLevelTpcd -// --is-subdomain --expire-days 5000 -const char kTopLevelTrialSubdomainMatchingToken[] = - "A5+BZIDRMyQWn2lWBHXWd3egEk2WqNdtEuzEbDZV0qXwYM8nKiqlHNYjGrfXuFgmUQ+" - "j0wpk0EBVJC51I3K0gQkAAABseyJvcmlnaW4iOiAiaHR0cHM6Ly9leGFtcGxlLnRlc3Q6NDQzI" - "iwgImZlYXR1cmUiOiAiVG9wTGV2ZWxUcGNkIiwgImV4cGlyeSI6IDIxMzkzMzg0NjcsICJpc1N" - "1YmRvbWFpbiI6IHRydWV9"; - -// Origin Trials token for `kTrialEnabledSiteSubdomain` generated with: -// tools/origin_trials/generate_token.py https://sub.example.test TopLevelTpcd -// --expire-days 5000 -const char kSubdomainTopLevelTrialToken[] = - "A7CJlPHXa8yQc2lJRvM/" - "mq4Oi5+" - "SJHbT4nnUmWiYKeuguuMkTd6y8DHBRAdEgvLXPajr9Qm2cMe4f5qzovm07QwAAABbeyJvcmlna" - "W4iOiAiaHR0cHM6Ly9zdWIuZXhhbXBsZS50ZXN0OjQ0MyIsICJmZWF0dXJlIjogIlRvcExldmV" - "sVHBjZCIsICJleHBpcnkiOiAyMTM5MzM4NTY5fQ=="; - -// Origin Trials token for `kTrialEnabledSiteSubdomain` (and all its subdomains) -// generated with: -// tools/origin_trials/generate_token.py https://sub.example.test TopLevelTpcd -// --is-subdomain --expire-days 5000 -const char kSubdomainTopLevelTrialSubdomainMatchingToken[] = - "Ayuwtl4l9AC0MUBPlPDMZ3on5Db2hTQtFJdRM4fC1Bj03JLXWKNoe9bg4m5CslS5wFG9WQQsKu" - "q/" - "IbnFBxzGXwMAAABweyJvcmlnaW4iOiAiaHR0cHM6Ly9zdWIuZXhhbXBsZS50ZXN0OjQ0MyIsIC" - "JmZWF0dXJlIjogIlRvcExldmVsVHBjZCIsICJleHBpcnkiOiAyMTM5MzM4NTIzLCAiaXNTdWJk" - "b21haW4iOiB0cnVlfQ=="; - -} // namespace class TopLevelTpcdTrialBrowserTest : public PlatformBrowserTest { public: @@ -156,8 +113,8 @@ } bool OnRequest(content::URLLoaderInterceptor::RequestParams* params) { - std::string path = params->url_request.url.path().substr(1); std::string host = params->url_request.url.host(); + std::string path = params->url_request.url.path().substr(1); std::string query = params->url_request.url.query(); if (host != kTrialEnabledDomain && host != kTrialEnabledSubdomain) {
diff --git a/chrome/browser/tpcd/support/trial_test_utils.h b/chrome/browser/tpcd/support/trial_test_utils.h index 5e35ab11f..6fded490 100644 --- a/chrome/browser/tpcd/support/trial_test_utils.h +++ b/chrome/browser/tpcd/support/trial_test_utils.h
@@ -27,6 +27,7 @@ inline constexpr char kTrialEnabledDomain[] = "example.test"; inline constexpr char kTrialEnabledSubdomain[] = "sub.example.test"; inline constexpr char kTrialEnabledIframePath[] = "origin-trial-iframe"; +inline constexpr char kTrialEnabledTopLevelPath[] = "origin-trial-top-level"; inline constexpr char kEmbeddedScriptPagePath[] = "tpcd/page_with_cross_site_tpcd_support_ot.html"; inline constexpr char kSubdomainMatchingEmbeddedScriptPagePath[] = @@ -61,6 +62,46 @@ "ICJmZWF0dXJlIjogIlRwY2QiLCAiZXhwaXJ5IjogMjEzMzk2NzQwOCwgImlzU3ViZG9tYWluIj" "ogdHJ1ZX0="; +// Origin Trials token for `kTrialEnabledSite` generated with: +// tools/origin_trials/generate_token.py https://example.test TopLevelTpcd +// --expire-days 5000 +const char kTopLevelTrialToken[] = + "A5sGfiy3qkhJES3yFHkBd7i0jX8rC+" + "pCA2M0tAhfmetOLkvOVTAR2589eHxZHbdv3QgX7BtANaw3A+" + "A3NvgAtwIAAABXeyJvcmlnaW4iOiAiaHR0cHM6Ly9leGFtcGxlLnRlc3Q6NDQzIiwgImZlYXR1" + "cmUiOiAiVG9wTGV2ZWxUcGNkIiwgImV4cGlyeSI6IDIxMzkzMjU5MjZ9"; + +// Origin Trials token for `kTrialEnabledSite` (and all its subdomains) +// generated with: +// tools/origin_trials/generate_token.py https://example.test TopLevelTpcd +// --is-subdomain --expire-days 5000 +const char kTopLevelTrialSubdomainMatchingToken[] = + "A5+BZIDRMyQWn2lWBHXWd3egEk2WqNdtEuzEbDZV0qXwYM8nKiqlHNYjGrfXuFgmUQ+" + "j0wpk0EBVJC51I3K0gQkAAABseyJvcmlnaW4iOiAiaHR0cHM6Ly9leGFtcGxlLnRlc3Q6NDQzI" + "iwgImZlYXR1cmUiOiAiVG9wTGV2ZWxUcGNkIiwgImV4cGlyeSI6IDIxMzkzMzg0NjcsICJpc1N" + "1YmRvbWFpbiI6IHRydWV9"; + +// Origin Trials token for `kTrialEnabledSiteSubdomain` generated with: +// tools/origin_trials/generate_token.py https://sub.example.test TopLevelTpcd +// --expire-days 5000 +const char kSubdomainTopLevelTrialToken[] = + "A7CJlPHXa8yQc2lJRvM/" + "mq4Oi5+" + "SJHbT4nnUmWiYKeuguuMkTd6y8DHBRAdEgvLXPajr9Qm2cMe4f5qzovm07QwAAABbeyJvcmlna" + "W4iOiAiaHR0cHM6Ly9zdWIuZXhhbXBsZS50ZXN0OjQ0MyIsICJmZWF0dXJlIjogIlRvcExldmV" + "sVHBjZCIsICJleHBpcnkiOiAyMTM5MzM4NTY5fQ=="; + +// Origin Trials token for `kTrialEnabledSiteSubdomain` (and all its subdomains) +// generated with: +// tools/origin_trials/generate_token.py https://sub.example.test TopLevelTpcd +// --is-subdomain --expire-days 5000 +const char kSubdomainTopLevelTrialSubdomainMatchingToken[] = + "Ayuwtl4l9AC0MUBPlPDMZ3on5Db2hTQtFJdRM4fC1Bj03JLXWKNoe9bg4m5CslS5wFG9WQQsKu" + "q/" + "IbnFBxzGXwMAAABweyJvcmlnaW4iOiAiaHR0cHM6Ly9zdWIuZXhhbXBsZS50ZXN0OjQ0MyIsIC" + "JmZWF0dXJlIjogIlRvcExldmVsVHBjZCIsICJleHBpcnkiOiAyMTM5MzM4NTIzLCAiaXNTdWJk" + "b21haW4iOiB0cnVlfQ=="; + // Helper function for performing client side cookie access via JS. void AccessCookieViaJsIn(content::WebContents* web_contents, content::RenderFrameHost* frame);
diff --git a/chrome/browser/tpcd/support/validity_service.cc b/chrome/browser/tpcd/support/validity_service.cc index 9e7e6cff..4ff61b0f 100644 --- a/chrome/browser/tpcd/support/validity_service.cc +++ b/chrome/browser/tpcd/support/validity_service.cc
@@ -12,9 +12,11 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tpcd/support/tpcd_support_service.h" #include "chrome/browser/tpcd/support/tpcd_support_service_factory.h" +#include "components/content_settings/core/browser/content_settings_type_set.h" #include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" +#include "components/content_settings/core/common/content_settings_types.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/cookie_access_details.h" @@ -32,12 +34,29 @@ namespace { +using ThirdPartyCookieAllowMechanism = + content_settings::CookieSettingsBase::ThirdPartyCookieAllowMechanism; + bool g_disabled_for_testing = false; bool IsThirdParty(const GURL& url, const GURL& first_party_url) { return !net::SiteForCookies::FromUrl(first_party_url).IsFirstParty(url); } +std::optional<ContentSettingsType> GetTrialContentSettingsType( + ThirdPartyCookieAllowMechanism mechanism) { + switch (mechanism) { + case ThirdPartyCookieAllowMechanism::kAllowBy3PCD: + return ContentSettingsType::TPCD_TRIAL; + case ThirdPartyCookieAllowMechanism::kAllowByTopLevel3PCD: + return ContentSettingsType::TOP_LEVEL_TPCD_TRIAL; + default: + // The other mechanisms do not map to a |ContentSettingsType| for a + // third-party cookie deprecation trial. + return std::nullopt; + } +} + } // namespace /* static */ @@ -63,9 +82,11 @@ ValidityService::~ValidityService() = default; -void ValidityService::UpdateTpcdTrialSettings(const GURL& url, - const GURL& first_party_url, - bool enabled) { +void ValidityService::UpdateTrialSettings( + const ContentSettingsType trial_settings_type, + const GURL& url, + const GURL& first_party_url, + bool enabled) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (g_disabled_for_testing || enabled) { @@ -79,10 +100,8 @@ // Find the setting that permitted the cookie access for the pair. content_settings::SettingInfo info; - bool setting_exists = - (settings_map->GetContentSetting(url, first_party_url, - ContentSettingsType::TPCD_TRIAL, - &info) == CONTENT_SETTING_ALLOW); + bool setting_exists = CheckTrialContentSetting(url, first_party_url, + trial_settings_type, &info); // If a matching setting no longer exists, there is no need to update // |settings_map|. @@ -97,23 +116,22 @@ auto matches = [&](const ContentSettingPatternSource& setting) -> bool { return (setting.primary_pattern == info.primary_pattern); }; - settings_map->ClearSettingsForOneTypeWithPredicate( - ContentSettingsType::TPCD_TRIAL, matches); + settings_map->ClearSettingsForOneTypeWithPredicate(trial_settings_type, + matches); - SyncTpcdTrialSettingsToNetworkService(settings_map); + SyncTrialSettingsToNetworkService( + trial_settings_type, + settings_map->GetSettingsForOneType(trial_settings_type)); } -void ValidityService::SyncTpcdTrialSettingsToNetworkService( - HostContentSettingsMap* settings_map) { - ContentSettingsForOneType tpcd_trial_settings = - settings_map->GetSettingsForOneType(ContentSettingsType::TPCD_TRIAL); - +void ValidityService::SyncTrialSettingsToNetworkService( + const ContentSettingsType trial_settings_type, + const ContentSettingsForOneType& trial_settings) { web_contents() ->GetBrowserContext() ->GetDefaultStoragePartition() ->GetCookieManagerForBrowserProcess() - ->SetContentSettings(ContentSettingsType::TPCD_TRIAL, - std::move(tpcd_trial_settings), + ->SetContentSettings(trial_settings_type, std::move(trial_settings), base::NullCallback()); } @@ -146,35 +164,42 @@ return; } - HostContentSettingsMap* settings_map = - HostContentSettingsMapFactory::GetForProfile(profile); - CHECK(settings_map); + scoped_refptr<content_settings::CookieSettings> cookie_settings = + CookieSettingsFactory::GetForProfile(profile); + CHECK(cookie_settings); - // Check for an existing enrollment setting for the pair. - if (settings_map->GetContentSetting(details.url, details.first_party_url, - ContentSettingsType::TPCD_TRIAL) == - CONTENT_SETTING_ALLOW) { + // Check for an existing trial setting applicable to the pair. + ThirdPartyCookieAllowMechanism allow_mechanism = + cookie_settings->GetThirdPartyCookieAllowMechanism( + details.url, details.first_party_url, + details.cookie_setting_overrides); + std::optional<ContentSettingsType> setting_type = + GetTrialContentSettingsType(allow_mechanism); + + if (setting_type.has_value()) { CheckTrialStatusAsync( - base::BindOnce(&ValidityService::UpdateTpcdTrialSettings, - weak_factory_.GetWeakPtr()), - details.url, details.first_party_url); + base::BindOnce(&ValidityService::UpdateTrialSettings, + weak_factory_.GetWeakPtr(), setting_type.value()), + setting_type.value(), details.url, details.first_party_url); } } void ValidityService::CheckTrialStatusAsync( ContentSettingUpdateCallback update_callback, + const ContentSettingsType trial_settings_type, const GURL& url, const GURL& first_party_url) { content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, - base::BindOnce(&ValidityService::CheckTrialStatusOnUiThread, - weak_factory_.GetWeakPtr(), std::move(update_callback), - std::move(url), std::move(first_party_url))); + FROM_HERE, base::BindOnce(&ValidityService::CheckTrialStatusOnUiThread, + weak_factory_.GetWeakPtr(), + std::move(update_callback), trial_settings_type, + std::move(url), std::move(first_party_url))); } // Persistent origin trials can only be checked on the UI thread. void ValidityService::CheckTrialStatusOnUiThread( ContentSettingUpdateCallback update_callback, + const ContentSettingsType trial_settings_type, const GURL& url, const GURL& first_party_url) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -187,17 +212,61 @@ return; } - url::Origin request_origin = url::Origin::Create(url); + bool enabled = false; url::Origin partition_origin = url::Origin::Create(first_party_url); - bool enabled = trial_delegate->IsFeaturePersistedForOrigin( - request_origin, partition_origin, blink::mojom::OriginTrialFeature::kTpcd, - base::Time::Now()); + switch (trial_settings_type) { + case ContentSettingsType::TPCD_TRIAL: + enabled = trial_delegate->IsFeaturePersistedForOrigin( + url::Origin::Create(url), partition_origin, + blink::mojom::OriginTrialFeature::kTpcd, base::Time::Now()); + break; + case ContentSettingsType::TOP_LEVEL_TPCD_TRIAL: + enabled = trial_delegate->IsFeaturePersistedForOrigin( + url::Origin::Create(first_party_url), partition_origin, + blink::mojom::OriginTrialFeature::kTopLevelTpcd, base::Time::Now()); + + break; + default: + NOTREACHED() << "ContentSettingsType::" << trial_settings_type + << " is not associated with a 3PCD trial."; + return; + } std::move(update_callback) .Run(std::move(url), std::move(first_party_url), enabled); } +bool ValidityService::CheckTrialContentSetting( + const GURL& url, + const GURL& first_party_url, + ContentSettingsType trial_settings_type, + content_settings::SettingInfo* info) { + HostContentSettingsMap* settings_map = + HostContentSettingsMapFactory::GetForProfile( + web_contents()->GetBrowserContext()); + CHECK(settings_map); + + switch (trial_settings_type) { + case ContentSettingsType::TPCD_TRIAL: + return (settings_map->GetContentSetting(url, first_party_url, + trial_settings_type, + info) == CONTENT_SETTING_ALLOW); + case ContentSettingsType::TOP_LEVEL_TPCD_TRIAL: + // Top-level 3pcd trial settings use + // |WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE| by default and as a result + // only use a primary pattern (with wildcard placeholder for the secondary + // pattern). + return (settings_map->GetContentSetting(first_party_url, first_party_url, + trial_settings_type, + info) == CONTENT_SETTING_ALLOW); + default: + NOTREACHED() << "ContentSettingsType::" << trial_settings_type + << " is not associated with a 3PCD trial."; + return false; + } +} + WEB_CONTENTS_USER_DATA_KEY_IMPL(ValidityService); } // namespace tpcd::trial
diff --git a/chrome/browser/tpcd/support/validity_service.h b/chrome/browser/tpcd/support/validity_service.h index 41362e4..e3d0679 100644 --- a/chrome/browser/tpcd/support/validity_service.h +++ b/chrome/browser/tpcd/support/validity_service.h
@@ -6,6 +6,8 @@ #define CHROME_BROWSER_TPCD_SUPPORT_VALIDITY_SERVICE_H_ #include "base/functional/callback.h" +#include "components/content_settings/core/common/content_settings.h" +#include "components/content_settings/core/common/content_settings_types.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" @@ -14,13 +16,14 @@ namespace tpcd::trial { -// ValidityService is responsible for ensuring the Tpcd deprecation trial is -// still enabled for the requesting origin of any third-party cookie access that -// is (or could have been) allowed as a result of a |TPCD_TRIAL| content -// setting. This is necessary since |content::OriginTrialsControllerDelegate| -// doesn't notify its observers when a trial is disabled for a reason other than -// all tokens being cleared or an origin intentionally disable it (by not -// supplying the token when loaded in the associated context). +// ValidityService is responsible for ensuring the Tpcd deprecation trials (for +// third-parties and for top-level sites) is still enabled for the appropriate +// origin of any third-party cookie access that is (or could have been) allowed +// as a result of a |TPCD_TRIAL| or |TOP_LEVEL_TPCD_TRIAL| content setting. This +// is necessary since |content::OriginTrialsControllerDelegate| doesn't notify +// its observers when a trial is disabled for a reason other than all tokens +// being cleared or an origin intentionally disable it (by not supplying the +// token when loaded in the associated context). class ValidityService : public content::WebContentsObserver, public content::WebContentsUserData<ValidityService> { public: @@ -43,22 +46,37 @@ explicit ValidityService(content::WebContents* web_contents); // Called when a third party cookie access is (or could have been) allowed by - // a |TPCD_TRIAL| content setting. Posts a task to the UI thread to check if - // the Tpcd origin trial is enabled for the specified context. Upon - // completion of the task, |update_callback| is run with |url|, - // |first_party_url|, and the trial enablement status as parameters. + // a |TPCD_TRIAL| or |TOP_LEVEL_TPCD_TRIAL| content setting. Posts a task to + // the UI thread to check if the appropriate trial is enabled for the + // specified context. Upon completion of the task, |update_callback| is run + // with |url|, |first_party_url|, and the trial enablement status as + // parameters. void CheckTrialStatusAsync(ContentSettingUpdateCallback update_callback, + const ContentSettingsType trial_settings_type, const GURL& url, const GURL& first_party_url); void CheckTrialStatusOnUiThread(ContentSettingUpdateCallback update_callback, + const ContentSettingsType trial_settings_type, const GURL& url, const GURL& first_party_url); - void UpdateTpcdTrialSettings(const GURL& url, - const GURL& first_party_url, - bool enabled); - void SyncTpcdTrialSettingsToNetworkService( - HostContentSettingsMap* settings_map); + void UpdateTrialSettings(const ContentSettingsType trial_settings_type, + const GURL& url, + const GURL& first_party_url, + bool enabled); + void SyncTrialSettingsToNetworkService( + const ContentSettingsType trial_settings_type, + const ContentSettingsForOneType& trial_settings); + + // Mostly a wrapper around + // |content::HostContentSettingsMap::GetContentSetting()| + // that accounts for the scoping differences between the trials and returns a + // boolean based on whether a matching setting exists and is + // |CONTENT_SETTING_ALLOW|. + bool CheckTrialContentSetting(const GURL& url, + const GURL& first_party_url, + const ContentSettingsType trial_settings_type, + content_settings::SettingInfo* info); void OnCookiesAccessedImpl(const content::CookieAccessDetails& details);
diff --git a/chrome/browser/tpcd/support/validity_service_browsertest.cc b/chrome/browser/tpcd/support/validity_service_browsertest.cc index 773c535..2a395834 100644 --- a/chrome/browser/tpcd/support/validity_service_browsertest.cc +++ b/chrome/browser/tpcd/support/validity_service_browsertest.cc
@@ -8,6 +8,8 @@ #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/tpcd/support/top_level_trial_service.h" +#include "chrome/browser/tpcd/support/top_level_trial_service_factory.h" #include "chrome/browser/tpcd/support/tpcd_support_service.h" #include "chrome/browser/tpcd/support/tpcd_support_service_factory.h" #include "chrome/browser/tpcd/support/trial_test_utils.h" @@ -44,7 +46,7 @@ namespace tpcd::trial { -class TpcdValidityBrowserTest : public PlatformBrowserTest { +class ValidityServiceBrowserTestBase : public PlatformBrowserTest { public: void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII("origin-trial-public-key", @@ -107,6 +109,10 @@ GetActiveWebContents()->GetBrowserContext()); } + TopLevelTrialService* GetTopLevelTrialService() { + return TopLevelTrialServiceFactory::GetForProfile(GetProfile()); + } + TpcdTrialService* GetTpcdTrialService() { return TpcdTrialServiceFactory::GetForProfile(GetProfile()); } @@ -135,7 +141,7 @@ } void NavigateToPageWithIFrame(const std::string& iframe_host, - std::string embedding_host) { + const std::string& embedding_host) { content::WebContents* web_contents = GetActiveWebContents(); // Navigate the top-level page to |embedding_site|. @@ -150,13 +156,23 @@ content::NavigateIframeToURL(web_contents, kIframeId, iframe_url)); } + // Most other cookie-related content settings compare their primary patterns' + // against embedded/requesting sites and their secondary patterns' + // against top-level sites. This convenience function helps avoid confusion + // since |TOP_LEVEL_TPCD_TRIAL| content settings only use a primary pattern + // which is compared against top-level sites. + ContentSettingChangeObserver CreateTopLevelTrialSettingsObserver(GURL url) { + return ContentSettingChangeObserver( + GetProfile(), url, GURL(), ContentSettingsType::TOP_LEVEL_TPCD_TRIAL); + } + // Creates a |TPCD_TRIAL| content setting allowing - // |embedded_url| to access third-party cookie under |top_level_url| + // |embedded_url| to access third-party cookies under |top_level_url| // without actually providing an origin trial token and enabling the // associated origin trial. - void CreateAndVerifyTrialGrant(const GURL& embedded_url, - GURL top_level_url, - bool match_subdomains) { + void CreateAndVerifyThirdPartyTrialGrant(const GURL& embedded_url, + const GURL& top_level_url, + bool match_subdomains) { // Create the content setting. ContentSettingChangeObserver setting_observer( GetActiveWebContents()->GetBrowserContext(), embedded_url, @@ -179,7 +195,56 @@ ThirdPartyCookieAllowMechanism::kAllowBy3PCD); } - bool OnRequest(content::URLLoaderInterceptor::RequestParams* params) { + // Creates a |TOP_LEVEL_TPCD_TRIAL| content setting allowing sites embedded + // under |top_level_url| to access third-party cookies without actually + // providing an origin trial token and enabling the associated origin trial. + void CreateAndVerifyFirstPartyTrialGrant(const GURL& top_level_url, + bool match_subdomains) { + // Create the content setting. + ContentSettingChangeObserver setting_observer = + CreateTopLevelTrialSettingsObserver(top_level_url); + GetTopLevelTrialService()->UpdateTopLevelTrialSettingsForTesting( + url::Origin::Create(top_level_url), match_subdomains, /*enabled=*/true); + setting_observer.Wait(); + + // Verify that a |TOP_LEVEL_TPCD_TRIAL| content setting now allows all sites + // access to cookies as a third-party when embedded by |top_level_url|. + content_settings::CookieSettings* settings = + CookieSettingsFactory::GetForProfile(GetProfile()).get(); + ASSERT_EQ(settings->GetCookieSetting(GURL(), top_level_url, {}, nullptr), + CONTENT_SETTING_ALLOW); + ASSERT_EQ(settings->GetThirdPartyCookieAllowMechanism(GURL(), top_level_url, + {}, nullptr), + content_settings::CookieSettingsBase:: + ThirdPartyCookieAllowMechanism::kAllowByTopLevel3PCD); + } + + virtual bool OnRequest(content::URLLoaderInterceptor::RequestParams* params) { + return false; + } + + base::test::ScopedFeatureList features_; + std::unique_ptr<net::EmbeddedTestServer> https_server_; + std::unique_ptr<URLLoaderInterceptor> url_loader_interceptor_; + const GURL kTrialEnabledSite{base::StrCat({"https://", kTrialEnabledDomain})}; + const GURL kTrialEnabledSiteSubdomain{ + base::StrCat({"https://", kTrialEnabledSubdomain})}; +}; + +class ValidityService3pTrialBrowserTest + : public ValidityServiceBrowserTestBase { + void SetUp() override { + features_.InitWithFeaturesAndParameters( + {{::features::kPersistentOriginTrials, {}}, + {net::features::kTpcdTrialSettings, {}}, + {content_settings::features::kTrackingProtection3pcd, {}}}, + {}); + + PlatformBrowserTest::SetUp(); + } + + bool OnRequest( + content::URLLoaderInterceptor::RequestParams* params) override { std::string host = params->url_request.url.host(); std::string path = params->url_request.url.path().substr(1); @@ -193,17 +258,10 @@ "", params->client.get()); return true; } - - base::test::ScopedFeatureList features_; - std::unique_ptr<net::EmbeddedTestServer> https_server_; - std::unique_ptr<URLLoaderInterceptor> url_loader_interceptor_; - const GURL kTrialEnabledSite{base::StrCat({"https://", kTrialEnabledDomain})}; - const GURL kTrialEnabledSiteSubdomain{ - base::StrCat({"https://", kTrialEnabledSubdomain})}; }; -IN_PROC_BROWSER_TEST_F(TpcdValidityBrowserTest, - RemovesSettingOnJsCookieAccess) { +IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest, + RemovesInvalidSettingOnJsCookieAccess) { content::WebContents* web_contents = GetActiveWebContents(); content_settings::CookieSettings* settings = CookieSettingsFactory::GetForProfile(GetProfile()).get(); @@ -215,8 +273,8 @@ GURL top_level_url = web_contents->GetPrimaryMainFrame()->GetLastCommittedURL(); GURL iframe_url = GetIFrame()->GetLastCommittedURL(); - CreateAndVerifyTrialGrant(iframe_url, top_level_url, - /*match_subdomains=*/false); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, top_level_url, + /*match_subdomains=*/false); // Access cookies via javascript in the iframe, which should cause the setting // to be removed. @@ -232,7 +290,7 @@ CONTENT_SETTING_BLOCK); } -IN_PROC_BROWSER_TEST_F(TpcdValidityBrowserTest, +IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest, RemoveInvalidSubdomainMatchingSettingOnJsCookieAccess) { content::WebContents* web_contents = GetActiveWebContents(); content_settings::CookieSettings* settings = @@ -248,8 +306,8 @@ GURL iframe_url = GetIFrame()->GetLastCommittedURL(); GURL grant_url = GURL(base::StrCat( {"https://", kTrialEnabledSite.host(), ":", iframe_url.port()})); - CreateAndVerifyTrialGrant(grant_url, top_level_url, - /*match_subdomains=*/true); + CreateAndVerifyThirdPartyTrialGrant(grant_url, top_level_url, + /*match_subdomains=*/true); // Access cookies via javascript in the iframe, which should cause the setting // to be removed. @@ -267,7 +325,7 @@ CONTENT_SETTING_BLOCK); } -IN_PROC_BROWSER_TEST_F(TpcdValidityBrowserTest, +IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest, RemoveInvalidSettingOnNavigationCookieAccess) { content::WebContents* web_contents = GetActiveWebContents(); content_settings::CookieSettings* settings = @@ -281,8 +339,8 @@ // without actually enabling the "Tpcd" trial. GURL iframe_url = https_server_->GetURL( kTrialEnabledSite.host(), "/set-cookie?name=value;Secure;SameSite=None"); - CreateAndVerifyTrialGrant(iframe_url, top_level_url, - /*match_subdomains=*/false); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, top_level_url, + /*match_subdomains=*/false); // Navigate the iframe to |iframe_url| to set a cookie via a network response, // which should cause the setting to be removed. @@ -299,7 +357,7 @@ } IN_PROC_BROWSER_TEST_F( - TpcdValidityBrowserTest, + ValidityService3pTrialBrowserTest, RemoveInvalidSubdomainMatchingSettingOnNavigationCookieAccess) { content::WebContents* web_contents = GetActiveWebContents(); content_settings::CookieSettings* settings = @@ -317,8 +375,8 @@ "/set-cookie?name=value;Secure;SameSite=None"); GURL grant_url = GURL(base::StrCat( {"https://", kTrialEnabledSite.host(), ":", iframe_url.port()})); - CreateAndVerifyTrialGrant(grant_url, top_level_url, - /*match_subdomains=*/true); + CreateAndVerifyThirdPartyTrialGrant(grant_url, top_level_url, + /*match_subdomains=*/true); // Navigate the iframe to |iframe_url| to set a cookie via a network response, // which should cause the setting to be removed. @@ -336,7 +394,7 @@ CONTENT_SETTING_BLOCK); } -IN_PROC_BROWSER_TEST_F(TpcdValidityBrowserTest, +IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest, RemoveAllSettingsCreatedUsingAffectedToken) { content::WebContents* web_contents = GetActiveWebContents(); content_settings::CookieSettings* settings = @@ -349,23 +407,23 @@ // Create |TPCD_TRIAL| settings for |iframe_url| under various top-level // sites. - CreateAndVerifyTrialGrant(iframe_url, top_level_url, - /*match_subdomains=*/false); - CreateAndVerifyTrialGrant(iframe_url, GURL("https://b.test"), - /*match_subdomains=*/false); - CreateAndVerifyTrialGrant(iframe_url, GURL("https://c.test"), - /*match_subdomains=*/false); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, top_level_url, + /*match_subdomains=*/false); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, GURL("https://b.test"), + /*match_subdomains=*/false); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, GURL("https://c.test"), + /*match_subdomains=*/false); // Note: this setting matches subdomains, while the others don't, meaning it // would've been created using a different origin trial token. GURL other_top_level_url("https://other-top-level.test"); - CreateAndVerifyTrialGrant(iframe_url, other_top_level_url, - /*match_subdomains=*/true); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, other_top_level_url, + /*match_subdomains=*/true); // Also, create a |TPCD_TRIAL| setting for |other_embedded_url| under // |top_level_url|. GURL other_embedded_url("https://another-embedded-site.test"); - CreateAndVerifyTrialGrant(other_embedded_url, top_level_url, - /*match_subdomains=*/false); + CreateAndVerifyThirdPartyTrialGrant(other_embedded_url, top_level_url, + /*match_subdomains=*/false); // Access cookies via javascript in the iframe, which should cause the setting // to be removed. @@ -411,7 +469,7 @@ } IN_PROC_BROWSER_TEST_F( - TpcdValidityBrowserTest, + ValidityService3pTrialBrowserTest, RemoveAllSettingsCreatedUsingAffectedSubdomainMatchingToken) { content::WebContents* web_contents = GetActiveWebContents(); content_settings::CookieSettings* settings = @@ -424,23 +482,23 @@ // Create |TPCD_TRIAL| settings for |iframe_url| (and subdomains of it) under // various top-level sites. - CreateAndVerifyTrialGrant(iframe_url, top_level_url, - /*match_subdomains=*/true); - CreateAndVerifyTrialGrant(iframe_url, GURL("https://b.test"), - /*match_subdomains=*/true); - CreateAndVerifyTrialGrant(iframe_url, GURL("https://c.test"), - /*match_subdomains=*/true); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, top_level_url, + /*match_subdomains=*/true); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, GURL("https://b.test"), + /*match_subdomains=*/true); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, GURL("https://c.test"), + /*match_subdomains=*/true); // Note: this setting does NOT match subdomains, while the others do, meaning // it would've been created using a different origin trial token. GURL other_top_level_url("https://other-top-level.test"); - CreateAndVerifyTrialGrant(iframe_url, other_top_level_url, - /*match_subdomains=*/false); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, other_top_level_url, + /*match_subdomains=*/false); // Also, create a |TPCD_TRIAL| setting for |other_embedded_url| under // |top_level_url|. GURL other_embedded_url("https://another-embedded-site.test"); - CreateAndVerifyTrialGrant(other_embedded_url, top_level_url, - /*match_subdomains=*/true); + CreateAndVerifyThirdPartyTrialGrant(other_embedded_url, top_level_url, + /*match_subdomains=*/true); // Access cookies via javascript in the iframe, which should cause the setting // to be removed. @@ -485,7 +543,8 @@ ThirdPartyCookieAllowMechanism::kAllowBy3PCD); } -IN_PROC_BROWSER_TEST_F(TpcdValidityBrowserTest, PreserveValidSettings) { +IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest, + PreserveValidSettings) { content::WebContents* web_contents = GetActiveWebContents(); content_settings::CookieSettings* settings = CookieSettingsFactory::GetForProfile(GetProfile()).get(); @@ -494,7 +553,7 @@ const std::string kIframeId = "test"; // defined in iframe_blank.html // Navigate the top-level page to |top_level_url| and update it to have an - // |kTrialEnabledSite| iframe that returns the origin trial token in it's HTTP + // |kTrialEnabledSite| iframe that returns the origin trial token in its HTTP // response headers. { ASSERT_TRUE(content::NavigateToURL(web_contents, top_level_url)); @@ -525,8 +584,8 @@ // Create a |TPCD_TRIAL| setting for |iframe_url| under |top_level_url| // without actually enabling the "Tpcd" trial. - CreateAndVerifyTrialGrant(iframe_url, top_level_url, - /*match_subdomains=*/false); + CreateAndVerifyThirdPartyTrialGrant(iframe_url, top_level_url, + /*match_subdomains=*/false); // Access cookies via javascript in the iframe, which should cause the // setting to be removed. @@ -550,4 +609,211 @@ CONTENT_SETTING_ALLOW); } +class ValidityService1pTrialBrowserTest + : public ValidityServiceBrowserTestBase { + void SetUp() override { + features_.InitWithFeaturesAndParameters( + {{::features::kPersistentOriginTrials, {}}, + {net::features::kTopLevelTpcdTrialSettings, {}}, + {content_settings::features::kTrackingProtection3pcd, {}}}, + {}); + + PlatformBrowserTest::SetUp(); + } + + bool OnRequest( + content::URLLoaderInterceptor::RequestParams* params) override { + std::string host = params->url_request.url.host(); + std::string path = params->url_request.url.path().substr(1); + + if (host != kTrialEnabledDomain || path != kTrialEnabledTopLevelPath) { + return false; + } + + URLLoaderInterceptor::WriteResponse( + base::StrCat({"HTTP/1.1 200 OK\n", "Content-type: text/html\n", + "Origin-Trial: ", kTopLevelTrialToken, "\n", "\n"}), + ("<html><head><title>Trial enabled page with iframe</title></head>" + "<body>" + "<iframe id='test'></iframe>" + "</body></html>"), + params->client.get()); + return true; + } +}; + +IN_PROC_BROWSER_TEST_F(ValidityService1pTrialBrowserTest, + RemovesInvalidSettingOnJsCookieAccess) { + content::WebContents* web_contents = GetActiveWebContents(); + content_settings::CookieSettings* settings = + CookieSettingsFactory::GetForProfile(GetProfile()).get(); + + NavigateToPageWithIFrame(kTrialEnabledSite.host(), "a.test"); + + // Create a |TOP_LEVEL_TPCD_TRIAL| setting for |top_level_url| without + // actually enabling the "TopLevelTpcd" trial. + GURL top_level_url = + web_contents->GetPrimaryMainFrame()->GetLastCommittedURL(); + GURL iframe_url = GetIFrame()->GetLastCommittedURL(); + CreateAndVerifyFirstPartyTrialGrant(top_level_url, + /*match_subdomains=*/false); + + // Access third-party cookies via javascript in the iframe, which should cause + // the setting to be removed. + ContentSettingChangeObserver setting_observer = + CreateTopLevelTrialSettingsObserver(top_level_url); + AccessCookieViaJsIn(web_contents, GetIFrame()); + setting_observer.Wait(); + + // Verify third-party cookie access is no longer permitted under + // |top_level_url|. + EXPECT_EQ(settings->GetCookieSetting(GURL(), top_level_url, {}, nullptr), + CONTENT_SETTING_BLOCK); +} + +IN_PROC_BROWSER_TEST_F(ValidityService1pTrialBrowserTest, + RemoveInvalidSettingOnNavigationCookieAccess) { + content::WebContents* web_contents = GetActiveWebContents(); + content_settings::CookieSettings* settings = + CookieSettingsFactory::GetForProfile(GetProfile()).get(); + + // Navigate to |top_level_url|, which has a blank iframe. + GURL top_level_url = + https_server_->GetURL(kTrialEnabledSite.host(), "/iframe_blank.html"); + ASSERT_TRUE(content::NavigateToURL(web_contents, top_level_url)); + + // Create a |TOP_LEVEL_TPCD_TRIAL| setting for |top_level_url| without + // actually enabling the "TopLevelTpcd" trial. + CreateAndVerifyFirstPartyTrialGrant(top_level_url, + /*match_subdomains=*/false); + + // Navigate the iframe to |iframe_url| to set a cookie via a network response, + // which should cause the setting to be removed. + ContentSettingChangeObserver setting_observer = + CreateTopLevelTrialSettingsObserver(top_level_url); + GURL iframe_url = https_server_->GetURL( + "a.test", "/set-cookie?name=value;Secure;SameSite=None"); + ASSERT_TRUE(NavigateIFrameAndWaitForCookieAccess(iframe_url)); + setting_observer.Wait(); + + // Verify third-party cookie access is no longer permitted under + // |top_level_url|. + EXPECT_EQ(settings->GetCookieSetting(GURL(), top_level_url, {}, nullptr), + CONTENT_SETTING_BLOCK); +} + +IN_PROC_BROWSER_TEST_F(ValidityService1pTrialBrowserTest, + RemoveInvalidSubdomainMatchingSettingOnCookieAccess) { + content::WebContents* web_contents = GetActiveWebContents(); + content_settings::CookieSettings* settings = + CookieSettingsFactory::GetForProfile(GetProfile()).get(); + + NavigateToPageWithIFrame("a.test", kTrialEnabledSiteSubdomain.host()); + + // Create a subdomain-matching |TOP_LEVEL_TPCD_TRIAL| setting for |grant_url| + // (which |top_level_url| is a subdomain of) without actually enabling the + // "TopLevelTpcd" trial. + GURL top_level_url = + web_contents->GetPrimaryMainFrame()->GetLastCommittedURL(); + GURL iframe_url = GetIFrame()->GetLastCommittedURL(); + GURL grant_url = GURL(base::StrCat( + {"https://", kTrialEnabledSite.host(), ":", top_level_url.port()})); + + CreateAndVerifyFirstPartyTrialGrant(grant_url, + /*match_subdomains=*/true); + + // Access cookies via javascript in the iframe, which should cause the setting + // to be removed. + ContentSettingChangeObserver setting_observer = + CreateTopLevelTrialSettingsObserver(top_level_url); + AccessCookieViaJsIn(web_contents, GetIFrame()); + setting_observer.Wait(); + + // Verify third-party cookie access is no longer permitted under + // |top_level_url| or |grant_url|. + EXPECT_EQ(settings->GetCookieSetting(GURL(), top_level_url, {}, nullptr), + CONTENT_SETTING_BLOCK); + EXPECT_EQ(settings->GetCookieSetting(GURL(), grant_url, {}, nullptr), + CONTENT_SETTING_BLOCK); +} + +IN_PROC_BROWSER_TEST_F(ValidityService1pTrialBrowserTest, + PreserveValidSettings) { + content::WebContents* web_contents = GetActiveWebContents(); + content_settings::CookieSettings* settings = + CookieSettingsFactory::GetForProfile(GetProfile()).get(); + GURL top_level_url = + GURL(kTrialEnabledSite.spec() + kTrialEnabledTopLevelPath); + GURL iframe_url = https_server_->GetURL("a.test", "/title1.html"); + const std::string kIframeId = "test"; + + // Navigate to a |top_level_url| page that returns its origin trial + // token in its HTTP response headers and has an iframe. + { + ContentSettingChangeObserver setting_observer = + CreateTopLevelTrialSettingsObserver(top_level_url); + + ASSERT_TRUE(content::NavigateToURL(web_contents, top_level_url)); + ASSERT_TRUE( + content::NavigateIframeToURL(web_contents, kIframeId, iframe_url)); + + setting_observer.Wait(); + + // Verify third-party cookie access is now permitted under + // |top_level_url|. + ASSERT_EQ(settings->GetCookieSetting(GURL(), top_level_url, {}, nullptr), + CONTENT_SETTING_ALLOW); + ASSERT_EQ(settings->GetThirdPartyCookieAllowMechanism(GURL(), top_level_url, + {}, nullptr), + content_settings::CookieSettingsBase:: + ThirdPartyCookieAllowMechanism::kAllowByTopLevel3PCD); + } + + // Write a third-party cookie from the iframe. + AccessCookieViaJsIn(web_contents, GetIFrame()); + + // Since we can't deterministically wait for the ValidityService to do nothing + // in response to a third-party cookie access permitted by a valid + // |TOP_LEVEL_TPCD_TRIAL| content setting, navigate to a different top-level + // site (with an invalid setting) and trigger a third-party cookie access, + // then after the invalid setting has been removed, check that the + // |kTrialEnabledSite| content setting still remains. + { + GURL other_top_level_url = + https_server_->GetURL("different-host.test", "/iframe_blank.html"); + ASSERT_TRUE(content::NavigateToURL(web_contents, other_top_level_url)); + ASSERT_TRUE( + content::NavigateIframeToURL(web_contents, kIframeId, iframe_url)); + + // Create a |TOP_LEVEL_TPCD_TRIAL| setting for |other_top_level_url| without + // actually enabling the "TopLevelTpcd" trial. + CreateAndVerifyFirstPartyTrialGrant(other_top_level_url, + /*match_subdomains=*/false); + + // Access cookies via javascript in the iframe, which should cause the + // setting to be removed. + ContentSettingChangeObserver setting_observer = + CreateTopLevelTrialSettingsObserver(other_top_level_url); + AccessCookieViaJsIn(web_contents, GetIFrame()); + setting_observer.Wait(); + + // Verify third-party cookie access is no longer permitted under + // |other_top_level_url|. + EXPECT_EQ( + settings->GetCookieSetting(GURL(), other_top_level_url, {}, nullptr), + CONTENT_SETTING_BLOCK); + } + + // Verify third-party cookie access is still permitted under + // |top_level_url|. + EXPECT_EQ(settings->GetCookieSetting(GURL(), top_level_url, {}, nullptr), + CONTENT_SETTING_ALLOW); + + HostContentSettingsMap* settings_map = + HostContentSettingsMapFactory::GetForProfile(GetProfile()); + EXPECT_EQ(settings_map->GetContentSetting( + top_level_url, GURL(), + ContentSettingsType::TOP_LEVEL_TPCD_TRIAL, nullptr), + CONTENT_SETTING_ALLOW); +} } // namespace tpcd::trial
diff --git a/chrome/browser/ui/android/multiwindow/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceIphController.java b/chrome/browser/ui/android/multiwindow/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceIphController.java index 3b2f16c5..93d859e 100644 --- a/chrome/browser/ui/android/multiwindow/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceIphController.java +++ b/chrome/browser/ui/android/multiwindow/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceIphController.java
@@ -9,6 +9,7 @@ import android.os.Looper; import android.view.View; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; import org.chromium.chrome.browser.user_education.IPHCommandBuilder; import org.chromium.chrome.browser.user_education.UserEducationHelper; @@ -18,15 +19,21 @@ public class MultiInstanceIphController { /** * Attempts to show an IPH text bubble about the instance swicher in app menu. + * * @param activity The current activity. + * @param profile The current profile. * @param toolbarMenuButton The toolbar menu button to which IPH will be anchored. * @param appMenuHandler The app menu handler. * @param menuId ID of the menu item to be highlighted. */ public static void maybeShowInProductHelp( - Activity activity, View toolbarMenuButton, AppMenuHandler appMenuHandler, int menuId) { + Activity activity, + Profile profile, + View toolbarMenuButton, + AppMenuHandler appMenuHandler, + int menuId) { UserEducationHelper userEducationHelper = - new UserEducationHelper(activity, new Handler(Looper.getMainLooper())); + new UserEducationHelper(activity, profile, new Handler(Looper.getMainLooper())); userEducationHelper.requestShowIPH( new IPHCommandBuilder( toolbarMenuButton.getContext().getResources(),
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/status/PageInfoIPHController.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/status/PageInfoIPHController.java index bfc7e7d..5110d10 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/status/PageInfoIPHController.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/status/PageInfoIPHController.java
@@ -4,14 +4,10 @@ package org.chromium.chrome.browser.omnibox.status; -import android.app.Activity; import android.graphics.Rect; -import android.os.Handler; -import android.os.Looper; import android.view.View; import androidx.annotation.StringRes; -import androidx.annotation.VisibleForTesting; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.omnibox.R; @@ -27,20 +23,15 @@ private final UserEducationHelper mUserEducationHelper; private final View mStatusView; - @VisibleForTesting - public PageInfoIPHController(UserEducationHelper educationHelper, View statusView) { - mUserEducationHelper = educationHelper; - mStatusView = statusView; - } - /** * Constructor * - * @param activity The activity. + * @param educationHelper The helper controlling user education. * @param statusView The status view in the omnibox. Used as anchor for IPH bubble. */ - public PageInfoIPHController(Activity activity, View statusView) { - this(new UserEducationHelper(activity, new Handler(Looper.getMainLooper())), statusView); + public PageInfoIPHController(UserEducationHelper educationHelper, View statusView) { + mUserEducationHelper = educationHelper; + mStatusView = statusView; } /**
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/status/StatusCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/status/StatusCoordinator.java index 9cd4c46..9d1300d 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/status/StatusCoordinator.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/status/StatusCoordinator.java
@@ -6,6 +6,8 @@ import android.animation.Animator; import android.content.res.Resources; +import android.os.Handler; +import android.os.Looper; import android.view.View; import androidx.annotation.DrawableRes; @@ -26,6 +28,7 @@ import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.ui.theme.BrandedColorScheme; +import org.chromium.chrome.browser.user_education.UserEducationHelper; import org.chromium.components.permissions.PermissionDialogController; import org.chromium.components.search_engines.TemplateUrlService; import org.chromium.ui.base.WindowAndroid; @@ -98,7 +101,10 @@ PageInfoIPHController pageInfoIPHController = new PageInfoIPHController( - ContextUtils.activityFromContext(mStatusView.getContext()), + new UserEducationHelper( + ContextUtils.activityFromContext(mStatusView.getContext()), + profileSupplier, + new Handler(Looper.getMainLooper())), getSecurityIconView()); mMediator =
diff --git a/chrome/browser/ui/android/page_insights/java/src/org/chromium/chrome/browser/page_insights/PageInsightsCoordinatorTest.java b/chrome/browser/ui/android/page_insights/java/src/org/chromium/chrome/browser/page_insights/PageInsightsCoordinatorTest.java index 347cf3f..38713df 100644 --- a/chrome/browser/ui/android/page_insights/java/src/org/chromium/chrome/browser/page_insights/PageInsightsCoordinatorTest.java +++ b/chrome/browser/ui/android/page_insights/java/src/org/chromium/chrome/browser/page_insights/PageInsightsCoordinatorTest.java
@@ -402,9 +402,11 @@ public void testResizeContent() throws Exception { createPageInsightsCoordinator(); assertEquals(SheetState.HIDDEN, mPageInsightsController.getSheetState()); - setAutoTriggerTimerFinished(); + setAutoTriggerTimerFinished(); + InstrumentationRegistry.getInstrumentation().waitForIdleSync(); hideTopBar(); // Signal for auto triggering the PIH + int peekHeight = mPageInsightsController.getCurrentOffset(); verify(mBrowserControlsSizer).setBottomControlsHeight(eq(peekHeight), eq(0));
diff --git a/chrome/browser/ui/android/plus_addresses/plus_address_creation_controller_android_unittest.cc b/chrome/browser/ui/android/plus_addresses/plus_address_creation_controller_android_unittest.cc index 1bdc52f..09e53a0 100644 --- a/chrome/browser/ui/android/plus_addresses/plus_address_creation_controller_android_unittest.cc +++ b/chrome/browser/ui/android/plus_addresses/plus_address_creation_controller_android_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ui/android/plus_addresses/plus_address_creation_controller_android.h" + #include <memory> #include <optional>
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/ToolbarFeatures.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/ToolbarFeatures.java index 28792e9..4b86f0c 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/ToolbarFeatures.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/ToolbarFeatures.java
@@ -38,6 +38,8 @@ USE_TOOLBAR_BG_COLOR_FOR_STRIP_TRANSITION_SCRIM_PARAM, false); + private static Boolean sShouldBlockCapturesForFullscreen; + /** Private constructor to avoid instantiation. */ private ToolbarFeatures() {} @@ -47,8 +49,17 @@ /** Returns if the suppression logic should avoid capturing during fullscreen, such as video. */ public static boolean shouldBlockCapturesForFullscreen() { - return ChromeFeatureList.getFieldTrialParamByFeatureAsBoolean( - ChromeFeatureList.SUPPRESS_TOOLBAR_CAPTURES, BLOCK_FOR_FULLSCREEN, false); + // Cache this value to avoid calling into native every time it is checked. + if (sShouldBlockCapturesForFullscreen == null) { + boolean shouldBlockCaptures = + ChromeFeatureList.getFieldTrialParamByFeatureAsBoolean( + ChromeFeatureList.SUPPRESS_TOOLBAR_CAPTURES, + BLOCK_FOR_FULLSCREEN, + false); + sShouldBlockCapturesForFullscreen = shouldBlockCaptures; + return shouldBlockCaptures; + } + return sShouldBlockCapturesForFullscreen; } /** @@ -67,4 +78,9 @@ public static boolean shouldUseToolbarBgColorForStripTransitionScrim() { return USE_TOOLBAR_BG_COLOR_FOR_STRIP_TRANSITION_SCRIM.getValue(); } + + /** Resets cached value for whether to block captures for fullscreen. */ + public static void resetShouldBlockCapturesForFullscreenForTesting() { + sShouldBlockCapturesForFullscreen = null; + } }
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainerTest.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainerTest.java index 8e57b744..dbd2645 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainerTest.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainerTest.java
@@ -183,6 +183,7 @@ public void before() { mJniMocker.mock(ResourceFactoryJni.TEST_HOOKS, mResourceFactoryJni); UmaRecorderHolder.resetForTesting(); + ToolbarFeatures.resetShouldBlockCapturesForFullscreenForTesting(); when(mToolbarContainer.getWidth()).thenReturn(1); when(mToolbarContainer.getHeight()).thenReturn(1); when(mToolbarContainer.findViewById(anyInt())).thenReturn(mToolbarHairline); @@ -393,6 +394,7 @@ ToolbarFeatures.BLOCK_FOR_FULLSCREEN, "true"); FeatureList.setTestValues(testValues); + ToolbarFeatures.resetShouldBlockCapturesForFullscreenForTesting(); final @ToolbarSnapshotDifference int difference = ToolbarSnapshotDifference.URL_TEXT; when(mFullscreenManager.getPersistentFullscreenMode()).thenReturn(true);
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java index 61d2915..2a9171f 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
@@ -2901,7 +2901,10 @@ View optionalButton = optionalButtonStub.inflate(); UserEducationHelper userEducationHelper = - new UserEducationHelper((Activity) getContext(), new Handler()); + new UserEducationHelper( + (Activity) getContext(), + ProfileManager.getLastUsedRegularProfile(), + new Handler()); BooleanSupplier isAnimationAllowedPredicate = new BooleanSupplier() {
diff --git a/chrome/browser/ui/ash/birch/birch_keyed_service_unittest.cc b/chrome/browser/ui/ash/birch/birch_keyed_service_unittest.cc index 981ab889..231aefe9 100644 --- a/chrome/browser/ui/ash/birch/birch_keyed_service_unittest.cc +++ b/chrome/browser/ui/ash/birch/birch_keyed_service_unittest.cc
@@ -181,7 +181,6 @@ using ash::holding_space::ScopedTestMountPoint; class BirchKeyedServiceTest : public BrowserWithTestWindowTest { - // public testing::Test { public: BirchKeyedServiceTest() : BrowserWithTestWindowTest(
diff --git a/chrome/browser/ui/ash/chrome_new_window_client.cc b/chrome/browser/ui/ash/chrome_new_window_client.cc index c07b406..b80fd37 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.cc +++ b/chrome/browser/ui/ash/chrome_new_window_client.cc
@@ -37,6 +37,7 @@ #include "chrome/browser/chromeos/arc/arc_web_contents_data.h" #include "chrome/browser/chromeos/network/network_portal_signin_window.h" #include "chrome/browser/extensions/extension_util.h" +#include "chrome/browser/platform_util.h" #include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/sessions/tab_restore_service_factory.h" @@ -523,6 +524,13 @@ chromeos::NetworkPortalSigninWindow::Get()->Show(url); } +void ChromeNewWindowClient::OpenFile(const base::FilePath& file_path) { + Profile* profile = ProfileManager::GetActiveUserProfile(); + platform_util::OpenItem(profile, file_path, + platform_util::OpenItemType::OPEN_FILE, + platform_util::OpenOperationCallback()); +} + void ChromeNewWindowClient::LaunchCameraApp(const std::string& queries, int32_t task_id) { DCHECK(IsCameraAppEnabled());
diff --git a/chrome/browser/ui/ash/chrome_new_window_client.h b/chrome/browser/ui/ash/chrome_new_window_client.h index de771b8..15c20f8 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.h +++ b/chrome/browser/ui/ash/chrome_new_window_client.h
@@ -50,6 +50,7 @@ const std::string& description_template) override; void OpenPersonalizationHub() override; void OpenCaptivePortalSignin(const GURL& url) override; + void OpenFile(const base::FilePath& file_path) override; // arc::ControlCameraAppDelegate: void LaunchCameraApp(const std::string& queries, int32_t task_id) override;
diff --git a/chrome/browser/ui/ash/crosapi_new_window_delegate.cc b/chrome/browser/ui/ash/crosapi_new_window_delegate.cc index 1760b972..1740479b 100644 --- a/chrome/browser/ui/ash/crosapi_new_window_delegate.cc +++ b/chrome/browser/ui/ash/crosapi_new_window_delegate.cc
@@ -221,6 +221,10 @@ crosapi::BrowserManager::Get()->OpenCaptivePortalSignin(url); } +void CrosapiNewWindowDelegate::OpenFile(const base::FilePath& file_path) { + delegate_->OpenFile(file_path); +} + void CrosapiNewWindowDelegate::DestroyWindowObserver() { window_observer_.reset(); }
diff --git a/chrome/browser/ui/ash/crosapi_new_window_delegate.h b/chrome/browser/ui/ash/crosapi_new_window_delegate.h index 4b70cf3..3c7e623 100644 --- a/chrome/browser/ui/ash/crosapi_new_window_delegate.h +++ b/chrome/browser/ui/ash/crosapi_new_window_delegate.h
@@ -50,6 +50,7 @@ const std::string& description_template) override; void OpenPersonalizationHub() override; void OpenCaptivePortalSignin(const GURL& url) override; + void OpenFile(const base::FilePath& file_path) override; private: // Observes the aura::Window instances created after the webui tab-drop
diff --git a/chrome/browser/ui/ash/desks/desks_client_browsertest.cc b/chrome/browser/ui/ash/desks/desks_client_browsertest.cc index b62af2f..056ac6f 100644 --- a/chrome/browser/ui/ash/desks/desks_client_browsertest.cc +++ b/chrome/browser/ui/ash/desks/desks_client_browsertest.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/ui/ash/desks/desks_client.h" + #include <cstdint> #include <cstdlib> #include <memory> @@ -73,7 +75,6 @@ #include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/ash/desks/chrome_desks_util.h" -#include "chrome/browser/ui/ash/desks/desks_client.h" #include "chrome/browser/ui/ash/desks/desks_templates_app_launch_handler.h" #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" #include "chrome/browser/ui/ash/system_web_apps/system_web_app_ui_utils.h"
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc index 6b780d9..f033eb51 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl_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/ui/autofill/autofill_popup_controller_impl.h" + #include <stddef.h> #include <memory> @@ -20,7 +22,6 @@ #include "build/chromeos_buildflags.h" #include "chrome/browser/accessibility/accessibility_state_utils.h" #include "chrome/browser/autofill/personal_data_manager_factory.h" -#include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" #include "chrome/browser/ui/autofill/autofill_popup_view.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_profile.h"
diff --git a/chrome/browser/ui/autofill/autofill_popup_view.h b/chrome/browser/ui/autofill/autofill_popup_view.h index 5e3be3b..00b48dbe 100644 --- a/chrome/browser/ui/autofill/autofill_popup_view.h +++ b/chrome/browser/ui/autofill/autofill_popup_view.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ #include <stddef.h> + #include <optional> #include <string>
diff --git a/chrome/browser/ui/hats/survey_config.cc b/chrome/browser/ui/hats/survey_config.cc index 32551bf..d8960ff 100644 --- a/chrome/browser/ui/hats/survey_config.cc +++ b/chrome/browser/ui/hats/survey_config.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "survey_config.h" + #include <optional> #include "base/feature_list.h"
diff --git a/chrome/browser/ui/sharing_hub/fake_sharing_hub_bubble_controller.h b/chrome/browser/ui/sharing_hub/fake_sharing_hub_bubble_controller.h index ff44455..85f43f2 100644 --- a/chrome/browser/ui/sharing_hub/fake_sharing_hub_bubble_controller.h +++ b/chrome/browser/ui/sharing_hub/fake_sharing_hub_bubble_controller.h
@@ -5,12 +5,11 @@ #ifndef CHROME_BROWSER_UI_SHARING_HUB_FAKE_SHARING_HUB_BUBBLE_CONTROLLER_H_ #define CHROME_BROWSER_UI_SHARING_HUB_FAKE_SHARING_HUB_BUBBLE_CONTROLLER_H_ -#include "chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h" - #include <optional> #include "base/callback_list.h" #include "base/functional/callback.h" +#include "chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h" #include "testing/gmock/include/gmock/gmock.h" namespace sharing_hub {
diff --git a/chrome/browser/ui/signin/signin_reauth_view_controller_browsertest.cc b/chrome/browser/ui/signin/signin_reauth_view_controller_browsertest.cc index 036e43b..ae540d7c 100644 --- a/chrome/browser/ui/signin/signin_reauth_view_controller_browsertest.cc +++ b/chrome/browser/ui/signin/signin_reauth_view_controller_browsertest.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/ui/signin/signin_reauth_view_controller.h" + #include <memory> #include <optional> @@ -22,7 +24,6 @@ #include "chrome/browser/sync/test/integration/encryption_helper.h" #include "chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/signin/signin_reauth_view_controller.h" #include "chrome/browser/ui/signin/signin_view_controller.h" #include "chrome/browser/ui/tabs/tab_enums.h" #include "chrome/browser/ui/webui/signin/login_ui_test_utils.h"
diff --git a/chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop_unittest.cc b/chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop_unittest.cc index b08cad0c..57c22f0e 100644 --- a/chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop_unittest.cc +++ b/chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop_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/ui/tab_contents/chrome_web_contents_view_handle_drop.h" + #include <memory> #include <optional> #include <set> @@ -21,7 +23,6 @@ #include "chrome/browser/enterprise/connectors/test/deep_scanning_test_utils.h" #include "chrome/browser/enterprise/connectors/test/fake_content_analysis_delegate.h" #include "chrome/browser/policy/dm_token_utils.h" -#include "chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h"
diff --git a/chrome/browser/ui/tabs/pinned_tab_collection.cc b/chrome/browser/ui/tabs/pinned_tab_collection.cc index 05c3cf0a..f92f661 100644 --- a/chrome/browser/ui/tabs/pinned_tab_collection.cc +++ b/chrome/browser/ui/tabs/pinned_tab_collection.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 "chrome/browser/ui/tabs/pinned_tab_collection.h" + #include <memory> #include <optional> -#include "chrome/browser/ui/tabs/pinned_tab_collection.h" #include "chrome/browser/ui/tabs/tab_collection_storage.h" #include "chrome/browser/ui/tabs/tab_model.h"
diff --git a/chrome/browser/ui/thumbnails/thumbnail_image.h b/chrome/browser/ui/thumbnails/thumbnail_image.h index df9281c..9554b927 100644 --- a/chrome/browser/ui/thumbnails/thumbnail_image.h +++ b/chrome/browser/ui/thumbnails/thumbnail_image.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_THUMBNAILS_THUMBNAIL_IMAGE_H_ #include <stdint.h> + #include <memory> #include <optional> #include <utility>
diff --git a/chrome/browser/ui/thumbnails/thumbnail_tab_helper.cc b/chrome/browser/ui/thumbnails/thumbnail_tab_helper.cc index d1e175b..beaccfb7 100644 --- a/chrome/browser/ui/thumbnails/thumbnail_tab_helper.cc +++ b/chrome/browser/ui/thumbnails/thumbnail_tab_helper.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/thumbnails/thumbnail_tab_helper.h" #include <stdint.h> + #include <algorithm> #include <optional> #include <set>
diff --git a/chrome/browser/ui/user_education/show_promo_in_page.h b/chrome/browser/ui/user_education/show_promo_in_page.h index 57f018a20..90722b00 100644 --- a/chrome/browser/ui/user_education/show_promo_in_page.h +++ b/chrome/browser/ui/user_education/show_promo_in_page.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/callback_list.h" #include "base/functional/callback_forward.h" #include "base/functional/callback_helpers.h"
diff --git a/chrome/browser/ui/user_education/show_promo_in_page_interactive_uitest.cc b/chrome/browser/ui/user_education/show_promo_in_page_interactive_uitest.cc index 39d9272..863bc55 100644 --- a/chrome/browser/ui/user_education/show_promo_in_page_interactive_uitest.cc +++ b/chrome/browser/ui/user_education/show_promo_in_page_interactive_uitest.cc
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/user_education/show_promo_in_page.h" - #include <optional> #include <string> @@ -11,6 +9,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/user_education/show_promo_in_page.h" #include "chrome/test/interaction/interactive_browser_test.h" #include "components/strings/grit/components_strings.h" #include "components/user_education/common/help_bubble_params.h"
diff --git a/chrome/browser/ui/views/autofill/payments/offer_notification_icon_view_browsertest.cc b/chrome/browser/ui/views/autofill/payments/offer_notification_icon_view_browsertest.cc index ebf2619..eb0861d 100644 --- a/chrome/browser/ui/views/autofill/payments/offer_notification_icon_view_browsertest.cc +++ b/chrome/browser/ui/views/autofill/payments/offer_notification_icon_view_browsertest.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 "chrome/browser/ui/views/autofill/payments/offer_notification_icon_view.h" + #include <optional> #include "chrome/browser/ui/autofill/chrome_autofill_client.h" #include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/browser/ui/page_action/page_action_icon_type.h" #include "chrome/browser/ui/test/test_browser_ui.h" -#include "chrome/browser/ui/views/autofill/payments/offer_notification_icon_view.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
diff --git a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils_browsertest.cc b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils_browsertest.cc index 3488b7d..ac0a617b 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils_browsertest.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils_browsertest.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/ui/views/autofill/popup/popup_row_factory_utils.h" + #include <memory> #include <optional> #include <string> @@ -12,7 +14,6 @@ #include "chrome/browser/ui/test/test_browser_ui.h" #include "chrome/browser/ui/views/autofill/popup/mock_accessibility_selection_delegate.h" #include "chrome/browser/ui/views/autofill/popup/mock_selection_delegate.h" -#include "chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.h" #include "chrome/browser/ui/views/autofill/popup/popup_row_view.h" #include "components/autofill/core/browser/ui/popup_item_ids.h" #include "components/autofill/core/browser/ui/suggestion.h"
diff --git a/chrome/browser/ui/views/chooser_bubble_testapi_views.cc b/chrome/browser/ui/views/chooser_bubble_testapi_views.cc index e56d722..85f12c68 100644 --- a/chrome/browser/ui/views/chooser_bubble_testapi_views.cc +++ b/chrome/browser/ui/views/chooser_bubble_testapi_views.cc
@@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/chooser_bubble_testapi.h" - #include <optional> #include "base/test/bind.h" +#include "chrome/browser/ui/chooser_bubble_testapi.h" #include "ui/views/widget/any_widget_observer.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc index 690ee0c..6e845dd 100644 --- a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc
@@ -166,7 +166,7 @@ ? kDownloadToolbarButtonChromeRefreshIcon : kDownloadToolbarButtonIcon, kDownloadToolbarButtonIcon); - GetViewAccessibility().OverrideHasPopup(ax::mojom::HasPopup::kDialog); + GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kDialog); tooltip_texts_[0] = l10n_util::GetStringUTF16(IDS_TOOLTIP_DOWNLOAD_ICON); SetTooltipText(tooltip_texts_.at(0)); SetVisible(false);
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc b/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc index 15cee10..71f61d6 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc +++ b/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc
@@ -2,8 +2,6 @@ // 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/extensions/extensions_menu_view.h" - #include <algorithm> #include <optional> @@ -26,6 +24,7 @@ #include "chrome/browser/ui/views/controls/hover_button.h" #include "chrome/browser/ui/views/extensions/extensions_menu_button.h" #include "chrome/browser/ui/views/extensions/extensions_menu_item_view.h" +#include "chrome/browser/ui/views/extensions/extensions_menu_view.h" #include "chrome/browser/ui/views/extensions/extensions_toolbar_button.h" #include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h" #include "chrome/browser/ui/views/extensions/extensions_toolbar_interactive_uitest.h"
diff --git a/chrome/browser/ui/views/extensions/extensions_toolbar_button.cc b/chrome/browser/ui/views/extensions/extensions_toolbar_button.cc index 08c1d9d4..e789cf6d 100644 --- a/chrome/browser/ui/views/extensions/extensions_toolbar_button.cc +++ b/chrome/browser/ui/views/extensions/extensions_toolbar_button.cc
@@ -83,7 +83,7 @@ SetVectorIcon(GetIcon(state_)); - GetViewAccessibility().OverrideHasPopup(ax::mojom::HasPopup::kMenu); + GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kMenu); // Do not flip the Extensions icon in RTL. SetFlipCanvasOnPaintForRTLUI(false);
diff --git a/chrome/browser/ui/views/frame/browser_actions.cc b/chrome/browser/ui/views/frame/browser_actions.cc index 6ae7b57..bb0b84c 100644 --- a/chrome/browser/ui/views/frame/browser_actions.cc +++ b/chrome/browser/ui/views/frame/browser_actions.cc
@@ -104,8 +104,6 @@ } void BrowserActions::InitializeBrowserActions() { - const bool rename_journeys = - base::FeatureList::IsEnabled(history_clusters::kRenameJourneys); Profile* profile = browser_->profile(); actions::ActionManager::Get().AddAction( @@ -145,13 +143,11 @@ if (HistoryClustersSidePanelCoordinator::IsSupported(profile)) { root_action_item_->AddChild( - SidePanelAction( - SidePanelEntryId::kHistoryClusters, - rename_journeys ? IDS_HISTORY_TITLE - : IDS_HISTORY_CLUSTERS_JOURNEYS_TAB_LABEL, - IDS_HISTORY_CLUSTERS_SHOW_SIDE_PANEL, - vector_icons::kHistoryChromeRefreshIcon, - kActionSidePanelShowHistoryCluster, &(browser_.get()), true) + SidePanelAction(SidePanelEntryId::kHistoryClusters, IDS_HISTORY_TITLE, + IDS_HISTORY_CLUSTERS_SHOW_SIDE_PANEL, + vector_icons::kHistoryChromeRefreshIcon, + kActionSidePanelShowHistoryCluster, &(browser_.get()), + true) .Build()); }
diff --git a/chrome/browser/ui/views/frame/contents_layout_manager.cc b/chrome/browser/ui/views/frame/contents_layout_manager.cc index 196c80d..1fe9a3e8 100644 --- a/chrome/browser/ui/views/frame/contents_layout_manager.cc +++ b/chrome/browser/ui/views/frame/contents_layout_manager.cc
@@ -21,15 +21,19 @@ return; strategy_.CopyFrom(strategy); - if (host_) - host_->InvalidateLayout(); + InvalidateHost(true); } -void ContentsLayoutManager::Layout(views::View* contents_container) { - DCHECK(host_ == contents_container); +views::ProposedLayout ContentsLayoutManager::CalculateProposedLayout( + const views::SizeBounds& size_bounds) const { + views::ProposedLayout layouts; - int height = contents_container->height(); - int width = contents_container->width(); + // If the |size_bounds| isn't bounded, the preferred size is being requested. + if (!size_bounds.is_fully_bounded()) { + return layouts; + } + int height = size_bounds.height().value(); + int width = size_bounds.width().value(); gfx::Size container_size(width, height); gfx::Rect new_devtools_bounds; @@ -40,21 +44,21 @@ // DevTools cares about the specific position, so we have to compensate RTL // layout here. - devtools_view_->SetBoundsRect(host_->GetMirroredRect(new_devtools_bounds)); - contents_view_->SetBoundsRect(host_->GetMirroredRect(new_contents_bounds)); + layouts.child_layouts.emplace_back( + devtools_view_.get(), devtools_view_->GetVisible(), + host_view()->GetMirroredRect(new_devtools_bounds), + views::SizeBounds(container_size)); + layouts.child_layouts.emplace_back( + contents_view_.get(), contents_view_->GetVisible(), + host_view()->GetMirroredRect(new_contents_bounds), + views::SizeBounds(container_size)); // Enterprise watermark view is always overlaid, even when empty. if (watermark_view_) { - watermark_view_->SetBoundsRect(gfx::Rect(0, 0, width, height)); + layouts.child_layouts.emplace_back( + watermark_view_.get(), watermark_view_->GetVisible(), + gfx::Rect(0, 0, width, height), views::SizeBounds(container_size)); } -} - -gfx::Size ContentsLayoutManager::GetPreferredSize( - const views::View* host) const { - return gfx::Size(); -} - -void ContentsLayoutManager::Installed(views::View* host) { - DCHECK(!host_); - host_ = host; + layouts.host_size = gfx::Size(width, height); + return layouts; }
diff --git a/chrome/browser/ui/views/frame/contents_layout_manager.h b/chrome/browser/ui/views/frame/contents_layout_manager.h index 6236107..ac487c0a 100644 --- a/chrome/browser/ui/views/frame/contents_layout_manager.h +++ b/chrome/browser/ui/views/frame/contents_layout_manager.h
@@ -7,10 +7,11 @@ #include "base/memory/raw_ptr.h" #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" -#include "ui/views/layout/layout_manager.h" +#include "ui/views/layout/layout_manager_base.h" +#include "ui/views/layout/proposed_layout.h" // ContentsLayoutManager positions the WebContents and devtools WebContents. -class ContentsLayoutManager : public views::LayoutManager { +class ContentsLayoutManager : public views::LayoutManagerBase { public: ContentsLayoutManager(views::View* devtools_view, views::View* contents_view, @@ -25,18 +26,16 @@ void SetContentsResizingStrategy( const DevToolsContentsResizingStrategy& strategy); - // views::LayoutManager overrides: - void Layout(views::View* host) override; - gfx::Size GetPreferredSize(const views::View* host) const override; - void Installed(views::View* host) override; + protected: + // views::LayoutManagerBase overrides: + views::ProposedLayout CalculateProposedLayout( + const views::SizeBounds& size_bounds) const override; private: raw_ptr<views::View> devtools_view_; raw_ptr<views::View> contents_view_; raw_ptr<views::View> watermark_view_; - raw_ptr<views::View> host_ = nullptr; - DevToolsContentsResizingStrategy strategy_; };
diff --git a/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.cc b/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.cc index 1761c17..2f5469a 100644 --- a/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.cc +++ b/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.cc
@@ -64,7 +64,7 @@ kMediaToolbarButtonTouchIcon); SetTooltipText( l10n_util::GetStringUTF16(IDS_GLOBAL_MEDIA_CONTROLS_ICON_TOOLTIP_TEXT)); - GetViewAccessibility().OverrideHasPopup(ax::mojom::HasPopup::kDialog); + GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kDialog); SetProperty(views::kElementIdentifierKey, kToolbarMediaButtonElementId); // We start hidden and only show once |controller_| tells us to.
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_dialog_browsertest.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view_dialog_browsertest.cc index 73a8852b..5d841f4 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_dialog_browsertest.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_dialog_browsertest.cc
@@ -6,6 +6,7 @@ #include "base/time/time_override.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h" +#include "base/path_service.h" #include "build/build_config.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/history/history_service_factory.h" @@ -23,7 +24,10 @@ #include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h" #include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h" +#include "chrome/browser/web_applications/test/os_integration_test_override_impl.h" +#include "chrome/browser/web_applications/test/web_app_install_test_utils.h" #include "chrome/common/chrome_features.h" +#include "chrome/common/chrome_paths.h" #include "chrome/common/url_constants.h" #include "chrome/test/base/testing_profile_manager.h" #include "chrome/test/base/ui_test_utils.h" @@ -56,6 +60,10 @@ #include "url/gurl.h" #include "url/origin.h" +#if BUILDFLAG(IS_MAC) +#include "chrome/browser/web_applications/app_shim_registry_mac.h" +#endif + namespace { constexpr int kTopicsAPITestTaxonomyVersion = 1; @@ -954,3 +962,116 @@ InvokeUi_AppNameIsDisplayedInsteadOfOriginForIsolatedWebApps_REV2) { ShowAndVerifyUi(); } + +namespace { +enum class WebAppWindowMode { kBrowserTab, kAppWindow }; + +std::string WebAppWindowModeToString( + const testing::TestParamInfo<WebAppWindowMode>& info) { + switch (info.param) { + case WebAppWindowMode::kBrowserTab: + return "BrowserTab"; + case WebAppWindowMode::kAppWindow: + return "AppWindow"; + } +} +} // namespace + +class PageInfoBubbleViewWebAppBrowserTest + : public PageInfoBubbleViewDialogBrowserTest, + public testing::WithParamInterface<WebAppWindowMode> { + public: + PageInfoBubbleViewWebAppBrowserTest() { + feature_list_.InitWithFeatures( + { +#if BUILDFLAG(IS_MAC) + features::kAppShimNotificationAttribution +#endif + }, + {}); + } + + void SetUpOnMainThread() override { + PageInfoBubbleViewDialogBrowserTest::SetUpOnMainThread(); + + override_registration_ = + web_app::OsIntegrationTestOverrideImpl::OverrideForTesting(); + + https_server_.ServeFilesFromDirectory( + base::PathService::CheckedGet(chrome::DIR_TEST_DATA)); + ASSERT_TRUE(https_server_.Start()); + + start_url_ = https_server_.GetURL("/web_apps/basic.html"); + app_id_ = web_app::InstallWebAppFromPage(browser(), start_url_); + } + + void TearDownOnMainThread() override { + web_app::test::UninstallAllWebApps(browser()->profile()); + override_registration_.reset(); + + PageInfoBubbleViewDialogBrowserTest::TearDownOnMainThread(); + } + + // DialogBrowserTest: + void ShowUi(const std::string& name_with_param_suffix) override { + // Bubble dialogs' bounds may exceed the display's work area. + // https://crbug.com/893292. + set_should_verify_dialog_bounds(false); + + const std::string& name = + name_with_param_suffix.substr(0, name_with_param_suffix.find("/")); + +#if BUILDFLAG(IS_MAC) + if (name == "NotificationSystemPermissionDenied") { + AppShimRegistry::Get()->SaveNotificationPermissionStatusForApp( + app_id_, mac_notifications::mojom::PermissionStatus::kDenied); + + HostContentSettingsMapFactory::GetForProfile(browser()->profile()) + ->SetContentSettingDefaultScope( + start_url_, start_url_, ContentSettingsType::NOTIFICATIONS, + ContentSetting::CONTENT_SETTING_ALLOW); + } +#endif + + Browser* app_browser = browser(); + switch (GetParam()) { + case WebAppWindowMode::kBrowserTab: + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), start_url_)); + break; + case WebAppWindowMode::kAppWindow: + app_browser = + web_app::LaunchWebAppBrowserAndWait(browser()->profile(), app_id_); + ASSERT_TRUE(app_browser); + break; + } + OpenPageInfoBubble(app_browser); + } + + private: + base::test::ScopedFeatureList feature_list_; + net::EmbeddedTestServer https_server_{net::EmbeddedTestServer::TYPE_HTTPS}; + GURL start_url_; + webapps::AppId app_id_; + + std::unique_ptr< + ::web_app::OsIntegrationTestOverrideImpl::BlockingRegistration> + override_registration_; +}; + +IN_PROC_BROWSER_TEST_P(PageInfoBubbleViewWebAppBrowserTest, InvokeUi_Default) { + ShowAndVerifyUi(); +} + +#if BUILDFLAG(IS_MAC) +IN_PROC_BROWSER_TEST_P(PageInfoBubbleViewWebAppBrowserTest, + InvokeUi_NotificationSystemPermissionDenied) { + ShowAndVerifyUi(); +} +#endif + +INSTANTIATE_TEST_SUITE_P( + /*no prefix*/, + PageInfoBubbleViewWebAppBrowserTest, + testing::ValuesIn({WebAppWindowMode::kBrowserTab, + WebAppWindowMode::kAppWindow}), + &WebAppWindowModeToString);
diff --git a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view_browsertest.cc b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view_browsertest.cc index 74fd9b692..24c884b 100644 --- a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view_browsertest.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/ui/views/payments/secure_payment_confirmation_dialog_view.h" + #include <optional> #include "base/test/metrics/histogram_tester.h" @@ -11,7 +13,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/test/test_browser_dialog.h" -#include "chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.h" #include "chrome/browser/ui/views/payments/secure_payment_confirmation_views_util.h" #include "chrome/browser/ui/views/payments/test_secure_payment_confirmation_payment_request_delegate.h" #include "chrome/test/base/in_process_browser_test.h"
diff --git a/chrome/browser/ui/views/performance_controls/battery_saver_button.cc b/chrome/browser/ui/views/performance_controls/battery_saver_button.cc index 375de952..158109a 100644 --- a/chrome/browser/ui/views/performance_controls/battery_saver_button.cc +++ b/chrome/browser/ui/views/performance_controls/battery_saver_button.cc
@@ -35,7 +35,7 @@ SetAccessibleName( l10n_util::GetStringUTF16(IDS_BATTERY_SAVER_BUTTON_ACCNAME)); SetTooltipText(l10n_util::GetStringUTF16(IDS_BATTERY_SAVER_BUTTON_TOOLTIP)); - GetViewAccessibility().OverrideHasPopup(ax::mojom::HasPopup::kDialog); + GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kDialog); SetProperty(views::kElementIdentifierKey, kToolbarBatterySaverButtonElementId);
diff --git a/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc b/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc index 1b462b3..313f838 100644 --- a/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc +++ b/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc
@@ -93,7 +93,7 @@ // and LabelButton image/label placement is still flipped like usual. SetFlipCanvasOnPaintForRTLUI(false); - GetViewAccessibility().OverrideHasPopup(ax::mojom::HasPopup::kMenu); + GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kMenu); // For consistency with identity representation, we need to have the avatar on // the left and the (potential) user name on the right.
diff --git a/chrome/browser/ui/views/profiles/avatar_toolbar_button_browsertest.cc b/chrome/browser/ui/views/profiles/avatar_toolbar_button_browsertest.cc index f16c08b..92bb8a5 100644 --- a/chrome/browser/ui/views/profiles/avatar_toolbar_button_browsertest.cc +++ b/chrome/browser/ui/views/profiles/avatar_toolbar_button_browsertest.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/ui/views/profiles/avatar_toolbar_button.h" + #include <optional> #include <string> @@ -31,7 +33,6 @@ #include "chrome/browser/ui/profiles/profile_colors_util.h" #include "chrome/browser/ui/ui_features.h" #include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/browser/ui/views/profiles/avatar_toolbar_button.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h"
diff --git a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view_browsertest.cc b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view_browsertest.cc index 9c6bd9b..7f1c7ab73 100644 --- a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view_browsertest.cc
@@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/signin/web_signin_interceptor.h" #include "chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.h" +#include <optional> + #include "base/functional/callback_helpers.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/user_action_tester.h" @@ -14,6 +15,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_observer.h" #include "chrome/browser/signin/signin_features.h" +#include "chrome/browser/signin/web_signin_interceptor.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/test/test_browser_dialog.h" #include "chrome/browser/ui/views/frame/browser_view.h" @@ -42,8 +44,6 @@ #include "ui/views/test/widget_test.h" #include "ui/views/widget/widget.h" -#include <optional> - namespace { // Returns the avatar button, which is the anchor view for the interception
diff --git a/chrome/browser/ui/views/profiles/profile_picker_view_browsertest.cc b/chrome/browser/ui/views/profiles/profile_picker_view_browsertest.cc index 72ab457..29bcfde 100644 --- a/chrome/browser/ui/views/profiles/profile_picker_view_browsertest.cc +++ b/chrome/browser/ui/views/profiles/profile_picker_view_browsertest.cc
@@ -2,7 +2,6 @@ // 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/profiles/profile_picker_dice_reauth_provider.h" #include "chrome/browser/ui/views/profiles/profile_picker_view.h" #include <optional> @@ -64,6 +63,7 @@ #include "chrome/browser/ui/startup/first_run_service.h" #include "chrome/browser/ui/tab_dialogs.h" #include "chrome/browser/ui/views/profiles/avatar_toolbar_button.h" +#include "chrome/browser/ui/views/profiles/profile_picker_dice_reauth_provider.h" #include "chrome/browser/ui/views/profiles/profile_picker_test_base.h" #include "chrome/browser/ui/views/user_education/browser_feature_promo_controller.h" #include "chrome/browser/ui/webui/signin/login_ui_service.h"
diff --git a/chrome/browser/ui/views/side_panel/history_clusters/history_clusters_side_panel_coordinator.cc b/chrome/browser/ui/views/side_panel/history_clusters/history_clusters_side_panel_coordinator.cc index 40cda7f4..7077b38 100644 --- a/chrome/browser/ui/views/side_panel/history_clusters/history_clusters_side_panel_coordinator.cc +++ b/chrome/browser/ui/views/side_panel/history_clusters/history_clusters_side_panel_coordinator.cc
@@ -64,18 +64,13 @@ void HistoryClustersSidePanelCoordinator::CreateAndRegisterEntry( SidePanelRegistry* global_registry) { - const bool rename_journeys = - base::FeatureList::IsEnabled(history_clusters::kRenameJourneys); global_registry->Register(std::make_unique<SidePanelEntry>( SidePanelEntry::Id::kHistoryClusters, - l10n_util::GetStringUTF16(rename_journeys - ? IDS_HISTORY_TITLE - : IDS_HISTORY_CLUSTERS_JOURNEYS_TAB_LABEL), + l10n_util::GetStringUTF16(IDS_HISTORY_TITLE), ui::ImageModel::FromVectorIcon( - rename_journeys ? (features::IsChromeRefresh2023() - ? vector_icons::kHistoryChromeRefreshIcon - : kHistoryIcon) - : kJourneysIcon, + features::IsChromeRefresh2023() + ? vector_icons::kHistoryChromeRefreshIcon + : kHistoryIcon, ui::kColorIcon, /*icon_size=*/16), base::BindRepeating( @@ -111,8 +106,7 @@ std::make_unique<SidePanelWebUIViewT<HistoryClustersSidePanelUI>>( base::RepeatingClosure(), base::RepeatingClosure(), std::make_unique<WebUIContentsWrapperT<HistoryClustersSidePanelUI>>( - url, GetBrowser().profile(), - IDS_HISTORY_CLUSTERS_JOURNEYS_TAB_LABEL, + url, GetBrowser().profile(), IDS_HISTORY_TITLE, /*webui_resizes_host=*/false, /*esc_closes_ui=*/false));
diff --git a/chrome/browser/ui/views/toolbar/app_menu_browsertest.cc b/chrome/browser/ui/views/toolbar/app_menu_browsertest.cc index 831fa51a5..df1fe78f1 100644 --- a/chrome/browser/ui/views/toolbar/app_menu_browsertest.cc +++ b/chrome/browser/ui/views/toolbar/app_menu_browsertest.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/ui/views/toolbar/app_menu.h" + #include <optional> #include <string> #include <utility> @@ -33,7 +35,6 @@ #include "chrome/browser/ui/ui_features.h" #include "chrome/browser/ui/views/frame/app_menu_button_observer.h" #include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/browser/ui/views/toolbar/app_menu.h" #include "chrome/browser/ui/views/toolbar/browser_app_menu_button.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "chrome/test/base/ui_test_utils.h"
diff --git a/chrome/browser/ui/views/toolbar/browser_app_menu_button_interactive_uitest.cc b/chrome/browser/ui/views/toolbar/browser_app_menu_button_interactive_uitest.cc index 79e02deb..4f1d153 100644 --- a/chrome/browser/ui/views/toolbar/browser_app_menu_button_interactive_uitest.cc +++ b/chrome/browser/ui/views/toolbar/browser_app_menu_button_interactive_uitest.cc
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/toolbar/app_menu_model.h" - #include <optional> #include "base/feature_list.h" @@ -15,6 +13,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/toolbar/app_menu_model.h" #include "chrome/browser/ui/toolbar/bookmark_sub_menu_model.h" #include "chrome/browser/ui/views/toolbar/browser_app_menu_button.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button.cc b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button.cc index 71e2335..cdb39e00 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button.cc
@@ -41,7 +41,7 @@ button_controller()->set_notify_action( views::ButtonController::NotifyAction::kOnPress); GetViewAccessibility().SetRole(ax::mojom::Role::kPopUpButton); - GetViewAccessibility().OverrideHasPopup(ax::mojom::HasPopup::kDialog); + GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kDialog); new_experiments_indicator_ = views::DotIndicator::Install(image_container_view()); UpdateDotIndicator();
diff --git a/chrome/browser/ui/views/toolbar/side_panel_toolbar_button.cc b/chrome/browser/ui/views/toolbar/side_panel_toolbar_button.cc index 90e5c7be..b3f9501 100644 --- a/chrome/browser/ui/views/toolbar/side_panel_toolbar_button.cc +++ b/chrome/browser/ui/views/toolbar/side_panel_toolbar_button.cc
@@ -46,7 +46,7 @@ set_context_menu_controller(nullptr); button_controller()->set_notify_action( views::ButtonController::NotifyAction::kOnPress); - GetViewAccessibility().OverrideHasPopup(ax::mojom::HasPopup::kMenu); + GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kMenu); SetProperty(views::kElementIdentifierKey, kToolbarSidePanelButtonElementId); }
diff --git a/chrome/browser/ui/views/toolbar/toolbar_controller_interactive_uitest.cc b/chrome/browser/ui/views/toolbar/toolbar_controller_interactive_uitest.cc index 1f96c32..bbddaa1 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_controller_interactive_uitest.cc
@@ -4,6 +4,7 @@ #include <optional> #include <sstream> + #include "base/feature_list.h" #include "base/functional/overloaded.h" #include "base/test/metrics/user_action_tester.h"
diff --git a/chrome/browser/ui/views/user_education/product_messaging_controller_interactive_uitest.cc b/chrome/browser/ui/views/user_education/product_messaging_controller_interactive_uitest.cc index 127b3fd..db9838f 100644 --- a/chrome/browser/ui/views/user_education/product_messaging_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/user_education/product_messaging_controller_interactive_uitest.cc
@@ -4,6 +4,7 @@ #include <optional> #include <sstream> + #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h"
diff --git a/chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_controller_unittest.cc b/chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_controller_unittest.cc index 90d94ee..7bb2ba4a 100644 --- a/chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_controller_unittest.cc +++ b/chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_controller_unittest.cc
@@ -24,6 +24,7 @@ #include "chrome/browser/ui/views/web_apps/isolated_web_apps/test_isolated_web_app_installer_model_observer.h" #include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_location.h" +#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h" #include "chrome/browser/web_applications/isolated_web_apps/signed_web_bundle_metadata.h" #include "chrome/browser/web_applications/isolated_web_apps/test/test_signed_web_bundle_builder.h" @@ -281,6 +282,7 @@ ValidBundleTransitionsToShowMetadataScreen) { base::FilePath bundle_path = CreateBundlePath("test_bundle.swbn"); IsolatedWebAppUrlInfo url_info = CreateAndWriteTestBundle(bundle_path, "1.0"); + SetTrustedWebBundleIdsForTesting({url_info.web_bundle_id()}); MockIconAndPageState(url_info); IsolatedWebAppInstallerModel model(bundle_path); @@ -339,6 +341,7 @@ OutdatedBundleShowsAlreadyInstalledDialog) { base::FilePath bundle_path = CreateBundlePath("test_bundle.swbn"); IsolatedWebAppUrlInfo url_info = CreateAndWriteTestBundle(bundle_path, "1.0"); + SetTrustedWebBundleIdsForTesting({url_info.web_bundle_id()}); MockIconAndPageState(url_info, "1.0"); AddDummyIsolatedAppToRegistry( @@ -374,6 +377,7 @@ NewerBundleShowsAlreadyInstalledDialog) { base::FilePath bundle_path = CreateBundlePath("test_bundle.swbn"); IsolatedWebAppUrlInfo url_info = CreateAndWriteTestBundle(bundle_path, "2.0"); + SetTrustedWebBundleIdsForTesting({url_info.web_bundle_id()}); MockIconAndPageState(url_info, "2.0"); AddDummyIsolatedAppToRegistry( @@ -458,6 +462,7 @@ SuccessfulInstallationMovesToSuccessScreen) { base::FilePath bundle_path = CreateBundlePath("test_bundle.swbn"); IsolatedWebAppUrlInfo url_info = CreateAndWriteTestBundle(bundle_path, "1.0"); + SetTrustedWebBundleIdsForTesting({url_info.web_bundle_id()}); MockIconAndPageState(url_info, "1.0"); IsolatedWebAppInstallerModel model(bundle_path); @@ -491,6 +496,7 @@ TEST_F(IsolatedWebAppInstallerViewControllerTest, CanLaunchAppAfterInstall) { base::FilePath bundle_path = CreateBundlePath("test_bundle.swbn"); IsolatedWebAppUrlInfo url_info = CreateAndWriteTestBundle(bundle_path, "1.0"); + SetTrustedWebBundleIdsForTesting({url_info.web_bundle_id()}); MockIconAndPageState(url_info, "1.0"); IsolatedWebAppInstallerModel model(bundle_path); @@ -532,6 +538,7 @@ InstallationErrorShowsErrorDialog) { base::FilePath bundle_path = CreateBundlePath("test_bundle.swbn"); IsolatedWebAppUrlInfo url_info = CreateAndWriteTestBundle(bundle_path, "1.0"); + SetTrustedWebBundleIdsForTesting({url_info.web_bundle_id()}); MockIconAndPageState(url_info, "1.0"); IsolatedWebAppInstallerModel model(bundle_path); @@ -596,6 +603,7 @@ ChangingPrefToFalseDisablesInstaller) { base::FilePath bundle_path = CreateBundlePath("test_bundle.swbn"); IsolatedWebAppUrlInfo url_info = CreateAndWriteTestBundle(bundle_path, "1.0"); + SetTrustedWebBundleIdsForTesting({url_info.web_bundle_id()}); MockIconAndPageState(url_info); IsolatedWebAppInstallerModel model(bundle_path); @@ -630,6 +638,7 @@ ChangingPrefToTrueRestartsInstaller) { base::FilePath bundle_path = CreateBundlePath("test_bundle.swbn"); IsolatedWebAppUrlInfo url_info = CreateAndWriteTestBundle(bundle_path, "1.0"); + SetTrustedWebBundleIdsForTesting({url_info.web_bundle_id()}); MockIconAndPageState(url_info); IsolatedWebAppInstallerModel model(bundle_path);
diff --git a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc index 20f0a08..5f01ab0 100644 --- a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc +++ b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc
@@ -85,6 +85,7 @@ #include "chrome/browser/web_applications/app_service/web_app_publisher_helper.h" #include "chrome/browser/web_applications/commands/run_on_os_login_command.h" #include "chrome/browser/web_applications/externally_managed_app_manager.h" +#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h" #include "chrome/browser/web_applications/isolated_web_apps/test/test_signed_web_bundle_builder.h" #include "chrome/browser/web_applications/manifest_update_manager.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" @@ -1495,6 +1496,8 @@ IsolatedWebAppUrlInfo::CreateFromSignedWebBundleId(bundle.id); webapps::AppId app_id = url_info.app_id(); + SetTrustedWebBundleIdsForTesting({bundle.id}); + { base::test::TestFuture<base::expected<InstallIsolatedWebAppCommandSuccess, InstallIsolatedWebAppCommandError>>
diff --git a/chrome/browser/ui/views/webid/account_selection_modal_view.cc b/chrome/browser/ui/views/webid/account_selection_modal_view.cc index fb20118..0626285 100644 --- a/chrome/browser/ui/views/webid/account_selection_modal_view.cc +++ b/chrome/browser/ui/views/webid/account_selection_modal_view.cc
@@ -141,7 +141,8 @@ &AccountSelectionViewBase::Observer::OnCloseButtonClicked, base::Unretained(observer_)), l10n_util::GetStringUTF16(IDS_CANCEL)); - cancel_button->SetStyle(ui::ButtonStyle::kTonal); + cancel_button_ = cancel_button.get(); + cancel_button->SetStyle(ui::ButtonStyle::kDefault); cancel_button->SetAppearDisabledInInactiveWidget(true); button_container->AddChildView(std::move(cancel_button)); @@ -277,7 +278,9 @@ // Disable buttons. CHECK(button_row_); for (const auto& button : button_row_->children()) { - button->SetEnabled(false); + if (button != cancel_button_) { + button->SetEnabled(false); + } } InitDialogWidget();
diff --git a/chrome/browser/ui/views/webid/account_selection_modal_view.h b/chrome/browser/ui/views/webid/account_selection_modal_view.h index 717588ee..31aed4c 100644 --- a/chrome/browser/ui/views/webid/account_selection_modal_view.h +++ b/chrome/browser/ui/views/webid/account_selection_modal_view.h
@@ -126,6 +126,9 @@ // View containing the modal dialog title. raw_ptr<views::Label> title_label_ = nullptr; + // View containing the modal dialog cancel button. + raw_ptr<views::MdTextButton> cancel_button_ = nullptr; + // The title for the modal dialog. std::u16string title_;
diff --git a/chrome/browser/ui/views/webid/account_selection_modal_view_browsertest.cc b/chrome/browser/ui/views/webid/account_selection_modal_view_browsertest.cc index 2127ea1..761b1a6 100644 --- a/chrome/browser/ui/views/webid/account_selection_modal_view_browsertest.cc +++ b/chrome/browser/ui/views/webid/account_selection_modal_view_browsertest.cc
@@ -10,11 +10,13 @@ #include "chrome/browser/ui/test/test_browser_dialog.h" #include "chrome/browser/ui/views/controls/hover_button.h" #include "chrome/browser/ui/views/webid/account_selection_view_test_base.h" +#include "components/strings/grit/components_strings.h" #include "content/public/test/browser_test.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #include "services/network/test/test_url_loader_factory.h" #include "testing/gmock/include/gmock/gmock-matchers.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/box_layout.h" @@ -269,7 +271,10 @@ std::vector<raw_ptr<views::View, VectorExperimental>> button_row = dialog()->children()[3]->children(); for (const auto& button : button_row) { - ASSERT_FALSE(static_cast<views::MdTextButton*>(button)->GetEnabled()); + auto* text_button = static_cast<views::MdTextButton*>(button); + ASSERT_TRUE(!text_button->GetEnabled() || + text_button->GetText() == + l10n_util::GetStringUTF16(IDS_CANCEL)); } }
diff --git a/chrome/browser/ui/web_applications/web_app_launch_utils.h b/chrome/browser/ui/web_applications/web_app_launch_utils.h index 6f94efd..1ae8fd4a 100644 --- a/chrome/browser/ui/web_applications/web_app_launch_utils.h +++ b/chrome/browser/ui/web_applications/web_app_launch_utils.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_LAUNCH_UTILS_H_ #include <stdint.h> + #include <memory> #include <optional> #include <string>
diff --git a/chrome/browser/ui/web_applications/web_app_metrics_browsertest.cc b/chrome/browser/ui/web_applications/web_app_metrics_browsertest.cc index f2b3070..8fa2674 100644 --- a/chrome/browser/ui/web_applications/web_app_metrics_browsertest.cc +++ b/chrome/browser/ui/web_applications/web_app_metrics_browsertest.cc
@@ -2,7 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/ui/web_applications/web_app_metrics.h" + #include <stdint.h> + #include <memory> #include <optional> #include <string> @@ -23,7 +26,6 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h" #include "chrome/browser/ui/web_applications/web_app_controller_browsertest.h" -#include "chrome/browser/ui/web_applications/web_app_metrics.h" #include "chrome/browser/web_applications/daily_metrics_helper.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom-shared.h" #include "chrome/browser/web_applications/test/web_app_install_test_utils.h"
diff --git a/chrome/browser/ui/web_applications/web_app_ui_manager_impl.h b/chrome/browser/ui/web_applications/web_app_ui_manager_impl.h index f66841e..eebc055 100644 --- a/chrome/browser/ui/web_applications/web_app_ui_manager_impl.h +++ b/chrome/browser/ui/web_applications/web_app_ui_manager_impl.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_UI_MANAGER_IMPL_H_ #include <stddef.h> + #include <map> #include <memory> #include <optional>
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h index b7240c4..f75293f4 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/files/file.h" #include "base/files/file_path.h" #include "base/functional/callback.h"
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler_browsertest.cc b/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler_browsertest.cc index c8a38e4..1f47461 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler_browsertest.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler_browsertest.cc
@@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <optional> - -#include "base/functional/callback_forward.h" -#include "base/test/bind.h" -#include "base/test/metrics/histogram_tester.h" #include "chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.h" +#include <optional> + #include "ash/constants/ash_features.h" #include "base/files/file.h" #include "base/files/file_util.h" +#include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/path_service.h" +#include "base/test/bind.h" +#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/threading/thread_restrictions.h" #include "chrome/browser/ash/file_manager/file_manager_test_util.h"
diff --git a/chrome/browser/ui/webui/ash/login/l10n_util_test_util.cc b/chrome/browser/ui/webui/ash/login/l10n_util_test_util.cc index 139ee25..22d805c 100644 --- a/chrome/browser/ui/webui/ash/login/l10n_util_test_util.cc +++ b/chrome/browser/ui/webui/ash/login/l10n_util_test_util.cc
@@ -5,7 +5,6 @@ #include "chrome/browser/ui/webui/ash/login/l10n_util_test_util.h" #include <optional> - #include <vector> #include "url/gurl.h"
diff --git a/chrome/browser/ui/webui/ash/settings/pages/printing/printing_section.cc b/chrome/browser/ui/webui/ash/settings/pages/printing/printing_section.cc index ea535f0..942372b 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/printing/printing_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/printing/printing_section.cc
@@ -133,7 +133,6 @@ IDS_OS_SETTINGS_REVAMP_PRINTING_CUPS_PRINT_DESCRIPTION}, {"cupsPrintersLearnMoreLabel", IDS_SETTINGS_PRINTING_CUPS_PRINTERS_LEARN_MORE_LABEL}, - {"addCupsPrinter", IDS_SETTINGS_PRINTING_CUPS_PRINTERS_ADD_PRINTER}, {"addCupsPrinterManually", IDS_SETTINGS_PRINTING_CUPS_PRINTERS_ADD_PRINTER_MANUALLY}, {"editPrinter", IDS_SETTINGS_PRINTING_CUPS_PRINTERS_EDIT}, @@ -178,8 +177,6 @@ IDS_SETTINGS_PRINTING_CUPS_PRINTERS_AVAILABLE_PRINTERS_READY}, {"availablePrintersReadySubtext", IDS_SETTINGS_PRINTING_CUPS_PRINTERS_AVAILABLE_PRINTERS_READY_SUBTEXT}, - {"nearbyPrintersListTitle", - IDS_SETTINGS_PRINTING_CUPS_PRINTERS_AVAILABLE_PRINTERS}, {"nearbyPrintersCountMany", IDS_SETTINGS_PRINTING_CUPS_PRINTERS_AVAILABLE_PRINTERS_COUNT_MANY}, {"nearbyPrintersCountOne", @@ -194,8 +191,6 @@ IDS_SETTINGS_PRINTING_ENTERPRISE_PRINTERS_AVAILABLE_PRINTER_COUNT_ONE}, {"enterprisePrintersCountNone", IDS_SETTINGS_PRINTING_ENTERPRISE_PRINTERS_AVAILABLE_PRINTER_COUNT_NONE}, - {"nearbyPrintersListDescription", - IDS_SETTINGS_PRINTING_CUPS_PRINTERS_ADD_DETECTED_OR_NEW_PRINTER}, {"manufacturerAndModelAdditionalInformation", IDS_SETTINGS_PRINTING_CUPS_MANUFACTURER_MODEL_ADDITIONAL_INFORMATION}, {"addPrinterButtonText", @@ -329,8 +324,6 @@ html_source->AddString( "printingCUPSPrintPpdLearnMoreUrl", GetHelpUrlWithBoard(chrome::kCupsPrintPPDLearnMoreURL)); - html_source->AddBoolean("isPrinterSettingsRevampEnabled", - features::IsPrinterSettingsRevampEnabled()); html_source->AddBoolean("isPrinterSettingsPrinterStatusEnabled", features::IsPrinterSettingsPrinterStatusEnabled()); html_source->AddBoolean("isPrintPreviewDiscoveredPrintersEnabled",
diff --git a/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.cc b/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.cc index 8032a3f0..850f305 100644 --- a/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.cc +++ b/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.cc
@@ -34,16 +34,13 @@ "isHistoryClustersEnabled", history_clusters_service && history_clusters_service->is_journeys_feature_flag_enabled()); - const bool rename_journeys = - base::FeatureList::IsEnabled(history_clusters::kRenameJourneys); - source->AddBoolean(kRenameJourneysKey, rename_journeys); const bool journeys_is_managed = prefs->IsManagedPreference(history_clusters::prefs::kVisible); - // When history_clusters::kRenameJourneys is enabled, history clusters are - // always visible unless the visibility prefs is set to false by policy. + // History clusters are always visible unless the visibility prefs is + // set to false by policy. source->AddBoolean(kIsHistoryClustersVisibleKey, prefs->GetBoolean(history_clusters::prefs::kVisible) || - (rename_journeys && !journeys_is_managed)); + !journeys_is_managed); source->AddBoolean(kIsHistoryClustersVisibleManagedByPolicyKey, journeys_is_managed); source->AddBoolean("isHistoryClustersDebug", @@ -65,12 +62,10 @@ {"deleteConfirm", IDS_HISTORY_CLUSTERS_DELETE_PRIOR_VISITS_CONFIRM_BUTTON}, {"deleteWarning", IDS_HISTORY_CLUSTERS_DELETE_PRIOR_VISITS_WARNING}, - {"disableHistoryClusters", IDS_HISTORY_CLUSTERS_DISABLE_MENU_ITEM_LABEL}, - {"enableHistoryClusters", IDS_HISTORY_CLUSTERS_ENABLE_MENU_ITEM_LABEL}, {"hideFromCluster", IDS_HISTORY_CLUSTERS_HIDE_PAGE}, {"hideAllVisits", IDS_HISTORY_CLUSTERS_HIDE_VISITS}, - {"historyClustersTabLabel", IDS_HISTORY_CLUSTERS_JOURNEYS_TAB_LABEL}, - {"historyListTabLabel", IDS_HISTORY_CLUSTERS_LIST_TAB_LABEL}, + {"historyClustersTabLabel", IDS_HISTORY_CLUSTERS_BY_GROUP_TAB_LABEL}, + {"historyListTabLabel", IDS_HISTORY_CLUSTERS_BY_DATE_TAB_LABEL}, {"loadMoreButtonLabel", IDS_HISTORY_CLUSTERS_LOAD_MORE_BUTTON_LABEL}, {"historyClustersNoResults", IDS_HISTORY_CLUSTERS_NO_RESULTS}, {"noSearchResults", IDS_HISTORY_CLUSTERS_NO_SEARCH_RESULTS}, @@ -81,20 +76,11 @@ {"removeFromHistoryToast", IDS_HISTORY_CLUSTERS_REMOVE_ITEM_TOAST}, {"removeSelected", IDS_HISTORY_CLUSTERS_REMOVE_SELECTED_ITEMS}, {"savedInTabGroup", IDS_HISTORY_CLUSTERS_SAVED_IN_TABGROUP_LABEL}, - {"historyClustersSearchPrompt", IDS_HISTORY_CLUSTERS_SEARCH_PROMPT}, + {"historyClustersSearchPrompt", IDS_HISTORY_SEARCH_PROMPT}, {"toggleButtonLabelLess", IDS_HISTORY_CLUSTERS_SHOW_LESS_BUTTON_LABEL}, {"toggleButtonLabelMore", IDS_HISTORY_CLUSTERS_SHOW_MORE_BUTTON_LABEL}, }; source->AddLocalizedStrings(kHistoryClustersStrings); - if (rename_journeys) { - source->AddLocalizedString("historyClustersSearchPrompt", - IDS_HISTORY_SEARCH_PROMPT); - source->AddLocalizedString("historyClustersTabLabel", - IDS_HISTORY_CLUSTERS_BY_GROUP_TAB_LABEL); - source->AddLocalizedString("historyListTabLabel", - IDS_HISTORY_CLUSTERS_BY_DATE_TAB_LABEL); - } - return; }
diff --git a/chrome/browser/ui/webui/history/history_ui.cc b/chrome/browser/ui/webui/history/history_ui.cc index 91508b3..38b410a 100644 --- a/chrome/browser/ui/webui/history/history_ui.cc +++ b/chrome/browser/ui/webui/history/history_ui.cc
@@ -280,16 +280,14 @@ base::Value::Dict update; update.Set(kIsUserSignedInKey, IsUserSignedIn(profile)); - const bool rename_journeys = - base::FeatureList::IsEnabled(history_clusters::kRenameJourneys); const bool is_managed = profile->GetPrefs()->IsManagedPreference( history_clusters::prefs::kVisible); - // When history_clusters::kRenameJourneys is enabled, history clusters are - // always visible unless the visibility prefs is set to false by policy. + // History clusters are always visible unless the visibility prefs + // is set to false by policy. update.Set( kIsHistoryClustersVisibleKey, profile->GetPrefs()->GetBoolean(history_clusters::prefs::kVisible) || - (rename_journeys && !is_managed)); + !is_managed); update.Set(kIsHistoryClustersVisibleManagedByPolicyKey, is_managed); content::WebUIDataSource::Update(profile, chrome::kChromeUIHistoryHost,
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler_unittest.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler_unittest.cc index 50ad55d8..1f372f7 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler_unittest.cc +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler_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/ui/webui/new_tab_page/new_tab_page_handler.h" + #include <array> #include <optional> #include <string> @@ -37,7 +39,6 @@ #include "chrome/browser/ui/hats/mock_hats_service.h" #include "chrome/browser/ui/side_panel/customize_chrome/customize_chrome_tab_helper.h" #include "chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom.h" -#include "chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.h" #include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_section.h" #include "chrome/browser/ui/webui/webui_util.h" #include "chrome/common/chrome_features.h"
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc index b02c2e2..e0143954 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
@@ -343,13 +343,7 @@ "isEnterpriseManaged", policy::ManagementServiceFactory::GetForPlatform()->IsManaged()); -#if BUILDFLAG(IS_CHROMEOS) - source->AddBoolean( - "isBorderlessPrintingEnabled", - base::FeatureList::IsEnabled(features::kEnableBorderlessPrinting)); -#else - source->AddBoolean("isBorderlessPrintingEnabled", false); -#endif + source->AddBoolean("isBorderlessPrintingEnabled", BUILDFLAG(IS_CHROMEOS)); } void SetupPrintPreviewPlugin(content::WebUIDataSource* source) {
diff --git a/chrome/browser/ui/webui/side_panel/customize_chrome/wallpaper_search/wallpaper_search_handler.cc b/chrome/browser/ui/webui/side_panel/customize_chrome/wallpaper_search/wallpaper_search_handler.cc index 2dadb46..e1b5bdd 100644 --- a/chrome/browser/ui/webui/side_panel/customize_chrome/wallpaper_search/wallpaper_search_handler.cc +++ b/chrome/browser/ui/webui/side_panel/customize_chrome/wallpaper_search/wallpaper_search_handler.cc
@@ -65,7 +65,12 @@ #include "ui/gfx/geometry/size.h" #include "ui/gfx/image/image.h" +using side_panel::customize_chrome::mojom::DescriptorDName; +using side_panel::customize_chrome::mojom::DescriptorDValue; using side_panel::customize_chrome::mojom::UserFeedback; +using side_panel::customize_chrome::mojom::WallpaperSearchResult; +using side_panel::customize_chrome::mojom::WallpaperSearchResultPtr; +using side_panel::customize_chrome::mojom::WallpaperSearchStatus; namespace { @@ -323,28 +328,22 @@ auto* identity_manager = IdentityManagerFactory::GetForProfile(profile_); if (!identity_manager || !identity_manager->HasPrimaryAccount(signin::ConsentLevel::kSignin)) { - std::move(callback).Run( - side_panel::customize_chrome::mojom::WallpaperSearchStatus::kSignedOut, - std::vector< - side_panel::customize_chrome::mojom::WallpaperSearchResultPtr>()); + std::move(callback).Run(WallpaperSearchStatus::kSignedOut, + std::vector<WallpaperSearchResultPtr>()); return; } #if BUILDFLAG(IS_CHROMEOS) // Check if user is browsing in guest mode. if (profile_->IsGuestSession()) { - std::move(callback).Run( - side_panel::customize_chrome::mojom::WallpaperSearchStatus::kSignedOut, - std::vector< - side_panel::customize_chrome::mojom::WallpaperSearchResultPtr>()); + std::move(callback).Run(WallpaperSearchStatus::kSignedOut, + std::vector<WallpaperSearchResultPtr>()); return; } #endif // BUILDFLAG(IS_CHROMEOS) callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun( - std::move(callback), - side_panel::customize_chrome::mojom::WallpaperSearchStatus::kError, - std::vector< - side_panel::customize_chrome::mojom::WallpaperSearchResultPtr>()); + std::move(callback), WallpaperSearchStatus::kError, + std::vector<WallpaperSearchResultPtr>()); if (!base::FeatureList::IsEnabled( ntp_features::kCustomizeChromeWallpaperSearch) || !base::FeatureList::IsEnabled( @@ -492,8 +491,7 @@ void WallpaperSearchHandler::UpdateHistory() { const auto& history = wallpaper_search_background_manager_->GetHistory(); - std::vector<side_panel::customize_chrome::mojom::WallpaperSearchResultPtr> - thumbnails; + std::vector<WallpaperSearchResultPtr> thumbnails; auto barrier = base::BarrierCallback<std::pair<SkBitmap, base::Token>>( history.size(), base::BindOnce(&WallpaperSearchHandler::OnHistoryDecoded, @@ -707,8 +705,7 @@ void WallpaperSearchHandler::OnHistoryDecoded( std::vector<HistoryEntry> history, std::vector<std::pair<SkBitmap, base::Token>> results) { - std::vector<side_panel::customize_chrome::mojom::WallpaperSearchResultPtr> - thumbnails; + std::vector<WallpaperSearchResultPtr> thumbnails; // Use the original history array to order the results. // O(n^2) but there should never be more than 6 in each vector. @@ -725,8 +722,7 @@ const bool success = gfx::PNGCodec::EncodeBGRASkBitmap( small_bitmap, /*discard_transparency=*/false, &encoded); if (success) { - auto thumbnail = - side_panel::customize_chrome::mojom::WallpaperSearchResult::New(); + auto thumbnail = WallpaperSearchResult::New(); thumbnail->image = base::Base64Encode(encoded); thumbnail->id = std::move(id); if (entry.subject) { @@ -839,9 +835,7 @@ descriptor_d_dict->FindString("name")) { if (descriptor_d_name->compare("Yellow") == 0) { mojo_inspiration_group->descriptors->color = - side_panel::customize_chrome::mojom::DescriptorDValue::NewName( - side_panel::customize_chrome::mojom::DescriptorDName:: - kYellow); + DescriptorDValue::NewName(DescriptorDName::kYellow); } } } @@ -943,11 +937,8 @@ if (result.error().error() == optimization_guide::OptimizationGuideModelExecutionError:: ModelExecutionError::kRequestThrottled) { - std::move(callback).Run( - side_panel::customize_chrome::mojom::WallpaperSearchStatus:: - kRequestThrottled, - std::vector< - side_panel::customize_chrome::mojom::WallpaperSearchResultPtr>()); + std::move(callback).Run(WallpaperSearchStatus::kRequestThrottled, + std::vector<WallpaperSearchResultPtr>()); } return; } @@ -1021,8 +1012,7 @@ std::vector< std::pair<optimization_guide::proto::WallpaperSearchImageQuality*, SkBitmap>> bitmaps) { - std::vector<side_panel::customize_chrome::mojom::WallpaperSearchResultPtr> - thumbnails; + std::vector<WallpaperSearchResultPtr> thumbnails; for (auto& [image_quality, bitmap] : bitmaps) { auto dimensions = @@ -1035,8 +1025,7 @@ const bool success = gfx::PNGCodec::EncodeBGRASkBitmap( small_bitmap, /*discard_transparency=*/false, &encoded); if (success) { - auto thumbnail = - side_panel::customize_chrome::mojom::WallpaperSearchResult::New(); + auto thumbnail = WallpaperSearchResult::New(); auto id = base::Token::CreateRandom(); wallpaper_search_results_[id] = std::make_tuple(image_quality, std::nullopt, std::move(bitmap)); @@ -1049,9 +1038,7 @@ UmaHistogramMediumTimes( "NewTabPage.WallpaperSearch.GetResultProcessingLatency", processing_timer.Elapsed()); - std::move(callback).Run( - side_panel::customize_chrome::mojom::WallpaperSearchStatus::kOk, - std::move(thumbnails)); + std::move(callback).Run(WallpaperSearchStatus::kOk, std::move(thumbnails)); } void WallpaperSearchHandler::LaunchDelayedHatsSurvey() {
diff --git a/chrome/browser/ui/webui/signin/turn_sync_on_helper_browsertest.cc b/chrome/browser/ui/webui/signin/turn_sync_on_helper_browsertest.cc index 0825f13..374ce065 100644 --- a/chrome/browser/ui/webui/signin/turn_sync_on_helper_browsertest.cc +++ b/chrome/browser/ui/webui/signin/turn_sync_on_helper_browsertest.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/ui/webui/signin/turn_sync_on_helper.h" + #include <memory> #include <optional> #include <vector> @@ -16,7 +18,6 @@ #include "chrome/browser/signin/account_reconcilor_factory.h" #include "chrome/browser/signin/signin_browser_test_base.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/webui/signin/turn_sync_on_helper.h" #include "components/signin/core/browser/account_reconcilor.h" #include "components/signin/public/base/consent_level.h" #include "components/signin/public/base/signin_switches.h"
diff --git a/chrome/browser/user_education/BUILD.gn b/chrome/browser/user_education/BUILD.gn index 2f384b5..10a83ee 100644 --- a/chrome/browser/user_education/BUILD.gn +++ b/chrome/browser/user_education/BUILD.gn
@@ -38,13 +38,17 @@ sources = [ "java/src/org/chromium/chrome/browser/user_education/IPHCommandBuilderUnitTest.java", "java/src/org/chromium/chrome/browser/user_education/IPHCommandUnitTest.java", + "java/src/org/chromium/chrome/browser/user_education/UserEducationHelperUnitTest.java", ] deps = [ ":java", ":java_resources", "//base:base_java", "//base:base_junit_test_support", + "//chrome/browser/feature_engagement:java", + "//chrome/browser/profiles/android:java", "//components/browser_ui/theme/android:java_resources", + "//components/feature_engagement/public:public_java", "//third_party/androidx:androidx_appcompat_appcompat_java", "//third_party/junit", "//third_party/mockito:mockito_java",
diff --git a/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java b/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java index 59536c3..1c342dfb 100644 --- a/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java +++ b/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java
@@ -8,10 +8,13 @@ import android.os.Handler; import android.view.View; +import androidx.annotation.NonNull; + import org.chromium.base.TraceEvent; +import org.chromium.base.supplier.Supplier; +import org.chromium.base.supplier.SupplierUtils; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.profiles.ProfileManager; import org.chromium.chrome.browser.util.ChromeAccessibilityUtil; import org.chromium.components.browser_ui.widget.highlight.ViewHighlighter; import org.chromium.components.browser_ui.widget.highlight.ViewHighlighter.HighlightParams; @@ -21,6 +24,9 @@ import org.chromium.ui.widget.RectProvider; import org.chromium.ui.widget.ViewRectProvider; +import java.util.ArrayList; +import java.util.List; + /** * Class that shows and hides in-product help message bubbles. * Recipes for use: @@ -46,11 +52,54 @@ private final Activity mActivity; private final Handler mHandler; - public UserEducationHelper(Activity activity, Handler handler) { + private Profile mProfile; + private List<IPHCommand> mPendingIPHCommands; + + /** + * Constructs a {@link UserEducationHelper} that is immediately available to process inbound + * {@link IPHCommand}s. + */ + public UserEducationHelper( + @NonNull Activity activity, @NonNull Profile profile, Handler handler) { assert activity != null : "Trying to show an IPH for a null activity."; + assert profile != null : "Trying to show an IPH with a null profile"; mActivity = activity; mHandler = handler; + + setProfile(profile); + } + + /** + * Constructs a {@link UserEducationHelper} that will wait for a {@link Profile} to become + * available before processing inbound {@link IPHCommand}s. + * + * <p>Caveat, this will only observe the first available Profile from the supplier and will keep + * a reference to the {@link Profile#getOriginalProfile()}. + */ + public UserEducationHelper( + @NonNull Activity activity, + @NonNull Supplier<Profile> profileSupplier, + Handler handler) { + assert activity != null : "Trying to show an IPH for a null activity."; + assert profileSupplier != null : "Trying to show an IPH with a null profile supplier"; + + mActivity = activity; + mHandler = handler; + + SupplierUtils.waitForAll(() -> setProfile(profileSupplier.get()), profileSupplier); + } + + private void setProfile(Profile profile) { + assert profile != null; + mProfile = profile.getOriginalProfile(); + + if (mPendingIPHCommands != null) { + for (IPHCommand iphCommand : mPendingIPHCommands) { + requestShowIPH(iphCommand); + } + mPendingIPHCommands = null; + } } /** @@ -62,13 +111,14 @@ public void requestShowIPH(IPHCommand iphCommand) { if (iphCommand == null) return; + if (mProfile == null) { + if (mPendingIPHCommands == null) mPendingIPHCommands = new ArrayList<>(); + mPendingIPHCommands.add(iphCommand); + return; + } + try (TraceEvent te = TraceEvent.scoped("UserEducationHelper::requestShowIPH")) { - // TODO (https://crbug.com/1048632): Use the current profile (i.e., regular profile or - // incognito profile) instead of always using regular profile. Currently always original - // profile is used not to start popping IPH messages as soon as opening an incognito - // tab. - Profile profile = ProfileManager.getLastUsedRegularProfile(); - final Tracker tracker = TrackerFactory.getTrackerForProfile(profile); + final Tracker tracker = TrackerFactory.getTrackerForProfile(mProfile); tracker.addOnInitializedCallback(success -> showIPH(tracker, iphCommand)); } }
diff --git a/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelperUnitTest.java b/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelperUnitTest.java new file mode 100644 index 0000000..9051bc8 --- /dev/null +++ b/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelperUnitTest.java
@@ -0,0 +1,79 @@ +// 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.user_education; + +import android.app.Activity; +import android.os.Handler; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.robolectric.shadows.ShadowLooper; + +import org.chromium.base.ContextUtils; +import org.chromium.base.supplier.ObservableSupplierImpl; +import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.components.feature_engagement.Tracker; + +/** Tests for {@link UserEducationHelper}. */ +@RunWith(BaseRobolectricTestRunner.class) +public class UserEducationHelperUnitTest { + public @Rule MockitoRule mMockitoRule = MockitoJUnit.rule(); + + private IPHCommand mTestIPHCommand1; + + @Mock private Tracker mTracker; + @Mock private Profile mProfile; + + @Before + public void setUp() { + Mockito.when(mProfile.getOriginalProfile()).thenReturn(mProfile); + mTestIPHCommand1 = + new IPHCommandBuilder( + ContextUtils.getApplicationContext().getResources(), "TEST", 1, 1) + .build(); + } + + @Test + public void testConstructor_ProfileSupplier_DelayedInit() { + TrackerFactory.setTrackerForTests(mTracker); + ObservableSupplierImpl<Profile> profileSupplier = new ObservableSupplierImpl<>(); + UserEducationHelper educationHelper = + new UserEducationHelper(new Activity(), profileSupplier, new Handler()); + educationHelper.requestShowIPH(mTestIPHCommand1); + + Mockito.verifyNoInteractions(mTracker); + profileSupplier.set(mProfile); + ShadowLooper.runUiThreadTasksIncludingDelayedTasks(); + Mockito.verify(mTracker).addOnInitializedCallback(Mockito.any()); + } + + @Test + public void testConstructor_ProfileSupplier_EarlyInit() { + TrackerFactory.setTrackerForTests(mTracker); + ObservableSupplierImpl<Profile> profileSupplier = new ObservableSupplierImpl<>(); + profileSupplier.set(mProfile); + UserEducationHelper educationHelper = + new UserEducationHelper(new Activity(), profileSupplier, new Handler()); + educationHelper.requestShowIPH(mTestIPHCommand1); + Mockito.verify(mTracker).addOnInitializedCallback(Mockito.any()); + } + + @Test + public void testConstructor_Profile() { + TrackerFactory.setTrackerForTests(mTracker); + UserEducationHelper educationHelper = + new UserEducationHelper(new Activity(), mProfile, new Handler()); + educationHelper.requestShowIPH(mTestIPHCommand1); + Mockito.verify(mTracker).addOnInitializedCallback(Mockito.any()); + } +}
diff --git a/chrome/browser/web_applications/app_service/web_apps_chromeos_browsertest.cc b/chrome/browser/web_applications/app_service/web_apps_chromeos_browsertest.cc index 4331c5c7..5acf8e8 100644 --- a/chrome/browser/web_applications/app_service/web_apps_chromeos_browsertest.cc +++ b/chrome/browser/web_applications/app_service/web_apps_chromeos_browsertest.cc
@@ -407,6 +407,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppChromeOsBrowserTest, ContextMenuOnlyHasLaunchNew) { + app()->TrustSigningKey(); web_app::IsolatedWebAppUrlInfo url_info = app()->InstallChecked(browser()->profile());
diff --git a/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management_unittest.cc b/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management_unittest.cc index 95d863e..be67012 100644 --- a/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management_unittest.cc +++ b/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management_unittest.cc
@@ -121,7 +121,7 @@ url_loader->SetNextLoadUrlResult(kWebAppUrl, WebAppUrlLoaderResult::kUrlLoaded); data_retriever->SetManifest(blink::mojom::ManifestPtr(), - webapps::InstallableStatusCode::MANIFEST_EMPTY); + webapps::InstallableStatusCode::NO_MANIFEST); FetchResult result = ScheduleCommandAndWait(kWebAppUrl, web_contents()->GetWeakPtr(),
diff --git a/chrome/browser/web_applications/externally_managed_app_manager_browsertest.cc b/chrome/browser/web_applications/externally_managed_app_manager_browsertest.cc index 0e48568..11c5aab 100644 --- a/chrome/browser/web_applications/externally_managed_app_manager_browsertest.cc +++ b/chrome/browser/web_applications/externally_managed_app_manager_browsertest.cc
@@ -189,13 +189,13 @@ EXPECT_TRUE(app_id.has_value()); EXPECT_EQ("Web app banner test page", registrar().GetAppShortName(app_id.value())); - // Same AppID should be in the registrar using install_url. - EXPECT_TRUE(registrar().IsLocallyInstalled(install_url)); + // Same AppID should be in the registrar using final_url. + EXPECT_TRUE(registrar().IsLocallyInstalled(final_url)); std::optional<webapps::AppId> opt_app_id = - registrar().FindAppWithUrlInScope(install_url); + registrar().FindAppWithUrlInScope(final_url); ASSERT_TRUE(opt_app_id.has_value()); EXPECT_EQ(*opt_app_id, app_id); - EXPECT_EQ(registrar().GetAppStartUrl(*opt_app_id), install_url); + EXPECT_EQ(registrar().GetAppStartUrl(*opt_app_id), final_url); } // Installing a placeholder app with shortcuts should succeed.
diff --git a/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command_unittest.cc index be390ee..9ae061e 100644 --- a/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command_unittest.cc
@@ -331,7 +331,7 @@ auto command_helper = std::make_unique<IsolatedWebAppInstallCommandHelper>( url_info, web_contents_manager().CreateDataRetriever(), IsolatedWebAppInstallCommandHelper::CreateDefaultResponseReaderFactory( - *profile()->GetPrefs())); + *profile())); auto command = std::make_unique<InstallIsolatedWebAppCommand>( url_info, CreateDevProxyLocation(), /*expected_version=*/std::nullopt,
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_apply_update_command_browsertest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_apply_update_command_browsertest.cc index 9d4af38..8af9671 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_apply_update_command_browsertest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_apply_update_command_browsertest.cc
@@ -16,6 +16,7 @@ #include "chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_location.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_prepare_and_store_update_command.h" +#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h" #include "chrome/browser/web_applications/isolated_web_apps/test/test_signed_web_bundle_builder.h" #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" #include "chrome/browser/web_applications/web_app_command_scheduler.h" @@ -85,6 +86,7 @@ void Install() { base::test::TestFuture<InstallResult> future; + SetTrustedWebBundleIdsForTesting({url_info_.web_bundle_id()}); provider()->scheduler().InstallIsolatedWebApp( url_info_, source_location_, /*expected_version=*/installed_version_,
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc index 77d74b9..4af465c1 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc
@@ -250,6 +250,7 @@ "application/manifest+json") .BuildBundle(); + app->TrustSigningKey(); IsolatedWebAppUrlInfo url_info = app->Install(profile()).value(); EXPECT_EQ(provider().registrar_unsafe().GetAppShortName(url_info.app_id()), @@ -281,6 +282,7 @@ auto app = ScopedBundledIsolatedWebApp::Create( web_bundle_id, web_package::WebBundleSigner::SignBundle( builder.CreateBundle(), {key_pair})); + app->TrustSigningKey(); ASSERT_OK_AND_ASSIGN(auto url_info, app->Install(profile())); EXPECT_EQ(provider().registrar_unsafe().GetAppShortName(url_info.app_id()),
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_install_command_helper.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_install_command_helper.cc index ca6be862..51ac7d2 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_install_command_helper.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_install_command_helper.cc
@@ -206,8 +206,8 @@ // static std::unique_ptr<IsolatedWebAppResponseReaderFactory> IsolatedWebAppInstallCommandHelper::CreateDefaultResponseReaderFactory( - const PrefService& prefs) { - auto trust_checker = std::make_unique<IsolatedWebAppTrustChecker>(prefs); + Profile& profile) { + auto trust_checker = std::make_unique<IsolatedWebAppTrustChecker>(profile); auto validator = std::make_unique<IsolatedWebAppValidator>(std::move(trust_checker)); @@ -236,7 +236,9 @@ [&](const InstalledBundle& location) { CHECK_EQ(url_info_.web_bundle_id().type(), web_package::SignedWebBundleId::Type::kEd25519PublicKey); - CheckTrustAndSignaturesOfBundle(location.path, std::move(callback)); + CheckTrustAndSignaturesOfBundle(location.path, + /*dev_mode=*/false, + std::move(callback)); }, [&](const DevModeBundle& location) { CHECK_EQ(url_info_.web_bundle_id().type(), @@ -246,7 +248,9 @@ base::unexpected(std::string(kIwaDevModeNotEnabledMessage))); return; } - CheckTrustAndSignaturesOfBundle(location.path, std::move(callback)); + CheckTrustAndSignaturesOfBundle(location.path, + /*dev_mode=*/true, + std::move(callback)); }, [&](const DevModeProxy& location) { CHECK_EQ(url_info_.web_bundle_id().type(), @@ -265,6 +269,7 @@ void IsolatedWebAppInstallCommandHelper::CheckTrustAndSignaturesOfBundle( const base::FilePath& path, + bool dev_mode, base::OnceCallback<void(base::expected<void, std::string>)> callback) { // To check whether the bundle is valid and trusted, we attempt to create a // `IsolatedWebAppResponseReader`. If a response reader is created @@ -274,11 +279,12 @@ // - ...has signatures that were verified successfully (as long as // `skip_signature_verification` below is set to `false`). // - ...contains valid metadata / no invalid URLs. + IsolatedWebAppResponseReaderFactory::Flags flags; + if (dev_mode) { + flags.Put(IsolatedWebAppResponseReaderFactory::Flag::kDevModeBundle); + } response_reader_factory_->CreateResponseReader( - path, url_info_.web_bundle_id(), - // During install and updates, we always want to verify signatures, - // regardless of the OS. - /*skip_signature_verification=*/false, + path, url_info_.web_bundle_id(), flags, base::BindOnce(&IsolatedWebAppInstallCommandHelper:: OnTrustAndSignaturesOfBundleChecked, weak_factory_.GetWeakPtr(), std::move(callback)));
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_install_command_helper.h b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_install_command_helper.h index 6d1c6599..9968bfe5 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_install_command_helper.h +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_install_command_helper.h
@@ -24,7 +24,6 @@ #include "url/gurl.h" class Profile; -class PrefService; namespace content { class WebContents; @@ -59,7 +58,7 @@ class IsolatedWebAppInstallCommandHelper { public: static std::unique_ptr<IsolatedWebAppResponseReaderFactory> - CreateDefaultResponseReaderFactory(const PrefService& prefs); + CreateDefaultResponseReaderFactory(Profile& profile); static std::unique_ptr<content::WebContents> CreateIsolatedWebAppWebContents( Profile& profile); @@ -122,6 +121,7 @@ private: void CheckTrustAndSignaturesOfBundle( const base::FilePath& path, + bool dev_mode, base::OnceCallback<void(base::expected<void, std::string>)> callback); void OnTrustAndSignaturesOfBundleChecked(
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager_unittest.cc index c3dd0e6d..391948a 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager_unittest.cc
@@ -55,6 +55,11 @@ using ::testing::Optional; using ::testing::VariantWith; +MATCHER_P(IsSameOriginWith, url, "") { + *result_listener << "where it is not same origin with " << url.spec(); + return arg.IsSameOriginWith(url); +} + using MaybeIwaLocation = base::expected<std::optional<IsolatedWebAppLocation>, std::string>; @@ -206,204 +211,161 @@ ErrorIs(HasSubstr("Isolated Web App Developer Mode is not enabled"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +class IsolatedWebAppInstallationManagerCommandLineTest + : public IsolatedWebAppInstallationManagerTest { + protected: + MaybeIwaLocation ParseCommandLine( + std::optional<base::StringPiece> proxy_flag_value, + std::optional<base::FilePath> bundle_flag_value) { + base::test::TestFuture<MaybeIwaLocation> future; + IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( + CreateCommandLine(proxy_flag_value, bundle_flag_value), + future.GetCallback()); + return future.Take(); + } +}; + +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, NoInstallationWhenProxyFlagAbsentAndBundleFlagAbsent) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine(std::nullopt, std::nullopt), future.GetCallback()); - EXPECT_THAT(future.Get(), ValueIs(Eq(std::nullopt))); + EXPECT_THAT(ParseCommandLine(std::nullopt, std::nullopt), + ValueIs(Eq(std::nullopt))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, NoInstallationWhenProxyFlagAbsentAndBundleFlagEmpty) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine(std::nullopt, base::FilePath::FromUTF8Unsafe("")), - future.GetCallback()); - EXPECT_THAT(future.Get(), ValueIs(Eq(std::nullopt))); + EXPECT_THAT( + ParseCommandLine(std::nullopt, base::FilePath::FromUTF8Unsafe("")), + ValueIs(Eq(std::nullopt))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagAbsentAndBundleFlagInvalid) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine(std::nullopt, - base::FilePath::FromUTF8Unsafe("does_not_exist.wbn)")), - future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("Invalid path provided"))); + EXPECT_THAT(ParseCommandLine(std::nullopt, base::FilePath::FromUTF8Unsafe( + "does_not_exist.wbn")), + ErrorIs(HasSubstr("Invalid path provided"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagAbsentAndBundleFlagIsDirectory) { ScopedWorkingDirectoryWithFile cwd; - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine(std::nullopt, cwd.directory()), future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("Invalid path provided"))); + EXPECT_THAT(ParseCommandLine(std::nullopt, cwd.directory()), + ErrorIs(HasSubstr("Invalid path provided"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, InstallsAppWhenProxyFlagAbsentAndBundleFlagValid) { ScopedWorkingDirectoryWithFile cwd; - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine(std::nullopt, cwd.existing_file_name()), - future.GetCallback()); - EXPECT_THAT(future.Get(), + EXPECT_THAT(ParseCommandLine(std::nullopt, cwd.existing_file_name()), ValueIs(Optional(VariantWith<DevModeBundle>( Field(&DevModeBundle::path, cwd.existing_file_path()))))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, InstallsAppWhenProxyFlagAbsentAndBundleFlagValidAndAbsolute) { ScopedWorkingDirectoryWithFile cwd; - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine(std::nullopt, cwd.existing_file_path()), - future.GetCallback()); - EXPECT_THAT(future.Get(), + EXPECT_THAT(ParseCommandLine(std::nullopt, cwd.existing_file_path()), ValueIs(Optional(VariantWith<DevModeBundle>( Field(&DevModeBundle::path, cwd.existing_file_path()))))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, NoInstallationWhenProxyFlagEmptyAndBundleFlagAbsent) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("", std::nullopt), - - future.GetCallback()); - EXPECT_THAT(future.Get(), ValueIs(Eq(std::nullopt))); + EXPECT_THAT(ParseCommandLine("", std::nullopt), ValueIs(Eq(std::nullopt))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, NoInstallationWhenProxyFlagEmptyAndBundleFlagEmpty) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("", base::FilePath::FromUTF8Unsafe("")), - future.GetCallback()); - EXPECT_THAT(future.Get(), ValueIs(Eq(std::nullopt))); + EXPECT_THAT(ParseCommandLine("", base::FilePath::FromUTF8Unsafe("")), + ValueIs(Eq(std::nullopt))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagEmptyAndBundleFlagInvalid) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("", - base::FilePath::FromUTF8Unsafe("does_not_exist.wbn")), - future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("Invalid path provided"))); + EXPECT_THAT(ParseCommandLine( + "", base::FilePath::FromUTF8Unsafe("does_not_exist.wbn")), + ErrorIs(HasSubstr("Invalid path provided"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, InstallsAppWhenProxyFlagEmptyAndBundleFlagValid) { ScopedWorkingDirectoryWithFile cwd; - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("", cwd.existing_file_name()), future.GetCallback()); - EXPECT_THAT(future.Get(), + EXPECT_THAT(ParseCommandLine("", cwd.existing_file_name()), ValueIs(Optional(VariantWith<DevModeBundle>( Field(&DevModeBundle::path, cwd.existing_file_path()))))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagInvalidAndBundleFlagAbsent) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("invalid", std::nullopt), future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("Invalid URL"))); + EXPECT_THAT(ParseCommandLine("invalid", std::nullopt), + ErrorIs(HasSubstr("Invalid URL"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagInvalidAndBundleFlagEmpty) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("invalid", base::FilePath::FromUTF8Unsafe("")), - future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("Invalid URL"))); + EXPECT_THAT(ParseCommandLine("invalid", base::FilePath::FromUTF8Unsafe("")), + ErrorIs(HasSubstr("Invalid URL"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagInvalidAndBundleFlagInvalid) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("invalid", - base::FilePath::FromUTF8Unsafe("does_not_exist.wbn")), - future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("cannot both be provided"))); + EXPECT_THAT(ParseCommandLine("invalid", base::FilePath::FromUTF8Unsafe( + "does_not_exist.wbn")), + ErrorIs(HasSubstr("cannot both be provided"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagInvalidAndBundleFlagValid) { ScopedWorkingDirectoryWithFile cwd; - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("invalid", cwd.existing_file_name()), - future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("cannot both be provided"))); + EXPECT_THAT(ParseCommandLine("invalid", cwd.existing_file_name()), + ErrorIs(HasSubstr("cannot both be provided"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, InstallsAppWhenProxyFlagValidAndBundleFlagAbsent) { constexpr base::StringPiece kUrl = "http://example.com"; - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine(kUrl, std::nullopt), future.GetCallback()); - EXPECT_THAT(future.Get(), ValueIs(Optional(VariantWith<DevModeProxy>(_)))); - EXPECT_TRUE(absl::get<DevModeProxy>(**future.Get()) - .proxy_url.IsSameOriginWith(GURL(kUrl))); + EXPECT_THAT(ParseCommandLine(kUrl, std::nullopt), + ValueIs(Optional(VariantWith<DevModeProxy>( + Field("proxy_url", &DevModeProxy::proxy_url, + IsSameOriginWith(GURL(kUrl))))))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, InstallsAppWhenProxyFlagWithPortValidAndBundleFlagAbsent) { constexpr base::StringPiece kUrl = "http://example.com:12345"; - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine(kUrl, std::nullopt), future.GetCallback()); - EXPECT_THAT(future.Get(), ValueIs(Optional(VariantWith<DevModeProxy>(_)))); - EXPECT_TRUE(absl::get<DevModeProxy>(**future.Get()) - .proxy_url.IsSameOriginWith(GURL(kUrl))); + EXPECT_THAT(ParseCommandLine(kUrl, std::nullopt), + ValueIs(Optional(VariantWith<DevModeProxy>( + Field("proxy_url", &DevModeProxy::proxy_url, + IsSameOriginWith(GURL(kUrl))))))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagHasPathAndBundleFlagInValid) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("http://example.com/path", std::nullopt), - future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("Non-origin URL provided"))); + EXPECT_THAT(ParseCommandLine("http://example.com/path", std::nullopt), + ErrorIs(HasSubstr("Non-origin URL provided"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, InstallsAppWhenProxyFlagValidAndBundleFlagEmpty) { constexpr base::StringPiece kUrl = "http://example.com"; - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine(kUrl, base::FilePath::FromUTF8Unsafe("")), - future.GetCallback()); - EXPECT_THAT(future.Get(), ValueIs(Optional(VariantWith<DevModeProxy>(_)))); - EXPECT_TRUE(absl::get<DevModeProxy>(**future.Get()) - .proxy_url.IsSameOriginWith(GURL(kUrl))); + EXPECT_THAT(ParseCommandLine(kUrl, base::FilePath::FromUTF8Unsafe("")), + ValueIs(Optional(VariantWith<DevModeProxy>( + Field("proxy_url", &DevModeProxy::proxy_url, + IsSameOriginWith(GURL(kUrl))))))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagValidAndBundleFlagInvalid) { - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("http://example.com", - base::FilePath::FromUTF8Unsafe("does_not_exist.wbn")), - future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("cannot both be provided"))); + EXPECT_THAT( + ParseCommandLine("http://example.com", + base::FilePath::FromUTF8Unsafe("does_not_exist.wbn")), + ErrorIs(HasSubstr("cannot both be provided"))); } -TEST_F(IsolatedWebAppInstallationManagerTest, +TEST_F(IsolatedWebAppInstallationManagerCommandLineTest, ErrorWhenProxyFlagValidAndBundleFlagValid) { ScopedWorkingDirectoryWithFile cwd; - base::test::TestFuture<MaybeIwaLocation> future; - IsolatedWebAppInstallationManager::GetIsolatedWebAppLocationFromCommandLine( - CreateCommandLine("http://example.com", cwd.existing_file_name()), - future.GetCallback()); - EXPECT_THAT(future.Get(), ErrorIs(HasSubstr("cannot both be provided"))); + EXPECT_THAT(ParseCommandLine("http://example.com", cwd.existing_file_name()), + ErrorIs(HasSubstr("cannot both be provided"))); } } // namespace web_app
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_prepare_and_store_update_command_browsertest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_prepare_and_store_update_command_browsertest.cc index 13fcb8a..595fdcb 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_prepare_and_store_update_command_browsertest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_prepare_and_store_update_command_browsertest.cc
@@ -17,6 +17,7 @@ #include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h" #include "chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_location.h" +#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h" #include "chrome/browser/web_applications/isolated_web_apps/test/test_signed_web_bundle_builder.h" #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" #include "chrome/browser/web_applications/web_app_command_scheduler.h" @@ -88,6 +89,7 @@ InstallIsolatedWebAppCommandSuccess Install() { base::test::TestFuture<InstallResult> future; + SetTrustedWebBundleIdsForTesting({url_info_.web_bundle_id()}); provider()->scheduler().InstallIsolatedWebApp( url_info_, installed_location_input_, /*expected_version=*/installed_version_,
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.cc index 0f96025..7f52d601 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.cc
@@ -7,6 +7,7 @@ #include <memory> #include <utility> +#include "base/barrier_closure.h" #include "base/functional/bind.h" #include "base/functional/callback.h" #include "base/metrics/histogram_functions.h" @@ -92,6 +93,7 @@ void IsolatedWebAppReaderRegistry::ReadResponse( const base::FilePath& web_bundle_path, + bool dev_mode, const web_package::SignedWebBundleId& web_bundle_id, const network::ResourceRequest& resource_request, ReadResponseCallback callback) { @@ -99,8 +101,10 @@ DCHECK_EQ(web_bundle_id.type(), web_package::SignedWebBundleId::Type::kEd25519PublicKey); + Cache::Key cache_key{.path = web_bundle_path, .dev_mode = dev_mode}; + { - auto cache_entry_it = reader_cache_.Find(web_bundle_path); + auto cache_entry_it = reader_cache_.Find(cache_key); bool found = cache_entry_it != reader_cache_.End(); base::UmaHistogramEnumeration( @@ -132,7 +136,7 @@ web_bundle_id.id()})); auto [cache_entry_it, was_insertion] = - reader_cache_.Emplace(web_bundle_path, Cache::Entry()); + reader_cache_.Emplace(cache_key, Cache::Entry()); DCHECK(was_insertion); cache_entry_it->second.pending_requests.emplace_back(resource_request, std::move(callback)); @@ -149,18 +153,38 @@ bool skip_signature_verification = verified_files_.contains(web_bundle_path); #endif + IsolatedWebAppResponseReaderFactory::Flags flags; + if (dev_mode) { + flags.Put(IsolatedWebAppResponseReaderFactory::Flag::kDevModeBundle); + } + if (skip_signature_verification) { + flags.Put( + IsolatedWebAppResponseReaderFactory::Flag::kSkipSignatureVerification); + } + reader_factory_->CreateResponseReader( - web_bundle_path, web_bundle_id, skip_signature_verification, + web_bundle_path, web_bundle_id, flags, base::BindOnce(&IsolatedWebAppReaderRegistry::OnResponseReaderCreated, // `base::Unretained` can be used here since `this` owns // `reader_factory`. - base::Unretained(this), web_bundle_path, web_bundle_id)); + base::Unretained(this), web_bundle_path, dev_mode, + web_bundle_id)); } void IsolatedWebAppReaderRegistry::ClearCacheForPath( const base::FilePath& web_bundle_path, base::OnceClosure callback) { - auto cache_entry_it = reader_cache_.Find(web_bundle_path); + auto callbacks = base::BarrierClosure(2, std::move(callback)); + ClearCacheForPath(web_bundle_path, /*dev_mode=*/false, callbacks); + ClearCacheForPath(web_bundle_path, /*dev_mode=*/true, callbacks); +} + +void IsolatedWebAppReaderRegistry::ClearCacheForPath( + const base::FilePath& web_bundle_path, + bool dev_mode, + base::OnceClosure callback) { + auto cache_entry_it = + reader_cache_.Find({.path = web_bundle_path, .dev_mode = dev_mode}); const bool found = cache_entry_it != reader_cache_.End(); if (!found) { std::move(callback).Run(); @@ -180,12 +204,14 @@ void IsolatedWebAppReaderRegistry::OnResponseReaderCreated( const base::FilePath& web_bundle_path, + bool dev_mode, const web_package::SignedWebBundleId& web_bundle_id, base::expected<std::unique_ptr<IsolatedWebAppResponseReader>, UnusableSwbnFileError> reader) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - auto cache_entry_it = reader_cache_.Find(web_bundle_path); + auto cache_entry_it = + reader_cache_.Find({.path = web_bundle_path, .dev_mode = dev_mode}); DCHECK(cache_entry_it != reader_cache_.End()); DCHECK_EQ(cache_entry_it->second.state(), Cache::Entry::State::kPending); @@ -217,7 +243,7 @@ // The `SignedWebBundleReader` is now ready to read responses. Inform all // consumers that were waiting for this `SignedWebBundleReader` to become // available. - verified_files_.insert(cache_entry_it->first); + verified_files_.insert(cache_entry_it->first.path); cache_entry_it->second.set_reader(std::move(*reader)); for (auto& [resource_request, callback] : pending_requests) { DoReadResponse(cache_entry_it->second.GetReader(), resource_request, @@ -299,15 +325,15 @@ IsolatedWebAppReaderRegistry::Cache::Cache() = default; IsolatedWebAppReaderRegistry::Cache::~Cache() = default; -base::flat_map<base::FilePath, +base::flat_map<IsolatedWebAppReaderRegistry::Cache::Key, IsolatedWebAppReaderRegistry::Cache::Entry>::iterator -IsolatedWebAppReaderRegistry::Cache::Find(const base::FilePath& file_path) { +IsolatedWebAppReaderRegistry::Cache::Find(const Key& key) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return cache_.find(file_path); + return cache_.find(key); } -base::flat_map<base::FilePath, +base::flat_map<IsolatedWebAppReaderRegistry::Cache::Key, IsolatedWebAppReaderRegistry::Cache::Entry>::iterator IsolatedWebAppReaderRegistry::Cache::End() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -316,7 +342,7 @@ } template <class... Args> -std::pair<base::flat_map<base::FilePath, +std::pair<base::flat_map<IsolatedWebAppReaderRegistry::Cache::Key, IsolatedWebAppReaderRegistry::Cache::Entry>::iterator, bool> IsolatedWebAppReaderRegistry::Cache::Emplace(Args&&... args) { @@ -328,7 +354,8 @@ } void IsolatedWebAppReaderRegistry::Cache::Erase( - base::flat_map<base::FilePath, Entry>::iterator iterator) { + base::flat_map<IsolatedWebAppReaderRegistry::Cache::Key, Entry>::iterator + iterator) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); cache_.erase(iterator); @@ -362,23 +389,27 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::TimeTicks now = base::TimeTicks::Now(); - cache_.erase( - base::ranges::remove_if( - cache_, - [&now](const Entry& cache_entry) -> bool { - // If a `SignedWebBundleReader` is ready to read responses and has - // not been used for at least `kCleanupInterval`, remove it from the - // cache. - return cache_entry.state() == Entry::State::kReady && - now - cache_entry.last_access() > kCleanupInterval; - }, - [](const std::pair<base::FilePath, Entry>& entry) -> const Entry& { - return entry.second; - }), - cache_.end()); + cache_.erase(base::ranges::remove_if( + cache_, + [&now](const Entry& cache_entry) -> bool { + // If a `SignedWebBundleReader` is ready to read responses + // and has not been used for at least `kCleanupInterval`, + // remove it from the cache. + return cache_entry.state() == Entry::State::kReady && + now - cache_entry.last_access() > kCleanupInterval; + }, + [](const std::pair<Key, Entry>& entry) -> const Entry& { + return entry.second; + }), + cache_.end()); StopCleanupTimerIfCacheIsEmpty(); } +bool IsolatedWebAppReaderRegistry::Cache::Key::operator<( + const Key& other) const { + return std::tie(path, dev_mode) < std::tie(other.path, other.dev_mode); +} + void IsolatedWebAppReaderRegistry::Cache::Entry::SetCloseReaderCallback( base::OnceClosure callback) { CHECK(pending_closed_callback_.is_null());
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.h b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.h index 70944224..8577531 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.h +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.h
@@ -85,12 +85,13 @@ // both the response head and a closure it can call to read the response body, // or a string if an error occurs. void ReadResponse(const base::FilePath& web_bundle_path, + bool dev_mode, const web_package::SignedWebBundleId& web_bundle_id, const network::ResourceRequest& resource_request, ReadResponseCallback callback); - // Closes the cached readers of the given path. After callback is invoked - // the caller can expect that the corresponding file is closed. + // Closes the cached readers of the given path. After callback is invoked the + // caller can expect that the corresponding file is closed. void ClearCacheForPath(const base::FilePath& web_bundle_path, base::OnceClosure callback); @@ -110,8 +111,13 @@ FRIEND_TEST_ALL_PREFIXES(IsolatedWebAppReaderRegistryTest, TestConcurrentRequests); + void ClearCacheForPath(const base::FilePath& web_bundle_path, + bool dev_mode, + base::OnceClosure callback); + void OnResponseReaderCreated( const base::FilePath& web_bundle_path, + bool dev_mode, const web_package::SignedWebBundleId& web_bundle_id, base::expected<std::unique_ptr<IsolatedWebAppResponseReader>, UnusableSwbnFileError> reader); @@ -127,13 +133,14 @@ enum class ReaderCacheState; - // A thin wrapper around `base::flat_map<base::FilePath, Cache::Entry>` that + // A thin wrapper around `base::flat_map<Cache::Key, Cache::Entry>` that // automatically removes entries from the cache if they have not been accessed // for some time. This makes sure that `IsolatedWebAppResponseReader`s are not // kept alive indefinitely, since each of them holds an open file handle and // memory. class Cache { public: + struct Key; class Entry; Cache(); @@ -142,16 +149,22 @@ Cache(Cache&& other) = delete; Cache& operator=(Cache&& other) = delete; - base::flat_map<base::FilePath, Entry>::iterator Find( - const base::FilePath& file_path); + base::flat_map<Key, Entry>::iterator Find(const Key& key); - base::flat_map<base::FilePath, Entry>::iterator End(); + base::flat_map<Key, Entry>::iterator End(); template <class... Args> - std::pair<base::flat_map<base::FilePath, Entry>::iterator, bool> Emplace( + std::pair<base::flat_map<Key, Entry>::iterator, bool> Emplace( Args&&... args); - void Erase(base::flat_map<base::FilePath, Entry>::iterator iterator); + void Erase(base::flat_map<Key, Entry>::iterator iterator); + + struct Key { + base::FilePath path; + bool dev_mode; + + bool operator<(const Key& other) const; + }; // A cache `Entry` has two states: In its initial `kPending` state, it // caches requests made to a Signed Web Bundle until an @@ -217,7 +230,7 @@ void CleanupOldEntries(); - base::flat_map<base::FilePath, Entry> cache_; + base::flat_map<Key, Entry> cache_; base::RepeatingTimer cleanup_timer_; SEQUENCE_CHECKER(sequence_checker_); };
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry_factory.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry_factory.cc index 69d5608..de29715 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry_factory.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry_factory.cc
@@ -47,8 +47,7 @@ Profile* profile = Profile::FromBrowserContext(context); auto isolated_web_app_trust_checker = - std::make_unique<IsolatedWebAppTrustChecker>( - CHECK_DEREF(profile->GetPrefs())); + std::make_unique<IsolatedWebAppTrustChecker>(CHECK_DEREF(profile)); auto validator = std::make_unique<IsolatedWebAppValidator>( std::move(isolated_web_app_trust_checker));
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry_unittest.cc index 5c546a5..d52c512 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry_unittest.cc
@@ -30,7 +30,6 @@ #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.h" #include "chrome/browser/web_applications/test/signed_web_bundle_utils.h" #include "chrome/common/url_constants.h" -#include "components/prefs/testing_pref_service.h" #include "components/web_package/mojom/web_bundle_parser.mojom.h" #include "components/web_package/signed_web_bundles/ed25519_public_key.h" #include "components/web_package/signed_web_bundles/signed_web_bundle_id.h" @@ -62,28 +61,26 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0}; -// This class needs to be a IsolatedWebAppVaidator, but also must provide -// a TestingPrefServiceSimple that outlives it. So rather than making -// TestingPrefServiceSimple a member, make it the leftmost base class. -class FakeIsolatedWebAppValidator : public TestingPrefServiceSimple, - public IsolatedWebAppValidator { +class FakeIsolatedWebAppValidator : public IsolatedWebAppValidator { public: explicit FakeIsolatedWebAppValidator( std::optional<std::string> integrity_block_error) - : IsolatedWebAppValidator(std::make_unique<IsolatedWebAppTrustChecker>( - // Disambiguate the constructor using the form that takes the - // already-initialized leftmost base class, rather than the copy - // constructor for the uninitialized rightmost base class. - *static_cast<TestingPrefServiceSimple*>(this))), + : IsolatedWebAppValidator(/*isolated_web_app_trust_checker=*/nullptr), integrity_block_error_(integrity_block_error) {} void ValidateIntegrityBlock( const web_package::SignedWebBundleId& web_bundle_id, const web_package::SignedWebBundleIntegrityBlock& integrity_block, + bool dev_mode, base::OnceCallback<void(std::optional<std::string>)> callback) override { std::move(callback).Run(integrity_block_error_); } + void set_integrity_block_error( + std::optional<std::string> integrity_block_error) { + integrity_block_error_ = std::move(integrity_block_error); + } + private: std::optional<std::string> integrity_block_error_; }; @@ -221,8 +218,8 @@ resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); FulfillMetadata(); @@ -254,8 +251,8 @@ resource_request.url = kUrl.Resolve("/?bar=baz#foo"); base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); FulfillMetadata(); @@ -272,14 +269,87 @@ EXPECT_EQ(kResponseBody, response_body); } +TEST_F(IsolatedWebAppReaderRegistryTest, TestMixedDevModeAndProdModeRequests) { + auto validator = std::make_unique<FakeIsolatedWebAppValidator>(std::nullopt); + auto* validator_ref = validator.get(); + + registry_ = std::make_unique<IsolatedWebAppReaderRegistry>( + std::move(validator), + base::BindRepeating( + []() -> std::unique_ptr< + web_package::SignedWebBundleSignatureVerifier> { + return std::make_unique<FakeSignatureVerifier>(std::nullopt); + })); + + network::ResourceRequest resource_request; + resource_request.url = kUrl; + + // First, simulate a successful parsing of the integrity block, and read a + // response. + validator_ref->set_integrity_block_error(std::nullopt); + { + base::test::TestFuture<ReadResult> read_response_future; + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, + read_response_future.GetCallback()); + FulfillIntegrityBlock(); + FulfillMetadata(); + FulfillResponse(resource_request); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppResponseReader::Response response, + read_response_future.Take()); + EXPECT_EQ(response.head()->response_code, 200); + } + + // Now, make all further attempts to parse an integrity block return with an + // error. + validator_ref->set_integrity_block_error("some error"); + { + // A request to the already opened bundle should still succeed. + base::test::TestFuture<ReadResult> read_response_future; + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, + read_response_future.GetCallback()); + FulfillResponse(resource_request); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppResponseReader::Response response, + read_response_future.Take()); + EXPECT_EQ(response.head()->response_code, 200); + } + { + // A request to the same bundle, but this time with a different `dev_mode` + // flag, should not succeed. This verifies that the cache is partitioned by + // `dev_mode`. + base::test::TestFuture<ReadResult> read_response_future; + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/true, kWebBundleId, + resource_request, + read_response_future.GetCallback()); + FulfillIntegrityBlock(); + EXPECT_THAT(read_response_future.Take(), + testing::Not(base::test::HasValue())); + } + + // Now, clear the cache - requests should all fail now. + base::test::TestFuture<void> close_future; + registry_->ClearCacheForPath(web_bundle_path_, close_future.GetCallback()); + EXPECT_TRUE(close_future.Wait()); + { + base::test::TestFuture<ReadResult> read_response_future; + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, + read_response_future.GetCallback()); + FulfillIntegrityBlock(); + EXPECT_THAT(read_response_future.Take(), + testing::Not(base::test::HasValue())); + } +} + TEST_F(IsolatedWebAppReaderRegistryTest, TestReadingResponseAfterSignedWebBundleReaderIsDeleted) { network::ResourceRequest resource_request; resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); FulfillMetadata(); @@ -310,8 +380,8 @@ resource_request.url = GURL(kUrl.spec() + "foo"); base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); FulfillMetadata(); @@ -354,7 +424,8 @@ { base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); // `SignedWebBundleReader`s should not be evicted from the cache while they @@ -387,7 +458,8 @@ { base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); // Notably, no `FulfillIntegrityBlock` or `FulfillMetadata` here, since the @@ -422,7 +494,8 @@ { base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); // Since the SignedWebBundleReader has been evicted from cache, integrity @@ -464,8 +537,8 @@ resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); auto error = web_package::mojom::BundleIntegrityBlockParseError::New(); error->type = GetParam().first; @@ -512,8 +585,8 @@ })); base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); @@ -548,8 +621,8 @@ })); base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); @@ -598,8 +671,8 @@ resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); auto error = web_package::mojom::BundleMetadataParseError::New(); @@ -639,8 +712,8 @@ resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); auto metadata = metadata_->Clone(); @@ -666,8 +739,8 @@ resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); auto metadata = metadata_->Clone(); @@ -701,8 +774,8 @@ resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); FulfillMetadata(); @@ -747,7 +820,8 @@ // Simulate two simultaneous requests for the same web bundle base::test::TestFuture<ReadResult> read_response_future_1; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future_1.GetCallback()); histogram_tester.GetAllSamples("WebApp.Isolated.ResponseReaderCacheState"), @@ -756,7 +830,8 @@ base::Bucket(ReaderCacheState::kCachedPending, 0)); base::test::TestFuture<ReadResult> read_response_future_2; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future_2.GetCallback()); histogram_tester.GetAllSamples("WebApp.Isolated.ResponseReaderCacheState"), @@ -793,7 +868,8 @@ } base::test::TestFuture<ReadResult> read_response_future_3; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future_3.GetCallback()); histogram_tester.GetAllSamples("WebApp.Isolated.ResponseReaderCacheState"), @@ -822,8 +898,8 @@ resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); FulfillMetadata(); @@ -855,8 +931,8 @@ resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, - read_response_future.GetCallback()); + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); base::test::TestFuture<void> close_future; registry_->ClearCacheForPath(web_bundle_path_, close_future.GetCallback()); @@ -889,7 +965,8 @@ resource_request.url = kUrl; base::test::TestFuture<ReadResult> read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, resource_request, + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, + resource_request, read_response_future.GetCallback()); FulfillIntegrityBlock(); @@ -915,7 +992,7 @@ new_resource_request.url = kUrl; base::test::TestFuture<ReadResult> new_read_response_future; - registry_->ReadResponse(web_bundle_path_, kWebBundleId, + registry_->ReadResponse(web_bundle_path_, /*dev_mode=*/false, kWebBundleId, new_resource_request, new_read_response_future.GetCallback());
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory.cc index 40d4d56..016525a 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory.cc
@@ -41,7 +41,7 @@ void IsolatedWebAppResponseReaderFactory::CreateResponseReader( const base::FilePath& web_bundle_path, const web_package::SignedWebBundleId& web_bundle_id, - bool skip_signature_verification, + Flags flags, Callback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_EQ(web_bundle_id.type(), @@ -59,8 +59,7 @@ SignedWebBundleReader& reader_ref = *reader.get(); reader_ref.StartReading( base::BindOnce(&IsolatedWebAppResponseReaderFactory::OnIntegrityBlockRead, - weak_ptr_factory_.GetWeakPtr(), web_bundle_id, - skip_signature_verification), + weak_ptr_factory_.GetWeakPtr(), web_bundle_id, flags), base::BindOnce( &IsolatedWebAppResponseReaderFactory::OnIntegrityBlockAndMetadataRead, weak_ptr_factory_.GetWeakPtr(), std::move(reader), web_bundle_path, @@ -95,17 +94,18 @@ void IsolatedWebAppResponseReaderFactory::OnIntegrityBlockRead( const web_package::SignedWebBundleId& web_bundle_id, - bool skip_signature_verification, + Flags flags, const web_package::SignedWebBundleIntegrityBlock integrity_block, base::OnceCallback<void(SignedWebBundleReader::SignatureVerificationAction)> integrity_callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); validator_->ValidateIntegrityBlock( - web_bundle_id, integrity_block, + web_bundle_id, integrity_block, flags.Has(Flag::kDevModeBundle), base::BindOnce( &IsolatedWebAppResponseReaderFactory::OnIntegrityBlockValidated, - weak_ptr_factory_.GetWeakPtr(), skip_signature_verification, + weak_ptr_factory_.GetWeakPtr(), + flags.Has(Flag::kSkipSignatureVerification), std::move(integrity_callback))); }
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory.h b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory.h index fa80e2f1..380285c 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory.h +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> +#include "base/containers/enum_set.h" #include "base/files/file_path.h" #include "base/functional/callback.h" #include "base/memory/weak_ptr.h" @@ -55,10 +56,18 @@ base::expected<std::unique_ptr<IsolatedWebAppResponseReader>, UnusableSwbnFileError>)>; + enum class Flag { + kMinValue, + kDevModeBundle = kMinValue, + kSkipSignatureVerification, + kMaxValue = kSkipSignatureVerification + }; + using Flags = base::EnumSet<Flag, Flag::kMinValue, Flag::kMaxValue>; + virtual void CreateResponseReader( const base::FilePath& web_bundle_path, const web_package::SignedWebBundleId& web_bundle_id, - bool skip_signature_verification, + Flags flags, Callback callback); static std::string ErrorToString(const UnusableSwbnFileError& error); @@ -66,7 +75,7 @@ private: void OnIntegrityBlockRead( const web_package::SignedWebBundleId& web_bundle_id, - bool skip_signature_verification, + Flags flags, const web_package::SignedWebBundleIntegrityBlock integrity_block, base::OnceCallback< void(SignedWebBundleReader::SignatureVerificationAction)> callback);
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory_unittest.cc index f895cb36..4df9bfd 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader_factory_unittest.cc
@@ -25,7 +25,6 @@ #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.h" -#include "components/prefs/testing_pref_service.h" #include "components/web_package/mojom/web_bundle_parser.mojom.h" #include "components/web_package/signed_web_bundles/ed25519_public_key.h" #include "components/web_package/signed_web_bundles/signed_web_bundle_id.h" @@ -62,24 +61,17 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0}; -// This class needs to be a IsolatedWebAppVaidator, but also must provide -// a TestingPrefServiceSimple that outlives it. So rather than making -// TestingPrefServiceSimple a member, make it the leftmost base class. -class FakeIsolatedWebAppValidator : public TestingPrefServiceSimple, - public IsolatedWebAppValidator { +class FakeIsolatedWebAppValidator : public IsolatedWebAppValidator { public: explicit FakeIsolatedWebAppValidator( std::optional<std::string> integrity_block_error) - : IsolatedWebAppValidator(std::make_unique<IsolatedWebAppTrustChecker>( - // Disambiguate the constructor using the form that takes the - // already-initialized leftmost base class, rather than the copy - // constructor for the uninitialized rightmost base class. - *static_cast<TestingPrefServiceSimple*>(this))), + : IsolatedWebAppValidator(/*isolated_web_app_trust_checker=*/nullptr), integrity_block_error_(integrity_block_error) {} void ValidateIntegrityBlock( const web_package::SignedWebBundleId& web_bundle_id, const web_package::SignedWebBundleIntegrityBlock& integrity_block, + bool dev_mode, base::OnceCallback<void(std::optional<std::string>)> callback) override { std::move(callback).Run(integrity_block_error_); } @@ -224,8 +216,7 @@ base::test::TestFuture<ReaderResult> reader_future; factory_->CreateResponseReader(web_bundle_path_, kWebBundleId, - /*skip_signature_verification=*/false, - reader_future.GetCallback()); + /*flags=*/{}, reader_future.GetCallback()); auto error = web_package::mojom::BundleIntegrityBlockParseError::New(); error->type = GetParam().first; @@ -267,8 +258,7 @@ base::test::TestFuture<ReaderResult> reader_future; factory_->CreateResponseReader(web_bundle_path_, kWebBundleId, - /*skip_signature_verification=*/false, - reader_future.GetCallback()); + /*flags=*/{}, reader_future.GetCallback()); FulfillIntegrityBlock(); @@ -309,9 +299,13 @@ }, error_)); + IsolatedWebAppResponseReaderFactory::Flags flags; + if (skip_signature_verification_) { + flags.Put( + IsolatedWebAppResponseReaderFactory::Flag::kSkipSignatureVerification); + } base::test::TestFuture<ReaderResult> reader_future; - factory_->CreateResponseReader(web_bundle_path_, kWebBundleId, - skip_signature_verification_, + factory_->CreateResponseReader(web_bundle_path_, kWebBundleId, flags, reader_future.GetCallback()); FulfillIntegrityBlock(); @@ -359,8 +353,7 @@ base::test::TestFuture<ReaderResult> reader_future; factory_->CreateResponseReader(web_bundle_path_, kWebBundleId, - /*skip_signature_verification=*/false, - reader_future.GetCallback()); + /*flags=*/{}, reader_future.GetCallback()); FulfillIntegrityBlock(); auto error = web_package::mojom::BundleMetadataParseError::New(); @@ -395,8 +388,7 @@ base::test::TestFuture<ReaderResult> reader_future; factory_->CreateResponseReader(web_bundle_path_, kWebBundleId, - /*skip_signature_verification=*/false, - reader_future.GetCallback()); + /*flags=*/{}, reader_future.GetCallback()); FulfillIntegrityBlock(); auto metadata = metadata_->Clone(); @@ -417,8 +409,7 @@ TestInvalidMetadataInvalidExchange) { base::test::TestFuture<ReaderResult> reader_future; factory_->CreateResponseReader(web_bundle_path_, kWebBundleId, - /*skip_signature_verification=*/false, - reader_future.GetCallback()); + /*flags=*/{}, reader_future.GetCallback()); FulfillIntegrityBlock(); auto metadata = metadata_->Clone();
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc index 0dfbc70..0bca27fa 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc
@@ -11,6 +11,8 @@ #include "base/notreached.h" #include "base/ranges/algorithm.h" #include "base/strings/stringprintf.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_dev_mode.h" #include "chrome/common/chrome_features.h" #include "components/prefs/pref_service.h" #include "components/web_package/signed_web_bundles/signed_web_bundle_id.h" @@ -36,15 +38,15 @@ } // namespace -IsolatedWebAppTrustChecker::IsolatedWebAppTrustChecker( - const PrefService& pref_service) - : pref_service_(pref_service) {} +IsolatedWebAppTrustChecker::IsolatedWebAppTrustChecker(Profile& profile) + : profile_(profile) {} IsolatedWebAppTrustChecker::~IsolatedWebAppTrustChecker() = default; IsolatedWebAppTrustChecker::Result IsolatedWebAppTrustChecker::IsTrusted( const web_package::SignedWebBundleId& expected_web_bundle_id, - const web_package::SignedWebBundleIntegrityBlock& integrity_block) const { + const web_package::SignedWebBundleIntegrityBlock& integrity_block, + bool is_dev_mode_bundle) const { if (expected_web_bundle_id.type() != web_package::SignedWebBundleId::Type::kEd25519PublicKey) { return {.status = Result::Status::kErrorUnsupportedWebBundleIdType, @@ -78,7 +80,7 @@ } #endif // BUILDFLAG(IS_CHROMEOS) - if (IsTrustedViaDevMode(expected_web_bundle_id)) { + if (is_dev_mode_bundle && IsIwaDevModeEnabled(&*profile_)) { return {.status = Result::Status::kTrusted}; } @@ -94,8 +96,8 @@ #if BUILDFLAG(IS_CHROMEOS) bool IsolatedWebAppTrustChecker::IsTrustedViaPolicy( const web_package::SignedWebBundleId& web_bundle_id) const { - const PrefService::Preference* pref = - pref_service_->FindPreference(prefs::kIsolatedWebAppInstallForceList); + const PrefService::Preference* pref = profile_->GetPrefs()->FindPreference( + prefs::kIsolatedWebAppInstallForceList); if (!pref) { NOTREACHED(); return false; @@ -112,11 +114,6 @@ } #endif // BUILDFLAG(IS_CHROMEOS) -bool IsolatedWebAppTrustChecker::IsTrustedViaDevMode( - const web_package::SignedWebBundleId& web_bundle_id) const { - return base::FeatureList::IsEnabled(features::kIsolatedWebAppDevMode); -} - void SetTrustedWebBundleIdsForTesting( // IN-TEST base::flat_set<web_package::SignedWebBundleId> trusted_web_bundle_ids) { DCHECK(base::ranges::all_of(
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h index d4c61b6..6078b73 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h
@@ -17,7 +17,7 @@ class SignedWebBundleIntegrityBlock; } // namespace web_package -class PrefService; +class Profile; namespace web_app { @@ -35,8 +35,8 @@ // 1. The Web Bundle ID of an Isolated Web App is configured via enterprise // policy to be trusted. // 2. Isolated Web App developer mode (`features::kIsolatedWebAppDevMode`) is -// enabled. This is used by developers to test their Isolated Web Apps during -// development. +// enabled and the app is a developer mode-installed app. This is used by +// developers to test their Isolated Web Apps during development. // 3. [Only in Tests] The Web Bundle ID of an Isolated Web App is configured as // trusted via a call to `SetTrustedWebBundleIdsForTesting`. // @@ -47,7 +47,7 @@ // Apps that were countersigned by a trusted distributor/store. class IsolatedWebAppTrustChecker { public: - explicit IsolatedWebAppTrustChecker(const PrefService& pref_service); + explicit IsolatedWebAppTrustChecker(Profile& profile); virtual ~IsolatedWebAppTrustChecker(); @@ -60,12 +60,16 @@ // This function also makes sure that the `expected_web_bundle_id` is actually // derived from the `public_key_stack`. // + // Whether or not Isolated Web App developer mode is enabled in the browser is + // only taken into account when `is_dev_mode_bundle` is set to `true`. + // // Important: This method does not verify the signatures themselves - it only // checks whether the public keys associated with these signatures correspond // to trusted parties. virtual Result IsTrusted( const web_package::SignedWebBundleId& expected_web_bundle_id, - const web_package::SignedWebBundleIntegrityBlock& integrity_block) const; + const web_package::SignedWebBundleIntegrityBlock& integrity_block, + bool is_dev_mode_bundle) const; struct Result { enum class Status { @@ -88,12 +92,7 @@ const web_package::SignedWebBundleId& web_bundle_id) const; #endif - // Returns `true` if trust for this Web Bundle ID is established because - // Isolated Web App developer mode is enabled. - [[nodiscard]] bool IsTrustedViaDevMode( - const web_package::SignedWebBundleId& web_bundle_id) const; - - raw_ref<const PrefService> pref_service_; + raw_ref<Profile> profile_; base::WeakPtrFactory<IsolatedWebAppTrustChecker> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker_unittest.cc index 7748043..c264166 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker_unittest.cc
@@ -11,10 +11,13 @@ #include "base/feature_list.h" #include "base/strings/strcat.h" #include "base/test/scoped_feature_list.h" +#include "base/types/cxx23_to_underlying.h" +#include "chrome/browser/policy/developer_tools_policy_handler.h" +#include "chrome/browser/web_applications/test/web_app_test.h" #include "chrome/common/chrome_features.h" +#include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "components/prefs/pref_service.h" -#include "components/prefs/testing_pref_service.h" #include "components/web_package/mojom/web_bundle_parser.mojom.h" #include "components/web_package/signed_web_bundles/ed25519_public_key.h" #include "components/web_package/signed_web_bundles/signed_web_bundle_id.h" @@ -27,8 +30,6 @@ #if BUILDFLAG(IS_CHROMEOS) #include "base/values.h" #include "chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_constants.h" -#include "chrome/common/pref_names.h" -#include "components/prefs/pref_registry_simple.h" #endif // BUILDFLAG(IS_CHROMEOS) namespace web_app { @@ -68,24 +69,30 @@ } // namespace -class IsolatedWebAppTrustCheckerTest : public testing::Test { +class IsolatedWebAppTrustCheckerTest : public WebAppTest { public: IsolatedWebAppTrustCheckerTest() { scoped_feature_list_.InitAndEnableFeature(features::kIsolatedWebApps); } -#if BUILDFLAG(IS_CHROMEOS) void SetUp() override { - pref_service_.registry()->RegisterListPref( - prefs::kIsolatedWebAppInstallForceList); + WebAppTest::SetUp(); + + isolated_web_app_trust_checker_ = + std::make_unique<IsolatedWebAppTrustChecker>(*profile()); } -#endif // BUILDFLAG(IS_CHROMEOS) + + void TearDown() override { + isolated_web_app_trust_checker_.reset(); + + WebAppTest::TearDown(); + } IsolatedWebAppTrustChecker& trust_checker() { - return isolated_web_app_trust_checker_; + return *isolated_web_app_trust_checker_; } - PrefService& pref_service() { return pref_service_; } + PrefService& pref_service() { return *profile()->GetPrefs(); } const web_package::Ed25519PublicKey kPublicKey1 = web_package::Ed25519PublicKey::Create(base::make_span(kPublicKeyBytes1)); @@ -107,14 +114,13 @@ private: base::test::ScopedFeatureList scoped_feature_list_; - TestingPrefServiceSimple pref_service_; - IsolatedWebAppTrustChecker isolated_web_app_trust_checker_ = - IsolatedWebAppTrustChecker(pref_service_); + std::unique_ptr<IsolatedWebAppTrustChecker> isolated_web_app_trust_checker_; }; TEST_F(IsolatedWebAppTrustCheckerTest, TwoPublicKeys) { IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( - kWebBundleId1, MakeIntegrityBlock({kPublicKey1, kPublicKey2})); + kWebBundleId1, MakeIntegrityBlock({kPublicKey1, kPublicKey2}), + /*is_dev_mode_bundle=*/false); EXPECT_EQ(result.status, IsolatedWebAppTrustChecker::Result::Status:: kErrorInvalidSignatureStackLength); } @@ -122,14 +128,16 @@ TEST_F(IsolatedWebAppTrustCheckerTest, DevWebBundleId) { IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( web_package::SignedWebBundleId::CreateRandomForDevelopment(), - MakeIntegrityBlock({kPublicKey1})); + MakeIntegrityBlock({kPublicKey1}), + /*is_dev_mode_bundle=*/false); EXPECT_EQ(result.status, IsolatedWebAppTrustChecker::Result::Status:: kErrorUnsupportedWebBundleIdType); } TEST_F(IsolatedWebAppTrustCheckerTest, WebBundleIdAndPublicKeyDiffer) { IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( - kWebBundleId1, MakeIntegrityBlock({kPublicKey2})); + kWebBundleId1, MakeIntegrityBlock({kPublicKey2}), + /*is_dev_mode_bundle=*/false); EXPECT_EQ(result.status, IsolatedWebAppTrustChecker::Result::Status:: kErrorWebBundleIdNotDerivedFromFirstPublicKey); EXPECT_EQ(result.message, @@ -142,7 +150,8 @@ TEST_F(IsolatedWebAppTrustCheckerTest, UntrustedByDefault) { { IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( - kWebBundleId1, MakeIntegrityBlock({kPublicKey1})); + kWebBundleId1, MakeIntegrityBlock({kPublicKey1}), + /*is_dev_mode_bundle=*/false); EXPECT_EQ( result.status, IsolatedWebAppTrustChecker::Result::Status::kErrorPublicKeysNotTrusted); @@ -150,7 +159,8 @@ { IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( - kWebBundleId2, MakeIntegrityBlock({kPublicKey2})); + kWebBundleId2, MakeIntegrityBlock({kPublicKey2}), + /*is_dev_mode_bundle=*/false); EXPECT_EQ( result.status, IsolatedWebAppTrustChecker::Result::Status::kErrorPublicKeysNotTrusted); @@ -180,14 +190,16 @@ { IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( - kWebBundleId1, MakeIntegrityBlock({kPublicKey1})); + kWebBundleId1, MakeIntegrityBlock({kPublicKey1}), + /*is_dev_mode_bundle=*/false); EXPECT_EQ(result.status, IsolatedWebAppTrustChecker::Result::Status::kTrusted); } { IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( - kWebBundleId2, MakeIntegrityBlock({kPublicKey2})); + kWebBundleId2, MakeIntegrityBlock({kPublicKey2}), + /*is_dev_mode_bundle=*/false); EXPECT_EQ( result.status, IsolatedWebAppTrustChecker::Result::Status::kErrorPublicKeysNotTrusted); @@ -196,14 +208,50 @@ #endif // BUILDFLAG(IS_CHROMEOS) -TEST_F(IsolatedWebAppTrustCheckerTest, TrustedViaDevMode) { +TEST_F(IsolatedWebAppTrustCheckerTest, + DevModeDoesNotAutomaticallyTrustAllApps) { base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeature(features::kIsolatedWebAppDevMode); IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( - kWebBundleId1, MakeIntegrityBlock({kPublicKey1})); - EXPECT_EQ(result.status, - IsolatedWebAppTrustChecker::Result::Status::kTrusted); + kWebBundleId1, MakeIntegrityBlock({kPublicKey1}), + /*is_dev_mode_bundle=*/false); + EXPECT_EQ( + result.status, + IsolatedWebAppTrustChecker::Result::Status::kErrorPublicKeysNotTrusted); +} + +TEST_F(IsolatedWebAppTrustCheckerTest, TrustedViaDevMode) { + { + IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( + kWebBundleId1, MakeIntegrityBlock({kPublicKey1}), + /*is_dev_mode_bundle=*/true); + EXPECT_EQ( + result.status, + IsolatedWebAppTrustChecker::Result::Status::kErrorPublicKeysNotTrusted); + } + + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(features::kIsolatedWebAppDevMode); + { + IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( + kWebBundleId1, MakeIntegrityBlock({kPublicKey1}), + /*is_dev_mode_bundle=*/true); + EXPECT_EQ(result.status, + IsolatedWebAppTrustChecker::Result::Status::kTrusted); + } + pref_service().SetInteger( + prefs::kDevToolsAvailability, + base::to_underlying( + policy::DeveloperToolsPolicyHandler::Availability::kDisallowed)); + { + IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( + kWebBundleId1, MakeIntegrityBlock({kPublicKey1}), + /*is_dev_mode_bundle=*/true); + EXPECT_EQ( + result.status, + IsolatedWebAppTrustChecker::Result::Status::kErrorPublicKeysNotTrusted); + } } TEST_F(IsolatedWebAppTrustCheckerTest, TrustedWebBundleIDsForTesting) { @@ -211,14 +259,16 @@ { IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( - kWebBundleId1, MakeIntegrityBlock({kPublicKey1})); + kWebBundleId1, MakeIntegrityBlock({kPublicKey1}), + /*is_dev_mode_bundle=*/false); EXPECT_EQ(result.status, IsolatedWebAppTrustChecker::Result::Status::kTrusted); } { IsolatedWebAppTrustChecker::Result result = trust_checker().IsTrusted( - kWebBundleId2, MakeIntegrityBlock({kPublicKey2})); + kWebBundleId2, MakeIntegrityBlock({kPublicKey2}), + /*is_dev_mode_bundle=*/false); EXPECT_EQ( result.status, IsolatedWebAppTrustChecker::Result::Status::kErrorPublicKeysNotTrusted);
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_uninstall_browsertest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_uninstall_browsertest.cc index 9132323..876bd67 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_uninstall_browsertest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_uninstall_browsertest.cc
@@ -15,6 +15,7 @@ #include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h" #include "chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_location.h" +#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h" #include "chrome/browser/web_applications/isolated_web_apps/test/test_signed_web_bundle_builder.h" #include "chrome/browser/web_applications/jobs/uninstall/remove_web_app_job.h" @@ -60,6 +61,7 @@ void Install() { base::test::TestFuture<InstallResult> future; + SetTrustedWebBundleIdsForTesting({url_info_.web_bundle_id()}); provider()->scheduler().InstallIsolatedWebApp( url_info_, src_location_, /*expected_version=*/std::nullopt,
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory.cc index 4feef272..26449f5 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory.cc
@@ -219,6 +219,7 @@ IsolatedWebAppURLLoader( IsolatedWebAppReaderRegistry* isolated_web_app_reader_registry, const base::FilePath& web_bundle_path, + bool dev_mode, web_package::SignedWebBundleId web_bundle_id, mojo::PendingRemote<network::mojom::URLLoaderClient> loader_client, const network::ResourceRequest& resource_request, @@ -227,7 +228,7 @@ resource_request_(resource_request), frame_tree_node_id_(frame_tree_node_id) { isolated_web_app_reader_registry->ReadResponse( - web_bundle_path, web_bundle_id, resource_request, + web_bundle_path, dev_mode, web_bundle_id, resource_request, base::BindOnce(&IsolatedWebAppURLLoader::OnResponseRead, weak_factory_.GetWeakPtr())); } @@ -502,7 +503,8 @@ [&](const InstalledBundle& location) { DCHECK_EQ(url_info.web_bundle_id().type(), web_package::SignedWebBundleId::Type::kEd25519PublicKey); - HandleSignedBundle(location.path, url_info.web_bundle_id(), + HandleSignedBundle(location.path, /*dev_mode=*/false, + url_info.web_bundle_id(), std::move(loader_receiver), resource_request, std::move(loader_client)); }, @@ -513,7 +515,8 @@ // like a properly installed Signed Web Bundle, with the only // difference being that we implicitly trust its public // key(s) when developer mode is enabled. - HandleSignedBundle(location.path, url_info.web_bundle_id(), + HandleSignedBundle(location.path, /*dev_mode=*/true, + url_info.web_bundle_id(), std::move(loader_receiver), resource_request, std::move(loader_client)); }, @@ -539,6 +542,7 @@ void IsolatedWebAppURLLoaderFactory::HandleSignedBundle( const base::FilePath& path, + bool dev_mode, const web_package::SignedWebBundleId& web_bundle_id, mojo::PendingReceiver<network::mojom::URLLoader> loader_receiver, const network::ResourceRequest& resource_request, @@ -552,7 +556,7 @@ } auto loader = std::make_unique<IsolatedWebAppURLLoader>( - isolated_web_app_reader_registry, path, web_bundle_id, + isolated_web_app_reader_registry, path, dev_mode, web_bundle_id, std::move(loader_client), resource_request, frame_tree_node_id_); mojo::MakeSelfOwnedReceiver(std::move(std::move(loader)), mojo::PendingReceiver<network::mojom::URLLoader>(
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory.h b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory.h index 99138ed..b2493ec 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory.h +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory.h
@@ -75,6 +75,7 @@ void HandleSignedBundle( const base::FilePath& path, + bool dev_mode, const web_package::SignedWebBundleId& web_bundle_id, mojo::PendingReceiver<network::mojom::URLLoader> loader_receiver, const network::ResourceRequest& resource_request,
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.cc index f7d8de3..e572814 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.cc
@@ -32,6 +32,7 @@ void IsolatedWebAppValidator::ValidateIntegrityBlock( const web_package::SignedWebBundleId& expected_web_bundle_id, const web_package::SignedWebBundleIntegrityBlock& integrity_block, + bool dev_mode, base::OnceCallback<void(std::optional<std::string>)> callback) { // In here, we would also validate other properties of the Integrity Block, // such as whether its version is supported (once we support multiple @@ -39,7 +40,7 @@ IsolatedWebAppTrustChecker::Result result = isolated_web_app_trust_checker_->IsTrusted(expected_web_bundle_id, - integrity_block); + integrity_block, dev_mode); if (result.status != IsolatedWebAppTrustChecker::Result::Status::kTrusted) { std::move(callback).Run(result.message); return;
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.h b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.h index 86f11773..e3374ed 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.h +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.h
@@ -37,6 +37,7 @@ virtual void ValidateIntegrityBlock( const web_package::SignedWebBundleId& expected_web_bundle_id, const web_package::SignedWebBundleIntegrityBlock& integrity_block, + bool dev_mode, base::OnceCallback<void(std::optional<std::string>)> callback); // Validates that the metadata of the Isolated Web App is valid given the
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator_unittest.cc index e8e07c4..7940f881 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator_unittest.cc
@@ -13,12 +13,12 @@ #include "base/strings/strcat.h" #include "base/strings/string_util.h" #include "base/test/gmock_expected_support.h" -#include "base/test/task_environment.h" #include "base/test/test_future.h" #include "base/types/expected.h" #include "chrome/browser/web_applications/isolated_web_apps/error/unusable_swbn_file_error.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h" #include "chrome/common/url_constants.h" +#include "chrome/test/base/testing_profile.h" #include "components/prefs/pref_service.h" #include "components/prefs/testing_pref_service.h" #include "components/web_package/mojom/web_bundle_parser.mojom.h" @@ -26,6 +26,7 @@ #include "components/web_package/signed_web_bundles/ed25519_signature.h" #include "components/web_package/signed_web_bundles/signed_web_bundle_id.h" #include "components/web_package/signed_web_bundles/signed_web_bundle_integrity_block.h" +#include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -65,24 +66,16 @@ 0xc2, 0xd9, 0xf2, 0x02, 0x03, 0x42, 0x18, 0x10, 0x12, 0x26, 0x62, 0x88, 0xf6, 0xa3, 0xa5, 0x47, 0x14, 0x69, 0x00, 0x73}; -// This class needs to be a IsolatedWebAppTrustChecker, but also must -// provide a TestingPrefServiceSimple that outlives it. So rather than -// making TestingPrefServiceSimple a member, make it the leftmost base class. -class MockIsolatedWebAppTrustChecker : private TestingPrefServiceSimple, - public IsolatedWebAppTrustChecker { +class MockIsolatedWebAppTrustChecker : public IsolatedWebAppTrustChecker { public: - MockIsolatedWebAppTrustChecker() - : IsolatedWebAppTrustChecker( - // Disambiguate the constructor using the form that takes the - // already-initialized leftmost base class, rather than the copy - // constructor for the uninitialized rightmost base class. - *static_cast<TestingPrefServiceSimple*>(this)) {} + using IsolatedWebAppTrustChecker::IsolatedWebAppTrustChecker; MOCK_METHOD( IsolatedWebAppTrustChecker::Result, IsTrusted, (const web_package::SignedWebBundleId& web_bundle_id, - const web_package::SignedWebBundleIntegrityBlock& integrity_block), + const web_package::SignedWebBundleIntegrityBlock& integrity_block, + bool dev_mode), (const, override)); }; @@ -111,11 +104,10 @@ class IsolatedWebAppValidatorTest : public ::testing::Test { private: - base::test::SingleThreadTaskEnvironment task_environment; + content::BrowserTaskEnvironment task_environment_; }; -class IsolatedWebAppValidatorIntegrityBlockTest - : public IsolatedWebAppValidatorTest {}; +using IsolatedWebAppValidatorIntegrityBlockTest = IsolatedWebAppValidatorTest; TEST_F(IsolatedWebAppValidatorIntegrityBlockTest, IWAIsTrusted) { ASSERT_OK_AND_ASSIGN( @@ -123,19 +115,23 @@ web_package::SignedWebBundleId::Create(kSignedWebBundleId)); auto integrity_block = MakeIntegrityBlock(); + TestingProfile profile; auto isolated_web_app_trust_checker = - std::make_unique<MockIsolatedWebAppTrustChecker>(); - EXPECT_CALL(*isolated_web_app_trust_checker, - IsTrusted(web_bundle_id, integrity_block)) - .WillOnce([](auto web_bundle_id, - auto integrity_block) -> IsolatedWebAppTrustChecker::Result { - return {.status = IsolatedWebAppTrustChecker::Result::Status::kTrusted}; - }); + std::make_unique<MockIsolatedWebAppTrustChecker>(profile); + EXPECT_CALL( + *isolated_web_app_trust_checker, + IsTrusted(web_bundle_id, integrity_block, /*is_dev_mode_bundle=*/false)) + .WillOnce( + [](auto web_bundle_id, auto integrity_block, + bool is_dev_mode_bundle) -> IsolatedWebAppTrustChecker::Result { + return {.status = + IsolatedWebAppTrustChecker::Result::Status::kTrusted}; + }); IsolatedWebAppValidator validator(std::move(isolated_web_app_trust_checker)); base::test::TestFuture<std::optional<std::string>> future; validator.ValidateIntegrityBlock(web_bundle_id, integrity_block, - future.GetCallback()); + /*dev_mode=*/false, future.GetCallback()); EXPECT_EQ(future.Get(), std::nullopt); } @@ -145,13 +141,15 @@ web_package::SignedWebBundleId::Create(kSignedWebBundleId)); auto integrity_block = MakeIntegrityBlock(); + TestingProfile profile; auto isolated_web_app_trust_checker = - std::make_unique<MockIsolatedWebAppTrustChecker>(); - EXPECT_CALL(*isolated_web_app_trust_checker, - IsTrusted(web_bundle_id, integrity_block)) + std::make_unique<MockIsolatedWebAppTrustChecker>(profile); + EXPECT_CALL( + *isolated_web_app_trust_checker, + IsTrusted(web_bundle_id, integrity_block, /*is_dev_mode_bundle=*/true)) .WillOnce( - [](auto web_bundle_id, - auto public_key_stack) -> IsolatedWebAppTrustChecker::Result { + [](auto web_bundle_id, auto public_key_stack, + bool is_dev_mode_bundle) -> IsolatedWebAppTrustChecker::Result { return { .status = IsolatedWebAppTrustChecker::Result::Status:: kErrorPublicKeysNotTrusted, @@ -162,7 +160,7 @@ IsolatedWebAppValidator validator(std::move(isolated_web_app_trust_checker)); base::test::TestFuture<std::optional<std::string>> future; validator.ValidateIntegrityBlock(web_bundle_id, integrity_block, - future.GetCallback()); + /*dev_mode=*/true, future.GetCallback()); EXPECT_EQ(future.Get(), "test error"); } @@ -192,8 +190,9 @@ auto web_bundle_id, web_package::SignedWebBundleId::Create(kSignedWebBundleId)); + TestingProfile profile; auto isolated_web_app_trust_checker = - std::make_unique<MockIsolatedWebAppTrustChecker>(); + std::make_unique<MockIsolatedWebAppTrustChecker>(profile); IsolatedWebAppValidator validator(std::move(isolated_web_app_trust_checker)); EXPECT_EQ(validator.ValidateMetadata(web_bundle_id, primary_url_, entries_), status_);
diff --git a/chrome/browser/web_applications/isolated_web_apps/signed_web_bundle_metadata.cc b/chrome/browser/web_applications/isolated_web_apps/signed_web_bundle_metadata.cc index 7e1158a3..6d5dd016 100644 --- a/chrome/browser/web_applications/isolated_web_apps/signed_web_bundle_metadata.cc +++ b/chrome/browser/web_applications/isolated_web_apps/signed_web_bundle_metadata.cc
@@ -48,7 +48,7 @@ helper_ = std::make_unique<IsolatedWebAppInstallCommandHelper>( url_info, provider->web_contents_manager().CreateDataRetriever(), IsolatedWebAppInstallCommandHelper::CreateDefaultResponseReaderFactory( - *profile->GetPrefs())); + *profile)); } void FetchAndReply(WebAppInstalInfoCallback callback) {
diff --git a/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.cc b/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.cc index 7ff54ca..c7abdd6f 100644 --- a/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.cc +++ b/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.cc
@@ -37,10 +37,11 @@ void FakeResponseReaderFactory::CreateResponseReader( const base::FilePath& web_bundle_path, const web_package::SignedWebBundleId& web_bundle_id, - bool skip_signature_verification, + IsolatedWebAppResponseReaderFactory::Flags flags, Callback callback) { // Signatures _must_ be verified during installation. - CHECK(!skip_signature_verification); + CHECK(!flags.Has( + IsolatedWebAppResponseReaderFactory::Flag::kSkipSignatureVerification)); if (!bundle_status_.has_value()) { std::move(callback).Run(base::unexpected(bundle_status_.error())); } else {
diff --git a/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.h b/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.h index e4ccd2a..4038512 100644 --- a/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.h +++ b/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.h
@@ -30,7 +30,7 @@ void CreateResponseReader(const base::FilePath& web_bundle_path, const web_package::SignedWebBundleId& web_bundle_id, - bool skip_signature_verification, + IsolatedWebAppResponseReaderFactory::Flags flags, Callback callback) override; private:
diff --git a/chrome/browser/web_applications/proto/web_app.proto b/chrome/browser/web_applications/proto/web_app.proto index 51186d7..ad4469ae 100644 --- a/chrome/browser/web_applications/proto/web_app.proto +++ b/chrome/browser/web_applications/proto/web_app.proto
@@ -486,4 +486,9 @@ // specifically from the `EnableLinkCapturingInfoBarDelegate`. optional int32 supported_links_offer_ignore_count = 66; optional int32 supported_links_offer_dismiss_count = 67; + + // Set to true if the app was installed via the DIY app install path by the + // user (3-dot menu, Install page as App...). DIY apps aren't promotable or + // installable, and the user can customize its name. + optional bool is_diy_app = 68; }
diff --git a/chrome/browser/web_applications/test/web_app_test_utils.cc b/chrome/browser/web_applications/test/web_app_test_utils.cc index c56fc78..4c37c938 100644 --- a/chrome/browser/web_applications/test/web_app_test_utils.cc +++ b/chrome/browser/web_applications/test/web_app_test_utils.cc
@@ -966,6 +966,8 @@ app->SetSupportedLinksOfferIgnoreCount(random.next_uint()); app->SetSupportedLinksOfferDismissCount(random.next_uint()); + + app->SetIsDiyApp(random.next_bool()); return app; }
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index ca41746..893ff27 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc
@@ -719,6 +719,10 @@ supported_links_offer_dismiss_count_ = dismiss_count; } +void WebApp::SetIsDiyApp(bool is_diy_app) { + is_diy_app_ = is_diy_app; +} + void WebApp::AddPlaceholderInfoToManagementExternalConfigMap( WebAppManagement::Type type, bool is_placeholder) { @@ -1013,7 +1017,8 @@ app.latest_install_time_, app.generated_icon_fix_, app.supported_links_offer_ignore_count_, - app.supported_links_offer_dismiss_count_ + app.supported_links_offer_dismiss_count_, + app.is_diy_app_ // clang-format on ); }; @@ -1241,6 +1246,8 @@ root.Set("supported_links_offer_dismiss_count", supported_links_offer_dismiss_count_); + root.Set("is_diy_app", is_diy_app_); + return base::Value(std::move(root)); }
diff --git a/chrome/browser/web_applications/web_app.h b/chrome/browser/web_applications/web_app.h index 3f8389e..cbcfa1c 100644 --- a/chrome/browser/web_applications/web_app.h +++ b/chrome/browser/web_applications/web_app.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ #include <stdint.h> + #include <iosfwd> #include <optional> #include <set> @@ -446,6 +447,8 @@ return supported_links_offer_dismiss_count_; } + bool is_diy_app() const { return is_diy_app_; } + // A Web App can be installed from multiple sources simultaneously. Installs // add a source to the app. Uninstalls remove a source from the app. void AddSource(WebAppManagement::Type source); @@ -550,6 +553,7 @@ proto::LinkCapturingUserPreference user_link_capturing_preference); void SetSupportedLinksOfferIgnoreCount(int ignore_count); void SetSupportedLinksOfferDismissCount(int dismiss_count); + void SetIsDiyApp(bool is_diy_app); void AddPlaceholderInfoToManagementExternalConfigMap( WebAppManagement::Type source_type, @@ -703,6 +707,8 @@ int supported_links_offer_ignore_count_ = 0; int supported_links_offer_dismiss_count_ = 0; + bool is_diy_app_ = false; + // New fields must be added to: // - |operator==| // - AsDebugValue()
diff --git a/chrome/browser/web_applications/web_app_command_scheduler.cc b/chrome/browser/web_applications/web_app_command_scheduler.cc index 6f6b5d4..3ec1b16 100644 --- a/chrome/browser/web_applications/web_app_command_scheduler.cc +++ b/chrome/browser/web_applications/web_app_command_scheduler.cc
@@ -275,7 +275,7 @@ std::make_unique<IsolatedWebAppInstallCommandHelper>( url_info, provider_->web_contents_manager().CreateDataRetriever(), IsolatedWebAppInstallCommandHelper:: - CreateDefaultResponseReaderFactory(*profile_->GetPrefs()))), + CreateDefaultResponseReaderFactory(*profile_))), call_location); } @@ -297,7 +297,7 @@ std::make_unique<IsolatedWebAppInstallCommandHelper>( url_info, provider_->web_contents_manager().CreateDataRetriever(), IsolatedWebAppInstallCommandHelper:: - CreateDefaultResponseReaderFactory(*profile_->GetPrefs()))), + CreateDefaultResponseReaderFactory(*profile_))), call_location); } @@ -318,7 +318,7 @@ std::make_unique<IsolatedWebAppInstallCommandHelper>( url_info, provider_->web_contents_manager().CreateDataRetriever(), IsolatedWebAppInstallCommandHelper:: - CreateDefaultResponseReaderFactory(*profile_->GetPrefs()))), + CreateDefaultResponseReaderFactory(*profile_))), call_location); }
diff --git a/chrome/browser/web_applications/web_app_database.cc b/chrome/browser/web_applications/web_app_database.cc index 88bd6409..7fd430f 100644 --- a/chrome/browser/web_applications/web_app_database.cc +++ b/chrome/browser/web_applications/web_app_database.cc
@@ -912,6 +912,8 @@ local_data->set_supported_links_offer_dismiss_count( web_app.supported_links_offer_dismiss_count()); + local_data->set_is_diy_app(web_app.is_diy_app()); + return local_data; } @@ -1735,6 +1737,8 @@ local_data.supported_links_offer_dismiss_count()); } + web_app->SetIsDiyApp(local_data.is_diy_app()); + return web_app; }
diff --git a/chrome/browser/web_applications/web_app_install_info.h b/chrome/browser/web_applications/web_app_install_info.h index e0b5658c..cefcf3a 100644 --- a/chrome/browser/web_applications/web_app_install_info.h +++ b/chrome/browser/web_applications/web_app_install_info.h
@@ -442,6 +442,10 @@ IconsWithSizeAny icons_with_size_any; + // A DIY app isn't installable or promotable, and the user was able to + // customize the title, etc. + bool is_diy_app = false; + private: // Used this method in Clone() method. Use Clone() to deep copy explicitly. WebAppInstallInfo(const WebAppInstallInfo& other);
diff --git a/chrome/browser/web_applications/web_app_install_utils.cc b/chrome/browser/web_applications/web_app_install_utils.cc index 1258164..dd0c7a8 100644 --- a/chrome/browser/web_applications/web_app_install_utils.cc +++ b/chrome/browser/web_applications/web_app_install_utils.cc
@@ -1256,6 +1256,8 @@ web_app.SetValidatedScopeExtensions( web_app_info.validated_scope_extensions.value()); } + + web_app.SetIsDiyApp(web_app_info.is_diy_app); } void SetWebAppProductIconFields(const WebAppInstallInfo& web_app_info,
diff --git a/chrome/browser/web_applications/web_app_registrar.cc b/chrome/browser/web_applications/web_app_registrar.cc index 1af551e..fb2b0fb2 100644 --- a/chrome/browser/web_applications/web_app_registrar.cc +++ b/chrome/browser/web_applications/web_app_registrar.cc
@@ -1211,6 +1211,14 @@ CapturesLinksInScope(app_id); } +bool WebAppRegistrar::IsDiyApp(const webapps::AppId& app_id) const { + if (!IsInstalled(app_id)) { + return false; + } + const WebApp* web_app = GetAppById(app_id); + return web_app && web_app->is_diy_app(); +} + std::string WebAppRegistrar::GetAppShortName( const webapps::AppId& app_id) const { if (base::FeatureList::IsEnabled(
diff --git a/chrome/browser/web_applications/web_app_registrar.h b/chrome/browser/web_applications/web_app_registrar.h index dcfbabe..b71c44d 100644 --- a/chrome/browser/web_applications/web_app_registrar.h +++ b/chrome/browser/web_applications/web_app_registrar.h
@@ -468,6 +468,8 @@ bool IsPreferredAppForCapturingUrl(const GURL& url, const webapps::AppId& app_id); + bool IsDiyApp(const webapps::AppId& app_id) const; + #if BUILDFLAG(IS_MAC) bool AlwaysShowToolbarInFullscreen(const webapps::AppId& app_id) const; void NotifyAlwaysShowToolbarInFullscreenChanged(const webapps::AppId& app_id,
diff --git a/chrome/browser/webauthn/enclave_manager_unittest.cc b/chrome/browser/webauthn/enclave_manager_unittest.cc index 6f579481..1cb1845 100644 --- a/chrome/browser/webauthn/enclave_manager_unittest.cc +++ b/chrome/browser/webauthn/enclave_manager_unittest.cc
@@ -39,13 +39,14 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -// The communication with the enclave process would need to be ported to Windows -// for these tests to run there. -// +#if BUILDFLAG(IS_WIN) +#include <windows.h> +#endif + // These tests are also disabled under MSAN. The enclave subprocess is written // in Rust and FFI from Rust to C++ doesn't work in Chromium at this time // (crbug.com/1369167). -#if BUILDFLAG(IS_POSIX) && !defined(MEMORY_SANITIZER) +#if !defined(MEMORY_SANITIZER) namespace enclave = device::enclave; @@ -145,8 +146,32 @@ std::optional<base::Process> enclave_process; uint16_t port; + char port_str[6]; for (int i = 0; i < 10; i++) { +#if BUILDFLAG(IS_WIN) + HANDLE read_handle; + HANDLE write_handle; + SECURITY_ATTRIBUTES security_attributes; + + security_attributes.nLength = sizeof(SECURITY_ATTRIBUTES); + security_attributes.bInheritHandle = TRUE; + security_attributes.lpSecurityDescriptor = NULL; + CHECK(CreatePipe(&read_handle, &write_handle, &security_attributes, 0)); + + subprocess_opts.stdin_handle = INVALID_HANDLE_VALUE; + subprocess_opts.stdout_handle = write_handle; + subprocess_opts.stderr_handle = INVALID_HANDLE_VALUE; + subprocess_opts.handles_to_inherit.push_back(write_handle); + enclave_process = base::LaunchProcess(base::CommandLine(enclave_bin_path), + subprocess_opts); + CloseHandle(write_handle); + CHECK(enclave_process->IsValid()); + + DWORD read_bytes; + CHECK(ReadFile(read_handle, port_str, sizeof(port_str), &read_bytes, NULL)); + CloseHandle(read_handle); +#else int fds[2]; CHECK(!pipe(fds)); subprocess_opts.fds_to_remap.emplace_back(fds[1], 1); @@ -155,15 +180,16 @@ CHECK(enclave_process->IsValid()); close(fds[1]); - char port_str[6]; const ssize_t read_bytes = HANDLE_EINTR(read(fds[0], port_str, sizeof(port_str))); + close(fds[0]); +#endif + CHECK(read_bytes > 0); port_str[read_bytes - 1] = 0; unsigned u_port; CHECK(base::StringToUint(port_str, &u_port)) << port_str; port = base::checked_cast<uint16_t>(u_port); - close(fds[0]); if (net::IsPortAllowedForScheme(port, "wss")) { break;
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 438c7ad0..b2513ad1e 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1709207912-7657b6347af15f9094a355c314afc6ece90ae5f4-2d819bfbac4fb4878136cb51604920b8d923177b.profdata +chrome-android32-main-1709229418-1d63095880705d541bde82fa1879afffe3b9eb1d-b0a7a7040e49ebde707133bb7b28d1df2acbe3f5.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 0c2e970..3eabcec 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1709214844-c8f63fd4c0225c6b7763dffeb66b232d30b96cc2-f770766245540322b0f30da0036c4d4a40104ea3.profdata +chrome-mac-arm-main-1709236759-a0e0102010e726c3ec9aa26f7a40a2917c462929-cb4b55eca6f33658d7073a2cc65fe5357f6b9ffb.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 5b7fe93..30e459e 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1709186356-ba3ade54f201b6cf0664673d73b9426259a14b77-248b5659e1d1fbb9b258b554b81f1fd00f330fb2.profdata +chrome-mac-main-1709229418-705274331d29f367c0fc74527d8e650dde99c159-b0a7a7040e49ebde707133bb7b28d1df2acbe3f5.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index fbebfdfa..b89400b 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1709207912-5ecdf22b3ee625cf221e95f8f02c1197d1b3c9a9-2d819bfbac4fb4878136cb51604920b8d923177b.profdata +chrome-win-arm64-main-1709229418-e645b1867e6096f5b77ee9acbd5e6bca83117273-b0a7a7040e49ebde707133bb7b28d1df2acbe3f5.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index dc938ee..47a1cc5 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1709207912-19b2775028446b2fc6f33db59efb166ee0b4d5b1-2d819bfbac4fb4878136cb51604920b8d923177b.profdata +chrome-win32-main-1709218648-e2b52b52f25d190f3daa56cd2651973155f54f21-e8dfc1f2e3fadb8df821082483dd7e98f14dd2e9.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index e3cff11..49525b9 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1709207912-09c7cef41a091e6a84d026f8ff8e4c5cba63a822-2d819bfbac4fb4878136cb51604920b8d923177b.profdata +chrome-win64-main-1709218648-0864b8c6975aadc135a9a765319061552d647627-e8dfc1f2e3fadb8df821082483dd7e98f14dd2e9.profdata
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index 0c09153..1ae80080 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn
@@ -115,7 +115,7 @@ group("common") { public_deps = [ ":common_lib" ] if (is_win) { - public_deps += [ "//chrome/common/win:delay_load_failure_hook" ] + public_deps += [ "//chrome/common/win:delay_load_hooks" ] } }
diff --git a/chrome/common/win/BUILD.gn b/chrome/common/win/BUILD.gn index ade59c4..9dc7379 100644 --- a/chrome/common/win/BUILD.gn +++ b/chrome/common/win/BUILD.gn
@@ -45,8 +45,12 @@ # The delay load hook must be a source_set to ensure that it has external # linkage and will correctly emplace over the correct symbols in delayimp.lib at # link time. -source_set("delay_load_failure_hook") { - sources = [ "delay_load_failure_hook.cc" ] +source_set("delay_load_hooks") { + sources = [ + "delay_load_failure_hook.cc", + "delay_load_notify_hook.cc", + "delay_load_notify_hook.h", + ] configs += [ "//build/config/compiler:wexit_time_destructors" ] deps = [ ":delay_load_failure_support",
diff --git a/chrome/common/win/delay_load_notify_hook.cc b/chrome/common/win/delay_load_notify_hook.cc new file mode 100644 index 0000000..c720bebd --- /dev/null +++ b/chrome/common/win/delay_load_notify_hook.cc
@@ -0,0 +1,42 @@ +// 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/common/win/delay_load_notify_hook.h" + +#include <atomic> + +namespace chrome { + +namespace { + +std::atomic<DelayLoadCallbackFunction> g_delay_load_callback_function(nullptr); + +// This function is a delay load notification hook. It is invoked by the +// delay load support in the visual studio runtime. Override the behavior +// using |SetDelayLoadHookCallback|. More details on usage in +// delay_load_notify_hook.h +FARPROC WINAPI DelayLoadNotifyHook(unsigned dliNotify, PDelayLoadInfo pdli) { + DelayLoadCallbackFunction callback = + g_delay_load_callback_function.load(std::memory_order_acquire); + if (!callback) { + return 0; + } + return callback(dliNotify, pdli); +} + +} // namespace + +void SetDelayLoadHookCallback(DelayLoadCallbackFunction callback_function) { + g_delay_load_callback_function = callback_function; +} + +} // namespace chrome + +// Set the delay load hook to the function above. +// +// |__pfnDliNotifyHook2| gets called automatically by delay load runtime +// at several points throughout delay loading, providing application the +// ability to modify delayload behavior. See +// https://learn.microsoft.com/en-us/cpp/build/reference/understanding-the-helper-function +extern "C" const PfnDliHook __pfnDliNotifyHook2 = chrome::DelayLoadNotifyHook;
diff --git a/chrome/common/win/delay_load_notify_hook.h b/chrome/common/win/delay_load_notify_hook.h new file mode 100644 index 0000000..373b806 --- /dev/null +++ b/chrome/common/win/delay_load_notify_hook.h
@@ -0,0 +1,42 @@ +// 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 CHROME_COMMON_WIN_DELAY_LOAD_NOTIFY_HOOK_H_ +#define CHROME_COMMON_WIN_DELAY_LOAD_NOTIFY_HOOK_H_ + +// windows.h needs to be included before delayimp.h. +#include <windows.h> + +#include <delayimp.h> + +namespace chrome { + +// See the following reference for sample delayload hook function: +// https://learn.microsoft.com/en-us/cpp/build/reference/understanding-the-helper-function +// The delayload hook function allows us to modify and monitor the behavior of +// delayload resolution for delay loads from our module. Note that the +// callback function is module-specific and only resolves delayloaded imports +// from the module in which it is set, not imports from other modules and also +// not from calls to LoadLibrary(Ex). In other words, different modules may +// have their own delayload hook with unique delayload resolution logic. +// For example, chrome.exe and chrome.dll have their own global callback +// pointers that are completely separate from each other and have to be +// initialized separately. +// +// |delay_load_event| is |dliNotify| on MSDN and |delay_load_info| is |pdli|. +// Return nullptr (0) for the default behavior. Depending on the event type +// override the behavior by returning an HMODULE or function pointer to +// provide an alternate implementation for a delay load. +typedef FARPROC (*DelayLoadCallbackFunction)(unsigned delay_load_event, + DelayLoadInfo* delay_load_info); + +// Set a specific delayload hook at runtime. Note that this callback cannot +// resolve functions that have already been resolved by delayload runtime, so it +// would be practical to set it during early process startup. nullptr can be +// passed to clear the callback, which is used in tests. +void SetDelayLoadHookCallback(DelayLoadCallbackFunction callback_function); + +} // namespace chrome + +#endif // CHROME_COMMON_WIN_DELAY_LOAD_NOTIFY_HOOK_H_
diff --git a/chrome/common/win/delay_load_notify_hook_unittest.cc b/chrome/common/win/delay_load_notify_hook_unittest.cc new file mode 100644 index 0000000..48ec170 --- /dev/null +++ b/chrome/common/win/delay_load_notify_hook_unittest.cc
@@ -0,0 +1,45 @@ +// 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/common/win/delay_load_notify_hook.h" + +#include "base/functional/bind.h" +#include "base/functional/callback_helpers.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace { + +constexpr char kTestDll[] = "test.dll"; +constexpr char kDummyFunction[] = "test.dll"; + +void WINAPI DummyFunction() {} + +FARPROC TestDelayLoadCallbackFunction(unsigned delay_load_event, + DelayLoadInfo* delay_load_info) { + if (delay_load_event == dliNotePreGetProcAddress && + strcmp(delay_load_info->szDll, kTestDll) == 0 && + strcmp(delay_load_info->dlp.szProcName, kDummyFunction) == 0) { + return reinterpret_cast<FARPROC>(DummyFunction); + } + return nullptr; +} + +} // namespace + +// This test verifies that delay load hooks are correctly in place for the +// current module, which is unit_tests.exe in the case of this test. +TEST(ChromeDelayLoadNotifyHookTest, HooksAreSetAtLinkTime) { + ASSERT_NE(__pfnDliNotifyHook2, nullptr); +} + +// This test verifies a typical usage of SetDelayLoadHookCallback +TEST(ChromeDelayLoadNotifyHookTest, OverrideDliNotifyHook) { + DelayLoadInfo dli = {.szDll = kTestDll}; + dli.dlp.szProcName = kDummyFunction; + base::ScopedClosureRunner reset_callback( + base::BindOnce(&chrome::SetDelayLoadHookCallback, nullptr)); + chrome::SetDelayLoadHookCallback(&TestDelayLoadCallbackFunction); + EXPECT_EQ(__pfnDliNotifyHook2(dliNotePreGetProcAddress, &dli), + reinterpret_cast<FARPROC>(DummyFunction)); +}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index d5ea605..0e038a6 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -7153,6 +7153,7 @@ "../common/conflicts/module_watcher_win_unittest.cc", "../common/conflicts/remote_module_watcher_win_unittest.cc", "../common/win/delay_load_failure_hook_unittest.cc", + "../common/win/delay_load_notify_hook_unittest.cc", ] data += [ "$root_out_dir/chrome.exe" ]
diff --git a/chrome/test/data/web_apps/empty_web_app.json b/chrome/test/data/web_apps/empty_web_app.json index eac7e01..0e4f6f2c 100644 --- a/chrome/test/data/web_apps/empty_web_app.json +++ b/chrome/test/data/web_apps/empty_web_app.json
@@ -27,6 +27,7 @@ "file_handlers": [ ], "first_install_time": "1601-01-01 00:00:00.000000 UTC", "generated_icon_fix": null, + "is_diy_app": false, "is_from_sync_and_pending_installation": false, "is_generated_icon": false, "is_locally_installed": false,
diff --git a/chrome/test/data/web_apps/sample_web_app.json b/chrome/test/data/web_apps/sample_web_app.json index 7b411c5..d32992ba 100644 --- a/chrome/test/data/web_apps/sample_web_app.json +++ b/chrome/test/data/web_apps/sample_web_app.json
@@ -169,6 +169,7 @@ "source": "Retroactive", "window_start_time": "1970-01-27 13:51:34.772000 UTC" }, + "is_diy_app": true, "is_from_sync_and_pending_installation": true, "is_generated_icon": true, "is_locally_installed": true,
diff --git a/chrome/test/data/webui/chromeos/personalization_app/sea_pen_recent_wallpapers_element_test.ts b/chrome/test/data/webui/chromeos/personalization_app/sea_pen_recent_wallpapers_element_test.ts index bee4711..49db5e3 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/sea_pen_recent_wallpapers_element_test.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/sea_pen_recent_wallpapers_element_test.ts
@@ -250,10 +250,12 @@ recentImageData: { 111: { url: {url: 'data:image/jpeg;base64,image111data'}, - queryInfo: 'query 1', + imageInfo: null, }, - 222: {url: {url: ''}, queryInfo: 'query 2'}, - 333: {url: {url: ''}, queryInfo: 'query 3'}, + 222: { + url: {url: ''}, + imageInfo: seaPenProvider.recentImageInfo2, + }, }, loading: { recentImageData: { @@ -316,11 +318,23 @@ }); }); - // TODO(b/318418911) re-enable this test. - test.skip( + test( 'select Wallpaper Info option for recent image', async () => { personalizationStore.data.wallpaper.seaPen.recentImages = seaPenProvider.recentImageIds; + personalizationStore.data.wallpaper.seaPen.recentImageData = + seaPenProvider.recentImageData; + personalizationStore.data.wallpaper.seaPen.loading = { + recentImageData: { + 111: false, + 222: false, + 333: false, + }, + recentImages: false, + thumbnails: false, + currentSelected: false, + setImage: 0, + }; // Initialize |seaPenRecentWallpapersElement|. seaPenRecentWallpapersElement = @@ -348,18 +362,21 @@ assertEquals( 3, actionMenus!.length, 'should be 3 action menus available.'); - // Menu dialog 2 should be opened. + // Menu dialog for the 3rd image should be opened. const actionMenu2 = actionMenus[2] as HTMLElement; - const menuDialog = actionMenu2.shadowRoot!.querySelector('dialog') as + const menuDialog2 = actionMenu2.shadowRoot!.querySelector('dialog') as HTMLDialogElement; - assertTrue(!!menuDialog!.open, `menu dialog 2 should be opened.`); + assertTrue( + !!menuDialog2!.open, + `menu dialog for the 3rd image should be opened.`); // Wallpaper Info menu option is available. Click on this option. - const wallpaperInfoOption = - actionMenu2.querySelector('.wallpaper-info-option') as HTMLElement; + const wallpaperInfoOption2 = + actionMenu2.querySelector<HTMLElement>('.wallpaper-info-option'); assertTrue( - !!wallpaperInfoOption, 'Wallpaper Info option should display.'); - wallpaperInfoOption!.click(); + !!wallpaperInfoOption2, + 'Wallpaper Info option for the 3rd image should display.'); + wallpaperInfoOption2!.click(); await waitAfterNextRender(seaPenRecentWallpapersElement); @@ -371,9 +388,27 @@ !!wallpaperInfoDialog, 'Wallpaper Info dialog should display.'); assertEquals('2', wallpaperInfoDialog.dataset['id']); + const aboutQueryDesc = wallpaperInfoDialog.querySelector<HTMLElement>( + '.about-prompt-info'); + assertTrue( + !!aboutQueryDesc, + 'Wallpaper Info dialog should include visible user query info'); + assertTrue( + aboutQueryDesc.innerText.includes('test template query'), + 'user visible query for 3rd image should display'); + + const creationTimeDesc = + wallpaperInfoDialog.querySelector<HTMLElement>('.about-date-info'); + assertTrue( + !!creationTimeDesc, + 'Wallpaper Info dialog should include creation time info'); + assertTrue( + creationTimeDesc.innerText.includes('Dec 31, 2023'), + 'creation time for 3rd image should display'); + // Click on 'Close' button to close the dialog. - const closeButton = wallpaperInfoDialog.querySelector( - '#wallpaperInfoCloseButton') as HTMLElement; + const closeButton = wallpaperInfoDialog.querySelector<HTMLElement>( + '#wallpaperInfoCloseButton'); assertTrue( !!closeButton, 'close button for Wallpaper Info dialog should display.'); @@ -385,6 +420,26 @@ seaPenRecentWallpapersElement.shadowRoot!.getElementById( 'wallpaperInfoDialog'), 'no Wallpaper Info dialog after close button clicked'); + + // Click on the menu icon button on the first image to open its menu + // options. + (menuIconButtons[0] as HTMLElement)!.click(); + + // Menu dialog for the 1st image should be opened. + const actionMenu0 = actionMenus[0] as HTMLElement; + const menuDialog0 = + actionMenu0.shadowRoot!.querySelector<HTMLDialogElement>('dialog'); + assertTrue( + !!menuDialog0!.open, + `menu dialog for the 1st image should be opened.`); + + // Wallpaper Info menu option is not available as SeaPenRecentData has + // no imageInfo. + const wallpaperInfoOption0 = + actionMenu0.querySelector('.wallpaper-info-option'); + assertFalse( + !!wallpaperInfoOption0, + 'Wallpaper Info option for the 1st image should not display.'); }); test('deletes a recent Sea Pen image', async () => {
diff --git a/chrome/test/data/webui/chromeos/personalization_app/test_sea_pen_interface_provider.ts b/chrome/test/data/webui/chromeos/personalization_app/test_sea_pen_interface_provider.ts index af8b0f62..b2afb017 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/test_sea_pen_interface_provider.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/test_sea_pen_interface_provider.ts
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {RecentSeaPenData} from 'chrome://personalization/js/personalization_app.js'; import {SeaPenImageId} from 'chrome://resources/ash/common/sea_pen/constants.js'; -import {MantaStatusCode, SeaPenFeedbackMetadata, SeaPenProviderInterface, SeaPenQuery, SeaPenThumbnail} from 'chrome://resources/ash/common/sea_pen/sea_pen.mojom-webui.js'; +import {MantaStatusCode, RecentSeaPenImageInfo, RecentSeaPenThumbnailData, SeaPenFeedbackMetadata, SeaPenProviderInterface, SeaPenQuery, SeaPenThumbnail} from 'chrome://resources/ash/common/sea_pen/sea_pen.mojom-webui.js'; import {isSeaPenImageId} from 'chrome://resources/ash/common/sea_pen/sea_pen_utils.js'; +import {stringToMojoString16} from 'chrome://resources/js/mojo_type_util.js'; import {assertTrue} from 'chrome://webui-test/chai_assert.js'; import {TestBrowserProxy} from 'chrome://webui-test/test_browser_proxy.js'; @@ -36,18 +36,34 @@ 333, ]; - recentImageData: Record<SeaPenImageId, RecentSeaPenData> = { + recentImageInfo2: RecentSeaPenImageInfo = { + userVisibleQuery: { + text: 'test freeform query', + templateTitle: '', + }, + creationTime: stringToMojoString16('Dec 15, 2023'), + }; + + recentImageInfo3: RecentSeaPenImageInfo = { + userVisibleQuery: { + text: 'test template query', + templateTitle: 'test template title', + }, + creationTime: stringToMojoString16('Dec 31, 2023'), + }; + + recentImageData: Record<string, RecentSeaPenThumbnailData|null> = { 111: { url: {url: 'data:image/jpeg;base64,image111data'}, - queryInfo: 'query 1', + imageInfo: null, }, 222: { url: {url: 'data:image/jpeg;base64,image222data'}, - queryInfo: 'query 2', + imageInfo: this.recentImageInfo2, }, 333: { url: {url: 'data:image/jpeg;base64,image333data'}, - queryInfo: 'query 3', + imageInfo: this.recentImageInfo3, }, }; @@ -101,7 +117,9 @@ assertTrue( isSeaPenImageId(id), `id must be SeaPenImageId but received: ${id}`); this.methodCalled('getRecentSeaPenImageThumbnail', id); - return Promise.resolve({url: this.recentImageData[id]!.url}); + return Promise.resolve({ + thumbnailData: this.recentImageData[id]!, + }); } deleteRecentSeaPenImage(id: SeaPenImageId) {
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/BUILD.gn b/chrome/test/data/webui/chromeos/print_preview_cros/BUILD.gn index 68e59f6b..621bba8b 100644 --- a/chrome/test/data/webui/chromeos/print_preview_cros/BUILD.gn +++ b/chrome/test/data/webui/chromeos/print_preview_cros/BUILD.gn
@@ -26,6 +26,7 @@ "//ash/webui/common/resources:build_ts", "//ash/webui/print_preview_cros/resources:build_ts", "//chrome/test/data/webui/chromeos:build_ts", + "//third_party/cros-components:cros_components_ts", "//third_party/polymer/v3_0:library", "//ui/webui/resources/js:build_ts", "//ui/webui/resources/mojo:build_ts",
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/fake_print_preview_page_handler_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/fake_print_preview_page_handler_test.ts index f9eaad48..323010b 100644 --- a/chrome/test/data/webui/chromeos/print_preview_cros/fake_print_preview_page_handler_test.ts +++ b/chrome/test/data/webui/chromeos/print_preview_cros/fake_print_preview_page_handler_test.ts
@@ -19,6 +19,7 @@ // Verify initial call count for tracked methods is zero. test('call count zero', () => { assertEquals(0, printPreviewPageHandler.getCallCount('print')); + assertEquals(0, printPreviewPageHandler.getCallCount('cancel')); }); // Verify the fake PrintPreviewPageHandler returns a successful response by @@ -38,4 +39,11 @@ const result = await printPreviewPageHandler.print(); assertEquals(FAKE_PRINT_REQUEST_FAILURE_INVALID_SETTINGS_ERROR, result); }); + + // Verify the fake PrintPreviewPageHandler cancel increases counter. + test('cancel print preview can be sent', async () => { + assertEquals(0, printPreviewPageHandler.getCallCount('cancel')); + printPreviewPageHandler.cancel(); + assertEquals(1, printPreviewPageHandler.getCallCount('cancel')); + }); });
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/print_ticket_manager_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/print_ticket_manager_test.ts index 95a0d40..30d866d 100644 --- a/chrome/test/data/webui/chromeos/print_preview_cros/print_ticket_manager_test.ts +++ b/chrome/test/data/webui/chromeos/print_preview_cros/print_ticket_manager_test.ts
@@ -40,4 +40,13 @@ instance.sendPrintRequest(); assertEquals(1, printPreviewPageHandler.getCallCount('print')); }); + + // Verify PrintPreviewPageHandler called when cancelPrintRequest triggered. + test('sendPrintRequest calls PrintPreviewPageHandler.print', () => { + const instance = PrintTicketManager.getInstance(); + const method = 'cancel'; + assertEquals(0, printPreviewPageHandler.getCallCount(method)); + instance.cancelPrintRequest(); + assertEquals(1, printPreviewPageHandler.getCallCount(method)); + }); });
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/summary_panel_controller_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/summary_panel_controller_test.ts index 4738b39..d7e1bfb4 100644 --- a/chrome/test/data/webui/chromeos/print_preview_cros/summary_panel_controller_test.ts +++ b/chrome/test/data/webui/chromeos/print_preview_cros/summary_panel_controller_test.ts
@@ -55,4 +55,16 @@ controller!.handlePrintClicked(); mockController.verifyMocks(); }); + + // Verify cancelPrintRequest calls PrintTicketManager. + test( + 'calls PrintTicketManager.cancelPrintRequest from handleCancelClicked', + () => { + const manager = PrintTicketManager.getInstance(); + const cancelPrintRequestFn = + mockController.createFunctionMock(manager, 'cancelPrintRequest'); + cancelPrintRequestFn.addExpectation(); + controller!.handleCancelClicked(); + mockController.verifyMocks(); + }); });
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/summary_panel_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/summary_panel_test.ts index 85f9ede4..68f8dec 100644 --- a/chrome/test/data/webui/chromeos/print_preview_cros/summary_panel_test.ts +++ b/chrome/test/data/webui/chromeos/print_preview_cros/summary_panel_test.ts
@@ -7,19 +7,25 @@ import {SummaryPanelElement} from 'chrome://os-print/js/summary_panel.js'; import {SHEETS_USED_CHANGED_EVENT, SummaryPanelController} from 'chrome://os-print/js/summary_panel_controller.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js'; +import {Button} from 'chrome://resources/cros_components/button/button.js'; import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; +import {MockController} from 'chrome://webui-test/chromeos/mock_controller.m.js'; import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; import {eventToPromise, isChildVisible, isVisible} from 'chrome://webui-test/test_util.js'; suite('SummaryPanel', () => { const sheetsUsedSelector = '#sheetsUsed'; + const printButtonSelector = '#print'; + const cancelButtonSelector = '#cancel'; let element: SummaryPanelElement|null = null; let controller: SummaryPanelController|null = null; + let mockController: MockController|null = null; setup(async () => { document.body.innerHTML = window.trustedTypes!.emptyHTML; + mockController = new MockController(); element = document.createElement(SummaryPanelElement.is) as SummaryPanelElement; assertTrue(!!element); @@ -40,6 +46,8 @@ } element = null; controller = null; + mockController?.reset(); + mockController = null; }); // Sets sheets used in controller and wait for UI to update. @@ -58,11 +66,9 @@ assert(element); assertTrue(isVisible(element)); - const cancelButtonSelector = '#cancel'; assertTrue( isChildVisible(element, cancelButtonSelector), `Should display ${cancelButtonSelector}`); - const printButtonSelector = '#print'; assertTrue( isChildVisible(element, printButtonSelector), `Should display ${printButtonSelector}`); @@ -108,4 +114,40 @@ `${SummaryPanelElement.is} controller text should match ${ expectedUpdatedText}`); }); + + // Verify print button calls controller.handlePrintClicked functionality. + test('click print triggers PrintPreviewPageHandler', async () => { + assert(mockController); + const handlePrintClickedMock = + mockController.createFunctionMock(controller!, 'handlePrintClicked'); + handlePrintClickedMock.addExpectation(); + + // Click print button. + const printButton = + strictQuery<Button>(printButtonSelector, element!.shadowRoot, Button); + const printButtonEvent = eventToPromise('click', printButton); + printButton.click(); + await printButtonEvent; + + // Verify controller is listening to click event. + mockController.verifyMocks(); + }); + + // Verify cancel button calls controller.handleCancelClicked functionality. + test('click cancel triggers PrintPreviewPageHandler', async () => { + assert(mockController); + const handleCancelClickedMock = + mockController.createFunctionMock(controller!, 'handleCancelClicked'); + handleCancelClickedMock.addExpectation(); + + // Click print button. + const cancelButton = + strictQuery<Button>(cancelButtonSelector, element!.shadowRoot, Button); + const cancelButtonEvent = eventToPromise('click', cancelButton); + cancelButton.click(); + await cancelButtonEvent; + + // Verify controller is listening to click event. + mockController.verifyMocks(); + }); });
diff --git a/chrome/test/data/webui/cr_components/certificate_manager_test.ts b/chrome/test/data/webui/cr_components/certificate_manager_test.ts index e963be9..093dc21 100644 --- a/chrome/test/data/webui/cr_components/certificate_manager_test.ts +++ b/chrome/test/data/webui/cr_components/certificate_manager_test.ts
@@ -621,36 +621,36 @@ */ test('Initialization', async function() { // Trigger all category tabs to be added to the DOM. - const paperTabsElement = page.shadowRoot!.querySelector('cr-tabs'); - assertTrue(!!paperTabsElement); - paperTabsElement.selected = CertificateCategoryIndex.PERSONAL; - flush(); - paperTabsElement.selected = CertificateCategoryIndex.SERVER; - flush(); - paperTabsElement.selected = CertificateCategoryIndex.CA; - flush(); - paperTabsElement.selected = CertificateCategoryIndex.OTHER; - flush(); + const crTabsElement = page.shadowRoot!.querySelector('cr-tabs'); + assertTrue(!!crTabsElement); + crTabsElement.selected = CertificateCategoryIndex.PERSONAL; + await crTabsElement.updateComplete; + crTabsElement.selected = CertificateCategoryIndex.SERVER; + await crTabsElement.updateComplete; + crTabsElement.selected = CertificateCategoryIndex.CA; + await crTabsElement.updateComplete; + crTabsElement.selected = CertificateCategoryIndex.OTHER; + await crTabsElement.updateComplete; const certificateLists = page.shadowRoot!.querySelectorAll('certificate-list'); assertEquals(4, certificateLists.length); - function assertCertificateListLength( + async function assertCertificateListLength( listIndex: CertificateCategoryIndex, expectedSize: number) { // Need to switch to the corresponding tab before querying the DOM. - assertTrue(!!paperTabsElement); - paperTabsElement.selected = listIndex; - flush(); + assertTrue(!!crTabsElement); + crTabsElement.selected = listIndex; + await crTabsElement.updateComplete; const certificateEntries = certificateLists[listIndex]!.shadowRoot!.querySelectorAll( 'certificate-entry'); assertEquals(expectedSize, certificateEntries.length); } - assertCertificateListLength(CertificateCategoryIndex.PERSONAL, 0); - assertCertificateListLength(CertificateCategoryIndex.SERVER, 0); - assertCertificateListLength(CertificateCategoryIndex.CA, 0); - assertCertificateListLength(CertificateCategoryIndex.OTHER, 0); + await assertCertificateListLength(CertificateCategoryIndex.PERSONAL, 0); + await assertCertificateListLength(CertificateCategoryIndex.SERVER, 0); + await assertCertificateListLength(CertificateCategoryIndex.CA, 0); + await assertCertificateListLength(CertificateCategoryIndex.OTHER, 0); await browserProxy.whenCalled('refreshCertificates'); // Simulate response for personal and CA certificates. @@ -735,14 +735,19 @@ }); // <if expr="chromeos_ash"> + + async function renderTabContents() { + const crTabs = page.shadowRoot!.querySelector('cr-tabs'); + assertTrue(!!crTabs); + crTabs.selected = CertificateCategoryIndex.PERSONAL; + await crTabs.updateComplete; + crTabs.selected = CertificateCategoryIndex.CA; + await crTabs.updateComplete; + } + // Test that import buttons are hidden by default. - test('ImportButton_Default', function() { - const paperTabsElement = page.shadowRoot!.querySelector('cr-tabs'); - assertTrue(!!paperTabsElement); - paperTabsElement.selected = CertificateCategoryIndex.PERSONAL; - flush(); - paperTabsElement.selected = CertificateCategoryIndex.CA; - flush(); + test('ImportButton_Default', async function() { + await renderTabContents(); const certificateLists = page.shadowRoot!.querySelectorAll('certificate-list'); const clientImportButton = certificateLists[0]!.$.import; @@ -756,12 +761,7 @@ // Test that ClientCertificateManagementAllowed policy is applied to the // UI when management is allowed. test('ImportButton_ClientPolicyAllowed', async function() { - const paperTabsElement = page.shadowRoot!.querySelector('cr-tabs'); - assertTrue(!!paperTabsElement); - paperTabsElement.selected = CertificateCategoryIndex.PERSONAL; - flush(); - paperTabsElement.selected = CertificateCategoryIndex.CA; - flush(); + await renderTabContents(); const certificateLists = page.shadowRoot!.querySelectorAll('certificate-list'); @@ -783,12 +783,7 @@ // Test that ClientCertificateManagementAllowed policy is applied to the // UI when management is not allowed. test('ImportButton_ClientPolicyDisallowed', async function() { - const paperTabsElement = page.shadowRoot!.querySelector('cr-tabs'); - assertTrue(!!paperTabsElement); - paperTabsElement.selected = CertificateCategoryIndex.PERSONAL; - flush(); - paperTabsElement.selected = CertificateCategoryIndex.CA; - flush(); + await renderTabContents(); const certificateLists = page.shadowRoot!.querySelectorAll('certificate-list'); @@ -810,12 +805,7 @@ // Test that CACertificateManagementAllowed policy is applied to the // UI when management is allowed. test('ImportButton_CAPolicyAllowed', async function() { - const paperTabsElement = page.shadowRoot!.querySelector('cr-tabs'); - assertTrue(!!paperTabsElement); - paperTabsElement.selected = CertificateCategoryIndex.PERSONAL; - flush(); - paperTabsElement.selected = CertificateCategoryIndex.CA; - flush(); + await renderTabContents(); const certificateLists = page.shadowRoot!.querySelectorAll('certificate-list'); @@ -836,12 +826,7 @@ // Test that CACertificateManagementAllowed policy is applied to the // UI when management is not allowed. test('ImportButton_CAPolicyDisallowed', async function() { - const paperTabsElement = page.shadowRoot!.querySelector('cr-tabs'); - assertTrue(!!paperTabsElement); - paperTabsElement.selected = CertificateCategoryIndex.PERSONAL; - flush(); - paperTabsElement.selected = CertificateCategoryIndex.CA; - flush(); + await renderTabContents(); const certificateLists = page.shadowRoot!.querySelectorAll('certificate-list');
diff --git a/chrome/test/data/webui/cr_components/chromeos/network/apn_selection_dialog_test.js b/chrome/test/data/webui/cr_components/chromeos/network/apn_selection_dialog_test.js index 126da58..86a78f98 100644 --- a/chrome/test/data/webui/cr_components/chromeos/network/apn_selection_dialog_test.js +++ b/chrome/test/data/webui/cr_components/chromeos/network/apn_selection_dialog_test.js
@@ -51,6 +51,34 @@ const dialog = apnSelectionDialog.shadowRoot.querySelector('cr-dialog'); assertTrue(!!dialog); assertTrue(dialog.open); + const apnSelectionDialogTitle = + apnSelectionDialog.shadowRoot.querySelector('#apnSelectionDialogTitle'); + assertTrue(!!apnSelectionDialogTitle); + assertEquals( + apnSelectionDialog.i18n('apnSelectionDialogTitle'), + apnSelectionDialogTitle.innerText); + + const apnSelectionDialogDescription = + apnSelectionDialog.shadowRoot.querySelector( + '#apnSelectionDialogDescription'); + assertTrue(!!apnSelectionDialogDescription); + assertEquals( + apnSelectionDialog.i18n('apnSelectionDialogDescription'), + apnSelectionDialogDescription.innerText); + + const apnSelectionActionBtn = + apnSelectionDialog.shadowRoot.querySelector('#apnSelectionActionBtn'); + assertTrue(!!apnSelectionActionBtn); + assertEquals( + apnSelectionDialog.i18n('apnSelectionDialogUseApn'), + apnSelectionActionBtn.innerText); + + const apnSelectionCancelBtn = + apnSelectionDialog.shadowRoot.querySelector('#apnSelectionCancelBtn'); + assertTrue(!!apnSelectionCancelBtn); + assertEquals( + apnSelectionDialog.i18n('apnDetailDialogCancel'), + apnSelectionCancelBtn.innerText); }); test('No apnList', () => {
diff --git a/chrome/test/data/webui/cr_elements/cr_tabs_test.ts b/chrome/test/data/webui/cr_elements/cr_tabs_test.ts index d637e767..d91e993 100644 --- a/chrome/test/data/webui/cr_elements/cr_tabs_test.ts +++ b/chrome/test/data/webui/cr_elements/cr_tabs_test.ts
@@ -9,7 +9,6 @@ import {keyDownOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; import {assertEquals, assertNotEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; -import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; // clang-format on suite('cr_tabs_test', function() { @@ -21,7 +20,6 @@ tabs.tabNames = ['tab1', 'tab2', 'tab3']; tabs.tabIcons = ['chrome://icon1.png']; document.body.appendChild(tabs); - return flushTasks(); }); function getTabElement(index: number): HTMLElement { @@ -31,6 +29,7 @@ async function checkUiChange( uiChange: Function, initialSelection: number, expectedSelection: number) { tabs.selected = initialSelection; + await tabs.updateComplete; if (initialSelection === expectedSelection) { uiChange(); } else { @@ -38,6 +37,10 @@ uiChange(); await wait; } + // Wait for updateComplete here, to allow any errors in the update cycle to + // surface (required for the 'initial tab out of bound' test to properly + // fail if errors occur in the update cycle). + await tabs.updateComplete; assertEquals(expectedSelection, tabs.selected); const tabElement = getTabElement(expectedSelection); assertTrue(!!tabElement); @@ -64,17 +67,21 @@ expectedSelection); } - test('check CSS classes, aria-selected and tabindex for a tab', () => { + test('check CSS classes, aria-selected and tabindex for a tab', async () => { const tab = getTabElement(0); assertEquals(1, tab.classList.length); assertEquals('false', tab.getAttribute('aria-selected')); assertEquals('-1', tab.getAttribute('tabindex')); + tabs.selected = 0; + await tabs.updateComplete; assertEquals(2, tab.classList.length); assertTrue(tab.classList.contains('selected')); assertEquals('true', tab.getAttribute('aria-selected')); assertEquals('0', tab.getAttribute('tabindex')); + tabs.selected = 1; + await tabs.updateComplete; assertEquals(1, tab.classList.length); assertEquals('false', tab.getAttribute('aria-selected')); assertEquals('-1', tab.getAttribute('tabindex'));
diff --git a/chrome/test/data/webui/extensions/activity_log_test.ts b/chrome/test/data/webui/extensions/activity_log_test.ts index 32b9aa7..11d8bbf0 100644 --- a/chrome/test/data/webui/extensions/activity_log_test.ts +++ b/chrome/test/data/webui/extensions/activity_log_test.ts
@@ -116,8 +116,8 @@ boundTestVisible('activity-log-history', true); // Navigate to the activity log stream. - activityLog.shadowRoot!.querySelector('cr-tabs')!.selected = 1; - flush(); + activityLog.$.tabs.selected = 1; + await activityLog.$.tabs.updateComplete; // One activity is recorded and should appear in the stream. proxyDelegate.getOnExtensionActivity().callListeners(activity1); @@ -127,7 +127,7 @@ assertEquals(1, getStreamItems().length); // Navigate back to the activity log history tab. - activityLog.shadowRoot!.querySelector('cr-tabs')!.selected = 0; + activityLog.$.tabs.selected = 0; // Expect a refresh of the activity log. await proxyDelegate.whenCalled('getExtensionActivityLog'); @@ -138,8 +138,8 @@ // the stream is inactive. proxyDelegate.getOnExtensionActivity().callListeners(activity1); - activityLog.shadowRoot!.querySelector('cr-tabs')!.selected = 1; - flush(); + activityLog.$.tabs.selected = 1; + await activityLog.$.tabs.updateComplete; // The one activity in the stream should have persisted between tab // switches.
diff --git a/chrome/test/data/webui/history/history_metrics_test.ts b/chrome/test/data/webui/history/history_metrics_test.ts index 6925ebe..691c17d 100644 --- a/chrome/test/data/webui/history/history_metrics_test.ts +++ b/chrome/test/data/webui/history/history_metrics_test.ts
@@ -8,7 +8,6 @@ import type {HistoryAppElement, HistoryEntry} from 'chrome://history/history.js'; import {BrowserServiceImpl, ensureLazyLoaded, HistoryPageViewHistogram, SYNCED_TABS_HISTOGRAM_NAME, SyncedTabsHistogram} from 'chrome://history/history.js'; import {webUIListenerCallback} from 'chrome://resources/js/cr.js'; -import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {flushTasks, waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js'; @@ -24,9 +23,6 @@ suiteSetup(function() { disableLinkClicks(); - loadTimeData.overrideValues({ - renameJourneys: false, - }); }); setup(async () => { @@ -227,7 +223,7 @@ test('history-clusters-duration', async () => { await finishSetup([]); - navigateTo('/journeys', app); + navigateTo('/grouped', app); await flushTasks(); navigateTo('/history', app);
diff --git a/chrome/test/data/webui/history/history_routing_test.ts b/chrome/test/data/webui/history/history_routing_test.ts index a117ec0..be8b6fce 100644 --- a/chrome/test/data/webui/history/history_routing_test.ts +++ b/chrome/test/data/webui/history/history_routing_test.ts
@@ -8,7 +8,7 @@ import {BrowserProxyImpl, BrowserServiceImpl, MetricsProxyImpl} from 'chrome://history/history.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {keyDownOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; -import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; +import {assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; import {TestBrowserProxy, TestMetricsProxy} from './history_clusters/utils.js'; @@ -29,7 +29,6 @@ enableHistoryClusters: 'Enable', isHistoryClustersEnabled, isHistoryClustersVisible: true, - renameJourneys: false, }); }); @@ -49,24 +48,6 @@ return flushTasks(); }); - [true, false].forEach(isHistoryClustersVisibleManagedByPolicy => { - const suiteSuffix = - isHistoryClustersVisibleManagedByPolicy ? 'managed' : 'not-managed'; - suite(`toggle-history-clusters-sidebar-menu-item-${suiteSuffix}`, () => { - suiteSetup(() => { - loadTimeData.overrideValues({ - isHistoryClustersVisibleManagedByPolicy, - }); - }); - - test('menu item visiblity', () => { - const visible = isHistoryClustersEnabled && - !isHistoryClustersVisibleManagedByPolicy; - assertEquals(!visible, sidebar.$['toggle-history-clusters'].hidden); - }); - }); - }); - test('changing route changes active view', function() { assertEquals('history', app.$.content.selected); assertEquals(app.$.history, app.$['tabs-content'].selectedItem); @@ -82,15 +63,15 @@ }); }); - test('routing to /journeys may change active view', function() { + test('routing to /grouped may change active view', function() { assertEquals('history', app.$.content.selected); assertEquals( app.shadowRoot!.querySelector('#history'), app.$['tabs-content'].selectedItem); - navigateTo('/journeys', app); + navigateTo('/grouped', app); return flushTasks().then(function() { - assertEquals('chrome://history/journeys', window.location.href); + assertEquals('chrome://history/grouped', window.location.href); assertEquals('history', app.$.content.selected); assertEquals( @@ -104,24 +85,24 @@ }); }); - test('routing to /journeys may update sidebar menu item', function() { + test('routing to /grouped may update sidebar menu item', function() { assertEquals('chrome://history/', sidebar.$.history.href); assertEquals('history', sidebar.$.history.getAttribute('path')); - navigateTo('/journeys', app); + navigateTo('/grouped', app); return flushTasks().then(function() { // Currently selected history view is preserved in sidebar menu item. assertEquals( - isHistoryClustersEnabled ? 'chrome://history/journeys' : + isHistoryClustersEnabled ? 'chrome://history/grouped' : 'chrome://history/', sidebar.$.history.href); assertEquals( - isHistoryClustersEnabled ? 'journeys' : 'history', + isHistoryClustersEnabled ? 'grouped' : 'history', sidebar.$.history.getAttribute('path')); }); }); - test('route updates from tabs and sidebar menu items', function() { + test('route updates from tabs and sidebar menu items', async function() { assertEquals('history', sidebar.$.menu.selected); assertEquals('chrome://history/', window.location.href); @@ -140,8 +121,9 @@ if (isHistoryClustersEnabled) { assertTrue(!!historyTabs); historyTabs.selected = 1; - assertEquals('journeys', sidebar.$.menu.selected); - assertEquals('chrome://history/journeys', window.location.href); + await historyTabs.updateComplete; + assertEquals('grouped', sidebar.$.menu.selected); + assertEquals('chrome://history/grouped', window.location.href); keyDownOn(sidebar.$.syncedTabs, 0, '', ' '); assertEquals('syncedTabs', sidebar.$.menu.selected); @@ -149,78 +131,16 @@ // Currently selected history view is preserved in sidebar menu item. keyDownOn(sidebar.$.history, 0, '', ' '); - assertEquals('journeys', sidebar.$.menu.selected); - assertEquals('chrome://history/journeys', window.location.href); + assertEquals('grouped', sidebar.$.menu.selected); + assertEquals('chrome://history/grouped', window.location.href); historyTabs.selected = 0; + await historyTabs.updateComplete; assertEquals('history', sidebar.$.menu.selected); assertEquals('chrome://history/', window.location.href); } }); - test('toggle history clusters on/off from sidebar menu item', async () => { - if (!isHistoryClustersEnabled) { - return; - } - - const handler = testBrowserProxy.handler; - - assertEquals('history', sidebar.$.menu.selected); - assertEquals('chrome://history/', window.location.href); - - // Navigate to chrome://history/journeys. - app.shadowRoot!.querySelector('cr-tabs')!.selected = 1; - assertEquals('journeys', sidebar.$.menu.selected); - assertEquals('chrome://history/journeys', window.location.href); - await flushTasks(); - assertTrue(app.shadowRoot!.querySelector('#history-clusters')!.classList - .contains('iron-selected')); - - handler.setResultFor( - 'toggleVisibility', Promise.resolve({visible: false})); - - // Verify the menu item label and press it. - assertEquals( - 'Disable', sidebar.$['toggle-history-clusters'].textContent!.trim()); - keyDownOn(sidebar.$['toggle-history-clusters'], 0, '', ' '); - - // Verify that the browser is notified and the histogram is recorded. - let visible = - await testMetricsProxy.whenCalled('recordToggledVisibility'); - assertFalse(visible); - visible = await handler.whenCalled('toggleVisibility'); - assertFalse(visible); - - // Toggling history clusters off navigates to chrome://history/. - assertEquals('history', sidebar.$.menu.selected); - assertEquals('chrome://history/', window.location.href); - assertFalse(app.shadowRoot!.querySelector('#history-clusters')!.classList - .contains('iron-selected')); - - handler.reset(); - testMetricsProxy.reset(); - - handler.setResultFor( - 'toggleVisibility', Promise.resolve({visible: true})); - - // Verify the updated menu item label and press it again. - assertEquals( - 'Enable', sidebar.$['toggle-history-clusters'].textContent!.trim()); - keyDownOn(sidebar.$['toggle-history-clusters'], 0, '', ' '); - - // Verify that the browser is notified and the histogram is recorded. - visible = await testMetricsProxy.whenCalled('recordToggledVisibility'); - assertTrue(visible); - visible = await handler.whenCalled('toggleVisibility'); - assertTrue(visible); - - // Toggling history clusters on navigates to chrome://history/journeys. - assertEquals('journeys', sidebar.$.menu.selected); - assertEquals('chrome://history/journeys', window.location.href); - assertTrue(app.shadowRoot!.querySelector('#history-clusters')!.classList - .contains('iron-selected')); - }); - test('search updates from route', function() { assertEquals('chrome://history/', window.location.href); const searchTerm = 'Mei'; @@ -238,28 +158,35 @@ assertEquals('chrome://history/?q=' + searchTerm, window.location.href); }); - test('search is preserved across tabs and sidebar menu items', function() { - const searchTerm = 'Soldier76'; - assertEquals('history', sidebar.$.menu.selected); - navigateTo('/?q=' + searchTerm, app); + test( + 'search is preserved across tabs and sidebar menu items', + async function() { + const searchTerm = 'Soldier76'; + assertEquals('history', sidebar.$.menu.selected); + navigateTo('/?q=' + searchTerm, app); - sidebar.$.syncedTabs.click(); - assertEquals('syncedTabs', sidebar.$.menu.selected); - assertEquals(searchTerm, app.$.toolbar.searchTerm); - assertEquals( - 'chrome://history/syncedTabs?q=' + searchTerm, window.location.href); + sidebar.$.syncedTabs.click(); + assertEquals('syncedTabs', sidebar.$.menu.selected); + assertEquals(searchTerm, app.$.toolbar.searchTerm); + assertEquals( + 'chrome://history/syncedTabs?q=' + searchTerm, + window.location.href); - sidebar.$.history.click(); - assertEquals('history', sidebar.$.menu.selected); - assertEquals(searchTerm, app.$.toolbar.searchTerm); - assertEquals('chrome://history/?q=' + searchTerm, window.location.href); + sidebar.$.history.click(); + assertEquals('history', sidebar.$.menu.selected); + assertEquals(searchTerm, app.$.toolbar.searchTerm); + assertEquals( + 'chrome://history/?q=' + searchTerm, window.location.href); if (isHistoryClustersEnabled) { - app.shadowRoot!.querySelector('cr-tabs')!.selected = 1; - assertEquals('journeys', sidebar.$.menu.selected); + const tabs = app.shadowRoot!.querySelector('cr-tabs'); + assertTrue(!!tabs); + tabs.selected = 1; + await tabs.updateComplete; + assertEquals('grouped', sidebar.$.menu.selected); assertEquals(searchTerm, app.$.toolbar.searchTerm); assertEquals( - 'chrome://history/journeys?q=' + searchTerm, window.location.href); + 'chrome://history/grouped?q=' + searchTerm, window.location.href); } }); }); @@ -275,7 +202,6 @@ loadTimeData.overrideValues({ isHistoryClustersEnabled: true, isHistoryClustersVisible: true, - renameJourneys: false, lastSelectedTab: 1, }); }); @@ -302,14 +228,14 @@ `route to non default last selected tab when no url params set `, async () => { initialize(); - assertEquals(`chrome://history/journeys`, window.location.href); + assertEquals(`chrome://history/grouped`, window.location.href); }); test(`route to grouped url when last tab is grouped`, async () => { initialize(); - assertEquals(`chrome://history/journeys`, window.location.href); - navigateTo('/journeys', app); - assertEquals(`chrome://history/journeys`, window.location.href); + assertEquals(`chrome://history/grouped`, window.location.href); + navigateTo('/grouped', app); + assertEquals(`chrome://history/grouped`, window.location.href); const lastSelectedTab = await testBrowserService.whenCalled('setLastSelectedTab'); assertEquals(lastSelectedTab, 1);
diff --git a/chrome/test/data/webui/history/history_ui_browsertest.cc b/chrome/test/data/webui/history/history_ui_browsertest.cc index cad44a6..a04fdabd 100644 --- a/chrome/test/data/webui/history/history_ui_browsertest.cc +++ b/chrome/test/data/webui/history/history_ui_browsertest.cc
@@ -3,7 +3,6 @@ // found in the LICENSE file. #include "base/strings/stringprintf.h" -#include "base/test/scoped_feature_list.h" #include "chrome/common/webui_url_constants.h" #include "chrome/test/base/web_ui_mocha_browser_test.h" #include "components/history_clusters/core/features.h" @@ -12,13 +11,8 @@ class HistoryUIBrowserTest : public WebUIMochaBrowserTest { protected: HistoryUIBrowserTest() { - scoped_feature_list_.InitAndDisableFeature( - history_clusters::kRenameJourneys); set_test_loader_host(chrome::kChromeUIHistoryHost); } - - private: - base::test::ScopedFeatureList scoped_feature_list_; }; using HistoryTest = HistoryUIBrowserTest;
diff --git a/chrome/test/data/webui/settings/chromeos/os_printing_page/cups_printer_landing_page_test.ts b/chrome/test/data/webui/settings/chromeos/os_printing_page/cups_printer_landing_page_test.ts index 06068e7..504faea7 100644 --- a/chrome/test/data/webui/settings/chromeos/os_printing_page/cups_printer_landing_page_test.ts +++ b/chrome/test/data/webui/settings/chromeos/os_printing_page/cups_printer_landing_page_test.ts
@@ -1389,11 +1389,11 @@ // connected to a network. assertTrue(!!page.shadowRoot!.querySelector('#cloudOffIcon')); assertTrue(!!page.shadowRoot!.querySelector('#connectionMessage')); - const addManualPrinterIcon = + const addManualPrinterButtonRevamp = page.shadowRoot!.querySelector<HTMLButtonElement>( - '#addManualPrinterIcon'); - assertTrue(!!addManualPrinterIcon); - assertTrue(addManualPrinterIcon.disabled); + '#addManualPrinterButtonRevamp'); + assertTrue(!!addManualPrinterButtonRevamp); + assertTrue(addManualPrinterButtonRevamp.disabled); }); test('checkNetworkConnection', async () => { @@ -1407,11 +1407,11 @@ // connected. assertTrue(!!page.shadowRoot!.querySelector('#cloudOffIcon')); assertTrue(!!page.shadowRoot!.querySelector('#connectionMessage')); - const addManualPrinterIcon = + const addManualPrinterButtonRevamp = page.shadowRoot!.querySelector<HTMLButtonElement>( - '#addManualPrinterIcon'); - assertTrue(!!addManualPrinterIcon); - assertTrue(addManualPrinterIcon.disabled); + '#addManualPrinterButtonRevamp'); + assertTrue(!!addManualPrinterButtonRevamp); + assertTrue(addManualPrinterButtonRevamp.disabled); // Simulate connecting to a network with connectivity. wifi1.connectionState = ConnectionStateType.kOnline; page.onActiveNetworksChanged([wifi1]);
diff --git a/chrome/test/data/webui/settings/chromeos/os_printing_page/cups_printer_page_test.ts b/chrome/test/data/webui/settings/chromeos/os_printing_page/cups_printer_page_test.ts index 65410911a..b648e035 100644 --- a/chrome/test/data/webui/settings/chromeos/os_printing_page/cups_printer_page_test.ts +++ b/chrome/test/data/webui/settings/chromeos/os_printing_page/cups_printer_page_test.ts
@@ -85,11 +85,6 @@ // Verify the Nearby printers section can be properly opened and closed. test('CollapsibleNearbyPrinterSection', () => { - // The Add printer section above the Nearby printers section should be - // hidden. - assertFalse( - isVisible(page.shadowRoot!.querySelector('#addPrinterSection'))); - // The collapsible section should start opened, then after clicking the // button should close. const toggleButton = page.shadowRoot!.querySelector<HTMLButtonElement>( @@ -165,7 +160,7 @@ await flushTasks(); const icon = page.shadowRoot!.querySelector<HTMLButtonElement>( - '.add-manual-printer-icon'); + '#addManualPrinterButtonRevamp'); assertTrue(!!icon); icon.click(); assertEquals(
diff --git a/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.cc b/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.cc index 5c0cbd376..a87d605 100644 --- a/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.cc +++ b/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.cc
@@ -1386,16 +1386,12 @@ RunSettingsTest("os_printing_page/cups_printer_dialog_test.js"); } -class OSSettingsPrintingTestSettingsRevampAndStatusEnabled - : public OSSettingsMochaTest { +class OSSettingsPrintingTestSettingsStatusEnabled : public OSSettingsMochaTest { protected: - OSSettingsPrintingTestSettingsRevampAndStatusEnabled() { + OSSettingsPrintingTestSettingsStatusEnabled() { scoped_feature_list_.InitWithFeatures( /*enabled=*/ - { - ash::features::kPrinterSettingsRevamp, - ash::features::kPrinterSettingsPrinterStatus, - }, + {ash::features::kPrinterSettingsPrinterStatus}, /*disabled=*/{}); } @@ -1403,32 +1399,20 @@ base::test::ScopedFeatureList scoped_feature_list_; }; -IN_PROC_BROWSER_TEST_F(OSSettingsPrintingTestSettingsRevampAndStatusEnabled, +IN_PROC_BROWSER_TEST_F(OSSettingsPrintingTestSettingsStatusEnabled, OsPrintingPageCupsPrinterLandingPage) { RunSettingsTest("os_printing_page/cups_printer_landing_page_test.js"); } -class OSSettingsAppsTestSettingsRevampEnabled : public OSSettingsMochaTest { - protected: - OSSettingsAppsTestSettingsRevampEnabled() { - scoped_feature_list_.InitAndEnableFeature( - ash::features::kPrinterSettingsRevamp); - } - - private: - base::test::ScopedFeatureList scoped_feature_list_; -}; - -IN_PROC_BROWSER_TEST_F(OSSettingsAppsTestSettingsRevampEnabled, - OsPrintingPageCupsPrinterPage) { - RunSettingsTest("os_printing_page/cups_printer_page_test.js"); -} - -IN_PROC_BROWSER_TEST_F(OSSettingsPrintingTestSettingsRevampAndStatusEnabled, +IN_PROC_BROWSER_TEST_F(OSSettingsPrintingTestSettingsStatusEnabled, OsPrintingPageCupsPrintersEntry) { RunSettingsTest("os_printing_page/cups_printers_entry_test.js"); } +IN_PROC_BROWSER_TEST_F(OSSettingsMochaTest, OsPrintingPageCupsPrinterPage) { + RunSettingsTest("os_printing_page/cups_printer_page_test.js"); +} + IN_PROC_BROWSER_TEST_F(OSSettingsMochaTest, OsPrintingPagePrinterStatus) { RunSettingsTest("os_printing_page/printer_status_test.js"); }
diff --git a/chrome/test/data/webui/settings/clear_browsing_data_test.ts b/chrome/test/data/webui/settings/clear_browsing_data_test.ts index 0fd229a..25c1ec4 100644 --- a/chrome/test/data/webui/settings/clear_browsing_data_test.ts +++ b/chrome/test/data/webui/settings/clear_browsing_data_test.ts
@@ -435,6 +435,7 @@ const crTabs = element.shadowRoot!.querySelector('cr-tabs'); assertTrue(!!crTabs); crTabs.selected = tabIndex; + await crTabs.updateComplete; const timePeriodDropdown = getTimePeriodDropdown(tabName, element); const selectElement = @@ -491,10 +492,8 @@ // Changing the tab selection changes the visible tab, but does not persist // the tab selection to the pref. - const crTabs = element.shadowRoot!.querySelector('cr-tabs'); - assertTrue(!!crTabs); - crTabs.selected = 1; - await waitAfterNextRender(element); + element.$.tabs.selected = 1; + await element.$.tabs.updateComplete; assertEquals( 0, element.getPref('browser.last_clear_browsing_data_tab').value); assertTrue(isChildVisible(element, '#advanced-tab')); @@ -579,10 +578,12 @@ assertTrue(element.$.cookiesCheckboxBasic.checked); assertFalse(actionButton!.disabled); // Switching to advanced disables the button. - element.shadowRoot!.querySelector('cr-tabs')!.selected = 1; + element.$.tabs.selected = 1; + await element.$.tabs.updateComplete; assertTrue(actionButton!.disabled); // Switching back enables it again. - element.shadowRoot!.querySelector('cr-tabs')!.selected = 0; + element.$.tabs.selected = 0; + await element.$.tabs.updateComplete; assertFalse(actionButton!.disabled); });
diff --git a/chrome/test/data/webui/settings/tab_discard_exception_dialog_test.ts b/chrome/test/data/webui/settings/tab_discard_exception_dialog_test.ts index 94733716a..9db7634 100644 --- a/chrome/test/data/webui/settings/tab_discard_exception_dialog_test.ts +++ b/chrome/test/data/webui/settings/tab_discard_exception_dialog_test.ts
@@ -262,6 +262,7 @@ const tab = tabs[tabId]; assertTrue(!!tab); tab.click(); + return dialog.$.tabs.updateComplete; } test('testExceptionTabbedAddDialogSwitchTabs', async function() { @@ -273,9 +274,9 @@ checkbox.click(); await checkbox.$.checkbox.updateComplete; assertFalse(dialog.$.actionButton.disabled); - switchAddDialogTab(dialog, ExceptionAddDialogTabs.MANUAL); + await switchAddDialogTab(dialog, ExceptionAddDialogTabs.MANUAL); assertTrue(dialog.$.actionButton.disabled); - switchAddDialogTab(dialog, ExceptionAddDialogTabs.CURRENT_SITES); + await switchAddDialogTab(dialog, ExceptionAddDialogTabs.CURRENT_SITES); assertFalse(dialog.$.actionButton.disabled); checkbox.click(); @@ -283,7 +284,7 @@ switchAddDialogTab(dialog, ExceptionAddDialogTabs.MANUAL); await assertUserInputValidated(VALID_RULE); assertFalse(dialog.$.actionButton.disabled); - switchAddDialogTab(dialog, ExceptionAddDialogTabs.CURRENT_SITES); + await switchAddDialogTab(dialog, ExceptionAddDialogTabs.CURRENT_SITES); assertTrue(dialog.$.actionButton.disabled); switchAddDialogTab(dialog, ExceptionAddDialogTabs.MANUAL); await performanceBrowserProxy.whenCalled('validateTabDiscardExceptionRule');
diff --git a/chrome/test/data/webui/side_panel/read_anything/fake_reading_mode.ts b/chrome/test/data/webui/side_panel/read_anything/fake_reading_mode.ts index c631a6bb..a1b9f55f 100644 --- a/chrome/test/data/webui/side_panel/read_anything/fake_reading_mode.ts +++ b/chrome/test/data/webui/side_panel/read_anything/fake_reading_mode.ts
@@ -299,4 +299,8 @@ // Signal that the supported fonts should be updated i.e. that the brower's // preferred language has changed. updateFonts() {} + + getDisplayNameForLocale(_locale: string, _displayLocale: string): string { + return ''; + } }
diff --git a/chrome/test/data/webui/side_panel/read_anything/play_pause_test.ts b/chrome/test/data/webui/side_panel/read_anything/play_pause_test.ts index fffe875..35515ca 100644 --- a/chrome/test/data/webui/side_panel/read_anything/play_pause_test.ts +++ b/chrome/test/data/webui/side_panel/read_anything/play_pause_test.ts
@@ -58,8 +58,8 @@ suite('by default', () => { test('is paused', () => { - assertTrue(app.speechPlayngState.paused); - assertFalse(app.speechPlayngState.speechStarted); + assertTrue(app.speechPlayingState.paused); + assertFalse(app.speechPlayingState.speechStarted); }); test('shows play icon', () => { @@ -77,7 +77,7 @@ }); test('starts speech', () => { - assertFalse(app.speechPlayngState.paused); + assertFalse(app.speechPlayingState.paused); // TODO: b/323960128 - Since this test browser doesn't have any // voices, speechStarted doesn't get set to true. Find a way to add a mock // voice to this browser, and test that app.speechStarted is true. @@ -99,7 +99,7 @@ }); test('stops speech', () => { - assertTrue(app.speechPlayngState.paused); + assertTrue(app.speechPlayingState.paused); }); test('updates icon to play', () => { @@ -120,13 +120,13 @@ test('first press plays', () => { app.$.flexParent!.dispatchEvent(kPress); - assertFalse(app.speechPlayngState.paused); + assertFalse(app.speechPlayingState.paused); }); test('second press pauses', () => { app.$.flexParent!.dispatchEvent(kPress); app.$.flexParent!.dispatchEvent(kPress); - assertTrue(app.speechPlayngState.paused); + assertTrue(app.speechPlayingState.paused); }); }); });
diff --git a/chrome/test/data/webui/side_panel/read_anything/voice_selection_menu_test.ts b/chrome/test/data/webui/side_panel/read_anything/voice_selection_menu_test.ts index 9c5ce05..a9c16bb5 100644 --- a/chrome/test/data/webui/side_panel/read_anything/voice_selection_menu_test.ts +++ b/chrome/test/data/webui/side_panel/read_anything/voice_selection_menu_test.ts
@@ -7,9 +7,12 @@ import type {CrIconButtonElement} from '//resources/cr_elements/cr_icon_button/cr_icon_button.js'; import {flush} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import type {VoiceSelectionMenuElement} from 'chrome-untrusted://read-anything-side-panel.top-chrome/voice_selection_menu.js'; -import {voiceToHtmlTestId} from 'chrome-untrusted://read-anything-side-panel.top-chrome/voice_selection_menu.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome-untrusted://webui-test/chai_assert.js'; +function stringToHtmlTestId(s: string): string { + return s.replace(/\s/g, '-').replace(/[()]/g, ''); +} + suite('VoiceSelectionMenuElement', () => { let voiceSelectionMenu: VoiceSelectionMenuElement; let availableVoices: SpeechSynthesisVoice[]; @@ -25,7 +28,8 @@ const getDropdownItemForVoice = (voice: SpeechSynthesisVoice) => { return voiceSelectionMenu.$.voiceSelectionMenu .querySelector<HTMLButtonElement>(`[data-test-id="${ - voiceToHtmlTestId(voice)}"].dropdown-voice-selection-button`)!; + stringToHtmlTestId(voice.name)}"].dropdown-voice-selection-button`)! + ; }; setup(() => { @@ -132,10 +136,10 @@ test('it groups voices by language', () => { const englishGroup: HTMLElement = voiceSelectionMenu.$.voiceSelectionMenu.querySelector<HTMLElement>( - 'div#group-en-US')!; + 'div[data-test-id="group-en-US"]')!; const italianGroup: HTMLElement = voiceSelectionMenu.$.voiceSelectionMenu.querySelector<HTMLElement>( - 'div#group-it-IT')!; + 'div[data-test-id="group-it-IT"]')!; const englishDropdownItems: NodeListOf<HTMLElement> = englishGroup.querySelectorAll<HTMLButtonElement>( @@ -148,6 +152,38 @@ assertEquals(italianDropdownItems.length, 1); }); + + suite('with display names for locales', () => { + setup(() => { + // Bypass Typescript compiler to allow us to set a private readonly + // property + // @ts-ignore + voiceSelectionMenu.localeToDisplayName = { + 'en-US': 'English (United States)', + }; + flush(); + }); + + test('it displays the display name', () => { + const englishGroup: HTMLElement = + voiceSelectionMenu.$.voiceSelectionMenu.querySelector<HTMLElement>( + 'div[data-test-id="group-English-United-States"]')!; + const groupNameSpan = englishGroup.querySelector<HTMLElement>('span'); + + assertEquals( + groupNameSpan!.textContent!.trim(), 'English (United States)'); + }); + + test('it defaults to the locale when there is no display name', () => { + const italianGroup: HTMLElement = + voiceSelectionMenu.$.voiceSelectionMenu.querySelector<HTMLElement>( + 'div[data-test-id="group-it-IT"]')!; + const groupNameSpan = italianGroup.querySelector<HTMLElement>('span'); + + assertEquals(groupNameSpan!.textContent!.trim(), 'it-IT'); + }); + }); + suite('when voices have duplicate names', () => { setup(() => { availableVoices = [ @@ -161,10 +197,10 @@ test('it groups the duplicate languages correctly', () => { const usEnglishGroup: HTMLElement = voiceSelectionMenu.$.voiceSelectionMenu.querySelector<HTMLElement>( - 'div#group-en-US')!; + 'div[data-test-id="group-en-US"]')!; const ukEnglishGroup: HTMLElement = voiceSelectionMenu.$.voiceSelectionMenu.querySelector<HTMLElement>( - 'div#group-en-UK')!; + 'div[data-test-id="group-en-UK"]')!; const usEnglishDropdownItems: NodeListOf<HTMLElement> = usEnglishGroup.querySelectorAll<HTMLButtonElement>(
diff --git a/chrome/test/data/webui/tab_search/tab_search_app_test.ts b/chrome/test/data/webui/tab_search/tab_search_app_test.ts index 3289947..8daa608 100644 --- a/chrome/test/data/webui/tab_search/tab_search_app_test.ts +++ b/chrome/test/data/webui/tab_search/tab_search_app_test.ts
@@ -31,7 +31,8 @@ }); test('Switching tabs calls setTabIndex', async () => { - assertEquals(0, testProxy.getCallCount('setTabIndex')); + assertEquals(1, testProxy.getCallCount('setTabIndex')); + testProxy.resetResolver('setTabIndex'); const crTabs = tabSearchApp.shadowRoot!.querySelector('cr-tabs'); assertTrue(!!crTabs); @@ -42,6 +43,7 @@ const newTabIndex = 1; const unselectedTab = allTabs[newTabIndex]!; unselectedTab.click(); + await crTabs.updateComplete; const [tabIndex] = await testProxy.whenCalled('setTabIndex'); assertEquals(newTabIndex, tabIndex);
diff --git a/chrome/test/delayload/delayload_hook_browsertest.cc b/chrome/test/delayload/delayload_hook_browsertest.cc index c9f4736..305c63e 100644 --- a/chrome/test/delayload/delayload_hook_browsertest.cc +++ b/chrome/test/delayload/delayload_hook_browsertest.cc
@@ -4,7 +4,13 @@ #include <windows.h> +#include <delayimp.h> +#include <roerrorapi.h> + +#include "base/functional/bind.h" +#include "base/functional/callback_helpers.h" #include "base/run_loop.h" +#include "chrome/common/win/delay_load_notify_hook.h" #include "chrome/test/base/in_process_browser_test.h" #include "content/public/browser/browser_child_process_observer.h" #include "content/public/browser/child_process_data.h" @@ -19,6 +25,26 @@ using ChromeDelayLoadHookTest = InProcessBrowserTest; +namespace { + +bool g_callback_ran = false; +void WINAPI RoFailFastWithErrorContextPatch(HRESULT error) { + g_callback_ran = true; +} + +FARPROC TestDelayLoadCallbackFunction(unsigned delay_load_event, + DelayLoadInfo* delay_load_info) { + if (delay_load_event == dliNotePreGetProcAddress && + base::EqualsCaseInsensitiveASCII( + delay_load_info->szDll, "api-ms-win-core-winrt-error-l1-1-0.dll") && + strcmp(delay_load_info->dlp.szProcName, "RoFailFastWithErrorContext") == + 0) { + return reinterpret_cast<FARPROC>(RoFailFastWithErrorContextPatch); + } + + return nullptr; +} + class EchoServiceProcessObserver : public content::ServiceProcessHost::Observer, public content::BrowserChildProcessObserver { public: @@ -66,6 +92,8 @@ base::RunLoop crash_loop_; }; +} // namespace + IN_PROC_BROWSER_TEST_F(ChromeDelayLoadHookTest, ObserveDelayLoadFailure) { EchoServiceProcessObserver observer; auto echo_service = @@ -76,4 +104,19 @@ EXPECT_EQ(EXCEPTION_BREAKPOINT, static_cast<DWORD>(exit_code)); } +// Override delayload behavior to redirect a Windows API call to our own +// implementation. Note we can only override functions that haven't been +// called or statically resolved before this point. +IN_PROC_BROWSER_TEST_F(ChromeDelayLoadHookTest, OverrideDelayloadBehavior) { + base::ScopedClosureRunner reset_callback( + base::BindOnce(&SetDelayLoadHookCallback, nullptr)); + + SetDelayLoadHookCallback(TestDelayLoadCallbackFunction); + g_callback_ran = false; + // Normally this API will crash the process. Since we've patched it, we + // won't see a crash. + ::RoFailFastWithErrorContext(E_FAIL); + EXPECT_EQ(g_callback_ran, true); +} + } // namespace chrome
diff --git a/chrome/test/interaction/interactive_browser_test.cc b/chrome/test/interaction/interactive_browser_test.cc index ee6f7bd..f9299e2 100644 --- a/chrome/test/interaction/interactive_browser_test.cc +++ b/chrome/test/interaction/interactive_browser_test.cc
@@ -35,6 +35,7 @@ #include "ui/base/interaction/interaction_sequence.h" #include "ui/base/interaction/interaction_test_util.h" #include "ui/base/interaction/interactive_test_internal.h" +#include "ui/views/controls/webview/webview.h" #include "ui/views/interaction/interactive_views_test.h" #include "ui/views/views_delegate.h"
diff --git a/chrome/updater/persisted_data.cc b/chrome/updater/persisted_data.cc index 586080af..55578a5a 100644 --- a/chrome/updater/persisted_data.cc +++ b/chrome/updater/persisted_data.cc
@@ -332,6 +332,11 @@ return delegate_->GetInstallDate(id); } +void PersistedData::SetInstallDate(const std::string& id, int install_date) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + delegate_->SetInstallDate(id, install_date); +} + void PersistedData::GetActiveBits( const std::vector<std::string>& ids, base::OnceCallback<void(const std::set<std::string>&)> callback) const { @@ -389,6 +394,9 @@ } else if (GetDateLastRollCall(rq.app_id) == update_client::kDateUnknown) { SetDateLastRollCall(rq.app_id, update_client::kDateFirstTime); } + if (rq.install_date) { + SetInstallDate(rq.app_id, *rq.install_date); + } if (!rq.cohort.empty()) { SetCohort(rq.app_id, rq.cohort); }
diff --git a/chrome/updater/persisted_data.h b/chrome/updater/persisted_data.h index 970635bd..1b4de7d 100644 --- a/chrome/updater/persisted_data.h +++ b/chrome/updater/persisted_data.h
@@ -165,6 +165,7 @@ int datenum, base::OnceClosure callback) override; int GetInstallDate(const std::string& id) const override; + void SetInstallDate(const std::string& id, int install_date) override; void GetActiveBits(const std::vector<std::string>& ids, base::OnceCallback<void(const std::set<std::string>&)> callback) const override;
diff --git a/chrome/updater/policy/service.cc b/chrome/updater/policy/service.cc index c8f1dba1..ad7604f 100644 --- a/chrome/updater/policy/service.cc +++ b/chrome/updater/policy/service.cc
@@ -700,14 +700,15 @@ policy_service_proxy_configuration.proxy_url = proxy_url.policy(); } } else if (proxy_mode.policy().compare(kProxyModePacScript) == 0) { - const PolicyStatus<std::string> proxy_pac_url; + const PolicyStatus<std::string> proxy_pac_url = + policy_service->GetProxyPacUrl(); if (!proxy_pac_url) { VLOG(1) << "PAC proxy policy has no PAC URL specified."; is_policy_config_valid = false; } else { policy_service_proxy_configuration.proxy_pac_url = proxy_pac_url.policy(); } - } else if (proxy_mode.policy().compare(kProxyModeAutoDetect)) { + } else if (proxy_mode.policy().compare(kProxyModeAutoDetect) == 0) { policy_service_proxy_configuration.proxy_auto_detect = true; }
diff --git a/chrome/updater/policy/service_unittest.cc b/chrome/updater/policy/service_unittest.cc index ceee542..072ab7c0 100644 --- a/chrome/updater/policy/service_unittest.cc +++ b/chrome/updater/policy/service_unittest.cc
@@ -732,4 +732,63 @@ } #endif +TEST(PolicyService, PolicyServiceProxyConfiguration_Get) { + // Test proxy mode "auto_detect". + PolicyService::PolicyManagerVector managers; + auto manager = base::MakeRefCounted<FakePolicyManager>(true, "manager"); + manager->SetProxyMode("auto_detect"); + manager->SetProxyPacUrl("pac://server"); + manager->SetProxyServer("proxy_server"); + managers.push_back(std::move(manager)); + managers.push_back(GetDefaultValuesPolicyManager()); + auto policy_service = + base::MakeRefCounted<PolicyService>(std::move(managers)); + std::optional<PolicyServiceProxyConfiguration> proxy_configuration = + PolicyServiceProxyConfiguration::Get(policy_service); + ASSERT_TRUE(proxy_configuration); + ASSERT_TRUE(proxy_configuration->proxy_auto_detect); + ASSERT_FALSE(proxy_configuration->proxy_pac_url); + ASSERT_FALSE(proxy_configuration->proxy_url); + + // Test proxy mode "fixed_servers". + manager = base::MakeRefCounted<FakePolicyManager>(true, "manager"); + manager->SetProxyMode("fixed_servers"); + manager->SetProxyPacUrl("pac://server"); + manager->SetProxyServer("proxy_server"); + managers.push_back(std::move(manager)); + managers.push_back(GetDefaultValuesPolicyManager()); + policy_service = base::MakeRefCounted<PolicyService>(std::move(managers)); + proxy_configuration = PolicyServiceProxyConfiguration::Get(policy_service); + ASSERT_TRUE(proxy_configuration); + ASSERT_FALSE(proxy_configuration->proxy_auto_detect); + ASSERT_FALSE(proxy_configuration->proxy_pac_url); + ASSERT_TRUE(proxy_configuration->proxy_url); + ASSERT_EQ(*proxy_configuration->proxy_url, "proxy_server"); + + // Test proxy mode "pac_script". + manager = base::MakeRefCounted<FakePolicyManager>(true, "manager"); + manager->SetProxyMode("pac_script"); + manager->SetProxyPacUrl("pac://server"); + manager->SetProxyServer("proxy_server"); + managers.push_back(std::move(manager)); + managers.push_back(GetDefaultValuesPolicyManager()); + policy_service = base::MakeRefCounted<PolicyService>(std::move(managers)); + proxy_configuration = PolicyServiceProxyConfiguration::Get(policy_service); + ASSERT_TRUE(proxy_configuration); + ASSERT_FALSE(proxy_configuration->proxy_auto_detect); + ASSERT_TRUE(proxy_configuration->proxy_pac_url); + ASSERT_EQ(proxy_configuration->proxy_pac_url, "pac://server"); + ASSERT_FALSE(proxy_configuration->proxy_url); + + // Test unknown proxy mode. + manager = base::MakeRefCounted<FakePolicyManager>(true, "manager"); + manager->SetProxyMode("unknown"); + manager->SetProxyPacUrl("pac://server"); + manager->SetProxyServer("proxy_server"); + managers.push_back(std::move(manager)); + managers.push_back(GetDefaultValuesPolicyManager()); + policy_service = base::MakeRefCounted<PolicyService>(std::move(managers)); + ASSERT_FALSE(PolicyServiceProxyConfiguration::Get(policy_service)); +} + } // namespace updater
diff --git a/chrome/updater/registration_data.h b/chrome/updater/registration_data.h index ed738df..e63c7f4 100644 --- a/chrome/updater/registration_data.h +++ b/chrome/updater/registration_data.h
@@ -68,6 +68,9 @@ // Date-last-rollcall. The value is the number of days since Jan 1, 2007. std::optional<int> dlrc; + // Date of install. The value is the number of days since Jan 1, 2007. + std::optional<int> install_date; + // Opaque cohort string meaningful to the server. std::string cohort;
diff --git a/chrome/updater/util/win_util.cc b/chrome/updater/util/win_util.cc index 36615f6..42fe0578 100644 --- a/chrome/updater/util/win_util.cc +++ b/chrome/updater/util/win_util.cc
@@ -1263,6 +1263,12 @@ registration.dlrc = DaynumFromDWORD(date_last_rollcall); } + DWORD install_date = 0; + if (client_state_key.ReadValueDW(kRegValueDayOfInstall, &install_date) == + ERROR_SUCCESS) { + registration.install_date = DaynumFromDWORD(install_date); + } + base::win::RegKey cohort_key; if (cohort_key.Open(root, GetAppCohortKey(app_id).c_str(), Wow6432(KEY_READ)) == ERROR_SUCCESS) {
diff --git a/chrome/updater/win/win_constants.cc b/chrome/updater/win/win_constants.cc index 874b0c9..ee9c4a0 100644 --- a/chrome/updater/win/win_constants.cc +++ b/chrome/updater/win/win_constants.cc
@@ -24,6 +24,7 @@ const wchar_t kRegValueAP[] = L"ap"; const wchar_t kRegValueDateOfLastActivity[] = L"DayOfLastActivity"; const wchar_t kRegValueDateOfLastRollcall[] = L"DayOfLastRollCall"; +const wchar_t kRegValueDayOfInstall[] = L"DayOfInstall"; const wchar_t kRegValueName[] = L"name"; const wchar_t kRegValueUninstallCmdLine[] = L"UninstallCmdLine"; const wchar_t kRegValueVersion[] = L"version";
diff --git a/chrome/updater/win/win_constants.h b/chrome/updater/win/win_constants.h index 5441d8a..84fac7f 100644 --- a/chrome/updater/win/win_constants.h +++ b/chrome/updater/win/win_constants.h
@@ -49,6 +49,7 @@ extern const wchar_t kRegValueAP[]; extern const wchar_t kRegValueDateOfLastActivity[]; extern const wchar_t kRegValueDateOfLastRollcall[]; +extern const wchar_t kRegValueDayOfInstall[]; extern const wchar_t kRegValueName[]; // Values created under `UPDATER_KEY`.
diff --git a/chromecast/app/cast_main_delegate.h b/chromecast/app/cast_main_delegate.h index 7866ee0f..603517e 100644 --- a/chromecast/app/cast_main_delegate.h +++ b/chromecast/app/cast_main_delegate.h
@@ -6,8 +6,8 @@ #define CHROMECAST_APP_CAST_MAIN_DELEGATE_H_ #include <memory> - #include <optional> + #include "build/build_config.h" #include "chromecast/common/cast_content_client.h" #include "content/public/app/content_main_delegate.h"
diff --git a/chromecast/browser/cast_web_preferences.h b/chromecast/browser/cast_web_preferences.h index 31e5c6e..849e258 100644 --- a/chromecast/browser/cast_web_preferences.h +++ b/chromecast/browser/cast_web_preferences.h
@@ -6,6 +6,7 @@ #define CHROMECAST_BROWSER_CAST_WEB_PREFERENCES_H_ #include <optional> + #include "base/supports_user_data.h" #include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom.h"
diff --git a/chromecast/browser/service_manager_context.cc b/chromecast/browser/service_manager_context.cc index a9af3e8..9b808f6 100644 --- a/chromecast/browser/service_manager_context.cc +++ b/chromecast/browser/service_manager_context.cc
@@ -6,10 +6,10 @@ #include <map> #include <memory> +#include <optional> #include <string> #include <utility> -#include <optional> #include "base/command_line.h" #include "base/feature_list.h" #include "base/functional/bind.h"
diff --git a/chromecast/browser/webui/cast_resource_data_source.h b/chromecast/browser/webui/cast_resource_data_source.h index edc1205..37570e8 100644 --- a/chromecast/browser/webui/cast_resource_data_source.h +++ b/chromecast/browser/webui/cast_resource_data_source.h
@@ -5,9 +5,9 @@ #ifndef CHROMECAST_BROWSER_WEBUI_CAST_RESOURCE_DATA_SOURCE_H_ #define CHROMECAST_BROWSER_WEBUI_CAST_RESOURCE_DATA_SOURCE_H_ +#include <optional> #include <string> -#include <optional> #include "chromecast/browser/webui/mojom/webui.mojom.h" #include "content/public/browser/url_data_source.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
diff --git a/chromecast/cast_core/grpc/grpc_server_reactor.h b/chromecast/cast_core/grpc/grpc_server_reactor.h index 2c666da..69f403f 100644 --- a/chromecast/cast_core/grpc/grpc_server_reactor.h +++ b/chromecast/cast_core/grpc/grpc_server_reactor.h
@@ -9,6 +9,7 @@ #include <grpcpp/grpcpp.h> #include <optional> + #include "base/check_op.h" #include "base/logging.h" #include "base/memory/raw_ptr.h"
diff --git a/chromecast/cast_core/grpc/grpc_status_or.h b/chromecast/cast_core/grpc/grpc_status_or.h index fec7cca..e54e083f 100644 --- a/chromecast/cast_core/grpc/grpc_status_or.h +++ b/chromecast/cast_core/grpc/grpc_status_or.h
@@ -7,10 +7,10 @@ #include <grpcpp/support/status.h> +#include <optional> #include <string> #include <type_traits> -#include <optional> #include "base/check.h" namespace cast {
diff --git a/chromecast/cast_core/runtime/browser/cast_runtime_metrics_recorder.cc b/chromecast/cast_core/runtime/browser/cast_runtime_metrics_recorder.cc index 67c1898..8076800 100644 --- a/chromecast/cast_core/runtime/browser/cast_runtime_metrics_recorder.cc +++ b/chromecast/cast_core/runtime/browser/cast_runtime_metrics_recorder.cc
@@ -6,8 +6,8 @@ #include <cfloat> #include <cmath> - #include <optional> + #include "base/json/json_string_value_serializer.h" #include "base/logging.h" #include "base/metrics/histogram_base.h"
diff --git a/chromecast/cast_core/runtime/browser/runtime_service_impl.h b/chromecast/cast_core/runtime/browser/runtime_service_impl.h index 7440104a..3849491 100644 --- a/chromecast/cast_core/runtime/browser/runtime_service_impl.h +++ b/chromecast/cast_core/runtime/browser/runtime_service_impl.h
@@ -6,8 +6,8 @@ #define CHROMECAST_CAST_CORE_RUNTIME_BROWSER_RUNTIME_SERVICE_IMPL_H_ #include <memory> - #include <optional> + #include "base/memory/weak_ptr.h" #include "base/task/sequenced_task_runner.h" #include "base/time/time.h"
diff --git a/chromecast/cast_core/runtime/browser/url_rewrite/url_request_rewrite_type_converters_unittest.cc b/chromecast/cast_core/runtime/browser/url_rewrite/url_request_rewrite_type_converters_unittest.cc index 4000965..7643ec3 100644 --- a/chromecast/cast_core/runtime/browser/url_rewrite/url_request_rewrite_type_converters_unittest.cc +++ b/chromecast/cast_core/runtime/browser/url_rewrite/url_request_rewrite_type_converters_unittest.cc
@@ -5,6 +5,7 @@ #include "chromecast/cast_core/runtime/browser/url_rewrite/url_request_rewrite_type_converters.h" #include <optional> + #include "base/run_loop.h" #include "base/strings/string_piece.h" #include "components/url_rewrite/browser/url_request_rewrite_rules_validation.h"
diff --git a/chromecast/common/cast_content_client.cc b/chromecast/common/cast_content_client.cc index a311ba0..9722258 100644 --- a/chromecast/common/cast_content_client.cc +++ b/chromecast/common/cast_content_client.cc
@@ -33,6 +33,7 @@ #if BUILDFLAG(IS_ANDROID) #include <optional> + #include "chromecast/common/media/cast_media_drm_bridge_client.h" #include "components/cdm/common/android_cdm_registration.h" #endif
diff --git a/chromecast/crash/linux/synchronized_minidump_manager.cc b/chromecast/crash/linux/synchronized_minidump_manager.cc index 9ceaefc0..1e91584 100644 --- a/chromecast/crash/linux/synchronized_minidump_manager.cc +++ b/chromecast/crash/linux/synchronized_minidump_manager.cc
@@ -12,10 +12,10 @@ #include <unistd.h> #include <memory> +#include <optional> #include <string> #include <utility> -#include <optional> #include "base/command_line.h" #include "base/files/dir_reader_posix.h" #include "base/files/file_util.h"
diff --git a/chromecast/crash/linux/synchronized_minidump_manager.h b/chromecast/crash/linux/synchronized_minidump_manager.h index 18d414a..1c5ab7e9e 100644 --- a/chromecast/crash/linux/synchronized_minidump_manager.h +++ b/chromecast/crash/linux/synchronized_minidump_manager.h
@@ -5,9 +5,9 @@ #ifndef CHROMECAST_CRASH_LINUX_SYNCHRONIZED_MINIDUMP_MANAGER_H_ #define CHROMECAST_CRASH_LINUX_SYNCHRONIZED_MINIDUMP_MANAGER_H_ +#include <optional> #include <vector> -#include <optional> #include "base/files/file_path.h" #include "base/values.h" #include "chromecast/crash/linux/dump_info.h"
diff --git a/chromecast/device/bluetooth/le/le_scan_manager.h b/chromecast/device/bluetooth/le/le_scan_manager.h index 5d627ba8..35a546bf 100644 --- a/chromecast/device/bluetooth/le/le_scan_manager.h +++ b/chromecast/device/bluetooth/le/le_scan_manager.h
@@ -7,9 +7,9 @@ #include <map> #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/functional/callback.h" #include "base/memory/scoped_refptr.h" #include "chromecast/device/bluetooth/le/le_scan_result.h"
diff --git a/chromecast/device/bluetooth/le/le_scan_result.h b/chromecast/device/bluetooth/le/le_scan_result.h index 476be5d8..e30e172b 100644 --- a/chromecast/device/bluetooth/le/le_scan_result.h +++ b/chromecast/device/bluetooth/le/le_scan_result.h
@@ -6,10 +6,10 @@ #define CHROMECAST_DEVICE_BLUETOOTH_LE_LE_SCAN_RESULT_H_ #include <map> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/containers/span.h" #include "chromecast/public/bluetooth/bluetooth_types.h"
diff --git a/chromecast/device/bluetooth/le/scan_filter.h b/chromecast/device/bluetooth/le/scan_filter.h index 9a872ae..1b47b4d 100644 --- a/chromecast/device/bluetooth/le/scan_filter.h +++ b/chromecast/device/bluetooth/le/scan_filter.h
@@ -5,9 +5,9 @@ #ifndef CHROMECAST_DEVICE_BLUETOOTH_LE_SCAN_FILTER_H_ #define CHROMECAST_DEVICE_BLUETOOTH_LE_SCAN_FILTER_H_ +#include <optional> #include <string> -#include <optional> #include "chromecast/device/bluetooth/le/le_scan_result.h" #include "chromecast/public/bluetooth/bluetooth_types.h"
diff --git a/chromecast/external_mojo/public/cpp/external_mojo_broker.cc b/chromecast/external_mojo/public/cpp/external_mojo_broker.cc index 0aac0a5..08e6d7dc 100644 --- a/chromecast/external_mojo/public/cpp/external_mojo_broker.cc +++ b/chromecast/external_mojo/public/cpp/external_mojo_broker.cc
@@ -16,6 +16,7 @@ #endif #include <optional> + #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/location.h"
diff --git a/chromecast/graphics/cast_screen.h b/chromecast/graphics/cast_screen.h index 672c3a2..cd897c00 100644 --- a/chromecast/graphics/cast_screen.h +++ b/chromecast/graphics/cast_screen.h
@@ -6,6 +6,7 @@ #define CHROMECAST_GRAPHICS_CAST_SCREEN_H_ #include <optional> + #include "chromecast/public/graphics_types.h" #include "ui/display/display.h" #include "ui/display/screen_base.h"
diff --git a/chromecast/media/audio/audio_clock_simulator_impl.cc b/chromecast/media/audio/audio_clock_simulator_impl.cc index 7d4a45cc..db9c7f7 100644 --- a/chromecast/media/audio/audio_clock_simulator_impl.cc +++ b/chromecast/media/audio/audio_clock_simulator_impl.cc
@@ -7,8 +7,8 @@ #include <cstddef> #include <cstdint> #include <memory> - #include <optional> + #include "base/check_op.h" #include "base/functional/bind.h" #include "chromecast/media/api/audio_clock_simulator.h"
diff --git a/chromecast/media/cma/backend/alsa/alsa_volume_control.h b/chromecast/media/cma/backend/alsa/alsa_volume_control.h index 3c9b48c..13cae1cf 100644 --- a/chromecast/media/cma/backend/alsa/alsa_volume_control.h +++ b/chromecast/media/cma/backend/alsa/alsa_volume_control.h
@@ -6,10 +6,10 @@ #define CHROMECAST_MEDIA_CMA_BACKEND_ALSA_ALSA_VOLUME_CONTROL_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/timer/timer.h" #include "chromecast/media/cma/backend/system_volume_control.h" #include "media/audio/alsa/alsa_wrapper.h"
diff --git a/chromecast/media/cma/backend/cast_audio_json.h b/chromecast/media/cma/backend/cast_audio_json.h index 927c62c..431c24c 100644 --- a/chromecast/media/cma/backend/cast_audio_json.h +++ b/chromecast/media/cma/backend/cast_audio_json.h
@@ -6,6 +6,7 @@ #define CHROMECAST_MEDIA_CMA_BACKEND_CAST_AUDIO_JSON_H_ #include <optional> + #include "base/files/file_path.h" #include "base/files/file_path_watcher.h" #include "base/functional/callback.h"
diff --git a/chromecast/media/cma/backend/mixer/mixer_input_connection.cc b/chromecast/media/cma/backend/mixer/mixer_input_connection.cc index 4651021..6c0b1f5 100644 --- a/chromecast/media/cma/backend/mixer/mixer_input_connection.cc +++ b/chromecast/media/cma/backend/mixer/mixer_input_connection.cc
@@ -9,9 +9,9 @@ #include <algorithm> #include <limits> +#include <optional> #include <utility> -#include <optional> #include "base/command_line.h" #include "base/functional/bind.h" #include "base/location.h"
diff --git a/chromecast/media/cma/backend/mixer/post_processing_pipeline_parser.h b/chromecast/media/cma/backend/mixer/post_processing_pipeline_parser.h index 546e45cd..fbf22676 100644 --- a/chromecast/media/cma/backend/mixer/post_processing_pipeline_parser.h +++ b/chromecast/media/cma/backend/mixer/post_processing_pipeline_parser.h
@@ -6,10 +6,10 @@ #define CHROMECAST_MEDIA_CMA_BACKEND_MIXER_POST_PROCESSING_PIPELINE_PARSER_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/files/file_path.h" #include "base/values.h"
diff --git a/chromecast/media/cma/backend/proxy/audio_channel_push_buffer_handler.h b/chromecast/media/cma/backend/proxy/audio_channel_push_buffer_handler.h index e9fe91bc..b4e16381 100644 --- a/chromecast/media/cma/backend/proxy/audio_channel_push_buffer_handler.h +++ b/chromecast/media/cma/backend/proxy/audio_channel_push_buffer_handler.h
@@ -6,6 +6,7 @@ #define CHROMECAST_MEDIA_CMA_BACKEND_PROXY_AUDIO_CHANNEL_PUSH_BUFFER_HANDLER_H_ #include <optional> + #include "chromecast/media/api/cma_backend.h" #include "third_party/cast_core/public/src/proto/runtime/cast_audio_channel_service.pb.h"
diff --git a/chromecast/media/cma/backend/proxy/buffer_id_manager.h b/chromecast/media/cma/backend/proxy/buffer_id_manager.h index 2c35979..d1aa2ad 100644 --- a/chromecast/media/cma/backend/proxy/buffer_id_manager.h +++ b/chromecast/media/cma/backend/proxy/buffer_id_manager.h
@@ -6,10 +6,10 @@ #define CHROMECAST_MEDIA_CMA_BACKEND_PROXY_BUFFER_ID_MANAGER_H_ #include <memory> +#include <optional> #include <queue> #include <utility> -#include <optional> #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "chromecast/media/api/cma_backend.h"
diff --git a/chromecast/media/cma/backend/proxy/cast_runtime_audio_channel_broker.h b/chromecast/media/cma/backend/proxy/cast_runtime_audio_channel_broker.h index aee01ae..e90ffa15 100644 --- a/chromecast/media/cma/backend/proxy/cast_runtime_audio_channel_broker.h +++ b/chromecast/media/cma/backend/proxy/cast_runtime_audio_channel_broker.h
@@ -6,8 +6,8 @@ #define CHROMECAST_MEDIA_CMA_BACKEND_PROXY_CAST_RUNTIME_AUDIO_CHANNEL_BROKER_H_ #include <memory> - #include <optional> + #include "base/memory/weak_ptr.h" #include "third_party/cast_core/public/src/proto/runtime/cast_audio_channel_service.pb.h" #include "third_party/protobuf/src/google/protobuf/duration.pb.h"
diff --git a/chromecast/media/cma/backend/proxy/media_pipeline_buffer_extension.h b/chromecast/media/cma/backend/proxy/media_pipeline_buffer_extension.h index a0b213c5..d51012a 100644 --- a/chromecast/media/cma/backend/proxy/media_pipeline_buffer_extension.h +++ b/chromecast/media/cma/backend/proxy/media_pipeline_buffer_extension.h
@@ -6,9 +6,9 @@ #define CHROMECAST_MEDIA_CMA_BACKEND_PROXY_MEDIA_PIPELINE_BUFFER_EXTENSION_H_ #include <memory> +#include <optional> #include <queue> -#include <optional> #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h"
diff --git a/chromecast/media/cma/backend/proxy/proxy_call_translator.h b/chromecast/media/cma/backend/proxy/proxy_call_translator.h index f597d93..ec04d5d 100644 --- a/chromecast/media/cma/backend/proxy/proxy_call_translator.h +++ b/chromecast/media/cma/backend/proxy/proxy_call_translator.h
@@ -6,8 +6,8 @@ #define CHROMECAST_MEDIA_CMA_BACKEND_PROXY_PROXY_CALL_TRANSLATOR_H_ #include <memory> - #include <optional> + #include "base/memory/ref_counted.h" #include "chromecast/media/api/decoder_buffer_base.h" #include "chromecast/media/cma/backend/proxy/buffer_id_manager.h"
diff --git a/chromecast/media/cma/backend/proxy/push_buffer_queue.h b/chromecast/media/cma/backend/proxy/push_buffer_queue.h index 53ebb2f..644961e 100644 --- a/chromecast/media/cma/backend/proxy/push_buffer_queue.h +++ b/chromecast/media/cma/backend/proxy/push_buffer_queue.h
@@ -7,9 +7,9 @@ #include <atomic> #include <istream> +#include <optional> #include <ostream> -#include <optional> #include "base/sequence_checker.h" #include "chromecast/media/api/cma_backend.h" #include "chromecast/media/api/decoder_buffer_base.h"
diff --git a/chromecast/media/cma/backend/proxy/push_buffer_queue_unittest.cc b/chromecast/media/cma/backend/proxy/push_buffer_queue_unittest.cc index a41e7bfb..7bdf4fa 100644 --- a/chromecast/media/cma/backend/proxy/push_buffer_queue_unittest.cc +++ b/chromecast/media/cma/backend/proxy/push_buffer_queue_unittest.cc
@@ -5,9 +5,9 @@ #include "chromecast/media/cma/backend/proxy/push_buffer_queue.h" #include <atomic> +#include <optional> #include <sstream> -#include <optional> #include "base/functional/bind.h" #include "base/location.h" #include "base/threading/thread.h"
diff --git a/chromecast/media/cma/decoder/cast_audio_decoder.cc b/chromecast/media/cma/decoder/cast_audio_decoder.cc index 75081d4..9b059c36 100644 --- a/chromecast/media/cma/decoder/cast_audio_decoder.cc +++ b/chromecast/media/cma/decoder/cast_audio_decoder.cc
@@ -7,10 +7,10 @@ #include <algorithm> #include <cstdint> #include <limits> +#include <optional> #include <utility> #include <vector> -#include <optional> #include "base/containers/queue.h" #include "base/functional/bind.h" #include "base/functional/callback_helpers.h"
diff --git a/chromecast/media/service/cast_renderer.h b/chromecast/media/service/cast_renderer.h index 22df99721..aac1f80 100644 --- a/chromecast/media/service/cast_renderer.h +++ b/chromecast/media/service/cast_renderer.h
@@ -6,8 +6,8 @@ #define CHROMECAST_MEDIA_SERVICE_CAST_RENDERER_H_ #include <memory> - #include <optional> + #include "base/memory/weak_ptr.h" #include "base/no_destructor.h" #include "base/unguessable_token.h"
diff --git a/chromecast/renderer/cast_content_renderer_client.cc b/chromecast/renderer/cast_content_renderer_client.cc index f0b5d1c..ca6de538 100644 --- a/chromecast/renderer/cast_content_renderer_client.cc +++ b/chromecast/renderer/cast_content_renderer_client.cc
@@ -4,9 +4,9 @@ #include "chromecast/renderer/cast_content_renderer_client.h" +#include <optional> #include <utility> -#include <optional> #include "base/command_line.h" #include "base/feature_list.h" #include "base/strings/string_number_conversions.h"
diff --git a/chromecast/renderer/media/key_systems_cast.cc b/chromecast/renderer/media/key_systems_cast.cc index 15b6fa2..97f3456 100644 --- a/chromecast/renderer/media/key_systems_cast.cc +++ b/chromecast/renderer/media/key_systems_cast.cc
@@ -4,9 +4,9 @@ #include "chromecast/renderer/media/key_systems_cast.h" +#include <optional> #include <string> -#include <optional> #include "base/check.h" #include "base/command_line.h" #include "build/build_config.h"
diff --git a/chromeos/ash/components/attestation/attestation_flow_unittest.cc b/chromeos/ash/components/attestation/attestation_flow_unittest.cc index 32bb49c..4c63ff7 100644 --- a/chromeos/ash/components/attestation/attestation_flow_unittest.cc +++ b/chromeos/ash/components/attestation/attestation_flow_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 "chromeos/ash/components/attestation/attestation_flow.h" + #include <memory> #include <optional> #include <utility> @@ -17,7 +19,6 @@ #include "base/test/task_environment.h" #include "base/time/tick_clock.h" #include "base/timer/timer.h" -#include "chromeos/ash/components/attestation/attestation_flow.h" #include "chromeos/ash/components/attestation/attestation_flow_factory.h" #include "chromeos/ash/components/attestation/attestation_flow_integrated.h" #include "chromeos/ash/components/attestation/mock_attestation_flow.h"
diff --git a/chromeos/ash/components/dbus/fwupd/dbus_constants.h b/chromeos/ash/components/dbus/fwupd/dbus_constants.h index c33f56ad..b7e0e0b 100644 --- a/chromeos/ash/components/dbus/fwupd/dbus_constants.h +++ b/chromeos/ash/components/dbus/fwupd/dbus_constants.h
@@ -42,6 +42,34 @@ const char kFwupdDeviceRequestId_ReplugPower[] = "org.freedesktop.fwupd.replug-power"; +const char kFwupdErrorName_Internal[] = "org.freedesktop.fwupd.Internal"; +const char kFwupdErrorName_VersionNewer[] = + "org.freedesktop.fwupd.VersionNewer"; +const char kFwupdErrorName_VersionSame[] = "org.freedesktop.fwupd.VersionSame"; +const char kFwupdErrorName_AlreadyPending[] = + "org.freedesktop.fwupd.AlreadyPending"; +const char kFwupdErrorName_AuthFailed[] = "org.freedesktop.fwupd.AuthFailed"; +const char kFwupdErrorName_Read[] = "org.freedesktop.fwupd.Read"; +const char kFwupdErrorName_Write[] = "org.freedesktop.fwupd.Write"; +const char kFwupdErrorName_InvalidFile[] = "org.freedesktop.fwupd.InvalidFile"; +const char kFwupdErrorName_NotFound[] = "org.freedesktop.fwupd.NotFound"; +const char kFwupdErrorName_NothingToDo[] = "org.freedesktop.fwupd.NothingToDo"; +const char kFwupdErrorName_NotSupported[] = + "org.freedesktop.fwupd.NotSupported"; +const char kFwupdErrorName_SignatureInvalid[] = + "org.freedesktop.fwupd.SignatureInvalid"; +const char kFwupdErrorName_AcPowerRequired[] = + "org.freedesktop.fwupd.AcPowerRequired"; +const char kFwupdErrorName_PermissionDenied[] = + "org.freedesktop.fwupd.PermissionDenied"; +const char kFwupdErrorName_BrokenSystem[] = + "org.freedesktop.fwupd.BrokenSystem"; +const char kFwupdErrorName_BatteryLevelTooLow[] = + "org.freedesktop.fwupd.BatteryLevelTooLow"; +const char kFwupdErrorName_NeedsUserAction[] = + "org.freedesktop.fwupd.NeedsUserAction"; +const char kFwupdErrorName_AuthExpired[] = "org.freedesktop.fwupd.AuthExpired"; + } // namespace ash #endif // CHROMEOS_ASH_COMPONENTS_DBUS_FWUPD_DBUS_CONSTANTS_H_
diff --git a/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.cc b/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.cc index 4911337..e034951 100644 --- a/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.cc +++ b/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.cc
@@ -7,6 +7,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/threading/thread_restrictions.h" +#include "chromeos/ash/components/dbus/fwupd/dbus_constants.h" #include "chromeos/ash/components/dbus/fwupd/fake_fwupd_client.h" #include "chromeos/ash/components/dbus/fwupd/fwupd_device.h" #include "chromeos/ash/components/dbus/fwupd/fwupd_properties.h" @@ -60,14 +61,15 @@ observer.OnUpdateListResponse(device_id, &updates); } -void FakeFwupdClient::InstallUpdate(const std::string& device_id, - base::ScopedFD file_descriptor, - FirmwareInstallOptions options, - base::OnceCallback<void(bool)> callback) { +void FakeFwupdClient::InstallUpdate( + const std::string& device_id, + base::ScopedFD file_descriptor, + FirmwareInstallOptions options, + base::OnceCallback<void(FwupdResult)> callback) { // This matches the behavior of the real class. I.e. if you send an unknown // id, nothing happens. if (device_id != kFakeDeviceIdForTesting) { - std::move(callback).Run(/*success=*/false); + std::move(callback).Run(FwupdResult::kInternalError); return; } @@ -75,7 +77,7 @@ if (defer_install_update_callback_) { install_update_callback_ = std::move(callback); } else { - std::move(callback).Run(/*success=*/true); + std::move(callback).Run(FwupdResult::kSuccess); } } @@ -90,7 +92,7 @@ void FakeFwupdClient::TriggerSuccessfulUpdateForTesting() { CHECK(install_update_callback_); has_update_started_ = false; - std::move(install_update_callback_).Run(/*success=*/true); + std::move(install_update_callback_).Run(FwupdResult::kSuccess); } void FakeFwupdClient::EmitDeviceRequestForTesting(uint32_t device_request_id) {
diff --git a/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.h b/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.h index 697be116..e4568768 100644 --- a/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.h +++ b/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.h
@@ -26,7 +26,7 @@ void InstallUpdate(const std::string& device_id, base::ScopedFD file_descriptor, FirmwareInstallOptions options, - base::OnceCallback<void(bool)> callback) override; + base::OnceCallback<void(FwupdResult)> callback) override; void TriggerPropertiesChangeForTesting(uint32_t percentage, uint32_t status); void TriggerSuccessfulUpdateForTesting(); @@ -49,7 +49,7 @@ bool has_update_started_ = false; // Callback to run when InstallUpdate completes. - base::OnceCallback<void(bool)> install_update_callback_; + base::OnceCallback<void(FwupdResult)> install_update_callback_; // The temporary directory where fake update files are created. base::ScopedTempDir temp_directory_;
diff --git a/chromeos/ash/components/dbus/fwupd/fwupd_client.cc b/chromeos/ash/components/dbus/fwupd/fwupd_client.cc index 26fd9f8..627153c 100644 --- a/chromeos/ash/components/dbus/fwupd/fwupd_client.cc +++ b/chromeos/ash/components/dbus/fwupd/fwupd_client.cc
@@ -54,6 +54,51 @@ // Defined here: https://github.com/fwupd/fwupd/blob/main/libfwupd/fwupd-enums.h const uint64_t kRequestsFeatureFlag = 1llu << 4; +// String to FwupdResult conversion +// Consistent with +// https://github.com/fwupd/fwupd/blob/988f27fd96c5334089ec5daf9c4b2a34f5c6943a/libfwupd/fwupd-error.c#L26 +FwupdResult GetFwupdResult(const std::string& error_name) { + if (error_name == std::string(kFwupdErrorName_Internal)) { + return FwupdResult::kInternalError; + } else if (error_name == std::string(kFwupdErrorName_VersionNewer)) { + return FwupdResult::kVersionNewerError; + } else if (error_name == std::string(kFwupdErrorName_VersionSame)) { + return FwupdResult::kVersionSameError; + } else if (error_name == std::string(kFwupdErrorName_AlreadyPending)) { + return FwupdResult::kAlreadyPendingError; + } else if (error_name == std::string(kFwupdErrorName_AuthFailed)) { + return FwupdResult::kAuthFailedError; + } else if (error_name == std::string(kFwupdErrorName_Read)) { + return FwupdResult::kReadError; + } else if (error_name == std::string(kFwupdErrorName_Write)) { + return FwupdResult::kWriteError; + } else if (error_name == std::string(kFwupdErrorName_InvalidFile)) { + return FwupdResult::kInvalidFileError; + } else if (error_name == std::string(kFwupdErrorName_NotFound)) { + return FwupdResult::kNotFoundError; + } else if (error_name == std::string(kFwupdErrorName_NothingToDo)) { + return FwupdResult::kNothingToDoError; + } else if (error_name == std::string(kFwupdErrorName_NotSupported)) { + return FwupdResult::kNotSupportedError; + } else if (error_name == std::string(kFwupdErrorName_SignatureInvalid)) { + return FwupdResult::kSignatureInvalidError; + } else if (error_name == std::string(kFwupdErrorName_AcPowerRequired)) { + return FwupdResult::kAcPowerRequiredError; + } else if (error_name == std::string(kFwupdErrorName_PermissionDenied)) { + return FwupdResult::kPermissionDeniedError; + } else if (error_name == std::string(kFwupdErrorName_BrokenSystem)) { + return FwupdResult::kBrokenSystemError; + } else if (error_name == std::string(kFwupdErrorName_BatteryLevelTooLow)) { + return FwupdResult::kBatteryLevelTooLowError; + } else if (error_name == std::string(kFwupdErrorName_NeedsUserAction)) { + return FwupdResult::kNeedsUserActionError; + } else if (error_name == std::string(kFwupdErrorName_AuthExpired)) { + return FwupdResult::kAuthExpiredError; + } + FIRMWARE_LOG(ERROR) << "No matching error found for: " << error_name; + return FwupdResult::kUnknownError; +} + base::FilePath GetFilePathFromUri(const GURL uri) { const std::string filepath = uri.spec(); @@ -204,7 +249,7 @@ void InstallUpdate(const std::string& device_id, base::ScopedFD file_descriptor, FirmwareInstallOptions options, - base::OnceCallback<void(bool)> callback) override { + base::OnceCallback<void(FwupdResult)> callback) override { FIRMWARE_LOG(USER) << "fwupd: InstallUpdate called for id: " << device_id; dbus::MethodCall method_call(kFwupdServiceInterface, kFwupdInstallMethodName); @@ -454,18 +499,19 @@ } } - void InstallUpdateCallback(base::OnceCallback<void(bool)> callback, + void InstallUpdateCallback(base::OnceCallback<void(FwupdResult)> callback, dbus::Response* response, dbus::ErrorResponse* error_response) { - bool success = true; + FwupdResult result = FwupdResult::kSuccess; if (error_response) { FIRMWARE_LOG(ERROR) << "Firmware install failed with error message: " << error_response->ToString(); - success = false; + result = GetFwupdResult(error_response->GetErrorName()); } - FIRMWARE_LOG(USER) << "fwupd: InstallUpdate returned with: " << success; - std::move(callback).Run(success); + FIRMWARE_LOG(USER) << "fwupd: InstallUpdate returned with: " + << static_cast<int>(result); + std::move(callback).Run(result); } void OnSignalConnected(const std::string& interface_name,
diff --git a/chromeos/ash/components/dbus/fwupd/fwupd_client.h b/chromeos/ash/components/dbus/fwupd/fwupd_client.h index 62507c2..04759be 100644 --- a/chromeos/ash/components/dbus/fwupd/fwupd_client.h +++ b/chromeos/ash/components/dbus/fwupd/fwupd_client.h
@@ -32,6 +32,34 @@ }; namespace ash { + +// All values returnable by fwupd dbus signal +// The errors are consistent with +// https://fwupd.github.io/libfwupd/error.Error.html +enum class FwupdResult { + kSuccess, + kInternalError, + kVersionNewerError, + kVersionSameError, + kAlreadyPendingError, + kAuthFailedError, + kReadError, + kWriteError, + kInvalidFileError, + kNotFoundError, + kNothingToDoError, + kNotSupportedError, + kSignatureInvalidError, + kAcPowerRequiredError, + kPermissionDeniedError, + kBrokenSystemError, + kBatteryLevelTooLowError, + kNeedsUserActionError, + kAuthExpiredError, + kUnknownError, + kMaxValue = kUnknownError, +}; + using FirmwareInstallOptions = std::map<std::string, bool>; using FwupdStringToRequestIdMap = std::map<std::string, DeviceRequestId>; @@ -85,10 +113,11 @@ // Install an update for |device_id|. Invokes |callback| when the operation // completes. - virtual void InstallUpdate(const std::string& device_id, - base::ScopedFD file_descriptor, - FirmwareInstallOptions options, - base::OnceCallback<void(bool)> callback) = 0; + virtual void InstallUpdate( + const std::string& device_id, + base::ScopedFD file_descriptor, + FirmwareInstallOptions options, + base::OnceCallback<void(FwupdResult)> callback) = 0; protected: friend class FwupdClientTest;
diff --git a/chromeos/ash/components/dbus/fwupd/fwupd_client_unittest.cc b/chromeos/ash/components/dbus/fwupd/fwupd_client_unittest.cc index 5f1e0e1..b435b3e 100644 --- a/chromeos/ash/components/dbus/fwupd/fwupd_client_unittest.cc +++ b/chromeos/ash/components/dbus/fwupd/fwupd_client_unittest.cc
@@ -649,12 +649,12 @@ AddDbusMethodCallResultSimulation(std::move(response), nullptr); base::RunLoop run_loop; - fwupd_client_->InstallUpdate(kFakeDeviceIdForTesting, base::ScopedFD(0), - std::map<std::string, bool>(), - base::BindLambdaForTesting([&](bool success) { - EXPECT_TRUE(success); - run_loop.Quit(); - })); + fwupd_client_->InstallUpdate( + kFakeDeviceIdForTesting, base::ScopedFD(0), std::map<std::string, bool>(), + base::BindLambdaForTesting([&](FwupdResult result) { + EXPECT_EQ(result, FwupdResult::kSuccess); + run_loop.Quit(); + })); run_loop.Run(); }
diff --git a/chromeos/ash/components/dbus/shill/shill_device_client_unittest.cc b/chromeos/ash/components/dbus/shill/shill_device_client_unittest.cc index 1f38004..61b67f4 100644 --- a/chromeos/ash/components/dbus/shill/shill_device_client_unittest.cc +++ b/chromeos/ash/components/dbus/shill/shill_device_client_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 "chromeos/ash/components/dbus/shill/shill_device_client.h" + #include <memory> #include <optional> @@ -11,7 +13,6 @@ #include "base/test/test_future.h" #include "base/values.h" #include "chromeos/ash/components/dbus/shill/shill_client_unittest_base.h" -#include "chromeos/ash/components/dbus/shill/shill_device_client.h" #include "dbus/message.h" #include "dbus/object_path.h" #include "dbus/values_util.h"
diff --git a/chromeos/ash/components/dbus/shill/shill_service_client_unittest.cc b/chromeos/ash/components/dbus/shill/shill_service_client_unittest.cc index c114786..18f1aa3 100644 --- a/chromeos/ash/components/dbus/shill/shill_service_client_unittest.cc +++ b/chromeos/ash/components/dbus/shill/shill_service_client_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 "chromeos/ash/components/dbus/shill/shill_service_client.h" + #include <memory> #include <optional> @@ -13,7 +15,6 @@ #include "base/test/test_future.h" #include "base/values.h" #include "chromeos/ash/components/dbus/shill/shill_client_unittest_base.h" -#include "chromeos/ash/components/dbus/shill/shill_service_client.h" #include "dbus/message.h" #include "dbus/object_path.h" #include "dbus/values_util.h"
diff --git a/chromeos/ash/components/fwupd/firmware_update_manager.cc b/chromeos/ash/components/fwupd/firmware_update_manager.cc index ce1c4586..f4108a8 100644 --- a/chromeos/ash/components/fwupd/firmware_update_manager.cc +++ b/chromeos/ash/components/fwupd/firmware_update_manager.cc
@@ -26,6 +26,7 @@ #include "base/task/task_traits.h" #include "base/task/thread_pool.h" #include "base/time/time.h" +#include "chromeos/ash/components/dbus/fwupd/dbus_constants.h" #include "chromeos/ash/components/dbus/fwupd/fwupd_client.h" #include "chromeos/ash/components/fwupd/histogram_util.h" #include "components/device_event_log/device_event_log.h" @@ -79,6 +80,51 @@ FirmwareUpdateManager* g_instance = nullptr; +InstallResult GetInstallResultFromFwupdResult(FwupdResult error) { + switch (error) { + case FwupdResult::kSuccess: + return InstallResult::kSuccess; + case FwupdResult::kInternalError: + return InstallResult::kInternalError; + case FwupdResult::kVersionNewerError: + return InstallResult::kVersionNewerError; + case FwupdResult::kVersionSameError: + return InstallResult::kVersionSameError; + case FwupdResult::kAlreadyPendingError: + return InstallResult::kAlreadyPendingError; + case FwupdResult::kAuthFailedError: + return InstallResult::kAuthFailedError; + case FwupdResult::kReadError: + return InstallResult::kReadError; + case FwupdResult::kWriteError: + return InstallResult::kWriteError; + case FwupdResult::kInvalidFileError: + return InstallResult::kInvalidFileError; + case FwupdResult::kNotFoundError: + return InstallResult::kNotFoundError; + case FwupdResult::kNothingToDoError: + return InstallResult::kNothingToDoError; + case FwupdResult::kNotSupportedError: + return InstallResult::kNotSupportedError; + case FwupdResult::kSignatureInvalidError: + return InstallResult::kSignatureInvalidError; + case FwupdResult::kAcPowerRequiredError: + return InstallResult::kAcPowerRequiredError; + case FwupdResult::kPermissionDeniedError: + return InstallResult::kPermissionDeniedError; + case FwupdResult::kBrokenSystemError: + return InstallResult::kBrokenSystemError; + case FwupdResult::kBatteryLevelTooLowError: + return InstallResult::kBatteryLevelTooLowError; + case FwupdResult::kNeedsUserActionError: + return InstallResult::kNeedsUserActionError; + case FwupdResult::kAuthExpiredError: + return InstallResult::kAuthExpiredError; + case FwupdResult::kUnknownError: + return InstallResult::kUnknownError; + } +} + base::ScopedFD OpenFileAndGetFileDescriptor(base::FilePath download_path) { base::File dest_file(download_path, base::File::FLAG_OPEN | base::File::FLAG_READ); @@ -649,7 +695,9 @@ } void FirmwareUpdateManager::OnInstallResponse(InstallCallback callback, - bool success) { + FwupdResult result) { + InstallResult install_result = GetInstallResultFromFwupdResult(result); + bool success = install_result == InstallResult::kSuccess; FIRMWARE_LOG(EVENT) << "OnInstallResponse(). Success: " << success; if (!success) { @@ -669,7 +717,7 @@ request_duration, last_device_request_->id); std::move(callback).Run(InstallResult::kInstallFailedTimeout); } else { - std::move(callback).Run(InstallResult::kInstallFailed); + std::move(callback).Run(install_result); } return; }
diff --git a/chromeos/ash/components/fwupd/firmware_update_manager.h b/chromeos/ash/components/fwupd/firmware_update_manager.h index 3b87a26a..498805c73 100644 --- a/chromeos/ash/components/fwupd/firmware_update_manager.h +++ b/chromeos/ash/components/fwupd/firmware_update_manager.h
@@ -59,6 +59,49 @@ kMaxValue = kWaitingForUser, }; +// Used in histograms. Keep in sync with FirmwareUpdateInstallResult in +// tools/metrics/histograms/metadata/chromeos/enums.xml. +enum class InstallResult { + kSuccess = 0, + // DEPRECATED: kInstallFailed = 1, + kFailedToCreateUpdateDirectory = 2, + // DEPRECATED: kInvalidDestinationFile = 3, + kInvalidFileDescriptor = 4, + kFailedToDownloadToFile = 5, + kFailedToCreatePatchFile = 6, + kEmptyPatchFile = 7, + kInvalidPatchFileUri = 8, + kInvalidPatchFile = 9, + kInstallFailedTimeout = 10, + + // All Install Errors returned by fwupd dbus signal + // These errors are consistent with + // /chromeos/ash/components/dbus/fwupd/fwupd_client.h + // + // Starting values from 100 to keep the Fwupd Error message contiguous in case + // more error names are added. + kInternalError = 100, + kVersionNewerError = 101, + kVersionSameError = 102, + kAlreadyPendingError = 103, + kAuthFailedError = 104, + kReadError = 105, + kWriteError = 106, + kInvalidFileError = 107, + kNotFoundError = 108, + kNothingToDoError = 109, + kNotSupportedError = 110, + kSignatureInvalidError = 111, + kAcPowerRequiredError = 112, + kPermissionDeniedError = 113, + kBrokenSystemError = 114, + kBatteryLevelTooLowError = 115, + kNeedsUserActionError = 116, + kAuthExpiredError = 117, + kUnknownError = 118, + kMaxValue = kUnknownError, +}; + // FirmwareUpdateManager contains all logic that runs the firmware update SWA. class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_FWUPD) FirmwareUpdateManager : public FwupdClient::Observer, @@ -70,23 +113,6 @@ FirmwareUpdateManager& operator=(const FirmwareUpdateManager&) = delete; ~FirmwareUpdateManager() override; - // Used in histograms. Keep in sync with FirmwareUpdateInstallResult in - // tools/metrics/histograms/metadata/chromeos/enums.xml. - enum class InstallResult { - kSuccess = 0, - kInstallFailed = 1, - kFailedToCreateUpdateDirectory = 2, - // DEPRECATED: kInvalidDestinationFile = 3, - kInvalidFileDescriptor = 4, - kFailedToDownloadToFile = 5, - kFailedToCreatePatchFile = 6, - kEmptyPatchFile = 7, - kInvalidPatchFileUri = 8, - kInvalidPatchFile = 9, - kInstallFailedTimeout = 10, - kMaxValue = kInstallFailedTimeout, - }; - class Observer : public base::CheckedObserver { public: ~Observer() override = default; @@ -191,7 +217,7 @@ base::File patch_file); // Response from fwupd DBus client InstallUpdate call. - void OnInstallResponse(InstallCallback callback, bool success); + void OnInstallResponse(InstallCallback callback, FwupdResult result); // InstallComplete will be called exactly once with a result when an install // attempt succeeds or fails for any reason.
diff --git a/chromeos/ash/components/fwupd/firmware_update_manager_unittest.cc b/chromeos/ash/components/fwupd/firmware_update_manager_unittest.cc index 588a050..d1f7abf7 100644 --- a/chromeos/ash/components/fwupd/firmware_update_manager_unittest.cc +++ b/chromeos/ash/components/fwupd/firmware_update_manager_unittest.cc
@@ -260,10 +260,11 @@ void TriggerInstallFailed() { // Create a fake update so that the following method call works correctly. firmware_update_manager_->inflight_update_ = CreateFakeUpdate(); + // Setting default value for failure error name + FwupdResult result = FwupdResult::kInternalError; // Trigger an unsuccessful update. firmware_update_manager_->OnInstallResponse( - base::BindOnce([](FirmwareUpdateManager::InstallResult) {}), - /*success=*/false); + base::BindOnce([](InstallResult) {}), result); task_environment_.RunUntilIdle(); } @@ -528,6 +529,13 @@ return dbus::ErrorResponse::FromRawMessage(raw_message); } + std::unique_ptr<dbus::ErrorResponse> CreateErrorResponseWithName( + const std::string& name) { + auto raw_message = CreateErrorResponse(); + raw_message->SetErrorName(name); + return raw_message; + } + void CreateOneDeviceAndUpdateResponse() { dbus_responses_.push_back(CreateOneDeviceResponse()); dbus_responses_.push_back(CreateOneUpdateResponse()); @@ -779,18 +787,76 @@ // the update list. ASSERT_EQ(2, update_observer.num_times_notified()); - histogram_tester.ExpectUniqueSample( - "ChromeOS.FirmwareUpdateUi.InstallResult", - FirmwareUpdateManager::InstallResult::kSuccess, 1); + histogram_tester.ExpectUniqueSample("ChromeOS.FirmwareUpdateUi.InstallResult", + InstallResult::kSuccess, 1); } -TEST_F(FirmwareUpdateManagerTest, BeginUpdateFailed) { +struct FailedInstallWithErrorParam { + explicit FailedInstallWithErrorParam(std::string error_name, + InstallResult install_result) + : error_name(error_name), install_result(install_result) {} + + std::string error_name; + InstallResult install_result; +}; + +class FirmwareUpdateManagerTest_FailedInstallWithErrorMessage + : public FirmwareUpdateManagerTest, + public testing::WithParamInterface<FailedInstallWithErrorParam> {}; + +INSTANTIATE_TEST_SUITE_P( + FirmwareUpdateManagerTest_FailedInstallWithErrorMessage, + FirmwareUpdateManagerTest_FailedInstallWithErrorMessage, + ::testing::Values( + FailedInstallWithErrorParam(kFwupdErrorName_Internal, + InstallResult::kInternalError), + FailedInstallWithErrorParam(kFwupdErrorName_VersionNewer, + InstallResult::kVersionNewerError), + FailedInstallWithErrorParam(kFwupdErrorName_VersionSame, + InstallResult::kVersionSameError), + FailedInstallWithErrorParam(kFwupdErrorName_AlreadyPending, + InstallResult::kAlreadyPendingError), + FailedInstallWithErrorParam(kFwupdErrorName_AuthFailed, + InstallResult::kAuthFailedError), + FailedInstallWithErrorParam(kFwupdErrorName_Read, + InstallResult::kReadError), + FailedInstallWithErrorParam(kFwupdErrorName_Write, + InstallResult::kWriteError), + FailedInstallWithErrorParam(kFwupdErrorName_InvalidFile, + InstallResult::kInvalidFileError), + FailedInstallWithErrorParam(kFwupdErrorName_NotFound, + InstallResult::kNotFoundError), + FailedInstallWithErrorParam(kFwupdErrorName_NothingToDo, + InstallResult::kNothingToDoError), + FailedInstallWithErrorParam(kFwupdErrorName_NotSupported, + InstallResult::kNotSupportedError), + FailedInstallWithErrorParam(kFwupdErrorName_SignatureInvalid, + InstallResult::kSignatureInvalidError), + FailedInstallWithErrorParam(kFwupdErrorName_AcPowerRequired, + InstallResult::kAcPowerRequiredError), + FailedInstallWithErrorParam(kFwupdErrorName_PermissionDenied, + InstallResult::kPermissionDeniedError), + FailedInstallWithErrorParam(kFwupdErrorName_BrokenSystem, + InstallResult::kBrokenSystemError), + FailedInstallWithErrorParam(kFwupdErrorName_BatteryLevelTooLow, + InstallResult::kBatteryLevelTooLowError), + FailedInstallWithErrorParam(kFwupdErrorName_NeedsUserAction, + InstallResult::kNeedsUserActionError), + FailedInstallWithErrorParam(kFwupdErrorName_AuthExpired, + InstallResult::kAuthExpiredError), + FailedInstallWithErrorParam("Random Error", + InstallResult::kUnknownError), + FailedInstallWithErrorParam("Random Error 2", + InstallResult::kUnknownError))); + +TEST_P(FirmwareUpdateManagerTest_FailedInstallWithErrorMessage, + FailedInstall_WithErrorMessage) { base::HistogramTester histogram_tester; // Provide one device and update for RequestUpdates() call from SetupObserver. CreateOneDeviceAndUpdateResponse(); // InstallUpdate failed response. - dbus_responses_.push_back(CreateErrorResponse()); + dbus_responses_.push_back(CreateErrorResponseWithName(GetParam().error_name)); // For RequestAllUpdates() call after install completes. CreateOneDeviceAndUpdateResponse(); @@ -815,9 +881,8 @@ // the update list. ASSERT_EQ(2, update_observer.num_times_notified()); - histogram_tester.ExpectUniqueSample( - "ChromeOS.FirmwareUpdateUi.InstallResult", - FirmwareUpdateManager::InstallResult::kInstallFailed, 1); + histogram_tester.ExpectUniqueSample("ChromeOS.FirmwareUpdateUi.InstallResult", + GetParam().install_result, 1); } TEST_F(FirmwareUpdateManagerTest, BeginUpdateLocalPatch) { @@ -851,9 +916,8 @@ SetupProgressObserver(&update_progress_observer); BeginUpdate(std::string(kFakeDeviceIdForTesting), base::FilePath(uri)); - histogram_tester.ExpectUniqueSample( - "ChromeOS.FirmwareUpdateUi.InstallResult", - FirmwareUpdateManager::InstallResult::kSuccess, 1); + histogram_tester.ExpectUniqueSample("ChromeOS.FirmwareUpdateUi.InstallResult", + InstallResult::kSuccess, 1); EXPECT_EQ(ash::firmware_update::mojom::UpdateState::kSuccess, update_progress_observer.GetLatestUpdate()->state); } @@ -881,9 +945,8 @@ BeginUpdate(std::string(kFakeDeviceIdForTesting), base::FilePath("BadTestFilename@#.cab")); - histogram_tester.ExpectUniqueSample( - "ChromeOS.FirmwareUpdateUi.InstallResult", - FirmwareUpdateManager::InstallResult::kInvalidPatchFile, 1); + histogram_tester.ExpectUniqueSample("ChromeOS.FirmwareUpdateUi.InstallResult", + InstallResult::kInvalidPatchFile, 1); EXPECT_EQ(ash::firmware_update::mojom::UpdateState::kFailed, update_progress_observer.GetLatestUpdate()->state); }
diff --git a/chromeos/ash/components/fwupd/histogram_util.cc b/chromeos/ash/components/fwupd/histogram_util.cc index a2779414f..110534ea7 100644 --- a/chromeos/ash/components/fwupd/histogram_util.cc +++ b/chromeos/ash/components/fwupd/histogram_util.cc
@@ -38,9 +38,9 @@ "ChromeOS.FirmwareUpdateUi.InstallFailedWithStatus", last_fwupd_status); } -void EmitInstallResult(FirmwareUpdateManager::InstallResult result) { - base::UmaHistogramEnumeration("ChromeOS.FirmwareUpdateUi.InstallResult", - result); +void EmitInstallResult(InstallResult result) { + base::UmaHistogramSparse("ChromeOS.FirmwareUpdateUi.InstallResult", + static_cast<int>(result)); } void EmitDeviceRequest(firmware_update::mojom::DeviceRequestPtr request) {
diff --git a/chromeos/ash/components/fwupd/histogram_util.h b/chromeos/ash/components/fwupd/histogram_util.h index 31493250..892511e2 100644 --- a/chromeos/ash/components/fwupd/histogram_util.h +++ b/chromeos/ash/components/fwupd/histogram_util.h
@@ -21,7 +21,7 @@ bool is_startup); void EmitInstallFailedWithStatus(FwupdStatus last_fwupd_status); -void EmitInstallResult(FirmwareUpdateManager::InstallResult result); +void EmitInstallResult(InstallResult result); void EmitDeviceRequest(firmware_update::mojom::DeviceRequestPtr request); void EmitFailedDeviceRequestDuration(const base::TimeDelta& request_duration, mojom::DeviceRequestId request_id);
diff --git a/chromeos/ash/components/network/onc/onc_normalizer_fuzzer.cc b/chromeos/ash/components/network/onc/onc_normalizer_fuzzer.cc index f06036f..be5439ed 100644 --- a/chromeos/ash/components/network/onc/onc_normalizer_fuzzer.cc +++ b/chromeos/ash/components/network/onc/onc_normalizer_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 "chromeos/ash/components/network/onc/onc_normalizer.h" + #include <stddef.h> #include <stdint.h> @@ -10,7 +12,6 @@ #include "base/json/json_reader.h" #include "base/values.h" -#include "chromeos/ash/components/network/onc/onc_normalizer.h" #include "chromeos/components/onc/onc_signature.h" namespace ash::onc {
diff --git a/chromeos/ash/components/tether/tether_connector_impl.cc b/chromeos/ash/components/tether/tether_connector_impl.cc index 876e4f8f..69bfa4f 100644 --- a/chromeos/ash/components/tether/tether_connector_impl.cc +++ b/chromeos/ash/components/tether/tether_connector_impl.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chromeos/ash/components/tether/tether_connector_impl.h" + #include <optional> #include <utility>
diff --git a/chromeos/ash/services/auth_factor_config/auth_factor_config.h b/chromeos/ash/services/auth_factor_config/auth_factor_config.h index 21501b3..92b990e 100644 --- a/chromeos/ash/services/auth_factor_config/auth_factor_config.h +++ b/chromeos/ash/services/auth_factor_config/auth_factor_config.h
@@ -14,13 +14,12 @@ #include "chromeos/ash/components/login/auth/public/authentication_error.h" #include "chromeos/ash/services/auth_factor_config/chrome_browser_delegates.h" #include "chromeos/ash/services/auth_factor_config/public/mojom/auth_factor_config.mojom.h" +#include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" +#include "components/user_manager/user.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote_set.h" -#include "components/prefs/pref_registry_simple.h" -#include "components/user_manager/user.h" - namespace ash::auth { // The implementation of the AuthFactorConfig service.
diff --git a/chromeos/chromeos_strings.grd b/chromeos/chromeos_strings.grd index 2274931..eac04a42 100644 --- a/chromeos/chromeos_strings.grd +++ b/chromeos/chromeos_strings.grd
@@ -5403,6 +5403,15 @@ <message name="IDS_SETTINGS_APN_DIALOG_DONE" desc="Text used to close the APN dialog in view mode."> Done </message> + <message name="IDS_SETTINGS_APN_SELECTION_DIALOG_TITLE" desc="Text used to cancel the APN dialog."> + Choose from available APNs + </message> + <message name="IDS_SETTINGS_APN_SELECTION_DIALOG_DESCRIPTION" desc="Text used to cancel the APN dialog."> + Invalid APNs could cause your mobile connection to be disabled. Only set APNs provided by your mobile provider or administrator. + </message> + <message name="IDS_SETTINGS_APN_SELECTION_DIALOG_BUTTON_USE_APN" desc="Text used to close the APN dialog in view mode."> + Use this APN + </message> <!-- End of APN --> <!-- Arc Input Overlay -->
diff --git a/chromeos/chromeos_strings_grd/IDS_SETTINGS_APN_SELECTION_DIALOG_BUTTON_USE_APN.png.sha1 b/chromeos/chromeos_strings_grd/IDS_SETTINGS_APN_SELECTION_DIALOG_BUTTON_USE_APN.png.sha1 new file mode 100644 index 0000000..a7b36d45 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_SETTINGS_APN_SELECTION_DIALOG_BUTTON_USE_APN.png.sha1
@@ -0,0 +1 @@ +5a76c3fac2cc43f8bcccbcd3d429d005402fa949 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_SETTINGS_APN_SELECTION_DIALOG_DESCRIPTION.png.sha1 b/chromeos/chromeos_strings_grd/IDS_SETTINGS_APN_SELECTION_DIALOG_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..a7b36d45 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_SETTINGS_APN_SELECTION_DIALOG_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +5a76c3fac2cc43f8bcccbcd3d429d005402fa949 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_SETTINGS_APN_SELECTION_DIALOG_TITLE.png.sha1 b/chromeos/chromeos_strings_grd/IDS_SETTINGS_APN_SELECTION_DIALOG_TITLE.png.sha1 new file mode 100644 index 0000000..a7b36d45 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_SETTINGS_APN_SELECTION_DIALOG_TITLE.png.sha1
@@ -0,0 +1 @@ +5a76c3fac2cc43f8bcccbcd3d429d005402fa949 \ No newline at end of file
diff --git a/chromeos/components/onc/onc_validator.cc b/chromeos/components/onc/onc_validator.cc index 17353929..f1124e5c 100644 --- a/chromeos/components/onc/onc_validator.cc +++ b/chromeos/components/onc/onc_validator.cc
@@ -18,7 +18,6 @@ #include "base/memory/ptr_util.h" #include "base/notreached.h" #include "base/strings/string_number_conversions.h" - #include "base/strings/string_util.h" #include "base/values.h" #include "chromeos/components/onc/onc_signature.h"
diff --git a/chromeos/components/onc/onc_validator_fuzzer.cc b/chromeos/components/onc/onc_validator_fuzzer.cc index e6b7b76..f501d4b 100644 --- a/chromeos/components/onc/onc_validator_fuzzer.cc +++ b/chromeos/components/onc/onc_validator_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 "chromeos/components/onc/onc_validator.h" + #include <stddef.h> #include <stdint.h> @@ -12,7 +14,6 @@ #include "base/logging.h" #include "base/values.h" #include "chromeos/components/onc/onc_signature.h" -#include "chromeos/components/onc/onc_validator.h" namespace chromeos { namespace onc {
diff --git a/clank b/clank index e1cea4c..5ac8fb2 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit e1cea4cbb1facae953cae4f052e196c367a636ce +Subproject commit 5ac8fb250ea25c91a12158f768d4f5c03976f15e
diff --git a/codelabs/cpp101/solutions/factor.cc b/codelabs/cpp101/solutions/factor.cc index 3372918..2151b082 100644 --- a/codelabs/cpp101/solutions/factor.cc +++ b/codelabs/cpp101/solutions/factor.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <optional> + #include "base/at_exit.h" #include "base/command_line.h" #include "base/functional/bind.h"
diff --git a/components/attribution_reporting/BUILD.gn b/components/attribution_reporting/BUILD.gn index d114412..5de64b7 100644 --- a/components/attribution_reporting/BUILD.gn +++ b/components/attribution_reporting/BUILD.gn
@@ -65,8 +65,9 @@ "os_registration.h", "parsing_utils.cc", "parsing_utils.h", - "registrar.cc", "registrar.h", + "registrar_info.cc", + "registrar_info.h", "registration_info.cc", "registration_info.h", "source_registration.cc", @@ -137,7 +138,7 @@ "max_event_level_reports_unittest.cc", "os_registration_unittest.cc", "parsing_utils_unittest.cc", - "registrar_unittest.cc", + "registrar_info_unittest.cc", "registration_info_unittest.cc", "source_registration_unittest.cc", "suitable_origin_unittest.cc",
diff --git a/components/attribution_reporting/registrar.cc b/components/attribution_reporting/registrar.cc deleted file mode 100644 index d0dc1f0b..0000000 --- a/components/attribution_reporting/registrar.cc +++ /dev/null
@@ -1,61 +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 "components/attribution_reporting/registrar.h" - -#include <optional> -#include <string> -#include <string_view> - -#include "base/types/expected.h" -#include "net/http/structured_headers.h" - -namespace attribution_reporting { - -namespace { -constexpr char kPreferredPlatform[] = "preferred-platform"; -} // namespace - -base::expected<std::optional<Registrar>, PreferredPlatformError> ParseInfo( - std::string_view header) { - if (header.empty()) { - return std::nullopt; - } - - const auto dict = net::structured_headers::ParseDictionary(header); - if (!dict) { - return base::unexpected(PreferredPlatformError()); - } - - return ParseInfo(*dict); -} - -base::expected<std::optional<Registrar>, PreferredPlatformError> ParseInfo( - const net::structured_headers::Dictionary& dict) { - auto iter = dict.find(kPreferredPlatform); - if (iter == dict.end()) { - return std::nullopt; - } - - const auto& parameterized_member = iter->second; - if (parameterized_member.member_is_inner_list) { - return base::unexpected(PreferredPlatformError()); - } - - const auto& parameterized_item = parameterized_member.member.front(); - if (!parameterized_item.item.is_token()) { - return base::unexpected(PreferredPlatformError()); - } - - const std::string& token = parameterized_item.item.GetString(); - if (token == "web") { - return Registrar::kWeb; - } else if (token == "os") { - return Registrar::kOs; - } else { - return base::unexpected(PreferredPlatformError()); - } -} - -} // namespace attribution_reporting
diff --git a/components/attribution_reporting/registrar.h b/components/attribution_reporting/registrar.h index 7073433..12b4acc 100644 --- a/components/attribution_reporting/registrar.h +++ b/components/attribution_reporting/registrar.h
@@ -5,13 +5,6 @@ #ifndef COMPONENTS_ATTRIBUTION_REPORTING_REGISTRAR_H_ #define COMPONENTS_ATTRIBUTION_REPORTING_REGISTRAR_H_ -#include <optional> -#include <string_view> - -#include "base/component_export.h" -#include "base/types/expected.h" -#include "net/http/structured_headers.h" - namespace attribution_reporting { enum class Registrar { @@ -19,30 +12,6 @@ kOs, }; -struct PreferredPlatformError { - friend bool operator==(const PreferredPlatformError&, - const PreferredPlatformError&) = default; -}; - -// Parses an Attribution-Reporting-Info header for the preferred platform. -// -// Currently only 'preferred-platform' field is expected in the -// Attribution-Reporting-Info header. Any other fields are ignored. -// Returns an error if the string is not parsable as a structured-header -// dictionary or the value of 'preferred-platform' is not an allowed token. -// -// Example: -// -// `preferred-platform=web` or `preferred-platform=os` -COMPONENT_EXPORT(ATTRIBUTION_REPORTING) -base::expected<std::optional<Registrar>, PreferredPlatformError> ParseInfo( - std::string_view); - -// Same as the above, but using an already-parsed structured-header dictionary. -COMPONENT_EXPORT(ATTRIBUTION_REPORTING) -base::expected<std::optional<Registrar>, PreferredPlatformError> ParseInfo( - const net::structured_headers::Dictionary&); - } // namespace attribution_reporting #endif // COMPONENTS_ATTRIBUTION_REPORTING_REGISTRAR_H_
diff --git a/components/attribution_reporting/registrar_info.cc b/components/attribution_reporting/registrar_info.cc new file mode 100644 index 0000000..c4a37ba --- /dev/null +++ b/components/attribution_reporting/registrar_info.cc
@@ -0,0 +1,131 @@ +// 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/attribution_reporting/registrar_info.h" + +#include <optional> + +#include "base/containers/enum_set.h" +#include "base/functional/function_ref.h" +#include "components/attribution_reporting/registrar.h" +#include "services/network/public/cpp/attribution_utils.h" +#include "services/network/public/mojom/attribution.mojom-shared.h" + +namespace attribution_reporting { + +namespace { + +using SetRegistrarOrIssueFunc = base::FunctionRef< + void(bool, network::mojom::AttributionSupport, RegistrarInfo&)>; + +void SetRegistrarOrIssue( + bool is_source, + network::mojom::AttributionSupport support, + Registrar registrar, + IssueType source_issue, + IssueType trigger_issue, + base::FunctionRef<bool(network::mojom::AttributionSupport)> check_func, + RegistrarInfo& info) { + if (check_func(support)) { + info.registrar = registrar; + } else { + info.issues.Put(is_source ? source_issue : trigger_issue); + } +} + +void SetWebRegistrarOrIssue(bool is_source, + network::mojom::AttributionSupport support, + RegistrarInfo& info) { + SetRegistrarOrIssue(is_source, support, Registrar::kWeb, + IssueType::kSourceIgnored, IssueType::kTriggerIgnored, + &network::HasAttributionWebSupport, info); +} + +void SetOsRegistrarOrIssue(bool is_source, + network::mojom::AttributionSupport support, + RegistrarInfo& info) { + SetRegistrarOrIssue(is_source, support, Registrar::kOs, + IssueType::kOsSourceIgnored, IssueType::kOsTriggerIgnored, + &network::HasAttributionOsSupport, info); +} + +void HandlePreferredPlatform(bool is_source, + network::mojom::AttributionSupport support, + IssueType source_issue, + IssueType trigger_issue, + bool has_preferred_header, + SetRegistrarOrIssueFunc preferred_func, + bool has_secondary_header, + SetRegistrarOrIssueFunc secondary_func, + RegistrarInfo& info) { + if (!has_preferred_header) { + info.issues.Put(is_source ? source_issue : trigger_issue); + return; + } + + preferred_func(is_source, support, info); + + if (!info.registrar.has_value() && has_secondary_header) { + secondary_func(is_source, support, info); + } +} + +} // namespace + +RegistrarInfo::RegistrarInfo() = default; + +RegistrarInfo::~RegistrarInfo() = default; + +RegistrarInfo::RegistrarInfo(const RegistrarInfo&) = default; + +RegistrarInfo& RegistrarInfo::operator=(const RegistrarInfo&) = default; + +RegistrarInfo::RegistrarInfo(RegistrarInfo&&) = default; + +RegistrarInfo& RegistrarInfo::operator=(RegistrarInfo&&) = default; + +// static +RegistrarInfo RegistrarInfo::Get( + bool has_web_header, + bool has_os_header, + bool is_source, + std::optional<Registrar> preferred_platform, + network::mojom::AttributionSupport support) { + if (!has_web_header && !has_os_header) { + return RegistrarInfo(); + } + + RegistrarInfo info; + + if (!preferred_platform.has_value()) { + if (has_web_header && has_os_header) { + info.issues.Put(IssueType::kWebAndOsHeaders); + } else if (has_web_header) { + SetWebRegistrarOrIssue(is_source, support, info); + } else if (has_os_header) { + SetOsRegistrarOrIssue(is_source, support, info); + } + return info; + } + + switch (preferred_platform.value()) { + case attribution_reporting::Registrar::kWeb: + HandlePreferredPlatform( + is_source, support, IssueType::kNoRegisterSourceHeader, + IssueType::kNoRegisterTriggerHeader, has_web_header, + &SetWebRegistrarOrIssue, has_os_header, &SetOsRegistrarOrIssue, info); + break; + case attribution_reporting::Registrar::kOs: + HandlePreferredPlatform(is_source, support, + IssueType::kNoRegisterOsSourceHeader, + IssueType::kNoRegisterOsTriggerHeader, + has_os_header, &SetOsRegistrarOrIssue, + has_web_header, &SetWebRegistrarOrIssue, info); + break; + } + + return info; +} + +} // namespace attribution_reporting
diff --git a/components/attribution_reporting/registrar_info.h b/components/attribution_reporting/registrar_info.h new file mode 100644 index 0000000..35ff7be --- /dev/null +++ b/components/attribution_reporting/registrar_info.h
@@ -0,0 +1,60 @@ +// 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_ATTRIBUTION_REPORTING_REGISTRAR_INFO_H_ +#define COMPONENTS_ATTRIBUTION_REPORTING_REGISTRAR_INFO_H_ + +#include <optional> +#include <vector> + +#include "base/component_export.h" +#include "base/containers/enum_set.h" +#include "base/types/expected.h" +#include "services/network/public/mojom/attribution.mojom-forward.h" + +namespace attribution_reporting { + +enum class Registrar; + +enum class IssueType { + kWebAndOsHeaders, + kSourceIgnored, + kTriggerIgnored, + kOsSourceIgnored, + kOsTriggerIgnored, + kNoRegisterSourceHeader, + kNoRegisterTriggerHeader, + kNoRegisterOsSourceHeader, + kNoRegisterOsTriggerHeader, + + kMinValue = kWebAndOsHeaders, + kMaxValue = kNoRegisterOsTriggerHeader, +}; + +using IssueTypes = + base::EnumSet<IssueType, IssueType::kMinValue, IssueType::kMaxValue>; + +struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING) RegistrarInfo { + static RegistrarInfo Get(bool has_web_header, + bool has_os_header, + bool is_source, + std::optional<Registrar> preferred_platform, + network::mojom::AttributionSupport); + + RegistrarInfo(); + ~RegistrarInfo(); + + RegistrarInfo(const RegistrarInfo&); + RegistrarInfo& operator=(const RegistrarInfo&); + + RegistrarInfo(RegistrarInfo&&); + RegistrarInfo& operator=(RegistrarInfo&&); + + std::optional<Registrar> registrar; + IssueTypes issues; +}; + +} // namespace attribution_reporting + +#endif // COMPONENTS_ATTRIBUTION_REPORTING_REGISTRAR_INFO_H_
diff --git a/components/attribution_reporting/registrar_info_unittest.cc b/components/attribution_reporting/registrar_info_unittest.cc new file mode 100644 index 0000000..0281dc1 --- /dev/null +++ b/components/attribution_reporting/registrar_info_unittest.cc
@@ -0,0 +1,379 @@ +// 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/attribution_reporting/registrar_info.h" + +#include <optional> + +#include "components/attribution_reporting/registrar.h" +#include "services/network/public/mojom/attribution.mojom-shared.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace attribution_reporting { +namespace { + +using ::network::mojom::AttributionSupport; +using ::testing::AllOf; +using ::testing::Eq; +using ::testing::Field; + +TEST(RegistrarInfoTest, GetForSource) { + const struct { + const char* description; + bool has_web_header; + bool has_os_header; + std::optional<Registrar> preferred_platform; + AttributionSupport support; + ::testing::Matcher<RegistrarInfo> matches; + } kTestCases[] = { + { + "no-headers", + false, + false, + std::nullopt, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-unspecified-both", + true, + true, + std::nullopt, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kWebAndOsHeaders}))), + }, + { + "preferred-unspecified-web", + true, + false, + std::nullopt, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kWeb), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-unspecified-web-none", + true, + false, + std::nullopt, + AttributionSupport::kNone, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kSourceIgnored}))), + }, + { + "preferred-unspecified-os", + false, + true, + std::nullopt, + AttributionSupport::kOs, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kOs), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-unspecified-os-none", + false, + true, + std::nullopt, + AttributionSupport::kNone, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kOsSourceIgnored}))), + }, + { + "preferred-os-both", + true, + true, + Registrar::kOs, + AttributionSupport::kWebAndOs, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kOs), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-os-both-web", + true, + true, + Registrar::kOs, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kWeb), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kOsSourceIgnored}))), + }, + { + "preferred-os-both-none", + true, + true, + Registrar::kOs, + AttributionSupport::kNone, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kOsSourceIgnored, + IssueType::kSourceIgnored}))), + }, + { + "preferred-os-os-web", + false, + true, + Registrar::kOs, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kOsSourceIgnored}))), + }, + { + "preferred-os-web", + true, + false, + Registrar::kOs, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kNoRegisterOsSourceHeader}))), + }, + { + "preferred-web-both", + true, + true, + Registrar::kWeb, + AttributionSupport::kWebAndOs, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kWeb), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-web-both-os", + true, + true, + Registrar::kWeb, + AttributionSupport::kOs, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kOs), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kSourceIgnored}))), + }, + { + "preferred-web-both-none", + true, + true, + Registrar::kWeb, + AttributionSupport::kNone, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kSourceIgnored, + IssueType::kOsSourceIgnored}))), + }, + { + "preferred-web-web-os", + true, + false, + Registrar::kWeb, + AttributionSupport::kOs, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kSourceIgnored}))), + }, + { + "preferred-web-os", + false, + true, + Registrar::kWeb, + AttributionSupport::kOs, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kNoRegisterSourceHeader}))), + }, + }; + + for (const auto& test_case : kTestCases) { + SCOPED_TRACE(test_case.description); + EXPECT_THAT( + RegistrarInfo::Get(test_case.has_web_header, test_case.has_os_header, + /*is_source=*/true, test_case.preferred_platform, + test_case.support), + test_case.matches); + } +} + +TEST(RegistrarInfoTest, GetForTrigger) { + const struct { + const char* description; + bool has_web_header; + bool has_os_header; + std::optional<Registrar> preferred_platform; + AttributionSupport support; + ::testing::Matcher<RegistrarInfo> matches; + } kTestCases[] = { + { + "no-headers", + false, + false, + std::nullopt, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-unspecified-both", + true, + true, + std::nullopt, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kWebAndOsHeaders}))), + }, + { + "preferred-unspecified-web", + true, + false, + std::nullopt, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kWeb), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-unspecified-web-none", + true, + false, + std::nullopt, + AttributionSupport::kNone, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kTriggerIgnored}))), + }, + { + "preferred-unspecified-os", + false, + true, + std::nullopt, + AttributionSupport::kOs, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kOs), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-unspecified-os-none", + false, + true, + std::nullopt, + AttributionSupport::kNone, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kOsTriggerIgnored}))), + }, + { + "preferred-os-both", + true, + true, + Registrar::kOs, + AttributionSupport::kWebAndOs, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kOs), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-os-both-web", + true, + true, + Registrar::kOs, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kWeb), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kOsTriggerIgnored}))), + }, + { + "preferred-os-both-none", + true, + true, + Registrar::kOs, + AttributionSupport::kNone, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kOsTriggerIgnored, + IssueType::kTriggerIgnored}))), + }, + { + "preferred-os-os-web", + false, + true, + Registrar::kOs, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kOsTriggerIgnored}))), + }, + { + "preferred-os-web", + true, + false, + Registrar::kOs, + AttributionSupport::kWeb, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kNoRegisterOsTriggerHeader}))), + }, + { + "preferred-web-both", + true, + true, + Registrar::kWeb, + AttributionSupport::kWebAndOs, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kWeb), + Field(&RegistrarInfo::issues, IssueTypes())), + }, + { + "preferred-web-both-os", + true, + true, + Registrar::kWeb, + AttributionSupport::kOs, + AllOf(Field(&RegistrarInfo::registrar, Registrar::kOs), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kTriggerIgnored}))), + }, + { + "preferred-web-both-none", + true, + true, + Registrar::kWeb, + AttributionSupport::kNone, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kTriggerIgnored, + IssueType::kOsTriggerIgnored}))), + }, + { + "preferred-web-web-os", + true, + false, + Registrar::kWeb, + AttributionSupport::kOs, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kTriggerIgnored}))), + }, + { + "preferred-web-os", + false, + true, + Registrar::kWeb, + AttributionSupport::kOs, + AllOf(Field(&RegistrarInfo::registrar, Eq(std::nullopt)), + Field(&RegistrarInfo::issues, + IssueTypes({IssueType::kNoRegisterTriggerHeader}))), + }, + }; + + for (const auto& test_case : kTestCases) { + SCOPED_TRACE(test_case.description); + EXPECT_THAT( + RegistrarInfo::Get(test_case.has_web_header, test_case.has_os_header, + /*is_source=*/false, test_case.preferred_platform, + test_case.support), + test_case.matches); + } +} + +} // namespace +} // namespace attribution_reporting
diff --git a/components/attribution_reporting/registrar_unittest.cc b/components/attribution_reporting/registrar_unittest.cc deleted file mode 100644 index 3eb811d9..0000000 --- a/components/attribution_reporting/registrar_unittest.cc +++ /dev/null
@@ -1,80 +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 "components/attribution_reporting/registrar.h" - -#include <optional> -#include <string_view> - -#include "testing/gtest/include/gtest/gtest.h" - -namespace attribution_reporting { -namespace { - -TEST(RegistrarTest, ParseInfo) { - const struct { - const char* description; - std::string_view header; - base::expected<std::optional<Registrar>, PreferredPlatformError> expected; - } kTestCases[] = { - { - "empty", - "", - std::nullopt, - }, - { - "list", - R"("foo", "bar")", - base::unexpected(PreferredPlatformError()), - }, - { - "prefer-web", - "preferred-platform=web", - Registrar::kWeb, - }, - { - "prefer-os", - "preferred-platform=os", - Registrar::kOs, - }, - { - "parameter-ignored", - "preferred-platform=os;abc", - Registrar::kOs, - }, - { - "missing-value", - "preferred-platform", - base::unexpected(PreferredPlatformError()), - }, - { - "unknown-value", - "preferred-platform=abc", - base::unexpected(PreferredPlatformError()), - }, - { - "invalid-type", - "preferred-platform=\"os\"", - base::unexpected(PreferredPlatformError()), - }, - { - "inner-list", - "preferred-platform=(foo bar)", - base::unexpected(PreferredPlatformError()), - }, - { - "unknown-field", - "unknown", - std::nullopt, - }, - }; - - for (const auto& test_case : kTestCases) { - SCOPED_TRACE(test_case.description); - EXPECT_EQ(ParseInfo(test_case.header), test_case.expected); - } -} - -} // namespace -} // namespace attribution_reporting
diff --git a/components/attribution_reporting/registration_info.cc b/components/attribution_reporting/registration_info.cc index a5f7eb6..42e1b79 100644 --- a/components/attribution_reporting/registration_info.cc +++ b/components/attribution_reporting/registration_info.cc
@@ -5,128 +5,58 @@ #include "components/attribution_reporting/registration_info.h" #include <optional> +#include <string> +#include <string_view> -#include "base/containers/enum_set.h" -#include "base/functional/function_ref.h" +#include "base/types/expected.h" #include "components/attribution_reporting/registrar.h" -#include "services/network/public/cpp/attribution_utils.h" -#include "services/network/public/mojom/attribution.mojom-shared.h" +#include "net/http/structured_headers.h" namespace attribution_reporting { namespace { - -using SetRegistrarOrIssueFunc = base::FunctionRef< - void(bool, network::mojom::AttributionSupport, RegistrationInfo&)>; - -void SetRegistrarOrIssue( - bool is_source, - network::mojom::AttributionSupport support, - Registrar registrar, - IssueType source_issue, - IssueType trigger_issue, - base::FunctionRef<bool(network::mojom::AttributionSupport)> check_func, - RegistrationInfo& info) { - if (check_func(support)) { - info.registrar = registrar; - } else { - info.issues.Put(is_source ? source_issue : trigger_issue); - } -} - -void SetWebRegistrarOrIssue(bool is_source, - network::mojom::AttributionSupport support, - RegistrationInfo& info) { - SetRegistrarOrIssue(is_source, support, Registrar::kWeb, - IssueType::kSourceIgnored, IssueType::kTriggerIgnored, - &network::HasAttributionWebSupport, info); -} - -void SetOsRegistrarOrIssue(bool is_source, - network::mojom::AttributionSupport support, - RegistrationInfo& info) { - SetRegistrarOrIssue(is_source, support, Registrar::kOs, - IssueType::kOsSourceIgnored, IssueType::kOsTriggerIgnored, - &network::HasAttributionOsSupport, info); -} - -void HandlePreferredPlatform(bool is_source, - network::mojom::AttributionSupport support, - IssueType source_issue, - IssueType trigger_issue, - bool has_preferred_header, - SetRegistrarOrIssueFunc preferred_func, - bool has_secondary_header, - SetRegistrarOrIssueFunc secondary_func, - RegistrationInfo& info) { - if (!has_preferred_header) { - info.issues.Put(is_source ? source_issue : trigger_issue); - return; - } - - preferred_func(is_source, support, info); - - if (!info.registrar.has_value() && has_secondary_header) { - secondary_func(is_source, support, info); - } -} - +constexpr char kPreferredPlatform[] = "preferred-platform"; } // namespace -RegistrationInfo::RegistrationInfo() = default; - -RegistrationInfo::~RegistrationInfo() = default; - -RegistrationInfo::RegistrationInfo(const RegistrationInfo&) = default; - -RegistrationInfo& RegistrationInfo::operator=(const RegistrationInfo&) = - default; - -RegistrationInfo::RegistrationInfo(RegistrationInfo&&) = default; - -RegistrationInfo& RegistrationInfo::operator=(RegistrationInfo&&) = default; - -// static -RegistrationInfo RegistrationInfo::Get( - bool has_web_header, - bool has_os_header, - bool is_source, - std::optional<Registrar> preferred_platform, - network::mojom::AttributionSupport support) { - if (!has_web_header && !has_os_header) { - return RegistrationInfo(); +base::expected<std::optional<Registrar>, RegistrationInfoError> ParseInfo( + std::string_view header) { + if (header.empty()) { + return std::nullopt; } - RegistrationInfo info; - - if (!preferred_platform.has_value()) { - if (has_web_header && has_os_header) { - info.issues.Put(IssueType::kWebAndOsHeaders); - } else if (has_web_header) { - SetWebRegistrarOrIssue(is_source, support, info); - } else if (has_os_header) { - SetOsRegistrarOrIssue(is_source, support, info); - } - return info; + const auto dict = net::structured_headers::ParseDictionary(header); + if (!dict) { + return base::unexpected(RegistrationInfoError()); } - switch (preferred_platform.value()) { - case attribution_reporting::Registrar::kWeb: - HandlePreferredPlatform( - is_source, support, IssueType::kNoRegisterSourceHeader, - IssueType::kNoRegisterTriggerHeader, has_web_header, - &SetWebRegistrarOrIssue, has_os_header, &SetOsRegistrarOrIssue, info); - break; - case attribution_reporting::Registrar::kOs: - HandlePreferredPlatform(is_source, support, - IssueType::kNoRegisterOsSourceHeader, - IssueType::kNoRegisterOsTriggerHeader, - has_os_header, &SetOsRegistrarOrIssue, - has_web_header, &SetWebRegistrarOrIssue, info); - break; + return ParseInfo(*dict); +} + +base::expected<std::optional<Registrar>, RegistrationInfoError> ParseInfo( + const net::structured_headers::Dictionary& dict) { + auto iter = dict.find(kPreferredPlatform); + if (iter == dict.end()) { + return std::nullopt; } - return info; + const auto& parameterized_member = iter->second; + if (parameterized_member.member_is_inner_list) { + return base::unexpected(RegistrationInfoError()); + } + + const auto& parameterized_item = parameterized_member.member.front(); + if (!parameterized_item.item.is_token()) { + return base::unexpected(RegistrationInfoError()); + } + + const std::string& token = parameterized_item.item.GetString(); + if (token == "web") { + return Registrar::kWeb; + } else if (token == "os") { + return Registrar::kOs; + } else { + return base::unexpected(RegistrationInfoError()); + } } } // namespace attribution_reporting
diff --git a/components/attribution_reporting/registration_info.h b/components/attribution_reporting/registration_info.h index bbec2081..1e103e3c 100644 --- a/components/attribution_reporting/registration_info.h +++ b/components/attribution_reporting/registration_info.h
@@ -6,54 +6,39 @@ #define COMPONENTS_ATTRIBUTION_REPORTING_REGISTRATION_INFO_H_ #include <optional> -#include <vector> +#include <string_view> #include "base/component_export.h" -#include "base/containers/enum_set.h" #include "base/types/expected.h" -#include "services/network/public/mojom/attribution.mojom-forward.h" +#include "net/http/structured_headers.h" namespace attribution_reporting { enum class Registrar; -enum class IssueType { - kWebAndOsHeaders, - kSourceIgnored, - kTriggerIgnored, - kOsSourceIgnored, - kOsTriggerIgnored, - kNoRegisterSourceHeader, - kNoRegisterTriggerHeader, - kNoRegisterOsSourceHeader, - kNoRegisterOsTriggerHeader, - - kMinValue = kWebAndOsHeaders, - kMaxValue = kNoRegisterOsTriggerHeader, +struct RegistrationInfoError { + friend bool operator==(const RegistrationInfoError&, + const RegistrationInfoError&) = default; }; -using IssueTypes = - base::EnumSet<IssueType, IssueType::kMinValue, IssueType::kMaxValue>; +// Parses an Attribution-Reporting-Info header for the preferred platform. +// +// Currently only 'preferred-platform' field is expected in the +// Attribution-Reporting-Info header. Any other fields are ignored. +// Returns an error if the string is not parsable as a structured-header +// dictionary or the value of 'preferred-platform' is not an allowed token. +// +// Example: +// +// `preferred-platform=web` or `preferred-platform=os` +COMPONENT_EXPORT(ATTRIBUTION_REPORTING) +base::expected<std::optional<Registrar>, RegistrationInfoError> ParseInfo( + std::string_view); -struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING) RegistrationInfo { - static RegistrationInfo Get(bool has_web_header, - bool has_os_header, - bool is_source, - std::optional<Registrar> preferred_platform, - network::mojom::AttributionSupport); - - RegistrationInfo(); - ~RegistrationInfo(); - - RegistrationInfo(const RegistrationInfo&); - RegistrationInfo& operator=(const RegistrationInfo&); - - RegistrationInfo(RegistrationInfo&&); - RegistrationInfo& operator=(RegistrationInfo&&); - - std::optional<Registrar> registrar; - IssueTypes issues; -}; +// Same as the above, but using an already-parsed structured-header dictionary. +COMPONENT_EXPORT(ATTRIBUTION_REPORTING) +base::expected<std::optional<Registrar>, RegistrationInfoError> ParseInfo( + const net::structured_headers::Dictionary&); } // namespace attribution_reporting
diff --git a/components/attribution_reporting/registration_info_unittest.cc b/components/attribution_reporting/registration_info_unittest.cc index 6e0e909e..c93099b 100644 --- a/components/attribution_reporting/registration_info_unittest.cc +++ b/components/attribution_reporting/registration_info_unittest.cc
@@ -5,373 +5,75 @@ #include "components/attribution_reporting/registration_info.h" #include <optional> +#include <string_view> #include "components/attribution_reporting/registrar.h" -#include "services/network/public/mojom/attribution.mojom-shared.h" -#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" namespace attribution_reporting { namespace { -using ::network::mojom::AttributionSupport; -using ::testing::AllOf; -using ::testing::Eq; -using ::testing::Field; - -TEST(RegistrationInfoTest, GetForSource) { +TEST(RegistrationInfoTest, ParseInfo) { const struct { const char* description; - bool has_web_header; - bool has_os_header; - std::optional<Registrar> preferred_platform; - AttributionSupport support; - ::testing::Matcher<RegistrationInfo> matches; + std::string_view header; + base::expected<std::optional<Registrar>, RegistrationInfoError> expected; } kTestCases[] = { { - "no-headers", - false, - false, + "empty", + "", std::nullopt, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, IssueTypes())), }, { - "preferred-unspecified-both", - true, - true, - std::nullopt, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kWebAndOsHeaders}))), + "list", + R"("foo", "bar")", + base::unexpected(RegistrationInfoError()), }, { - "preferred-unspecified-web", - true, - false, - std::nullopt, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kWeb), - Field(&RegistrationInfo::issues, IssueTypes())), - }, - { - "preferred-unspecified-web-none", - true, - false, - std::nullopt, - AttributionSupport::kNone, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kSourceIgnored}))), - }, - { - "preferred-unspecified-os", - false, - true, - std::nullopt, - AttributionSupport::kOs, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kOs), - Field(&RegistrationInfo::issues, IssueTypes())), - }, - { - "preferred-unspecified-os-none", - false, - true, - std::nullopt, - AttributionSupport::kNone, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kOsSourceIgnored}))), - }, - { - "preferred-os-both", - true, - true, - Registrar::kOs, - AttributionSupport::kWebAndOs, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kOs), - Field(&RegistrationInfo::issues, IssueTypes())), - }, - { - "preferred-os-both-web", - true, - true, - Registrar::kOs, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kWeb), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kOsSourceIgnored}))), - }, - { - "preferred-os-both-none", - true, - true, - Registrar::kOs, - AttributionSupport::kNone, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kOsSourceIgnored, - IssueType::kSourceIgnored}))), - }, - { - "preferred-os-os-web", - false, - true, - Registrar::kOs, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kOsSourceIgnored}))), - }, - { - "preferred-os-web", - true, - false, - Registrar::kOs, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kNoRegisterOsSourceHeader}))), - }, - { - "preferred-web-both", - true, - true, + "prefer-web", + "preferred-platform=web", Registrar::kWeb, - AttributionSupport::kWebAndOs, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kWeb), - Field(&RegistrationInfo::issues, IssueTypes())), }, { - "preferred-web-both-os", - true, - true, - Registrar::kWeb, - AttributionSupport::kOs, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kOs), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kSourceIgnored}))), + "prefer-os", + "preferred-platform=os", + Registrar::kOs, }, { - "preferred-web-both-none", - true, - true, - Registrar::kWeb, - AttributionSupport::kNone, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kSourceIgnored, - IssueType::kOsSourceIgnored}))), + "parameter-ignored", + "preferred-platform=os;abc", + Registrar::kOs, }, { - "preferred-web-web-os", - true, - false, - Registrar::kWeb, - AttributionSupport::kOs, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kSourceIgnored}))), + "missing-value", + "preferred-platform", + base::unexpected(RegistrationInfoError()), }, { - "preferred-web-os", - false, - true, - Registrar::kWeb, - AttributionSupport::kOs, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kNoRegisterSourceHeader}))), + "unknown-value", + "preferred-platform=abc", + base::unexpected(RegistrationInfoError()), + }, + { + "invalid-type", + "preferred-platform=\"os\"", + base::unexpected(RegistrationInfoError()), + }, + { + "inner-list", + "preferred-platform=(foo bar)", + base::unexpected(RegistrationInfoError()), + }, + { + "unknown-field", + "unknown", + std::nullopt, }, }; for (const auto& test_case : kTestCases) { SCOPED_TRACE(test_case.description); - EXPECT_THAT( - RegistrationInfo::Get(test_case.has_web_header, test_case.has_os_header, - /*is_source=*/true, test_case.preferred_platform, - test_case.support), - test_case.matches); - } -} - -TEST(RegistrationInfoTest, GetForTrigger) { - const struct { - const char* description; - bool has_web_header; - bool has_os_header; - std::optional<Registrar> preferred_platform; - AttributionSupport support; - ::testing::Matcher<RegistrationInfo> matches; - } kTestCases[] = { - { - "no-headers", - false, - false, - std::nullopt, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, IssueTypes())), - }, - { - "preferred-unspecified-both", - true, - true, - std::nullopt, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kWebAndOsHeaders}))), - }, - { - "preferred-unspecified-web", - true, - false, - std::nullopt, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kWeb), - Field(&RegistrationInfo::issues, IssueTypes())), - }, - { - "preferred-unspecified-web-none", - true, - false, - std::nullopt, - AttributionSupport::kNone, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kTriggerIgnored}))), - }, - { - "preferred-unspecified-os", - false, - true, - std::nullopt, - AttributionSupport::kOs, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kOs), - Field(&RegistrationInfo::issues, IssueTypes())), - }, - { - "preferred-unspecified-os-none", - false, - true, - std::nullopt, - AttributionSupport::kNone, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kOsTriggerIgnored}))), - }, - { - "preferred-os-both", - true, - true, - Registrar::kOs, - AttributionSupport::kWebAndOs, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kOs), - Field(&RegistrationInfo::issues, IssueTypes())), - }, - { - "preferred-os-both-web", - true, - true, - Registrar::kOs, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kWeb), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kOsTriggerIgnored}))), - }, - { - "preferred-os-both-none", - true, - true, - Registrar::kOs, - AttributionSupport::kNone, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kOsTriggerIgnored, - IssueType::kTriggerIgnored}))), - }, - { - "preferred-os-os-web", - false, - true, - Registrar::kOs, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kOsTriggerIgnored}))), - }, - { - "preferred-os-web", - true, - false, - Registrar::kOs, - AttributionSupport::kWeb, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kNoRegisterOsTriggerHeader}))), - }, - { - "preferred-web-both", - true, - true, - Registrar::kWeb, - AttributionSupport::kWebAndOs, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kWeb), - Field(&RegistrationInfo::issues, IssueTypes())), - }, - { - "preferred-web-both-os", - true, - true, - Registrar::kWeb, - AttributionSupport::kOs, - AllOf(Field(&RegistrationInfo::registrar, Registrar::kOs), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kTriggerIgnored}))), - }, - { - "preferred-web-both-none", - true, - true, - Registrar::kWeb, - AttributionSupport::kNone, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kTriggerIgnored, - IssueType::kOsTriggerIgnored}))), - }, - { - "preferred-web-web-os", - true, - false, - Registrar::kWeb, - AttributionSupport::kOs, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kTriggerIgnored}))), - }, - { - "preferred-web-os", - false, - true, - Registrar::kWeb, - AttributionSupport::kOs, - AllOf(Field(&RegistrationInfo::registrar, Eq(std::nullopt)), - Field(&RegistrationInfo::issues, - IssueTypes({IssueType::kNoRegisterTriggerHeader}))), - }, - }; - - for (const auto& test_case : kTestCases) { - SCOPED_TRACE(test_case.description); - EXPECT_THAT( - RegistrationInfo::Get(test_case.has_web_header, test_case.has_os_header, - /*is_source=*/false, test_case.preferred_platform, - test_case.support), - test_case.matches); + EXPECT_EQ(ParseInfo(test_case.header), test_case.expected); } }
diff --git a/components/autofill/content/renderer/form_cache_browsertest.cc b/components/autofill/content/renderer/form_cache_browsertest.cc index ba3ff27..1070c547 100644 --- a/components/autofill/content/renderer/form_cache_browsertest.cc +++ b/components/autofill/content/renderer/form_cache_browsertest.cc
@@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/autofill/content/renderer/form_cache.h" + #include <optional> #include <string_view> -#include "base/memory/raw_ref.h" -#include "base/test/scoped_feature_list.h" - #include "base/memory/raw_ptr.h" +#include "base/memory/raw_ref.h" #include "base/ranges/algorithm.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "components/autofill/content/renderer/focus_test_utils.h" #include "components/autofill/content/renderer/form_autofill_util.h" -#include "components/autofill/content/renderer/form_cache.h" #include "components/autofill/content/renderer/form_cache_test_api.h" #include "components/autofill/content/renderer/test_utils.h" #include "components/autofill/core/common/autofill_features.h"
diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc index e827701..dd9dfb8 100644 --- a/components/autofill/core/browser/browser_autofill_manager.cc +++ b/components/autofill/core/browser/browser_autofill_manager.cc
@@ -6,6 +6,7 @@ #include <stddef.h> #include <stdint.h> + #include <iterator> #include <limits> #include <map>
diff --git a/components/autofill/core/browser/browser_autofill_manager_unittest.cc b/components/autofill/core/browser/browser_autofill_manager_unittest.cc index ae8528878..31a32aa 100644 --- a/components/autofill/core/browser/browser_autofill_manager_unittest.cc +++ b/components/autofill/core/browser/browser_autofill_manager_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 "components/autofill/core/browser/browser_autofill_manager.h" + #include <stddef.h> #include <memory> @@ -37,7 +39,6 @@ #include "components/autofill/core/browser/autofill_plus_address_delegate.h" #include "components/autofill/core/browser/autofill_suggestion_generator.h" #include "components/autofill/core/browser/autofill_test_utils.h" -#include "components/autofill/core/browser/browser_autofill_manager.h" #include "components/autofill/core/browser/browser_autofill_manager_test_api.h" #include "components/autofill/core/browser/crowdsourcing/mock_autofill_crowdsourcing_manager.h" #include "components/autofill/core/browser/data_model/autofill_profile.h"
diff --git a/components/autofill/core/browser/field_filling_address_util.h b/components/autofill/core/browser/field_filling_address_util.h index f2fc097..22369bb5 100644 --- a/components/autofill/core/browser/field_filling_address_util.h +++ b/components/autofill/core/browser/field_filling_address_util.h
@@ -6,6 +6,7 @@ #define COMPONENTS_AUTOFILL_CORE_BROWSER_FIELD_FILLING_ADDRESS_UTIL_H_ #include <stdint.h> + #include <optional> #include <string>
diff --git a/components/autofill/core/browser/form_structure_unittest.cc b/components/autofill/core/browser/form_structure_unittest.cc index efa08144..3b0dee0 100644 --- a/components/autofill/core/browser/form_structure_unittest.cc +++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -5,9 +5,9 @@ #include "components/autofill/core/browser/form_structure.h" #include <stddef.h> -#include <cstdint> #include <algorithm> +#include <cstdint> #include <functional> #include <memory> #include <optional>
diff --git a/components/autofill/core/browser/manual_testing_import_unittest.cc b/components/autofill/core/browser/manual_testing_import_unittest.cc index ae956c46..50dd558 100644 --- a/components/autofill/core/browser/manual_testing_import_unittest.cc +++ b/components/autofill/core/browser/manual_testing_import_unittest.cc
@@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <vector> - -#include "base/test/scoped_feature_list.h" -#include "components/autofill/core/browser/country_type.h" #include "components/autofill/core/browser/manual_testing_import.h" #include <optional> +#include <vector> + #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/json/json_reader.h" +#include "base/test/scoped_feature_list.h" #include "base/values.h" +#include "components/autofill/core/browser/country_type.h" #include "components/autofill/core/browser/data_model/autofill_profile.h" #include "components/autofill/core/browser/data_model/credit_card.h" #include "components/autofill/core/browser/field_types.h"
diff --git a/components/autofill/core/browser/payments/legal_message_line_fuzzer.cc b/components/autofill/core/browser/payments/legal_message_line_fuzzer.cc index 793c12a..29830a2e 100644 --- a/components/autofill/core/browser/payments/legal_message_line_fuzzer.cc +++ b/components/autofill/core/browser/payments/legal_message_line_fuzzer.cc
@@ -2,14 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <stdint.h> +#include "components/autofill/core/browser/payments/legal_message_line.h" #include <fuzzer/FuzzedDataProvider.h> +#include <stdint.h> + #include <optional> #include "base/json/json_reader.h" #include "base/values.h" -#include "components/autofill/core/browser/payments/legal_message_line.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { FuzzedDataProvider provider(data, size);
diff --git a/components/autofill/core/browser/payments/payments_network_interface_unittest.cc b/components/autofill/core/browser/payments/payments_network_interface_unittest.cc index 7ba01de..6e66abe 100644 --- a/components/autofill/core/browser/payments/payments_network_interface_unittest.cc +++ b/components/autofill/core/browser/payments/payments_network_interface_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 "components/autofill/core/browser/payments/payments_network_interface.h" + #include <optional> #include <set> #include <string> @@ -26,7 +28,6 @@ #include "components/autofill/core/browser/payments/client_behavior_constants.h" #include "components/autofill/core/browser/payments/credit_card_save_manager.h" #include "components/autofill/core/browser/payments/local_card_migration_manager.h" -#include "components/autofill/core/browser/payments/payments_network_interface.h" #include "components/autofill/core/browser/payments/payments_network_interface_test_base.h" #include "components/autofill/core/browser/payments/virtual_card_enrollment_flow.h" #include "components/autofill/core/browser/test_personal_data_manager.h"
diff --git a/components/autofill/core/browser/strike_databases/simple_autofill_strike_database.h b/components/autofill/core/browser/strike_databases/simple_autofill_strike_database.h index 3566fdd..e7af75f19 100644 --- a/components/autofill/core/browser/strike_databases/simple_autofill_strike_database.h +++ b/components/autofill/core/browser/strike_databases/simple_autofill_strike_database.h
@@ -6,6 +6,7 @@ #define COMPONENTS_AUTOFILL_CORE_BROWSER_STRIKE_DATABASES_SIMPLE_AUTOFILL_STRIKE_DATABASE_H_ #include <stddef.h> + #include <optional> #include <string> #include <string_view>
diff --git a/components/autofill/core/browser/strike_databases/strike_database_integrator_base.h b/components/autofill/core/browser/strike_databases/strike_database_integrator_base.h index 9b916fa..54358414 100644 --- a/components/autofill/core/browser/strike_databases/strike_database_integrator_base.h +++ b/components/autofill/core/browser/strike_databases/strike_database_integrator_base.h
@@ -6,6 +6,7 @@ #define COMPONENTS_AUTOFILL_CORE_BROWSER_STRIKE_DATABASES_STRIKE_DATABASE_INTEGRATOR_BASE_H_ #include <stdint.h> + #include <map> #include <optional> #include <string>
diff --git a/components/autofill/core/browser/ui/autofill_image_fetcher.h b/components/autofill/core/browser/ui/autofill_image_fetcher.h index ad78d70..02bb244 100644 --- a/components/autofill/core/browser/ui/autofill_image_fetcher.h +++ b/components/autofill/core/browser/ui/autofill_image_fetcher.h
@@ -5,14 +5,13 @@ #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_UI_AUTOFILL_IMAGE_FETCHER_H_ #define COMPONENTS_AUTOFILL_CORE_BROWSER_UI_AUTOFILL_IMAGE_FETCHER_H_ -#include "components/autofill/core/browser/ui/autofill_image_fetcher_base.h" - #include <memory> #include <optional> #include "base/barrier_callback.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" +#include "components/autofill/core/browser/ui/autofill_image_fetcher_base.h" class GURL;
diff --git a/components/autofill/core/browser/ui/mock_autofill_popup_delegate.h b/components/autofill/core/browser/ui/mock_autofill_popup_delegate.h index 97430e02..82becf5 100644 --- a/components/autofill/core/browser/ui/mock_autofill_popup_delegate.h +++ b/components/autofill/core/browser/ui/mock_autofill_popup_delegate.h
@@ -5,12 +5,11 @@ #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_UI_MOCK_AUTOFILL_POPUP_DELEGATE_H_ #define COMPONENTS_AUTOFILL_CORE_BROWSER_UI_MOCK_AUTOFILL_POPUP_DELEGATE_H_ -#include "components/autofill/core/browser/ui/autofill_popup_delegate.h" - #include <optional> #include "base/functional/callback.h" #include "base/memory/weak_ptr.h" +#include "components/autofill/core/browser/ui/autofill_popup_delegate.h" #include "testing/gmock/include/gmock/gmock.h" namespace autofill {
diff --git a/components/autofill/core/browser/ui/payments/card_unmask_prompt_controller_impl.h b/components/autofill/core/browser/ui/payments/card_unmask_prompt_controller_impl.h index 6708db53..0446826 100644 --- a/components/autofill/core/browser/ui/payments/card_unmask_prompt_controller_impl.h +++ b/components/autofill/core/browser/ui/payments/card_unmask_prompt_controller_impl.h
@@ -104,7 +104,7 @@ AutofillMetrics::UnmaskPromptEvent GetCloseReasonEvent(); CardUnmaskPromptOptions card_unmask_prompt_options_; - const raw_ptr<PrefService> pref_service_; + const raw_ptr<PrefService, DanglingUntriaged> pref_service_; bool new_card_link_clicked_ = false; CreditCard card_; base::WeakPtr<CardUnmaskDelegate> delegate_;
diff --git a/components/autofill/core/browser/webdata/payments/autofill_wallet_metadata_sync_bridge.cc b/components/autofill/core/browser/webdata/payments/autofill_wallet_metadata_sync_bridge.cc index db77267a..0c5a7981 100644 --- a/components/autofill/core/browser/webdata/payments/autofill_wallet_metadata_sync_bridge.cc +++ b/components/autofill/core/browser/webdata/payments/autofill_wallet_metadata_sync_bridge.cc
@@ -18,10 +18,10 @@ #include "base/pickle.h" #include "components/autofill/core/browser/data_model/autofill_metadata.h" #include "components/autofill/core/browser/data_model/credit_card.h" -#include "components/autofill/core/browser/webdata/payments/payments_sync_bridge_util.h" #include "components/autofill/core/browser/webdata/autofill_sync_metadata_table.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/autofill/core/browser/webdata/payments/payments_autofill_table.h" +#include "components/autofill/core/browser/webdata/payments/payments_sync_bridge_util.h" #include "components/autofill/core/common/autofill_clock.h" #include "components/autofill/core/common/autofill_util.h" #include "components/sync/base/model_type.h"
diff --git a/components/autofill_payments_strings.grdp b/components/autofill_payments_strings.grdp index 577df57..bc5ee88f 100644 --- a/components/autofill_payments_strings.grdp +++ b/components/autofill_payments_strings.grdp
@@ -11,6 +11,12 @@ <message name="IDS_AUTOFILL_SAVE_IBAN_BUBBLE_SAVE_NO_THANKS" desc="The text label for `No thanks` button used in autofill prompt IBAN (International Bank Account Number) local save bubble on desktop."> No thanks </message> + <message name="IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_NO_THANKS" desc="Text for the cancel button in the mandatory reauth opt-in prompt. If the user clicks this button, mandatory reauth will not be enabled. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information." formatter_data="android_java"> + No thanks + </message> + <message name="IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_ACCEPT" desc="Text for the accept button in the mandatory reauth opt-in prompt. If the user clicks this button, mandatory reauth will be enabled. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information." formatter_data="android_java"> + Turn on + </message> </if> <if expr="use_titlecase"> <message name="IDS_AUTOFILL_NO_THANKS_DESKTOP_LOCAL_SAVE" desc="In Title Case: The label for cancel button used in autofill credit card local save bubble on desktop."> @@ -22,6 +28,12 @@ <message name="IDS_AUTOFILL_SAVE_IBAN_BUBBLE_SAVE_NO_THANKS" desc="The text label for `No Thanks` button used in autofill prompt IBAN (International Bank Account Number) local save bubble on desktop."> No Thanks </message> + <message name="IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_NO_THANKS" desc="Text for the cancel button in the mandatory reauth opt-in prompt. If the user clicks this button, mandatory reauth will not be enabled. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information." formatter_data="android_java"> + No Thanks + </message> + <message name="IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_ACCEPT" desc="Text for the accept button in the mandatory reauth opt-in prompt. If the user clicks this button, mandatory reauth will be enabled. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information." formatter_data="android_java"> + Turn On + </message> </if> <if expr="is_android or is_ios"> @@ -694,18 +706,19 @@ </message> <!-- Mandatory Reauth related strings - start --> - <message name="IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_NO_THANKS" desc="Text for the cancel button in the mandatory reauth opt-in prompt. If the user clicks this button, mandatory reauth will not be enabled. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information." formatter_data="android_java"> - No thanks - </message> - <message name="IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_ACCEPT" desc="Text for the accept button in the mandatory reauth opt-in prompt. If the user clicks this button, mandatory reauth will be enabled. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information." formatter_data="android_java"> - Yes - </message> <message name="IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_TITLE" desc="Title text for the mandatory reauth opt-in prompt that is displayed to the user after filling in payment method information. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information." formatter_data="android_java"> - Always verify? + Turn on manual verification? </message> + <if expr="_google_chrome"> <message name="IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_EXPLANATION" desc="Explanation text for the mandatory reauth opt-in prompt that is displayed to the user after filling in payment method information. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information." formatter_data="android_java"> - For added security on shared devices, turn on verification every time you pay using autofill. + If you share this device, Chrome can ask you to verify every time you pay using autofill </message> + </if> + <if expr="not _google_chrome"> + <message name="IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_EXPLANATION" desc="Explanation text for the mandatory reauth opt-in prompt that is displayed to the user after filling in payment method information. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information." formatter_data="android_java"> + If you share this device, Chromium can ask you to verify every time you pay using autofill + </message> + </if> <message name="IDS_AUTOFILL_MANDATORY_REAUTH_ICON_TOOLTIP" desc="The tooltip message for the omnibox icon for the mandatory reauth opt-in bubble on Desktop. This bubble prompts users if they would like to enroll in mandatory reauth. Mandatory reauth requires the user to unlock their device or pass a biometric auth when autofilling payment method information."> Enable mandatory re-authentication </message> @@ -1073,7 +1086,7 @@ <!-- Mandatory Reauth related strings --> <message name="IDS_AUTOFILL_SETTINGS_PAGE_ENABLE_PAYMENT_METHOD_MANDATORY_REAUTH_LABEL" desc="Label for a settings page toggle that allows users to control whether or not to add mandatory reauth for payment methods filling." formatter_data="android_java"> - Always verify when using autofill + Manually verify every time you pay using autofill </message> <message name="IDS_AUTOFILL_SETTINGS_PAGE_ENABLE_PAYMENT_METHOD_MANDATORY_REAUTH_SUBLABEL" desc="Sublabel for a settings page toggle that allows users to control whether or not to add mandatory reauth for payment methods filling." formatter_data="android_java"> When turned off, you may be asked occasionally to verify for security purposes
diff --git a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_ACCEPT.png.sha1 b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_ACCEPT.png.sha1 index 13333fb..409f63f3 100644 --- a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_ACCEPT.png.sha1 +++ b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_ACCEPT.png.sha1
@@ -1 +1 @@ -49b48998884871826cb354584d396116f9125491 \ No newline at end of file +77192483c9b9849a8a7f6e90d4d597fdc23e0c04 \ No newline at end of file
diff --git a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_EXPLANATION.png.sha1 b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_EXPLANATION.png.sha1 index 13333fb..409f63f3 100644 --- a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_EXPLANATION.png.sha1 +++ b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_EXPLANATION.png.sha1
@@ -1 +1 @@ -49b48998884871826cb354584d396116f9125491 \ No newline at end of file +77192483c9b9849a8a7f6e90d4d597fdc23e0c04 \ No newline at end of file
diff --git a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_NO_THANKS.png.sha1 b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_NO_THANKS.png.sha1 index d1e7c53d..409f63f3 100644 --- a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_NO_THANKS.png.sha1 +++ b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_NO_THANKS.png.sha1
@@ -1 +1 @@ -d8c1afa17bfb67b26544374d00b72fa464de8d01 \ No newline at end of file +77192483c9b9849a8a7f6e90d4d597fdc23e0c04 \ No newline at end of file
diff --git a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_TITLE.png.sha1 b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_TITLE.png.sha1 index 13333fb..409f63f3 100644 --- a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_TITLE.png.sha1 +++ b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_MANDATORY_REAUTH_OPT_IN_TITLE.png.sha1
@@ -1 +1 @@ -49b48998884871826cb354584d396116f9125491 \ No newline at end of file +77192483c9b9849a8a7f6e90d4d597fdc23e0c04 \ No newline at end of file
diff --git a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_SETTINGS_PAGE_ENABLE_PAYMENT_METHOD_MANDATORY_REAUTH_LABEL.png.sha1 b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_SETTINGS_PAGE_ENABLE_PAYMENT_METHOD_MANDATORY_REAUTH_LABEL.png.sha1 index f30210f..b2b42dd 100644 --- a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_SETTINGS_PAGE_ENABLE_PAYMENT_METHOD_MANDATORY_REAUTH_LABEL.png.sha1 +++ b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_SETTINGS_PAGE_ENABLE_PAYMENT_METHOD_MANDATORY_REAUTH_LABEL.png.sha1
@@ -1 +1 @@ -7ed1ae960ff08c9d4b41ef100229d631e6e229f6 \ No newline at end of file +afc9f02cc589a53c3b07c55ad3a14f8e9bba3688 \ No newline at end of file
diff --git a/components/browsing_topics/browsing_topics_service_impl.cc b/components/browsing_topics/browsing_topics_service_impl.cc index c628216..91c80635 100644 --- a/components/browsing_topics/browsing_topics_service_impl.cc +++ b/components/browsing_topics/browsing_topics_service_impl.cc
@@ -31,6 +31,15 @@ namespace { +enum class NumberOfTopics { + kZero = 0, + kOne = 1, + kTwo = 2, + kThree = 3, + + kMaxValue = kThree, +}; + // Returns whether the topics should all be cleared given // `browsing_topics_data_accessible_since` and `is_topic_allowed_by_settings`. // Returns true if `browsing_topics_data_accessible_since` is greater than the @@ -217,16 +226,19 @@ } } - const int kBuckets = 10; - DCHECK_GE(kBuckets, - blink::features::kBrowsingTopicsNumberOfEpochsToExpose.Get()); + CHECK_GE(real_count, 0); + CHECK_GE(fake_count, 0); + CHECK_GE(filtered_count, 0); + CHECK_LE(real_count, static_cast<int>(NumberOfTopics::kMaxValue)); + CHECK_LE(fake_count, static_cast<int>(NumberOfTopics::kMaxValue)); + CHECK_LE(filtered_count, static_cast<int>(NumberOfTopics::kMaxValue)); - base::UmaHistogramExactLinear("BrowsingTopics.Result.RealTopicCount", - real_count, kBuckets); - base::UmaHistogramExactLinear("BrowsingTopics.Result.FakeTopicCount", - fake_count, kBuckets); - base::UmaHistogramExactLinear("BrowsingTopics.Result.FilteredTopicCount", - filtered_count, kBuckets); + base::UmaHistogramEnumeration("BrowsingTopics.Result.RealTopicCount", + static_cast<NumberOfTopics>(real_count)); + base::UmaHistogramEnumeration("BrowsingTopics.Result.FakeTopicCount", + static_cast<NumberOfTopics>(fake_count)); + base::UmaHistogramEnumeration("BrowsingTopics.Result.FilteredTopicCount", + static_cast<NumberOfTopics>(filtered_count)); builder.Record(ukm_recorder->Get()); }
diff --git a/components/commerce/core/compare/product_specifications_server_proxy_unittest.cc b/components/commerce/core/compare/product_specifications_server_proxy_unittest.cc index 21fa66d..e2d0482 100644 --- a/components/commerce/core/compare/product_specifications_server_proxy_unittest.cc +++ b/components/commerce/core/compare/product_specifications_server_proxy_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/commerce/core/compare/product_specifications_server_proxy.h" + #include <memory> #include <optional> #include "base/functional/callback.h" #include "base/run_loop.h" #include "base/test/task_environment.h" -#include "components/commerce/core/compare/product_specifications_server_proxy.h" #include "services/data_decoder/public/cpp/data_decoder.h" #include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/components/compose/core/browser/compose_manager_impl_unittest.cc b/components/compose/core/browser/compose_manager_impl_unittest.cc index ec0a68f..4bd3fcf 100644 --- a/components/compose/core/browser/compose_manager_impl_unittest.cc +++ b/components/compose/core/browser/compose_manager_impl_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 "components/compose/core/browser/compose_manager_impl.h" + #include <memory> #include <optional> #include <utility> @@ -14,7 +16,6 @@ #include "components/autofill/core/common/autofill_test_utils.h" #include "components/autofill/core/common/form_data.h" #include "components/compose/core/browser/compose_client.h" -#include "components/compose/core/browser/compose_manager_impl.h" #include "components/compose/core/browser/compose_metrics.h" #include "components/ukm/test_ukm_recorder.h" #include "services/metrics/public/cpp/ukm_builders.h"
diff --git a/components/exo/wayland/xdg_shell.cc b/components/exo/wayland/xdg_shell.cc index b3e1a56..3e5b632 100644 --- a/components/exo/wayland/xdg_shell.cc +++ b/components/exo/wayland/xdg_shell.cc
@@ -8,6 +8,7 @@ #include <wayland-server-protocol-core.h> #include <xdg-decoration-unstable-v1-server-protocol.h> #include <xdg-shell-server-protocol.h> + #include <optional> #include "ash/public/cpp/shell_window_ids.h"
diff --git a/components/feature_engagement/public/feature_configurations.cc b/components/feature_engagement/public/feature_configurations.cc index 1f40c54..595e247 100644 --- a/components/feature_engagement/public/feature_configurations.cc +++ b/components/feature_engagement/public/feature_configurations.cc
@@ -132,7 +132,7 @@ std::optional<FeatureConfig> config = FeatureConfig(); config->valid = true; config->trigger = - EventConfig("password_saved", Comparator(LESS_THAN, 1), 180, 180); + EventConfig("password_saved", Comparator(LESS_THAN, 1), 360, 360); config->session_rate = Comparator(ANY, 0); config->availability = Comparator(ANY, 0); return config; @@ -142,7 +142,7 @@ std::optional<FeatureConfig> config = FeatureConfig(); config->valid = true; config->trigger = - EventConfig("signin_flow_detected", Comparator(LESS_THAN, 1), 180, 180); + EventConfig("signin_flow_detected", Comparator(LESS_THAN, 1), 360, 360); config->session_rate = Comparator(ANY, 0); config->availability = Comparator(ANY, 0); return config;
diff --git a/components/feature_engagement/public/feature_constants.cc b/components/feature_engagement/public/feature_constants.cc index 164a91c..020c1e8 100644 --- a/components/feature_engagement/public/feature_constants.cc +++ b/components/feature_engagement/public/feature_constants.cc
@@ -86,10 +86,10 @@ base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kIPHPasswordsManagementBubbleAfterSaveFeature, "IPH_PasswordsManagementBubbleAfterSave", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kIPHPasswordsManagementBubbleDuringSigninFeature, "IPH_PasswordsManagementBubbleDuringSignin", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kIPHPasswordsWebAppProfileSwitchFeature, "IPH_PasswordsWebAppProfileSwitch", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/components/history_clusters/core/features.cc b/components/history_clusters/core/features.cc index 51af4b3..31e9ec1 100644 --- a/components/history_clusters/core/features.cc +++ b/components/history_clusters/core/features.cc
@@ -113,10 +113,6 @@ const base::FeatureParam<bool> kSidePanelJourneysOpensFromOmnibox{ &kSidePanelJourneys, "SidePanelJourneysOpensFromOmnibox", true}; -BASE_FEATURE(kRenameJourneys, - "RenameJourneys", - base::FEATURE_ENABLED_BY_DEFAULT); - // Intended to be Enabled by default on Desktop and the flag left here as a // killswitch. BASE_FEATURE(kSearchesFindUngroupedVisits,
diff --git a/components/history_clusters/core/features.h b/components/history_clusters/core/features.h index 94e2259..fbdb71e 100644 --- a/components/history_clusters/core/features.h +++ b/components/history_clusters/core/features.h
@@ -99,9 +99,6 @@ extern const base::FeatureParam<bool> kSidePanelJourneysOpensFromOmnibox; BASE_DECLARE_FEATURE(kSidePanelJourneysQueryless); -// Enables renaming Journeys in the UI. -BASE_DECLARE_FEATURE(kRenameJourneys); - // Enables Side Panel Grouped History and WebUI Grouped History to find // ungrouped visits as well when the user has typed a search query. BASE_DECLARE_FEATURE(kSearchesFindUngroupedVisits);
diff --git a/components/history_clusters/core/history_clusters_service.cc b/components/history_clusters/core/history_clusters_service.cc index b052ef7..429b662f 100644 --- a/components/history_clusters/core/history_clusters_service.cc +++ b/components/history_clusters/core/history_clusters_service.cc
@@ -154,14 +154,12 @@ void HistoryClustersService::Shutdown() {} bool HistoryClustersService::IsJourneysEnabledAndVisible() const { - const bool rename_journeys = base::FeatureList::IsEnabled(kRenameJourneys); const bool journeys_is_managed = pref_service_->IsManagedPreference(prefs::kVisible); - // When history_clusters::kRenameJourneys is enabled, history clusters are - // always visible unless the visibility prefs is set to false by policy. + // History clusters are always visible unless the visibility prefs is + // set to false by policy. return is_journeys_feature_flag_enabled_ && - (pref_service_->GetBoolean(prefs::kVisible) || - (rename_journeys && !journeys_is_managed)); + (pref_service_->GetBoolean(prefs::kVisible) || !journeys_is_managed); } // static
diff --git a/components/history_clusters/core/url_constants.cc b/components/history_clusters/core/url_constants.cc index 0427d7a5..50d9933f7 100644 --- a/components/history_clusters/core/url_constants.cc +++ b/components/history_clusters/core/url_constants.cc
@@ -9,9 +9,7 @@ namespace history_clusters { const char* GetChromeUIHistoryClustersURL() { - return base::FeatureList::IsEnabled(history_clusters::kRenameJourneys) - ? "chrome://history/grouped" - : "chrome://history/journeys"; + return "chrome://history/grouped"; } } // namespace history_clusters
diff --git a/components/history_clusters_strings.grdp b/components/history_clusters_strings.grdp index a4da752..3a115995 100644 --- a/components/history_clusters_strings.grdp +++ b/components/history_clusters_strings.grdp
@@ -12,21 +12,9 @@ <message name="IDS_HISTORY_CLUSTERS_DELETE_PRIOR_VISITS_WARNING" desc="Warning shown before deleting from the history clusters page"> Are you sure you want to delete these pages from your history? </message> - <message name="IDS_HISTORY_CLUSTERS_DISABLE_MENU_ITEM_LABEL" desc="A label for the menu item to turn off the Journeys feature, which collects different search and browsing activities related to a single topic into a single place, and organizes them by topic. See glossary entry for meaning of 'Journeys'."> - Turn off Journeys - </message> - <message name="IDS_HISTORY_CLUSTERS_ENABLE_MENU_ITEM_LABEL" desc="A label for the menu item to turn on the Journeys feature, which collects different search and browsing activities related to a single topic into a single place, and organizes them by topic. See glossary entry for meaning of 'Journeys'."> - Turn on Journeys - </message> - <message name="IDS_HISTORY_CLUSTERS_JOURNEYS_TAB_LABEL" desc="A label for the section in Chrome History (chrome://history) where Journeys are collected and shown to the user. See glossary entry for meaning of 'Journeys'."> - Journeys - </message> <message name="IDS_HISTORY_CLUSTERS_BY_GROUP_TAB_LABEL" desc="A label for the section in Chrome History (chrome://history) where a list of history items organized into groups of pages are shown to the user."> By group </message> - <message name="IDS_HISTORY_CLUSTERS_LIST_TAB_LABEL" desc="A label for the section in Chrome History (chrome://history) where a list of history items are shown to the user."> - List - </message> <message name="IDS_HISTORY_CLUSTERS_BY_DATE_TAB_LABEL" desc="A label for the section in Chrome History (chrome://history) where a list of history items are shown to the user."> By date </message> @@ -94,9 +82,6 @@ <message name="IDS_HISTORY_CLUSTERS_SAVED_IN_TABGROUP_LABEL" desc="A label indicating whether a history item was added to a tab group."> Saved in tab group </message> - <message name="IDS_HISTORY_CLUSTERS_SEARCH_PROMPT" desc="A placeholder for the search bar in the side panel."> - Search Journeys - </message> <message name="IDS_HISTORY_CLUSTERS_CUT" desc="Label of the item in drop-down menu that allows the user to cut the searchbox query"> Cut </message>
diff --git a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_DISABLE_MENU_ITEM_LABEL.png.sha1 b/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_DISABLE_MENU_ITEM_LABEL.png.sha1 deleted file mode 100644 index 89a107a6b..0000000 --- a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_DISABLE_MENU_ITEM_LABEL.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -e4c50977c1953af182eb2503a0c59a567205bafc \ No newline at end of file
diff --git a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_ENABLE_MENU_ITEM_LABEL.png.sha1 b/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_ENABLE_MENU_ITEM_LABEL.png.sha1 deleted file mode 100644 index 8e9590f3..0000000 --- a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_ENABLE_MENU_ITEM_LABEL.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -043de46f71cf8f7aaa71fb3ac0d01da52c15d35d \ No newline at end of file
diff --git a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_JOURNEYS_TAB_LABEL.png.sha1 b/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_JOURNEYS_TAB_LABEL.png.sha1 deleted file mode 100644 index ee9dfb6a..0000000 --- a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_JOURNEYS_TAB_LABEL.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -5856c4100ea8ebddbf2223ccdc7fbac6fa8c2eb9 \ No newline at end of file
diff --git a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_LIST_TAB_LABEL.png.sha1 b/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_LIST_TAB_LABEL.png.sha1 deleted file mode 100644 index 5371cfb..0000000 --- a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_LIST_TAB_LABEL.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -4ffbe741a547282addf291c3500b0df42422429d \ No newline at end of file
diff --git a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_SEARCH_PROMPT.png.sha1 b/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_SEARCH_PROMPT.png.sha1 deleted file mode 100644 index bac3bdd43..0000000 --- a/components/history_clusters_strings_grdp/IDS_HISTORY_CLUSTERS_SEARCH_PROMPT.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -c2dc220bd037b4b79fab5420efbf436ce9d75d22 \ No newline at end of file
diff --git a/components/javascript_dialogs/app_modal_dialog_controller.h b/components/javascript_dialogs/app_modal_dialog_controller.h index f56ceb32..95af6efe 100644 --- a/components/javascript_dialogs/app_modal_dialog_controller.h +++ b/components/javascript_dialogs/app_modal_dialog_controller.h
@@ -124,7 +124,7 @@ // A map of extra Chrome-only data associated with the delegate_. Can be // inspected via |extra_data_map_[web_contents_]|. - raw_ptr<ExtraDataMap> extra_data_map_; + raw_ptr<ExtraDataMap, LeakedDanglingUntriaged> extra_data_map_; // Information about the message box is held in the following variables. const content::JavaScriptDialogType javascript_dialog_type_;
diff --git a/components/metrics/structured/lib/key_data_provider.cc b/components/metrics/structured/lib/key_data_provider.cc index 246dcb1e..3aac9df 100644 --- a/components/metrics/structured/lib/key_data_provider.cc +++ b/components/metrics/structured/lib/key_data_provider.cc
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/metrics/structured/lib/key_data_provider.h" + #include <optional> #include <string> -#include "components/metrics/structured/lib/key_data_provider.h" - namespace metrics::structured { KeyDataProvider::KeyDataProvider() = default;
diff --git a/components/omnibox/browser/actions/history_clusters_action_unittest.cc b/components/omnibox/browser/actions/history_clusters_action_unittest.cc index 78c723d..6e2f7744 100644 --- a/components/omnibox/browser/actions/history_clusters_action_unittest.cc +++ b/components/omnibox/browser/actions/history_clusters_action_unittest.cc
@@ -9,7 +9,6 @@ #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_refptr.h" #include "base/ranges/algorithm.h" -#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "components/history/core/browser/history_service.h" #include "components/history/core/test/history_service_test_util.h" @@ -62,9 +61,6 @@ // `history_dir_` needs to be initialized once only. void SetUp() override { - scoped_feature_list_.InitAndDisableFeature( - history_clusters::kRenameJourneys); - CHECK(history_dir_.CreateUniqueTempDir()); history_service_ = history::CreateHistoryService(history_dir_.GetPath(), true); @@ -129,12 +125,13 @@ void SetHistoryClustersVisiblePref(bool value) { prefs_enabled_.SetBoolean(history_clusters::prefs::kVisible, value); + // Make the history clusters visible pref managed. + prefs_enabled_.SetManagedPref(history_clusters::prefs::kVisible, + std::make_unique<base::Value>(value)); } base::test::TaskEnvironment task_environment_; - base::test::ScopedFeatureList scoped_feature_list_; - base::ScopedTempDir history_dir_; std::unique_ptr<history::HistoryService> history_service_; std::unique_ptr<HistoryClustersService> history_clusters_service_;
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc index f06c376..434fde67 100644 --- a/components/omnibox/browser/autocomplete_controller.cc +++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -1716,6 +1716,10 @@ bool AutocompleteController::ShouldRunProvider( AutocompleteProvider* provider) const { + if (!provider) { + return false; + } + if (input_.InKeywordMode()) { // Only a subset of providers are run when we're in a starter pack keyword // mode. Try to grab the TemplateURL to determine if we're in starter pack @@ -1771,9 +1775,10 @@ case AutocompleteProvider::TYPE_DOCUMENT: return !(omnibox_feature_configs::LimitKeywordModeSuggestions::Get() .limit_document_suggestions) || - base::StartsWith(keyword_turl->url(), - "https://drive.google.com", - base::CompareCase::INSENSITIVE_ASCII); + (keyword_turl && + base::StartsWith(keyword_turl->url(), + "https://drive.google.com", + base::CompareCase::INSENSITIVE_ASCII)); // Don't run on device head provider. case AutocompleteProvider::TYPE_ON_DEVICE_HEAD:
diff --git a/components/omnibox/browser/history_cluster_provider.cc b/components/omnibox/browser/history_cluster_provider.cc index acf84e14..1d834289 100644 --- a/components/omnibox/browser/history_cluster_provider.cc +++ b/components/omnibox/browser/history_cluster_provider.cc
@@ -179,10 +179,8 @@ FindTermMatches(input_.text(), text), text.length(), ACMatchClassification::MATCH, ACMatchClassification::NONE); - match.contents = l10n_util::GetStringUTF16( - base::FeatureList::IsEnabled(history_clusters::kRenameJourneys) - ? IDS_OMNIBOX_HISTORY_CLUSTERS_SEARCH_HINT - : IDS_OMNIBOX_ACTION_HISTORY_CLUSTERS_SEARCH_HINT); + match.contents = + l10n_util::GetStringUTF16(IDS_OMNIBOX_HISTORY_CLUSTERS_SEARCH_HINT); match.contents_class = {{0, ACMatchClassification::DIM}}; CompleteHistoryClustersMatch(base::UTF16ToUTF8(text),
diff --git a/components/omnibox/browser/history_cluster_provider_unittest.cc b/components/omnibox/browser/history_cluster_provider_unittest.cc index cf6cafc8..12e637f6 100644 --- a/components/omnibox/browser/history_cluster_provider_unittest.cc +++ b/components/omnibox/browser/history_cluster_provider_unittest.cc
@@ -8,7 +8,6 @@ #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_refptr.h" -#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "components/history/core/browser/history_service.h" #include "components/history_clusters/core/config.h" @@ -45,9 +44,6 @@ public AutocompleteProviderListener { public: void SetUp() override { - scoped_feature_list_.InitAndDisableFeature( - history_clusters::kRenameJourneys); - config_.is_journeys_enabled_no_locale_check = true; config_.omnibox_history_cluster_provider = true; // Setting this to false even though users see true behavior so that we do @@ -124,8 +120,6 @@ base::test::TaskEnvironment task_environment_; - base::test::ScopedFeatureList scoped_feature_list_; - std::unique_ptr<FakeAutocompleteProviderClient> autocomplete_provider_client_; base::ScopedTempDir history_dir_; @@ -170,10 +164,10 @@ ASSERT_EQ(provider_->matches().size(), 1u); EXPECT_EQ(provider_->matches()[0].relevance, 900); EXPECT_EQ(provider_->matches()[0].description, u"keyword"); - EXPECT_EQ(provider_->matches()[0].contents, u"Resume your journey"); + EXPECT_EQ(provider_->matches()[0].contents, u"Resume browsing"); EXPECT_EQ(provider_->matches()[0].fill_into_edit, u"keyword"); EXPECT_EQ(provider_->matches()[0].destination_url, - GURL("chrome://history/journeys?q=keyword")); + GURL("chrome://history/grouped?q=keyword")); EXPECT_TRUE(on_provider_update_calls_.empty()); }
diff --git a/components/optimization_guide/core/BUILD.gn b/components/optimization_guide/core/BUILD.gn index 40fc769..3bf1225 100644 --- a/components/optimization_guide/core/BUILD.gn +++ b/components/optimization_guide/core/BUILD.gn
@@ -256,6 +256,8 @@ "model_execution/session_impl.h", "model_execution/settings_enabled_observer.cc", "model_execution/settings_enabled_observer.h", + "model_execution/substitution.cc", + "model_execution/substitution.h", output_proto_descriptors_cc_file, ] } @@ -473,6 +475,7 @@ "model_execution/optimization_guide_model_execution_error_unittest.cc", "model_execution/redactor_unittest.cc", "model_execution/repetition_checker_unittest.cc", + "model_execution/substitution_unittest.cc", "model_execution/test_on_device_model_component.cc", "model_execution/test_on_device_model_component.h", ]
diff --git a/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.cc b/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.cc index fbbd30f..483c6c5 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.cc
@@ -21,9 +21,6 @@ namespace { -// The maximum number of args that can be substituted in the string template. -static constexpr int kMaxArgs = 32; - std::unique_ptr<proto::OnDeviceModelExecutionConfig> ReadOnDeviceModelExecutionConfig(const base::FilePath& path) { // Unpack and verify model config file. @@ -67,66 +64,6 @@ return rules; } -std::string StringPrintfVector(const std::string& string_template, - std::vector<std::string> args) { - CHECK(args.size() <= kMaxArgs); - - args.resize(kMaxArgs, ""); - return base::StringPrintfNonConstexpr( - string_template.c_str(), args[0].c_str(), args[1].c_str(), - args[2].c_str(), args[3].c_str(), args[4].c_str(), args[5].c_str(), - args[6].c_str(), args[7].c_str(), args[8].c_str(), args[9].c_str(), - args[10].c_str(), args[11].c_str(), args[12].c_str(), args[13].c_str(), - args[14].c_str(), args[15].c_str(), args[16].c_str(), args[17].c_str(), - args[18].c_str(), args[19].c_str(), args[20].c_str(), args[21].c_str(), - args[22].c_str(), args[23].c_str(), args[24].c_str(), args[25].c_str(), - args[26].c_str(), args[27].c_str(), args[28].c_str(), args[29].c_str(), - args[30].c_str(), args[31].c_str()); -} - -// Returns whether `condition` applies based on `message`. -bool EvaluateCondition(const google::protobuf::MessageLite& message, - const proto::Condition& condition) { - std::optional<proto::Value> proto_value = - GetProtoValue(message, condition.proto_field()); - if (!proto_value) { - return false; - } - - switch (condition.operator_type()) { - case proto::OPERATOR_TYPE_EQUAL_TO: - return AreValuesEqual(*proto_value, condition.value()); - case proto::OPERATOR_TYPE_NOT_EQUAL_TO: - return !AreValuesEqual(*proto_value, condition.value()); - case proto::OPERATOR_TYPE_UNSPECIFIED: - NOTREACHED(); - return false; - } -} - -// Returns whether `conditions` apply based on `message`. -bool DoConditionsApply(const google::protobuf::MessageLite& message, - const proto::ConditionList& conditions) { - if (conditions.conditions_size() == 0) { - return true; - } - - for (const auto& condition : conditions.conditions()) { - bool applies = EvaluateCondition(message, condition); - if (applies && conditions.condition_evaluation_type() == - proto::CONDITION_EVALUATION_TYPE_OR) { - return true; - } - if (!applies && conditions.condition_evaluation_type() == - proto::CONDITION_EVALUATION_TYPE_AND) { - return false; - } - } - - return conditions.condition_evaluation_type() == - proto::CONDITION_EVALUATION_TYPE_AND; -} - } // namespace OnDeviceModelExecutionConfigInterpreter:: @@ -230,8 +167,7 @@ feature_to_data_.clear(); } -std::optional< - OnDeviceModelExecutionConfigInterpreter::InputStringConstructionResult> +std::optional<SubstitutionResult> OnDeviceModelExecutionConfigInterpreter::ConstructInputString( proto::ModelExecutionFeature feature, const google::protobuf::MessageLite& request, @@ -251,52 +187,12 @@ if (input_config.request_base_name() != request.GetTypeName()) { return std::nullopt; } - - // Construct string. - std::vector<std::string> substitutions; - bool should_ignore_input_context = false; google::protobuf::RepeatedPtrField<proto::SubstitutedString> config_substitutions = want_input_context ? input_config.input_context_substitutions() : input_config.execute_substitutions(); - for (const auto& substitution : config_substitutions) { - if (!DoConditionsApply(request, substitution.conditions())) { - continue; - } - if (substitution.should_ignore_input_context()) { - should_ignore_input_context = true; - } - - std::vector<std::string> args(substitution.substitutions_size()); - for (int32_t i = 0; i < substitution.substitutions_size(); ++i) { - const auto& arg = substitution.substitutions(i); - for (const auto& candidate : arg.candidates()) { - if (!DoConditionsApply(request, candidate.conditions())) { - continue; - } - - if (candidate.has_raw_string()) { - args[i] = candidate.raw_string(); - } else if (candidate.has_proto_field()) { - std::optional<proto::Value> value = - GetProtoValue(request, candidate.proto_field()); - if (!value) { - return std::nullopt; - } - args[i] = GetStringFromValue(*value); - } - break; - } - } - - substitutions.push_back( - StringPrintfVector(substitution.string_template(), std::move(args))); - } - - return InputStringConstructionResult{ - .input_string = base::StrCat(substitutions), - .should_ignore_input_context = should_ignore_input_context}; + return CreateSubstitutions(request, config_substitutions); } std::optional<proto::Any>
diff --git a/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.h b/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.h index 742d2c8c..49b2598 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.h +++ b/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.h
@@ -14,6 +14,7 @@ #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/task/sequenced_task_runner.h" +#include "components/optimization_guide/core/model_execution/substitution.h" #include "components/optimization_guide/proto/model_execution.pb.h" namespace optimization_guide { @@ -36,19 +37,8 @@ // Whether there is an on-device model execution config for `feature`. bool HasConfigForFeature(proto::ModelExecutionFeature feature) const; - struct InputStringConstructionResult { - // The input string for the feature and request. Will return - // std::nullopt if there is not a valid config for the feature or the - // request could not be fulfilled for any reason. - std::string input_string; - - // If this is not a request for input context, this returns whether the - // existing input context should be ignored for the execution. - bool should_ignore_input_context = false; - }; - // Constructs the input string for `feature` and `request`. - std::optional<InputStringConstructionResult> ConstructInputString( + std::optional<SubstitutionResult> ConstructInputString( proto::ModelExecutionFeature feature, const google::protobuf::MessageLite& request, bool want_input_context) const;
diff --git a/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter_unittest.cc b/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter_unittest.cc index 0805915..31bf3226 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter_unittest.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter_unittest.cc
@@ -188,15 +188,16 @@ } TEST_F(OnDeviceModelExecutionConfigInterpeterTest, - ConstructInputStringSimpleRawStringInputContext) { + ConstructInputStringForInputContext) { proto::OnDeviceModelExecutionConfig config; auto* fc = config.add_feature_configs(); fc->set_feature(proto::MODEL_EXECUTION_FEATURE_COMPOSE); auto* input_config = fc->mutable_input_config(); input_config->set_request_base_name("base.test.TestMessage"); - auto* substitution = input_config->add_input_context_substitutions(); - substitution->set_string_template("hello this is a %s"); - substitution->add_substitutions()->add_candidates()->set_raw_string("test"); + auto* ctx_substitution = input_config->add_input_context_substitutions(); + ctx_substitution->set_string_template("hello this is %s"); + ctx_substitution->add_substitutions()->add_candidates()->set_raw_string( + "input context"); auto* execute_substitution = input_config->add_execute_substitutions(); execute_substitution->set_string_template("this should be ignored"); UpdateInterpreterWithConfig(config); @@ -208,19 +209,22 @@ /*want_input_context=*/true); ASSERT_TRUE(result.has_value()); - EXPECT_EQ(result->input_string, "hello this is a test"); + EXPECT_EQ(result->input_string, "hello this is input context"); } TEST_F(OnDeviceModelExecutionConfigInterpeterTest, - ConstructInputStringFeatureConfigExistsSimpleRawString) { + ConstructInputStringForExecution) { proto::OnDeviceModelExecutionConfig config; auto* fc = config.add_feature_configs(); fc->set_feature(proto::MODEL_EXECUTION_FEATURE_COMPOSE); auto* input_config = fc->mutable_input_config(); input_config->set_request_base_name("base.test.TestMessage"); - auto* substitution = input_config->add_execute_substitutions(); - substitution->set_string_template("hello this is a %s"); - substitution->add_substitutions()->add_candidates()->set_raw_string("test"); + auto* ctx_substitution = input_config->add_input_context_substitutions(); + ctx_substitution->set_string_template("this should be ignored"); + auto* execute_substitution = input_config->add_execute_substitutions(); + execute_substitution->set_string_template("hello this is %s"); + execute_substitution->add_substitutions()->add_candidates()->set_raw_string( + "execution"); UpdateInterpreterWithConfig(config); base::test::TestMessage test; @@ -230,153 +234,7 @@ /*want_input_context=*/false); ASSERT_TRUE(result.has_value()); - EXPECT_EQ(result->input_string, "hello this is a test"); - EXPECT_FALSE(result->should_ignore_input_context); -} - -TEST_F(OnDeviceModelExecutionConfigInterpeterTest, - ConstructInputStringFeatureWithProtoField) { - proto::OnDeviceModelExecutionConfig config; - auto* fc = config.add_feature_configs(); - fc->set_feature(proto::MODEL_EXECUTION_FEATURE_COMPOSE); - auto* input_config = fc->mutable_input_config(); - input_config->set_request_base_name( - "optimization_guide.proto.ComposeRequest"); - auto* input_substitutions = input_config->add_input_context_substitutions(); - input_substitutions->set_string_template("this is ignored"); - auto* substitution = input_config->add_execute_substitutions(); - substitution->set_string_template("hello this is a test: %s %s"); - substitution->set_should_ignore_input_context(true); - auto* proto_field2 = substitution->add_substitutions() - ->add_candidates() - ->mutable_proto_field(); - proto_field2->add_proto_descriptors()->set_tag_number(3); - proto_field2->add_proto_descriptors()->set_tag_number(2); - auto* proto_field3 = substitution->add_substitutions() - ->add_candidates() - ->mutable_proto_field(); - proto_field3->add_proto_descriptors()->set_tag_number(7); - proto_field3->add_proto_descriptors()->set_tag_number(1); - UpdateInterpreterWithConfig(config); - - proto::ComposeRequest request; - request.mutable_page_metadata()->set_page_title("nested"); - request.mutable_generate_params()->set_user_input("inner type"); - auto result = interpreter()->ConstructInputString( - proto::MODEL_EXECUTION_FEATURE_COMPOSE, request, - /*want_input_context=*/false); - - ASSERT_TRUE(result.has_value()); - EXPECT_EQ(result->input_string, "hello this is a test: nested inner type"); - EXPECT_TRUE(result->should_ignore_input_context); -} - -TEST_F(OnDeviceModelExecutionConfigInterpeterTest, - ConstructInputStringFeatureWithBadProtoField) { - proto::OnDeviceModelExecutionConfig config; - auto* fc = config.add_feature_configs(); - fc->set_feature(proto::MODEL_EXECUTION_FEATURE_COMPOSE); - auto* input_config = fc->mutable_input_config(); - input_config->set_request_base_name( - "optimization_guide.proto.ComposeRequest"); - auto* substitution = input_config->add_execute_substitutions(); - substitution->set_string_template("hello this is a test: %s"); - auto* proto_field = substitution->add_substitutions() - ->add_candidates() - ->mutable_proto_field(); - proto_field->add_proto_descriptors()->set_tag_number(10000); - UpdateInterpreterWithConfig(config); - - proto::ComposeRequest request; - request.mutable_page_metadata()->set_page_title("nested"); - auto result = interpreter()->ConstructInputString( - proto::MODEL_EXECUTION_FEATURE_COMPOSE, request, - /*want_input_context=*/false); - - EXPECT_FALSE(result); -} - -TEST_F(OnDeviceModelExecutionConfigInterpeterTest, - ConstructInputStringWithConditions) { - proto::OnDeviceModelExecutionConfig config; - auto* fc = config.add_feature_configs(); - fc->set_feature(proto::MODEL_EXECUTION_FEATURE_COMPOSE); - auto* input_config = fc->mutable_input_config(); - input_config->set_request_base_name( - "optimization_guide.proto.ComposeRequest"); - auto* execute_substitution = input_config->add_execute_substitutions(); - execute_substitution->set_string_template("hello this is a test: %s %s"); - auto* substitution1_proto_field = execute_substitution->add_substitutions() - ->add_candidates() - ->mutable_proto_field(); - substitution1_proto_field->add_proto_descriptors()->set_tag_number(8); - substitution1_proto_field->add_proto_descriptors()->set_tag_number(1); - auto* substitution2 = execute_substitution->add_substitutions(); - auto* arg1 = substitution2->add_candidates(); - auto* proto_field1 = arg1->mutable_proto_field(); - proto_field1->add_proto_descriptors()->set_tag_number(3); - proto_field1->add_proto_descriptors()->set_tag_number(1); - auto* arg1_conditions = arg1->mutable_conditions(); - arg1_conditions->set_condition_evaluation_type( - proto::CONDITION_EVALUATION_TYPE_OR); - auto* arg1_c1 = arg1_conditions->add_conditions(); - auto* arg1_c1_proto_field = arg1_c1->mutable_proto_field(); - arg1_c1_proto_field->add_proto_descriptors()->set_tag_number(8); - arg1_c1_proto_field->add_proto_descriptors()->set_tag_number(2); - arg1_c1->set_operator_type(proto::OPERATOR_TYPE_EQUAL_TO); - arg1_c1->mutable_value()->set_int32_value(1); - auto* arg1_c2 = arg1_conditions->add_conditions(); - arg1_c2->mutable_proto_field()->add_proto_descriptors()->set_tag_number(8); - arg1_c2->mutable_proto_field()->add_proto_descriptors()->set_tag_number(2); - arg1_c2->set_operator_type(proto::OPERATOR_TYPE_EQUAL_TO); - arg1_c1->mutable_value()->set_int32_value(2); - auto* arg2 = substitution2->add_candidates(); - auto* proto_field2 = arg2->mutable_proto_field(); - proto_field2->add_proto_descriptors()->set_tag_number(3); - proto_field2->add_proto_descriptors()->set_tag_number(2); - auto* arg2_conditions = arg2->mutable_conditions(); - arg2_conditions->set_condition_evaluation_type( - proto::CONDITION_EVALUATION_TYPE_OR); - auto* arg2_c1 = arg2_conditions->add_conditions(); - auto* arg2_c1_proto_field = arg2_c1->mutable_proto_field(); - arg2_c1_proto_field->add_proto_descriptors()->set_tag_number(8); - arg2_c1_proto_field->add_proto_descriptors()->set_tag_number(3); - arg2_c1->set_operator_type(proto::OPERATOR_TYPE_EQUAL_TO); - arg2_c1->mutable_value()->set_int32_value(1); - auto* arg2_c2 = arg2_conditions->add_conditions(); - arg2_c2->mutable_proto_field()->add_proto_descriptors()->set_tag_number(8); - arg2_c2->mutable_proto_field()->add_proto_descriptors()->set_tag_number(3); - arg2_c2->set_operator_type(proto::OPERATOR_TYPE_EQUAL_TO); - arg2_c1->mutable_value()->set_int32_value(2); - - auto* execute_substitution2 = input_config->add_execute_substitutions(); - execute_substitution2->set_string_template("should be ignored: %s"); - execute_substitution2->add_substitutions()->add_candidates()->set_raw_string( - "also ignored"); - auto* es2_conditions = execute_substitution2->mutable_conditions(); - es2_conditions->set_condition_evaluation_type( - proto::CONDITION_EVALUATION_TYPE_AND); - auto* c1 = es2_conditions->add_conditions(); - auto* c1_proto_field = c1->mutable_proto_field(); - c1_proto_field->add_proto_descriptors()->set_tag_number(8); - c1_proto_field->add_proto_descriptors()->set_tag_number(2); - c1->set_operator_type(proto::OPERATOR_TYPE_NOT_EQUAL_TO); - c1->mutable_value()->set_int32_value(0); - UpdateInterpreterWithConfig(config); - - proto::ComposeRequest request; - request.mutable_rewrite_params()->set_previous_response("this is my input"); - request.mutable_rewrite_params()->set_length(proto::COMPOSE_LONGER); - request.mutable_page_metadata()->set_page_title("title"); - request.mutable_page_metadata()->set_page_url("url"); - auto result = interpreter()->ConstructInputString( - proto::MODEL_EXECUTION_FEATURE_COMPOSE, request, - /*want_input_context=*/false); - - ASSERT_TRUE(result.has_value()); - EXPECT_EQ(result->input_string, - "hello this is a test: this is my input title"); - EXPECT_FALSE(result->should_ignore_input_context); + EXPECT_EQ(result->input_string, "hello this is execution"); } TEST_F(OnDeviceModelExecutionConfigInterpeterTest,
diff --git a/components/optimization_guide/core/model_execution/substitution.cc b/components/optimization_guide/core/model_execution/substitution.cc new file mode 100644 index 0000000..fbd0c3e --- /dev/null +++ b/components/optimization_guide/core/model_execution/substitution.cc
@@ -0,0 +1,138 @@ +// 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/optimization_guide/core/model_execution/substitution.h" + +#include <optional> +#include <string> +#include <vector> + +#include "base/containers/contains.h" +#include "base/files/file_util.h" +#include "base/logging.h" +#include "base/strings/strcat.h" +#include "base/strings/stringprintf.h" +#include "base/task/task_traits.h" +#include "base/task/thread_pool.h" +#include "components/optimization_guide/core/model_execution/on_device_model_execution_proto_descriptors.h" +#include "components/optimization_guide/core/model_execution/on_device_model_execution_proto_value_utils.h" +#include "components/optimization_guide/proto/substitution.pb.h" + +namespace optimization_guide { + +namespace { + +// The maximum number of args that can be substituted in the string template. +static constexpr int kMaxArgs = 32; + +std::string StringPrintfVector(const std::string& string_template, + std::vector<std::string> args) { + CHECK(args.size() <= kMaxArgs); + + args.resize(kMaxArgs, ""); + return base::StringPrintfNonConstexpr( + string_template.c_str(), args[0].c_str(), args[1].c_str(), + args[2].c_str(), args[3].c_str(), args[4].c_str(), args[5].c_str(), + args[6].c_str(), args[7].c_str(), args[8].c_str(), args[9].c_str(), + args[10].c_str(), args[11].c_str(), args[12].c_str(), args[13].c_str(), + args[14].c_str(), args[15].c_str(), args[16].c_str(), args[17].c_str(), + args[18].c_str(), args[19].c_str(), args[20].c_str(), args[21].c_str(), + args[22].c_str(), args[23].c_str(), args[24].c_str(), args[25].c_str(), + args[26].c_str(), args[27].c_str(), args[28].c_str(), args[29].c_str(), + args[30].c_str(), args[31].c_str()); +} + +// Returns whether `condition` applies based on `message`. +bool EvaluateCondition(const google::protobuf::MessageLite& message, + const proto::Condition& condition) { + std::optional<proto::Value> proto_value = + GetProtoValue(message, condition.proto_field()); + if (!proto_value) { + return false; + } + + switch (condition.operator_type()) { + case proto::OPERATOR_TYPE_EQUAL_TO: + return AreValuesEqual(*proto_value, condition.value()); + case proto::OPERATOR_TYPE_NOT_EQUAL_TO: + return !AreValuesEqual(*proto_value, condition.value()); + case proto::OPERATOR_TYPE_UNSPECIFIED: + NOTREACHED(); + return false; + } +} + +// Returns whether `conditions` apply based on `message`. +bool DoConditionsApply(const google::protobuf::MessageLite& message, + const proto::ConditionList& conditions) { + if (conditions.conditions_size() == 0) { + return true; + } + + for (const auto& condition : conditions.conditions()) { + bool applies = EvaluateCondition(message, condition); + if (applies && conditions.condition_evaluation_type() == + proto::CONDITION_EVALUATION_TYPE_OR) { + return true; + } + if (!applies && conditions.condition_evaluation_type() == + proto::CONDITION_EVALUATION_TYPE_AND) { + return false; + } + } + + return conditions.condition_evaluation_type() == + proto::CONDITION_EVALUATION_TYPE_AND; +} + +} // namespace + +std::optional<SubstitutionResult> CreateSubstitutions( + const google::protobuf::MessageLite& request, + const google::protobuf::RepeatedPtrField<proto::SubstitutedString>& + config_substitutions) { + // Construct string. + std::vector<std::string> substitutions; + bool should_ignore_input_context = false; + for (const auto& substitution : config_substitutions) { + if (!DoConditionsApply(request, substitution.conditions())) { + continue; + } + + if (substitution.should_ignore_input_context()) { + should_ignore_input_context = true; + } + + std::vector<std::string> args(substitution.substitutions_size()); + for (int32_t i = 0; i < substitution.substitutions_size(); ++i) { + const auto& arg = substitution.substitutions(i); + for (const auto& candidate : arg.candidates()) { + if (!DoConditionsApply(request, candidate.conditions())) { + continue; + } + + if (candidate.has_raw_string()) { + args[i] = candidate.raw_string(); + } else if (candidate.has_proto_field()) { + std::optional<proto::Value> value = + GetProtoValue(request, candidate.proto_field()); + if (!value) { + return std::nullopt; + } + args[i] = GetStringFromValue(*value); + } + break; + } + } + + substitutions.push_back( + StringPrintfVector(substitution.string_template(), std::move(args))); + } + + return SubstitutionResult{ + .input_string = base::StrCat(substitutions), + .should_ignore_input_context = should_ignore_input_context}; +} + +} // namespace optimization_guide
diff --git a/components/optimization_guide/core/model_execution/substitution.h b/components/optimization_guide/core/model_execution/substitution.h new file mode 100644 index 0000000..9219bc59 --- /dev/null +++ b/components/optimization_guide/core/model_execution/substitution.h
@@ -0,0 +1,27 @@ +// 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_OPTIMIZATION_GUIDE_CORE_MODEL_EXECUTION_SUBSTITUTION_H_ +#define COMPONENTS_OPTIMIZATION_GUIDE_CORE_MODEL_EXECUTION_SUBSTITUTION_H_ + +#include <optional> +#include <string> +#include <vector> + +#include "components/optimization_guide/proto/substitution.pb.h" + +namespace optimization_guide { + +struct SubstitutionResult { + std::string input_string; + bool should_ignore_input_context; +}; + +std::optional<SubstitutionResult> CreateSubstitutions( + const google::protobuf::MessageLite& request, + const google::protobuf::RepeatedPtrField<proto::SubstitutedString>& + config_substitutions); + +} // namespace optimization_guide + +#endif // COMPONENTS_OPTIMIZATION_GUIDE_CORE_MODEL_EXECUTION_SUBSTITUTION_H_
diff --git a/components/optimization_guide/core/model_execution/substitution_unittest.cc b/components/optimization_guide/core/model_execution/substitution_unittest.cc new file mode 100644 index 0000000..3f47342 --- /dev/null +++ b/components/optimization_guide/core/model_execution/substitution_unittest.cc
@@ -0,0 +1,157 @@ +// 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/optimization_guide/core/model_execution/substitution.h" + +#include "base/test/test.pb.h" +#include "components/optimization_guide/proto/features/compose.pb.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace optimization_guide { + +namespace { + +class SubstitutionTest : public testing::Test { + public: + SubstitutionTest() = default; + ~SubstitutionTest() override = default; +}; + +TEST_F(SubstitutionTest, RawString) { + google::protobuf::RepeatedPtrField<proto::SubstitutedString> subs; + auto* substitution = subs.Add(); + substitution->set_string_template("hello this is a %s"); + substitution->add_substitutions()->add_candidates()->set_raw_string("test"); + + base::test::TestMessage request; + request.set_test("some test"); + auto result = CreateSubstitutions(request, subs); + + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result->input_string, "hello this is a test"); + EXPECT_FALSE(result->should_ignore_input_context); +} + +TEST_F(SubstitutionTest, ProtoField) { + google::protobuf::RepeatedPtrField<proto::SubstitutedString> subs; + auto* substitution = subs.Add(); + substitution->set_string_template("hello this is a test: %s %s"); + substitution->set_should_ignore_input_context(true); + auto* proto_field2 = substitution->add_substitutions() + ->add_candidates() + ->mutable_proto_field(); + proto_field2->add_proto_descriptors()->set_tag_number(3); + proto_field2->add_proto_descriptors()->set_tag_number(2); + auto* proto_field3 = substitution->add_substitutions() + ->add_candidates() + ->mutable_proto_field(); + proto_field3->add_proto_descriptors()->set_tag_number(7); + proto_field3->add_proto_descriptors()->set_tag_number(1); + + proto::ComposeRequest request; + request.mutable_page_metadata()->set_page_title("nested"); + request.mutable_generate_params()->set_user_input("inner type"); + auto result = CreateSubstitutions(request, subs); + + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result->input_string, "hello this is a test: nested inner type"); + EXPECT_TRUE(result->should_ignore_input_context); +} + +TEST_F(SubstitutionTest, BadProtoField) { + google::protobuf::RepeatedPtrField<proto::SubstitutedString> subs; + auto* substitution = subs.Add(); + substitution->set_string_template("hello this is a test: %s"); + auto* proto_field = substitution->add_substitutions() + ->add_candidates() + ->mutable_proto_field(); + proto_field->add_proto_descriptors()->set_tag_number(10000); + + proto::ComposeRequest request; + request.mutable_page_metadata()->set_page_title("nested"); + + auto result = CreateSubstitutions(request, subs); + + EXPECT_FALSE(result); +} + +TEST_F(SubstitutionTest, Conditions) { + google::protobuf::RepeatedPtrField<proto::SubstitutedString> subs; + auto* execute_substitution = subs.Add(); + execute_substitution->set_string_template("hello this is a test: %s %s"); + auto* substitution1_proto_field = execute_substitution->add_substitutions() + ->add_candidates() + ->mutable_proto_field(); + substitution1_proto_field->add_proto_descriptors()->set_tag_number(8); + substitution1_proto_field->add_proto_descriptors()->set_tag_number(1); + auto* substitution2 = execute_substitution->add_substitutions(); + auto* arg1 = substitution2->add_candidates(); + auto* proto_field1 = arg1->mutable_proto_field(); + proto_field1->add_proto_descriptors()->set_tag_number(3); + proto_field1->add_proto_descriptors()->set_tag_number(1); + auto* arg1_conditions = arg1->mutable_conditions(); + arg1_conditions->set_condition_evaluation_type( + proto::CONDITION_EVALUATION_TYPE_OR); + auto* arg1_c1 = arg1_conditions->add_conditions(); + auto* arg1_c1_proto_field = arg1_c1->mutable_proto_field(); + arg1_c1_proto_field->add_proto_descriptors()->set_tag_number(8); + arg1_c1_proto_field->add_proto_descriptors()->set_tag_number(2); + arg1_c1->set_operator_type(proto::OPERATOR_TYPE_EQUAL_TO); + arg1_c1->mutable_value()->set_int32_value(1); + auto* arg1_c2 = arg1_conditions->add_conditions(); + arg1_c2->mutable_proto_field()->add_proto_descriptors()->set_tag_number(8); + arg1_c2->mutable_proto_field()->add_proto_descriptors()->set_tag_number(2); + arg1_c2->set_operator_type(proto::OPERATOR_TYPE_EQUAL_TO); + arg1_c1->mutable_value()->set_int32_value(2); + auto* arg2 = substitution2->add_candidates(); + auto* proto_field2 = arg2->mutable_proto_field(); + proto_field2->add_proto_descriptors()->set_tag_number(3); + proto_field2->add_proto_descriptors()->set_tag_number(2); + auto* arg2_conditions = arg2->mutable_conditions(); + arg2_conditions->set_condition_evaluation_type( + proto::CONDITION_EVALUATION_TYPE_OR); + auto* arg2_c1 = arg2_conditions->add_conditions(); + auto* arg2_c1_proto_field = arg2_c1->mutable_proto_field(); + arg2_c1_proto_field->add_proto_descriptors()->set_tag_number(8); + arg2_c1_proto_field->add_proto_descriptors()->set_tag_number(3); + arg2_c1->set_operator_type(proto::OPERATOR_TYPE_EQUAL_TO); + arg2_c1->mutable_value()->set_int32_value(1); + auto* arg2_c2 = arg2_conditions->add_conditions(); + arg2_c2->mutable_proto_field()->add_proto_descriptors()->set_tag_number(8); + arg2_c2->mutable_proto_field()->add_proto_descriptors()->set_tag_number(3); + arg2_c2->set_operator_type(proto::OPERATOR_TYPE_EQUAL_TO); + arg2_c1->mutable_value()->set_int32_value(2); + + auto* execute_substitution2 = subs.Add(); + execute_substitution2->set_string_template("should be ignored: %s"); + execute_substitution2->add_substitutions()->add_candidates()->set_raw_string( + "also ignored"); + auto* es2_conditions = execute_substitution2->mutable_conditions(); + es2_conditions->set_condition_evaluation_type( + proto::CONDITION_EVALUATION_TYPE_AND); + auto* c1 = es2_conditions->add_conditions(); + auto* c1_proto_field = c1->mutable_proto_field(); + c1_proto_field->add_proto_descriptors()->set_tag_number(8); + c1_proto_field->add_proto_descriptors()->set_tag_number(2); + c1->set_operator_type(proto::OPERATOR_TYPE_NOT_EQUAL_TO); + c1->mutable_value()->set_int32_value(0); + + proto::ComposeRequest request; + request.mutable_rewrite_params()->set_previous_response("this is my input"); + request.mutable_rewrite_params()->set_length(proto::COMPOSE_LONGER); + request.mutable_page_metadata()->set_page_title("title"); + request.mutable_page_metadata()->set_page_url("url"); + + auto result = CreateSubstitutions(request, subs); + + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result->input_string, + "hello this is a test: this is my input title"); + EXPECT_FALSE(result->should_ignore_input_context); +} + +} // namespace + +} // namespace optimization_guide
diff --git a/components/optimization_guide/core/model_quality/model_quality_logs_uploader_service.cc b/components/optimization_guide/core/model_quality/model_quality_logs_uploader_service.cc index 81e418a..47d2ee7a 100644 --- a/components/optimization_guide/core/model_quality/model_quality_logs_uploader_service.cc +++ b/components/optimization_guide/core/model_quality/model_quality_logs_uploader_service.cc
@@ -128,10 +128,9 @@ response_code = active_url_loader->ResponseInfo()->headers->response_code(); // Only record response code when there are headers. - base::UmaHistogramEnumeration( + base::UmaHistogramSparse( "OptimizationGuide.ModelQualityLogsUploaderService.Status", - static_cast<net::HttpStatusCode>(response_code), - net::HTTP_VERSION_NOT_SUPPORTED); + response_code); } // Net error codes are negative but histogram enums must be positive.
diff --git a/components/os_crypt/async/browser/dpapi_key_provider.h b/components/os_crypt/async/browser/dpapi_key_provider.h index 39181ec..6755036 100644 --- a/components/os_crypt/async/browser/dpapi_key_provider.h +++ b/components/os_crypt/async/browser/dpapi_key_provider.h
@@ -5,16 +5,16 @@ #ifndef COMPONENTS_OS_CRYPT_ASYNC_BROWSER_DPAPI_KEY_PROVIDER_H_ #define COMPONENTS_OS_CRYPT_ASYNC_BROWSER_DPAPI_KEY_PROVIDER_H_ +#include <optional> +#include <string> +#include <vector> + #include "base/containers/span.h" #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" #include "base/types/expected.h" #include "components/os_crypt/async/browser/key_provider.h" -#include <optional> -#include <string> -#include <vector> - class PrefService; namespace os_crypt_async {
diff --git a/components/page_image_service/image_service_consent_helper.cc b/components/page_image_service/image_service_consent_helper.cc index fbaa8b5..e5504ad 100644 --- a/components/page_image_service/image_service_consent_helper.cc +++ b/components/page_image_service/image_service_consent_helper.cc
@@ -10,6 +10,7 @@ #include "components/page_image_service/features.h" #include "components/page_image_service/metrics_util.h" #include "components/sync/service/sync_service.h" +#include "components/sync/service/sync_service_utils.h" #include "components/unified_consent/consent_throttle.h" #include "components/unified_consent/url_keyed_data_collection_consent_helper.h" @@ -135,6 +136,19 @@ return false; } + // If upload of the given ModelType is disabled (or inactive due to an + // error), then consent must be assumed to be NOT given. + // Note that the "INITIALIZING" state is good enough: It means the data + // type is enabled in principle, Sync just hasn't fully finished + // initializing yet. This case is handled by the DownloadStatus check + // below. + if (syncer::GetUploadToGoogleState(sync_service_, model_type_) == + syncer::UploadState::NOT_ACTIVE) { + return false; + } + + // Ensure Sync has downloaded all relevant updates (i.e. any deletions from + // other devices are known). syncer::SyncService::ModelTypeDownloadStatus download_status = sync_service_->GetDownloadStatusFor(model_type_); switch (download_status) {
diff --git a/components/page_image_service/image_service_consent_helper_unittest.cc b/components/page_image_service/image_service_consent_helper_unittest.cc index ef2c743..207f6b9c 100644 --- a/components/page_image_service/image_service_consent_helper_unittest.cc +++ b/components/page_image_service/image_service_consent_helper_unittest.cc
@@ -32,13 +32,13 @@ void SetUp() override { test_sync_service_ = std::make_unique<syncer::TestSyncService>(); consent_helper_ = std::make_unique<ImageServiceConsentHelper>( - test_sync_service_.get(), syncer::ModelType::HISTORY_DELETE_DIRECTIVES); + test_sync_service_.get(), syncer::ModelType::BOOKMARKS); } void SetDownloadStatusAndFireNotification( syncer::SyncService::ModelTypeDownloadStatus download_status) { - test_sync_service_->SetDownloadStatusFor( - {syncer::ModelType::HISTORY_DELETE_DIRECTIVES}, download_status); + test_sync_service_->SetDownloadStatusFor({syncer::ModelType::BOOKMARKS}, + download_status); test_sync_service_->FireStateChanged(); } @@ -77,6 +77,14 @@ SetDownloadStatusAndFireNotification( syncer::SyncService::ModelTypeDownloadStatus::kUpToDate); EXPECT_EQ(GetResultSynchronously(), PageImageServiceConsentStatus::kSuccess); + + // Set explicit passphrase for Bookmarks to simulate UploadToGoogleState not + // active. + sync_service()->GetUserSettings()->SetSelectedTypes( + /*sync_everything=*/false, + /*types=*/{syncer::UserSelectableType::kBookmarks}); + sync_service()->SetIsUsingExplicitPassphrase(true); + EXPECT_EQ(GetResultSynchronously(), PageImageServiceConsentStatus::kFailure); } TEST_F(ImageServiceConsentHelperTest, ExpireOldRequests) { @@ -236,7 +244,7 @@ SyncStatusNotObserved) { sync_service()->GetUserSettings()->SetSelectedTypes( /*sync_everything=*/false, - /*types=*/{syncer::UserSelectableType::kHistory}); + /*types=*/{syncer::UserSelectableType::kBookmarks}); sync_service()->FireStateChanged(); EXPECT_EQ(GetResultSynchronously(), PageImageServiceConsentStatus::kSuccess);
diff --git a/components/page_load_metrics/browser/observers/ad_metrics/aggregate_frame_data.h b/components/page_load_metrics/browser/observers/ad_metrics/aggregate_frame_data.h index f9a9610..8afc7ed 100644 --- a/components/page_load_metrics/browser/observers/ad_metrics/aggregate_frame_data.h +++ b/components/page_load_metrics/browser/observers/ad_metrics/aggregate_frame_data.h
@@ -6,6 +6,7 @@ #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_OBSERVERS_AD_METRICS_AGGREGATE_FRAME_DATA_H_ #include <stdint.h> + #include <optional> #include "base/time/time.h"
diff --git a/components/password_manager/core/browser/form_parsing/form_data_parser_unittest.cc b/components/password_manager/core/browser/form_parsing/form_data_parser_unittest.cc index cc92e053..5bbaeb6 100644 --- a/components/password_manager/core/browser/form_parsing/form_data_parser_unittest.cc +++ b/components/password_manager/core/browser/form_parsing/form_data_parser_unittest.cc
@@ -3,7 +3,6 @@ // found in the LICENSE file. #include "components/password_manager/core/browser/form_parsing/form_data_parser.h" -#include "components/autofill/core/common/autofill_test_utils.h" #include <stddef.h> @@ -19,6 +18,7 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "components/autofill/core/browser/field_types.h" +#include "components/autofill/core/common/autofill_test_utils.h" #include "components/autofill/core/common/form_data.h" #include "components/autofill/core/common/form_field_data.h" #include "components/autofill/core/common/unique_ids.h"
diff --git a/components/password_manager/core/browser/leak_detection/fuzzer/cypher_decrypt_fuzzer.cc b/components/password_manager/core/browser/leak_detection/fuzzer/cypher_decrypt_fuzzer.cc index 09cfbec..09969b9 100644 --- a/components/password_manager/core/browser/leak_detection/fuzzer/cypher_decrypt_fuzzer.cc +++ b/components/password_manager/core/browser/leak_detection/fuzzer/cypher_decrypt_fuzzer.cc
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/password_manager/core/browser/leak_detection/encryption_utils.h" - #include <optional> + +#include "components/password_manager/core/browser/leak_detection/encryption_utils.h" #include "third_party/boringssl/src/include/openssl/nid.h" #include "third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.h"
diff --git a/components/password_manager/core/browser/leak_detection/fuzzer/cypher_encrypt_with_key_fuzzer.cc b/components/password_manager/core/browser/leak_detection/fuzzer/cypher_encrypt_with_key_fuzzer.cc index d9e265e..239e360d 100644 --- a/components/password_manager/core/browser/leak_detection/fuzzer/cypher_encrypt_with_key_fuzzer.cc +++ b/components/password_manager/core/browser/leak_detection/fuzzer/cypher_encrypt_with_key_fuzzer.cc
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/password_manager/core/browser/leak_detection/encryption_utils.h" - #include <optional> + +#include "components/password_manager/core/browser/leak_detection/encryption_utils.h" #include "third_party/boringssl/src/include/openssl/nid.h" #include "third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.h"
diff --git a/components/password_manager/core/browser/leak_detection/fuzzer/cypher_reencrypt_fuzzer.cc b/components/password_manager/core/browser/leak_detection/fuzzer/cypher_reencrypt_fuzzer.cc index fa6f183..40044bc0 100644 --- a/components/password_manager/core/browser/leak_detection/fuzzer/cypher_reencrypt_fuzzer.cc +++ b/components/password_manager/core/browser/leak_detection/fuzzer/cypher_reencrypt_fuzzer.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/password_manager/core/browser/leak_detection/encryption_utils.h" - #include <optional> +#include "components/password_manager/core/browser/leak_detection/encryption_utils.h" + namespace password_manager { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
diff --git a/components/password_manager/core/browser/password_form_filling.h b/components/password_manager/core/browser/password_form_filling.h index 243b806..3a78c4f 100644 --- a/components/password_manager/core/browser/password_form_filling.h +++ b/components/password_manager/core/browser/password_form_filling.h
@@ -5,9 +5,8 @@ #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_FILLING_H_ #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_FILLING_H_ -#include <vector> - #include <optional> +#include <vector> #include "base/containers/span.h" #include "base/memory/raw_ptr.h"
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc index f71d2c85..2ef9dd06 100644 --- a/components/password_manager/core/browser/password_form_manager_unittest.cc +++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -5,7 +5,6 @@ #include "components/password_manager/core/browser/password_form_manager.h" #include <memory> - #include <optional> #include <string> #include <type_traits>
diff --git a/components/privacy_sandbox/tracking_protection_onboarding_unittest.cc b/components/privacy_sandbox/tracking_protection_onboarding_unittest.cc index ef4b62a27..ae6c9e6 100644 --- a/components/privacy_sandbox/tracking_protection_onboarding_unittest.cc +++ b/components/privacy_sandbox/tracking_protection_onboarding_unittest.cc
@@ -3,9 +3,11 @@ // found in the LICENSE file. #include "components/privacy_sandbox/tracking_protection_onboarding.h" + #include <memory> #include <optional> #include <utility> + #include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/user_action_tester.h" #include "base/test/scoped_feature_list.h"
diff --git a/components/safe_browsing/core/browser/db/hash_prefix_map.cc b/components/safe_browsing/core/browser/db/hash_prefix_map.cc index 9b202434..9c3db2a4 100644 --- a/components/safe_browsing/core/browser/db/hash_prefix_map.cc +++ b/components/safe_browsing/core/browser/db/hash_prefix_map.cc
@@ -618,10 +618,11 @@ start = offsets_[index]; if (++index < offsets_.size()) end = offsets_[index]; + } - // If the start is the same as end, the hash doesn't exist. - if (start == end) - return HashPrefixStr(); + // If the start is the same as end, the hash doesn't exist. + if (start == end) { + return HashPrefixStr(); } // TODO(crbug.com/1409674): Remove crash logging.
diff --git a/components/search/ntp_features.cc b/components/search/ntp_features.cc index f677b04..1a93dec 100644 --- a/components/search/ntp_features.cc +++ b/components/search/ntp_features.cc
@@ -418,6 +418,11 @@ "NtpWallpaperSearchButton", base::FEATURE_DISABLED_BY_DEFAULT); +// If enabled, animates New Tab Page's Wallpaper Search Button. +BASE_FEATURE(kNtpWallpaperSearchButtonAnimation, + "NtpWallpaperSearchButtonAnimation", + base::FEATURE_DISABLED_BY_DEFAULT); + const char kNtpModuleIgnoredCriteriaThreshold[] = "NtpModuleIgnoredCriteriaThreshold"; const char kNtpModuleIgnoredHaTSDelayTimeParam[] =
diff --git a/components/search/ntp_features.h b/components/search/ntp_features.h index b54d985..4c17cf64 100644 --- a/components/search/ntp_features.h +++ b/components/search/ntp_features.h
@@ -99,6 +99,7 @@ BASE_DECLARE_FEATURE(kNtpTabResumptionModuleCategories); BASE_DECLARE_FEATURE(kNtpTabResumptionModuleTimeLimit); BASE_DECLARE_FEATURE(kNtpWallpaperSearchButton); +BASE_DECLARE_FEATURE(kNtpWallpaperSearchButtonAnimation); // Parameter for controlling the luminosity difference for NTP elements on light // backgrounds.
diff --git a/components/services/storage/sandboxed_vfs_delegate.cc b/components/services/storage/sandboxed_vfs_delegate.cc index cb87156..6dcd4e6 100644 --- a/components/services/storage/sandboxed_vfs_delegate.cc +++ b/components/services/storage/sandboxed_vfs_delegate.cc
@@ -5,9 +5,9 @@ #include "components/services/storage/sandboxed_vfs_delegate.h" #include <cstdint> +#include <optional> #include <utility> -#include <optional> #include "base/files/file.h" #include "base/files/file_error_or.h" #include "base/files/file_path.h"
diff --git a/components/update_client/persisted_data.cc b/components/update_client/persisted_data.cc index 1a1c847..f63c012 100644 --- a/components/update_client/persisted_data.cc +++ b/components/update_client/persisted_data.cc
@@ -60,6 +60,7 @@ void SetDateLastActive(const std::string& id, int dla) override; void SetDateLastRollCall(const std::string& id, int dlrc) override; int GetInstallDate(const std::string& id) const override; + void SetInstallDate(const std::string& id, int install_date) override; std::string GetCohort(const std::string& id) const override; std::string GetCohortHint(const std::string& id) const override; std::string GetCohortName(const std::string& id) const override; @@ -265,6 +266,14 @@ app_key->Set("dlrc", dlrc); } +void PersistedDataImpl::SetInstallDate(const std::string& id, + int install_date) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + ScopedDictPrefUpdate update(pref_service_, kPersistedDataPreference); + base::Value::Dict* app_key = GetOrCreateAppKey(id, update.Get()); + app_key->Set("installdate", install_date); +} + void PersistedDataImpl::SetString(const std::string& id, const std::string& key, const std::string& value) {
diff --git a/components/update_client/persisted_data.h b/components/update_client/persisted_data.h index f34cffb..91402ee2 100644 --- a/components/update_client/persisted_data.h +++ b/components/update_client/persisted_data.h
@@ -79,6 +79,10 @@ // "InstallDate" is not known, -2 is returned. virtual int GetInstallDate(const std::string& id) const = 0; + // Sets InstallDate. This method should only be used for importing data from + // other data stores. + virtual void SetInstallDate(const std::string& id, int install_date) = 0; + // These functions return cohort data for the specified |id|. "Cohort" // indicates the membership of the client in any release channels components // have set up in a machine-readable format, while "CohortName" does so in a
diff --git a/components/user_manager/BUILD.gn b/components/user_manager/BUILD.gn index 7f69ca68..450385d7 100644 --- a/components/user_manager/BUILD.gn +++ b/components/user_manager/BUILD.gn
@@ -31,6 +31,8 @@ if (is_chromeos_ash) { sources += [ + "account_id_util.cc", + "account_id_util.h", "common_types.h", "include_exclude_account_id_filter.cc", "include_exclude_account_id_filter.h", @@ -79,6 +81,7 @@ source_set("unit_tests") { testonly = true sources = [ + "account_id_util_unittest.cc", "include_exclude_account_id_filter_unittest.cc", "known_user_unittest.cc", "user_unittest.cc",
diff --git a/components/user_manager/account_id_util.cc b/components/user_manager/account_id_util.cc new file mode 100644 index 0000000..bf5aa51 --- /dev/null +++ b/components/user_manager/account_id_util.cc
@@ -0,0 +1,111 @@ +// 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/user_manager/account_id_util.h" + +#include <optional> +#include <string> + +#include "base/check_is_test.h" +#include "base/json/values_util.h" +#include "base/notreached.h" +#include "base/values.h" +#include "components/account_id/account_id.h" + +namespace user_manager { + +const char kCanonicalEmail[] = "email"; +const char kGAIAIdKey[] = "gaia_id"; +const char kObjGuidKey[] = "obj_guid"; +const char kAccountTypeKey[] = "account_type"; + +std::optional<AccountId> LoadAccountId(const base::Value::Dict& dict) { + const std::string* email = dict.FindString(kCanonicalEmail); + const std::string* gaia_id = dict.FindString(kGAIAIdKey); + const std::string* obj_guid = dict.FindString(kObjGuidKey); + AccountType account_type = AccountType::GOOGLE; + if (const std::string* account_type_string = + dict.FindString(kAccountTypeKey)) { + account_type = AccountId::StringToAccountType(*account_type_string); + } + switch (account_type) { + case AccountType::GOOGLE: + if (email || gaia_id) { + return AccountId::FromUserEmailGaiaId( + email ? *email : std::string(), gaia_id ? *gaia_id : std::string()); + } + break; + case AccountType::ACTIVE_DIRECTORY: + if (email && obj_guid) { + return AccountId::AdFromUserEmailObjGuid(*email, *obj_guid); + } + break; + default: + NOTREACHED() << "Unknown account type"; + } + return std::nullopt; +} + +bool AccountIdMatches(const AccountId& account_id, + const base::Value::Dict& dict) { + const std::string* account_type = dict.FindString(kAccountTypeKey); + if (account_id.GetAccountType() != AccountType::UNKNOWN && account_type && + account_id.GetAccountType() != + AccountId::StringToAccountType(*account_type)) { + return false; + } + + // TODO(b/268177869): If the gaia id or GUID are present, but doesn't match, + // this function should likely be returning false even if the e-mail matches. + switch (account_id.GetAccountType()) { + case AccountType::GOOGLE: { + const std::string* gaia_id = dict.FindString(kGAIAIdKey); + if (gaia_id && account_id.GetGaiaId() == *gaia_id) { + return true; + } + break; + } + case AccountType::ACTIVE_DIRECTORY: { + const std::string* obj_guid = dict.FindString(kObjGuidKey); + if (obj_guid && account_id.GetObjGuid() == *obj_guid) { + return true; + } + break; + } + case AccountType::UNKNOWN: { + } + } + + const std::string* email = dict.FindString(kCanonicalEmail); + if (email && account_id.GetUserEmail() == *email) { + return true; + } + + return false; +} + +void StoreAccountId(const AccountId& account_id, base::Value::Dict& dict) { + if (!account_id.GetUserEmail().empty()) { + dict.Set(kCanonicalEmail, account_id.GetUserEmail()); + } + + switch (account_id.GetAccountType()) { + case AccountType::GOOGLE: + if (!account_id.GetGaiaId().empty()) { + dict.Set(kGAIAIdKey, account_id.GetGaiaId()); + } + break; + case AccountType::ACTIVE_DIRECTORY: + if (!account_id.GetObjGuid().empty()) { + dict.Set(kObjGuidKey, account_id.GetObjGuid()); + } + break; + case AccountType::UNKNOWN: + return; + } + dict.Set(kAccountTypeKey, + AccountId::AccountTypeToString(account_id.GetAccountType())); +} + +} // namespace user_manager
diff --git a/components/user_manager/account_id_util.h b/components/user_manager/account_id_util.h new file mode 100644 index 0000000..6f88414b --- /dev/null +++ b/components/user_manager/account_id_util.h
@@ -0,0 +1,47 @@ +// 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_USER_MANAGER_ACCOUNT_ID_UTIL_H_ +#define COMPONENTS_USER_MANAGER_ACCOUNT_ID_UTIL_H_ + +#include <optional> + +#include "base/values.h" +#include "components/user_manager/user_manager_export.h" + +class AccountId; + +// Methods for serializing and de-serializing `AccountId` as a number of fields +// in `Dict`. +namespace user_manager { + +// Fields used to serialize/deserialize AccountId. +// Note that this is an implementation detail of the user_manager. + +// Key of canonical e-mail value. +USER_MANAGER_EXPORT extern const char kCanonicalEmail[]; +// Key of obfuscated GAIA id value. +USER_MANAGER_EXPORT extern const char kGAIAIdKey[]; +// Key of obfuscated object guid value for Active Directory accounts. +USER_MANAGER_EXPORT extern const char kObjGuidKey[]; +// Key of account type. +USER_MANAGER_EXPORT extern const char kAccountTypeKey[]; + +// Attempts to construct `AccountId` based on provided `dict`. +// Resulting `AccountId` is not guaranteed to be fully resolved. +USER_MANAGER_EXPORT std::optional<AccountId> LoadAccountId( + const base::Value::Dict& dict); + +// Returns true if `account_id` matches the data in the dict. +// Note that match by id takes precedence over matching by e-mail. +USER_MANAGER_EXPORT bool AccountIdMatches(const AccountId& account_id, + const base::Value::Dict& dict); + +// Stores data relevant to `account_id` to `dict`. +USER_MANAGER_EXPORT void StoreAccountId(const AccountId& account_id, + base::Value::Dict& dict); + +} // namespace user_manager + +#endif // COMPONENTS_USER_MANAGER_ACCOUNT_ID_UTIL_H_
diff --git a/components/user_manager/account_id_util_unittest.cc b/components/user_manager/account_id_util_unittest.cc new file mode 100644 index 0000000..b6989ae --- /dev/null +++ b/components/user_manager/account_id_util_unittest.cc
@@ -0,0 +1,174 @@ +// 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/user_manager/account_id_util.h" + +#include <memory> +#include <optional> +#include <utility> + +#include "base/values.h" +#include "components/account_id/account_id.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace user_manager { + +namespace { +constexpr char kUserEmail[] = "default_account@gmail.com"; +constexpr char kOtherEmail[] = "renamed_account@gmail.com"; +constexpr char kGaiaID[] = "fake-gaia-id"; +// Active directory users are deprecated, but full cleanup is not finished yet. +constexpr char kObjGuid[] = "fake-obj-guid"; +} // namespace + +// Base class for tests of known_user. +// Sets up global objects necessary for known_user to be able to access +// local_state. +class AccountIdUtilTest : public testing::Test { + public: + AccountIdUtilTest() {} + ~AccountIdUtilTest() override = default; + + AccountIdUtilTest(const AccountIdUtilTest& other) = delete; + AccountIdUtilTest& operator=(const AccountIdUtilTest& other) = delete; + + protected: + const AccountId kDefaultAccountId = + AccountId::FromUserEmailGaiaId(kUserEmail, kGaiaID); +}; + +TEST_F(AccountIdUtilTest, LoadGoogleAccountWithGaiaId) { + base::Value::Dict dict = base::Value::Dict() + .Set("account_type", "google") + .Set("email", kUserEmail) + .Set("gaia_id", kGaiaID) + .Set("obj_guid", kObjGuid); + std::optional<AccountId> result = LoadAccountId(dict); + ASSERT_TRUE(result); + ASSERT_TRUE(result->is_valid()); + EXPECT_EQ(result->GetAccountType(), AccountType::GOOGLE); + EXPECT_EQ(result->GetUserEmail(), kUserEmail); + ASSERT_TRUE(result->HasAccountIdKey()); + ASSERT_EQ(result->GetGaiaId(), kGaiaID); +} + +TEST_F(AccountIdUtilTest, LoadGoogleAccountWithoutGaiaId) { + base::Value::Dict dict = base::Value::Dict() + .Set("account_type", "google") + .Set("email", kUserEmail) + .Set("obj_guid", kObjGuid); + std::optional<AccountId> result = LoadAccountId(dict); + ASSERT_TRUE(result); + ASSERT_TRUE(result->is_valid()); + EXPECT_EQ(result->GetAccountType(), AccountType::GOOGLE); + EXPECT_EQ(result->GetUserEmail(), kUserEmail); + ASSERT_FALSE(result->HasAccountIdKey()); +} + +// Death test for some reason fails on MSAN bots. +// TODO(b/325904498): Investigate how DEATH tests should be used. +TEST_F(AccountIdUtilTest, DISABLED_LoadUnknownAccount) { + base::Value::Dict dict = base::Value::Dict() + .Set("account_type", "unknown") + .Set("email", kUserEmail) + .Set("gaia_id", kGaiaID) + .Set("obj_guid", kObjGuid); + ASSERT_DEATH({ LoadAccountId(dict); }, "Unknown account type"); +} + +TEST_F(AccountIdUtilTest, LoadAccountEmailOnly) { + base::Value::Dict dict = base::Value::Dict().Set("email", kUserEmail); + std::optional<AccountId> result = LoadAccountId(dict); + ASSERT_TRUE(result); + ASSERT_TRUE(result->is_valid()); + // Assume that accounts are Google accounts by default. + EXPECT_EQ(result->GetAccountType(), AccountType::GOOGLE); + EXPECT_EQ(result->GetUserEmail(), kUserEmail); + ASSERT_FALSE(result->HasAccountIdKey()); +} + +TEST_F(AccountIdUtilTest, LoadDeprecatedActiveDirectoryUser) { + base::Value::Dict dict = base::Value::Dict() + .Set("account_type", "ad") + .Set("email", kUserEmail) + .Set("obj_guid", kObjGuid); + std::optional<AccountId> result = LoadAccountId(dict); + ASSERT_TRUE(result); + ASSERT_TRUE(result->is_valid()); + EXPECT_EQ(result->GetAccountType(), AccountType::ACTIVE_DIRECTORY); + EXPECT_EQ(result->GetUserEmail(), kUserEmail); + ASSERT_TRUE(result->HasAccountIdKey()); + EXPECT_EQ(result->GetObjGuid(), kObjGuid); +} + +TEST_F(AccountIdUtilTest, MatchByCorrectEmail) { + base::Value::Dict dict = base::Value::Dict() + .Set("account_type", "google") + .Set("email", kUserEmail) + .Set("gaia_id", kGaiaID); + AccountId id = AccountId::FromUserEmail(kUserEmail); + ASSERT_TRUE(AccountIdMatches(id, dict)); +} + +TEST_F(AccountIdUtilTest, MatchByIncorrectEmail) { + base::Value::Dict dict = base::Value::Dict() + .Set("account_type", "google") + .Set("email", kUserEmail) + .Set("gaia_id", kGaiaID); + AccountId id = AccountId::FromUserEmail(kOtherEmail); + ASSERT_FALSE(AccountIdMatches(id, dict)); +} + +TEST_F(AccountIdUtilTest, MatchByGaiaIdSameEmail) { + base::Value::Dict dict = base::Value::Dict() + .Set("account_type", "google") + .Set("email", kUserEmail) + .Set("gaia_id", kGaiaID); + AccountId id = AccountId::FromUserEmailGaiaId(kUserEmail, kGaiaID); + ASSERT_TRUE(AccountIdMatches(id, dict)); +} + +TEST_F(AccountIdUtilTest, MatchByGaiaIdOtherEmail) { + base::Value::Dict dict = base::Value::Dict() + .Set("account_type", "google") + .Set("email", kUserEmail) + .Set("gaia_id", kGaiaID); + AccountId id = AccountId::FromUserEmailGaiaId(kOtherEmail, kGaiaID); + ASSERT_TRUE(AccountIdMatches(id, dict)); +} + +TEST_F(AccountIdUtilTest, MatchByEmailOnly) { + base::Value::Dict dict = base::Value::Dict().Set("email", kUserEmail); + AccountId id = AccountId::FromUserEmail(kUserEmail); + ASSERT_TRUE(AccountIdMatches(id, dict)); +} + +TEST_F(AccountIdUtilTest, StoreEmailOnly) { + AccountId id = AccountId::FromUserEmail(kUserEmail); + base::Value::Dict dict; + StoreAccountId(id, dict); + EXPECT_EQ(dict.Find("account_type"), nullptr); + EXPECT_EQ(dict.Find("email")->GetString(), kUserEmail); + EXPECT_EQ(dict.Find("gaia_id"), nullptr); +} + +TEST_F(AccountIdUtilTest, StoreGoogleAccount) { + AccountId id = AccountId::FromUserEmailGaiaId(kUserEmail, kGaiaID); + base::Value::Dict dict; + StoreAccountId(id, dict); + EXPECT_EQ(dict.Find("account_type")->GetString(), "google"); + EXPECT_EQ(dict.Find("email")->GetString(), kUserEmail); + EXPECT_EQ(dict.Find("gaia_id")->GetString(), kGaiaID); +} + +TEST_F(AccountIdUtilTest, StoreDeprecatedADAccount) { + AccountId id = AccountId::AdFromUserEmailObjGuid(kUserEmail, kObjGuid); + base::Value::Dict dict; + StoreAccountId(id, dict); + EXPECT_EQ(dict.Find("account_type")->GetString(), "ad"); + EXPECT_EQ(dict.Find("email")->GetString(), kUserEmail); + EXPECT_EQ(dict.Find("obj_guid")->GetString(), kObjGuid); +} + +} // namespace user_manager
diff --git a/components/user_manager/known_user.cc b/components/user_manager/known_user.cc index 68713a7..513ecac 100644 --- a/components/user_manager/known_user.cc +++ b/components/user_manager/known_user.cc
@@ -20,6 +20,7 @@ #include "components/account_id/account_id.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/scoped_user_pref_update.h" +#include "components/user_manager/account_id_util.h" #include "components/user_manager/common_types.h" #include "components/user_manager/user_manager.h" #include "components/user_manager/user_names.h" @@ -35,18 +36,6 @@ // Known user preferences keys (stored in Local State). All keys should be // listed in kReservedKeys or kObsoleteKeys below. -// Key of canonical e-mail value. -const char kCanonicalEmail[] = "email"; - -// Key of obfuscated GAIA id value. -const char kGAIAIdKey[] = "gaia_id"; - -// Key of obfuscated object guid value for Active Directory accounts. -const char kObjGuidKey[] = "obj_guid"; - -// Key of account type. -const char kAccountTypeKey[] = "account_type"; - // Key of whether this user ID refers to a SAML user. const char kUsingSAMLKey[] = "using_saml"; @@ -154,62 +143,6 @@ kTokenHandleRotatedObsolete, }; -// Checks if values in |dict| correspond with |account_id| identity. -bool UserMatches(const AccountId& account_id, const base::Value::Dict& dict) { - const std::string* account_type = dict.FindString(kAccountTypeKey); - if (account_id.GetAccountType() != AccountType::UNKNOWN && account_type && - account_id.GetAccountType() != - AccountId::StringToAccountType(*account_type)) { - return false; - } - - // TODO(alemate): update code once user id is really a struct. - // TODO(https://crbug.com/1190902): If the gaia id or GUID doesn't match, - // this function should likely be returning false even if the e-mail matches. - switch (account_id.GetAccountType()) { - case AccountType::GOOGLE: { - const std::string* gaia_id = dict.FindString(kGAIAIdKey); - if (gaia_id && account_id.GetGaiaId() == *gaia_id) - return true; - break; - } - case AccountType::ACTIVE_DIRECTORY: { - const std::string* obj_guid = dict.FindString(kObjGuidKey); - if (obj_guid && account_id.GetObjGuid() == *obj_guid) - return true; - break; - } - case AccountType::UNKNOWN: { - } - } - - const std::string* email = dict.FindString(kCanonicalEmail); - if (email && account_id.GetUserEmail() == *email) - return true; - - return false; -} - -// Fills relevant |dict| values based on |account_id|. -void UpdateIdentity(const AccountId& account_id, base::Value::Dict& dict) { - if (!account_id.GetUserEmail().empty()) - dict.Set(kCanonicalEmail, account_id.GetUserEmail()); - - switch (account_id.GetAccountType()) { - case AccountType::GOOGLE: - if (!account_id.GetGaiaId().empty()) - dict.Set(kGAIAIdKey, account_id.GetGaiaId()); - break; - case AccountType::ACTIVE_DIRECTORY: - if (!account_id.GetObjGuid().empty()) - dict.Set(kObjGuidKey, account_id.GetObjGuid()); - break; - case AccountType::UNKNOWN: - return; - } - dict.Set(kAccountTypeKey, - AccountId::AccountTypeToString(account_id.GetAccountType())); -} // Checks for platform-specific known users matching given |user_email|. If // data matches a known account, returns it. @@ -249,8 +182,9 @@ if (!element_value.is_dict()) continue; const base::Value::Dict& dict = element_value.GetDict(); - if (!UserMatches(account_id, dict)) + if (!AccountIdMatches(account_id, dict)) { continue; + } return &dict; } return nullptr; @@ -274,15 +208,16 @@ if (!element_value.is_dict()) continue; base::Value::Dict& dict = element_value.GetDict(); - if (!UserMatches(account_id, dict)) + if (!AccountIdMatches(account_id, dict)) { continue; + } if (opt_value.has_value()) { dict.SetByDottedPath(path, std::move(opt_value).value()); } else { dict.RemoveByDottedPath(path); } - UpdateIdentity(account_id, dict); + StoreAccountId(account_id, dict); return; } if (!opt_value.has_value()) @@ -290,7 +225,7 @@ base::Value::Dict new_dict; new_dict.SetByDottedPath(path, std::move(opt_value).value()); - UpdateIdentity(account_id, new_dict); + StoreAccountId(account_id, new_dict); update->Append(std::move(new_dict)); } @@ -496,30 +431,8 @@ if (!element_value.is_dict()) continue; const base::Value::Dict& dict = element_value.GetDict(); - const std::string* email = dict.FindString(kCanonicalEmail); - const std::string* gaia_id = dict.FindString(kGAIAIdKey); - const std::string* obj_guid = dict.FindString(kObjGuidKey); - AccountType account_type = AccountType::GOOGLE; - if (const std::string* account_type_string = - dict.FindString(kAccountTypeKey)) { - account_type = AccountId::StringToAccountType(*account_type_string); - } - switch (account_type) { - case AccountType::GOOGLE: - if (email || gaia_id) { - result.push_back(AccountId::FromUserEmailGaiaId( - email ? *email : std::string(), - gaia_id ? *gaia_id : std::string())); - } - break; - case AccountType::ACTIVE_DIRECTORY: - if (email && obj_guid) { - result.push_back( - AccountId::AdFromUserEmailObjGuid(*email, *obj_guid)); - } - break; - default: - NOTREACHED() << "Unknown account type"; + if (std::optional<AccountId> account_id = LoadAccountId(dict)) { + result.push_back(*account_id); } } return result; @@ -835,7 +748,7 @@ ScopedListPrefUpdate update(local_state_, kKnownUsers); base::Value::List& update_list = update.Get(); for (auto it = update_list.begin(); it != update_list.end(); ++it) { - if (UserMatches(account_id, it->GetDict())) { + if (AccountIdMatches(account_id, it->GetDict())) { update_list.erase(it); break; }
diff --git a/components/variations/cros_evaluate_seed/evaluate_seed.h b/components/variations/cros_evaluate_seed/evaluate_seed.h index 9c311fe..8140b1a 100644 --- a/components/variations/cros_evaluate_seed/evaluate_seed.h +++ b/components/variations/cros_evaluate_seed/evaluate_seed.h
@@ -5,12 +5,12 @@ #ifndef COMPONENTS_VARIATIONS_CROS_EVALUATE_SEED_EVALUATE_SEED_H_ #define COMPONENTS_VARIATIONS_CROS_EVALUATE_SEED_EVALUATE_SEED_H_ +#include <stdio.h> + #include <memory> #include <optional> #include <string> -#include <stdio.h> - #include "base/command_line.h" #include "base/functional/callback.h" #include "chromeos/ash/components/dbus/featured/featured.pb.h"
diff --git a/components/viz/service/display/dc_layer_overlay.cc b/components/viz/service/display/dc_layer_overlay.cc index 0709f70e..c7923c0f 100644 --- a/components/viz/service/display/dc_layer_overlay.cc +++ b/components/viz/service/display/dc_layer_overlay.cc
@@ -345,6 +345,8 @@ dc_layer->color_space = resource_provider->GetColorSpace(quad->resource_id()); dc_layer->hdr_metadata = resource_provider->GetHDRMetadata(quad->resource_id()); + + dc_layer->protected_video_type = quad->protected_video_type; // Both color space and protected_video_type are hard-coded for stream video. // TODO(crbug.com/1384544): Consider using quad->protected_video_type. if (quad->is_stream_video) {
diff --git a/components/webapps/browser/android/add_to_homescreen_data_fetcher.cc b/components/webapps/browser/android/add_to_homescreen_data_fetcher.cc index 3c73bdb4..0f7bca4 100644 --- a/components/webapps/browser/android/add_to_homescreen_data_fetcher.cc +++ b/components/webapps/browser/android/add_to_homescreen_data_fetcher.cc
@@ -207,8 +207,9 @@ if (!web_contents_) return; - RecordMobileCapableUserActions(data.web_page_metadata->mobile_capable, - !blink::IsEmptyManifest(*data.manifest)); + RecordMobileCapableUserActions( + data.web_page_metadata->mobile_capable, + /*has_manifest=*/!data.manifest_url->is_empty()); shortcut_info_.UpdateFromWebPageMetadata(*data.web_page_metadata); shortcut_info_.UpdateFromManifest(*data.manifest); @@ -266,9 +267,8 @@ shortcut_info_.UpdateDisplayMode(webapk_compatible); AddToHomescreenParams::AppType app_type = - blink::IsEmptyManifest(*data.manifest) - ? AddToHomescreenParams::AppType::WEBAPK_DIY - : AddToHomescreenParams::AppType::WEBAPK; + data.manifest_url->is_empty() ? AddToHomescreenParams::AppType::WEBAPK_DIY + : AddToHomescreenParams::AppType::WEBAPK; observer_->OnUserTitleAvailable( webapk_compatible ? shortcut_info_.name : shortcut_info_.user_title,
diff --git a/components/webapps/browser/android/add_to_homescreen_data_fetcher_unittest.cc b/components/webapps/browser/android/add_to_homescreen_data_fetcher_unittest.cc index 89816d0..f008c8c7 100644 --- a/components/webapps/browser/android/add_to_homescreen_data_fetcher_unittest.cc +++ b/components/webapps/browser/android/add_to_homescreen_data_fetcher_unittest.cc
@@ -51,7 +51,6 @@ const char* kDefaultManifestUrl = "https://www.example.com/manifest.json"; const char* kDefaultIconUrl = "https://www.example.com/icon.png"; const char* kDefaultStartUrl = "https://www.example.com/index.html"; -const char* kDefaultScopeUrl = "https://www.example.com/"; const blink::mojom::DisplayMode kDefaultManifestDisplayMode = blink::mojom::DisplayMode::kStandalone; const int kIconSizePx = 144; @@ -127,14 +126,15 @@ } // Builds WebAPK compatible blink::Manifest. -blink::mojom::ManifestPtr BuildDefaultManifest() { +blink::mojom::ManifestPtr BuildWebAPKManifest() { + GURL start_url = GURL(kDefaultStartUrl); auto manifest = blink::mojom::Manifest::New(); manifest->name = kDefaultManifestName; manifest->short_name = kDefaultManifestShortName; - manifest->start_url = GURL(kDefaultStartUrl); - manifest->scope = GURL(kDefaultScopeUrl); + manifest->start_url = start_url; + manifest->scope = start_url.GetWithoutFilename(); manifest->has_valid_specified_start_url = true; - manifest->id = GURL(kDefaultStartUrl); + manifest->id = start_url.GetWithoutRef(); manifest->display = kDefaultManifestDisplayMode; blink::Manifest::ImageResource primary_icon; @@ -176,6 +176,15 @@ page_data_->OnPageMetadataFetched(std::move(metadata)); } + // Builds and sets the default manifest for the given document url. + void SetManifestAsDefault(const GURL& document_url) { + auto manifest = blink::mojom::Manifest::New(); + manifest->start_url = document_url; + manifest->scope = document_url.GetWithoutFilename(); + manifest->id = document_url.GetWithoutRef(); + page_data_->OnManifestFetched(std::move(manifest), /*manifest_url=*/GURL()); + } + void SetManifest(blink::mojom::ManifestPtr manifest) { if (!manifest->icons.empty()) { SetPrimaryIcon(manifest->icons[0].src); @@ -201,7 +210,7 @@ // installable fetcher won't try to fetch the real data. if (!page_data_->manifest_fetched()) { page_data_->OnManifestFetched(blink::mojom::Manifest::New(), GURL(), - InstallableStatusCode::MANIFEST_EMPTY); + InstallableStatusCode::NO_MANIFEST); } if (!page_data_->web_page_metadata_fetched()) { page_data_->OnPageMetadataFetched(BuildDefaultMetadata()); @@ -305,6 +314,10 @@ installable_manager_->SetManifest(std::move(manifest)); } + void SetManifestAsDefault(const GURL& document_url) { + installable_manager_->SetManifestAsDefault(document_url); + } + void SetWebPageMetadata(mojom::WebPageMetadataPtr metadata) { installable_manager_->SetWebPageMetadata(std::move(metadata)); } @@ -376,7 +389,7 @@ NullLargeIconService null_large_icon_service_; }; -TEST_F(AddToHomescreenDataFetcherTest, EmptyManifest) { +TEST_F(AddToHomescreenDataFetcherTest, NoManifest) { // Check that an empty manifest has the appropriate methods run. base::HistogramTester histograms; ObserverWaiter waiter; @@ -384,14 +397,14 @@ RunFetcher(fetcher.get(), waiter, kWebAppInstallInfoTitle, blink::mojom::DisplayMode::kBrowser, AddToHomescreenParams::AppType::SHORTCUT, - InstallableStatusCode::MANIFEST_EMPTY); + InstallableStatusCode::NO_MANIFEST); CheckHistograms(histograms); } TEST_F(AddToHomescreenDataFetcherTest, NoIconManifest) { // Test a manifest with no icons. This should use the short name and have // a generated icon (empty icon url). - blink::mojom::ManifestPtr manifest = BuildDefaultManifest(); + blink::mojom::ManifestPtr manifest = BuildWebAPKManifest(); manifest->icons.clear(); SetManifest(std::move(manifest)); @@ -414,7 +427,7 @@ // favicon). TEST_F(AddToHomescreenDataFetcherTest, ManifestFetchTimesOutPwa) { SetShouldManifestTimeOut(true); - SetManifest(BuildDefaultManifest()); + SetManifest(BuildWebAPKManifest()); // Check a site where InstallableManager finishes working after the time out // and determines PWA-ness. This is only relevant when checking WebAPK @@ -434,7 +447,7 @@ TEST_F(AddToHomescreenDataFetcherTest, ManifestFetchTimesOutNonPwa) { SetShouldManifestTimeOut(true); - SetManifest(BuildDefaultManifest()); + SetManifest(BuildWebAPKManifest()); // Check where InstallableManager finishes working after the time out and // determines non-PWA-ness. @@ -453,7 +466,7 @@ TEST_F(AddToHomescreenDataFetcherTest, ManifestFetchTimesOutUnknown) { SetShouldManifestTimeOut(true); - SetManifest(BuildDefaultManifest()); + SetManifest(BuildWebAPKManifest()); // Check where InstallableManager doesn't finish working after the time out. base::HistogramTester histograms; @@ -472,7 +485,7 @@ TEST_F(AddToHomescreenDataFetcherTest, InstallableManifest) { // Test a site that has valid manifest. - SetManifest(BuildDefaultManifest()); + SetManifest(BuildWebAPKManifest()); base::HistogramTester histograms; ObserverWaiter waiter; @@ -500,7 +513,7 @@ // - The page is not WebAPK compatible. // - WebAppInstallInfo::title is used as the "name". // - We still use the icons from the manifest. - blink::mojom::ManifestPtr manifest = BuildDefaultManifest(); + blink::mojom::ManifestPtr manifest = BuildWebAPKManifest(); manifest->name = std::nullopt; manifest->short_name = std::nullopt; @@ -525,7 +538,7 @@ features::kUniversalInstallManifest); // Test that when the manifest does not provide either Manifest::short_name // nor Manifest::name but web page metadata provides a application-name. - blink::mojom::ManifestPtr manifest = BuildDefaultManifest(); + blink::mojom::ManifestPtr manifest = BuildWebAPKManifest(); manifest->name = std::nullopt; manifest->short_name = std::nullopt; SetManifest(std::move(manifest)); @@ -552,7 +565,7 @@ {}); // Test that when the manifest does not provide any icon, we fallback to use // favicon. - blink::mojom::ManifestPtr manifest = BuildDefaultManifest(); + blink::mojom::ManifestPtr manifest = BuildWebAPKManifest(); manifest->icons.clear(); SetManifest(std::move(manifest)); @@ -585,7 +598,7 @@ features::kUniversalInstallManifest); // Test that when the manifest does not provide display mode, we fallback to // install with DisplayMode::kMinimalUi. - blink::mojom::ManifestPtr manifest = BuildDefaultManifest(); + blink::mojom::ManifestPtr manifest = BuildWebAPKManifest(); manifest->display = blink::mojom::DisplayMode::kUndefined; SetManifest(std::move(manifest)); mojom::WebPageMetadataPtr metadata = BuildDefaultMetadata(); @@ -613,9 +626,10 @@ features::kUniversalInstallIcon}, {}); - NavigateAndCommit(GURL("https://www.example.com/index.html")); + GURL document_url = GURL("https://www.example.com/index.html"); + NavigateAndCommit(document_url); - SetManifest(blink::mojom::Manifest::New()); + SetManifestAsDefault(document_url); SetWebPageMetadata(BuildDefaultMetadata()); std::vector<blink::mojom::FaviconURLPtr> favicon_urls; favicon_urls.push_back(blink::mojom::FaviconURL::New( @@ -648,9 +662,10 @@ features::kUniversalInstallIcon}, {}); - NavigateAndCommit(GURL("https://www.example.com/scope/index.html")); + GURL document_url = GURL("https://www.example.com/scope/index.html"); + NavigateAndCommit(document_url); - SetManifest(blink::mojom::Manifest::New()); + SetManifestAsDefault(document_url); SetWebPageMetadata(BuildDefaultMetadata()); std::vector<blink::mojom::FaviconURLPtr> favicon_urls; favicon_urls.push_back(blink::mojom::FaviconURL::New( @@ -666,7 +681,7 @@ RunFetcher(fetcher.get(), waiter, kWebAppInstallInfoTitle, blink::mojom::DisplayMode::kBrowser, AddToHomescreenParams::AppType::SHORTCUT, - InstallableStatusCode::MANIFEST_EMPTY); + InstallableStatusCode::NO_MANIFEST); EXPECT_EQ(fetcher->shortcut_info().name, kWebAppInstallInfoTitle); EXPECT_EQ(fetcher->shortcut_info().short_name, kWebAppInstallInfoTitle);
diff --git a/components/webapps/browser/banners/app_banner_manager.cc b/components/webapps/browser/banners/app_banner_manager.cc index c529c2f..1d3fa40 100644 --- a/components/webapps/browser/banners/app_banner_manager.cc +++ b/components/webapps/browser/banners/app_banner_manager.cc
@@ -29,6 +29,7 @@ #include "components/webapps/browser/banners/web_app_banner_data.h" #include "components/webapps/browser/features.h" #include "components/webapps/browser/installable/installable_data.h" +#include "components/webapps/browser/installable/installable_logging.h" #include "components/webapps/browser/installable/installable_manager.h" #include "components/webapps/browser/installable/installable_metrics.h" #include "components/webapps/browser/webapps_client.h" @@ -142,10 +143,10 @@ // In general, NullStatusReporter::ReportStatus should not be called. // However, it may be called in cases where Stop is called without a // preceding call to RequestAppBanner e.g. because the WebContents is being - // destroyed or web app uninstalled. In that case, code should always be - // NO_ERROR_DETECTED or PIPELINE_RESTARTED. + // destroyed, a web app uninstalled, or the manifest url changing. DCHECK(code == InstallableStatusCode::NO_ERROR_DETECTED || - code == InstallableStatusCode::PIPELINE_RESTARTED); + code == InstallableStatusCode::PIPELINE_RESTARTED || + code == InstallableStatusCode::MANIFEST_URL_CHANGED); } WebappInstallSource GetInstallSource(content::WebContents* web_contents, @@ -372,19 +373,20 @@ return; } UpdateState(State::ACTIVE); + if (!data.errors.empty()) { Stop(data.GetFirstError()); return; } - + // An empty manifest means there was a network error or a parsing error, and + // that case is caught in the InstallableDataFetcher and an error is produced + // & caught above. + CHECK(!blink::IsEmptyManifest(*data.manifest)); manifest_url_ = *(data.manifest_url); manifest_ = data.manifest->Clone(); web_page_metadata_ = data.web_page_metadata->Clone(); - manifest_id_ = manifest_->id; - if (!manifest_id_.is_valid()) { - manifest_id_ = validated_url_.GetWithoutRef(); - } + CHECK(manifest_id_.is_valid()); // Skip checks for PasswordManager WebUI page. if (content::HasWebUIScheme(validated_url_) && @@ -535,7 +537,7 @@ SetInstallableWebAppCheckResult(InstallableWebAppCheckResult::kUnknown); } -void AppBannerManager::Terminate() { +void AppBannerManager::Terminate(InstallableStatusCode code) { switch (state_) { case State::PENDING_PROMPT_CANCELED: TrackBeforeInstallEvent( @@ -553,10 +555,10 @@ break; } - Stop(TerminationCode()); + Stop(code); } -InstallableStatusCode AppBannerManager::TerminationCode() const { +InstallableStatusCode AppBannerManager::TerminationCodeFromState() const { switch (state_) { case State::PENDING_PROMPT_CANCELED: case State::PENDING_PROMPT_NOT_CANCELED: @@ -682,7 +684,7 @@ } if (state_ != State::COMPLETE && state_ != State::INACTIVE) - Terminate(); + Terminate(TerminationCodeFromState()); ResetCurrentPageData(); if (handle->IsServedFromBackForwardCache()) { @@ -713,29 +715,15 @@ void AppBannerManager::DidUpdateWebManifestURL( content::RenderFrameHost* target_frame, const GURL& manifest_url) { - GURL url = validated_url_; - switch (state_) { - case State::INACTIVE: - return; - case State::FETCHING_MANIFEST: - case State::PENDING_INSTALLABLE_CHECK: - UpdateState(State::INACTIVE); - RequestAppBanner(); - return; - case State::ACTIVE: - case State::FETCHING_NATIVE_DATA: - case State::PENDING_ENGAGEMENT: - case State::SENDING_EVENT: - case State::SENDING_EVENT_GOT_EARLY_PROMPT: - case State::PENDING_PROMPT_CANCELED: - case State::PENDING_PROMPT_NOT_CANCELED: - Terminate(); - [[fallthrough]]; - case State::COMPLETE: - if (!manifest_url.is_empty()) { - RecheckInstallabilityForLoadedPage(); - } - return; + if (state_ == State::INACTIVE || + (state_ == State::COMPLETE && manifest_url.is_empty())) { + return; + } + Terminate(manifest_url.is_empty() + ? InstallableStatusCode::NO_MANIFEST + : InstallableStatusCode::MANIFEST_URL_CHANGED); + if (!manifest_url.is_empty()) { + RecheckInstallabilityForLoadedPage(); } } @@ -752,7 +740,7 @@ } void AppBannerManager::WebContentsDestroyed() { - Terminate(); + Terminate(TerminationCodeFromState()); manager_ = nullptr; }
diff --git a/components/webapps/browser/banners/app_banner_manager.h b/components/webapps/browser/banners/app_banner_manager.h index 019b036..556f5b1 100644 --- a/components/webapps/browser/banners/app_banner_manager.h +++ b/components/webapps/browser/banners/app_banner_manager.h
@@ -147,9 +147,16 @@ InstallableWebAppCheckResult GetInstallableWebAppCheckResult(); - // Constructs and returns data about the web app on this page. Returns a - // std::nullopt if it doesn't exist. This is not guaranteed to have all data, - // please use the observer to wait. + // Constructs and returns data about the web app on this page. This is not + // guaranteed to have all data, and its presence does not mean the current + // page is promotable. If the page doesn't have a manifest url at all, this + // can still be populated with the default manifest. To ensure completion of + // the AppBannerManager pipeline & appropriate status, use the Observer + // interface to wait for an installable status. This returns a std::nullopt if + // - The manifest is hasn't been fetched yet. + // - This page is not eligible for installing (not https, incognito profile, + // etc). + // - There were parsing errors or network errors fetching the manifest. std::optional<WebAppBannerData> GetCurrentWebAppBannerData() const; // Returns whether installability checks satisfy promotion requirements @@ -330,7 +337,7 @@ virtual void ResetCurrentPageData(); // Stops the banner pipeline early. - void Terminate(); + void Terminate(InstallableStatusCode code); // Stops the banner pipeline, preventing any outstanding callbacks from // running and resetting the manager state. This method is virtual to allow @@ -435,7 +442,7 @@ void DisplayAppBanner() override; // Returns a status code based on the current state, to log when terminating. - InstallableStatusCode TerminationCode() const; + InstallableStatusCode TerminationCodeFromState() const; // Fetches the data required to display a banner for the current page. raw_ptr<InstallableManager> manager_;
diff --git a/components/webapps/browser/installable/installable_data_fetcher.cc b/components/webapps/browser/installable/installable_data_fetcher.cc index f86989f..e9648fa 100644 --- a/components/webapps/browser/installable/installable_data_fetcher.cc +++ b/components/webapps/browser/installable/installable_data_fetcher.cc
@@ -6,6 +6,7 @@ #include "base/functional/callback.h" #include "components/webapps/browser/features.h" +#include "components/webapps/browser/installable/installable_logging.h" #include "components/webapps/browser/installable/installable_metrics.h" #include "components/webapps/common/constants.h" #include "content/public/browser/manifest_icon_downloader.h" @@ -58,15 +59,12 @@ const GURL& manifest_url, blink::mojom::ManifestPtr manifest) { InstallableStatusCode error = InstallableStatusCode::NO_ERROR_DETECTED; - if (!base::FeatureList::IsEnabled( - features::kUniversalInstallRootScopeNoManifest)) { - if (manifest_url.is_empty()) { - error = InstallableStatusCode::NO_MANIFEST; - } else if (blink::IsEmptyManifest(manifest)) { - error = InstallableStatusCode::MANIFEST_EMPTY; - } + // An empty manifest signifies an error fetching, parsing, or a + // frame/CORS/opaque origin related issue. Otherwise the manifest algorithm + // will always populate default values for `start_url`, `id`, and `scope`. + if (blink::IsEmptyManifest(manifest)) { + error = InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR; } - page_data_->OnManifestFetched(std::move(manifest), manifest_url, error); std::move(finish_callback).Run(error); } @@ -172,7 +170,7 @@ FetcherCallback finish_callback, bool prefer_maskable, bool fetch_favicon) { - if (blink::IsEmptyManifest(page_data_->GetManifest()) && !fetch_favicon) { + if (page_data_->manifest_url().is_empty() && !fetch_favicon) { std::move(finish_callback).Run(InstallableStatusCode::NO_ERROR_DETECTED); return; }
diff --git a/components/webapps/browser/installable/installable_evaluator.cc b/components/webapps/browser/installable/installable_evaluator.cc index 095f9495..21fc5b1 100644 --- a/components/webapps/browser/installable/installable_evaluator.cc +++ b/components/webapps/browser/installable/installable_evaluator.cc
@@ -59,14 +59,16 @@ case InstallableCriteria::kValidManifestWithIcons: break; } + // This occurs when there is an error parsing the manifest, a network issue, + // or a CORS / opaque origin issue. + if (blink::IsEmptyManifest(manifest)) { + return InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR; + } if (manifest_url.is_empty()) { return InstallableStatusCode::NO_MANIFEST; } - if (blink::IsEmptyManifest(manifest)) { - return InstallableStatusCode::MANIFEST_EMPTY; - } return InstallableStatusCode::NO_ERROR_DETECTED; }
diff --git a/components/webapps/browser/installable/installable_evaluator_unittest.cc b/components/webapps/browser/installable/installable_evaluator_unittest.cc index d089feec..f18a799 100644 --- a/components/webapps/browser/installable/installable_evaluator_unittest.cc +++ b/components/webapps/browser/installable/installable_evaluator_unittest.cc
@@ -16,6 +16,7 @@ #include "content/public/test/web_contents_tester.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/features.h" +#include "third_party/blink/public/common/manifest/manifest_util.h" #include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h" #include "third_party/blink/public/mojom/manifest/display_mode.mojom.h" #include "third_party/blink/public/mojom/manifest/manifest.mojom.h" @@ -82,8 +83,27 @@ web_contents_tester()->TestSetFaviconURL(mojo::Clone(favicon_urls)); } + // Builds and sets the default manifest for the given document url. + void SetManifestAsDefault(const GURL& document_url) { + auto manifest = blink::mojom::Manifest::New(); + manifest->start_url = document_url; + manifest->scope = document_url.GetWithoutFilename(); + manifest->id = document_url.GetWithoutRef(); + page_data_->OnManifestFetched(std::move(manifest), /*manifest_url=*/GURL(), + InstallableStatusCode::NO_ERROR_DETECTED); + } + + void SetManifestParsingOrNetworkError() { + page_data_->OnManifestFetched( + blink::mojom::Manifest::New(), + /*manifest_url=*/GURL(), + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR); + } + void SetManifest(blink::mojom::ManifestPtr manifest) { GURL manifest_url("http://example.com"); + CHECK(!blink::IsEmptyManifest(manifest)) + << "Use SetManifestEmpty() instead to set an empty manifest."; page_data_->OnManifestFetched(std::move(manifest), manifest_url, InstallableStatusCode::NO_ERROR_DETECTED); } @@ -152,31 +172,34 @@ InstallableCriteria::kImplicitManifestFieldsHTML, InstallableCriteria::kNoManifestAtRootScope)); -TEST_P(InstallableEvaluatorCriteriaUnitTest, NoManifest) { +TEST_P(InstallableEvaluatorCriteriaUnitTest, UnsetManifest) { web_contents_tester()->NavigateAndCommit(GURL("https://www.example.com")); TestCheckInstallability( - InstallableStatusCode::NO_MANIFEST, InstallableStatusCode::NO_MANIFEST, + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR, + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR, InstallableStatusCode::MANIFEST_MISSING_NAME_OR_SHORT_NAME); web_contents_tester()->NavigateAndCommit( GURL("https://www.example.com/path/page.html")); - TestCheckInstallability(InstallableStatusCode::NO_MANIFEST, - InstallableStatusCode::NO_MANIFEST, - InstallableStatusCode::NO_MANIFEST); + TestCheckInstallability( + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR, + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR, + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR); } -TEST_P(InstallableEvaluatorCriteriaUnitTest, EmptyManifest) { - SetManifest(blink::mojom::Manifest::New()); +TEST_P(InstallableEvaluatorCriteriaUnitTest, ManifestParsingOrNetworkError) { + SetManifestParsingOrNetworkError(); TestCheckInstallability( - InstallableStatusCode::MANIFEST_EMPTY, - InstallableStatusCode::MANIFEST_EMPTY, + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR, + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR, InstallableStatusCode::MANIFEST_MISSING_NAME_OR_SHORT_NAME); web_contents_tester()->NavigateAndCommit( GURL("https://www.example.com/path/page.html")); - TestCheckInstallability(InstallableStatusCode::MANIFEST_EMPTY, - InstallableStatusCode::MANIFEST_EMPTY, - InstallableStatusCode::MANIFEST_EMPTY); + TestCheckInstallability( + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR, + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR, + InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR); } TEST_P(InstallableEvaluatorCriteriaUnitTest, CheckStartUrl) { @@ -615,13 +638,14 @@ TEST_F(InstallableEvaluatorUnitTest, ValidMetadata) { // Non-empty manifest with only the "display" field, with valid metadata // is installable. - SetManifest(blink::mojom::Manifest::New()); - manifest()->display = blink::mojom::DisplayMode::kStandalone; + auto manifest = blink::mojom::Manifest::New(); + manifest->display = blink::mojom::DisplayMode::kStandalone; // Note: the start_url, id, and scope are all set from the document_url if // they don't exist - manifest()->start_url = GURL("http://example.com"); - manifest()->id = GURL("http://example.com"); - manifest()->scope = GURL("http://example.com"); + manifest->start_url = GURL("http://example.com"); + manifest->id = GURL("http://example.com"); + manifest->scope = GURL("http://example.com"); + SetManifest(std::move(manifest)); SetMetadata(GetWebPageMetadata()); AddFavicon();
diff --git a/components/webapps/browser/installable/installable_logging.cc b/components/webapps/browser/installable/installable_logging.cc index 9efcaca..441dc7c 100644 --- a/components/webapps/browser/installable/installable_logging.cc +++ b/components/webapps/browser/installable/installable_logging.cc
@@ -22,8 +22,9 @@ static const char kNotFromSecureOriginMessage[] = "Page is not served from a secure origin"; static const char kNoManifestMessage[] = "Page has no manifest <link> URL"; -static const char kManifestEmptyMessage[] = - "Manifest could not be fetched, is empty, or could not be parsed"; +static const char kManifestParsingOrNetworkErrorMessage[] = + "The manifest could not be fetched, parsed, or the document is on an " + "opaque origin."; static const char kStartUrlNotValidMessage[] = "Manifest start URL is not valid"; static const char kManifestMissingNameOrShortNameMessage[] = @@ -70,7 +71,8 @@ static const char kNotFromSecureOriginId[] = "not-from-secure-origin"; static const char kNoManifestId[] = "no-manifest"; -static const char kManifestEmptyId[] = "manifest-empty"; +static const char kManifestParsingOrNetworkErrorId[] = + "manifest-parsing-or-network-error"; static const char kStartUrlNotValidId[] = "start-url-not-valid"; static const char kManifestMissingNameOrShortNameId[] = "manifest-missing-name-or-short-name"; @@ -139,8 +141,8 @@ case webapps::InstallableStatusCode::NO_MANIFEST: message = kNoManifestMessage; break; - case webapps::InstallableStatusCode::MANIFEST_EMPTY: - message = kManifestEmptyMessage; + case webapps::InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR: + message = kManifestParsingOrNetworkErrorMessage; break; case webapps::InstallableStatusCode::START_URL_NOT_VALID: message = kStartUrlNotValidMessage; @@ -246,8 +248,8 @@ case webapps::InstallableStatusCode::NO_MANIFEST: error_id = kNoManifestId; break; - case webapps::InstallableStatusCode::MANIFEST_EMPTY: - error_id = kManifestEmptyId; + case webapps::InstallableStatusCode::MANIFEST_PARSING_OR_NETWORK_ERROR: + error_id = kManifestParsingOrNetworkErrorId; break; case webapps::InstallableStatusCode::START_URL_NOT_VALID: error_id = kStartUrlNotValidId;
diff --git a/components/webapps/browser/installable/installable_logging.h b/components/webapps/browser/installable/installable_logging.h index 1145b8b..edc9f24 100644 --- a/components/webapps/browser/installable/installable_logging.h +++ b/components/webapps/browser/installable/installable_logging.h
@@ -29,7 +29,11 @@ // NOT_IN_MAIN_FRAME = 4 (DEPRECATED), NOT_FROM_SECURE_ORIGIN = 5, NO_MANIFEST = 6, - MANIFEST_EMPTY = 7, + // The manifest failed to parse, the network failed, or the document is an + // opaque origin. + // Note: This was renamed from MANIFEST_EMPTY now that the document can return + // a default manifest. + MANIFEST_PARSING_OR_NETWORK_ERROR = 7, START_URL_NOT_VALID = 8, MANIFEST_MISSING_NAME_OR_SHORT_NAME = 9, MANIFEST_DISPLAY_NOT_SUPPORTED = 10,
diff --git a/components/webapps/browser/installable/installable_page_data.h b/components/webapps/browser/installable/installable_page_data.h index a6ee526b..ba95423f 100644 --- a/components/webapps/browser/installable/installable_page_data.h +++ b/components/webapps/browser/installable/installable_page_data.h
@@ -72,6 +72,7 @@ ~ManifestProperty(); InstallableStatusCode error = InstallableStatusCode::NO_ERROR_DETECTED; + // This can be empty if the page doesn't have a manifest url. GURL url; blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); bool fetched = false;
diff --git a/content/app/content_main.cc b/content/app/content_main.cc index aebbcca..773c69ca0 100644 --- a/content/app/content_main.cc +++ b/content/app/content_main.cc
@@ -287,12 +287,10 @@ #endif #if BUILDFLAG(IS_IOS) - // TODO(crbug.com/1412835): Remove this initialization on iOS. Everything - // runs in process for now as we have no fork. + // TODO(crbug.com/1412835): We support multiprocess launch of the content + // process, but for now networking and GPU are still in process. base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); -#if !TARGET_OS_SIMULATOR - command_line->AppendSwitch(switches::kSingleProcess); -#endif + command_line->AppendSwitch(switches::kInProcessGPU); command_line->AppendSwitch(switches::kEnableViewport); command_line->AppendSwitch(switches::kUseMobileUserAgent); #endif
diff --git a/content/app/ios/appex/content_main_thunk.cc b/content/app/ios/appex/content_main_thunk.cc index 14b854c..d7ccb302 100644 --- a/content/app/ios/appex/content_main_thunk.cc +++ b/content/app/ios/appex/content_main_thunk.cc
@@ -4,6 +4,8 @@ #include <pthread.h> #include <xpc/xpc.h> + +#include "base/check_op.h" #include "base/mac/mach_port_rendezvous.h" // Leaked variables for now. @@ -22,9 +24,26 @@ } extern "C" void ContentProcessHandleNewConnection(xpc_connection_t connection) { - // TODO(dtapuska): For now we create our own main thread, figure out if we can - // use the ExtensionMain (thread 0) as the main thread but calling - // CFRunLoopRunInMode seems to crash it so we can't enter a nested event loop - // with some objects on the stack. - pthread_create(&g_main_thread, NULL, RunMain, NULL); + xpc_connection_set_event_handler(connection, ^(xpc_object_t msg) { + xpc_type_t msg_type = xpc_get_type(msg); + CHECK_EQ(msg_type, XPC_TYPE_DICTIONARY); + xpc_object_t args_array = xpc_dictionary_get_array(msg, "args"); + g_argc = xpc_array_get_count(args_array); + g_argv = new const char*[g_argc]; + for (size_t i = 0; i < g_argc; ++i) { + g_argv[i] = strdup(xpc_array_get_string(args_array, i)); + } + + mach_port_t port = xpc_dictionary_copy_mach_send(msg, "port"); + base::apple::ScopedMachSendRight server_port(port); + bool res = + base::MachPortRendezvousClient::Initialize(std::move(server_port)); + CHECK(res) << "MachPortRendezvousClient failed"; + // TODO(dtapuska): For now we create our own main thread, figure out if we + // can use the ExtensionMain (thread 0) as the main thread but calling + // CFRunLoopRunInMode seems to crash it so we can't enter a nested event + // loop with some objects on the stack. + pthread_create(&g_main_thread, NULL, RunMain, NULL); + }); + xpc_connection_activate(connection); }
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 14a5a76..9480a24 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -2636,7 +2636,7 @@ ] } else if (is_ios) { sources += [ - "child_process_launcher_helper_ios.cc", + "child_process_launcher_helper_ios.mm", "date_time_chooser/ios/date_time_chooser_coordinator.h", "date_time_chooser/ios/date_time_chooser_coordinator.mm", "date_time_chooser/ios/date_time_chooser_delegate.h", @@ -2665,7 +2665,10 @@ "web_contents/web_contents_view_ios.h", "web_contents/web_contents_view_ios.mm", ] - frameworks += [ "IOSurface.framework" ] + frameworks += [ + "BrowserEngineKit.framework", + "IOSurface.framework", + ] deps += [ "//ui/accelerated_widget_mac" ] } else { # Not Mac.
diff --git a/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc b/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc index 9d19f909f..38a83332 100644 --- a/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc +++ b/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc
@@ -36,6 +36,7 @@ #include "components/attribution_reporting/features.h" #include "components/attribution_reporting/os_registration.h" #include "components/attribution_reporting/registrar.h" +#include "components/attribution_reporting/registrar_info.h" #include "components/attribution_reporting/registration_eligibility.mojom.h" #include "components/attribution_reporting/registration_info.h" #include "components/attribution_reporting/source_registration.h" @@ -61,7 +62,6 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_client.h" -#include "content/public/common/content_features.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h" #include "net/http/http_response_headers.h" @@ -1187,7 +1187,7 @@ std::optional<Registrar> preferred_platform) { DCHECK(it != registrations_.end()); - auto registration_info = attribution_reporting::RegistrationInfo::Get( + auto registrar_info = attribution_reporting::RegistrarInfo::Get( pending_registration_data.headers.web_header.has_value(), pending_registration_data.headers.os_header.has_value(), pending_registration_data.headers.type == RegistrationType::kSource, @@ -1197,14 +1197,14 @@ RenderFrameHost::FromID(it->render_frame_id())))); pending_registration_data.headers.LogIssues( - *it, pending_registration_data.reporting_url, registration_info.issues); + *it, pending_registration_data.reporting_url, registrar_info.issues); - if (!registration_info.registrar.has_value()) { + if (!registrar_info.registrar.has_value()) { return; } std::optional<std::string>* header; - switch (registration_info.registrar.value()) { + switch (registrar_info.registrar.value()) { case Registrar::kWeb: header = &pending_registration_data.headers.web_header; break; @@ -1221,7 +1221,7 @@ std::move(pending_registration_data.reporting_origin), std::move(pending_registration_data.reporting_url), std::move(pending_registration_data.verifications)), - registration_info.registrar.value()); + registrar_info.registrar.value()); } void AttributionDataHostManagerImpl::HandleNextWebDecode( @@ -1770,9 +1770,6 @@ AttributionSuitableContext suitable_context, std::optional<int64_t> navigation_id, std::string devtools_request_id) { - CHECK(base::FeatureList::IsEnabled( - features::kAttributionFencedFrameReportingBeacon)); - if (navigation_id.has_value()) { MaybeStartNavigation(navigation_id.value()); }
diff --git a/content/browser/attribution_reporting/attribution_src_browsertest.cc b/content/browser/attribution_reporting/attribution_src_browsertest.cc index 35c6170..b796418 100644 --- a/content/browser/attribution_reporting/attribution_src_browsertest.cc +++ b/content/browser/attribution_reporting/attribution_src_browsertest.cc
@@ -36,7 +36,6 @@ #include "content/browser/attribution_reporting/test/mock_attribution_host.h" #include "content/browser/attribution_reporting/test/mock_attribution_manager.h" #include "content/browser/attribution_reporting/test/mock_content_browser_client.h" -#include "content/browser/attribution_reporting/test/mock_data_host.h" #include "content/browser/attribution_reporting/test/source_observer.h" #include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/browser/storage_partition_impl.h"
diff --git a/content/browser/attribution_reporting/attributions_browsertest.cc b/content/browser/attribution_reporting/attributions_browsertest.cc index b0af767..d68fa7c6 100644 --- a/content/browser/attribution_reporting/attributions_browsertest.cc +++ b/content/browser/attribution_reporting/attributions_browsertest.cc
@@ -1436,7 +1436,6 @@ : AttributionsBrowserTest(/*enabled_features=*/{ blink::features::kFencedFrames, features::kPrivacySandboxAdsAPIsOverride, - features::kAttributionFencedFrameReportingBeacon, blink::features::kFencedFramesAPIChanges, blink::features::kFencedFramesDefaultMode}) {}
diff --git a/content/browser/attribution_reporting/test/mock_data_host.cc b/content/browser/attribution_reporting/test/mock_data_host.cc deleted file mode 100644 index 03ca2b2..0000000 --- a/content/browser/attribution_reporting/test/mock_data_host.cc +++ /dev/null
@@ -1,114 +0,0 @@ -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/browser/attribution_reporting/test/mock_data_host.h" - -#include <stddef.h> - -#include <memory> -#include <optional> -#include <utility> -#include <vector> - -#include "base/run_loop.h" -#include "components/attribution_reporting/os_registration.h" -#include "components/attribution_reporting/source_registration.h" -#include "components/attribution_reporting/suitable_origin.h" -#include "components/attribution_reporting/trigger_registration.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/receiver.h" -#include "services/network/public/cpp/trigger_verification.h" -#include "third_party/blink/public/mojom/conversions/attribution_data_host.mojom.h" - -namespace content { - -MockDataHost::MockDataHost( - mojo::PendingReceiver<blink::mojom::AttributionDataHost> data_host) { - receiver_.Bind(std::move(data_host)); -} - -MockDataHost::~MockDataHost() = default; - -void MockDataHost::WaitForSourceData(size_t num_source_data) { - WaitForSourceAndTriggerData(num_source_data, /*num_trigger_data=*/0); -} - -void MockDataHost::WaitForTriggerData(size_t num_trigger_data) { - WaitForSourceAndTriggerData(/*num_source_data=*/0, num_trigger_data); -} - -void MockDataHost::WaitForSourceAndTriggerData(size_t num_source_data, - size_t num_trigger_data) { - min_source_data_count_ = num_source_data; - min_trigger_data_count_ = num_trigger_data; - if (source_data_.size() >= min_source_data_count_ && - trigger_data_.size() >= min_trigger_data_count_) { - return; - } - wait_loop_.Run(); -} - -void MockDataHost::SourceDataAvailable( - attribution_reporting::SuitableOrigin reporting_origin, - attribution_reporting::SourceRegistration data) { - source_data_.push_back(std::move(data)); - if (source_data_.size() < min_source_data_count_ || - trigger_data_.size() < min_trigger_data_count_) { - return; - } - wait_loop_.Quit(); -} - -void MockDataHost::TriggerDataAvailable( - attribution_reporting::SuitableOrigin reporting_origin, - attribution_reporting::TriggerRegistration data, - std::vector<network::TriggerVerification> verifications) { - trigger_data_.push_back(std::move(data)); - if (trigger_data_.size() < min_trigger_data_count_ || - source_data_.size() < min_source_data_count_) { - return; - } - wait_loop_.Quit(); -} - -void MockDataHost::OsSourceDataAvailable( - std::vector<attribution_reporting::OsRegistrationItem> registration_items) { - os_sources_.emplace_back(std::move(registration_items)); - if (os_sources_.size() < min_os_sources_count_) { - return; - } - wait_loop_.Quit(); -} - -void MockDataHost::OsTriggerDataAvailable( - std::vector<attribution_reporting::OsRegistrationItem> registration_items) { - os_triggers_.emplace_back(std::move(registration_items)); - if (os_triggers_.size() < min_os_triggers_count_) { - return; - } - wait_loop_.Quit(); -} - -void MockDataHost::WaitForOsSources(size_t num_os_sources) { - min_os_sources_count_ = num_os_sources; - if (os_sources_.size() >= min_os_sources_count_) { - return; - } - wait_loop_.Run(); -} - -void MockDataHost::WaitForOsTriggers(size_t num_os_triggers) { - min_os_triggers_count_ = num_os_triggers; - if (os_triggers_.size() >= min_os_triggers_count_) { - return; - } - wait_loop_.Run(); -} - -std::unique_ptr<MockDataHost> GetRegisteredDataHost( - mojo::PendingReceiver<blink::mojom::AttributionDataHost> data_host) { - return std::make_unique<MockDataHost>(std::move(data_host)); -} - -} // namespace content
diff --git a/content/browser/attribution_reporting/test/mock_data_host.h b/content/browser/attribution_reporting/test/mock_data_host.h deleted file mode 100644 index c3e7e08..0000000 --- a/content/browser/attribution_reporting/test/mock_data_host.h +++ /dev/null
@@ -1,106 +0,0 @@ -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_BROWSER_ATTRIBUTION_REPORTING_TEST_MOCK_DATA_HOST_H_ -#define CONTENT_BROWSER_ATTRIBUTION_REPORTING_TEST_MOCK_DATA_HOST_H_ - -#include <stddef.h> - -#include <memory> -#include <optional> -#include <vector> - -#include "base/run_loop.h" -#include "mojo/public/cpp/bindings/receiver.h" -#include "third_party/blink/public/mojom/conversions/attribution_data_host.mojom.h" - -namespace attribution_reporting { -struct OsRegistrationItem; -struct SourceRegistration; -struct TriggerRegistration; -} // namespace attribution_reporting - -namespace mojo { - -template <typename Interface> -class PendingReceiver; - -} // namespace mojo - -namespace content { - -class MockDataHost : public blink::mojom::AttributionDataHost { - public: - explicit MockDataHost( - mojo::PendingReceiver<blink::mojom::AttributionDataHost>); - ~MockDataHost() override; - - void WaitForSourceData(size_t num_source_data); - void WaitForTriggerData(size_t num_trigger_data); - void WaitForSourceAndTriggerData(size_t num_source_data, - size_t num_trigger_data); - - const std::vector<attribution_reporting::SourceRegistration>& source_data() - const { - return source_data_; - } - - const std::vector<attribution_reporting::TriggerRegistration>& trigger_data() - const { - return trigger_data_; - } - - const std::vector<std::vector<attribution_reporting::OsRegistrationItem>>& - os_sources() const { - return os_sources_; - } - const std::vector<std::vector<attribution_reporting::OsRegistrationItem>>& - os_triggers() const { - return os_triggers_; - } - void WaitForOsSources(size_t); - void WaitForOsTriggers(size_t); - - mojo::Receiver<blink::mojom::AttributionDataHost>& receiver() { - return receiver_; - } - - private: - // blink::mojom::AttributionDataHost: - void SourceDataAvailable( - attribution_reporting::SuitableOrigin reporting_origin, - attribution_reporting::SourceRegistration) override; - void TriggerDataAvailable( - attribution_reporting::SuitableOrigin reporting_origin, - attribution_reporting::TriggerRegistration, - std::vector<network::TriggerVerification>) override; - void OsSourceDataAvailable( - std::vector<attribution_reporting::OsRegistrationItem>) override; - void OsTriggerDataAvailable( - std::vector<attribution_reporting::OsRegistrationItem>) override; - - size_t min_source_data_count_ = 0; - std::vector<attribution_reporting::SourceRegistration> source_data_; - - size_t min_trigger_data_count_ = 0; - std::vector<attribution_reporting::TriggerRegistration> trigger_data_; - - size_t min_os_sources_count_ = 0; - std::vector<std::vector<attribution_reporting::OsRegistrationItem>> - os_sources_; - - size_t min_os_triggers_count_ = 0; - std::vector<std::vector<attribution_reporting::OsRegistrationItem>> - os_triggers_; - - base::RunLoop wait_loop_; - mojo::Receiver<blink::mojom::AttributionDataHost> receiver_{this}; -}; - -std::unique_ptr<MockDataHost> GetRegisteredDataHost( - mojo::PendingReceiver<blink::mojom::AttributionDataHost>); - -} // namespace content - -#endif // CONTENT_BROWSER_ATTRIBUTION_REPORTING_TEST_MOCK_DATA_HOST_H_
diff --git a/content/browser/back_forward_cache_not_restored_reasons_browsertest.cc b/content/browser/back_forward_cache_not_restored_reasons_browsertest.cc index 0dde6b40..e7d99ec 100644 --- a/content/browser/back_forward_cache_not_restored_reasons_browsertest.cc +++ b/content/browser/back_forward_cache_not_restored_reasons_browsertest.cc
@@ -2,10 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/back_forward_cache_browsertest.h" - #include <optional> +#include "content/browser/back_forward_cache_browsertest.h" #include "content/browser/back_forward_cache_test_util.h" #include "content/browser/renderer_host/navigation_request.h" #include "content/browser/web_contents/web_contents_impl.h"
diff --git a/content/browser/child_process_launcher_helper.cc b/content/browser/child_process_launcher_helper.cc index 3583408c8..7569e0a 100644 --- a/content/browser/child_process_launcher_helper.cc +++ b/content/browser/child_process_launcher_helper.cc
@@ -33,6 +33,10 @@ #include "content/browser/android/launcher_thread.h" #endif +#if BUILDFLAG(IS_IOS) +#include "base/mac/mach_port_rendezvous.h" +#endif + namespace content { namespace internal {
diff --git a/content/browser/child_process_launcher_helper.h b/content/browser/child_process_launcher_helper.h index fdff89a4..9687a27 100644 --- a/content/browser/child_process_launcher_helper.h +++ b/content/browser/child_process_launcher_helper.h
@@ -62,6 +62,10 @@ namespace base { class CommandLine; + +#if BUILDFLAG(IS_IOS) +class MachPortRendezvousServer; +#endif } namespace content { @@ -84,6 +88,15 @@ using FileMappedForLaunch = base::HandlesToInheritVector; #endif +#if BUILDFLAG(IS_IOS) +class LaunchResult; + +class ProcessStorageBase { + public: + virtual ~ProcessStorageBase() = default; +}; +#endif + // ChildProcessLauncherHelper is used by ChildProcessLauncher to start a // process. Since ChildProcessLauncher can be deleted by its client at any time, // this class is used to keep state as the process is started asynchronously. @@ -218,6 +231,10 @@ static void ForceNormalProcessTerminationAsync( ChildProcessLauncherHelper::Process process); +#if BUILDFLAG(IS_IOS) + void OnChildProcessStarted(std::unique_ptr<LaunchResult> launch_result); +#endif + #if BUILDFLAG(IS_ANDROID) void OnChildProcessStarted(JNIEnv* env, jint handle); @@ -304,6 +321,11 @@ #endif // BUILDFLAG(ENABLE_PPAPI) #endif // BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_IOS) + std::unique_ptr<base::MachPortRendezvousServer> rendezvous_server_; + std::unique_ptr<ProcessStorageBase> process_storage_; +#endif + #if BUILDFLAG(IS_ANDROID) base::android::ScopedJavaGlobalRef<jobject> java_peer_; bool java_peer_avaiable_on_client_thread_ = false;
diff --git a/content/browser/child_process_launcher_helper_ios.cc b/content/browser/child_process_launcher_helper_ios.cc deleted file mode 100644 index 4837c46..0000000 --- a/content/browser/child_process_launcher_helper_ios.cc +++ /dev/null
@@ -1,111 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/mac/mach_port_rendezvous.h" -#include "content/browser/child_process_launcher.h" -#include "content/browser/child_process_launcher_helper.h" -#include "content/browser/child_process_launcher_helper_posix.h" -#include "content/public/browser/child_process_launcher_utils.h" - -namespace content { -namespace internal { - -// TODO(crbug.com/1412835): Fill this class out. - -std::optional<mojo::NamedPlatformChannel> -ChildProcessLauncherHelper::CreateNamedPlatformChannelOnLauncherThread() { - DCHECK(CurrentlyOnProcessLauncherTaskRunner()); - return std::nullopt; -} - -void ChildProcessLauncherHelper::BeforeLaunchOnClientThread() { - DCHECK(client_task_runner_->RunsTasksInCurrentSequence()); -} - -std::unique_ptr<PosixFileDescriptorInfo> -ChildProcessLauncherHelper::GetFilesToMap() { - DCHECK(CurrentlyOnProcessLauncherTaskRunner()); - return CreateDefaultPosixFilesToMap( - child_process_id(), mojo_channel_->remote_endpoint(), - /*files_to_preload=*/{}, GetProcessType(), command_line()); -} - -bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( - FileMappedForLaunch& files_to_register, - base::LaunchOptions* options) { - mojo::PlatformHandle endpoint = - mojo_channel_->TakeRemoteEndpoint().TakePlatformHandle(); - DCHECK(endpoint.is_valid_mach_receive()); - options->mach_ports_for_rendezvous.insert(std::make_pair( - 'mojo', base::MachRendezvousPort(endpoint.TakeMachReceiveRight()))); - return true; -} - -ChildProcessLauncherHelper::Process -ChildProcessLauncherHelper::LaunchProcessOnLauncherThread( - const base::LaunchOptions* options, - std::unique_ptr<PosixFileDescriptorInfo> files_to_register, - bool* is_synchronous_launch, - int* launch_result) { - DCHECK(options); - *is_synchronous_launch = true; - ChildProcessLauncherHelper::Process process; - process.process = base::LaunchProcess(*command_line(), *options); - *launch_result = - process.process.IsValid() ? LAUNCH_RESULT_SUCCESS : LAUNCH_RESULT_FAILURE; - return process; -} - -bool ChildProcessLauncherHelper::IsUsingLaunchOptions() { - return true; -} - -void ChildProcessLauncherHelper::AfterLaunchOnLauncherThread( - const ChildProcessLauncherHelper::Process& process, - const base::LaunchOptions* options) {} - -ChildProcessTerminationInfo ChildProcessLauncherHelper::GetTerminationInfo( - const ChildProcessLauncherHelper::Process& process, - bool known_dead) { - ChildProcessTerminationInfo info; - info.status = known_dead ? base::GetKnownDeadTerminationStatus( - process.process.Handle(), &info.exit_code) - : base::GetTerminationStatus( - process.process.Handle(), &info.exit_code); - return info; -} - -// static -bool ChildProcessLauncherHelper::TerminateProcess(const base::Process& process, - int exit_code) { - // TODO(https://crbug.com/818244): Determine whether we should also call - // EnsureProcessTerminated() to make sure of process-exit, and reap it. - return process.Terminate(exit_code, false); -} - -// static -void ChildProcessLauncherHelper::ForceNormalProcessTerminationSync( - ChildProcessLauncherHelper::Process process) { - DCHECK(CurrentlyOnProcessLauncherTaskRunner()); - // Client has gone away, so just kill the process. Using exit code 0 means - // that UMA won't treat this as a crash. - process.process.Terminate(RESULT_CODE_NORMAL_EXIT, false); - base::EnsureProcessTerminated(std::move(process.process)); -} - -void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread( - base::Process process, - base::Process::Priority priority) {} - -// static -base::File OpenFileToShare(const base::FilePath& path, - base::MemoryMappedFile::Region* region) { - // Not used yet (until required files are described in the service manifest on - // iOS). - NOTREACHED(); - return base::File(); -} - -} // namespace internal -} // namespace content
diff --git a/content/browser/child_process_launcher_helper_ios.mm b/content/browser/child_process_launcher_helper_ios.mm new file mode 100644 index 0000000..6ac0dcc7 --- /dev/null +++ b/content/browser/child_process_launcher_helper_ios.mm
@@ -0,0 +1,193 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <list> + +#import <BrowserEngineKit/BEWebContentProcess.h> + +#include "base/mac/mach_port_rendezvous.h" +#include "content/browser/child_process_launcher.h" +#include "content/browser/child_process_launcher_helper.h" +#include "content/browser/child_process_launcher_helper_posix.h" +#include "content/public/browser/child_process_launcher_utils.h" + +namespace content { +namespace internal { + +// Object used to pass the result of the launch from the async +// dispatch_queue to the LauncherThread. +class LaunchResult { + public: + BEWebContentProcess* process; + NSError* error; +}; + +// Object to store the process handles. +class ProcessStorage : public ProcessStorageBase { + public: + ProcessStorage(BEWebContentProcess* process, xpc_connection_t connection) + : process_(process), ipc_channel_(connection) {} + ~ProcessStorage() override = default; + + private: + [[maybe_unused]] BEWebContentProcess* process_; + [[maybe_unused]] xpc_connection_t ipc_channel_; +}; + +std::optional<mojo::NamedPlatformChannel> +ChildProcessLauncherHelper::CreateNamedPlatformChannelOnLauncherThread() { + DCHECK(CurrentlyOnProcessLauncherTaskRunner()); + return std::nullopt; +} + +void ChildProcessLauncherHelper::BeforeLaunchOnClientThread() { + DCHECK(client_task_runner_->RunsTasksInCurrentSequence()); +} + +std::unique_ptr<PosixFileDescriptorInfo> +ChildProcessLauncherHelper::GetFilesToMap() { + DCHECK(CurrentlyOnProcessLauncherTaskRunner()); + return CreateDefaultPosixFilesToMap( + child_process_id(), mojo_channel_->remote_endpoint(), + /*files_to_preload=*/{}, GetProcessType(), command_line()); +} + +bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( + FileMappedForLaunch& files_to_register, + base::LaunchOptions* options) { + mojo::PlatformHandle endpoint = + mojo_channel_->TakeRemoteEndpoint().TakePlatformHandle(); + DCHECK(endpoint.is_valid_mach_receive()); + options->mach_ports_for_rendezvous.insert(std::make_pair( + 'mojo', base::MachRendezvousPort(endpoint.TakeMachReceiveRight()))); + return true; +} + +ChildProcessLauncherHelper::Process +ChildProcessLauncherHelper::LaunchProcessOnLauncherThread( + const base::LaunchOptions* options, + std::unique_ptr<PosixFileDescriptorInfo> files_to_register, + bool* is_synchronous_launch, + int* launch_result) { + DCHECK(options); + *is_synchronous_launch = false; + rendezvous_server_ = std::make_unique<base::MachPortRendezvousServer>( + options->mach_ports_for_rendezvous); + + void (^process_terminated)() = ^void() { + // TODO(dtapuska): This never gets called, once it does then we can + // make an implementation. Reported to Apple via feedback (13657030). + LOG(ERROR) << "Process died"; + }; + void (^process_launch_complete)(BEWebContentProcess* process, + NSError* error) = + ^void(BEWebContentProcess* process, NSError* error) { + auto result = std::make_unique<LaunchResult>(process, error); + GetProcessLauncherTaskRunner()->PostTask( + FROM_HERE, + base::BindOnce(&ChildProcessLauncherHelper::OnChildProcessStarted, + this, std::move(result))); + }; + + [BEWebContentProcess + webContentProcessWithInterruptionHandler:process_terminated + completion:process_launch_complete]; + AddRef(); + return Process(); +} + +void ChildProcessLauncherHelper::OnChildProcessStarted( + std::unique_ptr<LaunchResult> launch_result) { + DCHECK(CurrentlyOnProcessLauncherTaskRunner()); + scoped_refptr<ChildProcessLauncherHelper> ref(this); + Release(); // Balances with LaunchProcessOnLauncherThread. + + int launch_result_code = LAUNCH_RESULT_FAILURE; + + if (!launch_result->error) { + NSError* error = nil; + xpc_connection_t xpc_connection = + [launch_result->process makeLibXPCConnectionError:&error]; + if (xpc_connection) { + xpc_connection_set_event_handler(xpc_connection, ^(xpc_object_t msg){ + }); + xpc_connection_resume(xpc_connection); + xpc_object_t message = xpc_dictionary_create(nil, nil, 0); + xpc_object_t args_array = xpc_array_create_empty(); + for (const auto& arg : command_line()->argv()) { + xpc_object_t value = xpc_string_create(arg.c_str()); + xpc_array_append_value(args_array, value); + } + xpc_dictionary_set_value(message, "args", args_array); + xpc_dictionary_set_mach_send( + message, "port", rendezvous_server_->GetMachSendRight().get()); + xpc_connection_send_message(xpc_connection, message); + launch_result_code = LAUNCH_RESULT_SUCCESS; + + // Keep reference to BEWebContentProcess. + process_storage_ = std::make_unique<ProcessStorage>( + launch_result->process, xpc_connection); + } else { + [launch_result->process invalidate]; + } + } + + ChildProcessLauncherHelper::Process process; + // We need to hand out unique "process ids" just use a static counter + // for now. There should only be one launcher thread so this is + // synchronous access it doesn't need to be an atomic. + static pid_t g_pid = 0; + g_pid++; + process.process = base::Process(g_pid); + PostLaunchOnLauncherThread(std::move(process), launch_result_code); +} + +bool ChildProcessLauncherHelper::IsUsingLaunchOptions() { + return true; +} + +void ChildProcessLauncherHelper::AfterLaunchOnLauncherThread( + const ChildProcessLauncherHelper::Process& process, + const base::LaunchOptions* options) {} + +ChildProcessTerminationInfo ChildProcessLauncherHelper::GetTerminationInfo( + const ChildProcessLauncherHelper::Process& process, + bool known_dead) { + ChildProcessTerminationInfo info; + info.status = known_dead ? base::GetKnownDeadTerminationStatus( + process.process.Handle(), &info.exit_code) + : base::GetTerminationStatus( + process.process.Handle(), &info.exit_code); + return info; +} + +// static +bool ChildProcessLauncherHelper::TerminateProcess(const base::Process& process, + int exit_code) { + // TODO(dtapuska): We either need to lookup base::Process to some handle. + return false; +} + +// static +void ChildProcessLauncherHelper::ForceNormalProcessTerminationSync( + ChildProcessLauncherHelper::Process process) { + DCHECK(CurrentlyOnProcessLauncherTaskRunner()); + // TODO(dtapuska): Implement me, lookup ProcessStorage? +} + +void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread( + base::Process process, + base::Process::Priority priority) {} + +// static +base::File OpenFileToShare(const base::FilePath& path, + base::MemoryMappedFile::Region* region) { + // Not used yet (until required files are described in the service manifest on + // iOS). + NOTREACHED(); + return base::File(); +} + +} // namespace internal +} // namespace content
diff --git a/content/browser/fenced_frame/fenced_frame_browsertest.cc b/content/browser/fenced_frame/fenced_frame_browsertest.cc index 4ad8c6c..35aaf6fb 100644 --- a/content/browser/fenced_frame/fenced_frame_browsertest.cc +++ b/content/browser/fenced_frame/fenced_frame_browsertest.cc
@@ -5037,8 +5037,7 @@ // supporting iframes. FencedFrameReportEventBrowserTest() { scoped_feature_list_.InitWithFeaturesAndParameters( - {{blink::features::kAllowURNsInIframes, {}}, - {features::kAttributionFencedFrameReportingBeacon, {}}}, + {{blink::features::kAllowURNsInIframes, {}}}, {/* disabled_features */}); } @@ -6633,92 +6632,6 @@ EXPECT_EQ(reporting_response.http_request()->content, event_data); } -class FencedFrameReportEventAttributionDisabledBrowserTest - : public FencedFrameReportEventBrowserTest { - public: - FencedFrameReportEventAttributionDisabledBrowserTest() { - scoped_feature_list_.InitAndDisableFeature( - features::kAttributionFencedFrameReportingBeacon); - } - - private: - base::test::ScopedFeatureList scoped_feature_list_; -}; - -IN_PROC_BROWSER_TEST_F(FencedFrameReportEventAttributionDisabledBrowserTest, - FeatureDisabled_EligibleHeaderNotSet) { - net::test_server::ControllableHttpResponse response(https_server(), - kReportingURL); - ASSERT_TRUE(https_server()->Start()); - - GURL main_url = https_server()->GetURL("a.test", "/hello.html"); - EXPECT_TRUE(NavigateToURL(shell(), main_url)); - FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) - ->GetPrimaryFrameTree() - .root(); - EXPECT_TRUE(ExecJs(root, - "var f = document.createElement('fencedframe');" - "document.body.appendChild(f);")); - - EXPECT_EQ(1U, root->child_count()); - FrameTreeNode* fenced_frame_root_node = - GetFencedFrameRootNode(root->child_at(0)); - EXPECT_TRUE(fenced_frame_root_node->IsFencedFrameRoot()); - EXPECT_TRUE(fenced_frame_root_node->IsInFencedFrameTree()); - - GURL https_url( - https_server()->GetURL("a.test", "/fenced_frames/title1.html")); - - // Create a FencedFrameReporter and pass it reporting metadata. - scoped_refptr<FencedFrameReporter> fenced_frame_reporter = - CreateFencedFrameReporter(); - GURL reporting_url(https_server()->GetURL("a.test", kReportingURL)); - // Set valid reporting metadata for buyer. - fenced_frame_reporter->OnUrlMappingReady( - blink::FencedFrame::ReportingDestination::kBuyer, - url::Origin::Create(GURL()), {{"click", reporting_url}}); - - // Get the urn mapping object. - FencedFrameURLMapping& url_mapping = - root->current_frame_host()->GetPage().fenced_frame_urls_map(); - - // Add url and its reporting metadata to fenced frame url mapping. - auto urn_uuid = test::AddAndVerifyFencedFrameURL(&url_mapping, https_url, - fenced_frame_reporter); - - TestFencedFrameURLMappingResultObserver mapping_observer; - url_mapping.ConvertFencedFrameURNToURL(urn_uuid, &mapping_observer); - TestFrameNavigationObserver observer( - fenced_frame_root_node->current_frame_host()); - - // Navigate the fenced frame. - EXPECT_TRUE(ExecJs( - root, JsReplace("f.config = new FencedFrameConfig($1);", urn_uuid))); - - observer.WaitForCommit(); - EXPECT_TRUE(mapping_observer.mapping_complete_observed()); - EXPECT_EQ(fenced_frame_reporter, mapping_observer.fenced_frame_reporter()); - - // Perform the reportEvent call, with a unique body. - std::string event_data = "this is a click"; - std::string report_event_script = JsReplace(R"( - window.fence.reportEvent({ - eventType: 'click', - eventData: $1, - destination: ['buyer'], - }); - )", - event_data); - EXPECT_TRUE(ExecJs(fenced_frame_root_node, report_event_script)); - - response.WaitForRequest(); - EXPECT_EQ(response.http_request()->content, event_data); - EXPECT_FALSE(base::Contains(response.http_request()->headers, - "Attribution-Reporting-Eligible")); - EXPECT_FALSE(base::Contains(response.http_request()->headers, - "Attribution-Reporting-Support")); -} - class FencedFrameReportEventAttributionCrossAppWebEnabledBrowserTest : public FencedFrameReportEventBrowserTest { public:
diff --git a/content/browser/fenced_frame/fenced_frame_reporter.cc b/content/browser/fenced_frame/fenced_frame_reporter.cc index a00dc5a..a5de67c 100644 --- a/content/browser/fenced_frame/fenced_frame_reporter.cc +++ b/content/browser/fenced_frame/fenced_frame_reporter.cc
@@ -45,7 +45,6 @@ #include "content/public/browser/content_browser_client.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_client.h" -#include "content/public/common/content_features.h" #include "content/services/auction_worklet/public/mojom/private_aggregation_request.mojom.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/http/http_response_headers.h" @@ -410,9 +409,7 @@ WebContents* web_contents = WebContents::FromRenderFrameHost(request_initiator_frame); - if (base::FeatureList::IsEnabled( - features::kAttributionFencedFrameReportingBeacon) && - web_contents && + if (web_contents && network::HasAttributionSupport( AttributionManager::GetAttributionSupport(web_contents))) { if (auto suitable_context =
diff --git a/content/browser/fenced_frame/fenced_frame_reporter_unittest.cc b/content/browser/fenced_frame/fenced_frame_reporter_unittest.cc index 5c4c2c6..e677fe22 100644 --- a/content/browser/fenced_frame/fenced_frame_reporter_unittest.cc +++ b/content/browser/fenced_frame/fenced_frame_reporter_unittest.cc
@@ -22,7 +22,6 @@ #include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/browser/storage_partition_impl.h" #include "content/public/browser/browser_context.h" -#include "content/public/common/content_features.h" #include "content/public/test/test_renderer_host.h" #include "content/services/auction_worklet/public/mojom/private_aggregation_request.mojom.h" #include "content/test/test_content_browser_client.h" @@ -103,8 +102,7 @@ public: FencedFrameReporterTest() { scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{features::kAttributionFencedFrameReportingBeacon, - blink::features:: + /*enabled_features=*/{blink::features:: kFencedFramesAutomaticBeaconCredentials}, /*disabled_features=*/{}); }
diff --git a/content/browser/file_system/file_system_url_loader_factory_browsertest.cc b/content/browser/file_system/file_system_url_loader_factory_browsertest.cc index 71a5c42d..69b92d3 100644 --- a/content/browser/file_system/file_system_url_loader_factory_browsertest.cc +++ b/content/browser/file_system/file_system_url_loader_factory_browsertest.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 "content/browser/file_system/file_system_url_loader_factory.h" + #include <algorithm> #include <memory> #include <optional> @@ -26,7 +28,6 @@ #include "build/build_config.h" #include "components/file_access/scoped_file_access.h" #include "components/file_access/test/mock_scoped_file_access_delegate.h" -#include "content/browser/file_system/file_system_url_loader_factory.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h"
diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc index e9dce0f..31b0b83 100644 --- a/content/browser/indexed_db/indexed_db_unittest.cc +++ b/content/browser/indexed_db/indexed_db_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <inttypes.h> + #include <map> #include <memory> #include <optional>
diff --git a/content/browser/interest_group/interest_group_auction.cc b/content/browser/interest_group/interest_group_auction.cc index b5c8ae8e..33ee74d 100644 --- a/content/browser/interest_group/interest_group_auction.cc +++ b/content/browser/interest_group/interest_group_auction.cc
@@ -1902,9 +1902,12 @@ if (reject_reason != auction_worklet::mojom::RejectReason::kNotAvailable && reject_reason != - auction_worklet::mojom::RejectReason::kWrongGenerateBidCurrency) { - // Only possible reject reason from generateBid(), besides the default - // "not available", is "wrong generate bid currency". + auction_worklet::mojom::RejectReason::kWrongGenerateBidCurrency && + reject_reason != + auction_worklet::mojom::RejectReason::kMultiBidLimitExceeded) { + // Only possible reject reasons from generateBid(), besides the default + // "not available", are "wrong generate bid currency" and "multi-bid + // limit exceeded", mojo_bids.clear(); state->reject_reason = auction_worklet::mojom::RejectReason::kNotAvailable; @@ -3167,6 +3170,9 @@ case auction_worklet::mojom::RejectReason::kWrongScoreAdCurrency: reject_reason_str = "wrong-score-ad-currency"; break; + case auction_worklet::mojom::RejectReason::kMultiBidLimitExceeded: + reject_reason_str = "multi-bid-limit-exceeded"; + break; } return reject_reason_str; }
diff --git a/content/browser/manifest/manifest_browsertest.cc b/content/browser/manifest/manifest_browsertest.cc index accfedd..b67a702 100644 --- a/content/browser/manifest/manifest_browsertest.cc +++ b/content/browser/manifest/manifest_browsertest.cc
@@ -50,15 +50,6 @@ using ::testing::Contains; using ::testing::HasSubstr; -bool IsDefaultManifest(const blink::mojom::Manifest& manifest, - const GURL& document_url) { - blink::mojom::ManifestPtr expected_manifest = blink::mojom::Manifest::New(); - expected_manifest->start_url = document_url; - expected_manifest->id = document_url.GetWithoutRef(); - expected_manifest->scope = document_url.GetWithoutFilename(); - return manifest == *expected_manifest; -} - } // namespace class ManifestBrowserTest; @@ -222,7 +213,8 @@ ASSERT_TRUE(NavigateToURL(shell(), test_url)); GetManifestAndWait(); - EXPECT_TRUE(blink::IsEmptyManifest(manifest())); + EXPECT_FALSE(blink::IsEmptyManifest(manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(manifest(), test_url)); EXPECT_TRUE(manifest_url().is_empty()); EXPECT_EQ(0, GetConsoleErrorCount()); EXPECT_TRUE(reported_manifest_urls().empty()); @@ -315,7 +307,8 @@ { GetManifestAndWait(); - EXPECT_TRUE(blink::IsEmptyManifest(manifest())); + EXPECT_FALSE(blink::IsEmptyManifest(manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(manifest(), test_url)); EXPECT_TRUE(manifest_url().is_empty()); EXPECT_TRUE(reported_manifest_urls().empty()); } @@ -327,7 +320,7 @@ GetManifestAndWait(); EXPECT_FALSE(blink::IsEmptyManifest(manifest())); - EXPECT_FALSE(IsDefaultManifest(manifest(), test_url)); + EXPECT_FALSE(blink::IsDefaultManifest(manifest(), test_url)); EXPECT_FALSE(manifest_url().is_empty()); expected_manifest_urls.push_back(manifest_url()); EXPECT_EQ(expected_manifest_urls, reported_manifest_urls()); @@ -350,7 +343,7 @@ GetManifestAndWait(); // There is always a default manifest. EXPECT_FALSE(blink::IsEmptyManifest(manifest())); - EXPECT_TRUE(IsDefaultManifest(manifest(), test_url)); + EXPECT_TRUE(blink::IsDefaultManifest(manifest(), test_url)); EXPECT_TRUE(manifest_url().is_empty()); expected_manifest_urls.push_back(manifest_url()); EXPECT_EQ(expected_manifest_urls, reported_manifest_urls()); @@ -398,7 +391,8 @@ ASSERT_TRUE(ExecJs(shell(), "setManifestTo('" + manifest_link + "')")); GetManifestAndWait(); - EXPECT_TRUE(blink::IsEmptyManifest(manifest())); + EXPECT_FALSE(blink::IsEmptyManifest(manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(manifest(), test_url)); EXPECT_FALSE(manifest_url().is_empty()); EXPECT_THAT(console_errors(), Contains(HasSubstr("CORS"))); EXPECT_EQ(1, GetConsoleErrorCount()); @@ -470,7 +464,8 @@ ASSERT_TRUE(ExecJs(shell(), JsReplace("setManifestTo($1)", manifest_link))); GetManifestAndWait(); - EXPECT_TRUE(blink::IsEmptyManifest(manifest())); + EXPECT_FALSE(blink::IsEmptyManifest(manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(manifest(), test_url)); EXPECT_FALSE(manifest_url().is_empty()); EXPECT_THAT(console_errors(), Contains(HasSubstr("Mixed Content"))); ASSERT_EQ(1u, reported_manifest_urls().size()); @@ -525,7 +520,8 @@ ASSERT_TRUE(NavigateToURL(shell(), test_url)); GetManifestAndWait(); - EXPECT_TRUE(blink::IsEmptyManifest(manifest())); + EXPECT_TRUE(blink::IsDefaultManifest(manifest(), test_url)); + EXPECT_FALSE(blink::IsEmptyManifest(manifest())); EXPECT_EQ(0, GetConsoleErrorCount()); EXPECT_TRUE(manifest_url().is_empty()); EXPECT_EQ(expected_manifest_urls, reported_manifest_urls());
diff --git a/content/browser/media/web_app_system_media_controls_browsertest.cc b/content/browser/media/web_app_system_media_controls_browsertest.cc index b935c52..60d7226 100644 --- a/content/browser/media/web_app_system_media_controls_browsertest.cc +++ b/content/browser/media/web_app_system_media_controls_browsertest.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 "content/browser/media/web_app_system_media_controls.h" + #include <optional> #include "base/run_loop.h" @@ -13,7 +15,6 @@ #include "content/browser/browser_main_loop.h" #include "content/browser/media/media_keys_listener_manager_impl.h" #include "content/browser/media/session/media_session_impl.h" -#include "content/browser/media/web_app_system_media_controls.h" #include "content/browser/media/web_app_system_media_controls_manager.h" #include "content/public/common/content_features.h" #include "content/public/test/browser_test.h"
diff --git a/content/browser/preloading/prefetch/prefetch_streaming_url_loader_common_types.h b/content/browser/preloading/prefetch/prefetch_streaming_url_loader_common_types.h index 70edd64a..c6074003 100644 --- a/content/browser/preloading/prefetch/prefetch_streaming_url_loader_common_types.h +++ b/content/browser/preloading/prefetch/prefetch_streaming_url_loader_common_types.h
@@ -6,6 +6,7 @@ #define CONTENT_BROWSER_PRELOADING_PREFETCH_PREFETCH_STREAMING_URL_LOADER_COMMON_TYPES_H_ #include <optional> + #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/network/public/mojom/url_loader.mojom-forward.h"
diff --git a/content/browser/private_aggregation/private_aggregation_internals_browsertest.cc b/content/browser/private_aggregation/private_aggregation_internals_browsertest.cc index d3f461a9..e7e6d89 100644 --- a/content/browser/private_aggregation/private_aggregation_internals_browsertest.cc +++ b/content/browser/private_aggregation/private_aggregation_internals_browsertest.cc
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/private_aggregation/private_aggregation_internals_ui.h" - #include <memory> #include <optional> #include <string> @@ -18,6 +16,7 @@ #include "content/browser/aggregation_service/aggregation_service_observer.h" #include "content/browser/aggregation_service/aggregation_service_storage.h" #include "content/browser/aggregation_service/aggregation_service_test_utils.h" +#include "content/browser/private_aggregation/private_aggregation_internals_ui.h" #include "content/browser/private_aggregation/private_aggregation_test_utils.h" #include "content/browser/storage_partition_impl.h" #include "content/public/browser/browser_context.h"
diff --git a/content/browser/private_aggregation/private_aggregation_internals_handler_impl.cc b/content/browser/private_aggregation/private_aggregation_internals_handler_impl.cc index 6c7351d..d7ce7ca 100644 --- a/content/browser/private_aggregation/private_aggregation_internals_handler_impl.cc +++ b/content/browser/private_aggregation/private_aggregation_internals_handler_impl.cc
@@ -21,8 +21,8 @@ #include "base/values.h" #include "content/browser/aggregation_service/aggregatable_report.h" #include "content/browser/aggregation_service/aggregation_service.h" -#include "content/browser/private_aggregation/private_aggregation_internals.mojom.h" #include "content/browser/aggregation_service/aggregation_service_storage.h" +#include "content/browser/private_aggregation/private_aggregation_internals.mojom.h" #include "content/browser/private_aggregation/private_aggregation_manager.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h"
diff --git a/content/browser/private_aggregation/private_aggregation_internals_handler_impl.h b/content/browser/private_aggregation/private_aggregation_internals_handler_impl.h index 3b11eda..7b79995 100644 --- a/content/browser/private_aggregation/private_aggregation_internals_handler_impl.h +++ b/content/browser/private_aggregation/private_aggregation_internals_handler_impl.h
@@ -10,8 +10,8 @@ #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "content/browser/aggregation_service/aggregation_service.h" -#include "content/browser/private_aggregation/private_aggregation_internals.mojom.h" #include "content/browser/aggregation_service/aggregation_service_observer.h" +#include "content/browser/private_aggregation/private_aggregation_internals.mojom.h" #include "content/common/content_export.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h"
diff --git a/content/browser/renderer_host/debug_urls.cc b/content/browser/renderer_host/debug_urls.cc index 1cc17ef..f3fa87b 100644 --- a/content/browser/renderer_host/debug_urls.cc +++ b/content/browser/renderer_host/debug_urls.cc
@@ -7,6 +7,7 @@ #include <vector> #include "base/command_line.h" +#include "base/compiler_specific.h" #include "base/debug/asan_invalid_access.h" #include "base/debug/profiler.h" #include "base/functional/bind.h" @@ -103,13 +104,18 @@ return true; } -void HangCurrentThread() { +NOINLINE void HangCurrentThread() { ScopedAllowWaitForDebugURL allow_wait; base::WaitableEvent(base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED) .Wait(); } +NOINLINE void CrashBrowserProcessIntentionally() { + // Induce an intentional crash in the browser process. + CHECK(false); +} + } // namespace bool HandleDebugURL(const GURL& url, @@ -129,8 +135,7 @@ return HandleAsanDebugURL(url); if (url == blink::kChromeUIBrowserCrashURL) { - // Induce an intentional crash in the browser process. - CHECK(false); + CrashBrowserProcessIntentionally(); return true; }
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h index 0b8c62b..c7531293 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -7,6 +7,7 @@ #include <stddef.h> #include <stdint.h> + #include <cstdint> #include <deque> #include <list>
diff --git a/content/browser/resources/attribution_reporting/attribution_internals.html b/content/browser/resources/attribution_reporting/attribution_internals.html index a321b9b..738abc0 100644 --- a/content/browser/resources/attribution_reporting/attribution_internals.html +++ b/content/browser/resources/attribution_reporting/attribution_internals.html
@@ -18,53 +18,53 @@ <button id="clear-data">Clear all attribution data</button> </header> <cr-tab-box hidden> - <div slot="tab" id=tab-api-state>API State</div> - <div slot="tab" id=tab-active-sources>Active Sources</div> - <div slot="tab" id=tab-source-registrations>Source Registrations</div> - <div slot="tab" id=tab-trigger-registrations>Trigger Registrations</div> - <div slot="tab" id=tab-event-level-reports>Event-Level Reports</div> - <div slot="tab" id=tab-aggregatable-reports>Aggregatable Reports</div> - <div slot="tab" id=tab-debug-reports>Debug Reports</div> - <div slot="tab" id=tab-os-registrations>OS Registrations</div> - <div slot="panel"> + <div slot="tab" role=tab id=tab-api-state aria-controls=api-state-panel>API State</div> + <div slot="tab" role=tab id=tab-active-sources aria-controls=active-source-panel>Active Sources</div> + <div slot="tab" role=tab id=tab-source-registrations aria-controls=source-registration-panel>Source Registrations</div> + <div slot="tab" role=tab id=tab-trigger-registrations aria-controls=trigger-registration-panel>Trigger Registrations</div> + <div slot="tab" role=tab id=tab-event-level-reports aria-controls=event-level-report-panel>Event-Level Reports</div> + <div slot="tab" role=tab id=tab-aggregatable-reports aria-controls=aggregatable-report-panel>Aggregatable Reports</div> + <div slot="tab" role=tab id=tab-debug-reports aria-controls=debug-report-panel>Debug Reports</div> + <div slot="tab" role=tab id=tab-os-registrations aria-controls=os-registration-panel>OS Registrations</div> + <div slot="panel" role=tabpanel aria-labelledby=tab-api-state id=api-state-panel> In this browser: - <ul aria-labelledby=tab-api-state> + <ul> <li>Attribution Reporting is <b id="feature-status">disabled</b>. <li><code>Attribution-Reporting-Support</code> is <b id="attribution-support">web</b>. <li>Report delays are <b id="report-delays">enabled</b>. <li>Noise is <b id="noise">enabled</b>. </ul> </div> - <div slot="panel"> - <attribution-internals-table id="sourceTable" aria-labelledby=tab-active-sources> + <div slot="panel" role=tabpanel aria-labelledby=tab-active-sources id=active-source-panel> + <attribution-internals-table id="sourceTable"> </attribution-internals-table> </div> - <div slot="panel"> - <attribution-internals-table id="sourceRegistrationTable" aria-labelledby=tab-source-registrations> + <div slot="panel" role=tabpanel aria-labelledby=tab-source-registrations id=source-registration-panel> + <attribution-internals-table id="sourceRegistrationTable"> </attribution-internals-table> </div> - <div slot="panel"> - <attribution-internals-table id="triggerTable" aria-labelledby=tab-trigger-registrations> + <div slot="panel" role=tabpanel aria-labelledby=tab-trigger-registrations id=trigger-registration-panel> + <attribution-internals-table id="triggerTable"> </attribution-internals-table> </div> - <div slot="panel" id="event-level-report-panel"> + <div slot="panel" role=tabpanel aria-labelledby=tab-event-level-reports id="event-level-report-panel"> <div class="controls"> <button disabled>Send Selected Pending Event-Level Reports</button> </div> - <attribution-internals-table aria-labelledby=tab-event-level-reports></attribution-internals-table> + <attribution-internals-table></attribution-internals-table> </div> - <div slot="panel" id="aggregatable-report-panel"> + <div slot="panel" role=tabpanel aria-labelledby=tab-aggregatable-reports id="aggregatable-report-panel"> <div class="controls"> <button disabled>Send Selected Pending Aggregatable Reports</button> </div> - <attribution-internals-table aria-labelledby=tab-aggregatable-reports></attribution-internals-table> + <attribution-internals-table></attribution-internals-table> </div> - <div slot="panel"> - <attribution-internals-table id="debugReportTable" aria-labelledby=tab-debug-reports> + <div slot="panel" role=tabpanel aria-labelledby=tab-debug-reports id=debug-report-panel> + <attribution-internals-table id="debugReportTable"> </attribution-internals-table> </div> - <div slot="panel"> - <attribution-internals-table id="osRegistrationTable" aria-labelledby=tab-os-registrations> + <div slot="panel" role=tabpanel aria-labelledby=tab-os-registrations id=os-registration-panel> + <attribution-internals-table id="osRegistrationTable"> </attribution-internals-table> </div> </cr-tab-box>
diff --git a/content/browser/shared_storage/shared_storage_browsertest.cc b/content/browser/shared_storage/shared_storage_browsertest.cc index cf29b050..e0c8ad8f 100644 --- a/content/browser/shared_storage/shared_storage_browsertest.cc +++ b/content/browser/shared_storage/shared_storage_browsertest.cc
@@ -1514,7 +1514,9 @@ histogram_tester_.ExpectUniqueSample( kDestroyedStatusHistogram, blink::SharedStorageWorkletDestroyedStatus::kDidNotEnterKeepAlive, 1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); + histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunWebVisible, 1); histogram_tester_.ExpectTotalCount(kTimingUsefulResourceHistogram, 1);
diff --git a/content/browser/utility_sandbox_delegate.h b/content/browser/utility_sandbox_delegate.h index 0e07a97..fc3f310 100644 --- a/content/browser/utility_sandbox_delegate.h +++ b/content/browser/utility_sandbox_delegate.h
@@ -6,6 +6,7 @@ #define CONTENT_BROWSER_UTILITY_SANDBOX_DELEGATE_H_ #include <optional> + #include "base/command_line.h" #include "base/environment.h" #include "base/files/file_path.h"
diff --git a/content/browser/webid/fedcm_metrics.cc b/content/browser/webid/fedcm_metrics.cc index 2eb11a3..b1292c81 100644 --- a/content/browser/webid/fedcm_metrics.cc +++ b/content/browser/webid/fedcm_metrics.cc
@@ -67,6 +67,20 @@ duration); } +// static +void FedCmMetrics::RecordNumRequestsPerDocument(ukm::SourceId page_source_id, + const int num_requests) { + auto RecordUkm = [&](auto& ukm_builder) { + ukm_builder.SetNumRequestsPerDocument(num_requests); + ukm_builder.Record(ukm::UkmRecorder::Get()); + }; + ukm::builders::Blink_FedCm fedcm_builder(page_source_id); + RecordUkm(fedcm_builder); + + base::UmaHistogramCounts100("Blink.FedCm.NumRequestsPerDocument", + num_requests); +} + void FedCmMetrics::RecordContinueOnDialogTime(base::TimeDelta duration) { if (is_disabled_) return; @@ -416,22 +430,6 @@ base::UmaHistogramBoolean("Blink.FedCm.AccountsRequestSent", true); } -void FedCmMetrics::RecordNumRequestsPerDocument(const int num_requests) { - if (is_disabled_) { - return; - } - auto RecordUkm = [&](auto& ukm_builder) { - ukm_builder.SetNumRequestsPerDocument(num_requests); - ukm_builder.SetFedCmSessionID(session_id_); - ukm_builder.Record(ukm::UkmRecorder::Get()); - }; - ukm::builders::Blink_FedCm fedcm_builder(page_source_id_); - RecordUkm(fedcm_builder); - - base::UmaHistogramCounts100("Blink.FedCm.NumRequestsPerDocument", - num_requests); -} - void FedCmMetrics::RecordDisconnectMetrics( FedCmDisconnectStatus status, std::optional<base::TimeDelta> duration,
diff --git a/content/browser/webid/fedcm_metrics.h b/content/browser/webid/fedcm_metrics.h index 59e8767..e17aca91 100644 --- a/content/browser/webid/fedcm_metrics.h +++ b/content/browser/webid/fedcm_metrics.h
@@ -191,6 +191,12 @@ ~FedCmMetrics() = default; + // Records the number of times navigator.credentials.get() is called in a + // document. Requests made when FedCM is disabled, when there is a pending + // FedCM request or for the purpose of multi-IDP are not counted. + static void RecordNumRequestsPerDocument(ukm::SourceId page_source_id, + const int num_requests); + // Records the time from when a call to the API was made to when the accounts // dialog is shown. void RecordShowAccountsDialogTime(base::TimeDelta duration); @@ -290,11 +296,6 @@ // Records a sample when an accounts request is sent. void RecordAccountsRequestSent(); - // Records the number of times navigator.credentials.get() is called in a - // document. Requests made when FedCM is disabled, when there is a pending - // FedCM request or for the purpose of MDocs or multi-IDP are not counted. - void RecordNumRequestsPerDocument(const int num_requests); - // Records metrics for a disconnect call. `duration` is nullopt if the // disconnect fetch request was not sent, in which case we do not log the // metric.
diff --git a/content/browser/webid/federated_auth_request_impl.cc b/content/browser/webid/federated_auth_request_impl.cc index b0d2b3a..673dd9a 100644 --- a/content/browser/webid/federated_auth_request_impl.cc +++ b/content/browser/webid/federated_auth_request_impl.cc
@@ -556,8 +556,9 @@ // Since FederatedAuthRequestImpl is a subclass of // DocumentService<blink::mojom::FederatedAuthRequest>, it only lives as long // as the current document. - if (num_requests_ > 0 && fedcm_metrics_) { - fedcm_metrics_->RecordNumRequestsPerDocument(num_requests_); + if (num_requests_ > 0) { + FedCmMetrics::RecordNumRequestsPerDocument( + render_frame_host().GetPageUkmSourceId(), num_requests_); } } @@ -724,22 +725,9 @@ return; } - if (!fedcm_metrics_) { - // Ensure the lifecycle state as GetPageUkmSourceId doesn't support the - // prerendering page. As FederatedAithRequest runs behind the - // BrowserInterfaceBinders, the service doesn't receive any request while - // prerendering, and the CHECK should always meet the condition. - CHECK(!render_frame_host().IsInLifecycleState( - RenderFrameHost::LifecycleState::kPrerendering)); - - // TODO(crbug.com/1307709): Handle FedCmMetrics for multiple IDPs. - fedcm_metrics_ = - CreateFedCmMetrics(idp_get_params_ptrs[0] - ->providers[0] - ->config->config_url, - render_frame_host().GetPageUkmSourceId(), - /*is_disabled=*/idp_get_params_ptrs.size() > 1); - } + MaybeCreateFedCmMetrics( + idp_get_params_ptrs[0]->providers[0]->config->config_url, + /*is_disabled=*/idp_get_params_ptrs.size() > 1); had_transient_user_activation_ = render_frame_host().HasTransientUserActivation(); @@ -790,6 +778,10 @@ // This was reset to false during CleanUp when replacing a widget flow // from the same frame so we need to change it back to true. had_transient_user_activation_ = true; + // This was also possibly reset during cleanup. + MaybeCreateFedCmMetrics( + idp_get_params_ptrs[0]->providers[0]->config->config_url, + /*is_disabled=*/idp_get_params_ptrs.size() > 1); } bool intercept = false; @@ -984,17 +976,8 @@ return; } - if (!fedcm_metrics_) { - // Ensure the lifecycle state as GetPageUkmSourceId doesn't support the - // prerendering page. As FederatedAithRequest runs behind the - // BrowserInterfaceBinders, the service doesn't receive any request while - // prerendering, and the CHECK should always meet the condition. - CHECK(!render_frame_host().IsInLifecycleState( - RenderFrameHost::LifecycleState::kPrerendering)); - fedcm_metrics_ = CreateFedCmMetrics( - provider->config_url, render_frame_host().GetPageUkmSourceId(), - /*is_disabled=*/false); - } + MaybeCreateFedCmMetrics(provider->config_url, + /*is_disabled=*/false); auto network_manager = IdpNetworkRequestManager::Create( static_cast<RenderFrameHostImpl*>(&render_frame_host())); @@ -2212,12 +2195,11 @@ // takes a long time due to latency etc. In case that the fetching process is // fast, we still want to show the "Verify" sheet for at least // `kTokenRequestDelay` seconds for better UX. - // Note that for auto reauthn in the button flow, we can complete without - // delay since we skip the UI for streamlined sign-in experience. + // Note that for button flow we can complete without delay because the UI + // difference between the verifying UI and its predecessors are minor. token_response_time_ = base::TimeTicks::Now(); base::TimeDelta fetch_time = token_response_time_ - select_account_time_; - if (should_complete_request_immediately_ || - identity_selection_type_ == kAutoButton || + if (should_complete_request_immediately_ || rp_mode_ == RpMode::kButton || fetch_time >= kTokenRequestDelay) { std::move(complete_request_callback).Run(); return; @@ -2405,9 +2387,9 @@ devtools_instrumentation::DidCloseFedCmDialog(render_frame_host()); } - CleanUp(); if (!should_delay_callback || should_complete_request_immediately_) { + CleanUp(); GetPageData(&render_frame_host())->SetPendingWebIdentityRequest(nullptr); errors_logged_to_console_ = false; @@ -2455,6 +2437,7 @@ // Given that |request_dialog_controller_| has reference to this web content // instance we destroy that first. provider_fetcher_.reset(); + fedcm_metrics_.reset(); account_id_ = std::string(); start_time_ = base::TimeTicks(); ready_to_display_accounts_dialog_time_ = base::TimeTicks(); @@ -2885,17 +2868,8 @@ std::move(callback).Run(DisconnectStatus::kError); return; } - if (!fedcm_metrics_) { - // Ensure the lifecycle state as GetPageUkmSourceId doesn't support the - // prerendering page. As FederatedAuthRequest runs behind the - // BrowserInterfaceBinders, the service doesn't receive any request while - // prerendering, and the CHECK should always meet the condition. - CHECK(!render_frame_host().IsInLifecycleState( - RenderFrameHost::LifecycleState::kPrerendering)); - fedcm_metrics_ = CreateFedCmMetrics( - options->config->config_url, render_frame_host().GetPageUkmSourceId(), - /*is_disabled=*/false); - } + MaybeCreateFedCmMetrics(options->config->config_url, + /*is_disabled=*/false); if (disconnect_request_) { // Since we do not send any fetches in this case, consider the request to be // instant, e.g. duration is 0. @@ -2938,17 +2912,8 @@ return; } - if (!fedcm_metrics_) { - // Ensure the lifecycle state as GetPageUkmSourceId doesn't support the - // prerendering page. As FederatedAuthRequest runs behind the - // BrowserInterfaceBinders, the service doesn't receive any request while - // prerendering, and the CHECK should always meet the condition. - CHECK(!render_frame_host().IsInLifecycleState( - RenderFrameHost::LifecycleState::kPrerendering)); - fedcm_metrics_ = CreateFedCmMetrics( - idp->config->config_url, render_frame_host().GetPageUkmSourceId(), - /*is_disabled=*/false); - } + MaybeCreateFedCmMetrics(idp->config->config_url, + /*is_disabled=*/false); fedcm_metrics_->RecordTokenResponseTypeMetrics(token_response_type); @@ -2964,4 +2929,22 @@ } } +void FederatedAuthRequestImpl::MaybeCreateFedCmMetrics( + const GURL& provider_config_url, + bool is_disabled) { + if (!fedcm_metrics_) { + // Ensure the lifecycle state as GetPageUkmSourceId doesn't support the + // prerendering page. As FederatedAithRequest runs behind the + // BrowserInterfaceBinders, the service doesn't receive any request while + // prerendering, and the CHECK should always meet the condition. + CHECK(!render_frame_host().IsInLifecycleState( + RenderFrameHost::LifecycleState::kPrerendering)); + + // TODO(crbug.com/1307709): Handle FedCmMetrics for multiple IDPs. + fedcm_metrics_ = CreateFedCmMetrics( + provider_config_url, render_frame_host().GetPageUkmSourceId(), + is_disabled); + } +} + } // namespace content
diff --git a/content/browser/webid/federated_auth_request_impl.h b/content/browser/webid/federated_auth_request_impl.h index 58acfc77..bafd42a 100644 --- a/content/browser/webid/federated_auth_request_impl.h +++ b/content/browser/webid/federated_auth_request_impl.h
@@ -391,6 +391,9 @@ std::optional<IdpNetworkRequestManager::FedCmErrorUrlType> error_url_type); + void MaybeCreateFedCmMetrics(const GURL& provider_config_url, + bool is_disabled); + RpMode GetRpMode() const { return rp_mode_; } std::unique_ptr<IdpNetworkRequestManager> network_manager_;
diff --git a/content/browser/webid/federated_auth_request_impl_unittest.cc b/content/browser/webid/federated_auth_request_impl_unittest.cc index cee8da3..aded392 100644 --- a/content/browser/webid/federated_auth_request_impl_unittest.cc +++ b/content/browser/webid/federated_auth_request_impl_unittest.cc
@@ -1098,13 +1098,15 @@ base::RunLoop().RunUntilIdle(); } - void WaitForCurrentAuthRequest() { + void WaitForCurrentAuthRequest(bool should_fast_forward = true) { request_remote_.set_disconnect_handler(auth_helper_.quit_closure()); // Fast forward clock so that the pending // FederatedAuthRequestImpl::OnRejectRequest() task, if any, gets a // chance to run. - task_environment()->FastForwardBy(base::Minutes(10)); + if (should_fast_forward) { + task_environment()->FastForwardBy(base::Minutes(10)); + } auth_helper_.WaitForCallback(); request_remote_.set_disconnect_handler(base::OnceClosure()); @@ -1373,34 +1375,29 @@ CheckAllFedCmSessionIDs(); } - void CheckAllFedCmSessionIDs() { - std::optional<int> session_id; + void CheckAllFedCmSessionIDs(size_t expected_num_session_ids = 1u) { + std::set<int> session_ids; auto CheckUKMSessionID = [&](const auto& ukm_entries) { ASSERT_FALSE(ukm_entries.empty()); for (const ukm::mojom::UkmEntry* const entry : ukm_entries) { - const auto* const metric = - ukm_recorder()->GetEntryMetric(entry, "FedCmSessionID"); - ASSERT_TRUE(metric) - << "All UKM events should have the SessionID metric"; - if (!session_id.has_value()) { - session_id = *metric; - } else { - EXPECT_EQ(*metric, *session_id) - << "All UKM events should have the same SessionID"; + const auto* metric = + ukm_recorder()->GetEntryMetric(entry, "NumRequestsPerDocument"); + if (metric) { + continue; } + metric = ukm_recorder()->GetEntryMetric(entry, "FedCmSessionID"); + ASSERT_TRUE(metric) + << "All UKM events except for NumRequestsPerDocument should have " + "the SessionID metric"; + session_ids.insert(*metric); } + EXPECT_EQ(session_ids.size(), expected_num_session_ids); }; CheckUKMSessionID(ukm_recorder()->GetEntriesByName(FedCmEntry::kEntryName)); CheckUKMSessionID( ukm_recorder()->GetEntriesByName(FedCmIdpEntry::kEntryName)); } - void ComputeLoginStateAndReorderAccounts(const std::string& config_url, - AccountList& accounts) { - federated_auth_request_impl_->ComputeLoginStateAndReorderAccounts( - url::Origin::Create(GURL(config_url)), accounts); - } - std::vector<blink::mojom::IdentityProviderRequestOptionsPtr> MaybeAddRegisteredProviders( std::vector<blink::mojom::IdentityProviderRequestOptionsPtr>& providers) { @@ -1481,7 +1478,7 @@ federated_auth_request_impl_->OnIdpSigninStatusReceived( OriginFromString(kProviderUrlFull), true); - WaitForCurrentAuthRequest(); + WaitForCurrentAuthRequest(/*should_fast_forward=*/false); CheckAuthExpectations(kConfigurationValid, kExpectationSuccess); } @@ -3507,18 +3504,15 @@ // Test that the accounts are reordered so that accounts with a LoginState equal // to kSignIn are listed before accounts with a LoginState equal to kSignUp. TEST_F(FederatedAuthRequestImplTest, ReorderMultipleAccounts) { - // Run an auth test to initialize variables. - RunAuthTest(kDefaultRequestParameters, kExpectationSuccess, - kConfigurationValid); - - AccountList multiple_accounts = kMultipleAccounts; - ComputeLoginStateAndReorderAccounts(kProviderUrlFull, multiple_accounts); + MockConfiguration configuration = kConfigurationValid; + configuration.idp_info[kProviderUrlFull].accounts = kMultipleAccounts; + RunAuthTest(kDefaultRequestParameters, kExpectationSuccess, configuration); // Check the account order using the account ids. - ASSERT_EQ(multiple_accounts.size(), 3u); - EXPECT_EQ(multiple_accounts[0].id, kAccountIdPeter); - EXPECT_EQ(multiple_accounts[1].id, kAccountIdNicolas); - EXPECT_EQ(multiple_accounts[2].id, kAccountIdZach); + ASSERT_EQ(displayed_accounts().size(), 3u); + EXPECT_EQ(displayed_accounts()[0].id, kAccountIdPeter); + EXPECT_EQ(displayed_accounts()[1].id, kAccountIdNicolas); + EXPECT_EQ(displayed_accounts()[2].id, kAccountIdZach); } // Test that first API call with a given IDP is not affected by the @@ -5698,7 +5692,7 @@ // Check for RP-keyed UKM presence. ExpectUKMPresenceInternal("NumRequestsPerDocument", FedCmEntry::kEntryName); - CheckAllFedCmSessionIDs(); + CheckAllFedCmSessionIDs(2u); } // Test that an error dialog is shown when the token response is invalid.
diff --git a/content/child/child_thread_impl.h b/content/child/child_thread_impl.h index 1b0f82d2..adb665c 100644 --- a/content/child/child_thread_impl.h +++ b/content/child/child_thread_impl.h
@@ -177,13 +177,6 @@ #endif private: - // TODO(crbug.com/1111231): This class is a friend so that it can call our - // private mojo implementation methods, acting as a pass-through. This is only - // necessary during the associated interface migration, after which, - // AgentSchedulingGroup will not act as a pass-through to the private methods - // here. At that point we'll remove this friend class. - friend class AgentSchedulingGroup; - class IOThreadState; #if BUILDFLAG(CONTENT_ENABLE_LEGACY_IPC)
diff --git a/content/common/service_worker/race_network_request_url_loader_client.h b/content/common/service_worker/race_network_request_url_loader_client.h index ec6ead1..4b829e9 100644 --- a/content/common/service_worker/race_network_request_url_loader_client.h +++ b/content/common/service_worker/race_network_request_url_loader_client.h
@@ -6,6 +6,7 @@ #define CONTENT_COMMON_SERVICE_WORKER_RACE_NETWORK_REQUEST_URL_LOADER_CLIENT_H_ #include <optional> + #include "base/containers/span.h" #include "base/time/time.h" #include "content/common/content_export.h"
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 09fcc0f..0b55977c 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -17,11 +17,6 @@ // All features in alphabetical order. -// Enables FLEDGE and Attribution Reporting API integration. -BASE_FEATURE(kAttributionFencedFrameReportingBeacon, - "AttributionFencedFrameReportingBeacon", - base::FEATURE_ENABLED_BY_DEFAULT); - // Launches the audio service on the browser startup. BASE_FEATURE(kAudioServiceLaunchOnStartup, "AudioServiceLaunchOnStartup",
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 20284f5..ec544c1 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -25,7 +25,6 @@ // All features in alphabetical order. The features should be documented // alongside the definition of their values in the .cc file. -CONTENT_EXPORT BASE_DECLARE_FEATURE(kAttributionFencedFrameReportingBeacon); CONTENT_EXPORT BASE_DECLARE_FEATURE(kAudioServiceLaunchOnStartup); CONTENT_EXPORT BASE_DECLARE_FEATURE(kAudioServiceOutOfProcess); CONTENT_EXPORT BASE_DECLARE_FEATURE(kAudioServiceSandbox);
diff --git a/content/public/common/content_switch_dependent_feature_overrides.cc b/content/public/common/content_switch_dependent_feature_overrides.cc index da77a32..af5ae1f 100644 --- a/content/public/common/content_switch_dependent_feature_overrides.cc +++ b/content/public/common/content_switch_dependent_feature_overrides.cc
@@ -174,9 +174,6 @@ {switches::kEnablePrivacySandboxAdsApis, std::cref(blink::features::kPrivateAggregationApi), base::FeatureList::OVERRIDE_ENABLE_FEATURE}, - {switches::kEnablePrivacySandboxAdsApis, - std::cref(features::kAttributionFencedFrameReportingBeacon), - base::FeatureList::OVERRIDE_ENABLE_FEATURE}, }; std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
diff --git a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc index debaf62..00188a8d 100644 --- a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc +++ b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc
@@ -6,6 +6,7 @@ #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> + #include <memory> #include <optional>
diff --git a/content/services/auction_worklet/bidder_worklet_unittest.cc b/content/services/auction_worklet/bidder_worklet_unittest.cc index 5dce348..0502ca2 100644 --- a/content/services/auction_worklet/bidder_worklet_unittest.cc +++ b/content/services/auction_worklet/bidder_worklet_unittest.cc
@@ -765,6 +765,18 @@ return bidder_worklet; } + bool OnlyBidsForKAnonUpdate() { + if (kanon_mode_ != auction_worklet::mojom::KAnonymityBidMode::kEnforce) { + return false; + } + for (const auto& bid : bids_) { + if (bid->bid_role != auction_worklet::mojom::BidRole::kUnenforcedKAnon) { + return false; + } + } + return true; + } + void GenerateBidCallback( std::vector<mojom::BidderWorkletBidPtr> bids, std::optional<uint32_t> data_version, @@ -801,8 +813,10 @@ generate_bid_dependency_latencies_ = std::move(generate_bid_dependency_latencies); reject_reason_ = reject_reason; - if (!bids_.empty()) { - // Shouldn't have a reject reason if the bid isn't rejected. + // Shouldn't have a reject reason if we have bids, unless they are all + // non-k-anon bids only there to update k-anon data and not determine the + // actual winner. + if (!bids_.empty() && !OnlyBidsForKAnonUpdate()) { EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); } bid_errors_ = errors; @@ -2628,12 +2642,14 @@ // Empty array means no-bid. RunGenerateBidWithReturnValueExpectingResult( "[]", /*expected_bid=*/mojom::BidderWorkletBidPtr()); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); // Single bid as an array member. RunGenerateBidWithReturnValueExpectingResult( R"([{ad: "ad", bid: 2, render: "https://response.test/"}])", expected_bid->Clone()); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); // Actually multiple bids. RunGenerateBidWithReturnValueExpectingResult( @@ -2646,6 +2662,7 @@ ASSERT_EQ(2u, bids_.size()); EXPECT_EQ(bids_[1]->bid, 3); EXPECT_EQ(bids_[1]->ad, "\"ad2\""); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); // Too many bids. RunGenerateBidWithReturnValueExpectingResult( @@ -2661,6 +2678,7 @@ /*expected_errors=*/ {"https://url.test/ generateBid() more bids provided than permitted by " "auction configuration."}); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kMultiBidLimitExceeded); // The bid limit looks at the length of the sequence provided; some entries // being dropped as non-bids doesn't change that. @@ -2677,6 +2695,7 @@ /*expected_errors=*/ {"https://url.test/ generateBid() more bids provided than permitted by " "auction configuration."}); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kMultiBidLimitExceeded); // Catches errors in individual entries. RunGenerateBidWithReturnValueExpectingResult( @@ -2686,6 +2705,7 @@ /*expected_errors=*/ {"https://url.test/ generateBid() bids sequence entry: 'render' is " "required when making a bid."}); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); // Some more complicated error messages. RunGenerateBidWithReturnValueExpectingResult( @@ -2695,6 +2715,7 @@ /*expected_errors=*/ {"https://url.test/ generateBid() bids sequence entry: 'render': " "Required field 'url' is undefined."}); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); RunGenerateBidWithReturnValueExpectingResult( R"([{ad: "ad", bid: 10, render: "https://example.org/", @@ -2705,6 +2726,7 @@ /*expected_errors=*/ {"https://url.test/ generateBid() bids sequence entry: adComponents " "entry: Required field 'url' is undefined."}); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); RunGenerateBidWithReturnValueExpectingResult( R"([{ad: "ad", bid: 2, @@ -2715,6 +2737,7 @@ /*expected_errors=*/ {"https://url.test/ generateBid() bids sequence entry: 'render' is " "required when making a bid."}); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); RunGenerateBidWithReturnValueExpectingResult( R"([{ad: "ad", bid: 2, @@ -2725,12 +2748,14 @@ /*expected_errors=*/ {"https://url.test/ generateBid() bids sequence entry: Value passed as " "dictionary is neither object, null, nor undefined."}); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); // A non-bid is still ignored. RunGenerateBidWithReturnValueExpectingResult( R"([{ad: "ad", render: "https://response.test/"}])", /*expected_bid=*/mojom::BidderWorkletBidPtr()); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); // A non-bid among real bids in an array is also ignored. RunGenerateBidWithReturnValueExpectingResult( @@ -2740,6 +2765,7 @@ render: "https://response.test/"}, ])", expected_bid->Clone()); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); // Make sure the IDL checks happen before semantic checks. This has 4 bids, // but 4th one isn't an object, so the IDL error about that is what we should @@ -2758,6 +2784,7 @@ /*expected_errors=*/ {"https://url.test/ generateBid() bids sequence entry: Value passed as " "dictionary is neither object, null, nor undefined."}); + EXPECT_EQ(reject_reason_, mojom::RejectReason::kNotAvailable); } // For now multi-bid support, even in degenerate form of passing a single bid in
diff --git a/content/services/auction_worklet/public/mojom/reject_reason.mojom b/content/services/auction_worklet/public/mojom/reject_reason.mojom index 74ad9025..98d517c 100644 --- a/content/services/auction_worklet/public/mojom/reject_reason.mojom +++ b/content/services/auction_worklet/public/mojom/reject_reason.mojom
@@ -17,4 +17,5 @@ kBelowKAnonThreshold = 8, kWrongGenerateBidCurrency = 9, kWrongScoreAdCurrency = 10, + kMultiBidLimitExceeded = 11, };
diff --git a/content/services/auction_worklet/set_bid_bindings.cc b/content/services/auction_worklet/set_bid_bindings.cc index a7d872a..ab69387 100644 --- a/content/services/auction_worklet/set_bid_bindings.cc +++ b/content/services/auction_worklet/set_bid_bindings.cc
@@ -313,6 +313,7 @@ // Now do semantic checks. Length is first. if (idl_bids.size() > multi_bid_limit_) { + reject_reason_ = mojom::RejectReason::kMultiBidLimitExceeded; return IdlConvert::Status::MakeErrorMessage(too_many_bids_error); }
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index c163f72..2815030 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -69,8 +69,6 @@ "../browser/attribution_reporting/test/mock_attribution_observer.cc", "../browser/attribution_reporting/test/mock_attribution_observer.h", "../browser/attribution_reporting/test/mock_content_browser_client.h", - "../browser/attribution_reporting/test/mock_data_host.cc", - "../browser/attribution_reporting/test/mock_data_host.h", "../browser/attribution_reporting/test/source_observer.cc", "../browser/attribution_reporting/test/source_observer.h", "../browser/back_forward_cache_test_util.cc",
diff --git a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt index 51a51321..b5a7a9c 100644 --- a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt
@@ -439,6 +439,11 @@ # Broadly flaky unsymbolized crashes on Jacuzzi crbug.com/1518007 [ chromeos cros-chrome chromeos-board-jacuzzi ] Pixel_Video* [ RetryOnFailure ] +# Failures on fuchsia +crbug.com/414481724 [ fuchsia fuchsia-board-qemu-x64 ] Pixel_CanvasLowLatencyWebGLDrawImage [ Failure ] +crbug.com/414481724 [ fuchsia fuchsia-board-qemu-x64 ] Pixel_WebGLDisplayP3 [ Failure ] +crbug.com/414481724 [ fuchsia fuchsia-board-qemu-x64 ] Pixel_WebGLFloat [ Failure ] + ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/test/gpu/gpu_tests/test_expectations/screenshot_sync_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/screenshot_sync_expectations.txt index 8a07b24..89269413 100644 --- a/content/test/gpu/gpu_tests/test_expectations/screenshot_sync_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/screenshot_sync_expectations.txt
@@ -104,6 +104,9 @@ crbug.com/324934210 [ mac intel angle-metal passthrough asan graphite-enabled ] ScreenshotSync_GPURasterWithDivs [ RetryOnFailure ] crbug.com/324934210 [ mac intel angle-metal passthrough asan graphite-enabled ] ScreenshotSync_GPURasterWithCanvas [ RetryOnFailure ] +crbug.com/414481724 [ fuchsia fuchsia-board-qemu-x64 ] ScreenshotSync_SWRasterWithCanvas [ Failure ] +crbug.com/414481724 [ fuchsia fuchsia-board-qemu-x64 ] ScreenshotSync_SWRasterWithDivs [ Failure ] + ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/web_test/browser/mojo_echo.cc b/content/web_test/browser/mojo_echo.cc index c32758c..9dd488b 100644 --- a/content/web_test/browser/mojo_echo.cc +++ b/content/web_test/browser/mojo_echo.cc
@@ -181,4 +181,9 @@ mojom::TestUnion::NewStringValue(value))); } +void MojoEcho::EchoBoolArray(const std::vector<bool>& values, + EchoBoolArrayCallback callback) { + std::move(callback).Run(values); +} + } // namespace content
diff --git a/content/web_test/browser/mojo_echo.h b/content/web_test/browser/mojo_echo.h index ec3dc83..06f6d28 100644 --- a/content/web_test/browser/mojo_echo.h +++ b/content/web_test/browser/mojo_echo.h
@@ -90,6 +90,9 @@ void EchoStringAsOptionalNestedUnion( const std::string& value, EchoStringAsOptionalNestedUnionCallback callback) override; + + void EchoBoolArray(const std::vector<bool>& values, + EchoBoolArrayCallback callback) override; }; } // namespace content
diff --git a/content/web_test/common/mojo_echo.mojom b/content/web_test/common/mojo_echo.mojom index 8f073f7a..d3a6cf3 100644 --- a/content/web_test/common/mojo_echo.mojom +++ b/content/web_test/common/mojo_echo.mojom
@@ -106,4 +106,8 @@ EchoBoolAsOptionalNestedUnion(bool value) => (NestedUnion? test_union); // Runs callback with |test_union.union_value.string_value|. EchoStringAsOptionalNestedUnion(string value) => (NestedUnion? test_union); + + // The following methods help test that JS can correctly encode array of + // bools. + EchoBoolArray(array<bool> values) => (array<bool> values); };
diff --git a/crypto/aead.h b/crypto/aead.h index 4deff59..faa89084 100644 --- a/crypto/aead.h +++ b/crypto/aead.h
@@ -8,11 +8,11 @@ #include <stddef.h> #include <stdint.h> +#include <optional> #include <string> #include <string_view> #include <vector> -#include <optional> #include "base/containers/span.h" #include "base/memory/raw_ptr.h" #include "crypto/crypto_export.h"
diff --git a/crypto/encryptor.h b/crypto/encryptor.h index ee77f4b..f8af86e 100644 --- a/crypto/encryptor.h +++ b/crypto/encryptor.h
@@ -9,10 +9,10 @@ #include <stdint.h> #include <memory> +#include <optional> #include <string> #include <string_view> -#include <optional> #include "base/containers/span.h" #include "base/memory/raw_ptr.h" #include "build/build_config.h"
diff --git a/crypto/unexportable_key.h b/crypto/unexportable_key.h index 3a75442..7080058 100644 --- a/crypto/unexportable_key.h +++ b/crypto/unexportable_key.h
@@ -6,8 +6,8 @@ #define CRYPTO_UNEXPORTABLE_KEY_H_ #include <memory> - #include <optional> + #include "crypto/crypto_export.h" #include "crypto/signature_verifier.h"
diff --git a/crypto/unexportable_key_unittest.cc b/crypto/unexportable_key_unittest.cc index 3d6e54f..4092ed161 100644 --- a/crypto/unexportable_key_unittest.cc +++ b/crypto/unexportable_key_unittest.cc
@@ -4,8 +4,8 @@ #include "crypto/unexportable_key.h" -#include <tuple> #include <optional> +#include <tuple> #include "base/logging.h" #include "base/test/scoped_feature_list.h"
diff --git a/dbus/end_to_end_async_unittest.cc b/dbus/end_to_end_async_unittest.cc index ae43c4c..bcca3d2a 100644 --- a/dbus/end_to_end_async_unittest.cc +++ b/dbus/end_to_end_async_unittest.cc
@@ -6,10 +6,10 @@ #include <algorithm> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/memory/raw_ptr.h"
diff --git a/dbus/object_manager_unittest.cc b/dbus/object_manager_unittest.cc index eb38eda..9fe9de1 100644 --- a/dbus/object_manager_unittest.cc +++ b/dbus/object_manager_unittest.cc
@@ -8,10 +8,10 @@ #include <stdint.h> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" #include "base/message_loop/message_pump_type.h"
diff --git a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc index f5a442a..af4a4f0 100644 --- a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc +++ b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
@@ -392,16 +392,6 @@ base::BindOnce(&BluetoothAdapterBlueZ::OnSetDevCoredumpError, weak_ptr_factory_.GetWeakPtr())); #endif // BUILDFLAG(IS_CHROMEOS) - - bluez::BluezDBusManager::Get() - ->GetBluetoothDebugManagerClient() - ->SetLLPrivacy( - base::FeatureList::IsEnabled(bluez::features::kLinkLayerPrivacy), - base::BindOnce(&BluetoothAdapterBlueZ::OnSetLLPrivacySuccess, - weak_ptr_factory_.GetWeakPtr()), - base::BindOnce(&BluetoothAdapterBlueZ::OnSetLLPrivacyError, - weak_ptr_factory_.GetWeakPtr())); - std::move(init_callback_).Run(); }
diff --git a/device/bluetooth/floss/bluetooth_gatt_service_floss.cc b/device/bluetooth/floss/bluetooth_gatt_service_floss.cc index 3f191a86..5922d0e1 100644 --- a/device/bluetooth/floss/bluetooth_gatt_service_floss.cc +++ b/device/bluetooth/floss/bluetooth_gatt_service_floss.cc
@@ -51,6 +51,18 @@ return GattErrorCode::kUnknown; } +// static +GattStatus BluetoothGattServiceFloss::GattServiceErrorToStatus( + device::BluetoothGattService::GattErrorCode error_code) { + for (auto& [target, source] : kGattStatusMap) { + if (error_code == source) { + return target; + } + } + + return GattStatus::kError; +} + void BluetoothGattServiceFloss::AddObserverForHandle( int32_t handle, FlossGattClientObserver* observer) {
diff --git a/device/bluetooth/floss/bluetooth_gatt_service_floss.h b/device/bluetooth/floss/bluetooth_gatt_service_floss.h index 6af6c7a0..1473cfae 100644 --- a/device/bluetooth/floss/bluetooth_gatt_service_floss.h +++ b/device/bluetooth/floss/bluetooth_gatt_service_floss.h
@@ -30,6 +30,10 @@ static device::BluetoothGattService::GattErrorCode GattStatusToServiceError( const GattStatus status); + // Processes a |GattErrorCode| into a status code. + static GattStatus GattServiceErrorToStatus( + device::BluetoothGattService::GattErrorCode error_code); + // Adds an observer for a specific handle. This observer will only get // callbacks invoked for that specific handle. void AddObserverForHandle(int32_t handle, FlossGattClientObserver* observer);
diff --git a/device/vr/openxr/msft/openxr_scene_understanding_manager_msft.h b/device/vr/openxr/msft/openxr_scene_understanding_manager_msft.h index ce13251..088e64b 100644 --- a/device/vr/openxr/msft/openxr_scene_understanding_manager_msft.h +++ b/device/vr/openxr/msft/openxr_scene_understanding_manager_msft.h
@@ -4,18 +4,17 @@ #ifndef DEVICE_VR_OPENXR_MSFT_OPENXR_SCENE_UNDERSTANDING_MANAGER_MSFT_H_ #define DEVICE_VR_OPENXR_MSFT_OPENXR_SCENE_UNDERSTANDING_MANAGER_MSFT_H_ -#include "device/vr/openxr/openxr_scene_understanding_manager.h" - #include <memory> #include <optional> #include <vector> #include "base/memory/raw_ref.h" -#include "device/vr/openxr/openxr_extension_handler_factory.h" -#include "device/vr/openxr/msft/openxr_scene_msft.h" #include "device/vr/openxr/msft/openxr_scene_bounds_msft.h" +#include "device/vr/openxr/msft/openxr_scene_msft.h" #include "device/vr/openxr/msft/openxr_scene_observer_msft.h" #include "device/vr/openxr/msft/openxr_scene_plane_msft.h" +#include "device/vr/openxr/openxr_extension_handler_factory.h" +#include "device/vr/openxr/openxr_scene_understanding_manager.h" #include "device/vr/public/mojom/vr_service.mojom.h" #include "third_party/openxr/src/include/openxr/openxr.h"
diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index 3b7e1c7..5fc1ef5 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn
@@ -86,8 +86,6 @@ # TODO(https://crbug.com/883570): Anything under api/ should be moved out of # this target. - "api/activity_log/web_request_constants.cc", - "api/activity_log/web_request_constants.h", "api/api_resource.cc", "api/api_resource.h", "api/api_resource_manager.h",
diff --git a/extensions/browser/api/alarms/alarms_api_unittest.cc b/extensions/browser/api/alarms/alarms_api_unittest.cc index 8b68d0f..0a97a05e 100644 --- a/extensions/browser/api/alarms/alarms_api_unittest.cc +++ b/extensions/browser/api/alarms/alarms_api_unittest.cc
@@ -12,6 +12,7 @@ #include <optional> #include <string> #include <utility> + #include "base/functional/bind.h" #include "base/json/json_reader.h" #include "base/memory/raw_ptr.h"
diff --git a/extensions/browser/api/bluetooth/bluetooth_private_api.h b/extensions/browser/api/bluetooth/bluetooth_private_api.h index c03dd25..a98d37d6 100644 --- a/extensions/browser/api/bluetooth/bluetooth_private_api.h +++ b/extensions/browser/api/bluetooth/bluetooth_private_api.h
@@ -6,6 +6,7 @@ #define EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ #include <optional> + #include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "device/bluetooth/bluetooth_device.h"
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h index 8cb79d5..b254ec0d 100644 --- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h +++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> #include <unordered_set> + #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "build/build_config.h"
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h index c869e456..cf21bba 100644 --- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h +++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h
@@ -12,6 +12,7 @@ #include <set> #include <string> #include <vector> + #include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h"
diff --git a/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h b/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h index 81624a2..c81c993 100644 --- a/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h +++ b/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h
@@ -11,6 +11,7 @@ #include <string> #include <unordered_set> #include <vector> + #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/values.h"
diff --git a/extensions/browser/api/declarative/declarative_api.h b/extensions/browser/api/declarative/declarative_api.h index cf4f553..76fc9ea 100644 --- a/extensions/browser/api/declarative/declarative_api.h +++ b/extensions/browser/api/declarative/declarative_api.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/memory/scoped_refptr.h" #include "extensions/browser/api/declarative/rules_registry.h" #include "extensions/browser/extension_function.h"
diff --git a/extensions/browser/api/declarative/declarative_rule_unittest.cc b/extensions/browser/api/declarative/declarative_rule_unittest.cc index af9ddc96..c2c5da7 100644 --- a/extensions/browser/api/declarative/declarative_rule_unittest.cc +++ b/extensions/browser/api/declarative/declarative_rule_unittest.cc
@@ -5,6 +5,7 @@ #include "extensions/browser/api/declarative/declarative_rule.h" #include <optional> + #include "base/containers/contains.h" #include "base/functional/bind.h" #include "base/memory/raw_ptr.h"
diff --git a/extensions/browser/api/declarative_net_request/action_tracker.h b/extensions/browser/api/declarative_net_request/action_tracker.h index 390acf1e..01b14d0 100644 --- a/extensions/browser/api/declarative_net_request/action_tracker.h +++ b/extensions/browser/api/declarative_net_request/action_tracker.h
@@ -9,6 +9,7 @@ #include <map> #include <optional> #include <vector> + #include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "base/timer/timer.h"
diff --git a/extensions/browser/api/declarative_net_request/composite_matcher.h b/extensions/browser/api/declarative_net_request/composite_matcher.h index 37f93ca..ed15adc1 100644 --- a/extensions/browser/api/declarative_net_request/composite_matcher.h +++ b/extensions/browser/api/declarative_net_request/composite_matcher.h
@@ -10,6 +10,7 @@ #include <optional> #include <set> #include <vector> + #include "extensions/browser/api/declarative_net_request/constants.h" #include "extensions/browser/api/declarative_net_request/request_action.h" #include "extensions/browser/api/declarative_net_request/ruleset_matcher.h"
diff --git a/extensions/browser/api/declarative_net_request/declarative_net_request_prefs_helper.h b/extensions/browser/api/declarative_net_request/declarative_net_request_prefs_helper.h index de18d0d..8ef7b352 100644 --- a/extensions/browser/api/declarative_net_request/declarative_net_request_prefs_helper.h +++ b/extensions/browser/api/declarative_net_request/declarative_net_request_prefs_helper.h
@@ -7,6 +7,7 @@ #include <optional> #include <vector> + #include "base/containers/flat_set.h" #include "base/memory/raw_ref.h" #include "base/values.h"
diff --git a/extensions/browser/api/declarative_net_request/file_sequence_helper.h b/extensions/browser/api/declarative_net_request/file_sequence_helper.h index 5a927c7..d9489bc 100644 --- a/extensions/browser/api/declarative_net_request/file_sequence_helper.h +++ b/extensions/browser/api/declarative_net_request/file_sequence_helper.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> #include <vector> + #include "base/functional/callback_forward.h" #include "base/memory/weak_ptr.h" #include "base/version.h"
diff --git a/extensions/browser/api/declarative_net_request/filter_list_converter/converter_unittest.cc b/extensions/browser/api/declarative_net_request/filter_list_converter/converter_unittest.cc index aa9df90a..ad483b5 100644 --- a/extensions/browser/api/declarative_net_request/filter_list_converter/converter_unittest.cc +++ b/extensions/browser/api/declarative_net_request/filter_list_converter/converter_unittest.cc
@@ -5,6 +5,7 @@ #include "extensions/browser/api/declarative_net_request/filter_list_converter/converter.h" #include <optional> + #include "base/check_op.h" #include "base/files/file_path.h" #include "base/files/file_util.h"
diff --git a/extensions/browser/api/declarative_net_request/indexed_rule.h b/extensions/browser/api/declarative_net_request/indexed_rule.h index b82d1452..268dac8 100644 --- a/extensions/browser/api/declarative_net_request/indexed_rule.h +++ b/extensions/browser/api/declarative_net_request/indexed_rule.h
@@ -6,8 +6,10 @@ #define EXTENSIONS_BROWSER_API_DECLARATIVE_NET_REQUEST_INDEXED_RULE_H_ #include <stdint.h> + #include <optional> #include <string> + #include "base/containers/flat_set.h" #include "components/url_pattern_index/flat/url_pattern_index_generated.h" #include "extensions/common/api/declarative_net_request.h"
diff --git a/extensions/browser/api/declarative_net_request/indexed_rule_fuzzer.cc b/extensions/browser/api/declarative_net_request/indexed_rule_fuzzer.cc index 10c1694..2e911aa 100644 --- a/extensions/browser/api/declarative_net_request/indexed_rule_fuzzer.cc +++ b/extensions/browser/api/declarative_net_request/indexed_rule_fuzzer.cc
@@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "extensions/browser/api/declarative_net_request/indexed_rule.h" + +#include <fuzzer/FuzzedDataProvider.h> #include <stdint.h> #include <optional> #include <string> #include <utility> -#include <fuzzer/FuzzedDataProvider.h> - #include "base/check.h" #include "base/json/json_reader.h" #include "base/types/expected.h" #include "base/values.h" -#include "extensions/browser/api/declarative_net_request/indexed_rule.h" #include "extensions/common/api/declarative_net_request.h" #include "extensions/common/api/declarative_net_request/constants.h" #include "url/gurl.h"
diff --git a/extensions/browser/api/declarative_net_request/install_index_helper.h b/extensions/browser/api/declarative_net_request/install_index_helper.h index 22d2b9d..3725210 100644 --- a/extensions/browser/api/declarative_net_request/install_index_helper.h +++ b/extensions/browser/api/declarative_net_request/install_index_helper.h
@@ -10,6 +10,7 @@ #include <string> #include <utility> #include <vector> + #include "base/functional/callback_forward.h" #include "base/memory/ref_counted.h" #include "extensions/browser/api/declarative_net_request/file_backed_ruleset_source.h"
diff --git a/extensions/browser/api/declarative_net_request/request_action.h b/extensions/browser/api/declarative_net_request/request_action.h index 8ec1a3a..c125480 100644 --- a/extensions/browser/api/declarative_net_request/request_action.h +++ b/extensions/browser/api/declarative_net_request/request_action.h
@@ -8,6 +8,7 @@ #include <cstdint> #include <optional> #include <vector> + #include "extensions/common/api/declarative_net_request.h" #include "extensions/common/api/declarative_net_request/constants.h" #include "extensions/common/extension_id.h"
diff --git a/extensions/browser/api/declarative_net_request/rules_monitor_service.h b/extensions/browser/api/declarative_net_request/rules_monitor_service.h index 94fda99..26b113c6 100644 --- a/extensions/browser/api/declarative_net_request/rules_monitor_service.h +++ b/extensions/browser/api/declarative_net_request/rules_monitor_service.h
@@ -11,6 +11,7 @@ #include <set> #include <string> #include <vector> + #include "base/containers/flat_map.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h"
diff --git a/extensions/browser/api/declarative_net_request/ruleset_install_pref.h b/extensions/browser/api/declarative_net_request/ruleset_install_pref.h index 1ca911b..d1799cc 100644 --- a/extensions/browser/api/declarative_net_request/ruleset_install_pref.h +++ b/extensions/browser/api/declarative_net_request/ruleset_install_pref.h
@@ -7,6 +7,7 @@ #include <optional> #include <vector> + #include "extensions/common/api/declarative_net_request/constants.h" namespace extensions::declarative_net_request {
diff --git a/extensions/browser/api/declarative_net_request/ruleset_manager.cc b/extensions/browser/api/declarative_net_request/ruleset_manager.cc index d991f07..52f9ccb 100644 --- a/extensions/browser/api/declarative_net_request/ruleset_manager.cc +++ b/extensions/browser/api/declarative_net_request/ruleset_manager.cc
@@ -7,6 +7,7 @@ #include <iterator> #include <optional> #include <tuple> + #include "base/check_op.h" #include "base/containers/contains.h" #include "base/containers/cxx20_erase.h"
diff --git a/extensions/browser/api/declarative_net_request/ruleset_manager.h b/extensions/browser/api/declarative_net_request/ruleset_manager.h index b4d9a71..d1db277 100644 --- a/extensions/browser/api/declarative_net_request/ruleset_manager.h +++ b/extensions/browser/api/declarative_net_request/ruleset_manager.h
@@ -6,11 +6,13 @@ #define EXTENSIONS_BROWSER_API_DECLARATIVE_NET_REQUEST_RULESET_MANAGER_H_ #include <stddef.h> + #include <memory> #include <optional> #include <set> #include <utility> #include <vector> + #include "base/containers/flat_set.h" #include "base/memory/raw_ptr.h" #include "base/sequence_checker.h"
diff --git a/extensions/browser/api/declarative_net_request/ruleset_matcher_base.h b/extensions/browser/api/declarative_net_request/ruleset_matcher_base.h index 7676ecb..0a1e6748 100644 --- a/extensions/browser/api/declarative_net_request/ruleset_matcher_base.h +++ b/extensions/browser/api/declarative_net_request/ruleset_matcher_base.h
@@ -8,6 +8,7 @@ #include <map> #include <optional> #include <vector> + #include "content/public/browser/global_routing_id.h" #include "extensions/browser/api/declarative_net_request/constants.h" #include "extensions/browser/api/declarative_net_request/flat/extension_ruleset_generated.h"
diff --git a/extensions/browser/api/declarative_net_request/test_utils.h b/extensions/browser/api/declarative_net_request/test_utils.h index 251a4f94..d327722 100644 --- a/extensions/browser/api/declarative_net_request/test_utils.h +++ b/extensions/browser/api/declarative_net_request/test_utils.h
@@ -10,6 +10,7 @@ #include <ostream> #include <string> #include <vector> + #include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/scoped_observation.h"
diff --git a/extensions/browser/api/declarative_net_request/utils.h b/extensions/browser/api/declarative_net_request/utils.h index f051cd3..d98de5f0 100644 --- a/extensions/browser/api/declarative_net_request/utils.h +++ b/extensions/browser/api/declarative_net_request/utils.h
@@ -7,9 +7,11 @@ #include <stddef.h> #include <stdint.h> + #include <optional> #include <string> #include <vector> + #include "base/auto_reset.h" #include "base/containers/span.h" #include "extensions/browser/api/declarative_net_request/file_backed_ruleset_source.h"
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_action.h b/extensions/browser/api/declarative_webrequest/webrequest_action.h index 0044637..ec311bd 100644 --- a/extensions/browser/api/declarative_webrequest/webrequest_action.h +++ b/extensions/browser/api/declarative_webrequest/webrequest_action.h
@@ -10,6 +10,7 @@ #include <optional> #include <string> #include <vector> + #include "base/compiler_specific.h" #include "base/memory/raw_ptr.h" #include "base/memory/raw_ref.h"
diff --git a/extensions/browser/api/device_permissions_manager.cc b/extensions/browser/api/device_permissions_manager.cc index cc82e349..49da65fc 100644 --- a/extensions/browser/api/device_permissions_manager.cc +++ b/extensions/browser/api/device_permissions_manager.cc
@@ -8,6 +8,7 @@ #include <optional> #include <utility> + #include "base/containers/contains.h" #include "base/functional/bind.h" #include "base/memory/scoped_refptr.h"
diff --git a/extensions/browser/api/diagnostics/diagnostics_api.h b/extensions/browser/api/diagnostics/diagnostics_api.h index 64947126..011ea56 100644 --- a/extensions/browser/api/diagnostics/diagnostics_api.h +++ b/extensions/browser/api/diagnostics/diagnostics_api.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "extensions/browser/extension_function.h" #include "extensions/common/api/diagnostics.h"
diff --git a/extensions/browser/api/execute_code_function.cc b/extensions/browser/api/execute_code_function.cc index 0c980803..85af470 100644 --- a/extensions/browser/api/execute_code_function.cc +++ b/extensions/browser/api/execute_code_function.cc
@@ -9,6 +9,7 @@ #include <optional> #include <utility> + #include "base/functional/bind.h" #include "base/ranges/algorithm.h" #include "extensions/browser/extension_api_frame_id_map.h"
diff --git a/extensions/browser/api/execute_code_function.h b/extensions/browser/api/execute_code_function.h index e653a8d..601b563 100644 --- a/extensions/browser/api/execute_code_function.h +++ b/extensions/browser/api/execute_code_function.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> #include <vector> + #include "extensions/browser/extension_function.h" #include "extensions/browser/script_executor.h" #include "extensions/common/api/extension_types.h"
diff --git a/extensions/browser/api/file_handlers/non_native_file_system_delegate.h b/extensions/browser/api/file_handlers/non_native_file_system_delegate.h index aaed0ec1..9f68c18 100644 --- a/extensions/browser/api/file_handlers/non_native_file_system_delegate.h +++ b/extensions/browser/api/file_handlers/non_native_file_system_delegate.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/files/file_path.h" #include "base/functional/callback.h"
diff --git a/extensions/browser/api/hid/hid_device_manager.cc b/extensions/browser/api/hid/hid_device_manager.cc index 7d1ae14..ed16ce0 100644 --- a/extensions/browser/api/hid/hid_device_manager.cc +++ b/extensions/browser/api/hid/hid_device_manager.cc
@@ -13,6 +13,7 @@ #include <string> #include <utility> #include <vector> + #include "base/containers/contains.h" #include "base/functional/bind.h" #include "base/lazy_instance.h"
diff --git a/extensions/browser/api/media_perception_private/media_perception_api_manager.h b/extensions/browser/api/media_perception_private/media_perception_api_manager.h index b47d54a1..16c0e9e 100644 --- a/extensions/browser/api/media_perception_private/media_perception_api_manager.h +++ b/extensions/browser/api/media_perception_private/media_perception_api_manager.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h"
diff --git a/extensions/browser/api/messaging/extension_message_port.h b/extensions/browser/api/messaging/extension_message_port.h index 2f60c54..538c3ef 100644 --- a/extensions/browser/api/messaging/extension_message_port.h +++ b/extensions/browser/api/messaging/extension_message_port.h
@@ -11,6 +11,7 @@ #include <set> #include <string> #include <vector> + #include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h"
diff --git a/extensions/browser/api/messaging/message_port.h b/extensions/browser/api/messaging/message_port.h index bfb2e74..ba51254f5 100644 --- a/extensions/browser/api/messaging/message_port.h +++ b/extensions/browser/api/messaging/message_port.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/memory/weak_ptr.h" #include "base/values.h" #include "extensions/browser/activity.h"
diff --git a/extensions/browser/api/messaging/message_service_bindings.cc b/extensions/browser/api/messaging/message_service_bindings.cc index 830bb6f..64e392d 100644 --- a/extensions/browser/api/messaging/message_service_bindings.cc +++ b/extensions/browser/api/messaging/message_service_bindings.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <optional> + #include "base/feature_list.h" #include "base/metrics/histogram_functions.h" #include "base/types/optional_util.h"
diff --git a/extensions/browser/api/messaging/messaging_delegate.h b/extensions/browser/api/messaging/messaging_delegate.h index c14b261d..c58545b 100644 --- a/extensions/browser/api/messaging/messaging_delegate.h +++ b/extensions/browser/api/messaging/messaging_delegate.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "base/functional/callback_forward.h" #include "base/memory/weak_ptr.h" #include "extensions/browser/api/messaging/message_port.h"
diff --git a/extensions/browser/api/messaging/native_messaging_channel.h b/extensions/browser/api/messaging/native_messaging_channel.h index d5ffe397..4359ca7 100644 --- a/extensions/browser/api/messaging/native_messaging_channel.h +++ b/extensions/browser/api/messaging/native_messaging_channel.h
@@ -6,6 +6,7 @@ #define EXTENSIONS_BROWSER_API_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_ #include <optional> + #include "base/functional/callback.h" #include "base/values.h"
diff --git a/extensions/browser/api/networking_private/networking_private_api.h b/extensions/browser/api/networking_private/networking_private_api.h index 4f6382a..f06a7ec 100644 --- a/extensions/browser/api/networking_private/networking_private_api.h +++ b/extensions/browser/api/networking_private/networking_private_api.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "base/values.h" #include "extensions/browser/api/networking_private/networking_private_delegate.h" #include "extensions/browser/extension_function.h"
diff --git a/extensions/browser/api/networking_private/networking_private_chromeos.h b/extensions/browser/api/networking_private/networking_private_chromeos.h index c53506e..46e9e6a4 100644 --- a/extensions/browser/api/networking_private/networking_private_chromeos.h +++ b/extensions/browser/api/networking_private/networking_private_chromeos.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/values.h"
diff --git a/extensions/browser/api/networking_private/networking_private_delegate.h b/extensions/browser/api/networking_private/networking_private_delegate.h index 135def8..cdf1b43 100644 --- a/extensions/browser/api/networking_private/networking_private_delegate.h +++ b/extensions/browser/api/networking_private/networking_private_delegate.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> #include <vector> + #include "base/functional/callback.h" #include "base/values.h" #include "components/keyed_service/core/keyed_service.h"
diff --git a/extensions/browser/api/printer_provider/printer_provider_api.cc b/extensions/browser/api/printer_provider/printer_provider_api.cc index 42158890..9743fdd 100644 --- a/extensions/browser/api/printer_provider/printer_provider_api.cc +++ b/extensions/browser/api/printer_provider/printer_provider_api.cc
@@ -13,6 +13,7 @@ #include <string> #include <utility> #include <vector> + #include "base/functional/bind.h" #include "base/i18n/rtl.h" #include "base/location.h"
diff --git a/extensions/browser/api/runtime/runtime_api.h b/extensions/browser/api/runtime/runtime_api.h index 16a4f206..86570357 100644 --- a/extensions/browser/api/runtime/runtime_api.h +++ b/extensions/browser/api/runtime/runtime_api.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "base/time/time.h"
diff --git a/extensions/browser/api/socket/udp_socket.h b/extensions/browser/api/socket/udp_socket.h index e6e609a..9ff950ba 100644 --- a/extensions/browser/api/socket/udp_socket.h +++ b/extensions/browser/api/socket/udp_socket.h
@@ -10,6 +10,7 @@ #include <optional> #include <string> #include <vector> + #include "base/containers/span.h" #include "extensions/browser/api/socket/socket.h" #include "mojo/public/cpp/bindings/pending_remote.h"
diff --git a/extensions/browser/api/system_display/display_info_provider.h b/extensions/browser/api/system_display/display_info_provider.h index 9cc776e9..6df5f53 100644 --- a/extensions/browser/api/system_display/display_info_provider.h +++ b/extensions/browser/api/system_display/display_info_provider.h
@@ -10,6 +10,7 @@ #include <optional> #include <string> #include <vector> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "extensions/common/api/system_display.h"
diff --git a/extensions/browser/api/system_display/system_display_apitest.cc b/extensions/browser/api/system_display/system_display_apitest.cc index 6fcdd59..5ac2825 100644 --- a/extensions/browser/api/system_display/system_display_apitest.cc +++ b/extensions/browser/api/system_display/system_display_apitest.cc
@@ -5,6 +5,7 @@ #include <memory> #include <optional> #include <string> + #include "base/functional/bind.h" #include "base/test/gtest_tags.h" #include "build/build_config.h"
diff --git a/extensions/browser/api/usb/usb_device_manager.cc b/extensions/browser/api/usb/usb_device_manager.cc index 2d4e710..30d0e52e 100644 --- a/extensions/browser/api/usb/usb_device_manager.cc +++ b/extensions/browser/api/usb/usb_device_manager.cc
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <utility> + #include "base/containers/contains.h" #include "base/lazy_instance.h" #include "base/observer_list.h"
diff --git a/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_delegate.h b/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_delegate.h index 78fe73f3..251b992 100644 --- a/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_delegate.h +++ b/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_delegate.h
@@ -9,6 +9,7 @@ #include <set> #include <string> #include <vector> + #include "base/functional/callback.h" #include "base/values.h" #include "extensions/common/api/virtual_keyboard.h"
diff --git a/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.cc b/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.cc index 502f84e..8e50090 100644 --- a/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.cc +++ b/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.cc
@@ -7,6 +7,7 @@ #include <optional> #include <string> #include <utility> + #include "base/functional/bind.h" #include "base/lazy_instance.h" #include "base/notreached.h"
diff --git a/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h b/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h index b118ee7..e7a6ef5b 100644 --- a/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h +++ b/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <vector> + #include "base/memory/raw_ptr.h" #include "base/values.h" #include "build/chromeos_buildflags.h"
diff --git a/extensions/browser/api/web_request/extension_web_request_event_router.cc b/extensions/browser/api/web_request/extension_web_request_event_router.cc index 0963fac..90ba672 100644 --- a/extensions/browser/api/web_request/extension_web_request_event_router.cc +++ b/extensions/browser/api/web_request/extension_web_request_event_router.cc
@@ -17,7 +17,6 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" -#include "extensions/browser/api/activity_log/web_request_constants.h" #include "extensions/browser/api/declarative/rules_registry_service.h" #include "extensions/browser/api/declarative_net_request/request_action.h" #include "extensions/browser/api/declarative_net_request/rules_monitor_service.h" @@ -36,6 +35,7 @@ #include "extensions/browser/event_router.h" #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/process_map.h" +#include "extensions/common/api/web_request/web_request_activity_log_constants.h" #include "extensions/common/error_utils.h" #include "extensions/common/extension_features.h" #include "extensions/common/extension_id.h" @@ -50,7 +50,7 @@ namespace { -namespace activity_log = activity_log_web_request_constants; +namespace activity_log = web_request_activity_log_constants; namespace declarative_keys = declarative_webrequest_constants; namespace helpers = extension_web_request_api_helpers; namespace keys = extension_web_request_api_constants;
diff --git a/extensions/browser/api/web_request/web_request_api.h b/extensions/browser/api/web_request/web_request_api.h index 80021318..ff85a72 100644 --- a/extensions/browser/api/web_request/web_request_api.h +++ b/extensions/browser/api/web_request/web_request_api.h
@@ -14,6 +14,7 @@ #include <string> #include <utility> #include <vector> + #include "base/containers/unique_ptr_adapters.h" #include "base/feature_list.h" #include "base/functional/callback.h"
diff --git a/extensions/browser/api/web_request/web_request_api_helpers.h b/extensions/browser/api/web_request/web_request_api_helpers.h index c1dd606..c879633 100644 --- a/extensions/browser/api/web_request/web_request_api_helpers.h +++ b/extensions/browser/api/web_request/web_request_api_helpers.h
@@ -13,6 +13,7 @@ #include <string> #include <utility> #include <vector> + #include "base/memory/scoped_refptr.h" #include "base/time/time.h" #include "base/values.h"
diff --git a/extensions/browser/api/web_request/web_request_event_details.h b/extensions/browser/api/web_request/web_request_event_details.h index b7be67f3..ba3e8c4 100644 --- a/extensions/browser/api/web_request/web_request_event_details.h +++ b/extensions/browser/api/web_request/web_request_event_details.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "base/values.h" #include "extensions/browser/extension_api_frame_id_map.h" #include "extensions/common/extension_id.h"
diff --git a/extensions/browser/api/web_request/web_request_info.h b/extensions/browser/api/web_request/web_request_info.h index 505cbda8..bcca020 100644 --- a/extensions/browser/api/web_request/web_request_info.h +++ b/extensions/browser/api/web_request/web_request_info.h
@@ -11,6 +11,7 @@ #include <optional> #include <string> #include <vector> + #include "base/memory/scoped_refptr.h" #include "base/values.h" #include "content/public/browser/global_routing_id.h"
diff --git a/extensions/browser/api/web_request/web_request_permissions.h b/extensions/browser/api/web_request/web_request_permissions.h index 9cca464..78972fc4 100644 --- a/extensions/browser/api/web_request/web_request_permissions.h +++ b/extensions/browser/api/web_request/web_request_permissions.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "extensions/browser/api/web_request/web_request_resource_type.h" #include "extensions/common/extension_id.h" #include "extensions/common/permissions/permissions_data.h"
diff --git a/extensions/browser/api/web_request/web_request_proxying_websocket.h b/extensions/browser/api/web_request/web_request_proxying_websocket.h index 17482c9..301757a4 100644 --- a/extensions/browser/api/web_request/web_request_proxying_websocket.h +++ b/extensions/browser/api/web_request/web_request_proxying_websocket.h
@@ -8,6 +8,7 @@ #include <optional> #include <string> #include <vector> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h"
diff --git a/extensions/browser/api/web_request/web_request_proxying_webtransport.cc b/extensions/browser/api/web_request/web_request_proxying_webtransport.cc index 3577d64..8c3d7873 100644 --- a/extensions/browser/api/web_request/web_request_proxying_webtransport.cc +++ b/extensions/browser/api/web_request/web_request_proxying_webtransport.cc
@@ -5,6 +5,7 @@ #include "extensions/browser/api/web_request/web_request_proxying_webtransport.h" #include <optional> + #include "base/memory/raw_ptr.h" #include "base/memory/raw_ref.h" #include "content/public/browser/render_process_host.h"
diff --git a/extensions/browser/api_test_utils.cc b/extensions/browser/api_test_utils.cc index 9b14bd8..2282690 100644 --- a/extensions/browser/api_test_utils.cc +++ b/extensions/browser/api_test_utils.cc
@@ -7,6 +7,7 @@ #include <memory> #include <optional> #include <utility> + #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/json/json_reader.h"
diff --git a/extensions/browser/api_test_utils.h b/extensions/browser/api_test_utils.h index bfdc0da..9bde1f29 100644 --- a/extensions/browser/api_test_utils.h +++ b/extensions/browser/api_test_utils.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "base/memory/scoped_refptr.h" #include "base/run_loop.h" #include "base/values.h"
diff --git a/extensions/browser/api_unittest.h b/extensions/browser/api_unittest.h index eda46a7d..871e9f4 100644 --- a/extensions/browser/api_unittest.h +++ b/extensions/browser/api_unittest.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "base/memory/scoped_refptr.h" #include "components/sync_preferences/testing_pref_service_syncable.h" #include "extensions/browser/api_test_utils.h"
diff --git a/extensions/browser/background_script_executor.h b/extensions/browser/background_script_executor.h index 80fd6fe..dd7ac40c 100644 --- a/extensions/browser/background_script_executor.h +++ b/extensions/browser/background_script_executor.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "base/memory/raw_ptr.h" #include "base/values.h" #include "content/public/test/browser_test_utils.h"
diff --git a/extensions/browser/blocklist_extension_prefs.cc b/extensions/browser/blocklist_extension_prefs.cc index 66d3179..e844659 100644 --- a/extensions/browser/blocklist_extension_prefs.cc +++ b/extensions/browser/blocklist_extension_prefs.cc
@@ -5,6 +5,7 @@ #include "extensions/browser/blocklist_extension_prefs.h" #include <optional> + #include "extensions/browser/blocklist_state.h" #include "extensions/browser/extension_prefs.h" #include "extensions/common/extension_id.h" @@ -85,7 +86,7 @@ BitMapBlocklistState GetExtensionBlocklistState( const ExtensionId& extension_id, - ExtensionPrefs* extension_prefs) { + const ExtensionPrefs* extension_prefs) { BitMapBlocklistState sb_state = GetSafeBrowsingExtensionBlocklistState(extension_id, extension_prefs); BitMapBlocklistState extension_telemetry_service_state = @@ -134,7 +135,7 @@ bool HasOmahaBlocklistState(const ExtensionId& extension_id, BitMapBlocklistState state, - ExtensionPrefs* extension_prefs) { + const ExtensionPrefs* extension_prefs) { int current_states = extension_prefs->GetBitMapPrefBits( extension_id, kPrefOmahaBlocklistState, static_cast<int>(kDefaultBitMapBlocklistState)); @@ -218,7 +219,7 @@ BitMapBlocklistState GetSafeBrowsingExtensionBlocklistState( const ExtensionId& extension_id, - ExtensionPrefs* extension_prefs) { + const ExtensionPrefs* extension_prefs) { int int_value = -1; if (extension_prefs->ReadPrefAsInteger(extension_id, kPrefBlocklistState, &int_value) && @@ -249,7 +250,7 @@ BitMapBlocklistState GetExtensionTelemetryServiceBlocklistState( const ExtensionId& extension_id, - ExtensionPrefs* extension_prefs) { + const ExtensionPrefs* extension_prefs) { int int_value = -1; if (extension_prefs->ReadPrefAsInteger( extension_id, kPrefExtensionTelemetryServiceBlocklistState,
diff --git a/extensions/browser/blocklist_extension_prefs.h b/extensions/browser/blocklist_extension_prefs.h index 8e333f1..8356627e 100644 --- a/extensions/browser/blocklist_extension_prefs.h +++ b/extensions/browser/blocklist_extension_prefs.h
@@ -25,7 +25,7 @@ // BLOCKLISTED_POTENTIALLY_UNWANTED > BLOCKLISTED_SECURITY_VULNERABILITY. BitMapBlocklistState GetExtensionBlocklistState( const ExtensionId& extension_id, - ExtensionPrefs* extension_prefs); + const ExtensionPrefs* extension_prefs); // Returns whether the extension with |extension_id| is blocklisted for malware // by the Safe Browsing blocklist or the Omaha attribute blocklist. @@ -45,7 +45,7 @@ // state pref. bool HasOmahaBlocklistState(const ExtensionId& extension_id, BitMapBlocklistState state, - ExtensionPrefs* extension_prefs); + const ExtensionPrefs* extension_prefs); // Checks whether the `extension_id` is in any Omaha greylist state. bool HasAnyOmahaGreylistState(const ExtensionId& extension_id, ExtensionPrefs* extension_prefs); @@ -87,7 +87,7 @@ // blocklist, please use blocklist_prefs::GetExtensionBlocklistState instead. BitMapBlocklistState GetSafeBrowsingExtensionBlocklistState( const ExtensionId& extension_id, - ExtensionPrefs* extension_prefs); + const ExtensionPrefs* extension_prefs); // Sets the `bitmap_blocklist_state` to the Extension Telemetry service // blocklist state pref. @@ -100,7 +100,7 @@ // `extension_id`. BitMapBlocklistState GetExtensionTelemetryServiceBlocklistState( const ExtensionId& extension_id, - ExtensionPrefs* extension_prefs); + const ExtensionPrefs* extension_prefs); } // namespace blocklist_prefs } // namespace extensions
diff --git a/extensions/browser/computed_hashes.h b/extensions/browser/computed_hashes.h index 25a42bc..6c6a51e 100644 --- a/extensions/browser/computed_hashes.h +++ b/extensions/browser/computed_hashes.h
@@ -12,6 +12,7 @@ #include <optional> #include <string> #include <vector> + #include "base/files/file_path.h" #include "base/functional/callback.h" #include "extensions/browser/content_verifier/content_verifier_utils.h"
diff --git a/extensions/browser/content_verifier/content_verifier_io_data.h b/extensions/browser/content_verifier/content_verifier_io_data.h index 0cacec9..8010163a 100644 --- a/extensions/browser/content_verifier/content_verifier_io_data.h +++ b/extensions/browser/content_verifier/content_verifier_io_data.h
@@ -12,8 +12,8 @@ #include <string> #include "base/version.h" -#include "extensions/browser/content_verifier/content_verifier_utils.h" #include "extensions/browser/content_verifier/content_verifier_delegate.h" +#include "extensions/browser/content_verifier/content_verifier_utils.h" #include "extensions/common/extension_id.h" namespace extensions {
diff --git a/extensions/browser/content_verifier/test_utils.h b/extensions/browser/content_verifier/test_utils.h index da96651..25a60e0c 100644 --- a/extensions/browser/content_verifier/test_utils.h +++ b/extensions/browser/content_verifier/test_utils.h
@@ -12,6 +12,7 @@ #include <string> #include <utility> #include <vector> + #include "base/files/file_path.h" #include "base/run_loop.h" #include "base/task/sequenced_task_runner.h"
diff --git a/extensions/browser/event_listener_map.h b/extensions/browser/event_listener_map.h index 880d86cd..4559dd6a 100644 --- a/extensions/browser/event_listener_map.h +++ b/extensions/browser/event_listener_map.h
@@ -11,6 +11,7 @@ #include <set> #include <string> #include <vector> + #include "base/containers/flat_map.h" #include "base/memory/raw_ptr.h" #include "base/values.h"
diff --git a/extensions/browser/events/lazy_event_dispatch_util.cc b/extensions/browser/events/lazy_event_dispatch_util.cc index 240722d..be03c0f 100644 --- a/extensions/browser/events/lazy_event_dispatch_util.cc +++ b/extensions/browser/events/lazy_event_dispatch_util.cc
@@ -5,6 +5,7 @@ #include "extensions/browser/events/lazy_event_dispatch_util.h" #include <optional> + #include "base/observer_list.h" #include "base/version.h" #include "content/public/browser/browser_context.h"
diff --git a/extensions/browser/events/lazy_event_dispatcher.cc b/extensions/browser/events/lazy_event_dispatcher.cc index 100b360db..838b13d 100644 --- a/extensions/browser/events/lazy_event_dispatcher.cc +++ b/extensions/browser/events/lazy_event_dispatcher.cc
@@ -5,6 +5,7 @@ #include "extensions/browser/events/lazy_event_dispatcher.h" #include <optional> + #include "base/containers/contains.h" #include "base/functional/bind.h" #include "extensions/browser/event_router.h"
diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h index c762a71..3d3d4f7d 100644 --- a/extensions/browser/extension_function.h +++ b/extensions/browser/extension_function.h
@@ -11,6 +11,7 @@ #include <optional> #include <string> #include <vector> + #include "base/callback_list.h" #include "base/functional/callback.h" #include "base/memory/raw_ptr.h"
diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc index d7aa4926..ec55d70 100644 --- a/extensions/browser/extension_function_dispatcher.cc +++ b/extensions/browser/extension_function_dispatcher.cc
@@ -6,6 +6,7 @@ #include <optional> #include <utility> + #include "base/debug/crash_logging.h" #include "base/functional/bind.h" #include "base/json/json_string_value_serializer.h"
diff --git a/extensions/browser/extension_host_test_helper.h b/extensions/browser/extension_host_test_helper.h index 31bf4d2..d0fb8da 100644 --- a/extensions/browser/extension_host_test_helper.h +++ b/extensions/browser/extension_host_test_helper.h
@@ -7,6 +7,7 @@ #include <map> #include <optional> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h"
diff --git a/extensions/browser/extension_registrar_unittest.cc b/extensions/browser/extension_registrar_unittest.cc index 8cc9d89..99c7115 100644 --- a/extensions/browser/extension_registrar_unittest.cc +++ b/extensions/browser/extension_registrar_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> #include <optional> + #include "base/location.h" #include "base/task/sequenced_task_runner.h" #include "build/chromeos_buildflags.h"
diff --git a/extensions/browser/extension_system.h b/extensions/browser/extension_system.h index 30c07f2..f5f4575d 100644 --- a/extensions/browser/extension_system.h +++ b/extensions/browser/extension_system.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/functional/callback.h" #include "base/memory/scoped_refptr.h" #include "build/build_config.h"
diff --git a/extensions/browser/extensions_browser_client.cc b/extensions/browser/extensions_browser_client.cc index d69c978..12c3e464 100644 --- a/extensions/browser/extensions_browser_client.cc +++ b/extensions/browser/extensions_browser_client.cc
@@ -6,6 +6,7 @@ #include <memory> #include <optional> + #include "base/files/file_path.h" #include "base/functional/callback.h" #include "base/logging.h"
diff --git a/extensions/browser/file_reader.h b/extensions/browser/file_reader.h index 35b18a8e..3d424d72b 100644 --- a/extensions/browser/file_reader.h +++ b/extensions/browser/file_reader.h
@@ -8,6 +8,7 @@ #include <optional> #include <string> #include <vector> + #include "base/functional/callback.h" #include "base/memory/ref_counted.h" #include "base/task/single_thread_task_runner.h"
diff --git a/extensions/browser/file_reader_unittest.cc b/extensions/browser/file_reader_unittest.cc index 1535bf2..6f4ba5c 100644 --- a/extensions/browser/file_reader_unittest.cc +++ b/extensions/browser/file_reader_unittest.cc
@@ -6,6 +6,7 @@ #include <limits> #include <optional> + #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/functional/bind.h"
diff --git a/extensions/browser/guest_view/web_view/web_view_content_script_manager.h b/extensions/browser/guest_view/web_view/web_view_content_script_manager.h index 1060499..09427149 100644 --- a/extensions/browser/guest_view/web_view/web_view_content_script_manager.h +++ b/extensions/browser/guest_view/web_view/web_view_content_script_manager.h
@@ -10,6 +10,7 @@ #include <set> #include <string> #include <vector> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h"
diff --git a/extensions/browser/json_file_sanitizer.h b/extensions/browser/json_file_sanitizer.h index fb6cad9..128ba1e 100644 --- a/extensions/browser/json_file_sanitizer.h +++ b/extensions/browser/json_file_sanitizer.h
@@ -10,6 +10,7 @@ #include <set> #include <string> #include <tuple> + #include "base/files/file_path.h" #include "base/memory/weak_ptr.h" #include "base/task/sequenced_task_runner.h"
diff --git a/extensions/browser/load_and_localize_file.h b/extensions/browser/load_and_localize_file.h index b33d196e..e87e034 100644 --- a/extensions/browser/load_and_localize_file.h +++ b/extensions/browser/load_and_localize_file.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> #include <vector> + #include "base/functional/callback.h" namespace extensions {
diff --git a/extensions/browser/mock_display_info_provider.h b/extensions/browser/mock_display_info_provider.h index 729fead..f0fbe4f 100644 --- a/extensions/browser/mock_display_info_provider.h +++ b/extensions/browser/mock_display_info_provider.h
@@ -11,6 +11,7 @@ #include <string> #include <utility> #include <vector> + #include "base/values.h" #include "extensions/browser/api/system_display/display_info_provider.h" #include "extensions/browser/mock_screen.h"
diff --git a/extensions/browser/script_injection_tracker.h b/extensions/browser/script_injection_tracker.h index 5070981..bcde7c5 100644 --- a/extensions/browser/script_injection_tracker.h +++ b/extensions/browser/script_injection_tracker.h
@@ -6,6 +6,7 @@ #define EXTENSIONS_BROWSER_SCRIPT_INJECTION_TRACKER_H_ #include <optional> + #include "base/debug/crash_logging.h" #include "base/types/pass_key.h" #include "extensions/common/extension_id.h"
diff --git a/extensions/browser/service_worker/service_worker_task_queue.h b/extensions/browser/service_worker/service_worker_task_queue.h index c2adb0c..c27f5f8 100644 --- a/extensions/browser/service_worker/service_worker_task_queue.h +++ b/extensions/browser/service_worker/service_worker_task_queue.h
@@ -8,6 +8,7 @@ #include <map> #include <optional> #include <vector> + #include "base/containers/flat_map.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h"
diff --git a/extensions/browser/updater/extension_downloader.h b/extensions/browser/updater/extension_downloader.h index db2286b..2cab660 100644 --- a/extensions/browser/updater/extension_downloader.h +++ b/extensions/browser/updater/extension_downloader.h
@@ -12,6 +12,7 @@ #include <string> #include <utility> #include <vector> + #include "base/compiler_specific.h" #include "base/files/file_path.h" #include "base/memory/raw_ptr.h"
diff --git a/extensions/browser/updater/extension_downloader_delegate.h b/extensions/browser/updater/extension_downloader_delegate.h index f73e020..677fba7 100644 --- a/extensions/browser/updater/extension_downloader_delegate.h +++ b/extensions/browser/updater/extension_downloader_delegate.h
@@ -8,6 +8,7 @@ #include <optional> #include <set> #include <string> + #include "base/functional/callback.h" #include "base/time/time.h" #include "extensions/browser/crx_file_info.h"
diff --git a/extensions/browser/updater/request_queue.h b/extensions/browser/updater/request_queue.h index feedff6c..03d7a562 100644 --- a/extensions/browser/updater/request_queue.h +++ b/extensions/browser/updater/request_queue.h
@@ -10,6 +10,7 @@ #include <memory> #include <optional> #include <utility> + #include "base/containers/circular_deque.h" #include "base/functional/callback.h" #include "base/memory/raw_ptr.h"
diff --git a/extensions/browser/updater/safe_manifest_parser.cc b/extensions/browser/updater/safe_manifest_parser.cc index 2ea8492..59ae271 100644 --- a/extensions/browser/updater/safe_manifest_parser.cc +++ b/extensions/browser/updater/safe_manifest_parser.cc
@@ -7,6 +7,7 @@ #include <memory> #include <optional> #include <utility> + #include "base/functional/bind.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_number_conversions.h"
diff --git a/extensions/browser/updater/safe_manifest_parser.h b/extensions/browser/updater/safe_manifest_parser.h index ce267a8..4713127 100644 --- a/extensions/browser/updater/safe_manifest_parser.h +++ b/extensions/browser/updater/safe_manifest_parser.h
@@ -10,6 +10,7 @@ #include <optional> #include <string> #include <vector> + #include "base/functional/callback_forward.h" #include "extensions/common/extension_id.h" #include "url/gurl.h"
diff --git a/extensions/browser/updater/safe_manifest_parser_unittest.cc b/extensions/browser/updater/safe_manifest_parser_unittest.cc index e458ae9..8852e70e 100644 --- a/extensions/browser/updater/safe_manifest_parser_unittest.cc +++ b/extensions/browser/updater/safe_manifest_parser_unittest.cc
@@ -5,6 +5,7 @@ #include "extensions/browser/updater/safe_manifest_parser.h" #include <optional> + #include "base/functional/bind.h" #include "base/run_loop.h" #include "content/public/test/browser_task_environment.h"
diff --git a/extensions/browser/updater/update_data_provider.cc b/extensions/browser/updater/update_data_provider.cc index a91e489..c74ceb2 100644 --- a/extensions/browser/updater/update_data_provider.cc +++ b/extensions/browser/updater/update_data_provider.cc
@@ -6,6 +6,7 @@ #include <optional> #include <utility> + #include "base/base64.h" #include "base/files/file_path.h" #include "base/files/file_util.h"
diff --git a/extensions/browser/updater/update_data_provider.h b/extensions/browser/updater/update_data_provider.h index 82abce6..66eb015 100644 --- a/extensions/browser/updater/update_data_provider.h +++ b/extensions/browser/updater/update_data_provider.h
@@ -10,6 +10,7 @@ #include <optional> #include <string> #include <vector> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h"
diff --git a/extensions/browser/updater/update_data_provider_unittest.cc b/extensions/browser/updater/update_data_provider_unittest.cc index 98be0e3..f9543f3 100644 --- a/extensions/browser/updater/update_data_provider_unittest.cc +++ b/extensions/browser/updater/update_data_provider_unittest.cc
@@ -10,6 +10,7 @@ #include <set> #include <string> #include <vector> + #include "base/containers/contains.h" #include "base/files/file_path.h" #include "base/files/file_util.h"
diff --git a/extensions/browser/updater/update_service.cc b/extensions/browser/updater/update_service.cc index 49618c8cb..387fbe8 100644 --- a/extensions/browser/updater/update_service.cc +++ b/extensions/browser/updater/update_service.cc
@@ -9,6 +9,7 @@ #include <string> #include <utility> #include <vector> + #include "base/barrier_closure.h" #include "base/feature_list.h" #include "base/files/file_util.h"
diff --git a/extensions/browser/updater/update_service_unittest.cc b/extensions/browser/updater/update_service_unittest.cc index 927c9bb9..e32bacb 100644 --- a/extensions/browser/updater/update_service_unittest.cc +++ b/extensions/browser/updater/update_service_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 "extensions/browser/updater/update_service.h" + #include <stddef.h> #include <memory> @@ -9,6 +11,7 @@ #include <string> #include <utility> #include <vector> + #include "base/containers/contains.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" @@ -37,7 +40,6 @@ #include "extensions/browser/updater/extension_downloader.h" #include "extensions/browser/updater/extension_update_data.h" #include "extensions/browser/updater/uninstall_ping_sender.h" -#include "extensions/browser/updater/update_service.h" #include "extensions/common/extension_builder.h" #include "extensions/common/extension_features.h" #include "extensions/common/extension_id.h"
diff --git a/extensions/browser/user_script_manager.h b/extensions/browser/user_script_manager.h index c4e2908d..83e9b9d 100644 --- a/extensions/browser/user_script_manager.h +++ b/extensions/browser/user_script_manager.h
@@ -9,6 +9,7 @@ #include <memory> #include <optional> #include <set> + #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h"
diff --git a/extensions/browser/zipfile_installer.h b/extensions/browser/zipfile_installer.h index b86bb92a8..4f559307 100644 --- a/extensions/browser/zipfile_installer.h +++ b/extensions/browser/zipfile_installer.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> + #include "base/files/file_path.h" #include "base/functional/callback.h" #include "base/gtest_prod_util.h"
diff --git a/extensions/common/BUILD.gn b/extensions/common/BUILD.gn index 9171757..28ba686 100644 --- a/extensions/common/BUILD.gn +++ b/extensions/common/BUILD.gn
@@ -254,6 +254,8 @@ "api/sockets/sockets_manifest_handler.h", "api/sockets/sockets_manifest_permission.cc", "api/sockets/sockets_manifest_permission.h", + "api/web_request/web_request_activity_log_constants.cc", + "api/web_request/web_request_activity_log_constants.h", "command.cc", "command.h", "common_manifest_handlers.cc",
diff --git a/extensions/common/api/declarative_net_request/test_utils.h b/extensions/common/api/declarative_net_request/test_utils.h index e7f984a..b10f22be 100644 --- a/extensions/common/api/declarative_net_request/test_utils.h +++ b/extensions/common/api/declarative_net_request/test_utils.h
@@ -8,6 +8,7 @@ #include <optional> #include <string> #include <vector> + #include "base/files/file_path.h" #include "base/values.h" #include "extensions/common/api/declarative_net_request/constants.h"
diff --git a/extensions/common/api/messaging/messaging_endpoint.h b/extensions/common/api/messaging/messaging_endpoint.h index 95545b4..62fd71e 100644 --- a/extensions/common/api/messaging/messaging_endpoint.h +++ b/extensions/common/api/messaging/messaging_endpoint.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/debug/crash_logging.h" #include "extensions/common/extension_id.h" #include "extensions/common/mojom/message_port.mojom-shared.h"
diff --git a/extensions/common/api/messaging/port_context.h b/extensions/common/api/messaging/port_context.h index ce8908e9..0e0d1fd 100644 --- a/extensions/common/api/messaging/port_context.h +++ b/extensions/common/api/messaging/port_context.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> + #include "base/debug/crash_logging.h" #include "extensions/common/extension_id.h"
diff --git a/extensions/common/api/scripts_internal/script_serialization.cc b/extensions/common/api/scripts_internal/script_serialization.cc index 923afb9d..172cfd5 100644 --- a/extensions/common/api/scripts_internal/script_serialization.cc +++ b/extensions/common/api/scripts_internal/script_serialization.cc
@@ -5,6 +5,7 @@ #include "extensions/common/api/scripts_internal/script_serialization.h" #include <optional> + #include "base/types/optional_util.h" #include "extensions/common/api/scripts_internal.h" #include "extensions/common/user_script.h"
diff --git a/extensions/browser/api/activity_log/web_request_constants.cc b/extensions/common/api/web_request/web_request_activity_log_constants.cc similarity index 87% rename from extensions/browser/api/activity_log/web_request_constants.cc rename to extensions/common/api/web_request/web_request_activity_log_constants.cc index e92c2ca7..b74d1ce6 100644 --- a/extensions/browser/api/activity_log/web_request_constants.cc +++ b/extensions/common/api/web_request/web_request_activity_log_constants.cc
@@ -5,9 +5,9 @@ // Constants used when describing request modifications via the WebRequest API // in the activity log. -#include "extensions/browser/api/activity_log/web_request_constants.h" +#include "extensions/common/api/web_request/web_request_activity_log_constants.h" -namespace activity_log_web_request_constants { +namespace web_request_activity_log_constants { // Keys used in the dictionary summarizing an EventResponseDelta for the // extension activity log. @@ -30,4 +30,4 @@ const char kCookieModNameKey[] = "mod_name"; const char kCookieModDomainKey[] = "mod_domain"; -} // namespace activity_log_web_request_constants +} // namespace web_request_activity_log_constants
diff --git a/extensions/browser/api/activity_log/web_request_constants.h b/extensions/common/api/web_request/web_request_activity_log_constants.h similarity index 75% rename from extensions/browser/api/activity_log/web_request_constants.h rename to extensions/common/api/web_request/web_request_activity_log_constants.h index 5529765..be45933 100644 --- a/extensions/browser/api/activity_log/web_request_constants.h +++ b/extensions/common/api/web_request/web_request_activity_log_constants.h
@@ -5,10 +5,10 @@ // Constants used when describing request modifications via the WebRequest API // in the activity log. -#ifndef EXTENSIONS_BROWSER_API_ACTIVITY_LOG_WEB_REQUEST_CONSTANTS_H_ -#define EXTENSIONS_BROWSER_API_ACTIVITY_LOG_WEB_REQUEST_CONSTANTS_H_ +#ifndef EXTENSIONS_COMMON_API_WEB_REQUEST_WEB_REQUEST_ACTIVITY_LOG_CONSTANTS_H_ +#define EXTENSIONS_COMMON_API_WEB_REQUEST_WEB_REQUEST_ACTIVITY_LOG_CONSTANTS_H_ -namespace activity_log_web_request_constants { +namespace web_request_activity_log_constants { // Keys used in the dictionary summarizing an EventResponseDelta for the // extension activity log. @@ -31,6 +31,6 @@ extern const char kCookieModNameKey[]; extern const char kCookieModDomainKey[]; -} // namespace activity_log_web_request_constants +} // namespace web_request_activity_log_constants -#endif // EXTENSIONS_BROWSER_API_ACTIVITY_LOG_WEB_REQUEST_CONSTANTS_H_ +#endif // EXTENSIONS_COMMON_API_WEB_REQUEST_WEB_REQUEST_ACTIVITY_LOG_CONSTANTS_H_
diff --git a/extensions/common/feature_switch.h b/extensions/common/feature_switch.h index 6c023185..129b5be 100644 --- a/extensions/common/feature_switch.h +++ b/extensions/common/feature_switch.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/memory/raw_ptr.h" namespace base {
diff --git a/extensions/common/file_util.h b/extensions/common/file_util.h index 7c4ba44..713efeb 100644 --- a/extensions/common/file_util.h +++ b/extensions/common/file_util.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> #include <vector> + #include "base/files/file_path.h" #include "base/memory/scoped_refptr.h" #include "base/values.h"
diff --git a/extensions/common/manifest_fuzzer.cc b/extensions/common/manifest_fuzzer.cc index a28a08a..4b2e354 100644 --- a/extensions/common/manifest_fuzzer.cc +++ b/extensions/common/manifest_fuzzer.cc
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "extensions/common/manifest.h" + +#include <fuzzer/FuzzedDataProvider.h> #include <stddef.h> #include <stdint.h> @@ -10,7 +13,6 @@ #include <utility> #include <vector> -#include <fuzzer/FuzzedDataProvider.h> #include "base/at_exit.h" #include "base/check.h" #include "base/command_line.h" @@ -18,7 +20,6 @@ #include "base/values.h" #include "extensions/common/extensions_client.h" #include "extensions/common/install_warning.h" -#include "extensions/common/manifest.h" #include "extensions/common/mojom/manifest.mojom-shared.h" #include "extensions/test/test_extensions_client.h"
diff --git a/extensions/common/manifest_handlers/background_info.h b/extensions/common/manifest_handlers/background_info.h index 923f1b2..c3c348ce 100644 --- a/extensions/common/manifest_handlers/background_info.h +++ b/extensions/common/manifest_handlers/background_info.h
@@ -8,6 +8,7 @@ #include <optional> #include <string> #include <vector> + #include "extensions/common/extension.h" #include "extensions/common/manifest_handler.h" #include "url/gurl.h"
diff --git a/extensions/common/manifest_handlers/kiosk_mode_info.h b/extensions/common/manifest_handlers/kiosk_mode_info.h index 7bff4ab..5de09a9 100644 --- a/extensions/common/manifest_handlers/kiosk_mode_info.h +++ b/extensions/common/manifest_handlers/kiosk_mode_info.h
@@ -8,6 +8,7 @@ #include <optional> #include <string> #include <vector> + #include "extensions/common/extension.h" #include "extensions/common/extension_id.h" #include "extensions/common/manifest.h"
diff --git a/extensions/common/mojom/permission_set_mojom_traits.h b/extensions/common/mojom/permission_set_mojom_traits.h index 965b098..7c71645 100644 --- a/extensions/common/mojom/permission_set_mojom_traits.h +++ b/extensions/common/mojom/permission_set_mojom_traits.h
@@ -6,6 +6,7 @@ #define EXTENSIONS_COMMON_MOJOM_PERMISSION_SET_MOJOM_TRAITS_H_ #include <optional> + #include "extensions/common/mojom/api_permission_id.mojom-shared.h" #include "extensions/common/mojom/permission_set.mojom-shared.h" #include "extensions/common/mojom/url_pattern_set_mojom_traits.h"
diff --git a/extensions/renderer/api/messaging/message_target.h b/extensions/renderer/api/messaging/message_target.h index 35bf3f1a..637ce7b 100644 --- a/extensions/renderer/api/messaging/message_target.h +++ b/extensions/renderer/api/messaging/message_target.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "extensions/common/extension_id.h" namespace extensions {
diff --git a/extensions/renderer/api/messaging/one_time_message_handler.h b/extensions/renderer/api/messaging/one_time_message_handler.h index 8ec6f8c..9f13927 100644 --- a/extensions/renderer/api/messaging/one_time_message_handler.h +++ b/extensions/renderer/api/messaging/one_time_message_handler.h
@@ -10,6 +10,7 @@ #include <memory> #include <optional> #include <string> + #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "extensions/common/mojom/message_port.mojom.h"
diff --git a/extensions/renderer/api_definitions_natives.cc b/extensions/renderer/api_definitions_natives.cc index d2ee8b6..144250d 100644 --- a/extensions/renderer/api_definitions_natives.cc +++ b/extensions/renderer/api_definitions_natives.cc
@@ -7,16 +7,18 @@ #include "base/functional/bind.h" #include "extensions/common/features/feature.h" #include "extensions/common/features/feature_provider.h" -#include "extensions/renderer/dispatcher.h" #include "extensions/renderer/script_context.h" +#include "extensions/renderer/v8_schema_registry.h" #include "v8/include/v8-container.h" #include "v8/include/v8-function-callback.h" namespace extensions { -ApiDefinitionsNatives::ApiDefinitionsNatives(Dispatcher* dispatcher, - ScriptContext* context) - : ObjectBackedNativeHandler(context), dispatcher_(dispatcher) {} +ApiDefinitionsNatives::ApiDefinitionsNatives( + V8SchemaRegistry* v8_schema_registry, + ScriptContext* context) + : ObjectBackedNativeHandler(context), + v8_schema_registry_(v8_schema_registry) {} void ApiDefinitionsNatives::AddRoutes() { RouteHandlerFunction( @@ -37,7 +39,7 @@ } } args.GetReturnValue().Set( - dispatcher_->v8_schema_registry()->GetSchemas(args.GetIsolate(), apis)); + v8_schema_registry_->GetSchemas(args.GetIsolate(), apis)); } } // namespace extensions
diff --git a/extensions/renderer/api_definitions_natives.h b/extensions/renderer/api_definitions_natives.h index 95c5af0..79884ab 100644 --- a/extensions/renderer/api_definitions_natives.h +++ b/extensions/renderer/api_definitions_natives.h
@@ -10,13 +10,14 @@ #include "v8/include/v8-forward.h" namespace extensions { -class Dispatcher; +class V8SchemaRegistry; class ScriptContext; // Native functions for JS to get access to the schemas for extension APIs. class ApiDefinitionsNatives : public ObjectBackedNativeHandler { public: - ApiDefinitionsNatives(Dispatcher* dispatcher, ScriptContext* context); + ApiDefinitionsNatives(V8SchemaRegistry* v8_schema_registry, + ScriptContext* context); ApiDefinitionsNatives(const ApiDefinitionsNatives&) = delete; ApiDefinitionsNatives& operator=(const ApiDefinitionsNatives&) = delete; @@ -30,7 +31,7 @@ const v8::FunctionCallbackInfo<v8::Value>& args); // Not owned. - raw_ptr<Dispatcher> dispatcher_; + raw_ptr<V8SchemaRegistry> v8_schema_registry_; }; } // namespace extensions
diff --git a/extensions/renderer/bindings/api_binding_js_util.cc b/extensions/renderer/bindings/api_binding_js_util.cc index 43c8d321..4d5ad33 100644 --- a/extensions/renderer/bindings/api_binding_js_util.cc +++ b/extensions/renderer/bindings/api_binding_js_util.cc
@@ -5,6 +5,7 @@ #include "extensions/renderer/bindings/api_binding_js_util.h" #include <optional> + #include "base/strings/stringprintf.h" #include "base/values.h" #include "content/public/renderer/v8_value_converter.h"
diff --git a/extensions/renderer/bindings/api_binding_js_util_unittest.cc b/extensions/renderer/bindings/api_binding_js_util_unittest.cc index 672e5cb..eae2eb8c 100644 --- a/extensions/renderer/bindings/api_binding_js_util_unittest.cc +++ b/extensions/renderer/bindings/api_binding_js_util_unittest.cc
@@ -5,6 +5,7 @@ #include "extensions/renderer/bindings/api_binding_js_util.h" #include <optional> + #include "base/functional/bind.h" #include "extensions/renderer/bindings/api_binding_test_util.h" #include "extensions/renderer/bindings/api_bindings_system.h"
diff --git a/extensions/renderer/bindings/api_event_handler_unittest.cc b/extensions/renderer/bindings/api_event_handler_unittest.cc index 2e2a65c..94f99c1 100644 --- a/extensions/renderer/bindings/api_event_handler_unittest.cc +++ b/extensions/renderer/bindings/api_event_handler_unittest.cc
@@ -5,6 +5,7 @@ #include "extensions/renderer/bindings/api_event_handler.h" #include <optional> + #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/run_loop.h"
diff --git a/extensions/renderer/bindings/api_last_error.cc b/extensions/renderer/bindings/api_last_error.cc index 67b3b3a..bdd094d0 100644 --- a/extensions/renderer/bindings/api_last_error.cc +++ b/extensions/renderer/bindings/api_last_error.cc
@@ -6,6 +6,7 @@ #include <optional> #include <tuple> + #include "gin/converter.h" #include "gin/data_object_builder.h" #include "gin/handle.h"
diff --git a/extensions/renderer/bindings/api_last_error.h b/extensions/renderer/bindings/api_last_error.h index 30704a8..85dccda 100644 --- a/extensions/renderer/bindings/api_last_error.h +++ b/extensions/renderer/bindings/api_last_error.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/functional/callback.h" #include "extensions/renderer/bindings/api_binding_types.h" #include "v8/include/v8.h"
diff --git a/extensions/renderer/bindings/api_request_handler.h b/extensions/renderer/bindings/api_request_handler.h index 0b6e3dc..f941a50 100644 --- a/extensions/renderer/bindings/api_request_handler.h +++ b/extensions/renderer/bindings/api_request_handler.h
@@ -9,6 +9,7 @@ #include <memory> #include <optional> #include <set> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/values.h"
diff --git a/extensions/renderer/bindings/api_request_handler_unittest.cc b/extensions/renderer/bindings/api_request_handler_unittest.cc index af1e70c..7c0ec15e 100644 --- a/extensions/renderer/bindings/api_request_handler_unittest.cc +++ b/extensions/renderer/bindings/api_request_handler_unittest.cc
@@ -5,6 +5,7 @@ #include "extensions/renderer/bindings/api_request_handler.h" #include <optional> + #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/strings/strcat.h"
diff --git a/extensions/renderer/bindings/api_response_validator_unittest.cc b/extensions/renderer/bindings/api_response_validator_unittest.cc index 70328da7..5ef7a1f 100644 --- a/extensions/renderer/bindings/api_response_validator_unittest.cc +++ b/extensions/renderer/bindings/api_response_validator_unittest.cc
@@ -6,6 +6,7 @@ #include <optional> #include <vector> + #include "base/auto_reset.h" #include "base/functional/bind.h" #include "extensions/renderer/bindings/api_binding_test.h"
diff --git a/extensions/renderer/bindings/api_signature.h b/extensions/renderer/bindings/api_signature.h index ce848bad..761e7eee 100644 --- a/extensions/renderer/bindings/api_signature.h +++ b/extensions/renderer/bindings/api_signature.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> #include <vector> + #include "base/memory/raw_ptr.h" #include "base/values.h" #include "extensions/renderer/bindings/api_binding_types.h"
diff --git a/extensions/renderer/bindings/exception_handler_unittest.cc b/extensions/renderer/bindings/exception_handler_unittest.cc index b7e140e7..69de0f2 100644 --- a/extensions/renderer/bindings/exception_handler_unittest.cc +++ b/extensions/renderer/bindings/exception_handler_unittest.cc
@@ -7,6 +7,7 @@ #include <optional> #include <string> #include <tuple> + #include "base/functional/bind.h" #include "base/strings/stringprintf.h" #include "extensions/renderer/bindings/api_binding_test.h"
diff --git a/extensions/renderer/bindings/js_runner.h b/extensions/renderer/bindings/js_runner.h index 060b2e3..bd67be391 100644 --- a/extensions/renderer/bindings/js_runner.h +++ b/extensions/renderer/bindings/js_runner.h
@@ -7,6 +7,7 @@ #include <memory> #include <optional> + #include "base/functional/callback.h" #include "v8/include/v8.h"
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc index 74d28b69..72722cc 100644 --- a/extensions/renderer/dispatcher.cc +++ b/extensions/renderer/dispatcher.cc
@@ -924,86 +924,6 @@ return resources; } -// NOTE: please use the naming convention "foo_natives" for these. -// static -void Dispatcher::RegisterNativeHandlers( - ModuleSystem* module_system, - ScriptContext* context, - Dispatcher* dispatcher, - NativeExtensionBindingsSystem* bindings_system, - V8SchemaRegistry* v8_schema_registry) { - module_system->RegisterNativeHandler( - "chrome", - std::unique_ptr<NativeHandler>(new ChromeNativeHandler(context))); - module_system->RegisterNativeHandler( - "logging", - std::unique_ptr<NativeHandler>(new LoggingNativeHandler(context))); - module_system->RegisterNativeHandler( - "schema_registry", - v8_schema_registry->AsNativeHandler(context->isolate())); - module_system->RegisterNativeHandler( - "test_features", - std::unique_ptr<NativeHandler>(new TestFeaturesNativeHandler(context))); - module_system->RegisterNativeHandler( - "test_native_handler", - std::unique_ptr<NativeHandler>(new TestNativeHandler(context))); - module_system->RegisterNativeHandler( - "user_gestures", - std::unique_ptr<NativeHandler>(new UserGesturesNativeHandler(context))); - module_system->RegisterNativeHandler( - "utils", std::unique_ptr<NativeHandler>(new UtilsNativeHandler(context))); - module_system->RegisterNativeHandler( - "v8_context", - std::unique_ptr<NativeHandler>(new V8ContextNativeHandler(context))); - module_system->RegisterNativeHandler( - "messaging_natives", std::make_unique<MessagingBindings>(context)); - module_system->RegisterNativeHandler( - "apiDefinitions", std::unique_ptr<NativeHandler>( - new ApiDefinitionsNatives(dispatcher, context))); - module_system->RegisterNativeHandler( - "setIcon", std::unique_ptr<NativeHandler>(new SetIconNatives(context))); - module_system->RegisterNativeHandler( - "activityLogger", std::make_unique<APIActivityLogger>( - bindings_system->GetIPCMessageSender(), context)); - module_system->RegisterNativeHandler( - "renderFrameObserverNatives", - std::unique_ptr<NativeHandler>(new RenderFrameObserverNatives(context))); - - // Natives used by multiple APIs. - module_system->RegisterNativeHandler( - "file_system_natives", - std::unique_ptr<NativeHandler>(new FileSystemNatives(context))); - module_system->RegisterNativeHandler( - "service_worker_natives", - std::make_unique<ServiceWorkerNatives>(context)); - - // Custom bindings. - module_system->RegisterNativeHandler( - "app_window_natives", - std::unique_ptr<NativeHandler>(new AppWindowCustomBindings(context))); - module_system->RegisterNativeHandler( - "blob_natives", - std::unique_ptr<NativeHandler>(new BlobNativeHandler(context))); - module_system->RegisterNativeHandler( - "context_menus", - std::unique_ptr<NativeHandler>(new ContextMenusCustomBindings(context))); - module_system->RegisterNativeHandler( - "guest_view_internal", std::unique_ptr<NativeHandler>( - new GuestViewInternalCustomBindings(context))); - module_system->RegisterNativeHandler( - "id_generator", - std::unique_ptr<NativeHandler>(new IdGeneratorCustomBindings(context))); - module_system->RegisterNativeHandler( - "process", std::make_unique<ProcessInfoNativeHandler>(context)); - module_system->RegisterNativeHandler( - "runtime", - std::unique_ptr<NativeHandler>(new RuntimeCustomBindings(context))); - - module_system->RegisterNativeHandler( - "automationInternal", std::make_unique<AutomationInternalCustomBindings>( - context, bindings_system)); -} - void Dispatcher::RegisterMojoInterfaces( blink::AssociatedInterfaceRegistry* associated_interfaces) { // This base::Unretained() is safe, because: @@ -1495,8 +1415,65 @@ ScriptContext* context, NativeExtensionBindingsSystem* bindings_system, V8SchemaRegistry* v8_schema_registry) { - RegisterNativeHandlers(module_system, context, this, bindings_system, - v8_schema_registry); + module_system->RegisterNativeHandler( + "chrome", std::make_unique<ChromeNativeHandler>(context)); + module_system->RegisterNativeHandler( + "logging", std::make_unique<LoggingNativeHandler>(context)); + module_system->RegisterNativeHandler( + "schema_registry", + v8_schema_registry->AsNativeHandler(context->isolate())); + module_system->RegisterNativeHandler( + "test_features", std::make_unique<TestFeaturesNativeHandler>(context)); + module_system->RegisterNativeHandler( + "test_native_handler", std::make_unique<TestNativeHandler>(context)); + module_system->RegisterNativeHandler( + "user_gestures", std::make_unique<UserGesturesNativeHandler>(context)); + module_system->RegisterNativeHandler( + "utils", std::make_unique<UtilsNativeHandler>(context)); + module_system->RegisterNativeHandler( + "v8_context", std::make_unique<V8ContextNativeHandler>(context)); + module_system->RegisterNativeHandler( + "messaging_natives", std::make_unique<MessagingBindings>(context)); + module_system->RegisterNativeHandler( + "apiDefinitions", + std::make_unique<ApiDefinitionsNatives>(v8_schema_registry, context)); + module_system->RegisterNativeHandler( + "setIcon", std::make_unique<SetIconNatives>(context)); + module_system->RegisterNativeHandler( + "activityLogger", std::make_unique<APIActivityLogger>( + bindings_system->GetIPCMessageSender(), context)); + module_system->RegisterNativeHandler( + "renderFrameObserverNatives", + std::make_unique<RenderFrameObserverNatives>(context)); + + // Natives used by multiple APIs. + module_system->RegisterNativeHandler( + "file_system_natives", std::make_unique<FileSystemNatives>(context)); + module_system->RegisterNativeHandler( + "service_worker_natives", + std::make_unique<ServiceWorkerNatives>(context)); + + // Custom bindings. + module_system->RegisterNativeHandler( + "app_window_natives", std::make_unique<AppWindowCustomBindings>(context)); + module_system->RegisterNativeHandler( + "blob_natives", std::make_unique<BlobNativeHandler>(context)); + module_system->RegisterNativeHandler( + "context_menus", std::make_unique<ContextMenusCustomBindings>(context)); + module_system->RegisterNativeHandler( + "guest_view_internal", + std::make_unique<GuestViewInternalCustomBindings>(context)); + module_system->RegisterNativeHandler( + "id_generator", std::make_unique<IdGeneratorCustomBindings>(context)); + module_system->RegisterNativeHandler( + "process", std::make_unique<ProcessInfoNativeHandler>(context)); + module_system->RegisterNativeHandler( + "runtime", std::make_unique<RuntimeCustomBindings>(context)); + + module_system->RegisterNativeHandler( + "automationInternal", std::make_unique<AutomationInternalCustomBindings>( + context, bindings_system)); + delegate_->RegisterNativeHandlers(this, module_system, bindings_system, context); }
diff --git a/extensions/renderer/dispatcher.h b/extensions/renderer/dispatcher.h index 7759c859..124cb8d 100644 --- a/extensions/renderer/dispatcher.h +++ b/extensions/renderer/dispatcher.h
@@ -204,12 +204,6 @@ }; // Returns a list of resources for the JS modules to add to the source map. static std::vector<JsResourceInfo> GetJsResources(); - static void RegisterNativeHandlers( - ModuleSystem* module_system, - ScriptContext* context, - Dispatcher* dispatcher, - NativeExtensionBindingsSystem* bindings_system, - V8SchemaRegistry* v8_schema_registry); NativeExtensionBindingsSystem* bindings_system() { return bindings_system_.get();
diff --git a/extensions/renderer/extension_web_view_helper.h b/extensions/renderer/extension_web_view_helper.h index e9d9904..dbdb36b 100644 --- a/extensions/renderer/extension_web_view_helper.h +++ b/extensions/renderer/extension_web_view_helper.h
@@ -6,6 +6,7 @@ #define EXTENSIONS_RENDERER_EXTENSION_WEB_VIEW_HELPER_H_ #include <optional> + #include "third_party/blink/public/web/web_view.h" #include "third_party/blink/public/web/web_view_observer.h" #include "url/origin.h"
diff --git a/extensions/renderer/ipc_message_sender.cc b/extensions/renderer/ipc_message_sender.cc index a724963..58980f8 100644 --- a/extensions/renderer/ipc_message_sender.cc +++ b/extensions/renderer/ipc_message_sender.cc
@@ -6,6 +6,7 @@ #include <optional> #include <utility> + #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/metrics/histogram_macros.h"
diff --git a/extensions/renderer/isolated_world_manager.h b/extensions/renderer/isolated_world_manager.h index 65e3fb5..1c20ec5 100644 --- a/extensions/renderer/isolated_world_manager.h +++ b/extensions/renderer/isolated_world_manager.h
@@ -8,6 +8,7 @@ #include <map> #include <optional> #include <string> + #include "base/sequence_checker.h" #include "extensions/common/mojom/execution_world.mojom.h" #include "url/gurl.h"
diff --git a/extensions/renderer/programmatic_script_injector.h b/extensions/renderer/programmatic_script_injector.h index 28656de9f..4931fdc 100644 --- a/extensions/renderer/programmatic_script_injector.h +++ b/extensions/renderer/programmatic_script_injector.h
@@ -7,6 +7,7 @@ #include <memory> #include <optional> + #include "base/values.h" #include "extensions/common/mojom/css_origin.mojom-shared.h" #include "extensions/common/mojom/frame.mojom.h"
diff --git a/extensions/renderer/renderer_extension_registry.h b/extensions/renderer/renderer_extension_registry.h index 4e82ed6c..cdd1c986 100644 --- a/extensions/renderer/renderer_extension_registry.h +++ b/extensions/renderer/renderer_extension_registry.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <optional> + #include "base/synchronization/lock.h" #include "extensions/common/extension_id.h" #include "extensions/common/extension_set.h"
diff --git a/extensions/renderer/script_injection.h b/extensions/renderer/script_injection.h index f82c21b..6ff2486 100644 --- a/extensions/renderer/script_injection.h +++ b/extensions/renderer/script_injection.h
@@ -10,6 +10,7 @@ #include <memory> #include <optional> #include <vector> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h"
diff --git a/extensions/renderer/worker_thread_dispatcher.h b/extensions/renderer/worker_thread_dispatcher.h index 6145af06..00406c9 100644 --- a/extensions/renderer/worker_thread_dispatcher.h +++ b/extensions/renderer/worker_thread_dispatcher.h
@@ -9,6 +9,7 @@ #include <memory> #include <optional> #include <string> + #include "base/synchronization/lock.h" #include "base/threading/platform_thread.h" #include "base/values.h"
diff --git a/extensions/shell/app/shell_main_delegate.h b/extensions/shell/app/shell_main_delegate.h index 146d4977..bfe8aa68 100644 --- a/extensions/shell/app/shell_main_delegate.h +++ b/extensions/shell/app/shell_main_delegate.h
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <vector> + #include "base/compiler_specific.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h"
diff --git a/extensions/shell/test/test_shell_main_delegate.h b/extensions/shell/test/test_shell_main_delegate.h index 2d0d9309..70ea181 100644 --- a/extensions/shell/test/test_shell_main_delegate.h +++ b/extensions/shell/test/test_shell_main_delegate.h
@@ -7,6 +7,7 @@ #include <memory> #include <optional> + #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "extensions/shell/app/shell_main_delegate.h"
diff --git a/extensions/test/extension_test_message_listener.h b/extensions/test/extension_test_message_listener.h index c0ceaf2..51c87546 100644 --- a/extensions/test/extension_test_message_listener.h +++ b/extensions/test/extension_test_message_listener.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h"
diff --git a/fuchsia_web/common/test/frame_test_util.cc b/fuchsia_web/common/test/frame_test_util.cc index d9fea4d..64cd3f81 100644 --- a/fuchsia_web/common/test/frame_test_util.cc +++ b/fuchsia_web/common/test/frame_test_util.cc
@@ -4,10 +4,10 @@ #include "fuchsia_web/common/test/frame_test_util.h" +#include <optional> #include <utility> #include <vector> -#include <optional> #include "base/check.h" #include "base/fuchsia/mem_buffer_util.h" #include "base/json/json_reader.h"
diff --git a/fuchsia_web/common/test/frame_test_util.h b/fuchsia_web/common/test/frame_test_util.h index 4c01cbfb..ccd94cad 100644 --- a/fuchsia_web/common/test/frame_test_util.h +++ b/fuchsia_web/common/test/frame_test_util.h
@@ -9,6 +9,7 @@ #include <fuchsia/web/cpp/fidl.h> #include <optional> + #include "base/strings/string_piece.h" #include "base/values.h"
diff --git a/fuchsia_web/common/test/url_request_rewrite_test_util.h b/fuchsia_web/common/test/url_request_rewrite_test_util.h index 1b8e8cc..1c1152fc 100644 --- a/fuchsia_web/common/test/url_request_rewrite_test_util.h +++ b/fuchsia_web/common/test/url_request_rewrite_test_util.h
@@ -8,6 +8,7 @@ #include <fuchsia/web/cpp/fidl.h> #include <optional> + #include "base/strings/string_piece.h" // Utility functions to create a fuchsia.web.UrlRequestRewrite in one line.
diff --git a/fuchsia_web/runners/cast/api_bindings_client.h b/fuchsia_web/runners/cast/api_bindings_client.h index c682cd0..09c972e 100644 --- a/fuchsia_web/runners/cast/api_bindings_client.h +++ b/fuchsia_web/runners/cast/api_bindings_client.h
@@ -7,9 +7,10 @@ #include <chromium/cast/cpp/fidl.h> #include <fuchsia/web/cpp/fidl.h> -#include <vector> #include <optional> +#include <vector> + #include "base/memory/weak_ptr.h" #include "components/cast/message_port/message_port.h" #include "components/cast/named_message_port_connector/named_message_port_connector.h"
diff --git a/fuchsia_web/runners/cast/cast_component.h b/fuchsia_web/runners/cast/cast_component.h index f6bb93ee..07dedbf 100644 --- a/fuchsia_web/runners/cast/cast_component.h +++ b/fuchsia_web/runners/cast/cast_component.h
@@ -9,11 +9,11 @@ #include <fuchsia/web/cpp/fidl.h> #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/fuchsia/startup_context.h" #include "base/gtest_prod_util.h" #include "base/message_loop/message_pump_for_io.h"
diff --git a/fuchsia_web/runners/cast/cast_runner.h b/fuchsia_web/runners/cast/cast_runner.h index 2c699a87..b516fc9 100644 --- a/fuchsia_web/runners/cast/cast_runner.h +++ b/fuchsia_web/runners/cast/cast_runner.h
@@ -10,10 +10,10 @@ #include <fuchsia/web/cpp/fidl.h> #include <memory> +#include <optional> #include <set> #include <vector> -#include <optional> #include "base/containers/flat_set.h" #include "base/containers/unique_ptr_adapters.h" #include "base/fuchsia/startup_context.h"
diff --git a/fuchsia_web/runners/cast/cast_streaming.cc b/fuchsia_web/runners/cast/cast_streaming.cc index f66ecd6..865c1b1 100644 --- a/fuchsia_web/runners/cast/cast_streaming.cc +++ b/fuchsia_web/runners/cast/cast_streaming.cc
@@ -4,9 +4,9 @@ #include "fuchsia_web/runners/cast/cast_streaming.h" +#include <optional> #include <string> -#include <optional> #include "components/fuchsia_component_support/config_reader.h" namespace {
diff --git a/fuchsia_web/runners/cast/main.cc b/fuchsia_web/runners/cast/main.cc index 9c486bf..823b693 100644 --- a/fuchsia_web/runners/cast/main.cc +++ b/fuchsia_web/runners/cast/main.cc
@@ -7,9 +7,9 @@ #include <lib/sys/cpp/component_context.h> #include <lib/trace-provider/provider.h> +#include <optional> #include <utility> -#include <optional> #include "base/check.h" #include "base/command_line.h" #include "base/files/file_path.h"
diff --git a/fuchsia_web/runners/cast/test/cast_runner_launcher.h b/fuchsia_web/runners/cast/test/cast_runner_launcher.h index 8b28903..97b97d42 100644 --- a/fuchsia_web/runners/cast/test/cast_runner_launcher.h +++ b/fuchsia_web/runners/cast/test/cast_runner_launcher.h
@@ -9,9 +9,9 @@ #include <lib/sys/cpp/service_directory.h> #include <memory> +#include <optional> #include <string_view> -#include <optional> #include "fuchsia_web/common/test/fake_feedback_service.h" #include "fuchsia_web/runners/cast/test/cast_runner_features.h" #include "fuchsia_web/runners/cast/test/fake_cast_agent.h"
diff --git a/fuchsia_web/runners/cast/test/fake_application_config_manager.cc b/fuchsia_web/runners/cast/test/fake_application_config_manager.cc index e7bfc24..dca5815 100644 --- a/fuchsia_web/runners/cast/test/fake_application_config_manager.cc +++ b/fuchsia_web/runners/cast/test/fake_application_config_manager.cc
@@ -6,10 +6,10 @@ #include <fuchsia/web/cpp/fidl.h> +#include <optional> #include <string> #include <utility> -#include <optional> #include "base/fuchsia/fuchsia_logging.h" #include "base/logging.h"
diff --git a/fuchsia_web/shell/cast_streaming_shell.cc b/fuchsia_web/shell/cast_streaming_shell.cc index 12a5e3ec..d6a26ab 100644 --- a/fuchsia_web/shell/cast_streaming_shell.cc +++ b/fuchsia_web/shell/cast_streaming_shell.cc
@@ -9,6 +9,7 @@ #include <lib/sys/cpp/service_directory.h> #include <optional> + #include "base/base_paths.h" #include "base/check.h" #include "base/command_line.h"
diff --git a/fuchsia_web/shell/shell_relauncher.h b/fuchsia_web/shell/shell_relauncher.h index 7b0614e..7771fed 100644 --- a/fuchsia_web/shell/shell_relauncher.h +++ b/fuchsia_web/shell/shell_relauncher.h
@@ -6,6 +6,7 @@ #define FUCHSIA_WEB_SHELL_SHELL_RELAUNCHER_H_ #include <optional> + #include "base/strings/string_piece.h" namespace base {
diff --git a/fuchsia_web/shell/web_engine_shell.cc b/fuchsia_web/shell/web_engine_shell.cc index b29c348dc..c50e082 100644 --- a/fuchsia_web/shell/web_engine_shell.cc +++ b/fuchsia_web/shell/web_engine_shell.cc
@@ -11,9 +11,9 @@ #include <lib/sys/cpp/service_directory.h> #include <iostream> +#include <optional> #include <utility> -#include <optional> #include "base/base_paths.h" #include "base/check.h" #include "base/command_line.h"
diff --git a/fuchsia_web/webengine/browser/cookie_manager_impl_unittest.cc b/fuchsia_web/webengine/browser/cookie_manager_impl_unittest.cc index 9762f28b..de401a9 100644 --- a/fuchsia_web/webengine/browser/cookie_manager_impl_unittest.cc +++ b/fuchsia_web/webengine/browser/cookie_manager_impl_unittest.cc
@@ -2,12 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "fuchsia_web/webengine/browser/cookie_manager_impl.h" + #include <lib/fidl/cpp/binding.h> #include <map> +#include <optional> #include <vector> -#include <optional> #include "base/functional/bind.h" #include "base/run_loop.h" #include "base/strings/string_piece.h" @@ -15,7 +17,6 @@ #include "base/test/task_environment.h" #include "base/test/test_future.h" #include "fuchsia_web/common/test/fit_adapter.h" -#include "fuchsia_web/webengine/browser/cookie_manager_impl.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/cookies/cookie_access_result.h" #include "services/network/network_service.h"
diff --git a/fuchsia_web/webengine/browser/fake_semantics_manager.h b/fuchsia_web/webengine/browser/fake_semantics_manager.h index fd89213..25eb674 100644 --- a/fuchsia_web/webengine/browser/fake_semantics_manager.h +++ b/fuchsia_web/webengine/browser/fake_semantics_manager.h
@@ -10,6 +10,7 @@ #include <lib/fidl/cpp/binding.h> #include <optional> + #include "base/functional/callback.h" #include "fuchsia_web/webengine/browser/fake_semantic_tree.h"
diff --git a/fuchsia_web/webengine/browser/frame_impl.h b/fuchsia_web/webengine/browser/frame_impl.h index 10e6499..ab81b9e6 100644 --- a/fuchsia_web/webengine/browser/frame_impl.h +++ b/fuchsia_web/webengine/browser/frame_impl.h
@@ -15,11 +15,11 @@ #include <list> #include <map> #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/fuchsia/scoped_fx_logger.h" #include "base/gtest_prod_util.h" #include "base/logging.h"
diff --git a/fuchsia_web/webengine/browser/media_browsertest.cc b/fuchsia_web/webengine/browser/media_browsertest.cc index 8928863..69763aa 100644 --- a/fuchsia_web/webengine/browser/media_browsertest.cc +++ b/fuchsia_web/webengine/browser/media_browsertest.cc
@@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "fuchsia_web/webengine/test/web_engine_browser_test.h" - #include <fuchsia/mediacodec/cpp/fidl_test_base.h> #include <optional> + #include "base/files/file_path.h" #include "base/fuchsia/scoped_service_binding.h" #include "base/fuchsia/test_component_context_for_process.h" @@ -17,6 +16,7 @@ #include "fuchsia_web/common/test/test_navigation_listener.h" #include "fuchsia_web/webengine/features.h" #include "fuchsia_web/webengine/test/test_data.h" +#include "fuchsia_web/webengine/test/web_engine_browser_test.h" #include "testing/gtest/include/gtest/gtest.h" namespace {
diff --git a/fuchsia_web/webengine/browser/media_player_impl.h b/fuchsia_web/webengine/browser/media_player_impl.h index f1c781d..a682406 100644 --- a/fuchsia_web/webengine/browser/media_player_impl.h +++ b/fuchsia_web/webengine/browser/media_player_impl.h
@@ -6,9 +6,10 @@ #define FUCHSIA_WEB_WEBENGINE_BROWSER_MEDIA_PLAYER_IMPL_H_ #include <fidl/fuchsia.media.sessions2/cpp/fidl.h> -#include <string> #include <optional> +#include <string> + #include "base/functional/callback.h" #include "fuchsia_web/webengine/web_engine_export.h" #include "mojo/public/cpp/bindings/receiver.h"
diff --git a/fuchsia_web/webengine/browser/message_port.h b/fuchsia_web/webengine/browser/message_port.h index 4aa2ecc..230db13 100644 --- a/fuchsia_web/webengine/browser/message_port.h +++ b/fuchsia_web/webengine/browser/message_port.h
@@ -10,6 +10,7 @@ #include <lib/fidl/cpp/interface_request.h> #include <optional> + #include "third_party/blink/public/common/messaging/web_message_port.h" // Creates a connected MessagePort from a FIDL MessagePort request and
diff --git a/fuchsia_web/webengine/browser/mock_virtual_keyboard.h b/fuchsia_web/webengine/browser/mock_virtual_keyboard.h index 374f6fe8..7fc6ca8a 100644 --- a/fuchsia_web/webengine/browser/mock_virtual_keyboard.h +++ b/fuchsia_web/webengine/browser/mock_virtual_keyboard.h
@@ -9,6 +9,7 @@ #include <lib/fidl/cpp/binding.h> #include <optional> + #include "base/fuchsia/scoped_service_binding.h" #include "base/fuchsia/test_component_context_for_process.h" #include "base/functional/callback.h"
diff --git a/fuchsia_web/webengine/browser/theme_manager.h b/fuchsia_web/webengine/browser/theme_manager.h index 6c01c55..02ba9d6 100644 --- a/fuchsia_web/webengine/browser/theme_manager.h +++ b/fuchsia_web/webengine/browser/theme_manager.h
@@ -10,6 +10,7 @@ #include <lib/sys/cpp/component_context.h> #include <optional> + #include "base/fuchsia/process_context.h" #include "content/public/browser/web_contents.h" #include "fuchsia_web/webengine/web_engine_export.h"
diff --git a/fuchsia_web/webengine/browser/theme_manager_browsertest.cc b/fuchsia_web/webengine/browser/theme_manager_browsertest.cc index d816695..1d6ecc4 100644 --- a/fuchsia_web/webengine/browser/theme_manager_browsertest.cc +++ b/fuchsia_web/webengine/browser/theme_manager_browsertest.cc
@@ -5,6 +5,7 @@ #include <fuchsia/settings/cpp/fidl_test_base.h> #include <optional> + #include "base/fuchsia/scoped_service_binding.h" #include "base/fuchsia/test_component_context_for_process.h" #include "base/json/json_writer.h"
diff --git a/fuchsia_web/webengine/browser/web_engine_devtools_controller.cc b/fuchsia_web/webengine/browser/web_engine_devtools_controller.cc index daa8883..fe60f7c 100644 --- a/fuchsia_web/webengine/browser/web_engine_devtools_controller.cc +++ b/fuchsia_web/webengine/browser/web_engine_devtools_controller.cc
@@ -7,9 +7,10 @@ #include <fuchsia/web/cpp/fidl.h> #include <lib/fidl/cpp/interface_ptr_set.h> #include <lib/sys/cpp/component_context.h> -#include <vector> #include <optional> +#include <vector> + #include "base/command_line.h" #include "base/containers/flat_set.h" #include "base/fuchsia/process_context.h"
diff --git a/fuchsia_web/webengine/context_provider_impl_unittest.cc b/fuchsia_web/webengine/context_provider_impl_unittest.cc index 4bf2448..f5ba5c3 100644 --- a/fuchsia_web/webengine/context_provider_impl_unittest.cc +++ b/fuchsia_web/webengine/context_provider_impl_unittest.cc
@@ -16,11 +16,11 @@ #include <map> #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/base_switches.h" #include "base/command_line.h" #include "base/containers/contains.h"
diff --git a/fuchsia_web/webengine/renderer/web_engine_audio_renderer_test.cc b/fuchsia_web/webengine/renderer/web_engine_audio_renderer_test.cc index 22bc603d..6c9b436 100644 --- a/fuchsia_web/webengine/renderer/web_engine_audio_renderer_test.cc +++ b/fuchsia_web/webengine/renderer/web_engine_audio_renderer_test.cc
@@ -9,6 +9,7 @@ #include <lib/fidl/cpp/binding.h> #include <optional> + #include "base/containers/queue.h" #include "base/fuchsia/fuchsia_logging.h" #include "base/logging.h"
diff --git a/fuchsia_web/webengine/renderer/web_engine_content_renderer_client.cc b/fuchsia_web/webengine/renderer/web_engine_content_renderer_client.cc index c55b35f..aa05349 100644 --- a/fuchsia_web/webengine/renderer/web_engine_content_renderer_client.cc +++ b/fuchsia_web/webengine/renderer/web_engine_content_renderer_client.cc
@@ -4,9 +4,9 @@ #include "fuchsia_web/webengine/renderer/web_engine_content_renderer_client.h" +#include <optional> #include <tuple> -#include <optional> #include "base/command_line.h" #include "base/feature_list.h" #include "base/memory/scoped_refptr.h"
diff --git a/fuchsia_web/webengine/test/isolated_archivist.h b/fuchsia_web/webengine/test/isolated_archivist.h index 75f6543..1a6c9628 100644 --- a/fuchsia_web/webengine/test/isolated_archivist.h +++ b/fuchsia_web/webengine/test/isolated_archivist.h
@@ -9,6 +9,7 @@ #include <lib/sys/cpp/outgoing_directory.h> #include <optional> + #include "base/fuchsia/scoped_service_publisher.h" // Runs an isolated archivist-for-embedding, publishing its
diff --git a/fuchsia_web/webengine/web_engine_integration_logging_test.cc b/fuchsia_web/webengine/web_engine_integration_logging_test.cc index 0e75d27e..bf07a60 100644 --- a/fuchsia_web/webengine/web_engine_integration_logging_test.cc +++ b/fuchsia_web/webengine/web_engine_integration_logging_test.cc
@@ -5,8 +5,8 @@ #include <fidl/fuchsia.logger/cpp/fidl.h> #include <cstring> - #include <optional> + #include "base/containers/contains.h" #include "base/fuchsia/test_log_listener_safe.h" #include "base/strings/string_piece.h"
diff --git a/fuchsia_web/webengine/web_engine_integration_test.cc b/fuchsia_web/webengine/web_engine_integration_test.cc index e4c2f8891..9da5774a 100644 --- a/fuchsia_web/webengine/web_engine_integration_test.cc +++ b/fuchsia_web/webengine/web_engine_integration_test.cc
@@ -8,9 +8,9 @@ #include <zircon/rights.h> #include <zircon/types.h> +#include <optional> #include <string> -#include <optional> #include "base/containers/contains.h" #include "base/fuchsia/fuchsia_logging.h" #include "base/fuchsia/mem_buffer_util.h"
diff --git a/fuchsia_web/webengine/web_engine_main_delegate.h b/fuchsia_web/webengine/web_engine_main_delegate.h index 861c09e..c856a40 100644 --- a/fuchsia_web/webengine/web_engine_main_delegate.h +++ b/fuchsia_web/webengine/web_engine_main_delegate.h
@@ -7,10 +7,11 @@ #include <fuchsia/web/cpp/fidl.h> #include <lib/zx/channel.h> + #include <memory> +#include <optional> #include <string> -#include <optional> #include "content/public/app/content_main_delegate.h" #include "fuchsia_web/webengine/web_engine_export.h"
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc index a737887..7da26b9 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc
@@ -9,11 +9,11 @@ #include <cstdint> #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/allocator/partition_allocator/src/partition_alloc/page_allocator.h" #include "base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h" #include "base/bits.h"
diff --git a/google_apis/calendar/calendar_api_url_generator.h b/google_apis/calendar/calendar_api_url_generator.h index 3bebf8f..846eb953 100644 --- a/google_apis/calendar/calendar_api_url_generator.h +++ b/google_apis/calendar/calendar_api_url_generator.h
@@ -5,9 +5,9 @@ #ifndef GOOGLE_APIS_CALENDAR_CALENDAR_API_URL_GENERATOR_H_ #define GOOGLE_APIS_CALENDAR_CALENDAR_API_URL_GENERATOR_H_ +#include <optional> #include <string> -#include <optional> #include "base/time/time.h" #include "google_apis/gaia/gaia_urls.h" #include "url/gurl.h"
diff --git a/google_apis/classroom/classroom_api_course_work_response_types.h b/google_apis/classroom/classroom_api_course_work_response_types.h index 866d8a9b..50e465bf 100644 --- a/google_apis/classroom/classroom_api_course_work_response_types.h +++ b/google_apis/classroom/classroom_api_course_work_response_types.h
@@ -6,10 +6,10 @@ #define GOOGLE_APIS_CLASSROOM_CLASSROOM_API_COURSE_WORK_RESPONSE_TYPES_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/time/time.h" #include "url/gurl.h"
diff --git a/google_apis/classroom/classroom_api_student_submissions_response_types.h b/google_apis/classroom/classroom_api_student_submissions_response_types.h index 0089bbb..e220d13 100644 --- a/google_apis/classroom/classroom_api_student_submissions_response_types.h +++ b/google_apis/classroom/classroom_api_student_submissions_response_types.h
@@ -6,10 +6,10 @@ #define GOOGLE_APIS_CLASSROOM_CLASSROOM_API_STUDENT_SUBMISSIONS_RESPONSE_TYPES_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/time/time.h" namespace base {
diff --git a/google_apis/gaia/fake_gaia.h b/google_apis/gaia/fake_gaia.h index b870034e..21c1505 100644 --- a/google_apis/gaia/fake_gaia.h +++ b/google_apis/gaia/fake_gaia.h
@@ -6,10 +6,10 @@ #define GOOGLE_APIS_GAIA_FAKE_GAIA_H_ #include <memory> +#include <optional> #include <set> #include <string> -#include <optional> #include "base/containers/flat_map.h" #include "base/functional/callback.h" #include "google_apis/gaia/gaia_auth_consumer.h"
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc index 1818791..41168ea 100644 --- a/google_apis/gaia/gaia_auth_fetcher.cc +++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -4,11 +4,11 @@ #include "google_apis/gaia/gaia_auth_fetcher.h" +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/functional/bind.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h"
diff --git a/google_apis/gaia/gaia_auth_test_util.h b/google_apis/gaia/gaia_auth_test_util.h index 10a865f..818aee0 100644 --- a/google_apis/gaia/gaia_auth_test_util.h +++ b/google_apis/gaia/gaia_auth_test_util.h
@@ -6,10 +6,10 @@ #define GOOGLE_APIS_GAIA_GAIA_AUTH_TEST_UTIL_H_ #include <optional> -#include "base/base64url.h" - #include <string> +#include "base/base64url.h" + namespace gaia { std::string GenerateOAuth2MintTokenConsentResult(
diff --git a/google_apis/gaia/gaia_config_unittest.cc b/google_apis/gaia/gaia_config_unittest.cc index 785d1e9..d99a1c9e 100644 --- a/google_apis/gaia/gaia_config_unittest.cc +++ b/google_apis/gaia/gaia_config_unittest.cc
@@ -5,6 +5,7 @@ #include "google_apis/gaia/gaia_config.h" #include <optional> + #include "base/command_line.h" #include "base/json/json_reader.h" #include "google_apis/gaia/gaia_switches.h"
diff --git a/google_apis/gcm/engine/connection_factory_impl_unittest.cc b/google_apis/gcm/engine/connection_factory_impl_unittest.cc index bdc2a3c7..87957c7 100644 --- a/google_apis/gcm/engine/connection_factory_impl_unittest.cc +++ b/google_apis/gcm/engine/connection_factory_impl_unittest.cc
@@ -6,9 +6,9 @@ #include <cmath> #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" #include "base/run_loop.h"
diff --git a/google_apis/tasks/tasks_api_response_types.h b/google_apis/tasks/tasks_api_response_types.h index a012eee2..3fe16c2 100644 --- a/google_apis/tasks/tasks_api_response_types.h +++ b/google_apis/tasks/tasks_api_response_types.h
@@ -6,10 +6,10 @@ #define GOOGLE_APIS_TASKS_TASKS_API_RESPONSE_TYPES_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/time/time.h" #include "google_apis/tasks/tasks_api_task_status.h"
diff --git a/google_apis/tasks/tasks_api_url_generator_utils.cc b/google_apis/tasks/tasks_api_url_generator_utils.cc index 11a24e5..56445efb 100644 --- a/google_apis/tasks/tasks_api_url_generator_utils.cc +++ b/google_apis/tasks/tasks_api_url_generator_utils.cc
@@ -4,9 +4,9 @@ #include "google_apis/tasks/tasks_api_url_generator_utils.h" +#include <optional> #include <string> -#include <optional> #include "base/check.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h"
diff --git a/google_apis/tasks/tasks_api_url_generator_utils.h b/google_apis/tasks/tasks_api_url_generator_utils.h index f16ed74..b00f0058 100644 --- a/google_apis/tasks/tasks_api_url_generator_utils.h +++ b/google_apis/tasks/tasks_api_url_generator_utils.h
@@ -5,9 +5,8 @@ #ifndef GOOGLE_APIS_TASKS_TASKS_API_URL_GENERATOR_UTILS_H_ #define GOOGLE_APIS_TASKS_TASKS_API_URL_GENERATOR_UTILS_H_ -#include <string> - #include <optional> +#include <string> class GURL;
diff --git a/google_apis/tasks/tasks_api_url_generator_utils_unittest.cc b/google_apis/tasks/tasks_api_url_generator_utils_unittest.cc index 97f352d..0ae5b82 100644 --- a/google_apis/tasks/tasks_api_url_generator_utils_unittest.cc +++ b/google_apis/tasks/tasks_api_url_generator_utils_unittest.cc
@@ -5,6 +5,7 @@ #include "google_apis/tasks/tasks_api_url_generator_utils.h" #include <optional> + #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h"
diff --git a/gpu/command_buffer/client/client_transfer_cache.h b/gpu/command_buffer/client/client_transfer_cache.h index a03f273..95a9424 100644 --- a/gpu/command_buffer/client/client_transfer_cache.h +++ b/gpu/command_buffer/client/client_transfer_cache.h
@@ -6,8 +6,8 @@ #define GPU_COMMAND_BUFFER_CLIENT_CLIENT_TRANSFER_CACHE_H_ #include <map> - #include <optional> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/synchronization/lock.h"
diff --git a/gpu/command_buffer/client/gl_helper_scaling.cc b/gpu/command_buffer/client/gl_helper_scaling.cc index c4600b3..3ae8af2a 100644 --- a/gpu/command_buffer/client/gl_helper_scaling.cc +++ b/gpu/command_buffer/client/gl_helper_scaling.cc
@@ -7,11 +7,11 @@ #include <stddef.h> #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/containers/circular_deque.h" #include "base/functional/bind.h" #include "base/lazy_instance.h"
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h index 326fc96..570adbdb 100644 --- a/gpu/command_buffer/client/gles2_implementation.h +++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -10,13 +10,13 @@ #include <map> #include <memory> +#include <optional> #include <set> #include <string> #include <unordered_map> #include <utility> #include <vector> -#include <optional> #include "base/compiler_specific.h" #include "base/containers/queue.h" #include "base/memory/raw_ptr.h"
diff --git a/gpu/command_buffer/client/query_tracker.h b/gpu/command_buffer/client/query_tracker.h index 719de63..fc0090e1 100644 --- a/gpu/command_buffer/client/query_tracker.h +++ b/gpu/command_buffer/client/query_tracker.h
@@ -12,9 +12,9 @@ #include <bitset> #include <memory> +#include <optional> #include <unordered_map> -#include <optional> #include "base/atomicops.h" #include "base/containers/circular_deque.h" #include "base/containers/flat_map.h"
diff --git a/gpu/command_buffer/client/raster_implementation.h b/gpu/command_buffer/client/raster_implementation.h index 649e5cd..e9ea8ded0f 100644 --- a/gpu/command_buffer/client/raster_implementation.h +++ b/gpu/command_buffer/client/raster_implementation.h
@@ -9,11 +9,11 @@ #include <stdint.h> #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/memory/raw_ptr.h" #include "base/trace_event/memory_dump_provider.h" #include "cc/paint/paint_cache.h"
diff --git a/gpu/command_buffer/common/skia_utils.h b/gpu/command_buffer/common/skia_utils.h index d9e106c..c1eee39 100644 --- a/gpu/command_buffer/common/skia_utils.h +++ b/gpu/command_buffer/common/skia_utils.h
@@ -7,6 +7,7 @@ #include <cstdint> #include <optional> + #include "gpu/raster_export.h" class GrDirectContext;
diff --git a/gpu/command_buffer/common/swap_buffers_complete_params.h b/gpu/command_buffer/common/swap_buffers_complete_params.h index 59ee7523..a32cbc5 100644 --- a/gpu/command_buffer/common/swap_buffers_complete_params.h +++ b/gpu/command_buffer/common/swap_buffers_complete_params.h
@@ -5,9 +5,9 @@ #ifndef GPU_COMMAND_BUFFER_COMMON_SWAP_BUFFERS_COMPLETE_PARAMS_H_ #define GPU_COMMAND_BUFFER_COMMON_SWAP_BUFFERS_COMPLETE_PARAMS_H_ +#include <optional> #include <vector> -#include <optional> #include "gpu/command_buffer/common/mailbox.h" #include "gpu/gpu_export.h" #include "ui/gfx/ca_layer_params.h"
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc index 4a875af..9aa2c3a 100644 --- a/gpu/command_buffer/service/context_state.cc +++ b/gpu/command_buffer/service/context_state.cc
@@ -8,8 +8,8 @@ #include <algorithm> #include <cmath> - #include <optional> + #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/service/buffer_manager.h" #include "gpu/command_buffer/service/framebuffer_manager.h"
diff --git a/gpu/command_buffer/service/dawn_context_provider.h b/gpu/command_buffer/service/dawn_context_provider.h index e678f9c9..617fc6f 100644 --- a/gpu/command_buffer/service/dawn_context_provider.h +++ b/gpu/command_buffer/service/dawn_context_provider.h
@@ -8,8 +8,8 @@ #include <dawn/platform/DawnPlatform.h> #include <memory> - #include <optional> + #include "base/memory/raw_ptr.h" #include "base/synchronization/lock.h" #include "base/thread_annotations.h"
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 59688aa..c9ebbb6 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -15,11 +15,11 @@ #include <list> #include <map> #include <memory> +#include <optional> #include <set> #include <unordered_map> #include <utility> -#include <optional> #include "base/containers/contains.h" #include "base/containers/cxx20_erase.h" #include "base/containers/flat_set.h"
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h index 8ba46f7..ac367b5a 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
@@ -9,9 +9,9 @@ #include <algorithm> #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/containers/circular_deque.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h"
diff --git a/gpu/command_buffer/service/shared_context_state.h b/gpu/command_buffer/service/shared_context_state.h index 7fa1ad0..00e054c 100644 --- a/gpu/command_buffer/service/shared_context_state.h +++ b/gpu/command_buffer/service/shared_context_state.h
@@ -6,9 +6,9 @@ #define GPU_COMMAND_BUFFER_SERVICE_SHARED_CONTEXT_STATE_H_ #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/containers/lru_cache.h" #include "base/memory/memory_pressure_listener.h" #include "base/memory/raw_ptr.h"
diff --git a/gpu/command_buffer/service/shared_image/android_video_image_backing.h b/gpu/command_buffer/service/shared_image/android_video_image_backing.h index 0908ec49..0f5c2e2 100644 --- a/gpu/command_buffer/service/shared_image/android_video_image_backing.h +++ b/gpu/command_buffer/service/shared_image/android_video_image_backing.h
@@ -6,8 +6,8 @@ #define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_ANDROID_VIDEO_IMAGE_BACKING_H_ #include <memory> - #include <optional> + #include "gpu/command_buffer/service/shared_image/android_image_backing.h" #include "gpu/gpu_gles2_export.h" #include "gpu/ipc/common/vulkan_ycbcr_info.h"
diff --git a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.h b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.h index 6cc1e4a..c0f0041 100644 --- a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.h +++ b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.h
@@ -11,8 +11,8 @@ #include <wrl/client.h> #include <memory> - #include <optional> + #include "gpu/command_buffer/service/shared_image/shared_image_backing_factory.h" #include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h" #include "gpu/gpu_gles2_export.h"
diff --git a/gpu/command_buffer/service/shared_image/egl_image_backing.cc b/gpu/command_buffer/service/shared_image/egl_image_backing.cc index 7b576877..684962b 100644 --- a/gpu/command_buffer/service/shared_image/egl_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/egl_image_backing.cc
@@ -5,6 +5,7 @@ #include "gpu/command_buffer/service/shared_image/egl_image_backing.h" #include <optional> + #include "base/memory/raw_ptr.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/shared_context_state.h"
diff --git a/gpu/command_buffer/service/shared_image/ozone_image_backing_factory.h b/gpu/command_buffer/service/shared_image/ozone_image_backing_factory.h index 01c6880f..29f2dcf1 100644 --- a/gpu/command_buffer/service/shared_image/ozone_image_backing_factory.h +++ b/gpu/command_buffer/service/shared_image/ozone_image_backing_factory.h
@@ -6,6 +6,7 @@ #define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_OZONE_IMAGE_BACKING_FACTORY_H_ #include <optional> + #include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h"
diff --git a/gpu/command_buffer/service/shared_image/raw_draw_image_backing.h b/gpu/command_buffer/service/shared_image/raw_draw_image_backing.h index 5df56d8..e56949c 100644 --- a/gpu/command_buffer/service/shared_image/raw_draw_image_backing.h +++ b/gpu/command_buffer/service/shared_image/raw_draw_image_backing.h
@@ -6,6 +6,7 @@ #define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_RAW_DRAW_IMAGE_BACKING_H_ #include <optional> + #include "base/functional/callback.h" #include "base/thread_annotations.h" #include "base/threading/thread_checker.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_image_backing.h b/gpu/command_buffer/service/shared_image/shared_image_backing.h index 009f7e78..53a649a0 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_backing.h +++ b/gpu/command_buffer/service/shared_image/shared_image_backing.h
@@ -8,8 +8,8 @@ #include <dawn/webgpu_cpp.h> #include <memory> - #include <optional> + #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/metrics/histogram_macros.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_image_gl_utils.h b/gpu/command_buffer/service/shared_image/shared_image_gl_utils.h index 3cc954ab..5c30f75 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_gl_utils.h +++ b/gpu/command_buffer/service/shared_image/shared_image_gl_utils.h
@@ -6,6 +6,7 @@ #define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_SHARED_IMAGE_GL_UTILS_H_ #include <optional> + #include "base/memory/raw_ptr.h" #include "gpu/command_buffer/service/texture_manager.h" #include "ui/gl/gl_utils.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_image_manager.h b/gpu/command_buffer/service/shared_image/shared_image_manager.h index c0587288..e25ef5c 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_manager.h +++ b/gpu/command_buffer/service/shared_image/shared_image_manager.h
@@ -6,6 +6,7 @@ #define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_SHARED_IMAGE_MANAGER_H_ #include <optional> + #include "base/containers/flat_set.h" #include "base/memory/scoped_refptr.h" #include "base/synchronization/lock.h"
diff --git a/gpu/command_buffer/service/skia_utils.h b/gpu/command_buffer/service/skia_utils.h index 7d52d2b..3f3a9d5 100644 --- a/gpu/command_buffer/service/skia_utils.h +++ b/gpu/command_buffer/service/skia_utils.h
@@ -6,6 +6,7 @@ #define GPU_COMMAND_BUFFER_SERVICE_SKIA_UTILS_H_ #include <optional> + #include "base/functional/callback_forward.h" #include "gpu/config/gpu_driver_bug_workarounds.h" #include "gpu/config/gpu_preferences.h"
diff --git a/gpu/command_buffer/service/webgpu_decoder.h b/gpu/command_buffer/service/webgpu_decoder.h index c292665..6bd98360 100644 --- a/gpu/command_buffer/service/webgpu_decoder.h +++ b/gpu/command_buffer/service/webgpu_decoder.h
@@ -6,6 +6,7 @@ #define GPU_COMMAND_BUFFER_SERVICE_WEBGPU_DECODER_H_ #include <optional> + #include "base/memory/raw_ptr.h" #include "gpu/command_buffer/service/common_decoder.h" #include "gpu/command_buffer/service/decoder_context.h"
diff --git a/gpu/command_buffer/service/webgpu_decoder_impl.cc b/gpu/command_buffer/service/webgpu_decoder_impl.cc index 5adfc14b..f1feb878 100644 --- a/gpu/command_buffer/service/webgpu_decoder_impl.cc +++ b/gpu/command_buffer/service/webgpu_decoder_impl.cc
@@ -11,9 +11,9 @@ #include <dawn/wire/WireServer.h> #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/auto_reset.h" #include "base/bits.h" #include "base/containers/contains.h"
diff --git a/gpu/config/device_perf_info.h b/gpu/config/device_perf_info.h index 521d251..b45f116 100644 --- a/gpu/config/device_perf_info.h +++ b/gpu/config/device_perf_info.h
@@ -7,6 +7,7 @@ #include <cstdint> #include <optional> + #include "build/build_config.h" #include "gpu/gpu_export.h"
diff --git a/gpu/config/gpu_info.h b/gpu/config/gpu_info.h index 93b3ea5..ab8467c 100644 --- a/gpu/config/gpu_info.h +++ b/gpu/config/gpu_info.h
@@ -10,10 +10,10 @@ #include <stdint.h> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/clang_profiling_buildflags.h" #include "base/containers/flat_map.h" #include "base/containers/span.h"
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc index 9a114a7..ff78764f 100644 --- a/gpu/config/gpu_info_collector.cc +++ b/gpu/config/gpu_info_collector.cc
@@ -7,11 +7,11 @@ #include <stddef.h> #include <stdint.h> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/base_paths.h" #include "base/command_line.h" #include "base/files/file_path.h"
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc index 0d2ddf424..fe8762a 100644 --- a/gpu/config/gpu_util.cc +++ b/gpu/config/gpu_util.cc
@@ -13,13 +13,14 @@ #endif // BUILDFLAG(IS_WIN) #include <vulkan/vulkan.h> + #include <memory> +#include <optional> #include <set> #include <string> #include <thread> #include <vector> -#include <optional> #include "base/base_paths.h" #include "base/command_line.h" #include "base/files/file_path.h"
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.cc b/gpu/ipc/client/command_buffer_proxy_impl.cc index 23619f17..ebc60c9b 100644 --- a/gpu/ipc/client/command_buffer_proxy_impl.cc +++ b/gpu/ipc/client/command_buffer_proxy_impl.cc
@@ -5,8 +5,8 @@ #include "gpu/ipc/client/command_buffer_proxy_impl.h" #include <memory> - #include <optional> + #include "base/command_line.h" #include "base/functional/bind.h" #include "base/functional/callback.h"
diff --git a/gpu/ipc/common/gpu_info_mojom_traits.h b/gpu/ipc/common/gpu_info_mojom_traits.h index 33ea2f0..0735a5e 100644 --- a/gpu/ipc/common/gpu_info_mojom_traits.h +++ b/gpu/ipc/common/gpu_info_mojom_traits.h
@@ -6,6 +6,7 @@ #define GPU_IPC_COMMON_GPU_INFO_MOJOM_TRAITS_H_ #include <optional> + #include "base/time/time.h" #include "build/build_config.h" #include "gpu/config/gpu_info.h"
diff --git a/gpu/ipc/in_process_command_buffer.h b/gpu/ipc/in_process_command_buffer.h index 13eabcd..cb81ef32aa 100644 --- a/gpu/ipc/in_process_command_buffer.h +++ b/gpu/ipc/in_process_command_buffer.h
@@ -10,10 +10,10 @@ #include <map> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/compiler_specific.h" #include "base/functional/callback.h" #include "base/functional/callback_helpers.h"
diff --git a/gpu/ipc/service/command_buffer_stub.h b/gpu/ipc/service/command_buffer_stub.h index 445beed..66e81c6 100644 --- a/gpu/ipc/service/command_buffer_stub.h +++ b/gpu/ipc/service/command_buffer_stub.h
@@ -9,10 +9,10 @@ #include <stdint.h> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/raw_ref.h"
diff --git a/gpu/ipc/service/gpu_channel.h b/gpu/ipc/service/gpu_channel.h index be8fbf3a..3869a06 100644 --- a/gpu/ipc/service/gpu_channel.h +++ b/gpu/ipc/service/gpu_channel.h
@@ -9,9 +9,9 @@ #include <stdint.h> #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/containers/flat_map.h" #include "base/functional/callback.h" #include "base/memory/raw_ptr.h"
diff --git a/gpu/ipc/service/gpu_channel_manager.h b/gpu/ipc/service/gpu_channel_manager.h index 7201816..6435468 100644 --- a/gpu/ipc/service/gpu_channel_manager.h +++ b/gpu/ipc/service/gpu_channel_manager.h
@@ -8,10 +8,10 @@ #include <stdint.h> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/containers/flat_map.h" #include "base/memory/memory_pressure_listener.h" #include "base/memory/raw_ptr.h"
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc index 5466e02..8d119c3 100644 --- a/gpu/ipc/service/gpu_init.cc +++ b/gpu/ipc/service/gpu_init.cc
@@ -5,9 +5,9 @@ #include "gpu/ipc/service/gpu_init.h" #include <cstdlib> +#include <optional> #include <string> -#include <optional> #include "base/base_paths.h" #include "base/command_line.h" #include "base/files/file_path.h"
diff --git a/gpu/ipc/service/gpu_init.h b/gpu/ipc/service/gpu_init.h index b65c831..198b439 100644 --- a/gpu/ipc/service/gpu_init.h +++ b/gpu/ipc/service/gpu_init.h
@@ -6,6 +6,7 @@ #define GPU_IPC_SERVICE_GPU_INIT_H_ #include <optional> + #include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "gpu/config/device_perf_info.h"
diff --git a/gpu/ipc/service/image_decode_accelerator_stub.cc b/gpu/ipc/service/image_decode_accelerator_stub.cc index ff185073..50ca122 100644 --- a/gpu/ipc/service/image_decode_accelerator_stub.cc +++ b/gpu/ipc/service/image_decode_accelerator_stub.cc
@@ -8,10 +8,10 @@ #include <algorithm> #include <new> +#include <optional> #include <utility> #include <vector> -#include <optional> #include "base/containers/span.h" #include "base/feature_list.h" #include "base/functional/bind.h"
diff --git a/gpu/vulkan/tests/vulkan_test.cc b/gpu/vulkan/tests/vulkan_test.cc index b7030cfb..71041dd 100644 --- a/gpu/vulkan/tests/vulkan_test.cc +++ b/gpu/vulkan/tests/vulkan_test.cc
@@ -3,8 +3,8 @@ // found in the LICENSE file. #include <memory> - #include <optional> + #include "gpu/vulkan/tests/basic_vulkan_test.h" #include "gpu/vulkan/vulkan_command_buffer.h" #include "gpu/vulkan/vulkan_command_pool.h"
diff --git a/gpu/vulkan/vulkan_image.cc b/gpu/vulkan/vulkan_image.cc index b9a09c5..679d312 100644 --- a/gpu/vulkan/vulkan_image.cc +++ b/gpu/vulkan/vulkan_image.cc
@@ -7,8 +7,8 @@ #include <vulkan/vulkan.h> #include <algorithm> - #include <optional> + #include "base/logging.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h"
diff --git a/gpu/vulkan/vulkan_image.h b/gpu/vulkan/vulkan_image.h index 631a18691..b519ddd 100644 --- a/gpu/vulkan/vulkan_image.h +++ b/gpu/vulkan/vulkan_image.h
@@ -8,9 +8,9 @@ #include <vulkan/vulkan_core.h> #include <array> +#include <optional> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/files/scoped_file.h" #include "base/memory/raw_ptr.h"
diff --git a/gpu/vulkan/vulkan_memory.cc b/gpu/vulkan/vulkan_memory.cc index 18b7a703..f8d02f3 100644 --- a/gpu/vulkan/vulkan_memory.cc +++ b/gpu/vulkan/vulkan_memory.cc
@@ -7,6 +7,7 @@ #include <vulkan/vulkan.h> #include <optional> + #include "base/logging.h" #include "build/build_config.h" #include "gpu/vulkan/vulkan_device_queue.h"
diff --git a/gpu/vulkan/vulkan_swap_chain.h b/gpu/vulkan/vulkan_swap_chain.h index 0c166f5..59f29d8 100644 --- a/gpu/vulkan/vulkan_swap_chain.h +++ b/gpu/vulkan/vulkan_swap_chain.h
@@ -8,9 +8,9 @@ #include <vulkan/vulkan_core.h> #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/containers/circular_deque.h" #include "base/functional/callback.h"
diff --git a/headless/lib/browser/headless_browser_context_options.h b/headless/lib/browser/headless_browser_context_options.h index a9509f04..de15d25 100644 --- a/headless/lib/browser/headless_browser_context_options.h +++ b/headless/lib/browser/headless_browser_context_options.h
@@ -5,9 +5,9 @@ #ifndef HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_OPTIONS_H_ #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_OPTIONS_H_ +#include <optional> #include <string> -#include <optional> #include "base/files/file_path.h" #include "base/memory/raw_ptr.h" #include "headless/public/headless_browser.h"
diff --git a/headless/lib/browser/protocol/page_handler.cc b/headless/lib/browser/protocol/page_handler.cc index 24edefb..92352564 100644 --- a/headless/lib/browser/protocol/page_handler.cc +++ b/headless/lib/browser/protocol/page_handler.cc
@@ -9,6 +9,7 @@ #if BUILDFLAG(ENABLE_PRINTING) #include <optional> + #include "components/printing/browser/print_to_pdf/pdf_print_utils.h" #endif
diff --git a/headless/lib/headless_content_main_delegate.h b/headless/lib/headless_content_main_delegate.h index ccaf7a3..0938735 100644 --- a/headless/lib/headless_content_main_delegate.h +++ b/headless/lib/headless_content_main_delegate.h
@@ -6,9 +6,9 @@ #define HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ #include <memory> +#include <optional> #include <string> -#include <optional> #include "build/build_config.h" #include "content/public/app/content_main_delegate.h" #include "content/public/browser/content_browser_client.h"
diff --git a/headless/test/headless_browser_test_utils.cc b/headless/test/headless_browser_test_utils.cc index 542ef6c..68a5db4 100644 --- a/headless/test/headless_browser_test_utils.cc +++ b/headless/test/headless_browser_test_utils.cc
@@ -5,6 +5,7 @@ #include "headless/test/headless_browser_test_utils.h" #include <optional> + #include "base/functional/bind.h" #include "base/json/json_writer.h" #include "base/logging.h"
diff --git a/headless/test/headless_printtopdf_browsertest.cc b/headless/test/headless_printtopdf_browsertest.cc index 76b2815..a4ee7ce 100644 --- a/headless/test/headless_printtopdf_browsertest.cc +++ b/headless/test/headless_printtopdf_browsertest.cc
@@ -3,10 +3,10 @@ // found in the LICENSE file. #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/base64.h" #include "base/command_line.h" #include "base/functional/bind.h"
diff --git a/headless/test/headless_web_contents_browsertest.cc b/headless/test/headless_web_contents_browsertest.cc index d525b885..11e17f4 100644 --- a/headless/test/headless_web_contents_browsertest.cc +++ b/headless/test/headless_web_contents_browsertest.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 "headless/public/headless_web_contents.h" + #include <memory> #include <optional> #include <string> @@ -26,7 +28,6 @@ #include "content/public/test/browser_test.h" #include "headless/lib/browser/headless_web_contents_impl.h" #include "headless/public/headless_browser.h" -#include "headless/public/headless_web_contents.h" #include "headless/test/headless_browser_test.h" #include "headless/test/headless_browser_test_utils.h" #include "headless/test/headless_devtooled_browsertest.h"
diff --git a/infra/config/generated/testing/test_suites.pyl b/infra/config/generated/testing/test_suites.pyl index 75ea1c3..1856283 100644 --- a/infra/config/generated/testing/test_suites.pyl +++ b/infra/config/generated/testing/test_suites.pyl
@@ -7965,6 +7965,21 @@ }, }, + 'optimization_guide_desktop_gtests': { + 'optimization_guide_gpu_gtests': {}, + 'optimization_guide_nogpu_gtests': {}, + }, + + 'optimization_guide_desktop_script_tests': { + 'model_validation_tests': { + 'variants': [ + 'MODEL_VALIDATION_BASE', + 'MODEL_VALIDATION_TRUNK', + ], + }, + 'ondevice_stability_tests': {}, + }, + 'optimization_guide_linux_gtests': { 'optimization_guide_gpu_gtests': { 'variants': [ @@ -7997,21 +8012,6 @@ }, }, - 'optimization_guide_mac_gtests': { - 'optimization_guide_gpu_gtests': {}, - 'optimization_guide_nogpu_gtests': {}, - }, - - 'optimization_guide_mac_script_tests': { - 'model_validation_tests': { - 'variants': [ - 'MODEL_VALIDATION_BASE', - 'MODEL_VALIDATION_TRUNK', - ], - }, - 'ondevice_stability_tests': {}, - }, - 'optimization_guide_win_gtests': { 'optimization_guide_gpu_gtests': { 'variants': [
diff --git a/infra/config/generated/testing/variants.pyl b/infra/config/generated/testing/variants.pyl index 89c62e4..b216ae7 100644 --- a/infra/config/generated/testing/variants.pyl +++ b/infra/config/generated/testing/variants.pyl
@@ -307,16 +307,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 124.0.6329.0', + 'description': 'Run with ash-chrome version 124.0.6330.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v124.0.6329.0', - 'revision': 'version:124.0.6329.0', + 'location': 'lacros_version_skew_tests_v124.0.6330.0', + 'revision': 'version:124.0.6330.0', }, ], },
diff --git a/infra/config/lib/targets-internal/common.star b/infra/config/lib/targets-internal/common.star index bd1d27529..e1a8ce4a 100644 --- a/infra/config/lib/targets-internal/common.star +++ b/infra/config/lib/targets-internal/common.star
@@ -83,29 +83,53 @@ graph.add_edge(key, _targets_nodes.BUNDLE.key(t)) return key -def _create_test(*, name, spec_type, spec_value): +def _create_test(*, name, spec_handler, spec_value): return _create_bundle( name = name, test_spec_by_name = { name: struct( - spec_type = spec_type, + handler = spec_handler, spec_value = spec_value, ), }, ) -def _spec_type(*, finalize): +def _spec_handler(*, finalize): + """Create a spec handler for a target type. + + The spec handler is responsible for producing the final value of the spec + once all mixins have been applied. + + Args: + finalize: Produce the final value of a spec for a target. The function + will be passed the name of the test and the spec value that has been + modified by all applicable mixins. The function should return a + 3-tuple: + * The test_suites key that the spec should be added to in the output + json file (one of "gtest_tests", "isolated_scripts", + "junit_tests", "scripts" or "skylab_tests"). + * The sort key used to order tests for a given test_suites key. The + format is up to the spec handler, but all sort keys for a given + test_suites key must be comparable. + * The final value of the spec. This must be some object that can be + encoded to json with json.encode + (https://chromium.googlesource.com/infra/luci/luci-go/+/refs/heads/main/lucicfg/doc/README.md#json.encode). + + Returns: + An object that can be passed to the spec_handler argument of + common.create_test. + """ return struct( finalize = finalize, ) # TODO: crbug.com/1420012 - Update the handling of unimplemented test types so # that more context is provided about where the error is resulting from -def _spec_type_for_unimplemented_target_type(type_name): +def _spec_handler_for_unimplemented_target_type(type_name): def unimplemented(): fail("support for {} targets is not yet implemented".format(type_name)) - return _spec_type( + return _spec_handler( finalize = (lambda name, spec: unimplemented()), ) @@ -119,6 +143,6 @@ create_bundle = _create_bundle, # Functions for defining target spec types - spec_type = _spec_type, - spec_type_for_unimplemented_target_type = _spec_type_for_unimplemented_target_type, + spec_handler = _spec_handler, + spec_handler_for_unimplemented_target_type = _spec_handler_for_unimplemented_target_type, )
diff --git a/infra/config/lib/targets-internal/test-types/gpu_telemetry_test.star b/infra/config/lib/targets-internal/test-types/gpu_telemetry_test.star index 1b97770e..ab21978 100644 --- a/infra/config/lib/targets-internal/test-types/gpu_telemetry_test.star +++ b/infra/config/lib/targets-internal/test-types/gpu_telemetry_test.star
@@ -38,6 +38,6 @@ ) _targets_common.create_test( name = name, - spec_type = _targets_common.spec_type_for_unimplemented_target_type("gpu_telemetry_test"), + spec_handler = _targets_common.spec_handler_for_unimplemented_target_type("gpu_telemetry_test"), spec_value = None, )
diff --git a/infra/config/lib/targets-internal/test-types/gtest_test.star b/infra/config/lib/targets-internal/test-types/gtest_test.star index 0d55ee62..a7a8acb 100644 --- a/infra/config/lib/targets-internal/test-types/gtest_test.star +++ b/infra/config/lib/targets-internal/test-types/gtest_test.star
@@ -39,6 +39,6 @@ _targets_common.create_test( name = name, - spec_type = _targets_common.spec_type_for_unimplemented_target_type("gtest_test"), + spec_handler = _targets_common.spec_handler_for_unimplemented_target_type("gtest_test"), spec_value = None, )
diff --git a/infra/config/lib/targets-internal/test-types/isolated_script_test.star b/infra/config/lib/targets-internal/test-types/isolated_script_test.star index bb22820..c5f2794 100644 --- a/infra/config/lib/targets-internal/test-types/isolated_script_test.star +++ b/infra/config/lib/targets-internal/test-types/isolated_script_test.star
@@ -39,6 +39,6 @@ _targets_common.create_test( name = name, - spec_type = _targets_common.spec_type_for_unimplemented_target_type("isolated_script_test"), + spec_handler = _targets_common.spec_handler_for_unimplemented_target_type("isolated_script_test"), spec_value = None, )
diff --git a/infra/config/lib/targets-internal/test-types/junit_test.star b/infra/config/lib/targets-internal/test-types/junit_test.star index 67a68133..7db1e20 100644 --- a/infra/config/lib/targets-internal/test-types/junit_test.star +++ b/infra/config/lib/targets-internal/test-types/junit_test.star
@@ -43,6 +43,6 @@ _targets_common.create_test( name = name, - spec_type = _targets_common.spec_type_for_unimplemented_target_type("junit_test"), + spec_handler = _targets_common.spec_handler_for_unimplemented_target_type("junit_test"), spec_value = None, )
diff --git a/infra/config/lib/targets-internal/test-types/script_test.star b/infra/config/lib/targets-internal/test-types/script_test.star index bac218b6..08988cd 100644 --- a/infra/config/lib/targets-internal/test-types/script_test.star +++ b/infra/config/lib/targets-internal/test-types/script_test.star
@@ -6,7 +6,7 @@ load("../common.star", _targets_common = "common") -_script_test_target_type = _targets_common.spec_type( +_script_test_spec_handler = _targets_common.spec_handler( finalize = (lambda name, spec: ("scripts", name, spec)), ) @@ -33,7 +33,7 @@ _targets_common.create_test( name = name, - spec_type = _script_test_target_type, + spec_handler = _script_test_spec_handler, spec_value = dict( name = name, script = script,
diff --git a/infra/config/lib/targets.star b/infra/config/lib/targets.star index d7014db..d7a9b81 100644 --- a/infra/config/lib/targets.star +++ b/infra/config/lib/targets.star
@@ -945,7 +945,7 @@ additional_compile_targets, test_spec_by_name = bundle_resolver(bundle_node) sort_key_and_specs_by_type_key = {} for name, spec in test_spec_by_name.items(): - type_key, sort_key, spec = spec.spec_type.finalize(name, spec.spec_value) + type_key, sort_key, spec = spec.handler.finalize(name, spec.spec_value) sort_key_and_specs_by_type_key.setdefault(type_key, []).append((sort_key, spec)) specs_by_type_key = {}
diff --git a/infra/config/targets/lacros-version-skew-variants.json b/infra/config/targets/lacros-version-skew-variants.json index 4d5e7cb..2c32d4f 100644 --- a/infra/config/targets/lacros-version-skew-variants.json +++ b/infra/config/targets/lacros-version-skew-variants.json
@@ -1,16 +1,16 @@ { "LACROS_VERSION_SKEW_CANARY": { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "identifier": "Lacros version skew testing ash canary", "swarming": { "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ] }
diff --git a/infra/config/targets/matrix_compound_suites.star b/infra/config/targets/matrix_compound_suites.star index 4f64d74..816088c 100644 --- a/infra/config/targets/matrix_compound_suites.star +++ b/infra/config/targets/matrix_compound_suites.star
@@ -1367,6 +1367,27 @@ ) targets.legacy_matrix_compound_suite( + name = "optimization_guide_desktop_gtests", + basic_suites = { + "optimization_guide_nogpu_gtests": None, + "optimization_guide_gpu_gtests": None, + }, +) + +targets.legacy_matrix_compound_suite( + name = "optimization_guide_desktop_script_tests", + basic_suites = { + "model_validation_tests": targets.legacy_matrix_config( + variants = [ + "MODEL_VALIDATION_BASE", + "MODEL_VALIDATION_TRUNK", + ], + ), + "ondevice_stability_tests": None, + }, +) + +targets.legacy_matrix_compound_suite( name = "optimization_guide_linux_gtests", basic_suites = { "optimization_guide_nogpu_gtests": targets.legacy_matrix_config( @@ -1406,27 +1427,6 @@ ) targets.legacy_matrix_compound_suite( - name = "optimization_guide_mac_gtests", - basic_suites = { - "optimization_guide_nogpu_gtests": None, - "optimization_guide_gpu_gtests": None, - }, -) - -targets.legacy_matrix_compound_suite( - name = "optimization_guide_mac_script_tests", - basic_suites = { - "model_validation_tests": targets.legacy_matrix_config( - variants = [ - "MODEL_VALIDATION_BASE", - "MODEL_VALIDATION_TRUNK", - ], - ), - "ondevice_stability_tests": None, - }, -) - -targets.legacy_matrix_compound_suite( name = "optimization_guide_win_gtests", basic_suites = { "optimization_guide_nogpu_gtests": targets.legacy_matrix_config(
diff --git a/infra/inclusive_language_presubmit_exempt_dirs.txt b/infra/inclusive_language_presubmit_exempt_dirs.txt index 08600e3..81aa3b6e 100644 --- a/infra/inclusive_language_presubmit_exempt_dirs.txt +++ b/infra/inclusive_language_presubmit_exempt_dirs.txt
@@ -699,7 +699,6 @@ third_party/rust/chromium_crates_io/vendor/rand_core-0.6.4 4 1 third_party/rust/chromium_crates_io/vendor/rand_core-0.6.4/src 3 1 third_party/rust/chromium_crates_io/vendor/rand_pcg-0.3.1 4 1 -third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables 2 1 third_party/rust/chromium_crates_io/vendor/regex-1.10.3 1 1 third_party/rust/chromium_crates_io/vendor/regex-1.10.3/src 1 1 third_party/rust/chromium_crates_io/vendor/regex-1.10.3/tests 7 6
diff --git a/internal b/internal index 3ef0a2c..ee061f4 160000 --- a/internal +++ b/internal
@@ -1 +1 @@ -Subproject commit 3ef0a2c8fc674eb40881314fef93f2de913accbd +Subproject commit ee061f481382201645e2569b5cfb8bc70f5685ef
diff --git a/ios/chrome/browser/default_browser/model/utils.h b/ios/chrome/browser/default_browser/model/utils.h index caf378b..b4f93c7d 100644 --- a/ios/chrome/browser/default_browser/model/utils.h +++ b/ios/chrome/browser/default_browser/model/utils.h
@@ -192,6 +192,10 @@ // non-modal promo before. NSInteger UserInteractionWithNonModalPromoCount(); +// Returns the number of times a fullscreen default browser promo has been +// displayed. +NSInteger DisplayedFullscreenPromoCount(); + // Logs that one of the fullscreen default browser promos was displayed. void LogFullscreenDefaultBrowserPromoDisplayed(); @@ -201,8 +205,13 @@ // Logs that the user has interacted with a Tailored Fullscreen Promo. void LogUserInteractionWithTailoredFullscreenPromo(); -// Logs that the user has interacted with a Non-Modals Promo. -void LogUserInteractionWithNonModalPromo(); +// Logs that the user has interacted with a non-modal promo. The expected +// parameters are the current counts, because they will be incremented by 1 and +// then saved to NSUserDefaults. If kNonModalDefaultBrowserPromoCooldownRefactor +// is disabled, kDisplayedFullscreenPromoCount will also be incremented by 1. +void LogUserInteractionWithNonModalPromo( + NSInteger currentNonModalPromoInteractionsCount, + NSInteger currentFullscreenPromoInteractionsCount); // Logs that the user has interacted with the first run promo. void LogUserInteractionWithFirstRunPromo(BOOL openedSettings);
diff --git a/ios/chrome/browser/default_browser/model/utils.mm b/ios/chrome/browser/default_browser/model/utils.mm index 4207c62..896804c 100644 --- a/ios/chrome/browser/default_browser/model/utils.mm +++ b/ios/chrome/browser/default_browser/model/utils.mm
@@ -382,14 +382,6 @@ return number.boolValue; } -// Returns the number of times a fullscreen default browser promo has been -// displayed. -NSInteger DisplayedFullscreenPromoCount() { - NSNumber* number = - GetObjectFromStorageForKey<NSNumber>(kDisplayedFullscreenPromoCount); - return number.integerValue; -} - // Returns the number of time the fullscreen default browser promo has been // displayed. NSInteger GenericPromoInteractionCount() { @@ -645,6 +637,12 @@ return number.integerValue; } +NSInteger DisplayedFullscreenPromoCount() { + NSNumber* number = + GetObjectFromStorageForKey<NSNumber>(kDisplayedFullscreenPromoCount); + return number.integerValue; +} + void LogFullscreenDefaultBrowserPromoDisplayed() { const NSInteger displayed_promo_count = DisplayedFullscreenPromoCount(); NSDictionary<NSString*, NSObject*>* update = @{ @@ -676,20 +674,22 @@ }); } -void LogUserInteractionWithNonModalPromo() { - const NSInteger interaction_count = UserInteractionWithNonModalPromoCount(); - +void LogUserInteractionWithNonModalPromo( + NSInteger currentNonModalPromoInteractionsCount, + NSInteger currentFullscreenPromoInteractionsCount) { if (IsNonModalDefaultBrowserPromoCooldownRefactorEnabled()) { UpdateStorageWithDictionary(@{ kLastTimeUserInteractedWithNonModalPromo : [NSDate date], - kUserInteractedWithNonModalPromoCount : @(interaction_count + 1), + kUserInteractedWithNonModalPromoCount : + @(currentNonModalPromoInteractionsCount + 1), }); } else { - const NSInteger displayed_promo_count = DisplayedFullscreenPromoCount(); UpdateStorageWithDictionary(@{ kLastTimeUserInteractedWithFullscreenPromo : [NSDate date], - kUserInteractedWithNonModalPromoCount : @(interaction_count + 1), - kDisplayedFullscreenPromoCount : @(displayed_promo_count + 1), + kUserInteractedWithNonModalPromoCount : + @(currentNonModalPromoInteractionsCount + 1), + kDisplayedFullscreenPromoCount : + @(currentFullscreenPromoInteractionsCount + 1), }); } }
diff --git a/ios/chrome/browser/default_browser/model/utils_unittest.mm b/ios/chrome/browser/default_browser/model/utils_unittest.mm index d90c30b..016c1c2 100644 --- a/ios/chrome/browser/default_browser/model/utils_unittest.mm +++ b/ios/chrome/browser/default_browser/model/utils_unittest.mm
@@ -170,12 +170,14 @@ EXPECT_FALSE(UserInFullscreenPromoCooldown()); - LogUserInteractionWithNonModalPromo(); + LogUserInteractionWithNonModalPromo(UserInteractionWithNonModalPromoCount(), + DisplayedFullscreenPromoCount()); EXPECT_TRUE(UserInFullscreenPromoCooldown()); ClearDefaultBrowserPromoData(); LogUserInteractionWithTailoredFullscreenPromo(); - LogUserInteractionWithNonModalPromo(); + LogUserInteractionWithNonModalPromo(UserInteractionWithNonModalPromoCount(), + DisplayedFullscreenPromoCount()); EXPECT_TRUE(UserInFullscreenPromoCooldown()); } @@ -211,12 +213,14 @@ EXPECT_FALSE(UserInNonModalPromoCooldown()); - LogUserInteractionWithNonModalPromo(); + LogUserInteractionWithNonModalPromo(UserInteractionWithNonModalPromoCount(), + DisplayedFullscreenPromoCount()); EXPECT_EQ(UserInteractionWithNonModalPromoCount(), 1); EXPECT_TRUE(UserInNonModalPromoCooldown()); EXPECT_FALSE(UserInFullscreenPromoCooldown()); - LogUserInteractionWithNonModalPromo(); + LogUserInteractionWithNonModalPromo(UserInteractionWithNonModalPromoCount(), + DisplayedFullscreenPromoCount()); EXPECT_EQ(UserInteractionWithNonModalPromoCount(), 2); EXPECT_TRUE(UserInNonModalPromoCooldown()); EXPECT_FALSE(UserInFullscreenPromoCooldown()); @@ -232,17 +236,37 @@ EXPECT_FALSE(UserInNonModalPromoCooldown()); - LogUserInteractionWithNonModalPromo(); + LogUserInteractionWithNonModalPromo(UserInteractionWithNonModalPromoCount(), + DisplayedFullscreenPromoCount()); EXPECT_EQ(UserInteractionWithNonModalPromoCount(), 1); EXPECT_TRUE(UserInNonModalPromoCooldown()); EXPECT_TRUE(UserInFullscreenPromoCooldown()); - LogUserInteractionWithNonModalPromo(); + LogUserInteractionWithNonModalPromo(UserInteractionWithNonModalPromoCount(), + DisplayedFullscreenPromoCount()); EXPECT_EQ(UserInteractionWithNonModalPromoCount(), 2); EXPECT_TRUE(UserInNonModalPromoCooldown()); EXPECT_TRUE(UserInFullscreenPromoCooldown()); } +// Tests logging user interactions with a non-modal promo multiple times with +// the same current interactions count doesn't over-increment the value. +TEST_F(DefaultBrowserUtilsTest, + LogNonModalUserInteractionMultipleTimesSameArguments) { + feature_list_.InitWithFeatures( + {/*enabled=*/}, + {/*disabled=*/kNonModalDefaultBrowserPromoCooldownRefactor}); + + LogUserInteractionWithNonModalPromo(2, 2); + EXPECT_EQ(3, 3); + + LogUserInteractionWithNonModalPromo(2, 2); + EXPECT_EQ(3, 3); + + LogUserInteractionWithNonModalPromo(2, 2); + EXPECT_EQ(3, 3); +} + // Tests that the cooldown refactor flag is enabled. TEST_F(DefaultBrowserUtilsTest, CooldownRefactorFlagEnabled) { feature_list_.InitWithFeatures(
diff --git a/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent.mm b/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent.mm index 54d9992..6e6d438 100644 --- a/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent.mm +++ b/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent.mm
@@ -34,6 +34,8 @@ @interface NonModalDefaultBrowserPromoSchedulerSceneAgent () { __weak id<DefaultBrowserPromoNonModalCommands> _handler; + NSInteger _userInteractionWithNonModalPromoCount; + NSInteger _displayedFullscreenPromoCount; } @end @@ -68,6 +70,14 @@ } - (void)notifyHandlerShowPromo { + // The count of past non-modal promo interactions and fullscreen promo + // displays is cached because multiple interactions may be logged for the + // current non-modal promo impression. This makes sure we don't over-increment + // the interactions count value. + _userInteractionWithNonModalPromoCount = + UserInteractionWithNonModalPromoCount(); + _displayedFullscreenPromoCount = DisplayedFullscreenPromoCount(); + [_handler showDefaultBrowserNonModalPromo]; } @@ -80,7 +90,7 @@ if (currentPromoReason != PromoReasonNone && !promoIsShowing) { LogNonModalPromoAction(NonModalPromoAction::kBackgroundCancel, MetricTypeForPromoReason(currentPromoReason), - UserInteractionWithNonModalPromoCount()); + _userInteractionWithNonModalPromoCount); } [super cancelTimerAndPromoOnBackground]; } @@ -91,16 +101,17 @@ - (void)logPromoAppear:(PromoReason)currentPromoReason { LogNonModalPromoAction(NonModalPromoAction::kAppear, MetricTypeForPromoReason(currentPromoReason), - UserInteractionWithNonModalPromoCount()); + _userInteractionWithNonModalPromoCount); } - (void)logPromoAction:(PromoReason)currentPromoReason promoShownTime:(base::TimeTicks)promoShownTime { LogNonModalPromoAction(NonModalPromoAction::kAccepted, MetricTypeForPromoReason(currentPromoReason), - UserInteractionWithNonModalPromoCount()); + _userInteractionWithNonModalPromoCount); LogNonModalTimeOnScreen(promoShownTime); - LogUserInteractionWithNonModalPromo(); + LogUserInteractionWithNonModalPromo(_userInteractionWithNonModalPromoCount, + _displayedFullscreenPromoCount); NSURL* settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; [[UIApplication sharedApplication] openURL:settingsURL @@ -112,18 +123,20 @@ promoShownTime:(base::TimeTicks)promoShownTime { LogNonModalPromoAction(NonModalPromoAction::kDismiss, MetricTypeForPromoReason(currentPromoReason), - UserInteractionWithNonModalPromoCount()); + _userInteractionWithNonModalPromoCount); LogNonModalTimeOnScreen(promoShownTime); - LogUserInteractionWithNonModalPromo(); + LogUserInteractionWithNonModalPromo(_userInteractionWithNonModalPromoCount, + _displayedFullscreenPromoCount); } - (void)logPromoTimeout:(PromoReason)currentPromoReason promoShownTime:(base::TimeTicks)promoShownTime { LogNonModalPromoAction(NonModalPromoAction::kTimeout, MetricTypeForPromoReason(currentPromoReason), - UserInteractionWithNonModalPromoCount()); + _userInteractionWithNonModalPromoCount); LogNonModalTimeOnScreen(promoShownTime); - LogUserInteractionWithNonModalPromo(); + LogUserInteractionWithNonModalPromo(_userInteractionWithNonModalPromoCount, + _displayedFullscreenPromoCount); } @end
diff --git a/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent_unittest.mm b/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent_unittest.mm index 2ef5fd21..9fb065f 100644 --- a/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent_unittest.mm +++ b/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent_unittest.mm
@@ -239,6 +239,32 @@ EXPECT_EQ(UserInteractionWithNonModalPromoCount(), 1); } +// Tests that if the user manages to trigger multiple interactions, the +// interactions count is only incremented once. +TEST_F(NonModalDefaultBrowserPromoSchedulerSceneAgentTest, + TestMultipleInteractionsOnlyIncrementsCountOnce) { + [scheduler_ logUserPastedInOmnibox]; + + // Finish loading the page. + test_web_state_->SetLoading(true); + test_web_state_->OnPageLoaded(web::PageLoadCompletionStatus::SUCCESS); + test_web_state_->SetLoading(false); + + // Advance the timer by the post-load delay. This should trigger the promo. + [[promo_commands_handler_ expect] showDefaultBrowserNonModalPromo]; + task_env_.FastForwardBy(base::Seconds(3)); + + [promo_commands_handler_ verify]; + + // Attempt to log the action 3 times. + [scheduler_ logUserPerformedPromoAction]; + [scheduler_ logUserPerformedPromoAction]; + [scheduler_ logUserPerformedPromoAction]; + + // Check that NSUserDefaults has been updated, incremented only by 1. + EXPECT_EQ(UserInteractionWithNonModalPromoCount(), 1); +} + // Tests that if the user switches to a different tab before the post-load timer // finishes, the promo does not show. TEST_F(NonModalDefaultBrowserPromoSchedulerSceneAgentTest,
diff --git a/ios/chrome/browser/ui/autofill/error_dialog/BUILD.gn b/ios/chrome/browser/ui/autofill/error_dialog/BUILD.gn new file mode 100644 index 0000000..033c16b --- /dev/null +++ b/ios/chrome/browser/ui/autofill/error_dialog/BUILD.gn
@@ -0,0 +1,18 @@ +# 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. + +source_set("error_dialog") { + sources = [ + "autofill_error_dialog_coordinator.h", + "autofill_error_dialog_coordinator.mm", + ] + deps = [ + "//base:base", + "//components/autofill/core/browser", + "//ios/chrome/browser/shared/coordinator/chrome_coordinator", + "//ios/chrome/browser/shared/model/browser", + "//ios/chrome/browser/shared/public/commands", + ] + frameworks = [ "UIKit.framework" ] +}
diff --git a/ios/chrome/browser/ui/autofill/error_dialog/autofill_error_dialog_coordinator.h b/ios/chrome/browser/ui/autofill/error_dialog/autofill_error_dialog_coordinator.h new file mode 100644 index 0000000..4f09ee8e --- /dev/null +++ b/ios/chrome/browser/ui/autofill/error_dialog/autofill_error_dialog_coordinator.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 IOS_CHROME_BROWSER_UI_AUTOFILL_ERROR_DIALOG_AUTOFILL_ERROR_DIALOG_COORDINATOR_H_ +#define IOS_CHROME_BROWSER_UI_AUTOFILL_ERROR_DIALOG_AUTOFILL_ERROR_DIALOG_COORDINATOR_H_ + +#import <memory> + +#import "ios/chrome/browser/shared/coordinator/chrome_coordinator/chrome_coordinator.h" + +@protocol AutofillCommands; + +namespace autofill { +struct AutofillErrorDialogContext; +} // namespace autofill + +// The coordinator responsible for managing the autofill error dialog. This +// dialog is shown when some error/alert state should be presented. +@interface AutofillErrorDialogCoordinator : ChromeCoordinator + +// Handler for Autofill commands. +@property(nonatomic, weak) id<AutofillCommands> autofillCommandsHandler; + +- (instancetype)initWithBaseViewController:(UIViewController*)viewController + browser:(Browser*)browser + errorContext: + (autofill::AutofillErrorDialogContext) + errorContext NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithBaseViewController:(UIViewController*)viewController + browser:(Browser*)browser NS_UNAVAILABLE; + +@end + +#endif // IOS_CHROME_BROWSER_UI_AUTOFILL_ERROR_DIALOG_AUTOFILL_ERROR_DIALOG_COORDINATOR_H_
diff --git a/ios/chrome/browser/ui/autofill/error_dialog/autofill_error_dialog_coordinator.mm b/ios/chrome/browser/ui/autofill/error_dialog/autofill_error_dialog_coordinator.mm new file mode 100644 index 0000000..c9caf5f --- /dev/null +++ b/ios/chrome/browser/ui/autofill/error_dialog/autofill_error_dialog_coordinator.mm
@@ -0,0 +1,34 @@ +// 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 "ios/chrome/browser/ui/autofill/error_dialog/autofill_error_dialog_coordinator.h" + +#import <memory> + +#import "components/autofill/core/browser/payments/autofill_error_dialog_context.h" +#import "components/autofill/core/browser/ui/payments/autofill_error_dialog_controller_impl.h" +#import "ios/chrome/browser/shared/model/browser/browser.h" +#import "ios/chrome/browser/shared/public/commands/autofill_commands.h" + +@implementation AutofillErrorDialogCoordinator { + // The model layer controller. This model controller provide access to model + // data and also handles interactions. + std::unique_ptr<autofill::AutofillErrorDialogControllerImpl> _modelController; +} + +- (instancetype)initWithBaseViewController:(UIViewController*)viewController + browser:(Browser*)browser + errorContext: + (autofill::AutofillErrorDialogContext) + errorContext { + self = [super initWithBaseViewController:viewController browser:browser]; + if (self) { + _modelController = + std::make_unique<autofill::AutofillErrorDialogControllerImpl>( + std::move(errorContext)); + } + return self; +} + +@end
diff --git a/ios/chrome/browser/ui/browser_view/BUILD.gn b/ios/chrome/browser/ui/browser_view/BUILD.gn index 400e6c0b..6f0de8a 100644 --- a/ios/chrome/browser/ui/browser_view/BUILD.gn +++ b/ios/chrome/browser/ui/browser_view/BUILD.gn
@@ -132,6 +132,7 @@ "//ios/chrome/browser/ui/autofill:autofill", "//ios/chrome/browser/ui/autofill/bottom_sheet", "//ios/chrome/browser/ui/autofill/bottom_sheet:virtual_card_enrollment_bottom_sheet_coordinator", + "//ios/chrome/browser/ui/autofill/error_dialog", "//ios/chrome/browser/ui/autofill/form_input_accessory", "//ios/chrome/browser/ui/autofill/manual_fill", "//ios/chrome/browser/ui/bookmarks/home",
diff --git a/ios/chrome/browser/ui/browser_view/browser_coordinator.mm b/ios/chrome/browser/ui/browser_view/browser_coordinator.mm index a8e27ed..4b6fd64f 100644 --- a/ios/chrome/browser/ui/browser_view/browser_coordinator.mm +++ b/ios/chrome/browser/ui/browser_view/browser_coordinator.mm
@@ -133,6 +133,7 @@ #import "ios/chrome/browser/ui/authentication/signin_presenter.h" #import "ios/chrome/browser/ui/autofill/bottom_sheet/payments_suggestion_bottom_sheet_coordinator.h" #import "ios/chrome/browser/ui/autofill/bottom_sheet/virtual_card_enrollment_bottom_sheet_coordinator.h" +#import "ios/chrome/browser/ui/autofill/error_dialog/autofill_error_dialog_coordinator.h" #import "ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_coordinator.h" #import "ios/chrome/browser/ui/bookmarks/home/bookmarks_coordinator.h" @@ -389,6 +390,10 @@ @property(nonatomic, strong) EnterprisePromptCoordinator* enterprisePromptCoordinator; +// Coordinator to show the Autofill error dialog. +@property(nonatomic, strong) + AutofillErrorDialogCoordinator* autofillErrorDialogCoordinator; + // Coordinator for the find bar. @property(nonatomic, strong) FindBarCoordinator* findBarCoordinator; @@ -1239,6 +1244,9 @@ /* virtualCardEnrollmentBottomSheetCoordinator is created and started by a * BrowserCommand */ + /* autofillErrorDialogCoordinator is created and started by a BrowserCommand + */ + /* PriceNotificationsViewCoordinator is created and started by a * BrowserCommand */ @@ -1671,9 +1679,22 @@ - (void)showAutofillErrorDialog: (autofill::AutofillErrorDialogContext)errorContext { + if (self.autofillErrorDialogCoordinator) { + [self.autofillErrorDialogCoordinator stop]; + } + + self.autofillErrorDialogCoordinator = [[AutofillErrorDialogCoordinator alloc] + initWithBaseViewController:self.viewController + browser:self.browser + errorContext:std::move(errorContext)]; + self.autofillErrorDialogCoordinator.autofillCommandsHandler = + HandlerForProtocol(self.dispatcher, AutofillCommands); + [self.autofillErrorDialogCoordinator start]; } - (void)dismissAutofillErrorDialog { + [self.autofillErrorDialogCoordinator stop]; + self.autofillErrorDialogCoordinator = nil; } #pragma mark - BrowserCoordinatorCommands
diff --git a/ios/chrome/browser/ui/default_promo/default_browser_promo_non_modal_metrics_util.mm b/ios/chrome/browser/ui/default_promo/default_browser_promo_non_modal_metrics_util.mm index b8aa2a18e..06dbc403 100644 --- a/ios/chrome/browser/ui/default_promo/default_browser_promo_non_modal_metrics_util.mm +++ b/ios/chrome/browser/ui/default_promo/default_browser_promo_non_modal_metrics_util.mm
@@ -85,7 +85,8 @@ break; default: - NOTREACHED_NORETURN(); + // TODO(crbug.com/327429982): M124 validation necessary. + NOTREACHED(base::NotFatalUntil::M126); } UmaHistogramEnumeration(histogramString, action);
diff --git a/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_egtest.mm b/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_egtest.mm index 1c4c94f..c20fb9e6 100644 --- a/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_egtest.mm +++ b/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_egtest.mm
@@ -169,7 +169,7 @@ } if ([self isRunningTest:@selector - (testOpenPasswordBottomSheetWithSingleSharedPassword)] || + (DISABLED_testOpenPasswordBottomSheetWithSingleSharedPassword)] || [self isRunningTest:@selector (testOpenPasswordBottomSheetWithMultipleSharedPasswords)] || [self isRunningTest:@selector @@ -978,7 +978,8 @@ } } -- (void)testOpenPasswordBottomSheetWithSingleSharedPassword { +// TODO(crbug.com/327629133): Fix failing test (on fieldtrial bot) & re-enable. +- (void)DISABLED_testOpenPasswordBottomSheetWithSingleSharedPassword { [PasswordSuggestionBottomSheetAppInterface setUpMockReauthenticationModule]; [PasswordSuggestionBottomSheetAppInterface mockReauthenticationModuleExpectedResult:ReauthenticationResult::
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm index 17acdc0f..5f8369c9 100644 --- a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm
@@ -515,7 +515,6 @@ // Get the original value. BOOL mandatoryReauthEnabled = _personalDataManager->IsPaymentMethodsMandatoryReauthEnabled(); - CHECK_NE(mandatoryReauthEnabled, switchView.isOn); LogMandatoryReauthOptInOrOutUpdateEvent( MandatoryReauthOptInOrOutSource::kSettingsPage, /*opt_in=*/!mandatoryReauthEnabled,
diff --git a/ios/web/public/test/fakes/fake_web_state.h b/ios/web/public/test/fakes/fake_web_state.h index 56bd372..eb842bb 100644 --- a/ios/web/public/test/fakes/fake_web_state.h +++ b/ios/web/public/test/fakes/fake_web_state.h
@@ -6,7 +6,6 @@ #define IOS_WEB_PUBLIC_TEST_FAKES_FAKE_WEB_STATE_H_ #import <Foundation/Foundation.h> - #include <stdint.h> #include <memory>
diff --git a/ios/web/public/web_state.h b/ios/web/public/web_state.h index 72914b5..23d18e3c 100644 --- a/ios/web/public/web_state.h +++ b/ios/web/public/web_state.h
@@ -6,7 +6,6 @@ #define IOS_WEB_PUBLIC_WEB_STATE_H_ #import <UIKit/UIKit.h> - #include <stdint.h> #include <map>
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h index fe67eb5..f237a23 100644 --- a/ios/web/web_state/web_state_impl.h +++ b/ios/web/web_state/web_state_impl.h
@@ -6,7 +6,6 @@ #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ #import <Foundation/Foundation.h> - #include <stddef.h> #include <stdint.h>
diff --git a/ios_internal b/ios_internal index dc57479..c6c8dd8 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit dc57479f6f79fd6b1858ac34da9580fa68a3fcd9 +Subproject commit c6c8dd839bf98b445061bd6198695cbb9124b663
diff --git a/ipc/ipc_channel_mojo_unittest.cc b/ipc/ipc_channel_mojo_unittest.cc index e677693..893ebeb 100644 --- a/ipc/ipc_channel_mojo_unittest.cc +++ b/ipc/ipc_channel_mojo_unittest.cc
@@ -10,9 +10,9 @@ #include <atomic> #include <cstdint> #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/base_paths.h" #include "base/containers/queue.h" #include "base/files/file.h"
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index 8a2de76..0c908fd 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h
@@ -11,13 +11,13 @@ #include <map> #include <memory> +#include <optional> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <vector> -#include <optional> #include "base/check.h" #include "base/compiler_specific.h" #include "base/component_export.h"
diff --git a/ipc/ipc_mojo_bootstrap.cc b/ipc/ipc_mojo_bootstrap.cc index 56b59f7..951c629 100644 --- a/ipc/ipc_mojo_bootstrap.cc +++ b/ipc/ipc_mojo_bootstrap.cc
@@ -9,11 +9,11 @@ #include <map> #include <memory> +#include <optional> #include <set> #include <utility> #include <vector> -#include <optional> #include "base/check_op.h" #include "base/containers/circular_deque.h" #include "base/containers/contains.h"
diff --git a/ipc/message_mojom_traits.h b/ipc/message_mojom_traits.h index 0e71969..be5239c5 100644 --- a/ipc/message_mojom_traits.h +++ b/ipc/message_mojom_traits.h
@@ -5,9 +5,9 @@ #ifndef IPC_MESSAGE_MOJOM_TRAITS_H_ #define IPC_MESSAGE_MOJOM_TRAITS_H_ +#include <optional> #include <vector> -#include <optional> #include "base/containers/span.h" #include "ipc/ipc.mojom-shared.h" #include "ipc/message_view.h"
diff --git a/ipc/message_view.h b/ipc/message_view.h index 67f394f8..a8b43675 100644 --- a/ipc/message_view.h +++ b/ipc/message_view.h
@@ -5,9 +5,9 @@ #ifndef IPC_MESSAGE_VIEW_H_ #define IPC_MESSAGE_VIEW_H_ +#include <optional> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/containers/span.h" #include "ipc/ipc_message.h"
diff --git a/media/capture/video/file_video_capture_device.cc b/media/capture/video/file_video_capture_device.cc index dd7af09f..d096039 100644 --- a/media/capture/video/file_video_capture_device.cc +++ b/media/capture/video/file_video_capture_device.cc
@@ -5,10 +5,10 @@ #include "media/capture/video/file_video_capture_device.h" #include <stddef.h> -#include <optional> #include <algorithm> #include <memory> +#include <optional> #include <utility> #include "base/functional/bind.h"
diff --git a/mojo/core/embedder/embedder.cc b/mojo/core/embedder/embedder.cc index 44651b6..dca56dd 100644 --- a/mojo/core/embedder/embedder.cc +++ b/mojo/core/embedder/embedder.cc
@@ -5,6 +5,7 @@ #include "mojo/core/embedder/embedder.h" #include <stdint.h> + #include <atomic> #include <optional> #include <string>
diff --git a/mojo/core/invitation_unittest.cc b/mojo/core/invitation_unittest.cc index 0510fe0..92b57bd 100644 --- a/mojo/core/invitation_unittest.cc +++ b/mojo/core/invitation_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 "mojo/public/c/system/invitation.h" + #include <cstdint> #include <cstring> #include <optional> @@ -37,7 +39,6 @@ #include "mojo/core/node_controller.h" #include "mojo/core/test/mojo_test_base.h" #include "mojo/core/test/test_switches.h" -#include "mojo/public/c/system/invitation.h" #include "mojo/public/cpp/platform/named_platform_channel.h" #include "mojo/public/cpp/platform/platform_channel.h" #include "mojo/public/cpp/system/invitation.h"
diff --git a/mojo/public/cpp/base/BUILD.gn b/mojo/public/cpp/base/BUILD.gn index 29ae1741..162da0891 100644 --- a/mojo/public/cpp/base/BUILD.gn +++ b/mojo/public/cpp/base/BUILD.gn
@@ -12,6 +12,8 @@ "big_buffer.h", "shared_memory_utils.cc", "shared_memory_utils.h", + "shared_memory_version.cc", + "shared_memory_version.h", ] configs += [ "//build/config/compiler:wexit_time_destructors" ] @@ -152,6 +154,7 @@ "ref_counted_memory_unittest.cc", "safe_base_name_unittest.cc", "shared_memory_unittest.cc", + "shared_memory_version_unittest.cc", "string16_unittest.cc", "text_direction_unittest.cc", "thread_type_unittest.cc",
diff --git a/mojo/public/cpp/base/shared_memory_version.cc b/mojo/public/cpp/base/shared_memory_version.cc new file mode 100644 index 0000000..5bca8ba2 --- /dev/null +++ b/mojo/public/cpp/base/shared_memory_version.cc
@@ -0,0 +1,99 @@ +// 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 <limits> + +#include "mojo/public/cpp/base/shared_memory_version.h" + +#include "base/check_op.h" +#include "base/logging.h" +#include "base/memory/read_only_shared_memory_region.h" +#include "base/memory/shared_memory_mapping.h" +#include "shared_memory_version.h" + +namespace mojo { + +namespace { + +template <typename MemoryMapping> +VersionType GetSharedVersionHelper(const MemoryMapping& mapping) { + CHECK(mapping.IsValid()); + + // Relaxed memory order since only the version is stored within the region + // and as such is the only data shared between processes. There is no + // re-ordering to worry about. + return mapping.template GetMemoryAs<SharedVersionType>()->load( + std::memory_order_relaxed); +} + +} // namespace + +SharedMemoryVersionController::SharedMemoryVersionController() { + // Create a shared memory region and immediately populate it. + mapped_region_ = + base::ReadOnlySharedMemoryRegion::Create(sizeof(SharedVersionType)); + CHECK(mapped_region_.IsValid()); + new (mapped_region_.mapping.memory()) SharedVersionType; + + // Clients may use `kInvalidVersion` as special value to indicate the version + // in the absence of shared memory communication. Make sure the version starts + // at `kInitialVersion` to avoid any confusion. Relaxed memory order because + // no other memory operation depends on the version + mapped_region_.mapping.GetMemoryAs<SharedVersionType>()->store( + shared_memory_version::kInitialVersion, std::memory_order_relaxed); +} + +base::ReadOnlySharedMemoryRegion +SharedMemoryVersionController::GetSharedMemoryRegion() { + CHECK(mapped_region_.IsValid()); + return mapped_region_.region.Duplicate(); +} + +VersionType SharedMemoryVersionController::GetSharedVersion() { + return GetSharedVersionHelper(mapped_region_.region.Map()); +} + +void SharedMemoryVersionController::Increment() { + CHECK(mapped_region_.IsValid()); + + // Relaxed memory order because no other memory operation depends on the + // version. + const VersionType version = + mapped_region_.mapping.GetMemoryAs<SharedVersionType>()->fetch_add( + 1, std::memory_order_relaxed); + + // The version wrapping around is not supported and should not happen. + CHECK_LE(version, std::numeric_limits<VersionType>::max()); +} + +SharedMemoryVersionClient::SharedMemoryVersionClient( + base::ReadOnlySharedMemoryRegion shared_region) { + shared_region_ = std::move(shared_region); + read_only_mapping_ = shared_region_.Map(); +} + +bool SharedMemoryVersionClient::SharedVersionIsLessThan(VersionType version) { + // Invalid version numbers cannot be compared. Default to IPC. + if (version == shared_memory_version::kInvalidVersion) { + return true; + } + + return GetSharedVersion() < version; +} + +bool SharedMemoryVersionClient::SharedVersionIsGreaterThan( + VersionType version) { + // Invalid version numbers cannot be compared. Default to IPC. + if (version == shared_memory_version::kInvalidVersion) { + return true; + } + + return GetSharedVersion() > version; +} + +VersionType SharedMemoryVersionClient::GetSharedVersion() { + CHECK(read_only_mapping_.IsValid()); + return GetSharedVersionHelper(read_only_mapping_); +} + +} // namespace mojo
diff --git a/mojo/public/cpp/base/shared_memory_version.h b/mojo/public/cpp/base/shared_memory_version.h new file mode 100644 index 0000000..ac9e630 --- /dev/null +++ b/mojo/public/cpp/base/shared_memory_version.h
@@ -0,0 +1,137 @@ +// 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 MOJO_PUBLIC_CPP_BASE_SHARED_MEMORY_VERSION_H_ +#define MOJO_PUBLIC_CPP_BASE_SHARED_MEMORY_VERSION_H_ + +#include <atomic> +#include <cstdint> + +#include "base/component_export.h" + +#include "base/memory/read_only_shared_memory_region.h" + +namespace mojo { + +class SharedMemoryVersionClient; + +using VersionType = uint64_t; +using SharedVersionType = std::atomic<VersionType>; +static_assert(SharedVersionType::is_always_lock_free, + "Usage of SharedVersionType across processes might be unsafe"); + +// This file contains classes to share a version between processes through +// shared memory. A version is a nonzero monotonically increasing integer. A +// controller has read and write access to the version and one or many clients +// have read access only. Controllers should only be created in privileged +// processes. Clients can avoid issuing IPCs depending on the version stored in +// shared memory. +// +// Example: +// +// class Controller : mojom::StateProvider { +// ... +// +// void SetState(State state) { +// state_ = state; +// version_.Increment(); +// } +// +// void GetState( +// base::OnceCallback<void(State, VersionType)> callback) override { +// callback_.Run(state_, version_.GetSharedVersion()); +// } +// +// SharedMemoryVersionController version_; +// }; +// +// class Client { +// ... +// +// State GetState() { +// // IPC can be avoided. +// if (cached_version_ && +// !version_.SharedVersionIsGreaterThan(cached_version_)) { +// return cached_state_.value(); +// } +// +// State state; +// VersionType version; +// +// // Sync IPC to keep the example simple. Prefer async IPCs. +// if (!provider_->GetState(&state, &version)) { +// // error handling +// } +// +// cached_state_ = state; +// cached_version_ = version; +// return cached_state_.value(); +// } +// +// mojo::Receiver<mojom::StateProvider> provider_; +// std::optional<State> cached_state_; +// std::optional<VersionType> cached_version_; +// SharedMemoryVersionClient version_; +// +// }; + +namespace shared_memory_version { + +static constexpr VersionType kInvalidVersion = 0ULL; +static constexpr VersionType kInitialVersion = 1ULL; + +} // namespace shared_memory_version + +// Used to modify the version number and issue read only handles to it. +class COMPONENT_EXPORT(MOJO_BASE) SharedMemoryVersionController { + public: + SharedMemoryVersionController(); + ~SharedMemoryVersionController() = default; + + // Not copyable or movable + SharedMemoryVersionController(const SharedMemoryVersionController&) = delete; + SharedMemoryVersionController& operator=( + const SharedMemoryVersionController&) = delete; + + // Get a shared memory region to be sent to a different process. It will be + // used to instantiate a SharedMemoryVersionClient. + base::ReadOnlySharedMemoryRegion GetSharedMemoryRegion(); + + VersionType GetSharedVersion(); + + // Increment shared version. This is not expected to cause a wrap of the value + // during normal operation. This invariant is guaranteed with a CHECK. + void Increment(); + + private: + base::MappedReadOnlyRegion mapped_region_; +}; + +// Used to keep track of a remote version number and compare it to a +// locally tracked version. +class COMPONENT_EXPORT(MOJO_BASE) SharedMemoryVersionClient { + public: + explicit SharedMemoryVersionClient( + base::ReadOnlySharedMemoryRegion shared_region); + ~SharedMemoryVersionClient() = default; + + // Not copyable or movable + SharedMemoryVersionClient(const SharedMemoryVersionClient&) = delete; + SharedMemoryVersionClient& operator=(const SharedMemoryVersionClient&) = + delete; + + // Returns true if the shared version is less than (or greater than) the + // supplied version. + bool SharedVersionIsLessThan(VersionType version); + bool SharedVersionIsGreaterThan(VersionType version); + + private: + VersionType GetSharedVersion(); + base::ReadOnlySharedMemoryRegion shared_region_; + base::ReadOnlySharedMemoryMapping read_only_mapping_; +}; + +} // namespace mojo + +#endif // MOJO_PUBLIC_CPP_BASE_SHARED_MEMORY_VERSION_H_
diff --git a/mojo/public/cpp/base/shared_memory_version_unittest.cc b/mojo/public/cpp/base/shared_memory_version_unittest.cc new file mode 100644 index 0000000..0f9dc7c --- /dev/null +++ b/mojo/public/cpp/base/shared_memory_version_unittest.cc
@@ -0,0 +1,69 @@ +// 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 <optional> + +#include "mojo/public/cpp/base/shared_memory_version.h" + +#include "testing/gtest/include/gtest/gtest.h" + +namespace { + +TEST(SharedMemoryVersionTest, InitialSetupAllowsVersionSharing) { + mojo::SharedMemoryVersionController controller; + EXPECT_EQ(controller.GetSharedVersion(), + mojo::shared_memory_version::kInitialVersion); + mojo::SharedMemoryVersionClient client(controller.GetSharedMemoryRegion()); + + // Shared version is equal to `kInitialVersion` + EXPECT_FALSE(client.SharedVersionIsGreaterThan( + mojo::shared_memory_version::kInitialVersion)); + EXPECT_FALSE(client.SharedVersionIsLessThan( + mojo::shared_memory_version::kInitialVersion)); + + // Comparing to `kInvalidVersion` always defaults to true. + EXPECT_TRUE(client.SharedVersionIsGreaterThan( + mojo::shared_memory_version::kInvalidVersion)); + EXPECT_TRUE(client.SharedVersionIsLessThan( + mojo::shared_memory_version::kInvalidVersion)); +} + +TEST(SharedMemoryVersionTest, IncrementsAreReflectedInClient) { + mojo::SharedMemoryVersionController controller; + mojo::SharedMemoryVersionClient client(controller.GetSharedMemoryRegion()); + + mojo::VersionType local_version = + mojo::shared_memory_version::kInitialVersion; + + // Remote version initially smaller then incremented. + EXPECT_FALSE(client.SharedVersionIsGreaterThan(local_version)); + controller.Increment(); + EXPECT_TRUE(client.SharedVersionIsGreaterThan(local_version)); + + // Local version catches up. + ++local_version; + EXPECT_FALSE(client.SharedVersionIsGreaterThan(local_version)); + EXPECT_FALSE(client.SharedVersionIsLessThan(local_version)); + + // Local version overtakes remote version. + ++local_version; + EXPECT_TRUE(client.SharedVersionIsLessThan(local_version)); +} + +TEST(SharedMemoryVersionTest, ClientRemainsValidThroughControllerDestuction) { + std::optional<mojo::SharedMemoryVersionController> controller; + controller.emplace(); + controller->Increment(); + + mojo::SharedMemoryVersionClient client(controller->GetSharedMemoryRegion()); + controller.reset(); + + // Client is still valid past the lifetime of the controller.d + EXPECT_TRUE(client.SharedVersionIsGreaterThan( + mojo::shared_memory_version::kInitialVersion)); + EXPECT_FALSE(client.SharedVersionIsLessThan( + mojo::shared_memory_version::kInitialVersion)); +} + +} // namespace
diff --git a/mojo/public/cpp/bindings/tests/receiver_unittest.cc b/mojo/public/cpp/bindings/tests/receiver_unittest.cc index e9ec2f7f..34418925 100644 --- a/mojo/public/cpp/bindings/tests/receiver_unittest.cc +++ b/mojo/public/cpp/bindings/tests/receiver_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 "mojo/public/cpp/bindings/receiver.h" + #include <stdint.h> #include <optional> @@ -25,7 +27,6 @@ #include "mojo/public/cpp/bindings/lib/validation_errors.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
diff --git a/mojo/public/cpp/bindings/tests/remote_unittest.cc b/mojo/public/cpp/bindings/tests/remote_unittest.cc index 9b69353a..babf926a9b 100644 --- a/mojo/public/cpp/bindings/tests/remote_unittest.cc +++ b/mojo/public/cpp/bindings/tests/remote_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 "mojo/public/cpp/bindings/remote.h" + #include <stdint.h> #include <optional> @@ -26,7 +28,6 @@ #include "mojo/public/cpp/bindings/associated_receiver_set.h" #include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/bindings/receiver.h" -#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote_set.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "mojo/public/cpp/bindings/shared_associated_remote.h"
diff --git a/mojo/public/js/bindings_lite.js b/mojo/public/js/bindings_lite.js index ca8943b..41247fb 100644 --- a/mojo/public/js/bindings_lite.js +++ b/mojo/public/js/bindings_lite.js
@@ -240,7 +240,7 @@ */ mojo.internal.computeInlineArraySize = function(arraySpec, value) { if (arraySpec.elementType === mojo.internal.Bool) { - return mojo.internal.kArrayHeaderSize + (value.length + 7) >> 3; + return mojo.internal.kArrayHeaderSize + ((value.length + 7) >> 3); } else { return mojo.internal.kArrayHeaderSize + value.length *
diff --git a/net/base/backoff_entry_serializer_fuzzer.cc b/net/base/backoff_entry_serializer_fuzzer.cc index a6ce44c..056d1e9 100644 --- a/net/base/backoff_entry_serializer_fuzzer.cc +++ b/net/base/backoff_entry_serializer_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 "net/base/backoff_entry_serializer.h" + #include <stddef.h> #include <stdint.h> @@ -14,7 +16,6 @@ #include "base/time/tick_clock.h" #include "base/time/time.h" #include "net/base/backoff_entry.h" -#include "net/base/backoff_entry_serializer.h" #include "net/base/backoff_entry_serializer_fuzzer_input.pb.h" #include "testing/libfuzzer/proto/json_proto_converter.h" #include "testing/libfuzzer/proto/lpm_interface.h"
diff --git a/net/dns/dns_config_service_android.cc b/net/dns/dns_config_service_android.cc index 9a31f43d..c56f7086 100644 --- a/net/dns/dns_config_service_android.cc +++ b/net/dns/dns_config_service_android.cc
@@ -7,10 +7,10 @@ #include <sys/system_properties.h> #include <memory> +#include <optional> #include <string> #include <utility> -#include <optional> #include "base/android/build_info.h" #include "base/files/file_path.h" #include "base/functional/bind.h"
diff --git a/net/dns/dns_config_service_posix.h b/net/dns/dns_config_service_posix.h index 2739512..6bc0e477 100644 --- a/net/dns/dns_config_service_posix.h +++ b/net/dns/dns_config_service_posix.h
@@ -5,9 +5,9 @@ #ifndef NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ #define NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ -#include <sys/types.h> #include <netinet/in.h> #include <resolv.h> +#include <sys/types.h> #include <memory> #include <optional>
diff --git a/net/dns/dns_response_fuzzer.cc b/net/dns/dns_response_fuzzer.cc index 5f66955f..f4727a1 100644 --- a/net/dns/dns_response_fuzzer.cc +++ b/net/dns/dns_response_fuzzer.cc
@@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "net/dns/dns_response.h" + +#include <fuzzer/FuzzedDataProvider.h> #include <stddef.h> #include <stdint.h> -#include <fuzzer/FuzzedDataProvider.h> #include <optional> #include "base/check.h" @@ -14,7 +16,6 @@ #include "net/base/io_buffer.h" #include "net/dns/dns_names_util.h" #include "net/dns/dns_query.h" -#include "net/dns/dns_response.h" #include "net/dns/dns_util.h" #include "net/dns/public/dns_protocol.h"
diff --git a/net/dns/host_cache_fuzzer.cc b/net/dns/host_cache_fuzzer.cc index 14d617ea..576acb972 100644 --- a/net/dns/host_cache_fuzzer.cc +++ b/net/dns/host_cache_fuzzer.cc
@@ -2,9 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "net/dns/host_cache.h" + #include <stddef.h> #include <stdint.h> #include <stdlib.h> + #include <optional> #include "base/json/json_reader.h" @@ -12,7 +15,6 @@ #include "base/numerics/clamped_math.h" #include "base/numerics/ostream_operators.h" #include "base/strings/string_piece.h" -#include "net/dns/host_cache.h" #include "net/dns/host_cache_fuzzer.pb.h" #include "testing/libfuzzer/proto/json.pb.h" #include "testing/libfuzzer/proto/json_proto_converter.h"
diff --git a/net/dns/host_resolver_cache_fuzzer.cc b/net/dns/host_resolver_cache_fuzzer.cc index 432a0799..62eb958b 100644 --- a/net/dns/host_resolver_cache_fuzzer.cc +++ b/net/dns/host_resolver_cache_fuzzer.cc
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "net/dns/host_resolver_cache.h" + +#include <fuzzer/FuzzedDataProvider.h> #include <stddef.h> #include <stdint.h> #include <optional> -#include <fuzzer/FuzzedDataProvider.h> - #include "base/check_op.h" #include "base/json/json_reader.h" #include "base/values.h" -#include "net/dns/host_resolver_cache.h" #include "testing/libfuzzer/proto/json.pb.h" #include "testing/libfuzzer/proto/json_proto_converter.h" #include "testing/libfuzzer/proto/lpm_interface.h"
diff --git a/net/dns/https_record_rdata.h b/net/dns/https_record_rdata.h index 6c9fafd..224a90a4 100644 --- a/net/dns/https_record_rdata.h +++ b/net/dns/https_record_rdata.h
@@ -6,6 +6,7 @@ #define NET_DNS_HTTPS_RECORD_RDATA_H_ #include <stdint.h> + #include <map> #include <memory> #include <optional>
diff --git a/net/dns/public/dns_config_overrides.h b/net/dns/public/dns_config_overrides.h index 4024fad2..b85313f9 100644 --- a/net/dns/public/dns_config_overrides.h +++ b/net/dns/public/dns_config_overrides.h
@@ -5,10 +5,10 @@ #ifndef NET_DNS_PUBLIC_DNS_CONFIG_OVERRIDES_H_ #define NET_DNS_PUBLIC_DNS_CONFIG_OVERRIDES_H_ +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/time/time.h" #include "net/base/ip_endpoint.h" #include "net/base/net_export.h"
diff --git a/net/dns/public/dns_over_https_config.cc b/net/dns/public/dns_over_https_config.cc index 3029c3d..9a9e614 100644 --- a/net/dns/public/dns_over_https_config.cc +++ b/net/dns/public/dns_over_https_config.cc
@@ -5,10 +5,10 @@ #include "net/dns/public/dns_over_https_config.h" #include <iterator> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/ranges/algorithm.h"
diff --git a/net/dns/public/dns_over_https_config.h b/net/dns/public/dns_over_https_config.h index 81eafd9..0a80a3e2 100644 --- a/net/dns/public/dns_over_https_config.h +++ b/net/dns/public/dns_over_https_config.h
@@ -5,10 +5,10 @@ #ifndef NET_DNS_PUBLIC_DNS_OVER_HTTPS_CONFIG_H_ #define NET_DNS_PUBLIC_DNS_OVER_HTTPS_CONFIG_H_ +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/strings/string_piece.h" #include "base/values.h" #include "net/base/net_export.h"
diff --git a/net/dns/public/dns_over_https_server_config.cc b/net/dns/public/dns_over_https_server_config.cc index 0f6900c..89129d3 100644 --- a/net/dns/public/dns_over_https_server_config.cc +++ b/net/dns/public/dns_over_https_server_config.cc
@@ -4,11 +4,11 @@ #include "net/dns/public/dns_over_https_server_config.h" +#include <optional> #include <set> #include <string> #include <unordered_map> -#include <optional> #include "base/containers/contains.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h"
diff --git a/net/dns/public/dns_over_https_server_config.h b/net/dns/public/dns_over_https_server_config.h index 8e24423..a08842d 100644 --- a/net/dns/public/dns_over_https_server_config.h +++ b/net/dns/public/dns_over_https_server_config.h
@@ -5,9 +5,9 @@ #ifndef NET_DNS_PUBLIC_DNS_OVER_HTTPS_SERVER_CONFIG_H_ #define NET_DNS_PUBLIC_DNS_OVER_HTTPS_SERVER_CONFIG_H_ +#include <optional> #include <string> -#include <optional> #include "base/strings/string_piece.h" #include "base/values.h" #include "net/base/ip_address.h"
diff --git a/net/dns/public/doh_provider_entry.h b/net/dns/public/doh_provider_entry.h index dd81f795..5f03ff8 100644 --- a/net/dns/public/doh_provider_entry.h +++ b/net/dns/public/doh_provider_entry.h
@@ -5,11 +5,11 @@ #ifndef NET_DNS_PUBLIC_DOH_PROVIDER_ENTRY_H_ #define NET_DNS_PUBLIC_DOH_PROVIDER_ENTRY_H_ +#include <optional> #include <set> #include <string> #include <vector> -#include <optional> #include "base/feature_list.h" #include "base/memory/raw_ptr.h" #include "base/memory/raw_ptr_exclusion.h"
diff --git a/net/dns/public/host_resolver_results.cc b/net/dns/public/host_resolver_results.cc index 99c0df8e..1cae766 100644 --- a/net/dns/public/host_resolver_results.cc +++ b/net/dns/public/host_resolver_results.cc
@@ -6,10 +6,10 @@ #include <stdint.h> +#include <optional> #include <string> #include <utility> -#include <optional> #include "base/numerics/safe_conversions.h" #include "base/values.h" #include "net/base/connection_endpoint_metadata.h"
diff --git a/net/dns/public/host_resolver_source.cc b/net/dns/public/host_resolver_source.cc index 96451fec..6b49f1f 100644 --- a/net/dns/public/host_resolver_source.cc +++ b/net/dns/public/host_resolver_source.cc
@@ -5,6 +5,7 @@ #include "net/dns/public/host_resolver_source.h" #include <optional> + #include "base/values.h" namespace net {
diff --git a/net/dns/public/host_resolver_source.h b/net/dns/public/host_resolver_source.h index 2476f183..61161f3b 100644 --- a/net/dns/public/host_resolver_source.h +++ b/net/dns/public/host_resolver_source.h
@@ -6,8 +6,8 @@ #define NET_DNS_PUBLIC_HOST_RESOLVER_SOURCE_H_ #include <iterator> - #include <optional> + #include "base/values.h" namespace net {
diff --git a/net/dns/public/resolv_reader.cc b/net/dns/public/resolv_reader.cc index 7591421e..76d460e2 100644 --- a/net/dns/public/resolv_reader.cc +++ b/net/dns/public/resolv_reader.cc
@@ -9,11 +9,11 @@ #include <sys/types.h> #include <memory> +#include <optional> #include <type_traits> #include <utility> #include <vector> -#include <optional> #include "base/check_op.h" #include "base/functional/bind.h" #include "build/build_config.h"
diff --git a/net/dns/public/resolv_reader.h b/net/dns/public/resolv_reader.h index 8514a97..ec64e26 100644 --- a/net/dns/public/resolv_reader.h +++ b/net/dns/public/resolv_reader.h
@@ -8,9 +8,9 @@ #include <resolv.h> #include <memory> +#include <optional> #include <vector> -#include <optional> #include "net/base/ip_endpoint.h" #include "net/base/net_export.h" #include "net/dns/public/scoped_res_state.h"
diff --git a/net/dns/public/resolv_reader_unittest.cc b/net/dns/public/resolv_reader_unittest.cc index 1239a6cc..5c23797 100644 --- a/net/dns/public/resolv_reader_unittest.cc +++ b/net/dns/public/resolv_reader_unittest.cc
@@ -8,10 +8,10 @@ #include <resolv.h> #include <memory> +#include <optional> #include <utility> #include <vector> -#include <optional> #include "base/cancelable_callback.h" #include "base/check.h" #include "base/functional/bind.h"
diff --git a/net/dns/public/scoped_res_state.h b/net/dns/public/scoped_res_state.h index c08b04b..a1c97c3d 100644 --- a/net/dns/public/scoped_res_state.h +++ b/net/dns/public/scoped_res_state.h
@@ -8,6 +8,7 @@ #include <resolv.h> #include <optional> + #include "build/build_config.h" #include "net/base/net_export.h"
diff --git a/pdf/accessibility_helper.cc b/pdf/accessibility_helper.cc index f7ac169..7a9565e3 100644 --- a/pdf/accessibility_helper.cc +++ b/pdf/accessibility_helper.cc
@@ -6,9 +6,9 @@ #include <stdint.h> +#include <optional> #include <vector> -#include <optional> #include "base/numerics/safe_math.h" #include "pdf/accessibility_structs.h"
diff --git a/pdf/parsed_params.h b/pdf/parsed_params.h index 995dfe2..9d8eefc 100644 --- a/pdf/parsed_params.h +++ b/pdf/parsed_params.h
@@ -5,9 +5,9 @@ #ifndef PDF_PARSED_PARAMS_H_ #define PDF_PARSED_PARAMS_H_ +#include <optional> #include <string> -#include <optional> #include "pdf/pdfium/pdfium_form_filler.h" #include "third_party/skia/include/core/SkColor.h"
diff --git a/pdf/parsed_params_unittest.cc b/pdf/parsed_params_unittest.cc index 02e7b4d4..013948b 100644 --- a/pdf/parsed_params_unittest.cc +++ b/pdf/parsed_params_unittest.cc
@@ -4,9 +4,9 @@ #include "pdf/parsed_params.h" +#include <optional> #include <string> -#include <optional> #include "pdf/pdfium/pdfium_form_filler.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/pdf/pdf_engine.h b/pdf/pdf_engine.h index fbc93d0..bdf7e9c 100644 --- a/pdf/pdf_engine.h +++ b/pdf/pdf_engine.h
@@ -8,10 +8,10 @@ #include <stdint.h> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/containers/span.h" #include "base/functional/callback.h" #include "base/time/time.h"
diff --git a/pdf/pdf_utils/dates.cc b/pdf/pdf_utils/dates.cc index ed1cd04..0f5aa81 100644 --- a/pdf/pdf_utils/dates.cc +++ b/pdf/pdf_utils/dates.cc
@@ -7,6 +7,7 @@ #include <stdint.h> #include <optional> + #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h"
diff --git a/pdf/pdfium/findtext_unittest.cc b/pdf/pdfium/findtext_unittest.cc index 80b42ed..62eb6cc 100644 --- a/pdf/pdfium/findtext_unittest.cc +++ b/pdf/pdfium/findtext_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <optional> + #include "base/check_op.h" #include "base/strings/utf_string_conversions.h" #include "pdf/document_layout.h"
diff --git a/pdf/pdfium/pdfium_api_string_buffer_adapter.h b/pdf/pdfium/pdfium_api_string_buffer_adapter.h index 90c1e26..5366686 100644 --- a/pdf/pdfium/pdfium_api_string_buffer_adapter.h +++ b/pdf/pdfium/pdfium_api_string_buffer_adapter.h
@@ -7,9 +7,9 @@ #include <stddef.h> +#include <optional> #include <string> -#include <optional> #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/numerics/safe_math.h"
diff --git a/pdf/pdfium/pdfium_engine_exports_unittest.cc b/pdf/pdfium/pdfium_engine_exports_unittest.cc index 926e9be0..af290c23 100644 --- a/pdf/pdfium/pdfium_engine_exports_unittest.cc +++ b/pdf/pdfium/pdfium_engine_exports_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <optional> + #include "base/files/file_util.h" #include "base/path_service.h" #include "pdf/pdf.h"
diff --git a/pdf/pdfium/pdfium_page.h b/pdf/pdfium/pdfium_page.h index 31c2ffef..6b1c522d 100644 --- a/pdf/pdfium/pdfium_page.h +++ b/pdf/pdfium/pdfium_page.h
@@ -6,11 +6,11 @@ #define PDF_PDFIUM_PDFIUM_PAGE_H_ #include <map> +#include <optional> #include <set> #include <string> #include <vector> -#include <optional> #include "base/functional/callback.h" #include "base/functional/callback_forward.h" #include "base/gtest_prod_util.h"
diff --git a/pdf/pdfium/pdfium_page_unittest.cc b/pdf/pdfium/pdfium_page_unittest.cc index bb2c7e6..7922579e 100644 --- a/pdf/pdfium/pdfium_page_unittest.cc +++ b/pdf/pdfium/pdfium_page_unittest.cc
@@ -4,10 +4,10 @@ #include "pdf/pdfium/pdfium_page.h" +#include <optional> #include <utility> #include <vector> -#include <optional> #include "base/check.h" #include "base/files/file_path.h" #include "base/strings/string_util.h"
diff --git a/pdf/pdfium/pdfium_print_unittest.cc b/pdf/pdfium/pdfium_print_unittest.cc index 85c18ab..1eb5a51 100644 --- a/pdf/pdfium/pdfium_print_unittest.cc +++ b/pdf/pdfium/pdfium_print_unittest.cc
@@ -5,8 +5,8 @@ #include "pdf/pdfium/pdfium_print.h" #include <memory> - #include <optional> + #include "base/files/file_path.h" #include "base/strings/string_piece.h" #include "base/strings/stringprintf.h"
diff --git a/pdf/ui/document_properties.cc b/pdf/ui/document_properties.cc index 8239d472..2a6f190 100644 --- a/pdf/ui/document_properties.cc +++ b/pdf/ui/document_properties.cc
@@ -4,9 +4,9 @@ #include "pdf/ui/document_properties.h" +#include <optional> #include <string> -#include <optional> #include "base/i18n/number_formatting.h" #include "base/i18n/rtl.h" #include "base/strings/string_number_conversions.h"
diff --git a/pdf/ui/document_properties.h b/pdf/ui/document_properties.h index 9214b4a..8b6683d 100644 --- a/pdf/ui/document_properties.h +++ b/pdf/ui/document_properties.h
@@ -5,9 +5,9 @@ #ifndef PDF_UI_DOCUMENT_PROPERTIES_H_ #define PDF_UI_DOCUMENT_PROPERTIES_H_ +#include <optional> #include <string> -#include <optional> #include "pdf/document_metadata.h" namespace gfx {
diff --git a/pdf/ui/document_properties_unittest.cc b/pdf/ui/document_properties_unittest.cc index a26d56a3a..5cff5fb4 100644 --- a/pdf/ui/document_properties_unittest.cc +++ b/pdf/ui/document_properties_unittest.cc
@@ -4,9 +4,9 @@ #include "pdf/ui/document_properties.h" +#include <optional> #include <string> -#include <optional> #include "base/i18n/number_formatting.h" #include "base/i18n/rtl.h" #include "pdf/document_metadata.h"
diff --git a/printing/backend/print_backend.h b/printing/backend/print_backend.h index 21b9e43..f796f27b 100644 --- a/printing/backend/print_backend.h +++ b/printing/backend/print_backend.h
@@ -8,10 +8,10 @@ #include <stdint.h> #include <map> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h"
diff --git a/printing/backend/print_backend_test_constants.cc b/printing/backend/print_backend_test_constants.cc index 82d87c1..97162a6 100644 --- a/printing/backend/print_backend_test_constants.cc +++ b/printing/backend/print_backend_test_constants.cc
@@ -5,6 +5,7 @@ #include "printing/backend/print_backend_test_constants.h" #include <optional> + #include "printing/backend/print_backend.h" namespace printing {
diff --git a/printing/backend/print_backend_test_constants.h b/printing/backend/print_backend_test_constants.h index 8e76e27..8b32938 100644 --- a/printing/backend/print_backend_test_constants.h +++ b/printing/backend/print_backend_test_constants.h
@@ -7,9 +7,9 @@ #include <stdint.h> +#include <optional> #include <vector> -#include <optional> #include "build/build_config.h" #include "printing/backend/mojom/print_backend.mojom-forward.h" #include "printing/backend/print_backend.h"
diff --git a/printing/client_info_helpers_unittest.cc b/printing/client_info_helpers_unittest.cc index 552d77f..af5181e 100644 --- a/printing/client_info_helpers_unittest.cc +++ b/printing/client_info_helpers_unittest.cc
@@ -4,9 +4,9 @@ #include "printing/client_info_helpers.h" +#include <optional> #include <string> -#include <optional> #include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "printing/mojom/print.mojom.h"
diff --git a/printing/print_settings.h b/printing/print_settings.h index bddd437..84db04b 100644 --- a/printing/print_settings.h +++ b/printing/print_settings.h
@@ -6,11 +6,11 @@ #define PRINTING_PRINT_SETTINGS_H_ #include <algorithm> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/component_export.h" #include "build/build_config.h" #include "printing/buildflags/buildflags.h"
diff --git a/printing/print_settings_conversion_chromeos_unittest.cc b/printing/print_settings_conversion_chromeos_unittest.cc index f7d2009..794bcc6f 100644 --- a/printing/print_settings_conversion_chromeos_unittest.cc +++ b/printing/print_settings_conversion_chromeos_unittest.cc
@@ -4,9 +4,9 @@ #include "printing/print_settings_conversion_chromeos.h" +#include <optional> #include <string> -#include <optional> #include "base/test/values_test_util.h" #include "base/values.h" #include "printing/mojom/print.mojom.h"
diff --git a/printing/printing_features.cc b/printing/printing_features.cc index 611ed932..442116f 100644 --- a/printing/printing_features.cc +++ b/printing/printing_features.cc
@@ -19,11 +19,6 @@ BASE_FEATURE(kAddPrinterViaPrintscanmgr, "AddPrinterViaPrintscanmgr", base::FEATURE_ENABLED_BY_DEFAULT); - -// Enable support for borderless printing and media type. -BASE_FEATURE(kEnableBorderlessPrinting, - "EnableBorderlessPrinting", - base::FEATURE_ENABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_MAC)
diff --git a/printing/printing_features.h b/printing/printing_features.h index 4d7ff92..ac5d3b6 100644 --- a/printing/printing_features.h +++ b/printing/printing_features.h
@@ -20,7 +20,6 @@ #if BUILDFLAG(IS_CHROMEOS) COMPONENT_EXPORT(PRINTING_BASE) BASE_DECLARE_FEATURE(kAddPrinterViaPrintscanmgr); -COMPONENT_EXPORT(PRINTING_BASE) BASE_DECLARE_FEATURE(kEnableBorderlessPrinting); #endif // BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_MAC)
diff --git a/remoting/base/corp_service_client.h b/remoting/base/corp_service_client.h index 7d8606ab..78b57980 100644 --- a/remoting/base/corp_service_client.h +++ b/remoting/base/corp_service_client.h
@@ -6,9 +6,9 @@ #define REMOTING_BASE_CORP_SERVICE_CLIENT_H_ #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/functional/callback_forward.h" #include "base/memory/scoped_refptr.h" #include "remoting/base/buildflags.h"
diff --git a/remoting/base/protobuf_http_client.h b/remoting/base/protobuf_http_client.h index 4db70f5..9258f82 100644 --- a/remoting/base/protobuf_http_client.h +++ b/remoting/base/protobuf_http_client.h
@@ -7,9 +7,9 @@ #include <list> #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h"
diff --git a/remoting/base/result.h b/remoting/base/result.h index d9a5d67..fc120c3 100644 --- a/remoting/base/result.h +++ b/remoting/base/result.h
@@ -5,10 +5,10 @@ #ifndef REMOTING_BASE_RESULT_H_ #define REMOTING_BASE_RESULT_H_ +#include <optional> #include <type_traits> #include <utility> -#include <optional> #include "base/check.h" #include "third_party/abseil-cpp/absl/types/variant.h"
diff --git a/remoting/base/session_options.h b/remoting/base/session_options.h index 6d53993f..1daf6f2 100644 --- a/remoting/base/session_options.h +++ b/remoting/base/session_options.h
@@ -5,9 +5,9 @@ #ifndef REMOTING_BASE_SESSION_OPTIONS_H_ #define REMOTING_BASE_SESSION_OPTIONS_H_ +#include <optional> #include <string> -#include <optional> #include "base/containers/flat_map.h" namespace remoting {
diff --git a/remoting/client/display/gl_renderer.h b/remoting/client/display/gl_renderer.h index a6341d7a..7fd9abb 100644 --- a/remoting/client/display/gl_renderer.h +++ b/remoting/client/display/gl_renderer.h
@@ -5,9 +5,9 @@ #ifndef REMOTING_CLIENT_DISPLAY_GL_RENDERER_H_ #define REMOTING_CLIENT_DISPLAY_GL_RENDERER_H_ +#include <optional> #include <vector> -#include <optional> #include "base/containers/queue.h" #include "base/functional/callback.h" #include "base/memory/weak_ptr.h"
diff --git a/remoting/client/jni/jni_notification_presenter.h b/remoting/client/jni/jni_notification_presenter.h index a30d3c0..470ff69 100644 --- a/remoting/client/jni/jni_notification_presenter.h +++ b/remoting/client/jni/jni_notification_presenter.h
@@ -8,6 +8,7 @@ #include <jni.h> #include <optional> + #include "base/android/jni_weak_ref.h" #include "base/memory/scoped_refptr.h" #include "base/task/sequenced_task_runner.h"
diff --git a/remoting/client/notification/json_fetcher.h b/remoting/client/notification/json_fetcher.h index 7dfbf86..19329be 100644 --- a/remoting/client/notification/json_fetcher.h +++ b/remoting/client/notification/json_fetcher.h
@@ -5,9 +5,9 @@ #ifndef REMOTING_CLIENT_NOTIFICATION_JSON_FETCHER_H_ #define REMOTING_CLIENT_NOTIFICATION_JSON_FETCHER_H_ +#include <optional> #include <string> -#include <optional> #include "base/functional/callback_forward.h" namespace base {
diff --git a/remoting/client/notification/notification_client.h b/remoting/client/notification/notification_client.h index 149dd787..6e461a8f 100644 --- a/remoting/client/notification/notification_client.h +++ b/remoting/client/notification/notification_client.h
@@ -6,9 +6,9 @@ #define REMOTING_CLIENT_NOTIFICATION_NOTIFICATION_CLIENT_H_ #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/functional/callback_forward.h" #include "base/task/single_thread_task_runner.h" #include "base/values.h"
diff --git a/remoting/client/notification/notification_client_unittest.cc b/remoting/client/notification/notification_client_unittest.cc index 1013010ab..1dacb4a1 100644 --- a/remoting/client/notification/notification_client_unittest.cc +++ b/remoting/client/notification/notification_client_unittest.cc
@@ -5,8 +5,8 @@ #include "remoting/client/notification/notification_client.h" #include <memory> - #include <optional> + #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" #include "base/test/mock_callback.h"
diff --git a/remoting/client/notification/version_range.h b/remoting/client/notification/version_range.h index ab93fe9..8cd9315 100644 --- a/remoting/client/notification/version_range.h +++ b/remoting/client/notification/version_range.h
@@ -5,9 +5,9 @@ #ifndef REMOTING_CLIENT_NOTIFICATION_VERSION_RANGE_H_ #define REMOTING_CLIENT_NOTIFICATION_VERSION_RANGE_H_ +#include <optional> #include <string> -#include <optional> #include "base/version.h" namespace remoting {
diff --git a/remoting/host/base/desktop_environment_options.cc b/remoting/host/base/desktop_environment_options.cc index ba64e0c..874621b 100644 --- a/remoting/host/base/desktop_environment_options.cc +++ b/remoting/host/base/desktop_environment_options.cc
@@ -4,10 +4,10 @@ #include "remoting/host/base/desktop_environment_options.h" +#include <optional> #include <string> #include <utility> -#include <optional> #include "build/build_config.h" namespace remoting {
diff --git a/remoting/host/base/desktop_environment_options.h b/remoting/host/base/desktop_environment_options.h index 3176586..cb72f84 100644 --- a/remoting/host/base/desktop_environment_options.h +++ b/remoting/host/base/desktop_environment_options.h
@@ -6,6 +6,7 @@ #define REMOTING_HOST_BASE_DESKTOP_ENVIRONMENT_OPTIONS_H_ #include <optional> + #include "base/memory/weak_ptr.h" #include "remoting/base/session_options.h" #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
diff --git a/remoting/host/base/screen_controls.h b/remoting/host/base/screen_controls.h index 4772bda1..6b2e959 100644 --- a/remoting/host/base/screen_controls.h +++ b/remoting/host/base/screen_controls.h
@@ -6,6 +6,7 @@ #define REMOTING_HOST_BASE_SCREEN_CONTROLS_H_ #include <optional> + #include "third_party/webrtc/modules/desktop_capture/desktop_capture_types.h" namespace remoting {
diff --git a/remoting/host/chromeos/file_session_storage.cc b/remoting/host/chromeos/file_session_storage.cc index 4571641cb..a5eff40 100644 --- a/remoting/host/chromeos/file_session_storage.cc +++ b/remoting/host/chromeos/file_session_storage.cc
@@ -5,6 +5,7 @@ #include "remoting/host/chromeos/file_session_storage.h" #include <optional> + #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/functional/callback.h"
diff --git a/remoting/host/chromeos/file_session_storage_unittest.cc b/remoting/host/chromeos/file_session_storage_unittest.cc index 89be890a..9c6820c8 100644 --- a/remoting/host/chromeos/file_session_storage_unittest.cc +++ b/remoting/host/chromeos/file_session_storage_unittest.cc
@@ -5,6 +5,7 @@ #include "remoting/host/chromeos/file_session_storage.h" #include <optional> + #include "base/files/scoped_temp_dir.h" #include "base/test/task_environment.h" #include "base/test/test_future.h"
diff --git a/remoting/host/chromeos/frame_sink_desktop_capturer.h b/remoting/host/chromeos/frame_sink_desktop_capturer.h index f8c99487..42df9a6 100644 --- a/remoting/host/chromeos/frame_sink_desktop_capturer.h +++ b/remoting/host/chromeos/frame_sink_desktop_capturer.h
@@ -6,6 +6,7 @@ #define REMOTING_HOST_CHROMEOS_FRAME_SINK_DESKTOP_CAPTURER_H_ #include <optional> + #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" #include "components/viz/host/client_frame_sink_video_capturer.h"
diff --git a/remoting/host/chromeos/mouse_cursor_monitor_aura.cc b/remoting/host/chromeos/mouse_cursor_monitor_aura.cc index f52f463..c99fdff8 100644 --- a/remoting/host/chromeos/mouse_cursor_monitor_aura.cc +++ b/remoting/host/chromeos/mouse_cursor_monitor_aura.cc
@@ -4,9 +4,9 @@ #include "remoting/host/chromeos/mouse_cursor_monitor_aura.h" +#include <optional> #include <utility> -#include <optional> #include "ash/shell.h" #include "base/functional/bind.h" #include "base/functional/callback.h"
diff --git a/remoting/host/chromeos/remote_support_host_ash.cc b/remoting/host/chromeos/remote_support_host_ash.cc index 41ede01d..e54fbcd5 100644 --- a/remoting/host/chromeos/remote_support_host_ash.cc +++ b/remoting/host/chromeos/remote_support_host_ash.cc
@@ -5,9 +5,10 @@ #include "remoting/host/chromeos/remote_support_host_ash.h" #include <stddef.h> -#include <utility> #include <optional> +#include <utility> + #include "base/feature_list.h" #include "base/functional/bind.h" #include "base/functional/callback_helpers.h"
diff --git a/remoting/host/chromeos/remote_support_host_ash.h b/remoting/host/chromeos/remote_support_host_ash.h index 8337261..3a2792e5 100644 --- a/remoting/host/chromeos/remote_support_host_ash.h +++ b/remoting/host/chromeos/remote_support_host_ash.h
@@ -7,6 +7,7 @@ #include <memory> #include <optional> + #include "base/functional/callback.h" #include "base/memory/raw_ref.h" #include "base/memory/scoped_refptr.h"
diff --git a/remoting/host/chromeos/remoting_service.cc b/remoting/host/chromeos/remoting_service.cc index 72c2bbc..4acfbc0d6 100644 --- a/remoting/host/chromeos/remoting_service.cc +++ b/remoting/host/chromeos/remoting_service.cc
@@ -5,9 +5,9 @@ #include "remoting/host/chromeos/remoting_service.h" #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/no_destructor.h" #include "base/sequence_checker.h" #include "remoting/host/chromeos/file_session_storage.h"
diff --git a/remoting/host/chromeos/remoting_service.h b/remoting/host/chromeos/remoting_service.h index f5b0a28c..fbc78323 100644 --- a/remoting/host/chromeos/remoting_service.h +++ b/remoting/host/chromeos/remoting_service.h
@@ -6,6 +6,7 @@ #define REMOTING_HOST_CHROMEOS_REMOTING_SERVICE_H_ #include <optional> + #include "base/functional/callback_forward.h" #include "remoting/host/chromeos/session_id.h"
diff --git a/remoting/host/chromeos/session_storage.h b/remoting/host/chromeos/session_storage.h index eb8492d..e42c1ee 100644 --- a/remoting/host/chromeos/session_storage.h +++ b/remoting/host/chromeos/session_storage.h
@@ -6,6 +6,7 @@ #define REMOTING_HOST_CHROMEOS_SESSION_STORAGE_H_ #include <optional> + #include "base/functional/callback_forward.h" #include "base/values.h"
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc index f43a0b6..de42080 100644 --- a/remoting/host/client_session.cc +++ b/remoting/host/client_session.cc
@@ -7,9 +7,9 @@ #include <algorithm> #include <map> #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/command_line.h" #include "base/containers/contains.h" #include "base/functional/bind.h"
diff --git a/remoting/host/desktop_display_layout_util_unittest.cc b/remoting/host/desktop_display_layout_util_unittest.cc index cc79480e3..14defd6c 100644 --- a/remoting/host/desktop_display_layout_util_unittest.cc +++ b/remoting/host/desktop_display_layout_util_unittest.cc
@@ -4,9 +4,9 @@ #include "remoting/host/desktop_display_layout_util.h" +#include <optional> #include <vector> -#include <optional> #include "build/build_config.h" #include "remoting/proto/control.pb.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/remoting/host/desktop_session_agent.h b/remoting/host/desktop_session_agent.h index 083188a..cfefa694 100644 --- a/remoting/host/desktop_session_agent.h +++ b/remoting/host/desktop_session_agent.h
@@ -10,8 +10,8 @@ #include <map> #include <memory> - #include <optional> + #include "base/compiler_specific.h" #include "base/functional/callback.h" #include "base/memory/read_only_shared_memory_region.h"
diff --git a/remoting/host/desktop_session_proxy.h b/remoting/host/desktop_session_proxy.h index 490a1e52..b2e10a06 100644 --- a/remoting/host/desktop_session_proxy.h +++ b/remoting/host/desktop_session_proxy.h
@@ -8,9 +8,9 @@ #include <cstdint> #include <map> #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/callback_list.h" #include "base/functional/callback.h" #include "base/memory/read_only_shared_memory_region.h"
diff --git a/remoting/host/file_transfer/fake_file_operations.h b/remoting/host/file_transfer/fake_file_operations.h index e619060..67b4fd6 100644 --- a/remoting/host/file_transfer/fake_file_operations.h +++ b/remoting/host/file_transfer/fake_file_operations.h
@@ -7,9 +7,9 @@ #include <cstdint> #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/files/file_path.h" #include "base/memory/raw_ptr.h" #include "remoting/host/file_transfer/file_operations.h"
diff --git a/remoting/host/file_transfer/file_transfer_message_handler.h b/remoting/host/file_transfer/file_transfer_message_handler.h index 66356864..40f3b48 100644 --- a/remoting/host/file_transfer/file_transfer_message_handler.h +++ b/remoting/host/file_transfer/file_transfer_message_handler.h
@@ -7,10 +7,10 @@ #include <cstdint> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/containers/queue.h" #include "base/memory/weak_ptr.h" #include "remoting/host/file_transfer/buffered_file_writer.h"
diff --git a/remoting/host/file_transfer/local_file_operations.cc b/remoting/host/file_transfer/local_file_operations.cc index 2395b08..9d8762ff 100644 --- a/remoting/host/file_transfer/local_file_operations.cc +++ b/remoting/host/file_transfer/local_file_operations.cc
@@ -5,8 +5,8 @@ #include "remoting/host/file_transfer/local_file_operations.h" #include <cstdint> - #include <optional> + #include "base/files/file_path.h" #include "base/files/file_proxy.h" #include "base/files/file_util.h"
diff --git a/remoting/host/file_transfer/session_file_operations_handler.cc b/remoting/host/file_transfer/session_file_operations_handler.cc index 44948d623..6861720 100644 --- a/remoting/host/file_transfer/session_file_operations_handler.cc +++ b/remoting/host/file_transfer/session_file_operations_handler.cc
@@ -5,8 +5,8 @@ #include "remoting/host/file_transfer/session_file_operations_handler.h" #include <memory> - #include <optional> + #include "base/files/file_path.h" #include "base/functional/bind.h" #include "base/memory/weak_ptr.h"
diff --git a/remoting/host/host_config.h b/remoting/host/host_config.h index 45339699..ca15714 100644 --- a/remoting/host/host_config.h +++ b/remoting/host/host_config.h
@@ -6,9 +6,9 @@ #define REMOTING_HOST_HOST_CONFIG_H_ #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/values.h" namespace base {
diff --git a/remoting/host/host_config_unittest.cc b/remoting/host/host_config_unittest.cc index 0e0631e5..d23f42f57 100644 --- a/remoting/host/host_config_unittest.cc +++ b/remoting/host/host_config_unittest.cc
@@ -5,6 +5,7 @@ #include "remoting/host/host_config.h" #include <optional> + #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/json/json_writer.h"
diff --git a/remoting/host/input_injector_x11.cc b/remoting/host/input_injector_x11.cc index 994a19d..dcaf22b 100644 --- a/remoting/host/input_injector_x11.cc +++ b/remoting/host/input_injector_x11.cc
@@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/input_injector_x11.h" + #include <stddef.h> #include <stdint.h> + #include <memory> +#include <optional> #include <set> #include <utility> -#include <optional> #include "base/compiler_specific.h" #include "base/functional/bind.h" #include "base/location.h"
diff --git a/remoting/host/input_injector_x11.h b/remoting/host/input_injector_x11.h index 58b05d4..abd25f6 100644 --- a/remoting/host/input_injector_x11.h +++ b/remoting/host/input_injector_x11.h
@@ -7,11 +7,12 @@ #include <stddef.h> #include <stdint.h> + #include <memory> +#include <optional> #include <set> #include <utility> -#include <optional> #include "base/compiler_specific.h" #include "base/functional/bind.h" #include "base/location.h"
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_chromeos_unittest.cc b/remoting/host/it2me/it2me_confirmation_dialog_chromeos_unittest.cc index cf95286..7b5c16f 100644 --- a/remoting/host/it2me/it2me_confirmation_dialog_chromeos_unittest.cc +++ b/remoting/host/it2me/it2me_confirmation_dialog_chromeos_unittest.cc
@@ -6,9 +6,9 @@ #include <cstddef> #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/i18n/message_formatter.h" #include "base/ranges/algorithm.h" #include "base/strings/utf_string_conversions.h"
diff --git a/remoting/host/it2me/it2me_host.h b/remoting/host/it2me/it2me_host.h index 2e9e8446..e47ab157 100644 --- a/remoting/host/it2me/it2me_host.h +++ b/remoting/host/it2me/it2me_host.h
@@ -6,10 +6,10 @@ #define REMOTING_HOST_IT2ME_IT2ME_HOST_H_ #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/functional/callback_forward.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h"
diff --git a/remoting/host/it2me/it2me_host_unittest.cc b/remoting/host/it2me/it2me_host_unittest.cc index 8ca65cb..51f7f82 100644 --- a/remoting/host/it2me/it2me_host_unittest.cc +++ b/remoting/host/it2me/it2me_host_unittest.cc
@@ -5,11 +5,11 @@ #include "remoting/host/it2me/it2me_host.h" #include <memory> +#include <optional> #include <string> #include <string_view> #include <utility> -#include <optional> #include "base/functional/bind.h" #include "base/functional/callback.h" #include "base/location.h"
diff --git a/remoting/host/it2me/it2me_native_messaging_host.h b/remoting/host/it2me/it2me_native_messaging_host.h index 0fbeec8b..5ce54830 100644 --- a/remoting/host/it2me/it2me_native_messaging_host.h +++ b/remoting/host/it2me/it2me_native_messaging_host.h
@@ -6,9 +6,9 @@ #define REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h"
diff --git a/remoting/host/it2me/it2me_native_messaging_host_ash.h b/remoting/host/it2me/it2me_native_messaging_host_ash.h index deb699ad..0aa5077 100644 --- a/remoting/host/it2me/it2me_native_messaging_host_ash.h +++ b/remoting/host/it2me/it2me_native_messaging_host_ash.h
@@ -5,9 +5,9 @@ #define REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_ASH_H_ #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/sequence_checker.h" #include "base/thread_annotations.h" #include "base/values.h"
diff --git a/remoting/host/keyboard_layout_monitor_linux.cc b/remoting/host/keyboard_layout_monitor_linux.cc index 5285098..75d4d33f 100644 --- a/remoting/host/keyboard_layout_monitor_linux.cc +++ b/remoting/host/keyboard_layout_monitor_linux.cc
@@ -7,6 +7,7 @@ #include <gdk/gdk.h> #include <optional> + #include "base/files/file_descriptor_watcher_posix.h" #include "base/functional/bind.h" #include "base/functional/callback.h"
diff --git a/remoting/host/keyboard_layout_monitor_mac.cc b/remoting/host/keyboard_layout_monitor_mac.cc index 4cedac5..76c85ad 100644 --- a/remoting/host/keyboard_layout_monitor_mac.cc +++ b/remoting/host/keyboard_layout_monitor_mac.cc
@@ -9,9 +9,9 @@ #include <CoreServices/CoreServices.h> #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/apple/scoped_cftyperef.h" #include "base/functional/bind.h" #include "base/functional/callback.h"
diff --git a/remoting/host/linux/input_injector_wayland.cc b/remoting/host/linux/input_injector_wayland.cc index 9ce09d4..710b6e8 100644 --- a/remoting/host/linux/input_injector_wayland.cc +++ b/remoting/host/linux/input_injector_wayland.cc
@@ -7,11 +7,12 @@ #include <gtk/gtk.h> #include <stddef.h> #include <stdint.h> + #include <memory> +#include <optional> #include <set> #include <utility> -#include <optional> #include "base/containers/contains.h" #include "base/containers/queue.h" #include "base/functional/bind.h"
diff --git a/remoting/host/linux/input_injector_wayland.h b/remoting/host/linux/input_injector_wayland.h index c6a5d2c4..70496f6 100644 --- a/remoting/host/linux/input_injector_wayland.h +++ b/remoting/host/linux/input_injector_wayland.h
@@ -10,10 +10,10 @@ #include <stdint.h> #include <memory> +#include <optional> #include <set> #include <utility> -#include <optional> #include "base/containers/queue.h" #include "base/functional/bind.h" #include "base/functional/callback.h"
diff --git a/remoting/host/linux/remoting_user_session.cc b/remoting/host/linux/remoting_user_session.cc index 4f4457b..63b53f50 100644 --- a/remoting/host/linux/remoting_user_session.cc +++ b/remoting/host/linux/remoting_user_session.cc
@@ -32,13 +32,13 @@ #include <ctime> #include <map> #include <memory> +#include <optional> #include <string> #include <string_view> #include <tuple> #include <utility> #include <vector> -#include <optional> #include "base/environment.h" #include "base/files/file_path.h" #include "base/files/file_util.h"
diff --git a/remoting/host/mojom/remoting_mojom_traits.h b/remoting/host/mojom/remoting_mojom_traits.h index b89795d..1554fdd 100644 --- a/remoting/host/mojom/remoting_mojom_traits.h +++ b/remoting/host/mojom/remoting_mojom_traits.h
@@ -6,10 +6,11 @@ #define REMOTING_HOST_MOJOM_REMOTING_MOJOM_TRAITS_H_ #include <stddef.h> + #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/containers/span.h" #include "base/files/file_path.h" #include "base/numerics/safe_conversions.h"
diff --git a/remoting/host/native_messaging/native_messaging_helpers.h b/remoting/host/native_messaging/native_messaging_helpers.h index c9853d4..a242bdab 100644 --- a/remoting/host/native_messaging/native_messaging_helpers.h +++ b/remoting/host/native_messaging/native_messaging_helpers.h
@@ -5,9 +5,9 @@ #ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_HELPERS_H_ #define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_HELPERS_H_ +#include <optional> #include <string> -#include <optional> #include "base/values.h" namespace remoting {
diff --git a/remoting/host/native_messaging/native_messaging_reader_unittest.cc b/remoting/host/native_messaging/native_messaging_reader_unittest.cc index 6c0da95d..abfd5df 100644 --- a/remoting/host/native_messaging/native_messaging_reader_unittest.cc +++ b/remoting/host/native_messaging/native_messaging_reader_unittest.cc
@@ -6,9 +6,9 @@ #include <cstdint> #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/functional/bind.h" #include "base/run_loop.h" #include "base/test/task_environment.h"
diff --git a/remoting/host/register_support_host_request.h b/remoting/host/register_support_host_request.h index 711a4020..56196e9 100644 --- a/remoting/host/register_support_host_request.h +++ b/remoting/host/register_support_host_request.h
@@ -6,9 +6,9 @@ #define REMOTING_HOST_REGISTER_SUPPORT_HOST_REQUEST_H_ #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/functional/callback_forward.h" #include "base/memory/scoped_refptr.h" #include "base/time/time.h"
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index 6664c365..39e6957b 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc
@@ -8,11 +8,11 @@ #include <cstdint> #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/command_line.h" #include "base/files/file_path.h" #include "base/files/file_util.h"
diff --git a/remoting/host/remoting_register_support_host_request.h b/remoting/host/remoting_register_support_host_request.h index e22af08..f400fbf3 100644 --- a/remoting/host/remoting_register_support_host_request.h +++ b/remoting/host/remoting_register_support_host_request.h
@@ -6,6 +6,7 @@ #define REMOTING_HOST_REMOTING_REGISTER_SUPPORT_HOST_REQUEST_H_ #include <optional> + #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h"
diff --git a/remoting/host/remoting_register_support_host_request_unittest.cc b/remoting/host/remoting_register_support_host_request_unittest.cc index 655f23f8..61fe7d6 100644 --- a/remoting/host/remoting_register_support_host_request_unittest.cc +++ b/remoting/host/remoting_register_support_host_request_unittest.cc
@@ -5,6 +5,7 @@ #include "remoting/host/remoting_register_support_host_request.h" #include <optional> + #include "base/memory/raw_ptr.h" #include "base/test/mock_callback.h" #include "base/test/task_environment.h"
diff --git a/remoting/host/setup/daemon_controller.h b/remoting/host/setup/daemon_controller.h index b3048b4..e29097d6 100644 --- a/remoting/host/setup/daemon_controller.h +++ b/remoting/host/setup/daemon_controller.h
@@ -6,9 +6,9 @@ #define REMOTING_HOST_SETUP_DAEMON_CONTROLLER_H_ #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/containers/queue.h" #include "base/functional/callback.h" #include "base/memory/ref_counted.h"
diff --git a/remoting/host/setup/daemon_controller_delegate_linux.cc b/remoting/host/setup/daemon_controller_delegate_linux.cc index 28fae20..f368b4c 100644 --- a/remoting/host/setup/daemon_controller_delegate_linux.cc +++ b/remoting/host/setup/daemon_controller_delegate_linux.cc
@@ -5,9 +5,10 @@ #include "remoting/host/setup/daemon_controller_delegate_linux.h" #include <unistd.h> -#include <utility> #include <optional> +#include <utility> + #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/environment.h"
diff --git a/remoting/host/setup/host_stopper.h b/remoting/host/setup/host_stopper.h index 908223c6..2e719e5 100644 --- a/remoting/host/setup/host_stopper.h +++ b/remoting/host/setup/host_stopper.h
@@ -6,6 +6,7 @@ #define REMOTING_HOST_SETUP_HOST_STOPPER_H_ #include <optional> + #include "base/functional/callback.h" #include "base/memory/weak_ptr.h" #include "base/values.h"
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc index 8b1a6e4..23860d5 100644 --- a/remoting/host/setup/me2me_native_messaging_host.cc +++ b/remoting/host/setup/me2me_native_messaging_host.cc
@@ -6,10 +6,10 @@ #include <cstdint> #include <memory> +#include <optional> #include <string> #include <utility> -#include <optional> #include "base/command_line.h" #include "base/functional/bind.h" #include "base/functional/callback.h"
diff --git a/remoting/host/setup/me2me_native_messaging_host_unittest.cc b/remoting/host/setup/me2me_native_messaging_host_unittest.cc index a584758..6506de58 100644 --- a/remoting/host/setup/me2me_native_messaging_host_unittest.cc +++ b/remoting/host/setup/me2me_native_messaging_host_unittest.cc
@@ -8,10 +8,10 @@ #include <cstdint> #include <memory> +#include <optional> #include <string> #include <utility> -#include <optional> #include "base/compiler_specific.h" #include "base/functional/bind.h" #include "base/json/json_reader.h"
diff --git a/remoting/host/usage_stats_consent_linux.cc b/remoting/host/usage_stats_consent_linux.cc index 1e9b9033..6b961124 100644 --- a/remoting/host/usage_stats_consent_linux.cc +++ b/remoting/host/usage_stats_consent_linux.cc
@@ -5,9 +5,9 @@ #include "remoting/host/usage_stats_consent.h" #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/command_line.h" #include "base/files/file_path.h" #include "base/logging.h"
diff --git a/remoting/host/usage_stats_consent_mac.cc b/remoting/host/usage_stats_consent_mac.cc index 21aea57..2e19804 100644 --- a/remoting/host/usage_stats_consent_mac.cc +++ b/remoting/host/usage_stats_consent_mac.cc
@@ -5,9 +5,9 @@ #include "remoting/host/usage_stats_consent.h" #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/command_line.h" #include "base/files/file_path.h" #include "base/notreached.h"
diff --git a/remoting/host/xmpp_register_support_host_request_unittest.cc b/remoting/host/xmpp_register_support_host_request_unittest.cc index 6c8e22a5c..1914091 100644 --- a/remoting/host/xmpp_register_support_host_request_unittest.cc +++ b/remoting/host/xmpp_register_support_host_request_unittest.cc
@@ -7,6 +7,7 @@ #include <stdint.h> #include <optional> + #include "base/functional/bind.h" #include "base/memory/ref_counted.h" #include "base/observer_list.h"
diff --git a/remoting/host/xsession_chooser_linux.cc b/remoting/host/xsession_chooser_linux.cc index a80302b0..ec89826 100644 --- a/remoting/host/xsession_chooser_linux.cc +++ b/remoting/host/xsession_chooser_linux.cc
@@ -17,10 +17,10 @@ #include <map> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/environment.h" #include "base/files/file_enumerator.h" #include "base/files/file_path.h" @@ -37,14 +37,13 @@ #include "base/task/single_thread_task_executor.h" #include "remoting/base/logging.h" #include "remoting/base/string_resources.h" +#include "remoting/host/xsession_chooser_ui.inc" #include "third_party/icu/source/common/unicode/unistr.h" #include "third_party/icu/source/i18n/unicode/coll.h" #include "ui/base/glib/scoped_gobject.h" #include "ui/base/glib/scoped_gsignal.h" #include "ui/base/l10n/l10n_util.h" -#include "remoting/host/xsession_chooser_ui.inc" - namespace remoting { namespace {
diff --git a/remoting/ios/app/notification_presenter.h b/remoting/ios/app/notification_presenter.h index 8928ba2..3af27bc 100644 --- a/remoting/ios/app/notification_presenter.h +++ b/remoting/ios/app/notification_presenter.h
@@ -8,6 +8,7 @@ #import <Foundation/Foundation.h> #include <optional> + #include "base/no_destructor.h" #include "base/sequence_checker.h" #include "base/threading/sequence_bound.h"
diff --git a/remoting/protocol/clipboard_filter.h b/remoting/protocol/clipboard_filter.h index 829a462..3c3a28a 100644 --- a/remoting/protocol/clipboard_filter.h +++ b/remoting/protocol/clipboard_filter.h
@@ -6,6 +6,7 @@ #define REMOTING_PROTOCOL_CLIPBOARD_FILTER_H_ #include <optional> + #include "base/compiler_specific.h" #include "base/memory/raw_ptr.h" #include "remoting/protocol/clipboard_stub.h"
diff --git a/remoting/protocol/fake_stream_socket.h b/remoting/protocol/fake_stream_socket.h index b8004f06..d651ec2 100644 --- a/remoting/protocol/fake_stream_socket.h +++ b/remoting/protocol/fake_stream_socket.h
@@ -7,9 +7,9 @@ #include <map> #include <memory> +#include <optional> #include <string> -#include <optional> #include "base/memory/weak_ptr.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "remoting/protocol/p2p_stream_socket.h"
diff --git a/remoting/protocol/file_transfer_helpers.h b/remoting/protocol/file_transfer_helpers.h index 1063a2e..9135963 100644 --- a/remoting/protocol/file_transfer_helpers.h +++ b/remoting/protocol/file_transfer_helpers.h
@@ -6,9 +6,9 @@ #define REMOTING_PROTOCOL_FILE_TRANSFER_HELPERS_H_ #include <cstdint> +#include <optional> #include <ostream> -#include <optional> #include "base/location.h" #include "remoting/base/result.h" #include "remoting/proto/file_transfer.pb.h"
diff --git a/remoting/protocol/webrtc_transport.h b/remoting/protocol/webrtc_transport.h index d0ad0f1..9a2be086 100644 --- a/remoting/protocol/webrtc_transport.h +++ b/remoting/protocol/webrtc_transport.h
@@ -6,11 +6,11 @@ #define REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ #include <memory> +#include <optional> #include <string> #include <tuple> #include <vector> -#include <optional> #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h"
diff --git a/remoting/protocol/webrtc_video_encoder_wrapper.h b/remoting/protocol/webrtc_video_encoder_wrapper.h index d999af83..b65add82 100644 --- a/remoting/protocol/webrtc_video_encoder_wrapper.h +++ b/remoting/protocol/webrtc_video_encoder_wrapper.h
@@ -6,8 +6,8 @@ #define REMOTING_PROTOCOL_WEBRTC_VIDEO_ENCODER_WRAPPER_H_ #include <memory> - #include <optional> + #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h"
diff --git a/remoting/test/test_token_storage.cc b/remoting/test/test_token_storage.cc index 466d79e..481cf1d2 100644 --- a/remoting/test/test_token_storage.cc +++ b/remoting/test/test_token_storage.cc
@@ -5,6 +5,7 @@ #include "remoting/test/test_token_storage.h" #include <optional> + #include "base/files/file_util.h" #include "base/files/important_file_writer.h" #include "base/json/json_reader.h"
diff --git a/sandbox/linux/syscall_broker/broker_host.h b/sandbox/linux/syscall_broker/broker_host.h index 9a6131e..9d0c4a3 100644 --- a/sandbox/linux/syscall_broker/broker_host.h +++ b/sandbox/linux/syscall_broker/broker_host.h
@@ -6,6 +6,7 @@ #define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_HOST_H_ #include <optional> + #include "base/containers/span.h" #include "base/memory/raw_ref.h" #include "sandbox/linux/syscall_broker/broker_channel.h"
diff --git a/sandbox/linux/syscall_broker/broker_process.h b/sandbox/linux/syscall_broker/broker_process.h index 4baaed1e..878dab5 100644 --- a/sandbox/linux/syscall_broker/broker_process.h +++ b/sandbox/linux/syscall_broker/broker_process.h
@@ -8,10 +8,10 @@ #include <sys/stat.h> #include <memory> +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/functional/callback_forward.h" #include "sandbox/linux/syscall_broker/broker_sandbox_config.h" #include "sandbox/sandbox_export.h"
diff --git a/sandbox/mac/sandbox_test.h b/sandbox/mac/sandbox_test.h index fcac4be..847c356 100644 --- a/sandbox/mac/sandbox_test.h +++ b/sandbox/mac/sandbox_test.h
@@ -5,9 +5,9 @@ #ifndef SANDBOX_MAC_SANDBOX_TEST_H_ #define SANDBOX_MAC_SANDBOX_TEST_H_ +#include <optional> #include <string> -#include <optional> #include "base/command_line.h" #include "base/functional/callback.h" #include "base/process/process.h"
diff --git a/services/network/BUILD.gn b/services/network/BUILD.gn index a93064e9a..30d3667 100644 --- a/services/network/BUILD.gn +++ b/services/network/BUILD.gn
@@ -334,6 +334,7 @@ "//components/url_pattern", "//components/web_package", "//components/webrtc:fake_ssl_socket", + "//mojo/public/cpp/base", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//net",
diff --git a/services/network/p2p/socket_udp_unittest.cc b/services/network/p2p/socket_udp_unittest.cc index 17388d1..af0030af 100644 --- a/services/network/p2p/socket_udp_unittest.cc +++ b/services/network/p2p/socket_udp_unittest.cc
@@ -5,6 +5,7 @@ #include "services/network/p2p/socket_udp.h" #include <stdint.h> + #include <optional> #include <utility> #include <vector>
diff --git a/services/network/restricted_cookie_manager.cc b/services/network/restricted_cookie_manager.cc index f55f464..5c1d5c5 100644 --- a/services/network/restricted_cookie_manager.cc +++ b/services/network/restricted_cookie_manager.cc
@@ -488,19 +488,6 @@ if (role == mojom::RestrictedCookieManagerRole::SCRIPT) { CHECK(origin_.IsSameOriginWith(isolation_info_.frame_origin().value())); } - - // Create a shared memory region and immediately populate it. - mapped_region_ = - base::ReadOnlySharedMemoryRegion::Create(sizeof(SharedVersionType)); - CHECK(mapped_region_.IsValid()); - new (mapped_region_.mapping.memory()) SharedVersionType; - - // Clients will use 0 as special value to indicate the version in the absence - // of shared memory communication. Make sure the version starts at 1 to avoid - // any confusion. Relaxed memory ordering because this is the only memory - // shared. - mapped_region_.mapping.GetMemoryAs<SharedVersionType>()->store( - mojom::kInitialCookieVersion, std::memory_order_relaxed); } RestrictedCookieManager::~RestrictedCookieManager() { @@ -515,24 +502,6 @@ } } -void RestrictedCookieManager::IncrementSharedVersion() { - CHECK(mapped_region_.IsValid()); - // Relaxed memory order since only the version is stored within the region - // and as such is the only data shared between processes. There is no - // re-ordering to worry about. - mapped_region_.mapping.GetMemoryAs<SharedVersionType>()->fetch_add( - 1, std::memory_order_relaxed); -} - -uint64_t RestrictedCookieManager::GetSharedVersion() { - CHECK(mapped_region_.IsValid()); - // Relaxed memory order since only the version is stored within the region - // and as such is the only data shared between processes. There is no - // re-ordering to worry about. - return mapped_region_.mapping.GetMemoryAs<SharedVersionType>()->load( - std::memory_order_relaxed); -} - void RestrictedCookieManager::OnCookieSettingsChanged() { // Cookie settings changes can change cookie values as seen by content. // Increment the shared version to make sure it issues a full cookie string @@ -540,6 +509,10 @@ IncrementSharedVersion(); } +void RestrictedCookieManager::IncrementSharedVersion() { + shared_memory_version_controller_.Increment(); +} + void RestrictedCookieManager::SetShouldDeDupCookieAccessDetailsForTesting( bool should_dedup) { should_dedup_cookie_access_details_ = should_dedup; @@ -1019,7 +992,8 @@ base::ReadOnlySharedMemoryRegion shared_memory_region; if (get_version_shared_memory) { - shared_memory_region = mapped_region_.region.Duplicate(); + shared_memory_region = + shared_memory_version_controller_.GetSharedMemoryRegion(); // Clients can change their URL. If that happens the subscription needs to // mirror that to get the correct updates. @@ -1044,8 +1018,9 @@ // mechanism to avoid unnecessary IPCs. When the version is stale an // additional IPC will take place which is the way it would always be if there // was not shared memory versioning. - auto bound_callback = base::BindOnce(std::move(callback), GetSharedVersion(), - std::move(shared_memory_region)); + auto bound_callback = base::BindOnce( + std::move(callback), shared_memory_version_controller_.GetSharedVersion(), + std::move(shared_memory_region)); // Match everything. auto match_options = mojom::CookieManagerGetOptions::New();
diff --git a/services/network/restricted_cookie_manager.h b/services/network/restricted_cookie_manager.h index 2cfe8e2..85d8b18 100644 --- a/services/network/restricted_cookie_manager.h +++ b/services/network/restricted_cookie_manager.h
@@ -18,6 +18,7 @@ #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/timer/timer.h" +#include "mojo/public/cpp/base/shared_memory_version.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/base/isolation_info.h" @@ -208,11 +209,6 @@ // cookies the other side could have cached. void IncrementSharedVersion(); - // Returns the cookie version shared with clients to determine whether a - // cookie string has changed since the last request and a new request needs to - // be issued. - uint64_t GetSharedVersion(); - // The state associated with a CookieChangeListener. class Listener; @@ -363,9 +359,7 @@ size_t estimated_deduped_cookie_access_details_size_ = 0u; size_t cookie_access_details_count_ = 0u; - // Used to communicate cookie version information with renderers without going - // through IPCs. - base::MappedReadOnlyRegion mapped_region_; + mojo::SharedMemoryVersionController shared_memory_version_controller_; base::WeakPtrFactory<RestrictedCookieManager> weak_ptr_factory_{this}; };
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index 619caacb..cc88e68 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -241,6 +241,10 @@ #define SK_DONT_PAD_LAYER_IMAGES +// TODO: (skbug.com/40045243) - Remove legacy Perlin Noise implementation from +// Skia, then remove this migration flag. +#define SK_RASTER_PIPELINE_PERLIN_NOISE + /* When --disable-skia-runtime-opts is set in Chrome (or when SkGraphics::Init is not called), Skia will prefer precision over performance when computing reciprocals and inverse-square roots.
diff --git a/skia/public/mojom/image_info_mojom_traits.cc b/skia/public/mojom/image_info_mojom_traits.cc index 25c8dab..1c785bf 100644 --- a/skia/public/mojom/image_info_mojom_traits.cc +++ b/skia/public/mojom/image_info_mojom_traits.cc
@@ -5,6 +5,7 @@ #include "skia/public/mojom/image_info_mojom_traits.h" #include <optional> + #include "base/notreached.h" #include "base/numerics/checked_math.h" #include "base/numerics/safe_conversions.h"
diff --git a/skia/public/mojom/image_info_mojom_traits.h b/skia/public/mojom/image_info_mojom_traits.h index e1269f9..54eeb0af 100644 --- a/skia/public/mojom/image_info_mojom_traits.h +++ b/skia/public/mojom/image_info_mojom_traits.h
@@ -5,9 +5,9 @@ #ifndef SKIA_PUBLIC_MOJOM_IMAGE_INFO_MOJOM_TRAITS_H_ #define SKIA_PUBLIC_MOJOM_IMAGE_INFO_MOJOM_TRAITS_H_ +#include <optional> #include <vector> -#include <optional> #include "base/component_export.h" #include "skia/public/mojom/image_info.mojom-shared.h" #include "third_party/skia/include/core/SkImageInfo.h"
diff --git a/sql/database.h b/sql/database.h index 68cfe9cc..c5a9499 100644 --- a/sql/database.h +++ b/sql/database.h
@@ -9,12 +9,12 @@ #include <stdint.h> #include <memory> +#include <optional> #include <set> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/containers/flat_map.h" #include "base/dcheck_is_on.h"
diff --git a/sql/database_options_unittest.cc b/sql/database_options_unittest.cc index 932c4693..e2fe27c9 100644 --- a/sql/database_options_unittest.cc +++ b/sql/database_options_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <optional> + #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" #include "base/functional/callback_helpers.h"
diff --git a/sql/sandboxed_vfs.h b/sql/sandboxed_vfs.h index b454fb2..7c580aa4 100644 --- a/sql/sandboxed_vfs.h +++ b/sql/sandboxed_vfs.h
@@ -10,7 +10,6 @@ #include <memory> #include <optional> -#include <optional> #include "base/component_export.h" #include "base/files/file.h" #include "base/files/file_path.h"
diff --git a/sql/test/test_helpers.h b/sql/test/test_helpers.h index 32001967..f3a5a6e 100644 --- a/sql/test/test_helpers.h +++ b/sql/test/test_helpers.h
@@ -7,6 +7,7 @@ #include <stddef.h> #include <stdint.h> + #include <optional> #include <string>
diff --git a/storage/browser/blob/blob_memory_controller.h b/storage/browser/blob/blob_memory_controller.h index 4f9ec4e..c43d253 100644 --- a/storage/browser/blob/blob_memory_controller.h +++ b/storage/browser/blob/blob_memory_controller.h
@@ -10,12 +10,12 @@ #include <list> #include <map> #include <memory> +#include <optional> #include <string> #include <unordered_set> #include <utility> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/containers/lru_cache.h" #include "base/feature_list.h"
diff --git a/storage/browser/blob/blob_memory_controller_unittest.cc b/storage/browser/blob/blob_memory_controller_unittest.cc index 2d60482..34ca703 100644 --- a/storage/browser/blob/blob_memory_controller_unittest.cc +++ b/storage/browser/blob/blob_memory_controller_unittest.cc
@@ -5,6 +5,7 @@ #include "storage/browser/blob/blob_memory_controller.h" #include <optional> + #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/functional/bind.h"
diff --git a/storage/browser/blob/blob_reader.h b/storage/browser/blob/blob_reader.h index 1a396f38fe..6e00acc 100644 --- a/storage/browser/blob/blob_reader.h +++ b/storage/browser/blob/blob_reader.h
@@ -10,9 +10,9 @@ #include <map> #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/functional/callback_forward.h" #include "base/functional/callback_helpers.h"
diff --git a/storage/browser/blob/blob_registry_impl_unittest.cc b/storage/browser/blob/blob_registry_impl_unittest.cc index 307e7ae..d63e6ea 100644 --- a/storage/browser/blob/blob_registry_impl_unittest.cc +++ b/storage/browser/blob/blob_registry_impl_unittest.cc
@@ -6,12 +6,12 @@ #include <limits> #include <memory> +#include <optional> #include <string> #include <tuple> #include <utility> #include <vector> -#include <optional> #include "base/feature_list.h" #include "base/files/scoped_temp_dir.h" #include "base/functional/bind.h"
diff --git a/storage/browser/blob/blob_storage_context_unittest.cc b/storage/browser/blob/blob_storage_context_unittest.cc index f7df78a..747d2431 100644 --- a/storage/browser/blob/blob_storage_context_unittest.cc +++ b/storage/browser/blob/blob_storage_context_unittest.cc
@@ -8,10 +8,10 @@ #include <limits> #include <memory> +#include <optional> #include <string> #include <utility> -#include <optional> #include "base/files/file.h" #include "base/files/file_path.h" #include "base/files/file_util.h"
diff --git a/storage/browser/blob/blob_transport_strategy_unittest.cc b/storage/browser/blob/blob_transport_strategy_unittest.cc index 7283cd93..1626140c 100644 --- a/storage/browser/blob/blob_transport_strategy_unittest.cc +++ b/storage/browser/blob/blob_transport_strategy_unittest.cc
@@ -6,11 +6,11 @@ #include <algorithm> #include <memory> +#include <optional> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/functional/bind.h"
diff --git a/storage/browser/blob/mojo_blob_reader.h b/storage/browser/blob/mojo_blob_reader.h index 3dc68b1..ce8666f 100644 --- a/storage/browser/blob/mojo_blob_reader.h +++ b/storage/browser/blob/mojo_blob_reader.h
@@ -6,8 +6,8 @@ #define STORAGE_BROWSER_BLOB_MOJO_BLOB_READER_H_ #include <memory> - #include <optional> + #include "base/component_export.h" #include "base/memory/scoped_refptr.h" #include "base/sequence_checker.h"
diff --git a/storage/browser/blob/write_blob_to_file.h b/storage/browser/blob/write_blob_to_file.h index e643c0c..3e01502b9 100644 --- a/storage/browser/blob/write_blob_to_file.h +++ b/storage/browser/blob/write_blob_to_file.h
@@ -6,6 +6,7 @@ #define STORAGE_BROWSER_BLOB_WRITE_BLOB_TO_FILE_H_ #include <optional> + #include "base/files/file_path.h" #include "base/time/time.h" #include "components/services/storage/public/mojom/blob_storage_context.mojom.h"
diff --git a/storage/browser/file_system/file_system_url.h b/storage/browser/file_system/file_system_url.h index 54c95442..4a67339 100644 --- a/storage/browser/file_system/file_system_url.h +++ b/storage/browser/file_system/file_system_url.h
@@ -5,10 +5,10 @@ #ifndef STORAGE_BROWSER_FILE_SYSTEM_FILE_SYSTEM_URL_H_ #define STORAGE_BROWSER_FILE_SYSTEM_FILE_SYSTEM_URL_H_ +#include <optional> #include <set> #include <string> -#include <optional> #include "base/component_export.h" #include "base/files/file_path.h" #include "components/services/storage/public/cpp/buckets/bucket_locator.h"
diff --git a/storage/browser/file_system/sandbox_file_system_backend_delegate.h b/storage/browser/file_system/sandbox_file_system_backend_delegate.h index 4c82832..fbc60ab 100644 --- a/storage/browser/file_system/sandbox_file_system_backend_delegate.h +++ b/storage/browser/file_system/sandbox_file_system_backend_delegate.h
@@ -9,12 +9,12 @@ #include <map> #include <memory> +#include <optional> #include <set> #include <string> #include <utility> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/files/file_error_or.h" #include "base/files/file_path.h"
diff --git a/storage/browser/quota/quota_callbacks.h b/storage/browser/quota/quota_callbacks.h index aa60c0dc..71edd3b 100644 --- a/storage/browser/quota/quota_callbacks.h +++ b/storage/browser/quota/quota_callbacks.h
@@ -9,11 +9,11 @@ #include <stdint.h> #include <map> +#include <optional> #include <set> #include <utility> #include <vector> -#include <optional> #include "base/containers/contains.h" #include "base/functional/callback.h" #include "components/services/storage/public/cpp/buckets/bucket_locator.h"
diff --git a/storage/browser/quota/quota_database.h b/storage/browser/quota/quota_database.h index cc0fd37..2646faac 100644 --- a/storage/browser/quota/quota_database.h +++ b/storage/browser/quota/quota_database.h
@@ -9,10 +9,10 @@ #include <stdint.h> #include <memory> +#include <optional> #include <set> #include <string> -#include <optional> #include "base/component_export.h" #include "base/files/file_path.h" #include "base/functional/callback.h"
diff --git a/storage/browser/quota/quota_manager_impl.h b/storage/browser/quota/quota_manager_impl.h index 7b0a55a..73b9dbe 100644 --- a/storage/browser/quota/quota_manager_impl.h +++ b/storage/browser/quota/quota_manager_impl.h
@@ -9,13 +9,13 @@ #include <map> #include <memory> +#include <optional> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/files/file_path.h" #include "base/functional/callback.h"
diff --git a/storage/browser/quota/quota_manager_proxy.h b/storage/browser/quota/quota_manager_proxy.h index 7446b10c..03de91b 100644 --- a/storage/browser/quota/quota_manager_proxy.h +++ b/storage/browser/quota/quota_manager_proxy.h
@@ -8,9 +8,9 @@ #include <stdint.h> #include <memory> +#include <optional> #include <vector> -#include <optional> #include "base/component_export.h" #include "base/functional/callback.h" #include "base/memory/raw_ptr.h"
diff --git a/storage/browser/quota/quota_settings.h b/storage/browser/quota/quota_settings.h index 9fd8a98..61d517e 100644 --- a/storage/browser/quota/quota_settings.h +++ b/storage/browser/quota/quota_settings.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include <optional> + #include "base/component_export.h" #include "base/files/file_path.h" #include "base/functional/callback.h"
diff --git a/storage/browser/quota/quota_settings_unittest.cc b/storage/browser/quota/quota_settings_unittest.cc index 55764e8..e4c0157 100644 --- a/storage/browser/quota/quota_settings_unittest.cc +++ b/storage/browser/quota/quota_settings_unittest.cc
@@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "storage/browser/quota/quota_settings.h" + #include <memory> +#include <optional> #include <utility> -#include <optional> #include "base/files/scoped_temp_dir.h" #include "base/functional/bind.h" #include "base/functional/callback.h" @@ -16,7 +18,6 @@ #include "base/test/task_environment.h" #include "storage/browser/quota/quota_device_info_helper.h" #include "storage/browser/quota/quota_features.h" -#include "storage/browser/quota/quota_settings.h" #include "testing/gmock/include/gmock/gmock.h" using ::testing::_;
diff --git a/storage/browser/quota/quota_temporary_storage_evictor.h b/storage/browser/quota/quota_temporary_storage_evictor.h index c700540..b3a8d00 100644 --- a/storage/browser/quota/quota_temporary_storage_evictor.h +++ b/storage/browser/quota/quota_temporary_storage_evictor.h
@@ -8,10 +8,10 @@ #include <stdint.h> #include <map> +#include <optional> #include <set> #include <string> -#include <optional> #include "base/component_export.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h"
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 1086e19..66e1909 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5377,9 +5377,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5389,8 +5389,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": { @@ -5533,9 +5533,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5545,8 +5545,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index d0a4f8aa..3d0db5c 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -20313,9 +20313,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -20325,8 +20325,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": { @@ -20463,9 +20463,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -20475,8 +20475,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.fuchsia.json b/testing/buildbot/chromium.fuchsia.json index 2818d0a..cc49c59 100644 --- a/testing/buildbot/chromium.fuchsia.json +++ b/testing/buildbot/chromium.fuchsia.json
@@ -1296,8 +1296,10 @@ "--gtest_filter=-All/DumpAccessibility*/fuchsia", "--test-arg=--disable-gpu", "--test-arg=--headless", - "--test-arg=--ozone-platform=headless" + "--test-arg=--ozone-platform=headless", + "--test-arg=--test-launcher-jobs=1" ], + "ci_only": true, "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -1309,7 +1311,7 @@ "os": "Ubuntu-22.04" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 14 + "shards": 41 }, "test": "content_browsertests", "test_id_prefix": "ninja://content/test:content_browsertests/" @@ -2085,8 +2087,7 @@ "kvm": "1", "os": "Ubuntu-22.04" }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 5 + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test": "blink_web_tests", "test_id_prefix": "ninja://:blink_web_tests/" @@ -2114,8 +2115,7 @@ "kvm": "1", "os": "Ubuntu-22.04" }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test": "blink_wpt_tests", "test_id_prefix": "ninja://:blink_wpt_tests/" @@ -3431,9 +3431,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--platform=fuchsia", - "--jobs=1" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "isolate_profile_data": true, "merge": { @@ -3461,9 +3459,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--platform=fuchsia", - "--jobs=1" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "isolate_profile_data": true, "merge": { @@ -3621,6 +3617,79 @@ }, "test": "telemetry_gpu_integration_test_fuchsia", "test_id_prefix": "ninja://content/test:telemetry_gpu_integration_test_fuchsia/" + }, + { + "args": [ + "pixel", + "--show-stdout", + "--browser=web-engine-shell", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating", + "--enforce-browser-version", + "--dont-restore-color-profile-after-test", + "--test-machine-name", + "${buildername}", + "--jobs=1", + "--git-revision=${got_revision}" + ], + "isolate_profile_data": true, + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "pixel_skia_gold_validating_test", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "dimensions": { + "kvm": "1", + "os": "Ubuntu-22.04" + }, + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test_fuchsia", + "test_id_prefix": "ninja://content/test:telemetry_gpu_integration_test_fuchsia/" + }, + { + "args": [ + "screenshot_sync", + "--show-stdout", + "--browser=web-engine-shell", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating", + "--enforce-browser-version", + "--dont-restore-color-profile-after-test" + ], + "isolate_profile_data": true, + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "screenshot_sync_validating_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "dimensions": { + "kvm": "1", + "os": "Ubuntu-22.04" + }, + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test_fuchsia", + "test_id_prefix": "ninja://content/test:telemetry_gpu_integration_test_fuchsia/" } ] },
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 4b52eb7..e8dc81a 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -39981,9 +39981,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -39992,8 +39992,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": { @@ -40131,9 +40131,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -40142,8 +40142,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": { @@ -41480,9 +41480,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -41492,8 +41492,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": { @@ -41636,9 +41636,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -41648,8 +41648,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": { @@ -42961,9 +42961,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -42972,8 +42972,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": { @@ -43111,9 +43111,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43122,8 +43122,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index aaedcd2fe..8d80c96 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -16343,12 +16343,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16358,8 +16358,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": { @@ -16519,12 +16519,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 124.0.6329.0", + "description": "Run with ash-chrome version 124.0.6330.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16534,8 +16534,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6329.0", - "revision": "version:124.0.6329.0" + "location": "lacros_version_skew_tests_v124.0.6330.0", + "revision": "version:124.0.6330.0" } ], "dimensions": {
diff --git a/testing/buildbot/internal.optimization_guide.json b/testing/buildbot/internal.optimization_guide.json index fc4639c..94ed03d 100644 --- a/testing/buildbot/internal.optimization_guide.json +++ b/testing/buildbot/internal.optimization_guide.json
@@ -677,6 +677,180 @@ } ] }, + "optimization_guide-win-arm64": { + "additional_compile_targets": [ + "ondevice_model_benchmark", + "ondevice_model_example" + ], + "gtest_tests": [ + { + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "chrome_ml_unittests", + "swarming": { + "dimensions": { + "cpu": "arm64", + "os": "Windows-11", + "screen_scaling_percent": "100" + }, + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "chrome_ml_unittests", + "test_id_prefix": "ninja://components/optimization_guide/internal:chrome_ml_unittests/" + }, + { + "args": [ + "--gtest_filter=*OptimizationGuide*:*PageContentAnnotations*" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "optimization_guide_browser_tests", + "swarming": { + "dimensions": { + "cpu": "arm64", + "os": "Windows-11", + "screen_scaling_percent": "100" + }, + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "browser_tests", + "test_id_prefix": "ninja://chrome/test:browser_tests/" + }, + { + "args": [ + "--gtest_filter=*OptimizationGuide*:*PageEntities*:*EntityAnnotator*" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "optimization_guide_components_unittests", + "swarming": { + "dimensions": { + "cpu": "arm64", + "os": "Windows-11", + "screen_scaling_percent": "100" + }, + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "components_unittests", + "test_id_prefix": "ninja://components:components_unittests/" + }, + { + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "optimization_guide_gpu_unittests", + "swarming": { + "dimensions": { + "cpu": "arm64", + "os": "Windows-11", + "screen_scaling_percent": "100" + }, + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "optimization_guide_gpu_unittests", + "test_id_prefix": "ninja://components/optimization_guide/internal:optimization_guide_gpu_unittests/" + }, + { + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "optimization_guide_unittests", + "swarming": { + "dimensions": { + "cpu": "arm64", + "os": "Windows-11", + "screen_scaling_percent": "100" + }, + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "optimization_guide_unittests", + "test_id_prefix": "ninja://components/optimization_guide/internal:optimization_guide_unittests/" + } + ], + "isolated_scripts": [ + { + "args": [ + "--out_dir=." + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "model_validation_tests MODEL_VALIDATION_BASE", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "dimensions": { + "cpu": "arm64", + "os": "Windows-11", + "screen_scaling_percent": "100" + }, + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "model_validation_tests", + "test_id_prefix": "ninja://components/optimization_guide/internal/testing:model_validation_tests/", + "variant_id": "MODEL_VALIDATION_BASE" + }, + { + "args": [ + "--out_dir=.", + "--chromedriver", + "chromedriver.exe", + "--binary", + "Chrome.exe" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "model_validation_tests MODEL_VALIDATION_TRUNK", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "dimensions": { + "cpu": "arm64", + "os": "Windows-11", + "screen_scaling_percent": "100" + }, + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "model_validation_tests", + "test_id_prefix": "ninja://components/optimization_guide/internal/testing:model_validation_tests/", + "variant_id": "MODEL_VALIDATION_TRUNK" + }, + { + "args": [ + "--chromedriver", + "chromedriver.exe", + "--binary", + "Chrome.exe" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "ondevice_stability_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "dimensions": { + "cpu": "arm64", + "os": "Windows-11", + "screen_scaling_percent": "100" + }, + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "ondevice_stability_tests", + "test_id_prefix": "ninja://components/optimization_guide/internal/testing:ondevice_stability_tests/" + } + ] + }, "optimization_guide-win32": { "additional_compile_targets": [ "ondevice_model_benchmark",
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index abee706..281d0c6 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -489,11 +489,14 @@ 'shards': 2, }, }, + # Save some overhead loads of starting up emulator. + 'fuchsia-x64-cast-receiver-dbg': { + 'swarming': { + 'shards': 1, + }, + }, + # Save some overhead loads of starting up emulator. 'fuchsia-x64-cast-receiver-rel': { - 'args': [ - '--platform=fuchsia', - '--jobs=1', - ], 'swarming': { 'shards': 1, }, @@ -814,11 +817,14 @@ '--additional-driver-flag=--use-gpu-in-tests', ], }, + # Save some overhead loads of starting up emulator. + 'fuchsia-x64-cast-receiver-dbg': { + 'swarming': { + 'shards': 1, + }, + }, + # Save some overhead loads of starting up emulator. 'fuchsia-x64-cast-receiver-rel': { - 'args': [ - '--platform=fuchsia', - '--jobs=1', - ], 'swarming': { 'shards': 1, }, @@ -2082,6 +2088,19 @@ 'shards': 41, }, }, + 'fuchsia-x64-cast-receiver-dbg': { + # Temporarily only run this on CI due to resource requirements. + # TODO(crbug.com/1374125): Remove this once resources are available. + 'ci_only': True, + 'swarming': { + 'shards': 41, + }, + 'args': [ + # TODO(crbug.com/1406693): Remove this when the kernal panic in + # fuchsia has been resolved. + '--test-arg=--test-launcher-jobs=1', + ], + }, 'fuchsia-x64-cast-receiver-rel': { # Temporarily only run this on CI due to resource requirements. # TODO(crbug.com/1374125): Remove this once resources are available. @@ -3526,12 +3545,6 @@ 'Mac FYI Retina ASAN (AMD)', ], }, - 'mediapipe_validating_tests': { - 'remove_from': [ - # TODO(crbug.com/1372213): Remove these once tests are stable. - 'fuchsia-x64-cast-receiver-rel', - ], - }, 'model_validation_tests MODEL_VALIDATION_BASE': { 'modifications': { 'optimization_guide-win32': { @@ -3999,10 +4012,6 @@ ], }, }, - 'remove_from': [ - # TODO(https://crbug.com/1302427): Remove once tests pass. - 'fuchsia-x64-cast-receiver-rel', - ], 'replacements': { # The V8 builders pass the V8 revision for ${got_revision}, so instead # use ${got_cr_revision}, which is only set on the V8 bots. @@ -4111,10 +4120,6 @@ ], }, }, - 'remove_from': [ - # TODO(https://crbug.com/1302427): Remove once tests pass. - 'fuchsia-x64-cast-receiver-rel', - ], }, 'services_unittests': { 'remove_from': [
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 75ea1c3..1856283 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -7965,6 +7965,21 @@ }, }, + 'optimization_guide_desktop_gtests': { + 'optimization_guide_gpu_gtests': {}, + 'optimization_guide_nogpu_gtests': {}, + }, + + 'optimization_guide_desktop_script_tests': { + 'model_validation_tests': { + 'variants': [ + 'MODEL_VALIDATION_BASE', + 'MODEL_VALIDATION_TRUNK', + ], + }, + 'ondevice_stability_tests': {}, + }, + 'optimization_guide_linux_gtests': { 'optimization_guide_gpu_gtests': { 'variants': [ @@ -7997,21 +8012,6 @@ }, }, - 'optimization_guide_mac_gtests': { - 'optimization_guide_gpu_gtests': {}, - 'optimization_guide_nogpu_gtests': {}, - }, - - 'optimization_guide_mac_script_tests': { - 'model_validation_tests': { - 'variants': [ - 'MODEL_VALIDATION_BASE', - 'MODEL_VALIDATION_TRUNK', - ], - }, - 'ondevice_stability_tests': {}, - }, - 'optimization_guide_win_gtests': { 'optimization_guide_gpu_gtests': { 'variants': [
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 89c62e4..b216ae7 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -307,16 +307,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 124.0.6329.0', + 'description': 'Run with ash-chrome version 124.0.6330.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6329.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6330.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v124.0.6329.0', - 'revision': 'version:124.0.6329.0', + 'location': 'lacros_version_skew_tests_v124.0.6330.0', + 'revision': 'version:124.0.6330.0', }, ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index f17bf29..3b5a303 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -6693,8 +6693,8 @@ 'mac_default_arm64', ], 'test_suites': { - 'gtest_tests': 'optimization_guide_mac_gtests', - 'isolated_scripts': 'optimization_guide_mac_script_tests', + 'gtest_tests': 'optimization_guide_desktop_gtests', + 'isolated_scripts': 'optimization_guide_desktop_script_tests', }, 'os_type': 'mac', }, @@ -6708,11 +6708,25 @@ 'mac_default_x64', ], 'test_suites': { - 'gtest_tests': 'optimization_guide_mac_gtests', - 'isolated_scripts': 'optimization_guide_mac_script_tests', + 'gtest_tests': 'optimization_guide_desktop_gtests', + 'isolated_scripts': 'optimization_guide_desktop_script_tests', }, 'os_type': 'mac', }, + 'optimization_guide-win-arm64': { + 'additional_compile_targets': [ + 'ondevice_model_benchmark', + 'ondevice_model_example', + ], + 'mixins': [ + 'win-arm64' + ], + 'test_suites': { + 'gtest_tests': 'optimization_guide_desktop_gtests', + 'isolated_scripts': 'optimization_guide_desktop_script_tests', + }, + 'os_type': 'win', + }, 'optimization_guide-win32': { 'additional_compile_targets': [ 'ondevice_model_benchmark',
diff --git a/testing/perf/luci_test_result.h b/testing/perf/luci_test_result.h index 172c4df9..9ef4790 100644 --- a/testing/perf/luci_test_result.h +++ b/testing/perf/luci_test_result.h
@@ -5,10 +5,10 @@ #ifndef TESTING_PERF_LUCI_TEST_RESULT_H_ #define TESTING_PERF_LUCI_TEST_RESULT_H_ +#include <optional> #include <string> #include <vector> -#include <optional> #include "base/containers/flat_map.h" #include "base/files/file_path.h" #include "base/time/time.h"
diff --git a/testing/perf/luci_test_result_unittest.cc b/testing/perf/luci_test_result_unittest.cc index f0068182..21677c3 100644 --- a/testing/perf/luci_test_result_unittest.cc +++ b/testing/perf/luci_test_result_unittest.cc
@@ -5,6 +5,7 @@ #include "testing/perf/luci_test_result.h" #include <optional> + #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h"
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index c3ae3861..a4a126d 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -13855,7 +13855,6 @@ }, "enable_features": [ "AllowURNsInIframes", - "AttributionFencedFrameReportingBeacon", "AttributionReportingCrossAppWeb", "BiddingAndScoringDebugReportingAPI", "BrowsingTopics", @@ -15209,26 +15208,6 @@ ] } ], - "RevampedPasswordManagementBubble_IPH": [ - { - "platforms": [ - "chromeos", - "chromeos_lacros", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "IPH_PasswordsManagementBubbleAfterSave", - "IPH_PasswordsManagementBubbleDuringSignin" - ] - } - ] - } - ], "RunTasksByBatches": [ { "platforms": [ @@ -17249,21 +17228,6 @@ ] } ], - "SkiaGraphite": [ - { - "platforms": [ - "mac" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "SkiaGraphite" - ] - } - ] - } - ], "SkipUnnecessaryThreadHopsForParseHeaders": [ { "platforms": [
diff --git a/third_party/beto-core/src b/third_party/beto-core/src index bd1f127..8bd72cf 160000 --- a/third_party/beto-core/src +++ b/third_party/beto-core/src
@@ -1 +1 @@ -Subproject commit bd1f1272cd2a6605ec793b914ada2c4ebcc820f6 +Subproject commit 8bd72cfb219344308ee857bcbe65a27fe91acfe8
diff --git a/third_party/blink/common/manifest/manifest_util.cc b/third_party/blink/common/manifest/manifest_util.cc index 4736b64..2d9ecf2a 100644 --- a/third_party/blink/common/manifest/manifest_util.cc +++ b/third_party/blink/common/manifest/manifest_util.cc
@@ -27,6 +27,20 @@ return !manifest || IsEmptyManifest(*manifest); } +bool IsDefaultManifest(const mojom::Manifest& manifest, + const GURL& document_url) { + blink::mojom::ManifestPtr expected_manifest = blink::mojom::Manifest::New(); + expected_manifest->start_url = document_url; + expected_manifest->id = document_url.GetWithoutRef(); + expected_manifest->scope = document_url.GetWithoutFilename(); + return manifest == *expected_manifest; +} + +bool IsDefaultManifest(const mojom::ManifestPtr& manifest, + const GURL& document_url) { + return manifest && IsDefaultManifest(*manifest, document_url); +} + std::string DisplayModeToString(blink::mojom::DisplayMode display) { switch (display) { case blink::mojom::DisplayMode::kUndefined:
diff --git a/third_party/blink/perf_tests/css/CustomPropertiesVarAlias.html b/third_party/blink/perf_tests/css/CustomPropertiesVarAlias.html index 8083f0a..4eacaeb 100644 --- a/third_party/blink/perf_tests/css/CustomPropertiesVarAlias.html +++ b/third_party/blink/perf_tests/css/CustomPropertiesVarAlias.html
@@ -8,18 +8,23 @@ <div id=target></div> </body> <script> - const propCount = 2000; + const property_chain_count = 4; + const property_chain_length = 500; - // Create a rule which defines 'propCount' custom properties with a - // linear var()-dependency on eachother. + // Create a rule which defines `property_chain_count` chains of custom + // properties, each `property_chain_length` long, with linear var() + // dependencies. function createRule() { let lines = ['#target {']; - for (let i = 0; i < propCount; i++) { + for (let chain = 0; chain < property_chain_count; chain++) { + for (let property = 0; property < property_chain_length; + property++) { let value = '#fefefe'; - if (i > 0) { - value = `var(--prop-${i-1})`; + if (property > 0) { + value = `var(--prop-${chain}-${property-1})`; } - lines.push(`--prop-${i}: ${value};`); + lines.push(`--prop-${chain}-${property}: ${value};`); + } } lines.push('}'); return lines.join('\n'); @@ -33,7 +38,7 @@ target.style = 'display: none'; forceStyleRecalc(target); target.style = ''; - getComputedStyle(target).getPropertyValue('--prop-'+(propCount-1)); + forceStyleRecalc(target); } }); </script>
diff --git a/third_party/blink/public/common/manifest/manifest_util.h b/third_party/blink/public/common/manifest/manifest_util.h index e6a70c1..96e2c567 100644 --- a/third_party/blink/public/common/manifest/manifest_util.h +++ b/third_party/blink/public/common/manifest/manifest_util.h
@@ -17,12 +17,20 @@ #include "third_party/blink/public/mojom/manifest/manifest.mojom-forward.h" #include "third_party/blink/public/mojom/manifest/manifest_launch_handler.mojom.h" +class GURL; + namespace blink { // Checks whether the manifest has no fields set. BLINK_COMMON_EXPORT bool IsEmptyManifest(const mojom::Manifest& manifest); BLINK_COMMON_EXPORT bool IsEmptyManifest(const mojom::ManifestPtr& manifest); +// Returns if the given manifest matches the default manifest. +BLINK_COMMON_EXPORT bool IsDefaultManifest(const mojom::Manifest& manifest, + const GURL& document_url); +BLINK_COMMON_EXPORT bool IsDefaultManifest(const mojom::ManifestPtr& manifest, + const GURL& document_url); + // Converts a blink::mojom::DisplayMode to a string. Returns one of // https://www.w3.org/TR/appmanifest/#dfn-display-modes-values. Return values // are lowercase. Returns an empty string for DisplayMode::kUndefined.
diff --git a/third_party/blink/public/common/shared_storage/shared_storage_utils.h b/third_party/blink/public/common/shared_storage/shared_storage_utils.h index 19e2b336..e4c9a71 100644 --- a/third_party/blink/public/common/shared_storage/shared_storage_utils.h +++ b/third_party/blink/public/common/shared_storage/shared_storage_utils.h
@@ -35,9 +35,10 @@ kRunNonWebVisible = 3, kSelectURLWebVisible = 4, kSelectURLNonWebVisible = 5, + kSuccess = 6, // Keep this at the end and equal to the last entry. - kMaxValue = kSelectURLNonWebVisible, + kMaxValue = kSuccess, }; // Whether the length of the urls input parameter (of the
diff --git a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom index 27894e2..647f390 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
@@ -4239,6 +4239,7 @@ kDOMClobberedShadowedFormPropertyAccessed = 4874, kDOMClobberedNotShadowedFormPropertyAccessed = 4875, kTpcdCookieReadBlockedByAdHeuristics = 4876, + kUsedColorSchemeRootScrollbarsDark = 4877, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/renderer/core/animation/css/css_animations.cc b/third_party/blink/renderer/core/animation/css/css_animations.cc index 93a51f8..06bbf02 100644 --- a/third_party/blink/renderer/core/animation/css/css_animations.cc +++ b/third_party/blink/renderer/core/animation/css/css_animations.cc
@@ -367,8 +367,7 @@ properties.PropertyAt(j); CSSPropertyRef ref(property_reference.Name(), document); const CSSProperty& property = ref.GetProperty(); - if (RuntimeEnabledFeatures::CSSAnimationCompositionEnabled() && - property.PropertyID() == CSSPropertyID::kAnimationComposition) { + if (property.PropertyID() == CSSPropertyID::kAnimationComposition) { if (const auto* value_list = DynamicTo<CSSValueList>(property_reference.Value())) { if (const auto* identifier_value =
diff --git a/third_party/blink/renderer/core/content_capture/build.gni b/third_party/blink/renderer/core/content_capture/build.gni index 6554c48..0dc17fd9 100644 --- a/third_party/blink/renderer/core/content_capture/build.gni +++ b/third_party/blink/renderer/core/content_capture/build.gni
@@ -7,6 +7,8 @@ "content_capture_manager.h", "content_capture_task.cc", "content_capture_task.h", + "content_capture_task_histogram_reporter.cc", + "content_capture_task_histogram_reporter.h", "content_holder.cc", "content_holder.h", "task_session.cc",
diff --git a/third_party/blink/renderer/core/content_capture/content_capture_task.cc b/third_party/blink/renderer/core/content_capture/content_capture_task.cc index 7c7dd4a..8f4705dd 100644 --- a/third_party/blink/renderer/core/content_capture/content_capture_task.cc +++ b/third_party/blink/renderer/core/content_capture/content_capture_task.cc
@@ -18,6 +18,7 @@ #include "third_party/blink/renderer/core/layout/layout_text.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h" +#include "third_party/blink/renderer/platform/wtf/functional.h" namespace blink { @@ -53,6 +54,17 @@ task_delay_ = std::make_unique<TaskDelay>(local_frame_root.Client() ->GetWebContentCaptureClient() ->GetTaskInitialDelay()); + + // The histogram is all about time, just disable it if high resolution isn't + // supported. + if (base::TimeTicks::IsHighResolution()) { + histogram_reporter_ = + base::MakeRefCounted<ContentCaptureTaskHistogramReporter>(); + task_session_->SetSentNodeCountCallback( + WTF::BindRepeating(&ContentCaptureTaskHistogramReporter:: + RecordsSentContentCountPerDocument, + histogram_reporter_)); + } } ContentCaptureTask::~ContentCaptureTask() = default; @@ -89,9 +101,15 @@ bool ContentCaptureTask::CaptureContent() { DCHECK(task_session_); Vector<cc::NodeInfo> buffer; + if (histogram_reporter_) { + histogram_reporter_->OnCaptureContentStarted(); + } bool result = CaptureContent(buffer); if (!buffer.empty()) task_session_->SetCapturedContent(buffer); + if (histogram_reporter_) { + histogram_reporter_->OnCaptureContentEnded(buffer.size()); + } return result; } @@ -102,6 +120,9 @@ auto* client = GetWebContentCaptureClient(*document); DCHECK(client); + if (histogram_reporter_) { + histogram_reporter_->OnSendContentStarted(); + } WebVector<WebContentHolder> content_batch; content_batch.reserve(kBatchSize); // Only send changed content after the new content was sent. @@ -124,6 +145,9 @@ doc_session.SetFirstDataHasSent(); } } + if (histogram_reporter_) { + histogram_reporter_->OnSendContentEnded(content_batch.size()); + } } WebContentCaptureClient* ContentCaptureTask::GetWebContentCaptureClient( @@ -209,10 +233,19 @@ void ContentCaptureTask::Run(TimerBase*) { TRACE_EVENT0("content_capture", "RunTask"); task_delay_->IncreaseDelayExponent(); + if (histogram_reporter_) { + histogram_reporter_->OnTaskRun(); + } bool completed = RunInternal(); if (!completed) { ScheduleInternal(ScheduleReason::kRetryTask); } + if (histogram_reporter_ && + (completed || task_state_ == TaskState::kCaptureContent)) { + // The current capture session ends if the task indicates it completed or + // is about to capture the new changes. + histogram_reporter_->OnAllCapturedContentSent(); + } } base::TimeDelta ContentCaptureTask::GetAndAdjustDelay(ScheduleReason reason) { @@ -242,11 +275,18 @@ delay_task_.StartOneShot(delay, FROM_HERE); TRACE_EVENT_INSTANT1("content_capture", "ScheduleTask", TRACE_EVENT_SCOPE_THREAD, "reason", reason); + if (histogram_reporter_) { + histogram_reporter_->OnTaskScheduled(/* record_task_delay = */ reason != + ScheduleReason::kRetryTask); + } } void ContentCaptureTask::Schedule(ScheduleReason reason) { DCHECK(local_frame_root_); has_content_change_ = true; + if (histogram_reporter_) { + histogram_reporter_->OnContentChanged(); + } ScheduleInternal(reason); } @@ -261,6 +301,9 @@ if (delay_task_.IsActive()) delay_task_.Stop(); } +void ContentCaptureTask::ClearDocumentSessionsForTesting() { + task_session_->ClearDocumentSessionsForTesting(); +} base::TimeDelta ContentCaptureTask::GetTaskNextFireIntervalForTesting() const { return delay_task_.IsActive() ? delay_task_.NextFireInterval()
diff --git a/third_party/blink/renderer/core/content_capture/content_capture_task.h b/third_party/blink/renderer/core/content_capture/content_capture_task.h index fc11931..25a5635 100644 --- a/third_party/blink/renderer/core/content_capture/content_capture_task.h +++ b/third_party/blink/renderer/core/content_capture/content_capture_task.h
@@ -10,10 +10,12 @@ #include "base/time/time.h" #include "cc/paint/node_id.h" +#include "third_party/blink/renderer/core/content_capture/content_capture_task_histogram_reporter.h" #include "third_party/blink/renderer/core/content_capture/task_session.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/heap/disallow_new_wrapper.h" #include "third_party/blink/renderer/platform/timer.h" +#include "third_party/blink/renderer/platform/wtf/ref_counted.h" #include "third_party/blink/renderer/platform/wtf/vector.h" namespace blink { @@ -87,6 +89,8 @@ captured_content_for_testing_ = captured_content; } + void ClearDocumentSessionsForTesting(); + base::TimeDelta GetTaskNextFireIntervalForTesting() const; void CancelTaskForTesting(); const TaskDelay& GetTaskDelayForTesting() const { return *task_delay_; } @@ -143,6 +147,7 @@ std::unique_ptr<TaskDelay> task_delay_; + scoped_refptr<ContentCaptureTaskHistogramReporter> histogram_reporter_; std::optional<TaskState> task_stop_for_testing_; std::optional<Vector<cc::NodeInfo>> captured_content_for_testing_; };
diff --git a/third_party/blink/renderer/core/content_capture/content_capture_task_histogram_reporter.cc b/third_party/blink/renderer/core/content_capture/content_capture_task_histogram_reporter.cc new file mode 100644 index 0000000..08388fe --- /dev/null +++ b/third_party/blink/renderer/core/content_capture/content_capture_task_histogram_reporter.cc
@@ -0,0 +1,101 @@ +// Copyright 2019 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <utility> + +#include "base/metrics/histogram_functions.h" +#include "third_party/blink/renderer/core/content_capture/content_capture_task_histogram_reporter.h" + +namespace blink { + +// static +constexpr char ContentCaptureTaskHistogramReporter::kCaptureContentTime[]; +constexpr char ContentCaptureTaskHistogramReporter::kCaptureContentDelayTime[]; +constexpr char ContentCaptureTaskHistogramReporter::kSendContentTime[]; +constexpr char ContentCaptureTaskHistogramReporter::kSentContentCount[]; +constexpr char ContentCaptureTaskHistogramReporter::kTaskDelayInMs[]; +constexpr char ContentCaptureTaskHistogramReporter::kTaskRunsPerCapture[]; + +ContentCaptureTaskHistogramReporter::ContentCaptureTaskHistogramReporter() + : capture_content_time_histogram_(kCaptureContentTime, 0, 50000, 50), + send_content_time_histogram_(kSendContentTime, 0, 50000, 50), + task_runs_per_capture_histogram_(kTaskRunsPerCapture, 0, 100, 50) {} + +ContentCaptureTaskHistogramReporter::~ContentCaptureTaskHistogramReporter() = + default; + +void ContentCaptureTaskHistogramReporter::OnContentChanged() { + if (content_change_time_) { + return; + } + content_change_time_ = base::TimeTicks::Now(); +} + +void ContentCaptureTaskHistogramReporter::OnTaskScheduled( + bool record_task_delay) { + // Always save the latest schedule time. + task_scheduled_time_ = + record_task_delay ? base::TimeTicks::Now() : base::TimeTicks(); +} + +void ContentCaptureTaskHistogramReporter::OnTaskRun() { + if (!task_scheduled_time_.is_null()) { + base::UmaHistogramCustomTimes( + kTaskDelayInMs, base::TimeTicks::Now() - task_scheduled_time_, + base::Milliseconds(1), base::Seconds(128), 100); + } + task_runs_per_capture_++; +} + +void ContentCaptureTaskHistogramReporter::OnCaptureContentStarted() { + capture_content_start_time_ = base::TimeTicks::Now(); +} + +void ContentCaptureTaskHistogramReporter::OnCaptureContentEnded( + size_t captured_content_count) { + if (!captured_content_count) { + // We captured nothing for the recorded content change, reset the time to + // start again. + content_change_time_.reset(); + return; + } + // Gives content_change_time_ to the change occurred while sending the + // content. + captured_content_change_time_ = std::move(content_change_time_); + base::TimeDelta delta = base::TimeTicks::Now() - capture_content_start_time_; + capture_content_time_histogram_.CountMicroseconds(delta); +} + +void ContentCaptureTaskHistogramReporter::OnSendContentStarted() { + send_content_start_time_ = base::TimeTicks::Now(); +} + +void ContentCaptureTaskHistogramReporter::OnSendContentEnded( + size_t sent_content_count) { + base::TimeTicks now = base::TimeTicks::Now(); + if (captured_content_change_time_) { + base::TimeTicks content_change_time = captured_content_change_time_.value(); + captured_content_change_time_.reset(); + base::UmaHistogramCustomTimes( + kCaptureContentDelayTime, now - content_change_time, + base::Milliseconds(500), base::Seconds(30), 50); + } + if (!sent_content_count) { + return; + } + send_content_time_histogram_.CountMicroseconds(now - + send_content_start_time_); +} + +void ContentCaptureTaskHistogramReporter::OnAllCapturedContentSent() { + task_runs_per_capture_histogram_.Count(task_runs_per_capture_); + task_runs_per_capture_ = 0; +} + +void ContentCaptureTaskHistogramReporter::RecordsSentContentCountPerDocument( + int sent_content_count) { + base::UmaHistogramCounts10000(kSentContentCount, sent_content_count); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/content_capture/content_capture_task_histogram_reporter.h b/third_party/blink/renderer/core/content_capture/content_capture_task_histogram_reporter.h new file mode 100644 index 0000000..6999d78 --- /dev/null +++ b/third_party/blink/renderer/core/content_capture/content_capture_task_histogram_reporter.h
@@ -0,0 +1,85 @@ +// Copyright 2019 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CONTENT_CAPTURE_CONTENT_CAPTURE_TASK_HISTOGRAM_REPORTER_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_CONTENT_CAPTURE_CONTENT_CAPTURE_TASK_HISTOGRAM_REPORTER_H_ + +#include <optional> + +#include "base/time/time.h" +#include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/platform/instrumentation/histogram.h" +#include "third_party/blink/renderer/platform/wtf/ref_counted.h" + +namespace blink { + +// This class collects and reports metric data for the ContentCaptureTask. +class CORE_EXPORT ContentCaptureTaskHistogramReporter + : public RefCounted<ContentCaptureTaskHistogramReporter> { + public: + // Visible for testing. + static constexpr char kCaptureContentDelayTime[] = + "ContentCapture.CaptureContentDelayTime"; + static constexpr char kCaptureContentTime[] = + "ContentCapture.CaptureContentTime2"; + static constexpr char kSendContentTime[] = "ContentCapture.SendContentTime"; + static constexpr char kSentContentCount[] = + "ContentCapture.SentContentCount2"; + static constexpr char kTaskDelayInMs[] = "ContentCapture.TaskDelayTimeInMs"; + static constexpr char kTaskRunsPerCapture[] = + "ContentCapture.TaskRunsPerCapture"; + + ContentCaptureTaskHistogramReporter(); + ~ContentCaptureTaskHistogramReporter(); + + void OnContentChanged(); + void OnTaskScheduled(bool record_task_delay); + // Invoked on every task starts. + void OnTaskRun(); + // Invoked on a capturing session starts, a session begins with + // OnCaptureContentStarted(), ends with OnAllCaptureContentSent(). + void OnCaptureContentStarted(); + // Invoked on the on-screen content captured and ready to be sent out. + void OnCaptureContentEnded(size_t captured_content_count); + void OnSendContentStarted(); + void OnSendContentEnded(size_t sent_content_count); + // Invoked on a capturing session ends, at that time, all captured changes + // which include the new, changed and removed content has been sent. + void OnAllCapturedContentSent(); + void RecordsSentContentCountPerDocument(int sent_content_count); + + private: + void MayRecordTaskRunsPerCapture(); + + // The time of first content change since the last content captured. + std::optional<base::TimeTicks> content_change_time_; + // The copy of |content_change_time| after the content has been captured; we + // need to record the time the content has been sent, |content_change_time_| + // shall be released for the next content change. + std::optional<base::TimeTicks> captured_content_change_time_; + // The time to start capturing content. + base::TimeTicks capture_content_start_time_; + // The time to start sending content. + base::TimeTicks send_content_start_time_; + // The time when the task is scheduled, is valid if kTaskDelayInMs needs to be + // recorded. + base::TimeTicks task_scheduled_time_; + // Counts the task run times to complete a capture which includes capturing + // and sending the content. + int task_runs_per_capture_ = 0; + + // Records time to capture the content, its range is from 0 to 50,000 + // microseconds. + CustomCountHistogram capture_content_time_histogram_; + // Records time to send the content, its range is from 0 to 50,000 + // microseconds. + CustomCountHistogram send_content_time_histogram_; + // Records the number of times ContentCapture task run to complete a capture + // which includes capturing and sending the content. + CustomCountHistogram task_runs_per_capture_histogram_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_CONTENT_CAPTURE_CONTENT_CAPTURE_TASK_HISTOGRAM_REPORTER_H_
diff --git a/third_party/blink/renderer/core/content_capture/content_capture_test.cc b/third_party/blink/renderer/core/content_capture/content_capture_test.cc index 6bcb325cd..e926e29 100644 --- a/third_party/blink/renderer/core/content_capture/content_capture_test.cc +++ b/third_party/blink/renderer/core/content_capture/content_capture_test.cc
@@ -4,10 +4,12 @@ #include "third_party/blink/renderer/core/content_capture/content_capture_manager.h" +#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/web/web_content_capture_client.h" #include "third_party/blink/public/web/web_content_holder.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_gc_controller.h" #include "third_party/blink/renderer/core/dom/dom_node_ids.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/dom/node.h" @@ -198,6 +200,23 @@ GetOrResetContentCaptureManager()->OnScrollPositionChanged(); } + void CreateTextNodeAndNotifyManager() { + Document& doc = GetDocument(); + Node* node = doc.createTextNode("New Text"); + Element* element = MakeGarbageCollected<Element>(html_names::kPTag, &doc); + element->appendChild(node); + Element* div_element = GetElementById("d1"); + div_element->appendChild(element); + UpdateAllLifecyclePhasesForTest(); + GetOrResetContentCaptureManager()->ScheduleTaskIfNeeded(*node); + created_node_id_ = DOMNodeIds::IdForNode(node); + Vector<cc::NodeInfo> captured_content{ + cc::NodeInfo(created_node_id_, GetRect(node->GetLayoutObject()))}; + GetOrResetContentCaptureManager() + ->GetContentCaptureTaskForTesting() + ->SetCapturedContentForTesting(captured_content); + } + ContentCaptureManager* GetOrResetContentCaptureManager() { if (content_capture_manager_ == nullptr) content_capture_manager_ = GetFrame().GetOrResetContentCaptureManager(); @@ -340,6 +359,7 @@ std::unique_ptr<WebContentCaptureClientTestHelper> content_capture_client_; Persistent<ContentCaptureManager> content_capture_manager_; Persistent<ContentCaptureLocalFrameClientHelper> local_frame_client_; + DOMNodeId created_node_id_ = kInvalidDOMNodeId; base::test::ScopedFeatureList feature_list_; }; @@ -538,6 +558,127 @@ EXPECT_EQ(1u, GetWebContentCaptureClient()->RemovedData().size()); } +TEST_P(ContentCaptureTest, TaskHistogramReporter) { + // This performs gc for all DocumentSession, flushes the existing + // SentContentCount and give a clean baseline for histograms. + // We are not sure if it always work, maybe still be the source of flaky. + ThreadState::Current()->CollectAllGarbageForTesting(); + base::HistogramTester histograms; + + // The task stops before captures content. + GetContentCaptureTask()->SetTaskStopForTesting( + ContentCaptureTask::TaskState::kCaptureContent); + RunContentCaptureTask(); + // Verify no histogram reported yet. + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentTime, 0u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSendContentTime, 0u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentDelayTime, 0u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSentContentCount, 0u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kTaskRunsPerCapture, 0u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kTaskDelayInMs, 1u); + + // The task stops before sends the captured content out. + GetContentCaptureTask()->SetTaskStopForTesting( + ContentCaptureTask::TaskState::kProcessCurrentSession); + RunContentCaptureTask(); + // Verify has one CaptureContentTime record. + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentTime, 1u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSendContentTime, 0u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentDelayTime, 0u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSentContentCount, 0u); + + // The task stops at kProcessRetryTask because the captured content + // needs to be sent with 2 batch. + GetContentCaptureTask()->SetTaskStopForTesting( + ContentCaptureTask::TaskState::kProcessRetryTask); + RunContentCaptureTask(); + // Verify has one CaptureContentTime, one SendContentTime and one + // CaptureContentDelayTime record. + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentTime, 1u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSendContentTime, 1u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentDelayTime, 1u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSentContentCount, 0u); + + // Run task until it stops, task will not capture content, because there is no + // content change. + GetContentCaptureTask()->SetTaskStopForTesting( + ContentCaptureTask::TaskState::kStop); + RunContentCaptureTask(); + // Verify has two SendContentTime records. + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentTime, 1u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSendContentTime, 2u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentDelayTime, 1u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSentContentCount, 0u); + + // Verify retry task won't count to TaskDelay metrics. + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kTaskDelayInMs, 1u); + + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kTaskRunsPerCapture, 1u); + // Verify the task ran 4 times, first run stopped before capturing content + // and 2nd run captured content, 3rd and 4th run sent the content out. + histograms.ExpectBucketCount( + ContentCaptureTaskHistogramReporter::kTaskRunsPerCapture, 4u, 1u); + + // Create a node and run task until it stops. + CreateTextNodeAndNotifyManager(); + GetContentCaptureTask()->SetTaskStopForTesting( + ContentCaptureTask::TaskState::kStop); + RunNextContentCaptureTask(); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentTime, 2u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSendContentTime, 3u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentDelayTime, 2u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSentContentCount, 0u); + + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kTaskRunsPerCapture, 2u); + // Verify the task ran 1 times for this session because we didn't explicitly + // stop it. + histograms.ExpectBucketCount( + ContentCaptureTaskHistogramReporter::kTaskRunsPerCapture, 1u, 1u); + + GetContentCaptureTask()->ClearDocumentSessionsForTesting(); + ThreadState::Current()->CollectAllGarbageForTesting(); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentTime, 2u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSendContentTime, 3u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kCaptureContentDelayTime, 2u); + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kSentContentCount, 1u); + // Verify total content has been sent. + histograms.ExpectBucketCount( + ContentCaptureTaskHistogramReporter::kSentContentCount, 9u, 1u); + + // Verify TaskDelay was recorded again for node change. + histograms.ExpectTotalCount( + ContentCaptureTaskHistogramReporter::kTaskDelayInMs, 2u); +} + TEST_P(ContentCaptureTest, RescheduleTask) { // This test assumes test runs much faster than task's long delay which is 5s. Persistent<ContentCaptureTask> task = GetContentCaptureTask();
diff --git a/third_party/blink/renderer/core/content_capture/task_session.cc b/third_party/blink/renderer/core/content_capture/task_session.cc index 19d4a751..011a807 100644 --- a/third_party/blink/renderer/core/content_capture/task_session.cc +++ b/third_party/blink/renderer/core/content_capture/task_session.cc
@@ -20,10 +20,15 @@ } // namespace -TaskSession::DocumentSession::DocumentSession(const Document& document) - : document_(&document) {} +TaskSession::DocumentSession::DocumentSession(const Document& document, + SentNodeCountCallback& callback) + : document_(&document), callback_(callback) {} -TaskSession::DocumentSession::~DocumentSession() = default; +TaskSession::DocumentSession::~DocumentSession() { + if (callback_.has_value()) { + callback_.value().Run(total_sent_nodes_); + } +} bool TaskSession::DocumentSession::AddDetachedNode(const Node& node) { // Only notify the detachment of visible node which shall be in |sent_nodes| @@ -183,7 +188,7 @@ const Document& doc) { DocumentSession* doc_session = GetDocumentSession(doc); if (!doc_session) { - doc_session = MakeGarbageCollected<DocumentSession>(doc); + doc_session = MakeGarbageCollected<DocumentSession>(doc, callback_); to_document_session_.insert(&doc, doc_session); } return *doc_session; @@ -201,4 +206,8 @@ visitor->Trace(to_document_session_); } +void TaskSession::ClearDocumentSessionsForTesting() { + to_document_session_.clear(); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/content_capture/task_session.h b/third_party/blink/renderer/core/content_capture/task_session.h index 3a2a793..f025d590 100644 --- a/third_party/blink/renderer/core/content_capture/task_session.h +++ b/third_party/blink/renderer/core/content_capture/task_session.h
@@ -6,7 +6,9 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_CONTENT_CAPTURE_TASK_SESSION_H_ #include <optional> +#include <utility> +#include "base/functional/callback.h" #include "base/memory/scoped_refptr.h" #include "cc/paint/node_id.h" #include "third_party/blink/public/platform/web_vector.h" @@ -44,7 +46,10 @@ // document is GC-ed, see TaskSession::to_document_session_. class DocumentSession final : public GarbageCollected<DocumentSession> { public: - explicit DocumentSession(const Document& document); + // The callback for total_sent_nodes_ metrics. + using SentNodeCountCallback = base::RepeatingCallback<void(int)>; + + DocumentSession(const Document& document, SentNodeCountCallback& call_back); ~DocumentSession(); // Add the given |node| to changed node set if the node was sent, return // true if succeed. @@ -103,6 +108,9 @@ bool first_data_has_sent_ = false; // This is for the metrics to record the total node that has been sent. int total_sent_nodes_ = 0; + // Histogram could be disabled in low time resolution OS, see + // base::TimeTicks::IsHighResolution and ContentCaptureTask. + std::optional<SentNodeCountCallback> callback_; }; TaskSession(); @@ -120,8 +128,15 @@ bool HasUnsentData() const { return has_unsent_data_; } + void SetSentNodeCountCallback( + DocumentSession::SentNodeCountCallback call_back) { + callback_ = std::move(call_back); + } + void Trace(Visitor*) const; + void ClearDocumentSessionsForTesting(); + private: void GroupCapturedContentByDocument( const Vector<cc::NodeInfo>& captured_content); @@ -136,6 +151,7 @@ // DocumentSession, this is used to avoid to iterate all document sessions // to find out if there is any of them. bool has_unsent_data_ = false; + DocumentSession::SentNodeCountCallback callback_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/css/css_font_face.cc b/third_party/blink/renderer/core/css/css_font_face.cc index a8f316ea..0fa45f5 100644 --- a/third_party/blink/renderer/core/css/css_font_face.cc +++ b/third_party/blink/renderer/core/css/css_font_face.cc
@@ -216,9 +216,8 @@ void CSSFontFace::Load() { FontDescription font_description; - FontFamily font_family; - font_family.SetFamily(font_face_->family(), FontFamily::Type::kFamilyName); - font_description.SetFamily(font_family); + font_description.SetFamily( + FontFamily(font_face_->family(), FontFamily::Type::kFamilyName)); Load(font_description); }
diff --git a/third_party/blink/renderer/core/css/css_math_expression_node.cc b/third_party/blink/renderer/core/css/css_math_expression_node.cc index ad9205bb..f3273cd 100644 --- a/third_party/blink/renderer/core/css/css_math_expression_node.cc +++ b/third_party/blink/renderer/core/css/css_math_expression_node.cc
@@ -1714,16 +1714,13 @@ result.value() *= number; break; } - case CSSMathOperator::kCalcSize: { - // TODO(https://crbug.com/313072): For now we handle only the case where - // the calculation converts to a PixelsAndPercent without any - // substitutions of the 'size' keyword from the basis (which may or may - // not itself convert to PixelsAndPercent). We could theoretically - // handle more cases, but this should be fine for now (as for many of - // the functions below) not to handle all cases. - result = operands_[1]->ToPixelsAndPercent(length_resolver); - break; - } + case CSSMathOperator::kCalcSize: + // While it looks like we might be able to handle some calc-size() cases + // here, we don't want to do because it would be difficult to avoid a + // has_explicit_percent state inside the calculation propagating to the + // result (which should not happen; only the has_explicit_percent state + // from the basis should do so). + return std::nullopt; case CSSMathOperator::kMin: case CSSMathOperator::kMax: case CSSMathOperator::kClamp:
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5 index 67d0cfe2..609c800 100644 --- a/third_party/blink/renderer/core/css/css_properties.json5 +++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -766,7 +766,6 @@ default_value: "EffectModel::kCompositeReplace", type_name: "EffectModel::CompositeOperation", valid_for_marker: true, - runtime_flag: "CSSAnimationComposition" }, { name: "animation-delay",
diff --git a/third_party/blink/renderer/core/css/css_value_list.h b/third_party/blink/renderer/core/css/css_value_list.h index d3ac4ee..da972d4 100644 --- a/third_party/blink/renderer/core/css/css_value_list.h +++ b/third_party/blink/renderer/core/css/css_value_list.h
@@ -33,6 +33,10 @@ public: using iterator = HeapVector<Member<const CSSValue>, 4>::iterator; using const_iterator = HeapVector<Member<const CSSValue>, 4>::const_iterator; + using reverse_iterator = + HeapVector<Member<const CSSValue>, 4>::reverse_iterator; + using const_reverse_iterator = + HeapVector<Member<const CSSValue>, 4>::const_reverse_iterator; static CSSValueList* CreateCommaSeparated() { return MakeGarbageCollected<CSSValueList>(kCommaSeparator); @@ -58,6 +62,10 @@ iterator end() { return values_.end(); } const_iterator begin() const { return values_.begin(); } const_iterator end() const { return values_.end(); } + reverse_iterator rbegin() { return values_.rbegin(); } + reverse_iterator rend() { return values_.rend(); } + const_reverse_iterator rbegin() const { return values_.rbegin(); } + const_reverse_iterator rend() const { return values_.rend(); } wtf_size_t length() const { return values_.size(); } const CSSValue& Item(wtf_size_t index) const { return *values_[index]; }
diff --git a/third_party/blink/renderer/core/css/font_face_cache_test.cc b/third_party/blink/renderer/core/css/font_face_cache_test.cc index 7996e5e..42bbae1 100644 --- a/third_party/blink/renderer/core/css/font_face_cache_test.cc +++ b/third_party/blink/renderer/core/css/font_face_cache_test.cc
@@ -99,11 +99,9 @@ FontSelectionValue stretch, FontSelectionValue style, FontSelectionValue weight) { - FontFamily font_family; - font_family.SetFamily(kFontNameForTesting, - FontFamily::InferredTypeFor(kFontNameForTesting)); FontDescription description; - description.SetFamily(font_family); + description.SetFamily(FontFamily( + kFontNameForTesting, FontFamily::InferredTypeFor(kFontNameForTesting))); description.SetStretch(stretch); description.SetStyle(style); description.SetWeight(weight);
diff --git a/third_party/blink/renderer/core/css/font_face_set_document.cc b/third_party/blink/renderer/core/css/font_face_set_document.cc index 03ebcf5..a88c3b5 100644 --- a/third_party/blink/renderer/core/css/font_face_set_document.cc +++ b/third_party/blink/renderer/core/css/font_face_set_document.cc
@@ -195,13 +195,10 @@ ComputedStyleBuilder builder = GetDocument()->GetStyleResolver().CreateComputedStyleBuilder(); - FontFamily font_family; - font_family.SetFamily( - FontFaceSet::DefaultFontFamily(), - FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())); - FontDescription default_font_description; - default_font_description.SetFamily(font_family); + default_font_description.SetFamily(FontFamily( + FontFaceSet::DefaultFontFamily(), + FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()))); default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize); default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize);
diff --git a/third_party/blink/renderer/core/css/font_face_set_worker.cc b/third_party/blink/renderer/core/css/font_face_set_worker.cc index 2fe795d..b8fa748 100644 --- a/third_party/blink/renderer/core/css/font_face_set_worker.cc +++ b/third_party/blink/renderer/core/css/font_face_set_worker.cc
@@ -84,13 +84,10 @@ return false; } - FontFamily font_family; - font_family.SetFamily( - FontFaceSet::DefaultFontFamily(), - FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())); - FontDescription default_font_description; - default_font_description.SetFamily(font_family); + default_font_description.SetFamily(FontFamily( + FontFaceSet::DefaultFontFamily(), + FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()))); default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize); default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize);
diff --git a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc index 7b965a17..8af1d6d7 100644 --- a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc +++ b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
@@ -222,7 +222,6 @@ CSSParserTokenRange& range, const CSSParserContext& context, const CSSParserLocalContext&) const { - DCHECK(RuntimeEnabledFeatures::CSSAnimationCompositionEnabled()); return css_parsing_utils::ConsumeCommaSeparatedList( css_parsing_utils::ConsumeIdent<CSSValueID::kReplace, CSSValueID::kAdd, CSSValueID::kAccumulate>, @@ -234,7 +233,6 @@ const LayoutObject*, bool allow_visited_style, CSSValuePhase value_phase) const { - DCHECK(RuntimeEnabledFeatures::CSSAnimationCompositionEnabled()); if (!style.Animations()) { return InitialValue(); }
diff --git a/third_party/blink/renderer/core/css/resolver/font_builder.cc b/third_party/blink/renderer/core/css/resolver/font_builder.cc index a1a98ee..347e5ee1 100644 --- a/third_party/blink/renderer/core/css/resolver/font_builder.cc +++ b/third_party/blink/renderer/core/css/resolver/font_builder.cc
@@ -54,11 +54,9 @@ } FontFamily FontBuilder::StandardFontFamily() const { - FontFamily family; const AtomicString& standard_font_family = StandardFontFamilyName(); - family.SetFamily(standard_font_family, - FontFamily::InferredTypeFor(standard_font_family)); - return family; + return FontFamily(standard_font_family, + FontFamily::InferredTypeFor(standard_font_family)); } AtomicString FontBuilder::StandardFontFamilyName() const {
diff --git a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc index 5a53e33..bc9ba74 100644 --- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc +++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
@@ -30,6 +30,7 @@ #include <memory> #include <utility> +#include "base/containers/adapters.h" #include "base/notreached.h" #include "build/build_config.h" #include "third_party/blink/renderer/core/css/basic_shape_functions.h" @@ -378,63 +379,70 @@ if (const auto* system_font = DynamicTo<cssvalue::CSSPendingSystemFontValue>(value)) { - desc.family.SetFamily(system_font->ResolveFontFamily(), - FontFamily::Type::kFamilyName); + desc.family = FontFamily(system_font->ResolveFontFamily(), + FontFamily::Type::kFamilyName); return desc; } - FontFamily* curr_family = nullptr; - #if BUILDFLAG(IS_MAC) - bool has_seen_system_ui = false; + bool count_blink_mac_system_font = false; #endif - for (auto& family : To<CSSValueList>(value)) { + AtomicString family_name; + FontFamily::Type family_type; + scoped_refptr<SharedFontFamily> next; + bool has_value = false; + + for (auto& family : base::Reversed(To<CSSValueList>(value))) { + AtomicString next_family_name; FontDescription::GenericFamilyType generic_family = FontDescription::kNoFamily; - AtomicString family_name; - if (!ConvertFontFamilyName(*family, generic_family, family_name, + if (!ConvertFontFamilyName(*family, generic_family, next_family_name, font_builder, document_for_count)) { continue; } - if (!curr_family) { - curr_family = &desc.family; - } else { - scoped_refptr<SharedFontFamily> new_family = SharedFontFamily::Create(); - curr_family->AppendFamily(new_family); - curr_family = new_family.get(); - } - // TODO(crbug.com/1065468): Get rid of GenericFamilyType. - bool is_generic = generic_family != FontDescription::kNoFamily || - IsA<CSSIdentifierValue>(*family); + const bool is_generic = generic_family != FontDescription::kNoFamily || + IsA<CSSIdentifierValue>(*family); + + // Take the previous value and wrap it in a `SharedFontFamily` adding to + // the linked list. + if (has_value) { + next = + SharedFontFamily::Create(family_name, family_type, std::move(next)); + } + family_name = next_family_name; + family_type = is_generic ? FontFamily::Type::kGenericFamily + : FontFamily::Type::kFamilyName; + has_value = true; + #if BUILDFLAG(IS_MAC) // TODO(https://crbug.com/554590): Remove this counter when it's no longer // necessary. - if (!has_seen_system_ui) { - has_seen_system_ui = - is_generic && family_name == font_family_names::kSystemUi; - } if (IsA<CSSFontFamilyValue>(*family) && family_name == FontCache::LegacySystemFontFamily()) { + count_blink_mac_system_font = true; family_name = font_family_names::kSystemUi; - if (document_for_count && !has_seen_system_ui) { - document_for_count->CountUse(WebFeature::kBlinkMacSystemFont); - } + } else if (is_generic && family_name == font_family_names::kSystemUi) { + // If system-ui comes before BlinkMacSystemFont don't use-count. + count_blink_mac_system_font = false; } #endif - curr_family->SetFamily(family_name, is_generic - ? FontFamily::Type::kGenericFamily - : FontFamily::Type::kFamilyName); - - if (is_generic) { + if (desc.generic_family == FontDescription::GenericFamilyType::kNoFamily) { desc.generic_family = generic_family; } } +#if BUILDFLAG(IS_MAC) + if (document_for_count && count_blink_mac_system_font) { + document_for_count->CountUse(WebFeature::kBlinkMacSystemFont); + } +#endif + + desc.family = FontFamily(family_name, family_type, std::move(next)); return desc; }
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 431a78a..a206a9e6 100644 --- a/third_party/blink/renderer/core/frame/attribution_src_loader.cc +++ b/third_party/blink/renderer/core/frame/attribution_src_loader.cc
@@ -21,6 +21,7 @@ #include "base/unguessable_token.h" #include "components/attribution_reporting/os_registration.h" #include "components/attribution_reporting/registrar.h" +#include "components/attribution_reporting/registrar_info.h" #include "components/attribution_reporting/registration_eligibility.mojom-shared.h" #include "components/attribution_reporting/registration_info.h" #include "components/attribution_reporting/source_registration.h" @@ -119,7 +120,7 @@ } base::expected<std::optional<attribution_reporting::Registrar>, - attribution_reporting::PreferredPlatformError> + attribution_reporting::RegistrationInfoError> GetPreferredPlatform(const HTTPHeaderMap& map, ExecutionContext* execution_context, uint64_t request_id) { @@ -964,18 +965,17 @@ headers.MaybeLogAllTriggerHeadersIgnored(loader_->local_frame_->DomWindow()); - auto registration_info = attribution_reporting::RegistrationInfo::Get( + auto registrar_info = attribution_reporting::RegistrarInfo::Get( !headers.web_source.IsNull(), !headers.os_source.IsNull(), /*is_source=*/true, preferred_platform, support_); - headers.LogIssues(loader_->local_frame_->DomWindow(), - registration_info.issues); + headers.LogIssues(loader_->local_frame_->DomWindow(), registrar_info.issues); - if (!registration_info.registrar.has_value()) { + if (!registrar_info.registrar.has_value()) { return; } - switch (registration_info.registrar.value()) { + switch (registrar_info.registrar.value()) { case attribution_reporting::Registrar::kWeb: { CHECK(!headers.web_source.IsNull()); base::UmaHistogramCounts1M("Conversions.HeadersSize.RegisterSource", @@ -1033,18 +1033,17 @@ headers.MaybeLogAllSourceHeadersIgnored(loader_->local_frame_->DomWindow()); - auto registration_info = attribution_reporting::RegistrationInfo::Get( + auto registrar_info = attribution_reporting::RegistrarInfo::Get( !headers.web_trigger.IsNull(), !headers.os_trigger.IsNull(), /*is_source=*/false, preferred_platform, support_); - headers.LogIssues(loader_->local_frame_->DomWindow(), - registration_info.issues); + headers.LogIssues(loader_->local_frame_->DomWindow(), registrar_info.issues); - if (!registration_info.registrar.has_value()) { + if (!registrar_info.registrar.has_value()) { return; } - switch (registration_info.registrar.value()) { + switch (registrar_info.registrar.value()) { case attribution_reporting::Registrar::kWeb: { CHECK(!headers.web_trigger.IsNull()); // Max header size is 256 KB, use 1M count to encapsulate.
diff --git a/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc b/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc index 5bae6be..320d3a1 100644 --- a/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc +++ b/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc
@@ -29,11 +29,9 @@ const ComputedStyle* CreateDefaultFontStyle(const Document& document) { const AtomicString& default_font_family = font_family_names::kSansSerif; - FontFamily font_family; - font_family.SetFamily(default_font_family, - FontFamily::InferredTypeFor(default_font_family)); FontDescription default_font_description; - default_font_description.SetFamily(font_family); + default_font_description.SetFamily(FontFamily( + default_font_family, FontFamily::InferredTypeFor(default_font_family))); default_font_description.SetSpecifiedSize(defaultFontSize); default_font_description.SetComputedSize(defaultFontSize); ComputedStyleBuilder builder =
diff --git a/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc b/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc index 77e045df..396b690 100644 --- a/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc +++ b/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc
@@ -273,8 +273,6 @@ HtmlFastPathResult parse_result() const { return parse_result_; } - bool bulk_insert_notify() const { return bulk_insert_notify_; } - private: Span source_; Document& document_; @@ -283,8 +281,6 @@ const Char* const end_ = source_.data() + source_.size(); const Char* pos_ = source_.data(); - const bool bulk_insert_notify_ = - RuntimeEnabledFeatures::HTMLParserFastPathBulkInsertNotifyEnabled(); bool failed_ = false; bool inside_of_tag_a_ = false; bool inside_of_tag_li_ = false; @@ -925,24 +921,14 @@ if (text.size() >= Text::kDefaultLengthLimit) { return Fail(HtmlFastPathResult::kFailedBigText); } - if (bulk_insert_notify_) { - parent->ParserAppendChildInDocumentFragment( - Text::Create(document_, scanned_text.TryCanonicalizeString())); - } else { - parent->ParserAppendChild( - Text::Create(document_, scanned_text.TryCanonicalizeString())); - } + parent->ParserAppendChildInDocumentFragment( + Text::Create(document_, scanned_text.TryCanonicalizeString())); } else if (scanned_text.escaped_text) { if (scanned_text.escaped_text->size() >= Text::kDefaultLengthLimit) { return Fail(HtmlFastPathResult::kFailedBigText); } - if (bulk_insert_notify_) { - parent->ParserAppendChildInDocumentFragment( - Text::Create(document_, scanned_text.escaped_text->AsString())); - } else { - parent->ParserAppendChild(Text::Create( - document_, String(scanned_text.escaped_text->AsString()))); - } + parent->ParserAppendChildInDocumentFragment( + Text::Create(document_, scanned_text.escaped_text->AsString())); } if (pos_ == end_) { return; @@ -963,11 +949,7 @@ if (failed_) { return; } - if (bulk_insert_notify_) { - parent->ParserAppendChildInDocumentFragment(child); - } else { - parent->ParserAppendChild(child); - } + parent->ParserAppendChildInDocumentFragment(child); } } } @@ -1445,9 +1427,7 @@ number_of_bytes_parsed = parser.NumberOfBytesParsed(); // The time needed to parse is typically < 1ms (even at the 99%). if (success) { - if (parser.bulk_insert_notify()) { - root_node.ParserFinishedBuildingDocumentFragment(); - } + root_node.ParserFinishedBuildingDocumentFragment(); UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES( "Blink.HTMLFastPathParser.SuccessfulParseTime2", parse_timer.Elapsed(), base::Microseconds(1), base::Milliseconds(10), 100);
diff --git a/third_party/blink/renderer/core/loader/cookie_jar.cc b/third_party/blink/renderer/core/loader/cookie_jar.cc index e98dcf74..9973bc0c 100644 --- a/third_party/blink/renderer/core/loader/cookie_jar.cc +++ b/third_party/blink/renderer/core/loader/cookie_jar.cc
@@ -73,7 +73,7 @@ } void CookieJar::OnBackendDisconnect() { - shared_memory_initialized_ = false; + shared_memory_version_client_.reset(); InvalidateCache(); } @@ -87,7 +87,8 @@ String value = g_empty_string; base::ReadOnlySharedMemoryRegion new_mapped_region; - const bool get_version_shared_memory = !shared_memory_initialized_; + const bool get_version_shared_memory = + !shared_memory_version_client_.has_value(); // Store the latest cookie version to update |last_version_| after attempting // to get the string. Will get updated once more by GetCookiesString() if an @@ -112,13 +113,8 @@ } last_cookies_ = value; } - - // TODO(crbug.com/1465996): Once determined whether getting an invalid region - // is possible add a DCHECK or comment depending. - if (!shared_memory_initialized_ && new_mapped_region.IsValid()) { - mapped_region_ = std::move(new_mapped_region); - mapping_ = mapped_region_.Map(); - shared_memory_initialized_ = true; + if (new_mapped_region.IsValid()) { + shared_memory_version_client_.emplace(std::move(new_mapped_region)); } base::UmaHistogramTimes("Blink.CookiesTime", timer.Elapsed()); UpdateCacheAfterGetRequest(cookie_url, value, new_version); @@ -153,18 +149,7 @@ void CookieJar::InvalidateCache() { last_cookies_hash_.reset(); last_cookies_ = String(); - last_version_ = network::mojom::blink::kInvalidCookieVersion; -} - -uint64_t CookieJar::GetSharedCookieVersion() { - if (shared_memory_initialized_) { - // Relaxed memory order since only the version is stored within the region - // and as such is the only data shared between processes. There is no - // re-ordering to worry about. - return mapping_.GetMemoryAs<const std::atomic<uint64_t>>()->load( - std::memory_order_relaxed); - } - return network::mojom::blink::kInvalidCookieVersion; + last_version_ = mojo::shared_memory_version::kInvalidVersion; } bool CookieJar::IPCNeeded() { @@ -173,11 +158,6 @@ return true; } - // An IPC is needed if there is no cached version. - if (last_version_ == network::mojom::blink::kInvalidCookieVersion) { - return true; - } - // |last_cookies_| can be null when converting the raw mojo payload failed. // (See ConvertUTF8ToUTF16() for details.) In that case use an IPC to request // another string to be safe. @@ -186,7 +166,9 @@ } // Cookie string has changed. - if (last_version_ < GetSharedCookieVersion()) { + if (shared_memory_version_client_.has_value() && + shared_memory_version_client_->SharedVersionIsGreaterThan( + last_version_)) { return true; } @@ -221,7 +203,7 @@ // An invalid version means no shared memory communication so assume changes // happened. const bool cookie_is_unchanged = - new_version != network::mojom::blink::kInvalidCookieVersion && + new_version != mojo::shared_memory_version::kInvalidVersion && last_version_ == new_version; if (last_cookies_hash_.has_value() && cookie_is_unchanged) {
diff --git a/third_party/blink/renderer/core/loader/cookie_jar.h b/third_party/blink/renderer/core/loader/cookie_jar.h index e0b864d..e387e76 100644 --- a/third_party/blink/renderer/core/loader/cookie_jar.h +++ b/third_party/blink/renderer/core/loader/cookie_jar.h
@@ -7,6 +7,7 @@ #include <optional> +#include "mojo/public/cpp/base/shared_memory_version.h" #include "services/network/public/mojom/restricted_cookie_manager.mojom-blink.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" @@ -41,7 +42,6 @@ private: void RequestRestrictedCookieManagerIfNeeded(); void OnBackendDisconnect(); - uint64_t GetSharedCookieVersion(); // Returns true if last_cookies_ is not guaranteed to be up to date and an IPC // is needed to get the current cookie string. @@ -77,11 +77,8 @@ // cookie access results. bool last_operation_was_set_{false}; - bool shared_memory_initialized_ = false; - base::ReadOnlySharedMemoryRegion mapped_region_; - base::ReadOnlySharedMemoryMapping mapping_; - - uint64_t last_version_ = network::mojom::blink::kInvalidCookieVersion; + std::optional<mojo::SharedMemoryVersionClient> shared_memory_version_client_; + uint64_t last_version_ = mojo::shared_memory_version::kInvalidVersion; // Last received cookie string. Null if there is no last cached-version. Can // be empty since that is a valid cookie string.
diff --git a/third_party/blink/renderer/core/page/drag_image.cc b/third_party/blink/renderer/core/page/drag_image.cc index 670f731..a0dafa1 100644 --- a/third_party/blink/renderer/core/page/drag_image.cc +++ b/third_party/blink/renderer/core/page/drag_image.cc
@@ -127,11 +127,9 @@ const AtomicString& family = LayoutThemeFontProvider::SystemFontFamily(CSSValueID::kNone); - FontFamily font_family; - font_family.SetFamily(family, FontFamily::InferredTypeFor(family)); - FontDescription description; - description.SetFamily(font_family); + description.SetFamily( + FontFamily(family, FontFamily::InferredTypeFor(family))); description.SetWeight(font_weight); description.SetSpecifiedSize(size); description.SetComputedSize(size);
diff --git a/third_party/blink/renderer/core/paint/embedded_object_painter.cc b/third_party/blink/renderer/core/paint/embedded_object_painter.cc index 2742510..b58289f 100644 --- a/third_party/blink/renderer/core/paint/embedded_object_painter.cc +++ b/third_party/blink/renderer/core/paint/embedded_object_painter.cc
@@ -32,11 +32,9 @@ const float size = LayoutThemeFontProvider::SystemFontSize( CSSValueID::kWebkitSmallControl, document); - FontFamily font_family; - font_family.SetFamily(family, FontFamily::InferredTypeFor(family)); - FontDescription font_description; - font_description.SetFamily(font_family); + font_description.SetFamily( + FontFamily(family, FontFamily::InferredTypeFor(family))); font_description.SetWeight(kBoldWeightValue); font_description.SetSpecifiedSize(size); font_description.SetComputedSize(size);
diff --git a/third_party/blink/renderer/core/paint/highlight_painter.cc b/third_party/blink/renderer/core/paint/highlight_painter.cc index 21470b2..fce3da4 100644 --- a/third_party/blink/renderer/core/paint/highlight_painter.cc +++ b/third_party/blink/renderer/core/paint/highlight_painter.cc
@@ -70,15 +70,6 @@ context.FillRect(pixel_snapped_rect, color, auto_dark_mode); } -void PaintRect(GraphicsContext& context, - const PhysicalOffset& location, - const PhysicalRect& rect, - const Color color, - const AutoDarkMode& auto_dark_mode) { - PaintRect(context, PhysicalRect(rect.offset + location, rect.size), color, - auto_dark_mode); -} - const HighlightRegistry* GetHighlightRegistry(const Node* node) { if (!node) return nullptr; @@ -484,10 +475,10 @@ originating_style_.UsedColorScheme(), document.GetColorProviderForPainting( originating_style_.UsedColorScheme())); - PaintRect(paint_info_.context, PhysicalOffset(box_origin_), - fragment_item_.LocalRect(text, paint_start_offset, - paint_end_offset), - color, background_auto_dark_mode_); + PaintRect( + paint_info_.context, + ComputeBackgroundRect(text, paint_start_offset, paint_end_offset), + color, background_auto_dark_mode_); break; } @@ -523,11 +514,10 @@ case DocumentMarker::kSuggestion: { const auto& styleable_marker = To<StyleableMarker>(*marker); if (phase == kBackground) { - PaintRect(paint_info_.context, PhysicalOffset(box_origin_), - fragment_item_.LocalRect(text, paint_start_offset, - paint_end_offset), - styleable_marker.BackgroundColor(), - background_auto_dark_mode_); + PaintRect( + paint_info_.context, + ComputeBackgroundRect(text, paint_start_offset, paint_end_offset), + styleable_marker.BackgroundColor(), background_auto_dark_mode_); break; } if (DocumentMarkerPainter::ShouldPaintMarkerUnderline( @@ -564,10 +554,10 @@ highlight_pseudo_marker.GetPseudoId(), highlight_pseudo_marker.GetPseudoArgument()); - PaintRect(paint_info_.context, PhysicalOffset(box_origin_), - fragment_item_.LocalRect(text, paint_start_offset, - paint_end_offset), - background_color, background_auto_dark_mode_); + PaintRect( + paint_info_.context, + ComputeBackgroundRect(text, paint_start_offset, paint_end_offset), + background_color, background_auto_dark_mode_); break; } @@ -852,9 +842,7 @@ StringView text, unsigned start_offset, unsigned end_offset) { - const PhysicalRect& rect = - fragment_item_.LocalRect(text, start_offset, end_offset); - return PhysicalRect(rect.offset + PhysicalOffset(box_origin_), rect.size); + return fragment_item_.LocalRect(text, start_offset, end_offset) + box_origin_; } void HighlightPainter::PaintHighlightOverlays(
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc index f97b727..58901c5 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc
@@ -1255,6 +1255,8 @@ GetLayoutBox()->StyleRef().ColorSchemeFlagsIsNormal() && GetLayoutBox()->GetDocument().GetPreferredColorScheme() == mojom::blink::PreferredColorScheme::kDark) { + UseCounter::Count(GetLayoutBox()->GetDocument(), + WebFeature::kUsedColorSchemeRootScrollbarsDark); return mojom::blink::ColorScheme::kDark; }
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc index 3fc512d..d1d6497 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc
@@ -1858,6 +1858,34 @@ } } +TEST_P(PaintLayerScrollableAreaTest, + UsedColorSchemeRootScrollbarsUseCounterUpdated) { + USE_NON_OVERLAY_SCROLLBARS_OR_QUIT(); + + SetHtmlInnerHTML(R"HTML( + <style> + :root { height: 1000px; } + </style> + )HTML"); + + ASSERT_EQ(GetDocument().GetPreferredColorScheme(), + mojom::blink::PreferredColorScheme::kLight); + + const auto* root_scrollable_area = GetLayoutView().GetScrollableArea(); + ASSERT_TRUE(root_scrollable_area); + + // Change color scheme to dark. + ColorSchemeHelper color_scheme_helper(GetDocument()); + color_scheme_helper.SetPreferredColorScheme( + mojom::blink::PreferredColorScheme::kDark); + UpdateAllLifecyclePhasesForTest(); + + root_scrollable_area->UsedColorSchemeScrollbars(); + EXPECT_EQ(GetDocument().IsUseCounted( + WebFeature::kUsedColorSchemeRootScrollbarsDark), + RuntimeEnabledFeatures::UsedColorSchemeRootScrollbarsEnabled()); +} + // TODO(crbug.com/1020913): Actually this tests a situation that should not // exist but it does exist due to different or incorrect rounding methods for // scroll geometries. This test can be converted to test the correct behavior
diff --git a/third_party/blink/renderer/modules/manifest/manifest_manager.cc b/third_party/blink/renderer/modules/manifest/manifest_manager.cc index a1ee753e..e948e160 100644 --- a/third_party/blink/renderer/modules/manifest/manifest_manager.cc +++ b/third_party/blink/renderer/modules/manifest/manifest_manager.cc
@@ -49,7 +49,6 @@ ManifestManager::ManifestManager(LocalDOMWindow& window) : Supplement<LocalDOMWindow>(window), ExecutionContextLifecycleObserver(&window), - may_have_manifest_(false), manifest_dirty_(true), receivers_(this, GetExecutionContext()) { if (window.GetFrame()->IsMainFrame()) { @@ -130,11 +129,6 @@ return; } - if (!may_have_manifest_) { - std::move(callback).Run(KURL(), mojom::blink::ManifestPtr(), nullptr); - return; - } - if (!manifest_dirty_) { std::move(callback).Run(manifest_url_, manifest_, manifest_debug_info_.get()); @@ -151,7 +145,6 @@ } void ManifestManager::DidChangeManifest() { - may_have_manifest_ = true; manifest_dirty_ = true; manifest_url_ = KURL(); manifest_debug_info_ = nullptr;
diff --git a/third_party/blink/renderer/modules/manifest/manifest_manager.h b/third_party/blink/renderer/modules/manifest/manifest_manager.h index d43d5095..517f8ec8 100644 --- a/third_party/blink/renderer/modules/manifest/manifest_manager.h +++ b/third_party/blink/renderer/modules/manifest/manifest_manager.h
@@ -29,6 +29,12 @@ // the ManifestParser in order to do so. // // Consumers should use the mojo ManifestManager interface to use this class. +// +// Manifests returned from this class can only be empty if there is a network +// fetching error, parsing error, or frame/CORS/opaque origin related issue. +// Otherwise the manifest will always contain a `start_url`, `id`, and `scope` +// populated, as the parser will always default based on the document url if +// they are not specified in the json. class MODULES_EXPORT ManifestManager : public GarbageCollected<ManifestManager>, public Supplement<LocalDOMWindow>, @@ -100,12 +106,6 @@ Member<ManifestFetcher> fetcher_; Member<ManifestChangeNotifier> manifest_change_notifier_; - // Whether the window may have an associated Manifest. If true, the frame - // may have a manifest, if false, it can't have one. This boolean is true when - // DidChangeManifest() is called, if it is never called, it means that the - // associated document has no <link rel="manifest">. - bool may_have_manifest_; - // Whether the current Manifest is dirty. bool manifest_dirty_;
diff --git a/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet.cc b/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet.cc index d111a17c..3b357f2 100644 --- a/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet.cc +++ b/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet.cc
@@ -194,6 +194,8 @@ return; } + LogSharedStorageWorkletError( + SharedStorageWorkletErrorType::kSuccess); base::UmaHistogramMediumTimes( "Storage.SharedStorage.Document.Timing.AddModule", base::TimeTicks::Now() - start_time); @@ -474,6 +476,8 @@ return; } + LogSharedStorageWorkletError( + SharedStorageWorkletErrorType::kSuccess); base::UmaHistogramMediumTimes( "Storage.SharedStorage.Document.Timing.SelectURL", base::TimeTicks::Now() - start_time); @@ -589,6 +593,8 @@ return; } + LogSharedStorageWorkletError( + SharedStorageWorkletErrorType::kSuccess); base::UmaHistogramMediumTimes( "Storage.SharedStorage.Document.Timing.Run", base::TimeTicks::Now() - start_time);
diff --git a/third_party/blink/renderer/platform/exported/web_font_description.cc b/third_party/blink/renderer/platform/exported/web_font_description.cc index 4103264..c7f86f6 100644 --- a/third_party/blink/renderer/platform/exported/web_font_description.cc +++ b/third_party/blink/renderer/platform/exported/web_font_description.cc
@@ -49,13 +49,10 @@ } WebFontDescription::operator FontDescription() const { - FontFamily font_family; - font_family.SetFamily(family, family_is_generic - ? FontFamily::Type::kGenericFamily - : FontFamily::Type::kFamilyName); - FontDescription desc; - desc.SetFamily(font_family); + desc.SetFamily(FontFamily(family, family_is_generic + ? FontFamily::Type::kGenericFamily + : FontFamily::Type::kFamilyName)); desc.SetGenericFamily( static_cast<FontDescription::GenericFamilyType>(generic_family)); desc.SetSpecifiedSize(size);
diff --git a/third_party/blink/renderer/platform/fonts/bitmap_glyphs_block_list_test.cc b/third_party/blink/renderer/platform/fonts/bitmap_glyphs_block_list_test.cc index 931b684..9ea1ac3 100644 --- a/third_party/blink/renderer/platform/fonts/bitmap_glyphs_block_list_test.cc +++ b/third_party/blink/renderer/platform/fonts/bitmap_glyphs_block_list_test.cc
@@ -18,10 +18,8 @@ bool block_listed_expected) { FontCache& font_cache = FontCache::Get(); FontDescription font_description; - FontFamily font_family; - font_family.SetFamily(windows_family_name, - FontFamily::InferredTypeFor(windows_family_name)); - font_description.SetFamily(font_family); + font_description.SetFamily(FontFamily( + windows_family_name, FontFamily::InferredTypeFor(windows_family_name))); const SimpleFontData* simple_font_data = font_cache.GetFontData(font_description, windows_family_name); ASSERT_TRUE(simple_font_data);
diff --git a/third_party/blink/renderer/platform/fonts/fallback_list_composite_key_test.cc b/third_party/blink/renderer/platform/fonts/fallback_list_composite_key_test.cc index 46c06a9..a57831e 100644 --- a/third_party/blink/renderer/platform/fonts/fallback_list_composite_key_test.cc +++ b/third_party/blink/renderer/platform/fonts/fallback_list_composite_key_test.cc
@@ -13,8 +13,8 @@ TEST_F(FallbackListCompositeKeyTest, AllFeatures) { FontDescription font_description; - font_description.FirstFamily().SetFamily(font_family_names::kSerif, - FontFamily::Type::kGenericFamily); + font_description.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kGenericFamily)); FallbackListCompositeKey key_a = FallbackListCompositeKey(font_description); // Test every relevant property except font families, which are tested in @@ -240,49 +240,47 @@ TEST_F(FallbackListCompositeKeyTest, FontFamilies) { // One family in both descriptors FontDescription font_description_a; - FontFamily* family_a = &font_description_a.FirstFamily(); - family_a->SetFamily(font_family_names::kSerif, - FontFamily::Type::kGenericFamily); + font_description_a.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kGenericFamily)); FallbackListCompositeKey key_a = FallbackListCompositeKey(font_description_a); FontDescription font_description_b; - FontFamily* family_b = &font_description_b.FirstFamily(); - family_b->SetFamily(font_family_names::kSerif, - FontFamily::Type::kGenericFamily); + font_description_b.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kGenericFamily)); FallbackListCompositeKey key_b = FallbackListCompositeKey(font_description_b); EXPECT_EQ(key_a, key_b); // Differing family lists - scoped_refptr<SharedFontFamily> next_family_a = SharedFontFamily::Create(); - next_family_a->SetFamily(AtomicString("CustomFont1"), - FontFamily::Type::kFamilyName); - family_a->AppendFamily(next_family_a); - family_a = next_family_a.get(); + scoped_refptr<SharedFontFamily> next_family_a = SharedFontFamily::Create( + AtomicString("CustomFont1"), FontFamily::Type::kFamilyName); + font_description_a.SetFamily(FontFamily(font_family_names::kSerif, + FontFamily::Type::kGenericFamily, + next_family_a)); key_a = FallbackListCompositeKey(font_description_a); EXPECT_NE(key_a, key_b); // Same family lists with multiple entries - scoped_refptr<SharedFontFamily> next_family_b = SharedFontFamily::Create(); - next_family_b->SetFamily(AtomicString("CustomFont1"), - FontFamily::Type::kFamilyName); - family_b->AppendFamily(next_family_b); - family_b = next_family_b.get(); + scoped_refptr<SharedFontFamily> next_family_b = SharedFontFamily::Create( + AtomicString("CustomFont1"), FontFamily::Type::kFamilyName); + font_description_b.SetFamily(FontFamily(font_family_names::kSerif, + FontFamily::Type::kGenericFamily, + next_family_b)); key_b = FallbackListCompositeKey(font_description_b); EXPECT_EQ(key_a, key_b); // Same number of entries, different names - next_family_a = SharedFontFamily::Create(); - next_family_a->SetFamily(AtomicString("CustomFont2a"), - FontFamily::Type::kFamilyName); - family_a->AppendFamily(next_family_a); - family_a = next_family_a.get(); + next_family_a = SharedFontFamily::Create(AtomicString("CustomFont1a"), + FontFamily::Type::kFamilyName); + font_description_a.SetFamily(FontFamily(font_family_names::kSerif, + FontFamily::Type::kGenericFamily, + next_family_a)); key_a = FallbackListCompositeKey(font_description_a); - next_family_b = SharedFontFamily::Create(); - next_family_b->SetFamily(AtomicString("CustomFont2b"), - FontFamily::Type::kFamilyName); - family_b->AppendFamily(next_family_b); - family_b = next_family_b.get(); + next_family_a = SharedFontFamily::Create(AtomicString("CustomFont1b"), + FontFamily::Type::kFamilyName); + font_description_b.SetFamily(FontFamily(font_family_names::kSerif, + FontFamily::Type::kGenericFamily, + next_family_b)); key_b = FallbackListCompositeKey(font_description_b); EXPECT_NE(key_a, key_b); } @@ -292,14 +290,13 @@ // CSS generic family and a quoted family name. // See crbug.com/1408485 FontDescription font_description_a; - FontFamily* family_a = &font_description_a.FirstFamily(); - family_a->SetFamily(font_family_names::kSerif, - FontFamily::Type::kGenericFamily); + font_description_a.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kGenericFamily)); FallbackListCompositeKey key_a = FallbackListCompositeKey(font_description_a); FontDescription font_description_b; - FontFamily* family_b = &font_description_b.FirstFamily(); - family_b->SetFamily(font_family_names::kSerif, FontFamily::Type::kFamilyName); + font_description_b.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kFamilyName)); FallbackListCompositeKey key_b = FallbackListCompositeKey(font_description_b); EXPECT_NE(key_a, key_b);
diff --git a/third_party/blink/renderer/platform/fonts/font_description.h b/third_party/blink/renderer/platform/fonts/font_description.h index 37199b3..e2069ee 100644 --- a/third_party/blink/renderer/platform/fonts/font_description.h +++ b/third_party/blink/renderer/platform/fonts/font_description.h
@@ -195,7 +195,6 @@ FamilyDescription GetFamilyDescription() const { return FamilyDescription(GenericFamily(), Family()); } - FontFamily& FirstFamily() { return family_list_; } const FontFamily& FirstFamily() const { return family_list_; } Size GetSize() const { return Size(KeywordSize(), SpecifiedSize(), IsAbsoluteSize()); @@ -451,10 +450,6 @@ return fields_.subpixel_ascent_descent_; } - void SetHashCategory(HashCategory category) { - fields_.hash_category_ = category; - } - HashCategory GetHashCategory() const { return static_cast<HashCategory>(fields_.hash_category_); }
diff --git a/third_party/blink/renderer/platform/fonts/font_description_test.cc b/third_party/blink/renderer/platform/fonts/font_description_test.cc index 33c9f590..4771944d 100644 --- a/third_party/blink/renderer/platform/fonts/font_description_test.cc +++ b/third_party/blink/renderer/platform/fonts/font_description_test.cc
@@ -190,8 +190,8 @@ TEST_F(FontDescriptionTest, AllFeaturesHash) { FontDescription font_description; - font_description.FirstFamily().SetFamily(font_family_names::kSerif, - FontFamily::Type::kGenericFamily); + font_description.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kGenericFamily)); unsigned key_a = font_description.GetHash(); // Test every relevant property except font families, which are tested in @@ -418,13 +418,10 @@ FontDescription a; FontDescription b(a); - FontFamily* family_a = &a.FirstFamily(); - family_a->SetFamily(font_family_names::kSerif, - FontFamily::Type::kGenericFamily); - - FontFamily* family_b = &b.FirstFamily(); - family_b->SetFamily(font_family_names::kSerif, - FontFamily::Type::kGenericFamily); + a.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kGenericFamily)); + b.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kGenericFamily)); unsigned key_a = a.GetHash(); unsigned key_b = b.GetHash(); @@ -432,35 +429,31 @@ EXPECT_EQ(key_a, key_b); // Differing family lists - scoped_refptr<SharedFontFamily> next_family_a = SharedFontFamily::Create(); - next_family_a->SetFamily(AtomicString("CustomFont1"), - FontFamily::Type::kFamilyName); - family_a->AppendFamily(next_family_a); - family_a = next_family_a.get(); + scoped_refptr<SharedFontFamily> next_family_a = SharedFontFamily::Create( + AtomicString("CustomFont1"), FontFamily::Type::kFamilyName); + a.SetFamily(FontFamily(font_family_names::kSerif, + FontFamily::Type::kGenericFamily, next_family_a)); key_a = a.GetHash(); EXPECT_NE(key_a, key_b); // Same family lists with multiple entries - scoped_refptr<SharedFontFamily> next_family_b = SharedFontFamily::Create(); - next_family_b->SetFamily(AtomicString("CustomFont1"), - FontFamily::Type::kFamilyName); - family_b->AppendFamily(next_family_b); - family_b = next_family_b.get(); + scoped_refptr<SharedFontFamily> next_family_b = SharedFontFamily::Create( + AtomicString("CustomFont1"), FontFamily::Type::kFamilyName); + b.SetFamily(FontFamily(font_family_names::kSerif, + FontFamily::Type::kGenericFamily, next_family_b)); key_b = b.GetHash(); EXPECT_EQ(key_a, key_b); // Same number of entries, different names - next_family_a = SharedFontFamily::Create(); - next_family_a->SetFamily(AtomicString("CustomFont2a"), - FontFamily::Type::kFamilyName); - family_a->AppendFamily(next_family_a); - family_a = next_family_a.get(); + next_family_a = SharedFontFamily::Create(AtomicString("CustomFont1a"), + FontFamily::Type::kFamilyName); + a.SetFamily(FontFamily(font_family_names::kSerif, + FontFamily::Type::kGenericFamily, next_family_a)); key_a = a.GetHash(); - next_family_b = SharedFontFamily::Create(); - next_family_b->SetFamily(AtomicString("CustomFont2b"), - FontFamily::Type::kFamilyName); - family_b->AppendFamily(next_family_b); - family_b = next_family_b.get(); + next_family_b = SharedFontFamily::Create(AtomicString("CustomFont1b"), + FontFamily::Type::kFamilyName); + b.SetFamily(FontFamily(font_family_names::kSerif, + FontFamily::Type::kGenericFamily, next_family_b)); key_b = b.GetHash(); EXPECT_NE(key_a, key_b); } @@ -472,11 +465,10 @@ FontDescription a; FontDescription b(a); - FontFamily* family_a = &a.FirstFamily(); - family_a->SetFamily(font_family_names::kSerif, - FontFamily::Type::kGenericFamily); - FontFamily* family_b = &b.FirstFamily(); - family_b->SetFamily(font_family_names::kSerif, FontFamily::Type::kFamilyName); + a.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kGenericFamily)); + b.SetFamily( + FontFamily(font_family_names::kSerif, FontFamily::Type::kFamilyName)); unsigned key_a = a.GetHash(); unsigned key_b = b.GetHash(); @@ -487,12 +479,10 @@ TEST_F(FontDescriptionTest, ToString) { FontDescription description; - FontFamily family; - family.SetFamily(AtomicString("A"), FontFamily::Type::kFamilyName); - scoped_refptr<SharedFontFamily> b_family = SharedFontFamily::Create(); - b_family->SetFamily(AtomicString("B"), FontFamily::Type::kFamilyName); - family.AppendFamily(b_family); - description.SetFamily(family); + description.SetFamily( + FontFamily(AtomicString("A"), FontFamily::Type::kFamilyName, + SharedFontFamily::Create(AtomicString("B"), + FontFamily::Type::kFamilyName))); description.SetLocale(LayoutLocale::Get(AtomicString("no"))); @@ -554,13 +544,11 @@ FontDescription description2; description1.SetWeight(FontSelectionValue(100)); - FontFamily family; - family.SetFamily(AtomicString("A"), FontFamily::Type::kFamilyName); - scoped_refptr<SharedFontFamily> b_family = SharedFontFamily::Create(); - b_family->SetFamily(AtomicString("B"), FontFamily::Type::kFamilyName); - family.AppendFamily(b_family); FontDescription description3; - description3.SetFamily(family); + description3.SetFamily( + FontFamily(AtomicString("A"), FontFamily::Type::kFamilyName, + SharedFontFamily::Create(AtomicString("B"), + FontFamily::Type::kFamilyName))); EXPECT_TRUE(map.insert(description1, 1).is_new_entry); EXPECT_FALSE(map.insert(description1, 1).is_new_entry);
diff --git a/third_party/blink/renderer/platform/fonts/font_fallback_list.cc b/third_party/blink/renderer/platform/fonts/font_fallback_list.cc index 3fcc5dd..ade6d6d 100644 --- a/third_party/blink/renderer/platform/fonts/font_fallback_list.cc +++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.cc
@@ -178,9 +178,8 @@ if (font_selector_) { // Try the user's preferred standard font. - FontFamily font_family; - font_family.SetFamily(font_family_names::kWebkitStandard, - FontFamily::Type::kGenericFamily); + FontFamily font_family(font_family_names::kWebkitStandard, + FontFamily::Type::kGenericFamily); if (const FontData* data = font_selector_->GetFontData(font_description, font_family)) { return data;
diff --git a/third_party/blink/renderer/platform/fonts/font_family.cc b/third_party/blink/renderer/platform/fonts/font_family.cc index 6166a0b..2949e1be 100644 --- a/third_party/blink/renderer/platform/fonts/font_family.cc +++ b/third_party/blink/renderer/platform/fonts/font_family.cc
@@ -49,20 +49,6 @@ return true; } -wtf_size_t FontFamily::CountNames() const { - wtf_size_t count = 0; - for (const FontFamily* font_family = this; font_family; - font_family = font_family->Next()) - ++count; - return count; -} - -void FontFamily::AppendFamily(AtomicString family_name, Type family_type) { - scoped_refptr<SharedFontFamily> appended_family = SharedFontFamily::Create(); - appended_family->SetFamily(family_name, family_type); - AppendFamily(appended_family); -} - String FontFamily::ToString() const { StringBuilder builder; builder.Append(family_name_);
diff --git a/third_party/blink/renderer/platform/fonts/font_family.h b/third_party/blink/renderer/platform/fonts/font_family.h index b285c4c..4a5ed58 100644 --- a/third_party/blink/renderer/platform/fonts/font_family.h +++ b/third_party/blink/renderer/platform/fonts/font_family.h
@@ -39,16 +39,18 @@ DISALLOW_NEW(); public: - FontFamily() = default; - ~FontFamily(); - // https://drafts.csswg.org/css-fonts/#font-family-prop enum class Type : uint8_t { kFamilyName, kGenericFamily }; - void SetFamily(const AtomicString& family_name, Type family_type) { - family_name_ = family_name; - family_type_ = family_type; - } + FontFamily(const AtomicString& family_name, + Type family_type, + scoped_refptr<SharedFontFamily> next = nullptr) + : family_name_(family_name), + next_(std::move(next)), + family_type_(family_type) {} + FontFamily() = default; + ~FontFamily(); + // Return this font family's name. Note that it is never quoted nor escaped. // For web-exposed serialization, please rely instead on the functions // ComputedStyleUtils::ValueForFontFamily(const FontFamily&) and @@ -57,13 +59,8 @@ const AtomicString& FamilyName() const { return family_name_; } bool FamilyIsGeneric() const { return family_type_ == Type::kGenericFamily; } - // Returns number of linked `FontFamily` including `this`, so return value is - // greater than or equal to 1. When `Next()` is `nullptr`, return value is 1. - wtf_size_t CountNames() const; const FontFamily* Next() const; - void AppendFamily(scoped_refptr<SharedFontFamily>); - void AppendFamily(AtomicString family_name, Type family_type); scoped_refptr<SharedFontFamily> ReleaseNext(); bool IsPrewarmed() const { return is_prewarmed_; } @@ -96,12 +93,19 @@ SharedFontFamily(const SharedFontFamily&) = delete; SharedFontFamily& operator=(const SharedFontFamily&) = delete; - static scoped_refptr<SharedFontFamily> Create() { - return base::AdoptRef(new SharedFontFamily); + static scoped_refptr<SharedFontFamily> Create( + const AtomicString& family_name, + Type family_type, + scoped_refptr<SharedFontFamily> next = nullptr) { + return base::AdoptRef( + new SharedFontFamily(family_name, family_type, std::move(next))); } private: - SharedFontFamily() = default; + SharedFontFamily(const AtomicString& family_name, + Type family_type, + scoped_refptr<SharedFontFamily> next) + : FontFamily(family_name, family_type, std::move(next)) {} }; PLATFORM_EXPORT bool operator==(const FontFamily&, const FontFamily&); @@ -121,10 +125,6 @@ return next_.get(); } -inline void FontFamily::AppendFamily(scoped_refptr<SharedFontFamily> family) { - next_ = std::move(family); -} - inline scoped_refptr<SharedFontFamily> FontFamily::ReleaseNext() { return std::move(next_); }
diff --git a/third_party/blink/renderer/platform/fonts/font_family_test.cc b/third_party/blink/renderer/platform/fonts/font_family_test.cc index de15d638..4754b67 100644 --- a/third_party/blink/renderer/platform/fonts/font_family_test.cc +++ b/third_party/blink/renderer/platform/fonts/font_family_test.cc
@@ -8,57 +8,25 @@ namespace blink { -namespace { - -FontFamily* CreateAndAppendFamily(FontFamily& parent, - const char* family_name, - FontFamily::Type family_type) { - scoped_refptr<SharedFontFamily> family = SharedFontFamily::Create(); - family->SetFamily(AtomicString(family_name), family_type); - parent.AppendFamily(family); - return family.get(); -} - -} // namespace - -TEST(FontFamilyTest, CountNames) { - { - FontFamily family; - EXPECT_EQ(1u, family.CountNames()); - } - { - FontFamily family; - family.SetFamily(AtomicString("A"), FontFamily::Type::kFamilyName); - CreateAndAppendFamily(family, "B", FontFamily::Type::kFamilyName); - EXPECT_EQ(2u, family.CountNames()); - } - { - FontFamily family; - family.SetFamily(AtomicString("A"), FontFamily::Type::kFamilyName); - FontFamily* b_family = - CreateAndAppendFamily(family, "B", FontFamily::Type::kFamilyName); - CreateAndAppendFamily(*b_family, "C", FontFamily::Type::kFamilyName); - EXPECT_EQ(3u, family.CountNames()); - } -} - TEST(FontFamilyTest, ToString) { { FontFamily family; EXPECT_EQ("", family.ToString()); } { - FontFamily family; - family.SetFamily(AtomicString("A"), FontFamily::Type::kFamilyName); - CreateAndAppendFamily(family, "B", FontFamily::Type::kFamilyName); + scoped_refptr<SharedFontFamily> b = SharedFontFamily::Create( + AtomicString("B"), FontFamily::Type::kFamilyName); + FontFamily family(AtomicString("A"), FontFamily::Type::kFamilyName, + std::move(b)); EXPECT_EQ("A, B", family.ToString()); } { - FontFamily family; - family.SetFamily(AtomicString("A"), FontFamily::Type::kFamilyName); - FontFamily* b_family = - CreateAndAppendFamily(family, "B", FontFamily::Type::kFamilyName); - CreateAndAppendFamily(*b_family, "C", FontFamily::Type::kFamilyName); + scoped_refptr<SharedFontFamily> c = SharedFontFamily::Create( + AtomicString("C"), FontFamily::Type::kFamilyName); + scoped_refptr<SharedFontFamily> b = SharedFontFamily::Create( + AtomicString("B"), FontFamily::Type::kFamilyName, std::move(c)); + FontFamily family(AtomicString("A"), FontFamily::Type::kFamilyName, + std::move(b)); EXPECT_EQ("A, B, C", family.ToString()); } }
diff --git a/third_party/blink/renderer/platform/fonts/shaping/han_kerning_test.cc b/third_party/blink/renderer/platform/fonts/shaping/han_kerning_test.cc index 089d39f..9b2e03a1 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/han_kerning_test.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/han_kerning_test.cc
@@ -144,10 +144,9 @@ bool is_antialiased_text_enabled_; } enable_antialias_text; - FontFamily family; - family.SetFamily(AtomicString("Yu Gothic"), FontFamily::Type::kFamilyName); FontDescription font_description; - font_description.SetFamily(family); + font_description.SetFamily( + FontFamily(AtomicString("Yu Gothic"), FontFamily::Type::kFamilyName)); const float specified_size = 16.f * 1.03f; font_description.SetSpecifiedSize(specified_size); const float computed_size = specified_size * 1.25f;
diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper_test.cc b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper_test.cc index c88e45e..d50d258 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper_test.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper_test.cc
@@ -96,21 +96,10 @@ void TearDown() override {} void SelectDevanagariFont() { - FontFamily devanagari_family; - // Windows 10 - devanagari_family.SetFamily(AtomicString("Nirmala UI"), - FontFamily::Type::kFamilyName); - // Windows 7 - devanagari_family.AppendFamily(AtomicString("Mangal"), - FontFamily::Type::kFamilyName); - // Linux - devanagari_family.AppendFamily(AtomicString("Lohit Devanagari"), - FontFamily::Type::kFamilyName); - // Mac - devanagari_family.AppendFamily(AtomicString("ITF Devanagari"), - FontFamily::Type::kFamilyName); - - font_description.SetFamily(devanagari_family); + font_description.SetFamily( + FontFamily(AtomicString("Nirmala UI"), FontFamily::Type::kFamilyName, + SharedFontFamily::Create(AtomicString("ITF Devanagari"), + FontFamily::Type::kFamilyName))); } Font CreateAhem(float size) { @@ -1874,9 +1863,8 @@ // // [1] RoundHarfBuzzPosition() @harfbuzz_shaper.cc FontDescription font_description_copy(font_description); - FontFamily family; - family.SetFamily(font_family_names::kArial, FontFamily::Type::kFamilyName); - font_description_copy.SetFamily(family); + font_description_copy.SetFamily( + FontFamily(font_family_names::kArial, FontFamily::Type::kFamilyName)); Font font = Font(font_description_copy); String string(u"AVOID"); @@ -2066,9 +2054,8 @@ // Setting the font family is not strictly necessary as fonts automatically // fallback, but it helps keeping the whole string in a run (i.e., shapes // surrounding characters with the same font.) - FontFamily family; - family.SetFamily(AtomicString("Geneva"), FontFamily::Type::kFamilyName); - font_description.SetFamily(family); + font_description.SetFamily( + FontFamily(AtomicString("Geneva"), FontFamily::Type::kFamilyName)); Font font(font_description); HarfBuzzShaper shaper(string);
diff --git a/third_party/blink/renderer/platform/fonts/shaping/shaping_line_breaker_test.cc b/third_party/blink/renderer/platform/fonts/shaping/shaping_line_breaker_test.cc index 0dd8b6b..508ba09 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/shaping_line_breaker_test.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/shaping_line_breaker_test.cc
@@ -63,21 +63,10 @@ } void SelectLucidaFont() { - FontFamily lucida_family; - // Windows 10 - lucida_family.SetFamily(AtomicString("Lucida Grande"), - FontFamily::Type::kFamilyName); - // Windows 7 - lucida_family.AppendFamily(AtomicString("Lucida Grande"), - FontFamily::Type::kFamilyName); - // Linux - lucida_family.AppendFamily(AtomicString("Lucida Medium"), - FontFamily::Type::kFamilyName); - // Mac - lucida_family.AppendFamily(AtomicString("Lucida Medium"), - FontFamily::Type::kFamilyName); - - font_description.SetFamily(lucida_family); + font_description.SetFamily( + FontFamily(AtomicString("Lucida Grande"), FontFamily::Type::kFamilyName, + SharedFontFamily::Create(AtomicString("Lucida Medium"), + FontFamily::Type::kFamilyName))); } void TearDown() override {}
diff --git a/third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h b/third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h index cc9f9429..569764df 100644 --- a/third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h +++ b/third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h
@@ -64,7 +64,7 @@ private: std::optional<PaintController> own_paint_controller_; - raw_ptr<PaintController> paint_controller_; + raw_ptr<PaintController, DanglingUntriaged> paint_controller_; GraphicsContext context_; };
diff --git a/third_party/blink/renderer/platform/graphics/placeholder_image.cc b/third_party/blink/renderer/platform/graphics/placeholder_image.cc index 53f8181..454500a 100644 --- a/third_party/blink/renderer/platform/graphics/placeholder_image.cc +++ b/third_party/blink/renderer/platform/graphics/placeholder_image.cc
@@ -85,23 +85,18 @@ } FontDescription CreatePlaceholderFontDescription(float scale_factor) { + scoped_refptr<SharedFontFamily> arial = SharedFontFamily::Create( + font_family_names::kArial, FontFamily::Type::kFamilyName); + scoped_refptr<SharedFontFamily> helvetica = SharedFontFamily::Create( + font_family_names::kHelvetica, FontFamily::Type::kFamilyName, arial); + scoped_refptr<SharedFontFamily> helvetica_neue = + SharedFontFamily::Create(font_family_names::kHelveticaNeue, + FontFamily::Type::kFamilyName, helvetica); + FontFamily roboto(font_family_names::kRoboto, FontFamily::Type::kFamilyName, + helvetica_neue); + FontDescription description; - description.FirstFamily().SetFamily(font_family_names::kRoboto, - FontFamily::Type::kFamilyName); - - scoped_refptr<SharedFontFamily> helvetica_neue = SharedFontFamily::Create(); - helvetica_neue->SetFamily(font_family_names::kHelveticaNeue, - FontFamily::Type::kFamilyName); - scoped_refptr<SharedFontFamily> helvetica = SharedFontFamily::Create(); - helvetica->SetFamily(font_family_names::kHelvetica, - FontFamily::Type::kFamilyName); - scoped_refptr<SharedFontFamily> arial = SharedFontFamily::Create(); - arial->SetFamily(font_family_names::kArial, FontFamily::Type::kFamilyName); - - helvetica->AppendFamily(std::move(arial)); - helvetica_neue->AppendFamily(std::move(helvetica)); - description.FirstFamily().AppendFamily(std::move(helvetica_neue)); - + description.SetFamily(roboto); description.SetGenericFamily(FontDescription::kSansSerifFamily); description.SetComputedSize(scale_factor * kFontSize); description.SetWeight(FontSelectionValue(500));
diff --git a/third_party/blink/renderer/platform/graphics/placeholder_image_test.cc b/third_party/blink/renderer/platform/graphics/placeholder_image_test.cc index d613081..ecd054cf 100644 --- a/third_party/blink/renderer/platform/graphics/placeholder_image_test.cc +++ b/third_party/blink/renderer/platform/graphics/placeholder_image_test.cc
@@ -116,23 +116,18 @@ float GetExpectedPlaceholderTextWidth(const StringView& text, float scale_factor) { + scoped_refptr<SharedFontFamily> arial = SharedFontFamily::Create( + font_family_names::kArial, FontFamily::Type::kFamilyName); + scoped_refptr<SharedFontFamily> helvetica = SharedFontFamily::Create( + font_family_names::kHelvetica, FontFamily::Type::kFamilyName, arial); + scoped_refptr<SharedFontFamily> helvetica_neue = + SharedFontFamily::Create(font_family_names::kHelveticaNeue, + FontFamily::Type::kFamilyName, helvetica); + FontFamily roboto(font_family_names::kRoboto, FontFamily::Type::kFamilyName, + helvetica_neue); + FontDescription description; - description.FirstFamily().SetFamily(font_family_names::kRoboto, - FontFamily::Type::kFamilyName); - - scoped_refptr<SharedFontFamily> helvetica_neue = SharedFontFamily::Create(); - helvetica_neue->SetFamily(font_family_names::kHelveticaNeue, - FontFamily::Type::kFamilyName); - scoped_refptr<SharedFontFamily> helvetica = SharedFontFamily::Create(); - helvetica->SetFamily(font_family_names::kHelvetica, - FontFamily::Type::kFamilyName); - scoped_refptr<SharedFontFamily> arial = SharedFontFamily::Create(); - arial->SetFamily(font_family_names::kArial, FontFamily::Type::kFamilyName); - - helvetica->AppendFamily(std::move(arial)); - helvetica_neue->AppendFamily(std::move(helvetica)); - description.FirstFamily().AppendFamily(std::move(helvetica_neue)); - + description.SetFamily(roboto); description.SetGenericFamily(FontDescription::kSansSerifFamily); description.SetComputedSize(scale_factor * 14.0f); description.SetWeight(FontSelectionValue(500));
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index c47c3a8..24538e4 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -736,10 +736,6 @@ status: "experimental", }, { - name: "CSSAnimationComposition", - status: "stable", - }, - { // Support for the animation-delay-start and animation-delay-end // properties. // @@ -1998,11 +1994,6 @@ name: "HTMLInvokeTargetAttribute", status: "experimental", }, - // This is a killswitch. Removable a few weeks after M121 ships. - { - name: "HTMLParserFastPathBulkInsertNotify", - status: "stable", - }, { // A flag, just for local testing to make the // HTML parser yield more often and take longer to resume.
diff --git a/third_party/blink/renderer/platform/testing/font_test_helpers.cc b/third_party/blink/renderer/platform/testing/font_test_helpers.cc index 9058c68..fae1d33 100644 --- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc +++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc
@@ -127,11 +127,9 @@ size_t data_size, float size, const FontDescription::VariantLigatures* ligatures) { - FontFamily family; - family.SetFamily(family_name, FontFamily::Type::kFamilyName); - FontDescription font_description; - font_description.SetFamily(family); + font_description.SetFamily( + FontFamily(family_name, FontFamily::Type::kFamilyName)); font_description.SetSpecifiedSize(size); font_description.SetComputedSize(size); if (ligatures) @@ -145,11 +143,9 @@ float size, const FontDescription::VariantLigatures* ligatures, void (*init_font_description)(FontDescription*)) { - FontFamily family; - family.SetFamily(family_name, FontFamily::Type::kFamilyName); - FontDescription font_description; - font_description.SetFamily(family); + font_description.SetFamily( + FontFamily(family_name, FontFamily::Type::kFamilyName)); font_description.SetSpecifiedSize(size); font_description.SetComputedSize(size); if (ligatures)
diff --git a/third_party/blink/web_tests/FlagExpectations/enable-skia-graphite b/third_party/blink/web_tests/FlagExpectations/enable-skia-graphite index 7cb4338..9583acb 100644 --- a/third_party/blink/web_tests/FlagExpectations/enable-skia-graphite +++ b/third_party/blink/web_tests/FlagExpectations/enable-skia-graphite
@@ -31,6 +31,8 @@ crbug.com/1518086 external/wpt/html/semantics/embedded-content/media-elements/ready-states/autoplay-hidden.optional.html [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 virtual/view-transition-mpa-serialization/external/wpt/css/css-view-transitions/content-with-clip-root.html [ Failure ] +crbug.com/626703 virtual/view-transition-mpa-serialization/external/wpt/css/css-view-transitions/pseudo-with-classes-match-multiple-wildcard.html [ Failure ] crbug.com/626703 virtual/view-transition-mpa-serialization/external/wpt/css/css-view-transitions/massive-element-left-of-viewport-partially-onscreen-new.html [ Failure ] crbug.com/626703 virtual/view-transition-mpa-serialization/external/wpt/css/css-view-transitions/new-content-container-writing-modes.html [ Failure ] crbug.com/626703 virtual/view-transition-mpa-serialization/external/wpt/css/css-view-transitions/new-content-element-writing-modes.html [ Failure ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 113f653..2dcc653c 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -2632,6 +2632,7 @@ crbug.com/626703 external/wpt/uievents/mouse/mouse_boundary_events_after_removing_last_over_element.html [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 external/wpt/css/css-text-decor/text-shadow/svg-stroke.html [ Failure ] crbug.com/626703 [ Win11-arm64 ] virtual/webnn-service-enabled/external/wpt/webnn/conformance_tests/gpu/batch_normalization.https.any.html [ Crash Timeout ] crbug.com/626703 [ Win11-arm64 ] virtual/webnn-service-enabled/external/wpt/webnn/conformance_tests/gpu/batch_normalization.https.any.worker.html [ Crash Timeout ] crbug.com/626703 [ Win11-arm64 ] virtual/webnn-service-enabled/external/wpt/webnn/conformance_tests/gpu/conv2d.https.any.html [ Crash Timeout ] @@ -6780,7 +6781,7 @@ crbug.com/1172985 http/tests/devtools/elements/styles-1/edit-media-text.js [ Failure Pass ] crbug.com/1172985 http/tests/devtools/elements/styles-2/media-emulation.js [ Failure Pass ] crbug.com/1172985 http/tests/devtools/elements/styles-4/styles-do-not-detach-sourcemap-on-edits.js [ Failure Pass ] -crbug.com/1172985 http/tests/devtools/elements/styles-4/styles-update-links-1.js [ Skip Timeout Failure Pass ] +crbug.com/1172985 http/tests/devtools/elements/styles-4/styles-update-links-1.js [ Failure Pass Skip Timeout ] crbug.com/1172985 http/tests/devtools/elements/styles-4/styles-update-links-2.js [ Failure Pass ] crbug.com/1172985 http/tests/devtools/elements/styles-4/styles-update-links-3.js [ Failure Pass ]
diff --git a/third_party/blink/web_tests/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/css3/filters/effect-reference-zoom-expected.png index e54653f..8c72168 100644 --- a/third_party/blink/web_tests/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index 633cdec8..64720ab 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -201553,6 +201553,58 @@ {} ] ], + "svg-fill-none.html": [ + "389db4a3426e0a98bf0e90d62ef94fdc8facc4f7", + [ + null, + [ + [ + "/css/css-text-decor/text-shadow/svg-fill-none-ref.html", + "==" + ] + ], + {} + ] + ], + "svg-fill-opacity.html": [ + "1ac577bf76e40ebecc417a6176552ebf53650e3a", + [ + null, + [ + [ + "/css/css-text-decor/text-shadow/svg-fill-opacity-ref.html", + "==" + ] + ], + {} + ] + ], + "svg-stroke-dasharray.html": [ + "bd77d85edf4f7a4f2bc13afc9ae72e06d991b8e7", + [ + null, + [ + [ + "/css/css-text-decor/text-shadow/svg-stroke-dasharray-ref.html", + "==" + ] + ], + {} + ] + ], + "svg-stroke.html": [ + "b65348fd0f20daf9fea975125cf0b4d73703611a", + [ + null, + [ + [ + "/css/css-text-decor/text-shadow/svg-stroke-ref.html", + "==" + ] + ], + {} + ] + ], "textindent.html": [ "4b66f9dcb8916a125bced71bec37d757a5521af5", [ @@ -277625,6 +277677,19 @@ ] ] }, + "stop-animation-01.html": [ + "d240c51142abb4e96d88b9bcc341c03d70d9d3ee", + [ + null, + [ + [ + "/svg/struct/reftests/reference/green-100x100.html", + "==" + ] + ], + {} + ] + ], "use-animate-display-none-symbol-2.html": [ "db06b641d9a60b094aee40a3930fd7229fcdb0d5", [ @@ -331181,6 +331246,22 @@ "8a962a41e923c50a6d891bc3f1b9c7bff3bbd180", [] ], + "svg-fill-none-ref.html": [ + "9167272178371bf554f83278eb0d256490a6ca34", + [] + ], + "svg-fill-opacity-ref.html": [ + "73c878b89dfa4b12d5a3dd985d0110c424265a1d", + [] + ], + "svg-stroke-dasharray-ref.html": [ + "63e45f4e11775c807abbb36f813ffc9604171ca9", + [] + ], + "svg-stroke-ref.html": [ + "d3905fbfbc96f87bf3d209b1d7c5955d70782e4a", + [] + ], "textindent-ref.html": [ "c3e3315e9b2795a5a5fb8a7e367bb133d6e442fe", [] @@ -334919,7 +335000,7 @@ "calc-size": { "animation": { "calc-size-height-interpolation.tentative-expected.txt": [ - "324756dcdf30f4b943781fef91372ba0e119696f", + "0e39bf0dda6397ca2bb94bf2d5d64a3688cfeba2", [] ], "calc-size-width-interpolation.tentative-expected.txt": [ @@ -348983,7 +349064,7 @@ [] ], "anchor.tentative.https.window_include=from-public-expected.txt": [ - "083cb0dcc74738c69f0aa1fd39f4388deba7875e", + "19aec2667c4dabf7d92d197acaacd2b387f8a318", [] ], "anchor.tentative.https.window_include=from-treat-as-public-expected.txt": [ @@ -349123,6 +349204,10 @@ "816de535feaa83c224e76159d3defa571b1199fe", [] ], + "service-worker-fetch-all.js": [ + "78ac8d1576b49802fa1587c332ba8cad7a568daf", + [] + ], "service-worker.js": [ "bca71ad910cb189c2de6298b4ea59b5594aba637", [] @@ -349144,7 +349229,7 @@ [] ], "support.sub.js": [ - "46a9d9e0764c06c640adb0f463e8ea432f032e60", + "1cb432b7874ab35a0878fd680a4c1972606b9ad9", [] ], "worker-blob-fetcher.html": [ @@ -349164,6 +349249,14 @@ [] ] }, + "service-worker-fetch-document-treat-as-public.tentative.https.window-expected.txt": [ + "c9433e6f5deb270f6c70872722c6250ff0fe54eb", + [] + ], + "service-worker-fetch-document.tentative.https.window-expected.txt": [ + "3f3485f4c707cfaee7242ef1240a0093245cf0de", + [] + ], "service-worker-fetch.tentative.https.window_1-8-expected.txt": [ "3f3485f4c707cfaee7242ef1240a0093245cf0de", [] @@ -349201,7 +349294,7 @@ [] ], "window-open-existing.tentative.https.window_include=from-public-expected.txt": [ - "083cb0dcc74738c69f0aa1fd39f4388deba7875e", + "19aec2667c4dabf7d92d197acaacd2b387f8a318", [] ], "window-open-existing.tentative.https.window_include=from-treat-as-public-expected.txt": [ @@ -349221,7 +349314,7 @@ [] ], "window-open.tentative.https.window_include=from-public-expected.txt": [ - "083cb0dcc74738c69f0aa1fd39f4388deba7875e", + "19aec2667c4dabf7d92d197acaacd2b387f8a318", [] ], "window-open.tentative.https.window_include=from-treat-as-public-expected.txt": [ @@ -451493,7 +451586,7 @@ ] ], "mask-computed.html": [ - "28fc38defae2e5ea7b4bffab2a8755535921fa9d", + "586683dd5de9780cc77ab7e58128b3584ec7a8d0", [ null, {} @@ -511511,7 +511604,7 @@ }, "private-network-access": { "anchor.tentative.https.window.js": [ - "4e860ad381df9b97fe3486e6b9d8d98eaabf808a", + "f5473868b7cf722dfacf76822ec2e89bfd064170", [ "fetch/private-network-access/anchor.tentative.https.window.html?include=from-local", { @@ -512519,8 +512612,44 @@ } ] ], + "service-worker-fetch-document-treat-as-public.tentative.https.window.js": [ + "6fc29ce4725b15b4d773c641e8fa93756e2399a5", + [ + "fetch/private-network-access/service-worker-fetch-document-treat-as-public.tentative.https.window.html", + { + "script_metadata": [ + [ + "script", + "/common/utils.js" + ], + [ + "script", + "resources/support.sub.js" + ] + ] + } + ] + ], + "service-worker-fetch-document.tentative.https.window.js": [ + "ec380555a809b38543bb0f74fb59a8d546e785ef", + [ + "fetch/private-network-access/service-worker-fetch-document.tentative.https.window.html", + { + "script_metadata": [ + [ + "script", + "/common/utils.js" + ], + [ + "script", + "resources/support.sub.js" + ] + ] + } + ] + ], "service-worker-fetch.tentative.https.window.js": [ - "cb6d1f79b01f7c3fc7ba13884bd675bfd01d74a2", + "5fc5800ba042345789ffe0a78c77c9502d6acd44", [ "fetch/private-network-access/service-worker-fetch.tentative.https.window.html?1-8", { @@ -512749,7 +512878,7 @@ ] ], "window-open-existing.tentative.https.window.js": [ - "6a2a624fc8032d03b626109ee7f825f7acf5874c", + "565a2117a8470c66bfd487637fdc8aadb3ccf34b", [ "fetch/private-network-access/window-open-existing.tentative.https.window.html?include=from-local", { @@ -512955,7 +513084,7 @@ ] ], "window-open.tentative.https.window.js": [ - "6793d1f3b4d9218975c7b08e165a729c00960df9", + "42d70af4e4ea0ce6ed38f3fbe438da000ad7d2da", [ "fetch/private-network-access/window-open.tentative.https.window.html?include=from-local", { @@ -706941,7 +707070,7 @@ "permissions": { "set_permission": { "invalid.py": [ - "0ef8c57f4154e524ea95bea08454d914e0153f62", + "0ace04e8bcfefd25795e062026c4e402e2d315f3", [ null, {} @@ -707181,7 +707310,7 @@ ] ], "contexts.py": [ - "eed4d2044cf92cff736e2d9637123c7a553a7d6f", + "83dfa5560f77896564de93db4fbf0d1a62182d57", [ null, {}
diff --git a/third_party/blink/web_tests/external/wpt/css/css-masking/parsing/mask-computed.html b/third_party/blink/web_tests/external/wpt/css/css-masking/parsing/mask-computed.html index 28fc38de..586683dd 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-masking/parsing/mask-computed.html +++ b/third_party/blink/web_tests/external/wpt/css/css-masking/parsing/mask-computed.html
@@ -10,7 +10,7 @@ <script src="/css/support/computed-testcommon.js"></script> </head> <body> -<div id="target"></div> +<div id="target" style="display:none"></div> <script> // value: <mask-layer># // <mask-layer> =
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-none-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-none-ref.html new file mode 100644 index 0000000..91672721 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-none-ref.html
@@ -0,0 +1,8 @@ +<!doctype html> +<style> +svg { font: bold 64px Arial, sans-serif; fill: none; stroke-width: 4px; } +</style> +<svg width="240" height="80"> + <text x="40" y="60" stroke="grey">Hello</text> + <text x="30" y="50" stroke="black">Hello</text> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-none.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-none.html new file mode 100644 index 0000000..389db4a3 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-none.html
@@ -0,0 +1,10 @@ +<!doctype html> +<title>CSS Test: 'text-shadow' respects 'fill="none"'</title> +<link rel="help" href="https://www.w3.org/TR/css-text-decor-3/#text-shadow-property"> +<link rel="match" href="svg-fill-none-ref.html"> +<style> +svg { font: bold 64px Arial, sans-serif; text-shadow: grey 10px 10px } +</style> +<svg width="240" height="80"> + <text x="30" y="50" fill="none" stroke="black" stroke-width="4">Hello</text> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-opacity-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-opacity-ref.html new file mode 100644 index 0000000..73c878b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-opacity-ref.html
@@ -0,0 +1,7 @@ +<!doctype html> +<style> +svg { font: bold 64px Arial, sans-serif; text-shadow: grey 10px 10px } +</style> +<svg width="240" height="80"> + <text x="30" y="50" fill-opacity="0.5" fill="#FFFF00">Hello</text> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-opacity.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-opacity.html new file mode 100644 index 0000000..1ac577bf --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-fill-opacity.html
@@ -0,0 +1,10 @@ +<!doctype html> +<title>CSS Test: 'text-shadow' respects non-opaque fill</title> +<link rel="help" href="https://www.w3.org/TR/css-text-decor-3/#text-shadow-property"> +<link rel="match" href="svg-fill-opacity-ref.html"> +<style> +svg { font: bold 64px Arial, sans-serif; text-shadow: grey 10px 10px } +</style> +<svg width="240" height="80"> + <text x="30" y="50" fill="rgba(255, 255, 0, 0.5)">Hello</text> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke-dasharray-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke-dasharray-ref.html new file mode 100644 index 0000000..63e45f4e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke-dasharray-ref.html
@@ -0,0 +1,8 @@ +<!doctype html> +<style> +svg { font: bold 64px Arial, sans-serif; fill: none; stroke-width: 2px; stroke-dasharray:2, 2; } +</style> +<svg width="240" height="80"> + <text x="40" y="60" stroke="grey">Hello</text> + <text x="30" y="50" stroke="black">Hello</text> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke-dasharray.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke-dasharray.html new file mode 100644 index 0000000..bd77d85e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke-dasharray.html
@@ -0,0 +1,10 @@ +<!doctype html> +<title>CSS Test: 'text-shadow' respects stroke-dasharray</title> +<link rel="help" href="https://www.w3.org/TR/css-text-decor-3/#text-shadow-property"> +<link rel="match" href="svg-stroke-dasharray-ref.html"> +<style> +svg { font: bold 64px Arial, sans-serif; text-shadow: grey 10px 10px } +</style> +<svg width="240" height="80"> + <text x="30" y="50" fill="none" stroke="black" stroke-width="2" stroke-dasharray="2, 2">Hello</text> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke-ref.html new file mode 100644 index 0000000..d3905fbf --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke-ref.html
@@ -0,0 +1,8 @@ +<!doctype html> +<style> +svg { font: bold 64px Arial, sans-serif; stroke: black; stroke-width: 4px; } +</style> +<svg width="240" height="80"> + <text x="40" y="60" fill="grey" stroke="grey">Hello</text> + <text x="30" y="50">Hello</text> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke.html new file mode 100644 index 0000000..b65348fd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-shadow/svg-stroke.html
@@ -0,0 +1,10 @@ +<!doctype html> +<title>CSS Test: 'text-shadow' respects stroke</title> +<link rel="help" href="https://www.w3.org/TR/css-text-decor-3/#text-shadow-property"> +<link rel="match" href="svg-stroke-ref.html"> +<style> +svg { font: bold 64px Arial, sans-serif; text-shadow: grey 10px 10px } +</style> +<svg width="240" height="80"> + <text x="30" y="50" stroke="black" stroke-width="4">Hello</text> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-values/calc-size/calc-size-height.tentative-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-values/calc-size/calc-size-height.tentative-expected.txt deleted file mode 100644 index 0931cad..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-values/calc-size/calc-size-height.tentative-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -This is a testharness.js-based test. -[FAIL] resolved height for height in auto height container: calc-size(any, 31%) - assert_equals: expected "0px" but got "10px" -[FAIL] resolved height for height in auto height container: calc-size(max-content, 31%) - assert_equals: expected "0px" but got "10px" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html index b5b49482..fe87d37 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html
@@ -1,5 +1,6 @@ <head> <link rel="match" href="canvas-filter-object-blur-expected.html"> + <meta name=fuzzy content="maxDifference=0-16; totalPixels=0-1000"> </head> <body> </body>
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/external/permissions/set_permission/invalid.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/external/permissions/set_permission/invalid.py index 0ef8c57..0ace04e 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/external/permissions/set_permission/invalid.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/external/permissions/set_permission/invalid.py
@@ -34,7 +34,7 @@ ) -@pytest.mark.parametrize("state", ["UNKOWN", "Granted"]) +@pytest.mark.parametrize("state", ["UNKNOWN", "Granted"]) async def test_params_state_invalid_value(bidi_session, state): with pytest.raises(error.InvalidArgumentException): await bidi_session.permissions.set_permission(
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/network/add_intercept/contexts.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/network/add_intercept/contexts.py index eed4d20..83dfa556 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/network/add_intercept/contexts.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/network/add_intercept/contexts.py
@@ -106,3 +106,105 @@ assert_before_request_sent_event( event, is_blocked=False ) + + +@pytest.mark.asyncio +async def test_two_contexts_same_intercept( + bidi_session, + url, + top_context, + add_intercept, + fetch, + setup_network_test, + wait_for_event, + wait_for_future_safe +): + other_context = await bidi_session.browsing_context.create(type_hint="tab") + await bidi_session.browsing_context.navigate( + context=other_context["context"], url=url(PAGE_EMPTY_HTML), wait="complete" + ) + + # Subscribe to network events in both contexts. + await setup_network_test( + events=[ + BEFORE_REQUEST_SENT_EVENT, + ], + contexts=[top_context["context"], other_context["context"]], + ) + + # Add an intercept to both contexts + text_url = url(PAGE_EMPTY_TEXT) + intercept = await add_intercept( + phases=["beforeRequestSent"], + url_patterns=[{"type": "string", "pattern": text_url}], + contexts=[top_context["context"], other_context["context"]], + ) + + # Request on the top_context should be blocked. + on_network_event = wait_for_event(BEFORE_REQUEST_SENT_EVENT) + asyncio.ensure_future(fetch(text_url, context=top_context)) + event = await wait_for_future_safe(on_network_event) + assert_before_request_sent_event( + event, is_blocked=True, intercepts=[intercept] + ) + + # Request on the other_context should be blocked. + on_network_event = wait_for_event(BEFORE_REQUEST_SENT_EVENT) + asyncio.ensure_future(fetch(text_url, context=other_context)) + event = await wait_for_future_safe(on_network_event) + assert_before_request_sent_event( + event, is_blocked=True, intercepts=[intercept] + ) + + +@pytest.mark.asyncio +async def test_two_contexts_global_intercept( + bidi_session, + url, + top_context, + add_intercept, + fetch, + setup_network_test, + wait_for_event, + wait_for_future_safe +): + other_context = await bidi_session.browsing_context.create(type_hint="tab") + await bidi_session.browsing_context.navigate( + context=other_context["context"], url=url(PAGE_EMPTY_HTML), wait="complete" + ) + + # Subscribe to network events in both contexts. + await setup_network_test( + events=[ + BEFORE_REQUEST_SENT_EVENT, + ], + contexts=[top_context["context"], other_context["context"]], + ) + + # Add an intercept for top_context and a global intercept. + text_url = url(PAGE_EMPTY_TEXT) + context_intercept = await add_intercept( + phases=["beforeRequestSent"], + url_patterns=[{"type": "string", "pattern": text_url}], + contexts=[top_context["context"]], + ) + global_intercept = await add_intercept( + phases=["beforeRequestSent"], + url_patterns=[{"type": "string", "pattern": text_url}], + ) + + # Request on the top_context should be blocked and list both intercepts. + on_network_event = wait_for_event(BEFORE_REQUEST_SENT_EVENT) + asyncio.ensure_future(fetch(text_url, context=top_context)) + event = await wait_for_future_safe(on_network_event) + assert_before_request_sent_event( + event, is_blocked=True, intercepts=[context_intercept, global_intercept] + ) + + # Request on the other_context should be blocked by the global intercept. + on_network_event = wait_for_event(BEFORE_REQUEST_SENT_EVENT) + asyncio.ensure_future(fetch(text_url, context=other_context)) + event = await wait_for_future_safe(on_network_event) + assert_before_request_sent_event( + event, is_blocked=True, intercepts=[global_intercept] + )
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/paint/filters/clip-under-filter-expected.png b/third_party/blink/web_tests/flag-specific/highdpi/paint/filters/clip-under-filter-expected.png index 746f2fc..d85d2b0 100644 --- a/third_party/blink/web_tests/flag-specific/highdpi/paint/filters/clip-under-filter-expected.png +++ b/third_party/blink/web_tests/flag-specific/highdpi/paint/filters/clip-under-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/http/tests/mojo/shared/encoding-decoding.js b/third_party/blink/web_tests/http/tests/mojo/shared/encoding-decoding.js index fec2db00..a447884 100644 --- a/third_party/blink/web_tests/http/tests/mojo/shared/encoding-decoding.js +++ b/third_party/blink/web_tests/http/tests/mojo/shared/encoding-decoding.js
@@ -226,3 +226,9 @@ assert_equals(stringValue, 'foo'); } }, 'JS decoding and C++ encoding of optional nested unions work as expected.'); + +promise_test(async() => { + const remote = getMojoEchoRemote(); + const response = await remote.echoBoolArray([true, false, true]); + assert_array_equals(response.values, [true, false, true]); +}, 'JS encoding and decoding array of bools as expected.');
diff --git a/third_party/blink/web_tests/paint/filters/clip-under-filter-expected.png b/third_party/blink/web_tests/paint/filters/clip-under-filter-expected.png index 75ca1cc..71331df 100644 --- a/third_party/blink/web_tests/paint/filters/clip-under-filter-expected.png +++ b/third_party/blink/web_tests/paint/filters/clip-under-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/webdriver/tests/bidi/network/add_intercept/contexts-expected.txt b/third_party/blink/web_tests/platform/linux-chrome/external/wpt/webdriver/tests/bidi/network/add_intercept/contexts-expected.txt index b93380a..aac159d 100644 --- a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/webdriver/tests/bidi/network/add_intercept/contexts-expected.txt +++ b/third_party/blink/web_tests/platform/linux-chrome/external/wpt/webdriver/tests/bidi/network/add_intercept/contexts-expected.txt
@@ -5,4 +5,8 @@ TypeError: add_intercept() got an unexpected keyword argument 'contexts' [FAIL] test_other_context_with_event_subscription TypeError: add_intercept() got an unexpected keyword argument 'contexts' +[FAIL] test_two_contexts_same_intercept + TypeError: add_intercept() got an unexpected keyword argument 'contexts' +[FAIL] test_two_contexts_global_intercept + TypeError: add_intercept() got an unexpected keyword argument 'contexts' Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any.serviceworker_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any.serviceworker_wpt_flags=h2-expected.txt deleted file mode 100644 index 5b37deb..0000000 --- a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any.serviceworker_wpt_flags=h2-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -All subtests passed and are omitted for brevity. -See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/writing_web_tests.md#Text-Test-Baselines for details. -Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any.sharedworker_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any.sharedworker_wpt_flags=h2-expected.txt deleted file mode 100644 index 5b37deb..0000000 --- a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any.sharedworker_wpt_flags=h2-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -All subtests passed and are omitted for brevity. -See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/writing_web_tests.md#Text-Test-Baselines for details. -Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any.worker_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any.worker_wpt_flags=h2-expected.txt deleted file mode 100644 index 5b37deb..0000000 --- a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any.worker_wpt_flags=h2-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -All subtests passed and are omitted for brevity. -See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/writing_web_tests.md#Text-Test-Baselines for details. -Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any_wpt_flags=h2-expected.txt deleted file mode 100644 index 5b37deb..0000000 --- a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/websockets/stream/tentative/remote-close.any_wpt_flags=h2-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -All subtests passed and are omitted for brevity. -See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/writing_web_tests.md#Text-Test-Baselines for details. -Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-turbulence-expected.png b/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-turbulence-expected.png index 07ec17f..8e1d67b3 100644 --- a/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-turbulence-expected.png +++ b/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-turbulence-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png b/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png index 163ac50..70f27ed 100644 --- a/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png b/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png index 80017ff7..d8d7a52 100644 --- a/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-expected.png index 0b7a4bb..90101ea 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png index f6c7c48..f5f4a4d3 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png index 05ef00db..fb636071 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png index 2d8cca9..72fee07 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-expected.png index 660e63aa..407dca1 100644 --- a/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-subregion-expected.png index 4ed300f..f33a0ddf 100644 --- a/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-zoom-expected.png index 6e4db81..35c7d2e6 100644 --- a/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png new file mode 100644 index 0000000..7ba55f15 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png new file mode 100644 index 0000000..ee9fca8 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png new file mode 100644 index 0000000..ac60466 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png new file mode 100644 index 0000000..d404845 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png index c777390..21790a70 100644 --- a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png index 288fb8c..79032aa 100644 --- a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png index a6da890..8e2d3e0 100644 --- a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-expected.png index 660e63aa..407dca1 100644 --- a/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-subregion-expected.png index 4ed300f..f33a0ddf 100644 --- a/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-zoom-expected.png index 6e4db81..35c7d2e6 100644 --- a/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png new file mode 100644 index 0000000..7ba55f15 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png new file mode 100644 index 0000000..ee9fca8 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png new file mode 100644 index 0000000..ac60466 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png new file mode 100644 index 0000000..d404845 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png index c777390..21790a70 100644 --- a/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png index 288fb8c..79032aa 100644 --- a/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png index a6da890..8e2d3e0 100644 --- a/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-expected.png index 660e63aa..407dca1 100644 --- a/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-subregion-expected.png index 4ed300f..f33a0ddf 100644 --- a/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-zoom-expected.png index 6e4db81..35c7d2e6 100644 --- a/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png new file mode 100644 index 0000000..7ba55f15 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png new file mode 100644 index 0000000..ee9fca8 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png new file mode 100644 index 0000000..ac60466 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png new file mode 100644 index 0000000..d404845 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png index c777390..21790a70 100644 --- a/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png index 288fb8c..79032aa 100644 --- a/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png index a6da890..8e2d3e0 100644 --- a/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/mac/css3/filters/effect-reference-expected.png index d9ece1ff..fffc36f 100644 --- a/third_party/blink/web_tests/platform/mac/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/mac/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/mac/css3/filters/effect-reference-subregion-expected.png index 29b1ab5..740aa39 100644 --- a/third_party/blink/web_tests/platform/mac/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/mac/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/css3/filters/filter-repaint-turbulence-expected.png b/third_party/blink/web_tests/platform/mac/css3/filters/filter-repaint-turbulence-expected.png index 918f462..758ec4925 100644 --- a/third_party/blink/web_tests/platform/mac/css3/filters/filter-repaint-turbulence-expected.png +++ b/third_party/blink/web_tests/platform/mac/css3/filters/filter-repaint-turbulence-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png b/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png index d2e1717..e976b097 100644 --- a/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png +++ b/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png b/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png index d8fcf5a2..d85e480 100644 --- a/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png +++ b/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-expected.png index 0b7a4bb..90101ea 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png index f6c7c48..f5f4a4d3 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png index 05ef00db..fb636071 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png index 2bd0a56..a8384ba 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/win/css3/filters/effect-reference-expected.png index d9372a3..d318543 100644 --- a/third_party/blink/web_tests/platform/win/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/win/css3/filters/effect-reference-subregion-expected.png index 2f8e9a7..fdc593b 100644 --- a/third_party/blink/web_tests/platform/win/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/filters/filter-repaint-turbulence-expected.png b/third_party/blink/web_tests/platform/win/css3/filters/filter-repaint-turbulence-expected.png index 9585c1a..ba156f2 100644 --- a/third_party/blink/web_tests/platform/win/css3/filters/filter-repaint-turbulence-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/filters/filter-repaint-turbulence-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png b/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png index 72e0a37..65c56f5 100644 --- a/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png b/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png index d541e15..c5a3cdb8 100644 --- a/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-expected.png index f688053..4726c90 100644 --- a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png index 8ac07c0..5058695 100644 --- a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png index 5976b822..be94ef0 100644 --- a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png index 5de3687a..0ae6383 100644 --- a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/filter-repaint-turbulence-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-expected.png index a942e8ba5e..7d183647 100644 --- a/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-subregion-expected.png index 9b597e7..31e8605c 100644 --- a/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-zoom-expected.png index 6e4db81..35c7d2e6 100644 --- a/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/win11-arm64/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png new file mode 100644 index 0000000..4a2ab25 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png new file mode 100644 index 0000000..646dd3d3 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png new file mode 100644 index 0000000..ac60466 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png new file mode 100644 index 0000000..d404845 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png new file mode 100644 index 0000000..f4c28ce9 --- /dev/null +++ b/third_party/blink/web_tests/platform/win11-arm64/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png b/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png index f840619..6422fd3 100644 --- a/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png +++ b/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png b/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png index 209c7bf..63d14c1 100644 --- a/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png +++ b/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-subregion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png b/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png index 3b1c2da5..a0b5f4d9 100644 --- a/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png +++ b/third_party/blink/web_tests/platform/win11-arm64/virtual/scalefactor200/css3/filters/effect-reference-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png index 2302840..19122d2 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png index 2302840..19122d2 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png index 2302840..19122d2 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png index 4fe9585..9359d57 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png index 2302840..19122d2 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop-expected.png index 2302840..60ba3b2 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png index 2302840..19122d2 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png index 3286ff2..7307523 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png index 2302840..19122d2 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png index 2302840..19122d2 100644 --- a/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png +++ b/third_party/blink/web_tests/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/filters/feDisplacementMap-turbulence-expected.png b/third_party/blink/web_tests/svg/filters/feDisplacementMap-turbulence-expected.png index 40c9ff1..47f56a26 100644 --- a/third_party/blink/web_tests/svg/filters/feDisplacementMap-turbulence-expected.png +++ b/third_party/blink/web_tests/svg/filters/feDisplacementMap-turbulence-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/filters/feTurbulence-scale-expected.png b/third_party/blink/web_tests/svg/filters/feTurbulence-scale-expected.png index 97a7017..da6ec05c 100644 --- a/third_party/blink/web_tests/svg/filters/feTurbulence-scale-expected.png +++ b/third_party/blink/web_tests/svg/filters/feTurbulence-scale-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/filters/feTurbulence-tiled-expected.png b/third_party/blink/web_tests/svg/filters/feTurbulence-tiled-expected.png index 8689c28..20939c9 100644 --- a/third_party/blink/web_tests/svg/filters/feTurbulence-tiled-expected.png +++ b/third_party/blink/web_tests/svg/filters/feTurbulence-tiled-expected.png Binary files differ
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index e6a1cfc..196ae62 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit e6a1cfc5b76dece414156ebbba15beb82dc47a7a +Subproject commit 196ae62399105a2fe043fcd30a1446e2fe80d7b3
diff --git a/third_party/libaom/README.chromium b/third_party/libaom/README.chromium index 627b84d..1c684d3 100644 --- a/third_party/libaom/README.chromium +++ b/third_party/libaom/README.chromium
@@ -2,7 +2,7 @@ Short Name: libaom URL: https://aomedia.googlesource.com/aom/ Version: N/A -Revision: a2d599c9750e3027d3104770fe74ff5d5d012c13 +Revision: 14010c6f0f787b0c294a352823e34fe058674510 CPEPrefix: cpe:/a:aomedia:aomedia:3.8.1 License: BSD License File: source/libaom/LICENSE
diff --git a/third_party/libaom/source/config/config/aom_version.h b/third_party/libaom/source/config/config/aom_version.h index d72dcab7..f5d2ca0 100644 --- a/third_party/libaom/source/config/config/aom_version.h +++ b/third_party/libaom/source/config/config/aom_version.h
@@ -12,8 +12,8 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 8 #define VERSION_PATCH 1 -#define VERSION_EXTRA "281-ga2d599c975" +#define VERSION_EXTRA "302-g14010c6f0f" #define VERSION_PACKED \ ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH)) -#define VERSION_STRING_NOSP "3.8.1-281-ga2d599c975" -#define VERSION_STRING " 3.8.1-281-ga2d599c975" +#define VERSION_STRING_NOSP "3.8.1-302-g14010c6f0f" +#define VERSION_STRING " 3.8.1-302-g14010c6f0f"
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm index 9486c97..ca35b16 100644 --- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm +++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
@@ -52,6 +52,7 @@ CONFIG_OUTPUT_FRAME_SIZE equ 0 CONFIG_PARTITION_SEARCH_ORDER equ 0 CONFIG_PIC equ 1 +CONFIG_QUANT_MATRIX equ 1 CONFIG_RATECTRL_LOG equ 0 CONFIG_RD_COMMAND equ 0 CONFIG_RD_DEBUG equ 0 @@ -87,6 +88,7 @@ HAVE_SSE4_2 equ 0 HAVE_SSSE3 equ 0 HAVE_SVE equ 0 +HAVE_SVE2 equ 0 HAVE_UNISTD_H equ 1 HAVE_VSX equ 0 HAVE_WXWIDGETS equ 0
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h index 786a4cb..d62f1482 100644 --- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h +++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 0 #define HAVE_SSSE3 0 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 1 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm index e67f190..f221f03 100644 --- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm +++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
@@ -52,6 +52,7 @@ CONFIG_OUTPUT_FRAME_SIZE equ 0 CONFIG_PARTITION_SEARCH_ORDER equ 0 CONFIG_PIC equ 1 +CONFIG_QUANT_MATRIX equ 1 CONFIG_RATECTRL_LOG equ 0 CONFIG_RD_COMMAND equ 0 CONFIG_RD_DEBUG equ 0 @@ -87,6 +88,7 @@ HAVE_SSE4_2 equ 0 HAVE_SSSE3 equ 0 HAVE_SVE equ 0 +HAVE_SVE2 equ 0 HAVE_UNISTD_H equ 1 HAVE_VSX equ 0 HAVE_WXWIDGETS equ 0
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h index e6efef0..73862d16 100644 --- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h +++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 0 #define HAVE_SSSE3 0 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 1 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.asm b/third_party/libaom/source/config/linux/arm/config/aom_config.asm index 44e241cb..e73e0a0 100644 --- a/third_party/libaom/source/config/linux/arm/config/aom_config.asm +++ b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
@@ -52,6 +52,7 @@ CONFIG_OUTPUT_FRAME_SIZE equ 0 CONFIG_PARTITION_SEARCH_ORDER equ 0 CONFIG_PIC equ 1 +CONFIG_QUANT_MATRIX equ 1 CONFIG_RATECTRL_LOG equ 0 CONFIG_RD_COMMAND equ 0 CONFIG_RD_DEBUG equ 0 @@ -87,6 +88,7 @@ HAVE_SSE4_2 equ 0 HAVE_SSSE3 equ 0 HAVE_SVE equ 0 +HAVE_SVE2 equ 0 HAVE_UNISTD_H equ 1 HAVE_VSX equ 0 HAVE_WXWIDGETS equ 0
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.h b/third_party/libaom/source/config/linux/arm/config/aom_config.h index a1cc860..bc4fdef 100644 --- a/third_party/libaom/source/config/linux/arm/config/aom_config.h +++ b/third_party/libaom/source/config/linux/arm/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 0 #define HAVE_SSSE3 0 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 1 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/linux/arm64-cpu-detect/config/aom_config.asm b/third_party/libaom/source/config/linux/arm64-cpu-detect/config/aom_config.asm index 2c44590..1eca30d 100644 --- a/third_party/libaom/source/config/linux/arm64-cpu-detect/config/aom_config.asm +++ b/third_party/libaom/source/config/linux/arm64-cpu-detect/config/aom_config.asm
@@ -52,6 +52,7 @@ CONFIG_OUTPUT_FRAME_SIZE equ 0 CONFIG_PARTITION_SEARCH_ORDER equ 0 CONFIG_PIC equ 1 +CONFIG_QUANT_MATRIX equ 1 CONFIG_RATECTRL_LOG equ 0 CONFIG_RD_COMMAND equ 0 CONFIG_RD_DEBUG equ 0 @@ -87,6 +88,7 @@ HAVE_SSE4_2 equ 0 HAVE_SSSE3 equ 0 HAVE_SVE equ 0 +HAVE_SVE2 equ 0 HAVE_UNISTD_H equ 1 HAVE_VSX equ 0 HAVE_WXWIDGETS equ 0
diff --git a/third_party/libaom/source/config/linux/arm64-cpu-detect/config/aom_config.h b/third_party/libaom/source/config/linux/arm64-cpu-detect/config/aom_config.h index 5731e42..7c7b44b 100644 --- a/third_party/libaom/source/config/linux/arm64-cpu-detect/config/aom_config.h +++ b/third_party/libaom/source/config/linux/arm64-cpu-detect/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 0 #define HAVE_SSSE3 0 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 1 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.asm b/third_party/libaom/source/config/linux/generic/config/aom_config.asm index a9d911c6..088405c 100644 --- a/third_party/libaom/source/config/linux/generic/config/aom_config.asm +++ b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
@@ -52,6 +52,7 @@ CONFIG_OUTPUT_FRAME_SIZE equ 0 CONFIG_PARTITION_SEARCH_ORDER equ 0 CONFIG_PIC equ 1 +CONFIG_QUANT_MATRIX equ 1 CONFIG_RATECTRL_LOG equ 0 CONFIG_RD_COMMAND equ 0 CONFIG_RD_DEBUG equ 0 @@ -87,6 +88,7 @@ HAVE_SSE4_2 equ 0 HAVE_SSSE3 equ 0 HAVE_SVE equ 0 +HAVE_SVE2 equ 0 HAVE_UNISTD_H equ 1 HAVE_VSX equ 0 HAVE_WXWIDGETS equ 0
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.h b/third_party/libaom/source/config/linux/generic/config/aom_config.h index 6b00a33..eed2323 100644 --- a/third_party/libaom/source/config/linux/generic/config/aom_config.h +++ b/third_party/libaom/source/config/linux/generic/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 0 #define HAVE_SSSE3 0 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 1 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/linux/ia32/config/aom_config.asm b/third_party/libaom/source/config/linux/ia32/config/aom_config.asm index a950275..72f7ee74 100644 --- a/third_party/libaom/source/config/linux/ia32/config/aom_config.asm +++ b/third_party/libaom/source/config/linux/ia32/config/aom_config.asm
@@ -42,6 +42,7 @@ %define CONFIG_OUTPUT_FRAME_SIZE 0 %define CONFIG_PARTITION_SEARCH_ORDER 0 %define CONFIG_PIC 1 +%define CONFIG_QUANT_MATRIX 1 %define CONFIG_RATECTRL_LOG 0 %define CONFIG_RD_COMMAND 0 %define CONFIG_RD_DEBUG 0 @@ -77,6 +78,7 @@ %define HAVE_SSE4_2 1 %define HAVE_SSSE3 1 %define HAVE_SVE 0 +%define HAVE_SVE2 0 %define HAVE_UNISTD_H 1 %define HAVE_VSX 0 %define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/linux/ia32/config/aom_config.h b/third_party/libaom/source/config/linux/ia32/config/aom_config.h index db0340f..92496a7 100644 --- a/third_party/libaom/source/config/linux/ia32/config/aom_config.h +++ b/third_party/libaom/source/config/linux/ia32/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 1 #define HAVE_SSSE3 1 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 1 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.asm b/third_party/libaom/source/config/linux/x64/config/aom_config.asm index 38dc716..2abf047 100644 --- a/third_party/libaom/source/config/linux/x64/config/aom_config.asm +++ b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
@@ -42,6 +42,7 @@ %define CONFIG_OUTPUT_FRAME_SIZE 0 %define CONFIG_PARTITION_SEARCH_ORDER 0 %define CONFIG_PIC 1 +%define CONFIG_QUANT_MATRIX 1 %define CONFIG_RATECTRL_LOG 0 %define CONFIG_RD_COMMAND 0 %define CONFIG_RD_DEBUG 0 @@ -77,6 +78,7 @@ %define HAVE_SSE4_2 1 %define HAVE_SSSE3 1 %define HAVE_SVE 0 +%define HAVE_SVE2 0 %define HAVE_UNISTD_H 1 %define HAVE_VSX 0 %define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.h b/third_party/libaom/source/config/linux/x64/config/aom_config.h index fa14548..aa985aa 100644 --- a/third_party/libaom/source/config/linux/x64/config/aom_config.h +++ b/third_party/libaom/source/config/linux/x64/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 1 #define HAVE_SSSE3 1 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 1 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/win/arm64-cpu-detect/config/aom_config.asm b/third_party/libaom/source/config/win/arm64-cpu-detect/config/aom_config.asm index 2c44590..1eca30d 100644 --- a/third_party/libaom/source/config/win/arm64-cpu-detect/config/aom_config.asm +++ b/third_party/libaom/source/config/win/arm64-cpu-detect/config/aom_config.asm
@@ -52,6 +52,7 @@ CONFIG_OUTPUT_FRAME_SIZE equ 0 CONFIG_PARTITION_SEARCH_ORDER equ 0 CONFIG_PIC equ 1 +CONFIG_QUANT_MATRIX equ 1 CONFIG_RATECTRL_LOG equ 0 CONFIG_RD_COMMAND equ 0 CONFIG_RD_DEBUG equ 0 @@ -87,6 +88,7 @@ HAVE_SSE4_2 equ 0 HAVE_SSSE3 equ 0 HAVE_SVE equ 0 +HAVE_SVE2 equ 0 HAVE_UNISTD_H equ 1 HAVE_VSX equ 0 HAVE_WXWIDGETS equ 0
diff --git a/third_party/libaom/source/config/win/arm64-cpu-detect/config/aom_config.h b/third_party/libaom/source/config/win/arm64-cpu-detect/config/aom_config.h index 999e8c24..6da1c586 100644 --- a/third_party/libaom/source/config/win/arm64-cpu-detect/config/aom_config.h +++ b/third_party/libaom/source/config/win/arm64-cpu-detect/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 0 #define HAVE_SSSE3 0 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 0 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/win/ia32/config/aom_config.asm b/third_party/libaom/source/config/win/ia32/config/aom_config.asm index b0d831cb..f7b343a 100644 --- a/third_party/libaom/source/config/win/ia32/config/aom_config.asm +++ b/third_party/libaom/source/config/win/ia32/config/aom_config.asm
@@ -42,6 +42,7 @@ %define CONFIG_OUTPUT_FRAME_SIZE 0 %define CONFIG_PARTITION_SEARCH_ORDER 0 %define CONFIG_PIC 1 +%define CONFIG_QUANT_MATRIX 1 %define CONFIG_RATECTRL_LOG 0 %define CONFIG_RD_COMMAND 0 %define CONFIG_RD_DEBUG 0 @@ -77,6 +78,7 @@ %define HAVE_SSE4_2 1 %define HAVE_SSSE3 1 %define HAVE_SVE 0 +%define HAVE_SVE2 0 %define HAVE_UNISTD_H 0 %define HAVE_VSX 0 %define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/win/ia32/config/aom_config.h b/third_party/libaom/source/config/win/ia32/config/aom_config.h index 080f471..28b5c085 100644 --- a/third_party/libaom/source/config/win/ia32/config/aom_config.h +++ b/third_party/libaom/source/config/win/ia32/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 1 #define HAVE_SSSE3 1 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 0 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/win/x64/config/aom_config.asm b/third_party/libaom/source/config/win/x64/config/aom_config.asm index 94ab526..9f409b6 100644 --- a/third_party/libaom/source/config/win/x64/config/aom_config.asm +++ b/third_party/libaom/source/config/win/x64/config/aom_config.asm
@@ -42,6 +42,7 @@ %define CONFIG_OUTPUT_FRAME_SIZE 0 %define CONFIG_PARTITION_SEARCH_ORDER 0 %define CONFIG_PIC 1 +%define CONFIG_QUANT_MATRIX 1 %define CONFIG_RATECTRL_LOG 0 %define CONFIG_RD_COMMAND 0 %define CONFIG_RD_DEBUG 0 @@ -77,6 +78,7 @@ %define HAVE_SSE4_2 1 %define HAVE_SSSE3 1 %define HAVE_SVE 0 +%define HAVE_SVE2 0 %define HAVE_UNISTD_H 0 %define HAVE_VSX 0 %define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/config/win/x64/config/aom_config.h b/third_party/libaom/source/config/win/x64/config/aom_config.h index 74609740..309ce38 100644 --- a/third_party/libaom/source/config/win/x64/config/aom_config.h +++ b/third_party/libaom/source/config/win/x64/config/aom_config.h
@@ -54,6 +54,7 @@ #define CONFIG_OUTPUT_FRAME_SIZE 0 #define CONFIG_PARTITION_SEARCH_ORDER 0 #define CONFIG_PIC 1 +#define CONFIG_QUANT_MATRIX 1 #define CONFIG_RATECTRL_LOG 0 #define CONFIG_RD_COMMAND 0 #define CONFIG_RD_DEBUG 0 @@ -89,6 +90,7 @@ #define HAVE_SSE4_2 1 #define HAVE_SSSE3 1 #define HAVE_SVE 0 +#define HAVE_SVE2 0 #define HAVE_UNISTD_H 0 #define HAVE_VSX 0 #define HAVE_WXWIDGETS 0
diff --git a/third_party/libaom/source/libaom b/third_party/libaom/source/libaom index a2d599c..14010c6 160000 --- a/third_party/libaom/source/libaom +++ b/third_party/libaom/source/libaom
@@ -1 +1 @@ -Subproject commit a2d599c9750e3027d3104770fe74ff5d5d012c13 +Subproject commit 14010c6f0f787b0c294a352823e34fe058674510
diff --git a/third_party/perfetto b/third_party/perfetto index 3fa1408..77ac4b7 160000 --- a/third_party/perfetto +++ b/third_party/perfetto
@@ -1 +1 @@ -Subproject commit 3fa1408bbc785c9e6c5d69ba5f807243fa9dc9fd +Subproject commit 77ac4b7528eeb8444b6f829264a2e82be99a8cd0
diff --git a/third_party/rust/chromium_crates_io/Cargo.lock b/third_party/rust/chromium_crates_io/Cargo.lock index 4069529d3..4cc9a91 100644 --- a/third_party/rust/chromium_crates_io/Cargo.lock +++ b/third_party/rust/chromium_crates_io/Cargo.lock
@@ -347,7 +347,7 @@ [[package]] name = "read-fonts" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "font-types",
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 78f1033..79e737c6 100644 --- a/third_party/rust/chromium_crates_io/supply-chain/config.toml +++ b/third_party/rust/chromium_crates_io/supply-chain/config.toml
@@ -181,7 +181,7 @@ [policy."rand_pcg:0.3.1"] criteria = ["does-not-implement-crypto", "safe-to-run"] -[policy."read-fonts:0.15.5"] +[policy."read-fonts:0.15.6"] criteria = ["does-not-implement-crypto", "safe-to-deploy", "ub-risk-2"] [policy."regex-automata:0.4.5"] @@ -412,12 +412,13 @@ notes = "Grandparented-in when setting up `cargo vet` in Jan 2024" [[exemptions.read-fonts]] -version = "0.15.5" +version = "0.15.6" criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] notes = """ 0.15.2 grandparented-in when setting up `cargo vet` in Jan 2024. Exemption updated to 0.15.5 when updating the crate in Feb 2024. +Exemption updated to 0.15.6 when updating the crate in Feb 2024. """ [[exemptions.rustversion]]
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/.cargo_vcs_info.json deleted file mode 100644 index 3bdb3e6..0000000 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/.cargo_vcs_info.json +++ /dev/null
@@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "a4256de95a92f8254168620668856981f2586634" - }, - "path_in_vcs": "read-fonts" -} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/.cargo-checksum.json similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/.cargo-checksum.json rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/.cargo_vcs_info.json new file mode 100644 index 0000000..dab365c --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/.cargo_vcs_info.json
@@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "853dbfb6ee0eeb14a3d1eed3d47b3e0360443eee" + }, + "path_in_vcs": "read-fonts" +} \ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/Cargo.toml similarity index 97% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/Cargo.toml rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/Cargo.toml index 3ea0f1d..2b314e68 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/Cargo.toml
@@ -12,7 +12,7 @@ [package] edition = "2021" name = "read-fonts" -version = "0.15.5" +version = "0.15.6" description = "Reading OpenType font files." readme = "README.md" categories = [
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/Cargo.toml.orig similarity index 96% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/Cargo.toml.orig rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/Cargo.toml.orig index bfe08d2..437a060 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/Cargo.toml.orig +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/Cargo.toml.orig
@@ -1,6 +1,6 @@ [package] name = "read-fonts" -version = "0.15.5" +version = "0.15.6" edition = "2021" license = "MIT/Apache-2.0" description = "Reading OpenType font files."
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/LICENSE-APACHE b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/LICENSE-APACHE similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/LICENSE-APACHE rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/LICENSE-APACHE
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/LICENSE-MIT b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/LICENSE-MIT similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/LICENSE-MIT rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/LICENSE-MIT
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/README.md b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/README.md similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/README.md rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/font.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/font.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/font.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/font.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_avar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_avar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_avar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_avar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_base.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_base.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_base.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_base.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_bitmap.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_bitmap.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_bitmap.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_bitmap.rs index 5126d19..606c3449 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_bitmap.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_bitmap.rs
@@ -966,7 +966,8 @@ cursor.advance::<u16>(); cursor.advance::<u16>(); cursor.advance::<u32>(); - let sbit_offsets_byte_len = cursor.remaining_bytes(); + let sbit_offsets_byte_len = + cursor.remaining_bytes() / u32::RAW_BYTE_LEN * u32::RAW_BYTE_LEN; cursor.advance_by(sbit_offsets_byte_len); cursor.finish(IndexSubtable1Marker { sbit_offsets_byte_len, @@ -1176,7 +1177,8 @@ cursor.advance::<u16>(); cursor.advance::<u16>(); cursor.advance::<u32>(); - let sbit_offsets_byte_len = cursor.remaining_bytes(); + let sbit_offsets_byte_len = + cursor.remaining_bytes() / u16::RAW_BYTE_LEN * u16::RAW_BYTE_LEN; cursor.advance_by(sbit_offsets_byte_len); cursor.finish(IndexSubtable3Marker { sbit_offsets_byte_len,
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cbdt.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cbdt.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cbdt.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cbdt.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cblc.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cblc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cblc.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cblc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cff.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cff.rs similarity index 97% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cff.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cff.rs index eef5c95..a8d7c8a 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cff.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cff.rs
@@ -49,7 +49,7 @@ cursor.advance::<u8>(); let _padding_byte_len = transforms::subtract(hdr_size, 4_usize) * u8::RAW_BYTE_LEN; cursor.advance_by(_padding_byte_len); - let trailing_data_byte_len = cursor.remaining_bytes(); + let trailing_data_byte_len = cursor.remaining_bytes() / u8::RAW_BYTE_LEN * u8::RAW_BYTE_LEN; cursor.advance_by(trailing_data_byte_len); cursor.finish(CffHeaderMarker { _padding_byte_len,
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cff2.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cff2.rs similarity index 97% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cff2.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cff2.rs index fb85f48..420302ee 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cff2.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cff2.rs
@@ -56,7 +56,7 @@ cursor.advance_by(_padding_byte_len); let top_dict_data_byte_len = top_dict_length as usize * u8::RAW_BYTE_LEN; cursor.advance_by(top_dict_data_byte_len); - let trailing_data_byte_len = cursor.remaining_bytes(); + let trailing_data_byte_len = cursor.remaining_bytes() / u8::RAW_BYTE_LEN * u8::RAW_BYTE_LEN; cursor.advance_by(trailing_data_byte_len); cursor.finish(Cff2HeaderMarker { _padding_byte_len,
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cmap.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cmap.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cmap.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cmap.rs index 14cad76a..90e27056 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cmap.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cmap.rs
@@ -652,7 +652,8 @@ cursor.advance_by(id_delta_byte_len); let id_range_offsets_byte_len = transforms::half(seg_count_x2) * u16::RAW_BYTE_LEN; cursor.advance_by(id_range_offsets_byte_len); - let glyph_id_array_byte_len = cursor.remaining_bytes(); + let glyph_id_array_byte_len = + cursor.remaining_bytes() / u16::RAW_BYTE_LEN * u16::RAW_BYTE_LEN; cursor.advance_by(glyph_id_array_byte_len); cursor.finish(Cmap4Marker { end_code_byte_len, @@ -1152,7 +1153,8 @@ cursor.advance::<u32>(); cursor.advance::<u32>(); cursor.advance::<u32>(); - let glyph_id_array_byte_len = cursor.remaining_bytes(); + let glyph_id_array_byte_len = + cursor.remaining_bytes() / u16::RAW_BYTE_LEN * u16::RAW_BYTE_LEN; cursor.advance_by(glyph_id_array_byte_len); cursor.finish(Cmap10Marker { glyph_id_array_byte_len,
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_colr.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_colr.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_colr.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_colr.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cpal.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cpal.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_cpal.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_cpal.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_ebdt.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_ebdt.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_ebdt.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_ebdt.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_eblc.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_eblc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_eblc.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_eblc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_fvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_fvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_fvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_fvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_gdef.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_gdef.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_gdef.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_gdef.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_glyf.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_glyf.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_glyf.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_glyf.rs index a5b166c..5d1d36fe 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_glyf.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_glyf.rs
@@ -112,7 +112,7 @@ let instruction_length: u16 = cursor.read()?; let instructions_byte_len = instruction_length as usize * u8::RAW_BYTE_LEN; cursor.advance_by(instructions_byte_len); - let glyph_data_byte_len = cursor.remaining_bytes(); + let glyph_data_byte_len = cursor.remaining_bytes() / u8::RAW_BYTE_LEN * u8::RAW_BYTE_LEN; cursor.advance_by(glyph_data_byte_len); cursor.finish(SimpleGlyphMarker { end_pts_of_contours_byte_len, @@ -648,7 +648,8 @@ cursor.advance::<i16>(); cursor.advance::<i16>(); cursor.advance::<i16>(); - let component_data_byte_len = cursor.remaining_bytes(); + let component_data_byte_len = + cursor.remaining_bytes() / u8::RAW_BYTE_LEN * u8::RAW_BYTE_LEN; cursor.advance_by(component_data_byte_len); cursor.finish(CompositeGlyphMarker { component_data_byte_len,
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_gpos.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_gpos.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_gpos.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_gpos.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_gsub.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_gsub.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_gsub.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_gsub.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_gvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_gvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_gvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_gvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_head.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_head.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_head.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_head.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_hhea.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_hhea.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_hhea.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_hhea.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_hmtx.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_hmtx.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_hmtx.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_hmtx.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_hvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_hvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_hvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_hvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_layout.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_layout.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_layout.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_layout.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_maxp.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_maxp.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_maxp.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_maxp.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_mvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_mvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_mvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_mvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_name.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_name.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_name.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_name.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_os2.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_os2.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_os2.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_os2.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_post.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_post.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_post.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_post.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_postscript.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_postscript.rs similarity index 98% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_postscript.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_postscript.rs index c7f7088..5f98feb 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_postscript.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_postscript.rs
@@ -40,7 +40,7 @@ let offsets_byte_len = transforms::add_multiply(count, 1_usize, off_size) * u8::RAW_BYTE_LEN; cursor.advance_by(offsets_byte_len); - let data_byte_len = cursor.remaining_bytes(); + let data_byte_len = cursor.remaining_bytes() / u8::RAW_BYTE_LEN * u8::RAW_BYTE_LEN; cursor.advance_by(data_byte_len); cursor.finish(Index1Marker { offsets_byte_len, @@ -136,7 +136,7 @@ let offsets_byte_len = transforms::add_multiply(count, 1_usize, off_size) * u8::RAW_BYTE_LEN; cursor.advance_by(offsets_byte_len); - let data_byte_len = cursor.remaining_bytes(); + let data_byte_len = cursor.remaining_bytes() / u8::RAW_BYTE_LEN * u8::RAW_BYTE_LEN; cursor.advance_by(data_byte_len); cursor.finish(Index2Marker { offsets_byte_len, @@ -282,7 +282,7 @@ fn read(data: FontData<'a>) -> Result<Self, ReadError> { let mut cursor = data.cursor(); cursor.advance::<u8>(); - let fds_byte_len = cursor.remaining_bytes(); + let fds_byte_len = cursor.remaining_bytes() / u8::RAW_BYTE_LEN * u8::RAW_BYTE_LEN; cursor.advance_by(fds_byte_len); cursor.finish(FdSelectFormat0Marker { fds_byte_len }) }
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_sbix.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_sbix.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_sbix.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_sbix.rs index 88e99f4..640f90d 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_sbix.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_sbix.rs
@@ -583,7 +583,7 @@ cursor.advance::<i16>(); cursor.advance::<i16>(); cursor.advance::<Tag>(); - let data_byte_len = cursor.remaining_bytes(); + let data_byte_len = cursor.remaining_bytes() / u8::RAW_BYTE_LEN * u8::RAW_BYTE_LEN; cursor.advance_by(data_byte_len); cursor.finish(GlyphDataMarker { data_byte_len }) }
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_stat.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_stat.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_stat.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_stat.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_count_all.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_count_all.rs new file mode 100644 index 0000000..f62b1a81 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_count_all.rs
@@ -0,0 +1,130 @@ +// THIS FILE IS AUTOGENERATED. +// Any changes to this file will be overwritten. +// For more information about how codegen works, see font-codegen/README.md + +#[allow(unused_imports)] +use crate::codegen_prelude::*; + +#[derive(Debug, Clone, Copy)] +#[doc(hidden)] +pub struct CountAll16Marker { + remainder_byte_len: usize, +} + +impl CountAll16Marker { + fn some_field_byte_range(&self) -> Range<usize> { + let start = 0; + start..start + u16::RAW_BYTE_LEN + } + fn remainder_byte_range(&self) -> Range<usize> { + let start = self.some_field_byte_range().end; + start..start + self.remainder_byte_len + } +} + +impl<'a> FontRead<'a> for CountAll16<'a> { + fn read(data: FontData<'a>) -> Result<Self, ReadError> { + let mut cursor = data.cursor(); + cursor.advance::<u16>(); + let remainder_byte_len = cursor.remaining_bytes() / u16::RAW_BYTE_LEN * u16::RAW_BYTE_LEN; + cursor.advance_by(remainder_byte_len); + cursor.finish(CountAll16Marker { remainder_byte_len }) + } +} + +pub type CountAll16<'a> = TableRef<'a, CountAll16Marker>; + +impl<'a> CountAll16<'a> { + pub fn some_field(&self) -> u16 { + let range = self.shape.some_field_byte_range(); + self.data.read_at(range.start).unwrap() + } + + pub fn remainder(&self) -> &'a [BigEndian<u16>] { + let range = self.shape.remainder_byte_range(); + self.data.read_array(range).unwrap() + } +} + +#[cfg(feature = "traversal")] +impl<'a> SomeTable<'a> for CountAll16<'a> { + fn type_name(&self) -> &str { + "CountAll16" + } + fn get_field(&self, idx: usize) -> Option<Field<'a>> { + match idx { + 0usize => Some(Field::new("some_field", self.some_field())), + 1usize => Some(Field::new("remainder", self.remainder())), + _ => None, + } + } +} + +#[cfg(feature = "traversal")] +impl<'a> std::fmt::Debug for CountAll16<'a> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + (self as &dyn SomeTable<'a>).fmt(f) + } +} + +#[derive(Debug, Clone, Copy)] +#[doc(hidden)] +pub struct CountAll32Marker { + remainder_byte_len: usize, +} + +impl CountAll32Marker { + fn some_field_byte_range(&self) -> Range<usize> { + let start = 0; + start..start + u16::RAW_BYTE_LEN + } + fn remainder_byte_range(&self) -> Range<usize> { + let start = self.some_field_byte_range().end; + start..start + self.remainder_byte_len + } +} + +impl<'a> FontRead<'a> for CountAll32<'a> { + fn read(data: FontData<'a>) -> Result<Self, ReadError> { + let mut cursor = data.cursor(); + cursor.advance::<u16>(); + let remainder_byte_len = cursor.remaining_bytes() / u32::RAW_BYTE_LEN * u32::RAW_BYTE_LEN; + cursor.advance_by(remainder_byte_len); + cursor.finish(CountAll32Marker { remainder_byte_len }) + } +} + +pub type CountAll32<'a> = TableRef<'a, CountAll32Marker>; + +impl<'a> CountAll32<'a> { + pub fn some_field(&self) -> u16 { + let range = self.shape.some_field_byte_range(); + self.data.read_at(range.start).unwrap() + } + + pub fn remainder(&self) -> &'a [BigEndian<u32>] { + let range = self.shape.remainder_byte_range(); + self.data.read_array(range).unwrap() + } +} + +#[cfg(feature = "traversal")] +impl<'a> SomeTable<'a> for CountAll32<'a> { + fn type_name(&self) -> &str { + "CountAll32" + } + fn get_field(&self, idx: usize) -> Option<Field<'a>> { + match idx { + 0usize => Some(Field::new("some_field", self.some_field())), + 1usize => Some(Field::new("remainder", self.remainder())), + _ => None, + } + } +} + +#[cfg(feature = "traversal")] +impl<'a> std::fmt::Debug for CountAll32<'a> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + (self as &dyn SomeTable<'a>).fmt(f) + } +}
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_enum.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_enum.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_enum.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_enum.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_flags.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_flags.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_flags.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_flags.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_formats.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_formats.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_formats.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_formats.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_offsets_arrays.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_offsets_arrays.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_offsets_arrays.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_offsets_arrays.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_records.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_records.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_test_records.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_test_records.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_variations.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_variations.rs similarity index 99% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_variations.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_variations.rs index fdd5fe14..ee1d9f1 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_variations.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_variations.rs
@@ -1148,7 +1148,7 @@ let region_index_count: u16 = cursor.read()?; let region_indexes_byte_len = region_index_count as usize * u16::RAW_BYTE_LEN; cursor.advance_by(region_indexes_byte_len); - let delta_sets_byte_len = cursor.remaining_bytes(); + let delta_sets_byte_len = cursor.remaining_bytes() / u8::RAW_BYTE_LEN * u8::RAW_BYTE_LEN; cursor.advance_by(delta_sets_byte_len); cursor.finish(ItemVariationDataMarker { region_indexes_byte_len,
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_vhea.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_vhea.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_vhea.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_vhea.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_vmtx.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_vmtx.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_vmtx.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_vmtx.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_vvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_vvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/generated/generated_vvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/generated/generated_vvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/array.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/array.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/array.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/array.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/codegen_test.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/codegen_test.rs similarity index 71% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/codegen_test.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/codegen_test.rs index 0cf1093..5c96cc16 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/codegen_test.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/codegen_test.rs
@@ -72,3 +72,27 @@ pub mod enums { include!("../generated/generated_test_enum.rs"); } + +pub mod count_all { + use crate::FontData; + + include!("../generated/generated_test_count_all.rs"); + + /// Test for count(..) with element sizes > 1 + #[test] + fn element_size_greater_than_one_with_padding() { + // Size of 13 ensures we have an extra padding byte + let bytes = [0u8; 13]; + // Generated table has a 2 byte field above the array + let remainder_len = bytes.len() - 2; + let data = FontData::new(&bytes); + // Trailing array with 16-bit elements + assert!(remainder_len % 2 != 0); + let count16 = CountAll16::read(data).unwrap(); + assert_eq!(count16.remainder().len(), remainder_len / 2); + // Trailing array with 32-bit elements + assert!(remainder_len % 4 != 0); + let count32 = CountAll32::read(data).unwrap(); + assert_eq!(count32.remainder().len(), remainder_len / 4); + } +}
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/font_data.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/font_data.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/font_data.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/font_data.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/lib.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/lib.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/lib.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/offset.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/offset.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/offset.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/offset.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/offset_array.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/offset_array.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/offset_array.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/offset_array.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/read.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/read.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/read.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/read.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/scaler_test.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/scaler_test.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/scaler_test.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/scaler_test.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/table_provider.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/table_provider.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/table_provider.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/table_provider.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/table_ref.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/table_ref.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/table_ref.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/table_ref.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/avar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/avar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/avar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/avar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/base.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/base.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/base.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/base.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/bitmap.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/bitmap.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/bitmap.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/bitmap.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cbdt.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cbdt.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cbdt.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cbdt.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cblc.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cblc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cblc.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cblc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cff.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cff.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cff.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cff.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cff2.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cff2.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cff2.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cff2.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cmap.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cmap.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cmap.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cmap.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/colr.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/colr.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/colr.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/colr.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cpal.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cpal.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cpal.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cpal.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/ebdt.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/ebdt.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/ebdt.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/ebdt.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/eblc.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/eblc.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/eblc.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/eblc.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/fvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/fvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/fvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/fvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gdef.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gdef.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gdef.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gdef.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode/decode.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode/decode.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode/decode.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode/decode.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode/instruction.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode/instruction.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode/instruction.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode/instruction.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode/opcode.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode/opcode.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode/opcode.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode/opcode.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gpos.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gpos.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gpos.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gpos.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gsub.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gsub.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gsub.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gsub.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gsub/closure.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gsub/closure.rs similarity index 93% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gsub/closure.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gsub/closure.rs index d9d95fc..f02431a 100644 --- a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gsub/closure.rs +++ b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gsub/closure.rs
@@ -69,10 +69,36 @@ let feature_list = self.feature_list()?; let lookup_list = self.lookup_list()?; // first we want to get the lookups that are directly referenced by a feature + // (including in a feature variation table) let mut lookup_ids = HashSet::with_capacity(lookup_list.lookup_count() as _); - for rec in feature_list.feature_records() { - let feat = rec.feature(feature_list.offset_data())?; - lookup_ids.extend(feat.lookup_list_indices().iter().map(|idx| idx.get())); + let feature_variations = self + .feature_variations() + .transpose()? + .map(|vars| { + let data = vars.offset_data(); + vars.feature_variation_records() + .iter() + .filter_map(move |rec| { + rec.feature_table_substitution(data) + .transpose() + .ok() + .flatten() + }) + .flat_map(|subs| { + subs.substitutions() + .iter() + .map(move |sub| sub.alternate_feature(subs.offset_data())) + }) + }) + .into_iter() + .flatten(); + for feature in feature_list + .feature_records() + .iter() + .map(|rec| rec.feature(feature_list.offset_data())) + .chain(feature_variations) + { + lookup_ids.extend(feature?.lookup_list_indices().iter().map(|idx| idx.get())); } // and now we need to add lookups referenced by contextual lookups, @@ -597,4 +623,13 @@ let intermediate = compute_closure(&gsub, &glyph_map, &["a", "B.2"]); assert_closure_result!(glyph_map, intermediate, &["a", "B.2", "B.3"]); } + + #[test] + fn feature_variations() { + let gsub = get_gsub(test_data::VARIATIONS_CLOSURE); + let glyph_map = GlyphMap::new(test_data::VARIATIONS_GLYPHS); + + let input = compute_closure(&gsub, &glyph_map, &["a"]); + assert_closure_result!(glyph_map, input, &["a", "b", "c"]); + } }
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/head.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/head.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/head.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/head.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/hhea.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/hhea.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/hhea.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/hhea.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/hmtx.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/hmtx.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/hmtx.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/hmtx.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/hvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/hvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/hvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/hvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/instance_record.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/instance_record.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/instance_record.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/instance_record.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/layout.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/layout.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/layout.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/layout.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/loca.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/loca.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/loca.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/loca.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/lookupflag.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/lookupflag.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/lookupflag.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/lookupflag.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/maxp.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/maxp.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/maxp.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/maxp.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/mvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/mvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/mvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/mvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/name.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/name.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/name.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/name.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/os2.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/os2.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/os2.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/os2.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/post.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/post.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/post.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/post.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/blend.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/blend.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/blend.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/blend.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/charstring.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/charstring.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/charstring.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/charstring.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/dict.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/dict.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/dict.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/dict.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/fd_select.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/fd_select.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/fd_select.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/fd_select.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/index.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/index.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/index.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/index.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/stack.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/stack.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/stack.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/stack.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/string.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/string.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/string.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/string.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/sbix.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/sbix.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/sbix.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/sbix.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/stat.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/stat.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/stat.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/stat.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/value_record.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/value_record.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/value_record.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/value_record.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/variations.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/variations.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/variations.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/variations.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/vhea.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/vhea.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/vhea.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/vhea.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/vmtx.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/vmtx.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/vmtx.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/vmtx.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/vvar.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/vvar.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/vvar.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/vvar.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/layout.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/layout.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/layout.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/layout.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_gdef.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_gdef.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_gdef.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_gdef.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_gpos.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_gpos.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_gpos.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_gpos.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_gsub.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_gsub.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_gsub.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_gsub.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_helpers.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_helpers.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_helpers.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_helpers.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/traversal.rs b/third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/traversal.rs similarity index 100% rename from third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/traversal.rs rename to third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/traversal.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 6e0be91..82e85448 100644 --- a/third_party/rust/chromium_crates_io/vet_config.toml.hbs +++ b/third_party/rust/chromium_crates_io/vet_config.toml.hbs
@@ -180,12 +180,13 @@ notes = "Grandparented-in when setting up `cargo vet` in Jan 2024" [[exemptions.read-fonts]] -version = "0.15.5" +version = "0.15.6" criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] notes = """ 0.15.2 grandparented-in when setting up `cargo vet` in Jan 2024. Exemption updated to 0.15.5 when updating the crate in Feb 2024. +Exemption updated to 0.15.6 when updating the crate in Feb 2024. """ [[exemptions.rustversion]]
diff --git a/third_party/rust/read_fonts/v0_15/BUILD.gn b/third_party/rust/read_fonts/v0_15/BUILD.gn index 71617c1..909be98 100644 --- a/third_party/rust/read_fonts/v0_15/BUILD.gn +++ b/third_party/rust/read_fonts/v0_15/BUILD.gn
@@ -12,124 +12,125 @@ crate_name = "read_fonts" epoch = "0.15" crate_type = "rlib" - crate_root = "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/lib.rs" + crate_root = "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/lib.rs" sources = [ - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/array.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/codegen_test.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/font_data.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/lib.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/offset.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/offset_array.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/read.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/scaler_test.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/table_provider.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/table_ref.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/avar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/base.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/bitmap.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cbdt.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cblc.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cff.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cff2.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cmap.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/colr.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/cpal.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/ebdt.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/eblc.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/fvar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gdef.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode/decode.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode/instruction.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/glyf/bytecode/opcode.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gpos.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gsub.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gsub/closure.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/gvar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/head.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/hhea.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/hmtx.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/hvar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/instance_record.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/layout.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/loca.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/lookupflag.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/maxp.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/mvar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/name.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/os2.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/post.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/blend.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/charstring.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/dict.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/fd_select.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/index.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/stack.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/postscript/string.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/sbix.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/stat.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/value_record.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/variations.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/vhea.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/vmtx.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tables/vvar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/layout.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_gdef.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_gpos.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_gsub.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/tests/test_helpers.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/traversal.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/array.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/codegen_test.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/font_data.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/lib.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/offset.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/offset_array.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/read.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/scaler_test.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/table_provider.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/table_ref.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/avar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/base.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/bitmap.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cbdt.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cblc.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cff.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cff2.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cmap.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/colr.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/cpal.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/ebdt.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/eblc.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/fvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gdef.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode/decode.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode/instruction.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/glyf/bytecode/opcode.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gpos.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gsub.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gsub/closure.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/gvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/head.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/hhea.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/hmtx.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/hvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/instance_record.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/layout.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/loca.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/lookupflag.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/maxp.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/mvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/name.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/os2.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/post.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/blend.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/charstring.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/dict.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/fd_select.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/index.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/stack.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/postscript/string.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/sbix.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/stat.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/value_record.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/variations.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/vhea.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/vmtx.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tables/vvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/layout.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_gdef.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_gpos.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_gsub.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/tests/test_helpers.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/traversal.rs", ] inputs = [ - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/font.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_avar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_base.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_bitmap.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_cbdt.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_cblc.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_cff.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_cff2.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_cmap.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_colr.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_cpal.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_ebdt.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_eblc.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_fvar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_gdef.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_glyf.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_gpos.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_gsub.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_gvar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_head.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_hhea.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_hmtx.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_hvar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_layout.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_maxp.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_mvar.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_name.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_os2.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_post.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_postscript.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_sbix.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_stat.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_test_enum.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_test_flags.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_test_formats.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_test_offsets_arrays.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_test_records.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_variations.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_vhea.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_vmtx.rs", - "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/src/../generated/generated_vvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/font.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_avar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_base.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_bitmap.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_cbdt.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_cblc.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_cff.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_cff2.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_cmap.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_colr.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_cpal.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_ebdt.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_eblc.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_fvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_gdef.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_glyf.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_gpos.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_gsub.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_gvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_head.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_hhea.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_hmtx.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_hvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_layout.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_maxp.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_mvar.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_name.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_os2.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_post.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_postscript.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_sbix.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_stat.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_test_count_all.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_test_enum.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_test_flags.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_test_formats.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_test_offsets_arrays.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_test_records.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_variations.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_vhea.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_vmtx.rs", + "//third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/src/../generated/generated_vvar.rs", ] build_native_rust_unit_tests = false edition = "2021" - cargo_pkg_version = "0.15.5" + cargo_pkg_version = "0.15.6" cargo_pkg_name = "read-fonts" cargo_pkg_description = "Reading OpenType font files." library_configs -= [ "//build/config/compiler:chromium_code" ]
diff --git a/third_party/rust/read_fonts/v0_15/README.chromium b/third_party/rust/read_fonts/v0_15/README.chromium index bc59121..4cf1b6d7 100644 --- a/third_party/rust/read_fonts/v0_15/README.chromium +++ b/third_party/rust/read_fonts/v0_15/README.chromium
@@ -1,9 +1,9 @@ Name: read-fonts URL: https://crates.io/crates/read-fonts Description: Reading OpenType font files. -Version: 0.15.5 +Version: 0.15.6 Security Critical: yes Shipped: yes License: Apache 2.0 -License File: //third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.5/LICENSE-APACHE -Revision: a4256de95a92f8254168620668856981f2586634 +License File: //third_party/rust/chromium_crates_io/vendor/read-fonts-0.15.6/LICENSE-APACHE +Revision: 853dbfb6ee0eeb14a3d1eed3d47b3e0360443eee
diff --git a/third_party/webrtc b/third_party/webrtc index 015de61..e5ac106 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit 015de612e925b0d43384fd3c589c115538bb399d +Subproject commit e5ac106a357e2a1a088b732f0232d470de42f0cb
diff --git a/third_party/zlib/contrib/tests/utils_unittest.cc b/third_party/zlib/contrib/tests/utils_unittest.cc index 3d6672d..0cc1081 100644 --- a/third_party/zlib/contrib/tests/utils_unittest.cc +++ b/third_party/zlib/contrib/tests/utils_unittest.cc
@@ -1105,6 +1105,46 @@ deflateEnd(&stream); } +TEST(ZlibTest, DeflateBound) { + // Check that the deflateBound() isn't too low when using non-default + // parameters (crbug.com/40270738). + const int level = 9; + const int windowBits = 15; + const int memLevel = 1; + const int strategy = Z_FIXED; + const uint8_t src[] = { + 49, 255, 255, 20, 45, 49, 167, 56, 55, 255, 255, 255, 223, 255, 49, + 255, 3, 78, 0, 0, 141, 253, 209, 163, 29, 195, 43, 60, 199, 123, + 112, 35, 134, 13, 148, 102, 212, 4, 184, 103, 7, 102, 225, 102, 156, + 164, 78, 48, 70, 49, 125, 162, 55, 116, 161, 174, 83, 0, 59, 0, + 225, 140, 0, 0, 63, 63, 4, 15, 198, 30, 126, 196, 33, 99, 135, + 41, 192, 82, 28, 105, 216, 170, 221, 14, 61, 1, 0, 0, 22, 195, + 45, 53, 244, 163, 167, 158, 229, 68, 18, 112, 49, 174, 43, 75, 90, + 161, 85, 19, 36, 163, 118, 228, 169, 180, 161, 237, 234, 253, 197, 234, + 66, 106, 12, 42, 124, 96, 160, 144, 183, 194, 157, 167, 202, 217}; + + z_stream stream; + stream.zalloc = Z_NULL; + stream.zfree = Z_NULL; + int ret = + deflateInit2(&stream, level, Z_DEFLATED, windowBits, memLevel, strategy); + ASSERT_EQ(ret, Z_OK); + size_t deflate_bound = deflateBound(&stream, sizeof(src)); + + uint8_t out[sizeof(src) * 10]; + stream.next_in = (uint8_t*)src; + stream.avail_in = sizeof(src); + stream.next_out = out; + stream.avail_out = sizeof(out); + ret = deflate(&stream, Z_FINISH); + ASSERT_EQ(ret, Z_STREAM_END); + + size_t out_size = sizeof(out) - stream.avail_out; + EXPECT_LE(out_size, deflate_bound); + + deflateEnd(&stream); +} + // TODO(gustavoa): make these tests run standalone. #ifndef CMAKE_STANDALONE_UNITTESTS
diff --git a/third_party/zlib/deflate.c b/third_party/zlib/deflate.c index 4920e70..4371158 100644 --- a/third_party/zlib/deflate.c +++ b/third_party/zlib/deflate.c
@@ -923,6 +923,12 @@ wraplen = 6; } + /* With Chromium's hashing, s->hash_bits may not correspond to the + memLevel, making the computations below incorrect. Return the + conservative bound. */ + if (s->chromium_zlib_hash) + return (fixedlen > storelen ? fixedlen : storelen) + wraplen; + /* if not default parameters, return one of the conservative bounds */ if (s->w_bits != 15 || s->hash_bits != 8 + 7) return (s->w_bits <= s->hash_bits && s->level ? fixedlen : storelen) +
diff --git a/tools/cygprofile/orderfile_generator_backend.py b/tools/cygprofile/orderfile_generator_backend.py index b0d713f..75f8fda5 100755 --- a/tools/cygprofile/orderfile_generator_backend.py +++ b/tools/cygprofile/orderfile_generator_backend.py
@@ -522,8 +522,10 @@ """ _CHECK_ORDERFILE_SCRIPT = os.path.join( constants.DIR_SOURCE_ROOT, 'tools', 'cygprofile', 'check_orderfile.py') - _BUILD_ROOT = os.path.abspath(os.path.dirname(os.path.dirname( - constants.GetOutDirectory()))) # Normally /path/to/src + # Normally /path/to/src/out. + _OUT_DIR = os.path.abspath(os.path.dirname(constants.GetOutDirectory())) + # Normally /path/to/src. + _BUILD_ROOT = os.path.dirname(_OUT_DIR) # Previous orderfile_generator debug files would be overwritten. _DIRECTORY_FOR_DEBUG_FILES = '/tmp/orderfile_generator_debug_files' @@ -598,6 +600,18 @@ self._BUILD_ROOT, self._options.arch + '_instrumented_out') if self._options.use_call_graph: self._instrumented_out_dir += '_call_graph' + if options.use_common_out_dir_for_instrumented: + assert options.buildbot, ('--use-common-out-dir-for-instrumented is only ' + 'meant to be used with --buildbot, otherwise ' + 'it will overwrite the local out/Release dir.') + # This is used on the bot to save the directory for the stack tool. We + # only save the instrumented out dir since it is needed to deobfuscate the + # stack trace. The uninstrumented build is used to compare performance on + # Speedometer with/without orderfile, which is less likely to fail. + if os.path.exists(self._instrumented_out_dir): + # Clean up any old leftover instrumented dirs. + shutil.rmtree(self._instrumented_out_dir, ignore_errors=True) + self._instrumented_out_dir = self._OUT_DIR self._uninstrumented_out_dir = os.path.join( self._BUILD_ROOT, self._options.arch + '_uninstrumented_out') @@ -1010,7 +1024,13 @@ if self._options.profile: try: - _UnstashOutputDirectory(self._instrumented_out_dir) + if not self._options.use_common_out_dir_for_instrumented: + _UnstashOutputDirectory(self._instrumented_out_dir) + else: + # Clean up any old leftover out/Release stuff. + if os.path.exists(self._instrumented_out_dir): + shutil.rmtree(self._instrumented_out_dir, ignore_errors=True) + self._compiler = ClankCompiler(self._instrumented_out_dir, self._step_recorder, self._options, self._GetPathToOrderfile(), @@ -1028,7 +1048,8 @@ self._GenerateAndProcessProfile() self._MaybeArchiveOrderfile(self._GetUnpatchedOrderfileFilename()) finally: - _StashOutputDirectory(self._instrumented_out_dir) + if not self._options.use_common_out_dir_for_instrumented: + _StashOutputDirectory(self._instrumented_out_dir) elif self._options.manual_symbol_offsets: assert self._options.manual_libname assert self._options.manual_objdir @@ -1204,6 +1225,10 @@ 'checkout; performs no other action')) parser.add_argument('--use-call-graph', action='store_true', default=False, help='Use call graph instrumentation.') + parser.add_argument('--use-common-out-dir-for-instrumented', + action='store_true', + help='Use out/Release for the instrumented out dir so ' + 'that the stack tool works on the bot.') parser.add_argument('-v', '--verbose', dest='verbosity',
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index e0ae758..e93137f 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -226,6 +226,7 @@ 'optimization_guide-linux': 'optimization_guide_rel', 'optimization_guide-mac-arm64': 'optimization_guide_mac_arm64_rel', 'optimization_guide-mac-x64': 'optimization_guide_rel', + 'optimization_guide-win-arm64': 'optimization_guide_win_arm64_rel', 'optimization_guide-win32': 'optimization_guide_x86_rel', 'optimization_guide-win64': 'optimization_guide_rel', }, @@ -338,6 +339,7 @@ 'optimization_guide-linux': 'optimization_guide_rel', 'optimization_guide-mac-arm64': 'optimization_guide_mac_arm64_rel', 'optimization_guide-mac-x64': 'optimization_guide_rel', + 'optimization_guide-win-arm64': 'optimization_guide_win_arm64_rel', 'optimization_guide-win32': 'optimization_guide_x86_rel', 'optimization_guide-win64': 'optimization_guide_rel', }, @@ -919,6 +921,10 @@ 'minimal_symbols', 'ml_internal', 'no_widevine_cdm_host_verification', 'official', 'optimization_guide', 'pgo_phase_0', 'reclient', 'release', ], + 'optimization_guide_win_arm64_rel': [ + 'minimal_symbols', 'ml_internal', 'official', 'optimization_guide', 'pgo_phase_0', 'reclient', 'release', 'x86', 'arm64' + ], + 'optimization_guide_x86_rel': [ 'minimal_symbols', 'ml_internal', 'official', 'optimization_guide', 'pgo_phase_0', 'reclient', 'release', 'x86', ],
diff --git a/tools/mb/mb_config_expectations/internal.optimization_guide.json b/tools/mb/mb_config_expectations/internal.optimization_guide.json index a74d4eb..4503522 100644 --- a/tools/mb/mb_config_expectations/internal.optimization_guide.json +++ b/tools/mb/mb_config_expectations/internal.optimization_guide.json
@@ -68,6 +68,21 @@ "use_remoteexec": true } }, + "optimization_guide-win-arm64": { + "gn_args": { + "build_with_internal_optimization_guide": true, + "chrome_pgo_phase": 0, + "dcheck_always_on": false, + "enable_ml_internal": true, + "is_chrome_branded": true, + "is_debug": false, + "is_official_build": true, + "strip_absolute_paths_from_debug_symbols": true, + "symbol_level": 1, + "target_cpu": "arm64", + "use_remoteexec": true + } + }, "optimization_guide-win32": { "gn_args": { "build_with_internal_optimization_guide": true,
diff --git a/tools/mb/mb_config_expectations/tryserver.internal.optimization_guide.json b/tools/mb/mb_config_expectations/tryserver.internal.optimization_guide.json index 2786e7c..40ffab063 100644 --- a/tools/mb/mb_config_expectations/tryserver.internal.optimization_guide.json +++ b/tools/mb/mb_config_expectations/tryserver.internal.optimization_guide.json
@@ -143,6 +143,21 @@ "use_remoteexec": true } }, + "optimization_guide-win-arm64": { + "gn_args": { + "build_with_internal_optimization_guide": true, + "chrome_pgo_phase": 0, + "dcheck_always_on": false, + "enable_ml_internal": true, + "is_chrome_branded": true, + "is_debug": false, + "is_official_build": true, + "strip_absolute_paths_from_debug_symbols": true, + "symbol_level": 1, + "target_cpu": "arm64", + "use_remoteexec": true + } + }, "optimization_guide-win32": { "gn_args": { "build_with_internal_optimization_guide": true,
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 424b193..ab51749 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -11322,6 +11322,7 @@ <int value="4874" label="DOMClobberedShadowedFormPropertyAccessed"/> <int value="4875" label="DOMClobberedNotShadowedFormPropertyAccessed"/> <int value="4876" label="TpcdCookieReadBlockedByAdHeuristics"/> + <int value="4877" label="UsedColorSchemeRootScrollbarsDark"/> </enum> <enum name="FeaturePolicyFeature"> @@ -13841,7 +13842,9 @@ <int value="4" label="Site not loaded in main frame"/> <int value="5" label="Site not served from a secure origin"/> <int value="6" label="Site did not provide a manifest link"/> - <int value="7" label="Manifest was empty or could not be parsed"/> + <int value="7" + label="Manifest could not be fetched, parsed, or was in an + iframe/opaque origin."/> <int value="8" label="Manifest start_url not valid"/> <int value="9" label="Manifest missing name or short_name"/> <int value="10" label="Manifest display not supported"/> @@ -18111,6 +18114,7 @@ <int value="-1250240035" label="NearbySharingOnePageOnboarding:enabled"/> <int value="-1250222445" label="WebMidi:enabled"/> <int value="-1249349654" label="UseAndroidStagingSmds:disabled"/> + <int value="-1249142697" label="NtpWallpaperSearchButtonAnimation:enabled"/> <int value="-1248478422" label="enable-zip-archiver-packer"/> <int value="-1248232229" label="UsernameFirstFlowWithIntermediateValuesPredictions:enabled"/> @@ -18547,6 +18551,7 @@ <int value="-1041643783" label="SingleTouchSelect:enabled"/> <int value="-1041363400" label="QuickDeleteAndroidAnimation:enabled"/> <int value="-1041150041" label="ContextualSearchLiteralSearchTap:disabled"/> + <int value="-1040769407" label="NtpWallpaperSearchButtonAnimation:disabled"/> <int value="-1040641773" label="ArcOnDemand:enabled"/> <int value="-1040547868" label="MutationEvents:disabled"/> <int value="-1040000888" label="ContextMenuSearchWithGoogleLens:disabled"/>
diff --git a/tools/metrics/histograms/metadata/accessibility/histograms.xml b/tools/metrics/histograms/metadata/accessibility/histograms.xml index bb36e23..6792121 100644 --- a/tools/metrics/histograms/metadata/accessibility/histograms.xml +++ b/tools/metrics/histograms/metadata/accessibility/histograms.xml
@@ -47,7 +47,7 @@ </variants> <histogram name="Accessibility.ActiveTime" units="ms" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>janewman@microsoft.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -59,7 +59,7 @@ <histogram name="Accessibility.Android.AutoDisableV2.{CurrentState}Time.{CallType}" - units="ms" expires_after="2024-06-30"> + units="ms" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>dtseng@google.com</owner> @@ -88,7 +88,7 @@ <histogram name="Accessibility.Android.AutoDisableV2.{MethodCall}Called.{CallType}" - units="count" expires_after="2024-06-30"> + units="count" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>dtseng@google.com</owner> @@ -114,7 +114,7 @@ </histogram> <histogram name="Accessibility.Android.Cache.MaxNodesInCache" units="count" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -124,7 +124,7 @@ </histogram> <histogram name="Accessibility.Android.Cache.PercentageRetrievedFromCache" - units="%" expires_after="2024-06-30"> + units="%" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -135,7 +135,7 @@ </histogram> <histogram name="Accessibility.Android.OnDemand.EventsDropped" units="count" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -146,7 +146,7 @@ </histogram> <histogram name="Accessibility.Android.OnDemand.OneHundredPercentEventsDropped" - units="count" expires_after="2024-06-30"> + units="count" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -159,7 +159,7 @@ <histogram name="Accessibility.Android.OnDemand.OneHundredPercentEventsDropped.{AXMode}" - units="count" expires_after="2024-06-30"> + units="count" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -184,7 +184,7 @@ </histogram> <histogram name="Accessibility.Android.OnDemand.PercentageDropped" units="%" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -195,7 +195,7 @@ </histogram> <histogram name="Accessibility.Android.OnDemand.PercentageDropped.{AXMode}" - units="%" expires_after="2024-06-30"> + units="%" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -219,7 +219,7 @@ </histogram> <histogram name="Accessibility.Android.PageZoom.AppMenuEnabledState" - enum="AccessibilityPageZoomAppMenuEnabledState" expires_after="2024-06-30"> + enum="AccessibilityPageZoomAppMenuEnabledState" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -234,7 +234,7 @@ </histogram> <histogram name="Accessibility.Android.PageZoom.AppMenuSliderOpened" - enum="Boolean" expires_after="2024-06-30"> + enum="Boolean" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -245,7 +245,7 @@ </histogram> <histogram name="Accessibility.Android.PageZoom.AppMenuSliderZoomLevelChanged" - enum="Boolean" expires_after="2024-06-30"> + enum="Boolean" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -257,7 +257,7 @@ </histogram> <histogram name="Accessibility.Android.PageZoom.AppMenuSliderZoomLevelValue" - units="%" expires_after="2024-06-30"> + units="%" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -271,7 +271,7 @@ <histogram name="Accessibility.Android.PageZoom.SettingsDefaultZoomLevelChanged" - enum="Boolean" expires_after="2024-06-30"> + enum="Boolean" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -284,7 +284,7 @@ </histogram> <histogram name="Accessibility.Android.PageZoom.SettingsDefaultZoomLevelValue" - units="%" expires_after="2024-06-30"> + units="%" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -315,7 +315,7 @@ </histogram> <histogram name="Accessibility.Android.UpdateAccessibilityServices.DidPoll" - enum="BooleanHit" expires_after="2024-06-30"> + enum="BooleanHit" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -326,7 +326,7 @@ </histogram> <histogram name="Accessibility.Android.UpdateAccessibilityServices.PollCount" - units="count" expires_after="2024-06-30"> + units="count" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -338,7 +338,7 @@ </histogram> <histogram name="Accessibility.Android.UpdateAccessibilityServices.PollTimeout" - enum="BooleanHit" expires_after="2024-06-30"> + enum="BooleanHit" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -351,7 +351,7 @@ </histogram> <histogram name="Accessibility.Android.UpdateAccessibilityServices.Runtime" - units="microseconds" expires_after="2024-06-30"> + units="microseconds" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -363,7 +363,7 @@ </histogram> <histogram name="Accessibility.Android.Usage.A11yAlwaysOn" units="ms" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -379,7 +379,7 @@ </histogram> <histogram name="Accessibility.Android.Usage.{UsageType}" units="ms" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -397,7 +397,7 @@ </histogram> <histogram name="Accessibility.Android.UserFontSizePref.Change" units="%" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>twellington@chromium.org</owner> <owner>skym@chromium.org</owner> <summary> @@ -408,7 +408,7 @@ </histogram> <histogram name="Accessibility.Android.UserFontSizePref.OnStartup" units="%" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>twellington@chromium.org</owner> <owner>skym@chromium.org</owner> <summary> @@ -419,7 +419,7 @@ </histogram> <histogram name="Accessibility.AndroidServiceInfo.{RunningApps}" - enum="AccessibilityAndroidServiceInfoEnum" expires_after="2024-06-30"> + enum="AccessibilityAndroidServiceInfoEnum" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>dtseng@chromium.org</owner> @@ -456,7 +456,7 @@ </histogram> <histogram name="Accessibility.AutoDisabled.DisabledTime" units="ms" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -466,7 +466,7 @@ </histogram> <histogram name="Accessibility.AutoDisabled.EnabledTime" units="ms" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -476,7 +476,7 @@ </histogram> <histogram name="Accessibility.AutoDisabled.EventCount" units="count" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -543,7 +543,7 @@ </histogram> <histogram name="Accessibility.Bundle" enum="AccessibilityModeBundleEnum" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>kevers@chromium.org</owner> <owner>chrome-a11y-core@chromium.org</owner> <summary> @@ -573,7 +573,7 @@ </histogram> <histogram name="Accessibility.ChromeVox.PerformGestureType" - enum="ChromeVoxGestureType" expires_after="2024-06-30"> + enum="ChromeVoxGestureType" expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -585,7 +585,7 @@ </histogram> <histogram name="Accessibility.CrosAlwaysShowA11yMenu" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>kenjibaheux@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -597,7 +597,7 @@ </histogram> <histogram name="Accessibility.CrosAutoclick" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>kenjibaheux@google.com</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -620,7 +620,7 @@ </histogram> <histogram name="Accessibility.CrosCaretHighlight" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -664,7 +664,7 @@ </histogram> <histogram name="Accessibility.CrosCursorColor" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -675,7 +675,7 @@ </histogram> <histogram name="Accessibility.CrosCursorHighlight" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -685,7 +685,7 @@ </histogram> <histogram name="Accessibility.CrosDictation" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>anastasi@google.com</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -696,7 +696,7 @@ </histogram> <histogram name="Accessibility.CrosDictation.Language" enum="LocaleCodeISO639" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -711,7 +711,7 @@ <histogram name="Accessibility.CrosDictation.ListeningDuration.NetworkRecognition" - units="ms" expires_after="2024-06-30"> + units="ms" expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -734,7 +734,7 @@ </histogram> <histogram name="Accessibility.CrosDictation.MacroFailed" - enum="CrosDictationMacroName" expires_after="2024-06-30"> + enum="CrosDictationMacroName" expires_after="2025-02-28"> <owner>akihiroota@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -744,14 +744,14 @@ </histogram> <histogram name="Accessibility.CrosDictation.MacroRecognized" - enum="CrosDictationMacroName" expires_after="2024-04-28"> + enum="CrosDictationMacroName" expires_after="2025-02-28"> <owner>akihiroota@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary>Recorded whenever Dictation recognizes a macro.</summary> </histogram> <histogram name="Accessibility.CrosDictation.MacroSucceeded" - enum="CrosDictationMacroName" expires_after="2024-06-30"> + enum="CrosDictationMacroName" expires_after="2025-02-28"> <owner>akihiroota@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -771,7 +771,7 @@ </histogram> <histogram name="Accessibility.CrosDictation.ToggleDictationMethod" - enum="CrosDictationToggleDictationMethod" expires_after="2024-04-28"> + enum="CrosDictationToggleDictationMethod" expires_after="2025-02-28"> <owner>anastasi@google.com</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -789,7 +789,7 @@ </histogram> <histogram name="Accessibility.CrosDictation.UsedPumpkin" enum="BooleanUsage" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>akihiroota@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -800,7 +800,7 @@ </histogram> <histogram name="Accessibility.CrosDockedMagnifier" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -811,7 +811,7 @@ </histogram> <histogram name="Accessibility.CrosFocusHighlight" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -821,7 +821,7 @@ </histogram> <histogram name="Accessibility.CrosHighContrast" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>kenjibaheux@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -832,7 +832,7 @@ </histogram> <histogram name="Accessibility.CrosLargeCursor" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>kenjibaheux@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -854,7 +854,7 @@ </histogram> <histogram name="Accessibility.CrosScreenMagnifier" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>josiahk@google.com</owner> <owner>kenjibaheux@google.com</owner> @@ -866,7 +866,7 @@ </histogram> <histogram name="Accessibility.CrosSelectToSpeak" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -886,7 +886,7 @@ </histogram> <histogram name="Accessibility.CrosSelectToSpeak.BubbleDismissMethod" - enum="CrosSelectToSpeakActivationMethod" expires_after="2024-06-30"> + enum="CrosSelectToSpeakActivationMethod" expires_after="2025-02-28"> <owner>ajitnarayanan@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -898,7 +898,7 @@ </histogram> <histogram name="Accessibility.CrosSelectToSpeak.EnhancedNetworkVoices" - enum="BooleanEnabled" expires_after="2024-06-30"> + enum="BooleanEnabled" expires_after="2025-02-28"> <owner>ajitnarayanan@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -908,7 +908,7 @@ </histogram> <histogram name="Accessibility.CrosSelectToSpeak.NavigationControls" - enum="BooleanEnabled" expires_after="2024-06-30"> + enum="BooleanEnabled" expires_after="2025-02-28"> <owner>ajitnarayanan@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -918,7 +918,7 @@ <histogram name="Accessibility.CrosSelectToSpeak.OverrideSpeechRateMultiplier" enum="CrosSelectToSpeakOverrideSpeechRateMultiplier" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>ajitnarayanan@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -934,7 +934,7 @@ </histogram> <histogram name="Accessibility.CrosSelectToSpeak.ParagraphNavigationMethod" - enum="CrosSelectToSpeakActivationMethod" expires_after="2024-06-30"> + enum="CrosSelectToSpeakActivationMethod" expires_after="2025-02-28"> <owner>ajitnarayanan@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -957,7 +957,7 @@ </histogram> <histogram name="Accessibility.CrosSelectToSpeak.StartSpeechMethod" - enum="CrosSelectToSpeakStartSpeechMethod" expires_after="2024-06-30"> + enum="CrosSelectToSpeakStartSpeechMethod" expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -968,7 +968,7 @@ </histogram> <histogram name="Accessibility.CrosSelectToSpeak.StateChangeEvent" - enum="CrosSelectToSpeakStateChangeEvent" expires_after="2024-06-30"> + enum="CrosSelectToSpeakStateChangeEvent" expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -981,7 +981,7 @@ </histogram> <histogram name="Accessibility.CrosSelectToSpeak.TtsEngineUsed" - enum="CrosSelectToSpeakTtsEngineUsed" expires_after="2024-06-30"> + enum="CrosSelectToSpeakTtsEngineUsed" expires_after="2025-02-28"> <owner>ajitnarayanan@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -1021,7 +1021,7 @@ </histogram> <histogram name="Accessibility.CrosSpokenFeedback{AccessibilityEveryReport}" - enum="BooleanEnabled" expires_after="2024-06-30"> + enum="BooleanEnabled" expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>kenjibaheux@google.com</owner> <owner>aleventhal@google.com</owner> @@ -1038,7 +1038,7 @@ </histogram> <histogram name="Accessibility.CrosStickyKeys" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>kenjibaheux@google.com</owner> <owner>tengs@chromium.org</owner> @@ -1050,7 +1050,7 @@ </histogram> <histogram name="Accessibility.CrosSwitchAccess" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>anastasi@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1061,7 +1061,7 @@ </histogram> <histogram name="Accessibility.CrosSwitchAccess.AutoScan" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>anastasi@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1073,7 +1073,7 @@ </histogram> <histogram name="Accessibility.CrosSwitchAccess.AutoScan.KeyboardSpeedMs" - units="ms" expires_after="2024-06-30"> + units="ms" expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>anastasi@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1085,7 +1085,7 @@ </histogram> <histogram name="Accessibility.CrosSwitchAccess.AutoScan.SpeedMs" units="ms" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>anastasi@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1097,7 +1097,7 @@ </histogram> <histogram name="Accessibility.CrosSwitchAccess.Error" - enum="CrosSwitchAccessError" expires_after="2024-06-30"> + enum="CrosSwitchAccessError" expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>anastasi@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1108,7 +1108,7 @@ </histogram> <histogram name="Accessibility.CrosSwitchAccess.NextKeyCode" enum="KeyCode" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>anastasi@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1119,7 +1119,7 @@ </histogram> <histogram name="Accessibility.CrosSwitchAccess.PreviousKeyCode" enum="KeyCode" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>anastasi@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1130,7 +1130,7 @@ </histogram> <histogram name="Accessibility.CrosSwitchAccess.SelectKeyCode" enum="KeyCode" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>anastasi@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1169,7 +1169,7 @@ </histogram> <histogram name="Accessibility.ExperimentalModeFlag.FormControls" - enum="BooleanEnabled" expires_after="2024-06-30"> + enum="BooleanEnabled" expires_after="2025-02-28"> <owner>aldietz@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -1197,7 +1197,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.Android" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1209,7 +1209,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.Android.DialogOption" - enum="AccessibilityImageLabelModeAndroid" expires_after="2024-06-30"> + enum="AccessibilityImageLabelModeAndroid" expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1220,7 +1220,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.Android.OnlyOnWifi" - enum="BooleanEnabled" expires_after="2024-06-30"> + enum="BooleanEnabled" expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1244,7 +1244,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.PageLanguage" enum="LanguageName" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1255,7 +1255,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.RequestLanguage" enum="LanguageName" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1267,7 +1267,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.{Result}By{Dimension}" - units="pixels" expires_after="2024-06-30"> + units="pixels" expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1288,7 +1288,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.{Result}By{Length}" - units="characters" expires_after="2024-06-30"> + units="characters" expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1310,7 +1310,7 @@ </histogram> <histogram name="Accessibility.ImageLabels2" enum="BooleanEnabled" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -1322,7 +1322,7 @@ </histogram> <histogram name="Accessibility.InactiveTime" units="ms" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>abigailbklein@chromium.org</owner> <owner>janewman@microsoft.com</owner> @@ -1349,7 +1349,7 @@ </histogram> <histogram name="Accessibility.LanguageDetection.CountDetectionAttempted" - units="count" expires_after="2024-06-30"> + units="count" expires_after="2025-02-28"> <owner>chrishall@chromium.org</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1361,7 +1361,7 @@ </histogram> <histogram name="Accessibility.LanguageDetection.CountLabelled" units="count" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>chrishall@chromium.org</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1373,7 +1373,7 @@ </histogram> <histogram name="Accessibility.LanguageDetection.LangsPerPage" units="count" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>chrishall@chromium.org</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1386,7 +1386,7 @@ </histogram> <histogram name="Accessibility.LanguageDetection.PercentageLabelledWithTop" - units="%" expires_after="2024-06-30"> + units="%" expires_after="2025-02-28"> <owner>chrishall@chromium.org</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1399,7 +1399,7 @@ </histogram> <histogram name="Accessibility.LanguageDetection.PercentageLanguageDetected" - units="%" expires_after="2024-02-04"> + units="%" expires_after="2025-02-28"> <owner>chrishall@chromium.org</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1410,7 +1410,7 @@ </histogram> <histogram name="Accessibility.LanguageDetection.PercentageOverridden" - units="%" expires_after="2024-06-30"> + units="%" expires_after="2025-02-28"> <owner>chrishall@chromium.org</owner> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1695,7 +1695,7 @@ </histogram> <histogram name="Accessibility.ManuallyEnabled" enum="BooleanEnabled" - expires_after="2024-02-04"> + expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>kenjibaheux@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1707,7 +1707,7 @@ </histogram> <histogram name="Accessibility.ModeFlag" enum="AccessibilityModeFlagEnum" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -1734,7 +1734,7 @@ </histogram> <histogram name="Accessibility.PDF.HasAccessibleText" enum="BooleanExists" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>nektar@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1757,7 +1757,7 @@ </histogram> <histogram name="Accessibility.PdfOcr.ActiveWhenInaccessiblePdfOpened" - enum="BooleanExists" expires_after="2024-06-30"> + enum="BooleanExists" expires_after="2025-02-28"> <owner>kyungjunlee@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -1813,7 +1813,7 @@ </histogram> <histogram name="Accessibility.PdfOcr.UserSelection" enum="PdfOcrUserSelection" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>kyungjunlee@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -1863,7 +1863,7 @@ <histogram name="Accessibility.Performance.AXObjectCacheImpl.RedundantSerializations" - units="count" expires_after="2024-06-30"> + units="count" expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -1888,7 +1888,7 @@ </histogram> <histogram name="Accessibility.Performance.AXTree.Destroy2" - units="microseconds" expires_after="2024-06-30"> + units="microseconds" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>agarwaltushar@google.com</owner> <owner>olivierli@chromium.org</owner> @@ -1911,7 +1911,7 @@ <histogram name="Accessibility.Performance.BrowserAccessibilityManager::OnAccessibilityEvents2" - units="microseconds" expires_after="2024-06-30"> + units="microseconds" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aleventhal@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1935,7 +1935,7 @@ </histogram> <histogram name="Accessibility.Performance.HandleAXEvents2" - units="microseconds" expires_after="2024-06-30"> + units="microseconds" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aleventhal@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1953,7 +1953,7 @@ </histogram> <histogram name="Accessibility.Performance.ProcessDeferredAccessibilityEvents2" - units="microseconds" expires_after="2024-04-28"> + units="microseconds" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aleventhal@chromium.org</owner> <owner>janewman@microsoft.com</owner> @@ -1973,7 +1973,7 @@ <histogram name="Accessibility.Performance.SendPendingAccessibilityEvents.PostLoad2" - units="microseconds" expires_after="2024-05-12"> + units="microseconds" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aleventhal@chromium.org</owner> <owner>janewman@microsoft.com</owner> @@ -1992,7 +1992,7 @@ </histogram> <histogram name="Accessibility.Performance.SendPendingAccessibilityEvents2" - units="microseconds" expires_after="2024-06-30"> + units="microseconds" expires_after="2025-02-28"> <owner>mschillaci@google.com</owner> <owner>aleventhal@chromium.org</owner> <owner>janewman@microsoft.com</owner> @@ -2010,7 +2010,7 @@ </histogram> <histogram name="Accessibility.Performance.Tree.Unserialize2" - units="microseconds" expires_after="2024-06-30"> + units="microseconds" expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>janewman@microsoft.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -2027,7 +2027,7 @@ </histogram> <histogram name="Accessibility.Performance.WinAPIs.{API}" units="microseconds" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>kschmi@microsoft.com</owner> <owner>janewman@microsoft.com</owner> @@ -2087,7 +2087,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.Color" enum="ReadAnythingColor" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2096,7 +2096,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.EmptyState" - enum="ReadAnythingEmptyState" expires_after="2024-06-30"> + enum="ReadAnythingEmptyState" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2106,7 +2106,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.FontName" - enum="ReadAnythingFontName" expires_after="2024-06-30"> + enum="ReadAnythingFontName" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2115,7 +2115,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.FontScale" units="em" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2124,7 +2124,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.Language" enum="LocaleCodeISO639" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2134,7 +2134,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.LetterSpacing" - enum="ReadAnythingLetterSpacing" expires_after="2024-06-30"> + enum="ReadAnythingLetterSpacing" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2143,7 +2143,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.LineSpacing" - enum="ReadAnythingLineSpacing" expires_after="2024-06-30"> + enum="ReadAnythingLineSpacing" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2152,7 +2152,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.MergedDistillationTime.{Result}" - units="ms" expires_after="2024-06-30"> + units="ms" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2167,14 +2167,14 @@ </histogram> <histogram name="Accessibility.ReadAnything.OmniboxIconShown" - enum="BooleanShown" expires_after="2024-04-28"> + enum="BooleanShown" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary>Records when the Read Anything omnibox icon is shown.</summary> </histogram> <histogram name="Accessibility.ReadAnything.RulesDistillationTime.{Result}" - units="ms" expires_after="2024-06-30"> + units="ms" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2188,14 +2188,14 @@ </histogram> <histogram name="Accessibility.ReadAnything.ScrollEvent" - enum="ReadAnythingScrollEvent" expires_after="2024-06-30"> + enum="ReadAnythingScrollEvent" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary>Records when a scroll happens.</summary> </histogram> <histogram name="Accessibility.ReadAnything.SettingsChange" - enum="ReadAnythingSettingsChange" expires_after="2024-06-30"> + enum="ReadAnythingSettingsChange" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2238,7 +2238,7 @@ </histogram> <histogram name="Accessibility.Reliability.Tree.UnserializeError" - enum="AccessibilityTreeUnserializeError" expires_after="2024-06-30"> + enum="AccessibilityTreeUnserializeError" expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>janewman@microsoft.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -2252,7 +2252,7 @@ </histogram> <histogram name="Accessibility.ScreenAI.AnnotateScreenshotTime.{Result}" - units="ms" expires_after="2024-05-30"> + units="ms" expires_after="2025-02-28"> <owner>kyungjunlee@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2268,7 +2268,7 @@ </histogram> <histogram name="Accessibility.ScreenAI.Component.InstallRetries" units="count" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>rhalavati@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2278,7 +2278,7 @@ </histogram> <histogram name="Accessibility.ScreenAI.Component.{Action}" - enum="BooleanSuccess" expires_after="2024-06-30"> + enum="BooleanSuccess" expires_after="2025-02-28"> <owner>rhalavati@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary>Records success or failure of Screen AI component {Action}.</summary> @@ -2289,7 +2289,7 @@ </histogram> <histogram name="Accessibility.ScreenAI.LibraryLoadDetailedResultOnWindows" - enum="WinGetLastError" expires_after="2024-06-30"> + enum="WinGetLastError" expires_after="2025-02-28"> <owner>rhalavati@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2361,7 +2361,7 @@ </histogram> <histogram name="Accessibility.ScreenAI.Screen2xDistillationTime.{Result}" - units="ms" expires_after="2024-06-30"> + units="ms" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>rhalavati@google.com</owner> <owner>kyungjunlee@google.com</owner> @@ -2412,7 +2412,7 @@ </histogram> <histogram name="Accessibility.ScreenAI.{Step}.Initialized" - enum="BooleanSuccess" expires_after="2024-06-30"> + enum="BooleanSuccess" expires_after="2025-02-28"> <owner>rhalavati@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2450,7 +2450,7 @@ </histogram> <histogram name="Accessibility.WebSpeech.Duration" units="ms" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>evliu@google.com</owner> <owner>chrome-media-ux@google.com</owner> <summary> @@ -2460,7 +2460,7 @@ </histogram> <histogram name="Accessibility.WinAPIs" enum="AccessibilityWinAPIEnum" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>nektar@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -2468,7 +2468,7 @@ </histogram> <histogram name="Accessibility.WinAPIs.GetPropertyValue" - enum="AccessibilityWinAPIGetPropertyValueEnum" expires_after="2024-06-30"> + enum="AccessibilityWinAPIGetPropertyValueEnum" expires_after="2025-02-28"> <owner>aleventhal@chromium.org</owner> <owner>nektar@chromium.org</owner> <owner>dlibby@microsoft.com</owner> @@ -2628,7 +2628,7 @@ </histogram> <histogram name="PumpkinInstaller.InstallationSuccess" enum="BooleanSuccess" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>akihiroota@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2641,7 +2641,7 @@ </histogram> <histogram name="SodaInstaller.BinaryInstallationFailureTime" units="ms" - expires_after="2024-05-01"> + expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>evliu@google.com</owner> <owner>yilkal@chromium.org</owner> @@ -2654,7 +2654,7 @@ </histogram> <histogram name="SodaInstaller.BinaryInstallationResult" enum="BooleanSuccess" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>evliu@google.com</owner> <owner>yilkal@chromium.org</owner> @@ -2667,7 +2667,7 @@ </histogram> <histogram name="SodaInstaller.BinaryInstallationSuccessTime" units="ms" - expires_after="2024-05-01"> + expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>evliu@google.com</owner> <owner>yilkal@chromium.org</owner> @@ -2681,7 +2681,7 @@ <histogram name="SodaInstaller.Language.{SodaLanguageCode}.InstallationFailureTime" - units="ms" expires_after="2024-06-30"> + units="ms" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>evliu@google.com</owner> <owner>yilkal@chromium.org</owner> @@ -2695,7 +2695,7 @@ </histogram> <histogram name="SodaInstaller.Language.{SodaLanguageCode}.InstallationResult" - enum="BooleanSuccess" expires_after="2024-06-30"> + enum="BooleanSuccess" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>evliu@google.com</owner> <owner>yilkal@chromium.org</owner> @@ -2711,7 +2711,7 @@ <histogram name="SodaInstaller.Language.{SodaLanguageCode}.InstallationSuccessTime" - units="ms" expires_after="2024-06-30"> + units="ms" expires_after="2025-02-28"> <owner>abigailbklein@google.com</owner> <owner>evliu@google.com</owner> <owner>yilkal@chromium.org</owner> @@ -2725,7 +2725,7 @@ </histogram> <histogram name="TextToSpeech.Event" enum="TextToSpeechEvent" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -2737,7 +2737,7 @@ </histogram> <histogram name="TextToSpeech.Settings.GetVoiceBytes" - enum="TextToSpeechGetVoiceBytes" expires_after="2024-06-30"> + enum="TextToSpeechGetVoiceBytes" expires_after="2025-02-28"> <owner>josiahk@chromium.org</owner> <owner>akihiroota@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -2749,7 +2749,7 @@ </histogram> <histogram name="TextToSpeech.Utterance.FromExtensionAPI" - enum="TextToSpeechFromExtensionAPI" expires_after="2024-06-30"> + enum="TextToSpeechFromExtensionAPI" expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -2761,7 +2761,7 @@ </histogram> <histogram name="TextToSpeech.Utterance.HasVoiceName" - enum="TextToSpeechHasVoiceName" expires_after="2024-06-30"> + enum="TextToSpeechHasVoiceName" expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2772,7 +2772,7 @@ </histogram> <histogram name="TextToSpeech.Utterance.Native" enum="TextToSpeechNative" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2784,7 +2784,7 @@ </histogram> <histogram name="TextToSpeech.Utterance.Rate" units="count" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>dtseng@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2795,7 +2795,7 @@ </histogram> <histogram name="TextToSpeech.Utterance.Source" enum="TextToSpeechSource" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>joelriley@google.com</owner> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -2808,7 +2808,7 @@ </histogram> <histogram name="TextToSpeech.Utterance.TextLength" units="bytes" - expires_after="2024-06-30"> + expires_after="2025-02-28"> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/browsing_topics/enums.xml b/tools/metrics/histograms/metadata/browsing_topics/enums.xml index 372d7e5..bc1afa90 100644 --- a/tools/metrics/histograms/metadata/browsing_topics/enums.xml +++ b/tools/metrics/histograms/metadata/browsing_topics/enums.xml
@@ -59,6 +59,18 @@ <int value="7" label="Failure: Disallowed by permissions policy."/> </enum> +<enum name="BrowsingTopicsNumberOfTopics"> + <summary> + The number of topics returned by the Topics API. This enum type is used for + histograms when they want to set up Chirp alert on bucket proportion, as + Chirp lacks bucket proportion monitoring for numeric types. + </summary> + <int value="0" label="0"/> + <int value="1" label="1"/> + <int value="2" label="2"/> + <int value="3" label="3"/> +</enum> + <enum name="BrowsingTopicsOverrideListFileLoadResult"> <int value="0" label="Unknown"/> <int value="1" label="Success"/>
diff --git a/tools/metrics/histograms/metadata/browsing_topics/histograms.xml b/tools/metrics/histograms/metadata/browsing_topics/histograms.xml index 675a9c28..505e1aa 100644 --- a/tools/metrics/histograms/metadata/browsing_topics/histograms.xml +++ b/tools/metrics/histograms/metadata/browsing_topics/histograms.xml
@@ -178,8 +178,8 @@ </summary> </histogram> -<histogram name="BrowsingTopics.Result.FakeTopicCount" units="topics" - expires_after="2024-07-07"> +<histogram name="BrowsingTopics.Result.FakeTopicCount" + enum="BrowsingTopicsNumberOfTopics" expires_after="2024-07-07"> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary> @@ -188,8 +188,8 @@ </summary> </histogram> -<histogram name="BrowsingTopics.Result.FilteredTopicCount" units="topics" - expires_after="2024-07-07"> +<histogram name="BrowsingTopics.Result.FilteredTopicCount" + enum="BrowsingTopicsNumberOfTopics" expires_after="2024-07-07"> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary> @@ -199,8 +199,8 @@ </summary> </histogram> -<histogram name="BrowsingTopics.Result.RealTopicCount" units="topics" - expires_after="2024-07-07"> +<histogram name="BrowsingTopics.Result.RealTopicCount" + enum="BrowsingTopicsNumberOfTopics" expires_after="2024-07-07"> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/chromeos/enums.xml b/tools/metrics/histograms/metadata/chromeos/enums.xml index 350940e..99293d8 100644 --- a/tools/metrics/histograms/metadata/chromeos/enums.xml +++ b/tools/metrics/histograms/metadata/chromeos/enums.xml
@@ -886,7 +886,7 @@ <enum name="FirmwareUpdateInstallResult"> <int value="0" label="Success"/> - <int value="1" label="InstallFailed"/> + <int value="1" label="DEPRECATED: InstallFailed"/> <int value="2" label="FailedToCreateUpdateDirectory"/> <int value="3" label="DEPRECATED: InvalidDestinationFile"/> <int value="4" label="InvalidFileDescriptor"/> @@ -896,6 +896,25 @@ <int value="8" label="InvalidPatchFileUri"/> <int value="9" label="InvalidPatchFile"/> <int value="10" label="InstallFailedTimeout"/> + <int value="100" label="InternalError"/> + <int value="101" label="InstalledNewerFirmwareVersion"/> + <int value="102" label="InstalledSameFirmwareVersion"/> + <int value="103" label="AlreadySetToBeInstalledOffline"/> + <int value="104" label="FailedToGetAuthentication"/> + <int value="105" label="FailedToReadFromDevice"/> + <int value="106" label="FailedToWriteToTheDevice"/> + <int value="107" label="InvalidFileFormat"/> + <int value="108" label="NoMatchingDeviceExists"/> + <int value="109" label="NothingToDo"/> + <int value="110" label="ActionWasNotPossible"/> + <int value="111" label="SignatureWasInvalid"/> + <int value="112" label="ACPowerWasRequired"/> + <int value="113" label="PermissionWasDenied"/> + <int value="114" label="UserHasConfiguredTheirSystemInABrokenWay"/> + <int value="115" label="TheSystemBatteryLevelIsTooLow"/> + <int value="116" label="UserNeedsToDoAnActionToCompleteTheUpdate"/> + <int value="117" label="FailedToGetAuthAsCredentialsHaveExpired"/> + <int value="118" label="UnknownError"/> </enum> <enum name="GeolocationAccessLevel">
diff --git a/tools/metrics/histograms/metadata/content/histograms.xml b/tools/metrics/histograms/metadata/content/histograms.xml index 4f7e288..7f5a45b6 100644 --- a/tools/metrics/histograms/metadata/content/histograms.xml +++ b/tools/metrics/histograms/metadata/content/histograms.xml
@@ -77,6 +77,75 @@ </summary> </histogram> +<histogram name="ContentCapture.CaptureContentDelayTime" units="ms" + expires_after="2024-12-01"> + <owner>wangxianzhu@chromium.org</owner> + <owner>src/third_party/blink/renderer/core/content_capture/OWNERS</owner> + <summary> + The time between a change in content and when the new capture is sent to the + browser process. + + A specific content change is hard to track. This is roughly calculated as + the interval from the first content change after a prior capturing content + to the first content being sent after the next capture of content. + </summary> +</histogram> + +<histogram name="ContentCapture.CaptureContentTime2" units="microseconds" + expires_after="2024-12-01"> + <owner>wangxianzhu@chromium.org</owner> + <owner>src/third_party/blink/renderer/core/content_capture/OWNERS</owner> + <summary> + The time taken to capture the on-screen content and group them by document. + + Note that this metrics is only recorded on clients on which a + high-resolution clock is available. + </summary> +</histogram> + +<histogram name="ContentCapture.SendContentTime" units="microseconds" + expires_after="2024-12-01"> + <owner>wangxianzhu@chromium.org</owner> + <owner>src/third_party/blink/renderer/core/content_capture/OWNERS</owner> + <summary> + The time taken to send the content to the browser process in batch. + + Note that this metrics is only recorded on clients on which a + high-resolution clock is available. + </summary> +</histogram> + +<histogram name="ContentCapture.SentContentCount2" units="count" + expires_after="2024-12-01"> + <owner>wangxianzhu@chromium.org</owner> + <owner>src/third_party/blink/renderer/core/content_capture/OWNERS</owner> + <summary>The total number of content captures sent for a document.</summary> +</histogram> + +<histogram name="ContentCapture.TaskDelayTimeInMs" units="ms" + expires_after="2024-12-01"> + <owner>wangxianzhu@chromium.org</owner> + <owner>src/third_party/blink/renderer/core/content_capture/OWNERS</owner> + <summary> + The time taken for the task to start after it's scheduled. + + Note: The time of task that was scheduled for the retry wasn't measured + because it is always 500ms. + </summary> +</histogram> + +<histogram name="ContentCapture.TaskRunsPerCapture" units="runs" + expires_after="2024-12-01"> + <owner>wangxianzhu@chromium.org</owner> + <owner>src/third_party/blink/renderer/core/content_capture/OWNERS</owner> + <summary> + The number of the times the task runs for a content capture session. + + A content capture session begins with capturing on-screen content and ends + in sending all changes. + </summary> +</histogram> + <histogram name="ContentNotifications.ClientStatus.Enabled.ByProvider" enum="Boolean" expires_after="2024-06-20"> <owner>guiperez@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/mobile/histograms.xml b/tools/metrics/histograms/metadata/mobile/histograms.xml index 207259ad..3da3fef2 100644 --- a/tools/metrics/histograms/metadata/mobile/histograms.xml +++ b/tools/metrics/histograms/metadata/mobile/histograms.xml
@@ -919,7 +919,7 @@ </histogram> <histogram name="MobileFre.SlowestLoadPoint" enum="LoadPoint" - expires_after="2023-11-01"> + expires_after="2025-03-01"> <owner>triploblastic@chromium.org</owner> <owner>chrome-signin-team@google.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/platform/histograms.xml b/tools/metrics/histograms/metadata/platform/histograms.xml index cc74d279..d92f2758 100644 --- a/tools/metrics/histograms/metadata/platform/histograms.xml +++ b/tools/metrics/histograms/metadata/platform/histograms.xml
@@ -936,6 +936,18 @@ </summary> </histogram> +<histogram name="Platform.Hibernate.ResumeTime.RestoreSystem" units="ms" + expires_after="2024-09-01"> + <owner>mka@chromium.org</owner> + <owner>bgeffon@chromium.org</owner> + <owner>chromeos-hibernate@google.com</owner> + <summary> + The time it takes to restore the hibernated system after loading the + hibernate image into the kernel. Reported when hiberman flushes metrics at + the completion of resume. + </summary> +</histogram> + <histogram name="Platform.Hibernate.ResumeTime.Total" units="ms" expires_after="2024-06-08"> <owner>mka@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/storage/enums.xml b/tools/metrics/histograms/metadata/storage/enums.xml index 6a34c09..da6f892 100644 --- a/tools/metrics/histograms/metadata/storage/enums.xml +++ b/tools/metrics/histograms/metadata/storage/enums.xml
@@ -219,12 +219,13 @@ <int value="3" label="RunNonWebVisible"> Errors in `run()` not visible to the document. </int> - <int value="4" label="kSelectURLWebVisible"> + <int value="4" label="SelectURLWebVisible"> Errors in `selectURL()` visible to the document. </int> - <int value="5" label="kSelectURLNonWebVisible"> + <int value="5" label="SelectURLNonWebVisible"> Errors in `selectURL()` not visible to the document. </int> + <int value="6" label="Success"/> </enum> <enum name="SqlRecoveryResult">
diff --git a/tools/metrics/histograms/metadata/sync/enums.xml b/tools/metrics/histograms/metadata/sync/enums.xml index 4df715e6..38d98b0 100644 --- a/tools/metrics/histograms/metadata/sync/enums.xml +++ b/tools/metrics/histograms/metadata/sync/enums.xml
@@ -525,13 +525,14 @@ label="kProfileContentSettingsPartitionedExceptionsWindowPlacement"/> <int value="100261" label="kStandaloneWindowMigrationNudgeShown"/> <int value="100262" label="TabDiscardingExceptionsWithTime"/> - <int value="100263" label="kAccessibilityFaceGazeCursorSpeedUp"/> - <int value="100264" label="kAccessibilityFaceGazeCursorSpeedDown"/> - <int value="100265" label="kAccessibilityFaceGazeCursorSpeedLeft"/> - <int value="100266" label="kAccessibilityFaceGazeCursorSpeedRight"/> - <int value="100267" label="kAccessibilityFaceGazeCursorSmoothing"/> - <int value="100268" label="kAccessibilityFaceGazeCursorUseAcceleration"/> + <int value="100263" label="AccessibilityFaceGazeCursorSpeedUp"/> + <int value="100264" label="AccessibilityFaceGazeCursorSpeedDown"/> + <int value="100265" label="AccessibilityFaceGazeCursorSpeedLeft"/> + <int value="100266" label="AccessibilityFaceGazeCursorSpeedRight"/> + <int value="100267" label="AccessibilityFaceGazeCursorSmoothing"/> + <int value="100268" label="AccessibilityFaceGazeCursorUseAcceleration"/> <int value="100269" label="AntiFingerprintingEnabled"/> + <int value="100270" label="AccessibilityFaceGazeGesturesToMacros"/> <int value="200000" label="ArticlesForYouEnabled"/> <int value="200001" label="ContextualSearchEnabled_IOS"/> <int value="200002" label="DefaultCharset_IOS"/>
diff --git a/tools/perf/contrib/shared_storage/README.md b/tools/perf/contrib/shared_storage/README.md index 9a72e113..a0db982 100644 --- a/tools/perf/contrib/shared_storage/README.md +++ b/tools/perf/contrib/shared_storage/README.md
@@ -25,16 +25,46 @@ * `shared_storage.medium` * `shared_storage.large` -Select a browser type: -* `system` -* `stable` +Run the following bash command in your Chromium source directory to see a list of available browser types on your machine: +```bash +tools/perf/run_benchmark --browser=list +``` -Run the following bash command, substituting in your chosen benchmark and +Sample output from the above command where four available types are found: +``` +Available browsers: + desktop + content-shell-default + default + stable + system +``` + +Select a browser type from the list, e.g. `system`, which refers to your system's default installation of Chrome. + +Run the following bash command in your Chromium source directory, substituting in your chosen benchmark and browser type: ```bash tools/perf/run_benchmark shared_storage.small --browser=system ``` +Alternatively you can omit the browser type in the command if you select browser type `default`: +```bash +tools/perf/run_benchmark shared_storage.small +``` + +Note that the `default` browser type is only available if you have a compiled build in a Chromium out directory named "Default". (The latest compiled build will be used.) + +Similarly, you can make `release` and `debug` browser types available by having compiled release and debug builds in Chromium out directories named "Release" and "Debug", respectively. + +Another alternative to selecting browser type is to pass your build directory via `--chromium-output-directory`, as long as you have named your out directory as one of the recognized out directories "Default", "Release", "Release_x64", "Debug", or "Debug_x64". + +For example, the following command uses the `debug` browser type, or in other words the most recent build in `$CHROMIUM_SRC/out/Default`, where `$CHROMIUM_SRC` is your Chromium source directory: + +```bash +tools/perf/run_benchmark shared_storage.small --chromium-output-directory=out/Debug +``` + Optionally, you can qualify your command further as follows: * `--story-filter=STORY_FILTER` Only use stories whose names match the given filter regexp. @@ -58,9 +88,9 @@ ``` -For example, a modified version of the original benchmark command is: +For example, a modified version of the benchmark command is: ```bash -tools/perf/run_benchmark shared_storage.small --browser=system --story-filter=Append --iterations=5 --pageset-repeat=1 --xvfb --verbose-cpu-metrics --verbose-memory-metrics --verbose +tools/perf/run_benchmark shared_storage.small --chromium-output-directory=out/Debug --story-filter=Append --iterations=5 --pageset-repeat=1 --xvfb --verbose-cpu-metrics --verbose-memory-metrics --verbose ``` ## Post-Test Result Processing
diff --git a/tools/utr/recipe.py b/tools/utr/recipe.py index 04141a4..df887ba 100644 --- a/tools/utr/recipe.py +++ b/tools/utr/recipe.py
@@ -7,6 +7,7 @@ import logging import os import pathlib +import shutil import subprocess import tempfile @@ -14,6 +15,25 @@ _SRC_DIR = _THIS_DIR.parents[1] +def check_rdb_auth(): + """Checks that the user is logged in with resultdb.""" + rdb_path = shutil.which('rdb') + if not rdb_path: + logging.error("'rdb' binary not found. Is depot_tools not on PATH?") + return False + cmd = [rdb_path, 'auth-info'] + p = subprocess.run(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True) + if p.returncode: + logging.error('No rdb auth available:') + logging.error(p.stdout.strip()) + logging.error("Please run 'rdb auth-login' to authenticate") + return False + return True + + class LegacyRunner: """Interface for running the UTR recipe via the legacy `recipes.py run` mode. @@ -90,8 +110,22 @@ Tuple of (exit code, error message) of the `recipes.py` invocation. """ with tempfile.TemporaryDirectory() as tmp_dir: + + # TODO(crbug.com/41492688): Support both chrome and chromium realms. Just + # hard-code 'chromium' for now. + # Put all results in "try" realms. "try" should be writable for most devs, + # while other realms like "ci" likely aren't. "try" is generally where we + # confine untested code, so it's the best fit for our results here. + rdb_realm = 'chromium:try' + output_path = pathlib.Path(tmp_dir).joinpath('out.json') cmd = [ + 'rdb', + 'stream', + '-new', + '-realm', + rdb_realm, + '--', self._recipes_py, 'run', '--output-result-json',
diff --git a/tools/utr/run.py b/tools/utr/run.py index b7629c92..e9e5cae 100755 --- a/tools/utr/run.py +++ b/tools/utr/run.py
@@ -84,6 +84,9 @@ args = parse_args() logging.basicConfig(level=logging.DEBUG if args.verbose else logging.WARN) + if not recipe.check_rdb_auth(): + return 1 + bundle_root = cipd.fetch_recipe_bundle(args.verbose) builder_props, swarming_server = builders.find_builder_props( args.bucket, args.builder)
diff --git a/ui/chromeos/strings/network/network_element_localized_strings_provider.cc b/ui/chromeos/strings/network/network_element_localized_strings_provider.cc index 3d5afc7e..997978b8 100644 --- a/ui/chromeos/strings/network/network_element_localized_strings_provider.cc +++ b/ui/chromeos/strings/network/network_element_localized_strings_provider.cc
@@ -353,6 +353,11 @@ {"apnDetailAddApnDialogTitle", IDS_SETTINGS_ADD_APN_DIALOG_TITLE}, {"apnDetailViewApnDialogTitle", IDS_SETTINGS_VIEW_APN_DIALOG_TITLE}, {"apnDetailEditApnDialogTitle", IDS_SETTINGS_EDIT_APN_DIALOG_TITLE}, + {"apnSelectionDialogTitle", IDS_SETTINGS_APN_SELECTION_DIALOG_TITLE}, + {"apnSelectionDialogDescription", + IDS_SETTINGS_APN_SELECTION_DIALOG_DESCRIPTION}, + {"apnSelectionDialogUseApn", + IDS_SETTINGS_APN_SELECTION_DIALOG_BUTTON_USE_APN}, {"apnDetailApnErrorMaxChars", IDS_SETTINGS_APN_INPUT_LABEL_ERROR_MAX_CHARS}, {"apnDetailApnErrorInvalidChar",
diff --git a/ui/gfx/image/image_mac.mm b/ui/gfx/image/image_mac.mm index 8c1e9c86..938c6fc8 100644 --- a/ui/gfx/image/image_mac.mm +++ b/ui/gfx/image/image_mac.mm
@@ -18,13 +18,13 @@ // Returns a 16x16 red NSImage to visually show when a NSImage cannot be // created from PNG data. NSImage* GetErrorNSImage() { - NSRect rect = NSMakeRect(0, 0, 16, 16); - NSImage* image = [[NSImage alloc] initWithSize:rect.size]; - [image lockFocus]; - [[NSColor colorWithDeviceRed:1.0 green:0.0 blue:0.0 alpha:1.0] set]; - NSRectFill(rect); - [image unlockFocus]; - return image; + return [NSImage imageWithSize:NSMakeSize(16, 16) + flipped:NO + drawingHandler:^(NSRect rect) { + [NSColor.redColor set]; + NSRectFill(rect); + return YES; + }]; } } // namespace
diff --git a/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h b/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h index 08ca2b8..2643bf7 100644 --- a/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h +++ b/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h
@@ -6,6 +6,7 @@ #define UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_ #include <stdint.h> + #include <memory> #include <optional> #include <vector>
diff --git a/ui/views/accessibility/view_ax_platform_node_delegate_unittest.cc b/ui/views/accessibility/view_ax_platform_node_delegate_unittest.cc index e662c2fd..2d2636f 100644 --- a/ui/views/accessibility/view_ax_platform_node_delegate_unittest.cc +++ b/ui/views/accessibility/view_ax_platform_node_delegate_unittest.cc
@@ -982,13 +982,11 @@ EXPECT_FALSE(label_accessibility()->IsAccessibilityFocusable()); } -TEST_F(ViewAXPlatformNodeDelegateTest, OverrideHasPopup) { +TEST_F(ViewAXPlatformNodeDelegateTest, SetHasPopup) { View::Views view_ids = SetUpExtraViews(); - view_ids[1]->GetViewAccessibility().OverrideHasPopup( - ax::mojom::HasPopup::kTrue); - view_ids[2]->GetViewAccessibility().OverrideHasPopup( - ax::mojom::HasPopup::kMenu); + view_ids[1]->GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kTrue); + view_ids[2]->GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kMenu); ui::AXNodeData node_data_0; view_ids[0]->GetViewAccessibility().GetAccessibleNodeData(&node_data_0);
diff --git a/ui/views/background.cc b/ui/views/background.cc index 690dbdd7..0e256cc 100644 --- a/ui/views/background.cc +++ b/ui/views/background.cc
@@ -4,6 +4,7 @@ #include "ui/views/background.h" +#include <optional> #include <utility> #include "base/check.h" @@ -67,6 +68,11 @@ canvas->DrawPath(path, flags); } + std::optional<gfx::RoundedCornersF> GetRoundedCornerRadiiForTesing() + override { + return radii_; + } + private: const gfx::RoundedCornersF radii_; const float half_thickness_; @@ -186,6 +192,11 @@ void Background::OnViewThemeChanged(View* view) {} +std::optional<gfx::RoundedCornersF> +Background::GetRoundedCornerRadiiForTesing() { + return std::nullopt; +} + std::unique_ptr<Background> CreateSolidBackground(SkColor color) { return std::make_unique<SolidBackground>(color); }
diff --git a/ui/views/background.h b/ui/views/background.h index 98d2dbb..32e0ef5 100644 --- a/ui/views/background.h +++ b/ui/views/background.h
@@ -8,22 +8,23 @@ #include <stddef.h> #include <memory> +#include <optional> #include "build/build_config.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/themed_vector_icon.h" #include "ui/color/color_id.h" #include "ui/gfx/color_palette.h" +#include "ui/gfx/geometry/rounded_corners_f.h" #include "ui/views/views_export.h" namespace gfx { class Canvas; -class RoundedCornersF; -} +} // namespace gfx namespace ui { class ThemedVectorIcon; -} +} // namespace ui namespace views { @@ -45,10 +46,8 @@ class VIEWS_EXPORT Background { public: Background(); - Background(const Background&) = delete; Background& operator=(const Background&) = delete; - virtual ~Background(); // Render the background for the provided view @@ -62,6 +61,10 @@ // subclasses that depend on theme colors. virtual void OnViewThemeChanged(View* view); + // Returns the rounded corner radii of the background for testing. Returns + // `std::nullopt` by default. + virtual std::optional<gfx::RoundedCornersF> GetRoundedCornerRadiiForTesing(); + // Returns the "background color". This is equivalent to the color set in // SetNativeControlColor(). For solid backgrounds, this is the color; for // gradient backgrounds, it's the midpoint of the gradient; for painter
diff --git a/ui/views/controls/table/table_view.h b/ui/views/controls/table/table_view.h index 0f2287d1..a471a7e 100644 --- a/ui/views/controls/table/table_view.h +++ b/ui/views/controls/table/table_view.h
@@ -484,7 +484,9 @@ // Updates the focus rings of the TableView and the TableHeader if necessary. void UpdateFocusRings(); - raw_ptr<ui::TableModel> model_ = nullptr; + // TODO(327473315): Only one of raw_ptr in this class is dangling. Find which + // one. + raw_ptr<ui::TableModel, LeakedDanglingUntriaged> model_ = nullptr; std::vector<ui::TableColumn> columns_; @@ -498,7 +500,9 @@ // The header. This is only created if more than one column is specified or // the first column has a non-empty title. - raw_ptr<TableHeader> header_ = nullptr; + // TODO(327473315): Only one of raw_ptr in this class is dangling. Find which + // one. + raw_ptr<TableHeader, LeakedDanglingUntriaged> header_ = nullptr; // TableView allows using the keyboard to activate a cell or row, including // optionally the header row. This bool keeps track of whether the active row @@ -516,7 +520,9 @@ // is selected then. bool select_on_remove_ = true; - raw_ptr<TableViewObserver> observer_ = nullptr; + // TODO(327473315): Only one of raw_ptr in this class is dangling. Find which + // one. + raw_ptr<TableViewObserver, LeakedDanglingUntriaged> observer_ = nullptr; // If |sort_on_paint_| is true, table will sort before painting. bool sort_on_paint_ = false; @@ -541,7 +547,9 @@ std::vector<size_t> view_to_model_; std::vector<size_t> model_to_view_; - raw_ptr<TableGrouper> grouper_ = nullptr; + // TODO(327473315): Only one of raw_ptr in this class is dangling. Find which + // one. + raw_ptr<TableGrouper, LeakedDanglingUntriaged> grouper_ = nullptr; // True if in SetVisibleColumnWidth(). bool in_set_visible_column_width_ = false;
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index 1bbccb1..da3b8248 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc
@@ -3335,7 +3335,7 @@ } private: - raw_ptr<Widget> widget_; + raw_ptr<Widget, DanglingUntriaged> widget_; }; class ClosingView : public View {
diff --git a/ui/webui/resources/cr_elements/BUILD.gn b/ui/webui/resources/cr_elements/BUILD.gn index 92f41ffe..51b5cba 100644 --- a/ui/webui/resources/cr_elements/BUILD.gn +++ b/ui/webui/resources/cr_elements/BUILD.gn
@@ -122,6 +122,7 @@ "cr_input/cr_input.css", "cr_input/cr_input_style.css", "cr_input/cr_input_style_lit.css", + "cr_tabs/cr_tabs.css", "cr_toast/cr_toast.css", "cr_toast/cr_toast_manager.css", "cr_toggle/cr_toggle.css",
diff --git a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.css b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.css new file mode 100644 index 0000000..af052ea --- /dev/null +++ b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.css
@@ -0,0 +1,132 @@ +/* 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. */ + +/* #css_wrapper_metadata_start + * #type=style-lit + * #import=../cr_shared_vars.css.js + * #import=../cr_hidden_style_lit.css.js + * #scheme=relative + * #include=cr-hidden-style-lit + * #css_wrapper_metadata_end */ + +:host { + cursor: pointer; + display: flex; + flex-direction: row; + font-size: var(--cr-tabs-font-size, 14px); + font-weight: 500; + height: var(--cr-tabs-height, 48px); + user-select: none; +} + +.tab { + align-items: center; + color: var(--cr-secondary-text-color); + display: flex; + flex: var(--cr-tabs-flex, auto); + height: 100%; + justify-content: center; + opacity: .8; + outline: none; + padding: 0 var(--cr-tabs-tab-inline-padding, 0); + position: relative; + transition: opacity 100ms cubic-bezier(.4, 0, 1, 1); +} + +:host-context([chrome-refresh-2023]) .tab { + opacity: 1; +} + +:host-context(.focus-outline-visible) .tab:focus { + outline: var(--cr-tabs-focus-outline, auto); + outline-offset: var(--cr-tabs-focus-outline-offset, 0); +} + +.selected { + color: var(--cr-tabs-selected-color, var(--google-blue-600)); + opacity: 1; +} + +@media (prefers-color-scheme: dark) { + .selected { + color: var(--cr-tabs-selected-color, var(--google-blue-300)); + } +} + +.tab-icon { + -webkit-mask-position: center; + -webkit-mask-repeat: no-repeat; + -webkit-mask-size: var(--cr-tabs-icon-size, var(--cr-icon-size)); + background-color: var(--cr-secondary-text-color); + display: none; + height: var(--cr-tabs-icon-size, var(--cr-icon-size)); + margin-inline-end: var(--cr-tabs-icon-margin-end, var(--cr-icon-size)); + width: var(--cr-tabs-icon-size, var(--cr-icon-size)); +} + +.selected .tab-icon { + background-color: var(--cr-tabs-selected-color, var(--google-blue-600)); +} + +@media (prefers-color-scheme: dark) { + .selected .tab-icon { + background-color: var(--cr-tabs-selected-color, var(--google-blue-300)); + } +} + +.tab-indicator, +.tab-indicator-background { + bottom: 0; + height: var(--cr-tabs-selection-bar-width, 2px); + left: var(--cr-tabs-tab-inline-padding, 0); + position: absolute; + right: var(--cr-tabs-tab-inline-padding, 0); +} + +.tab-indicator { + border-top-left-radius: var(--cr-tabs-selection-bar-radius, + var(--cr-tabs-selection-bar-width, 2px)); + border-top-right-radius: var(--cr-tabs-selection-bar-radius, + var(--cr-tabs-selection-bar-width, 2px)); + opacity: 0; + transform-origin: left center; + transition: transform; +} + +.selected .tab-indicator { + background: var(--cr-tabs-selected-color, var(--google-blue-600)); + opacity: 1; +} + +.tab-indicator.expand { + transition-duration: 150ms; + transition-timing-function: cubic-bezier(.4, 0, 1, 1); +} + +.tab-indicator.contract { + transition-duration: 180ms; + transition-timing-function: cubic-bezier(0, 0, .2, 1); +} + +.tab-indicator-background { + background: var(--cr-tabs-unselected-color, var(--google-blue-600)); + opacity: var(--cr-tabs-selection-bar-unselected-opacity, 0); + z-index: -1; +} + +@media (prefers-color-scheme: dark) { + .tab-indicator-background { + background: var(--cr-tabs-unselected-color, var(--google-blue-300)); + } + + .selected .tab-indicator { + background: var(--cr-tabs-selected-color, var(--google-blue-300)); + } +} + +@media (forced-colors: active) { + .tab-indicator { + background: SelectedItem; + } +}
diff --git a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.html b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.html index 1902ad79..b61aaf5 100644 --- a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.html +++ b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.html
@@ -1,137 +1,12 @@ - <style include="cr-hidden-style"> - :host { - cursor: pointer; - display: flex; - flex-direction: row; - font-size: var(--cr-tabs-font-size, 14px); - font-weight: 500; - height: var(--cr-tabs-height, 48px); - user-select: none; - } - - .tab { - align-items: center; - color: var(--cr-secondary-text-color); - display: flex; - flex: var(--cr-tabs-flex, auto); - height: 100%; - justify-content: center; - opacity: .8; - outline: none; - padding: 0 var(--cr-tabs-tab-inline-padding, 0); - position: relative; - transition: opacity 100ms cubic-bezier(.4, 0, 1, 1); - } - - :host-context([chrome-refresh-2023]) .tab { - opacity: 1; - } - - :host-context(.focus-outline-visible) .tab:focus { - outline: var(--cr-tabs-focus-outline, auto); - outline-offset: var(--cr-tabs-focus-outline-offset, 0); - } - - .selected { - color: var(--cr-tabs-selected-color, var(--google-blue-600)); - opacity: 1; - } - - @media (prefers-color-scheme: dark) { - .selected { - color: var(--cr-tabs-selected-color, var(--google-blue-300)); - } - } - - .tab-icon { - -webkit-mask-position: center; - -webkit-mask-repeat: no-repeat; - -webkit-mask-size: var(--cr-tabs-icon-size, var(--cr-icon-size)); - background-color: var(--cr-secondary-text-color); - display: none; - height: var(--cr-tabs-icon-size, var(--cr-icon-size)); - margin-inline-end: var(--cr-tabs-icon-margin-end, var(--cr-icon-size)); - width: var(--cr-tabs-icon-size, var(--cr-icon-size)); - } - - .selected .tab-icon { - background-color: var(--cr-tabs-selected-color, var(--google-blue-600)); - } - - @media (prefers-color-scheme: dark) { - .selected .tab-icon { - background-color: var(--cr-tabs-selected-color, var(--google-blue-300)); - } - } - - .tab-indicator, - .tab-indicator-background { - bottom: 0; - height: var(--cr-tabs-selection-bar-width, 2px); - left: var(--cr-tabs-tab-inline-padding, 0); - position: absolute; - right: var(--cr-tabs-tab-inline-padding, 0); - } - - .tab-indicator { - border-top-left-radius: var(--cr-tabs-selection-bar-radius, - var(--cr-tabs-selection-bar-width, 2px)); - border-top-right-radius: var(--cr-tabs-selection-bar-radius, - var(--cr-tabs-selection-bar-width, 2px)); - opacity: 0; - transform-origin: left center; - transition: transform; - } - - .selected .tab-indicator { - background: var(--cr-tabs-selected-color, var(--google-blue-600)); - opacity: 1; - } - - .tab-indicator.expand { - transition-duration: 150ms; - transition-timing-function: cubic-bezier(.4, 0, 1, 1); - } - - .tab-indicator.contract { - transition-duration: 180ms; - transition-timing-function: cubic-bezier(0, 0, .2, 1); - } - - .tab-indicator-background { - background: var(--cr-tabs-unselected-color, var(--google-blue-600)); - opacity: var(--cr-tabs-selection-bar-unselected-opacity, 0); - z-index: -1; - } - - @media (prefers-color-scheme: dark) { - .tab-indicator-background { - background: var(--cr-tabs-unselected-color, var(--google-blue-300)); - } - - .selected .tab-indicator { - background: var(--cr-tabs-selected-color, var(--google-blue-300)); - } - } - - @media (forced-colors: active) { - .tab-indicator { - background: SelectedItem; - } - } - </style> - - <template is="dom-repeat" items="[[tabNames]]"> - <div - role="tab" - class$="tab [[getSelectedClass_(index, selected)]]" - on-click="onTabClick_" - aria-selected$="[[getAriaSelected_(index, selected)]]" - tabindex$="[[getTabindex_(index, selected)]]"> - <div class="tab-icon" style$="[[getIconStyle_(index)]]"> - </div> - [[item]] - <div class="tab-indicator-background"></div> - <div class="tab-indicator"></div> - </div> - </template> +${this.tabNames.map((item, index) => html` + <div role="tab" + class="tab ${this.getSelectedClass_(index, this.selected)}" + aria-selected="${this.getAriaSelected_(index, this.selected)}" + tabindex="${this.getTabindex_(index, this.selected)}" + data-index="${index}" @click="${this.onTabClick_}"> + <div class="tab-icon" .style="${this.getIconStyle_(index)}"></div> + ${item} + <div class="tab-indicator-background"></div> + <div class="tab-indicator"></div> + </div> +`)}
diff --git a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.ts b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.ts index 98819da..0f63d37 100644 --- a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.ts +++ b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.ts
@@ -19,48 +19,49 @@ * - no horizontal scrolling, it is assumed that tabs always fit in the * available space */ -import '../cr_hidden_style.css.js'; -import '../cr_shared_vars.css.js'; +import {CrLitElement} from '//resources/lit/v3_0/lit.rollup.js'; +import type {PropertyValues} from '//resources/lit/v3_0/lit.rollup.js'; -import type {DomRepeatEvent} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {getCss} from './cr_tabs.css.js'; +import {getHtml} from './cr_tabs.html.js'; -import {getTemplate} from './cr_tabs.html.js'; +export const NONE_SELECTED: number = -1; -export class CrTabsElement extends PolymerElement { +export class CrTabsElement extends CrLitElement { static get is() { return 'cr-tabs'; } - static get template() { - return getTemplate(); + static override get styles() { + return getCss(); } - static get properties() { + override render() { + return getHtml.bind(this)(); + } + + static override get properties() { return { // Optional icon urls displayed in each tab. tabIcons: { type: Array, - value: () => [], }, // Tab names displayed in each tab. tabNames: { type: Array, - value: () => [], }, /** Index of the selected tab. */ selected: { type: Number, notify: true, - observer: 'onSelectedChanged_', }, }; } - tabIcons: string[]; - tabNames: string[]; + tabIcons: string[] = []; + tabNames: string[] = []; selected: number; private isRtl_: boolean = false; @@ -71,35 +72,46 @@ this.isRtl_ = this.matches(':host-context([dir=rtl]) cr-tabs'); } - override ready() { - super.ready(); - + override firstUpdated() { this.setAttribute('role', 'tablist'); this.addEventListener('keydown', this.onKeyDown_.bind(this)); } - private getAriaSelected_(index: number): string { + override updated(changedProperties: PropertyValues<this>) { + super.updated(changedProperties); + + if (changedProperties.has('selected')) { + this.onSelectedChanged_(this.selected, changedProperties.get('selected')); + } + } + + protected getAriaSelected_(index: number, _selected: number): string { return index === this.selected ? 'true' : 'false'; } - private getIconStyle_(index: number): string { + protected getIconStyle_(index: number): string { const icon = this.tabIcons[index]; return icon ? `-webkit-mask-image: url(${icon}); display: block;` : ''; } - private getTabindex_(index: number): string { + protected getTabindex_(index: number, _selected: number): string { return index === this.selected ? '0' : '-1'; } - private getSelectedClass_(index: number): string { + protected getSelectedClass_(index: number, _selected: number): string { return index === this.selected ? 'selected' : ''; } - private onSelectedChanged_(newSelected: number, oldSelected: number) { + private onSelectedChanged_( + newSelected: number, oldSelected: number|undefined) { + if (newSelected === NONE_SELECTED || oldSelected === NONE_SELECTED || + oldSelected === undefined) { + return; + } + const tabs = this.shadowRoot!.querySelectorAll('.tab'); - if (tabs.length === 0 || oldSelected === undefined || - tabs.length <= newSelected || tabs.length <= oldSelected) { - // Tabs are not fully rendered yet. + + if (tabs.length <= oldSelected) { return; } @@ -127,7 +139,7 @@ this.updateIndicator_(newIndicator, newTabRect, leftmostEdge, fullWidth); } - private onKeyDown_(e: KeyboardEvent) { + private async onKeyDown_(e: KeyboardEvent) { const count = this.tabNames.length; let newSelection; if (e.key === 'Home') { @@ -144,6 +156,7 @@ e.preventDefault(); e.stopPropagation(); this.selected = newSelection; + await this.updateComplete; this.shadowRoot!.querySelector<HTMLElement>('.tab.selected')!.focus(); } @@ -153,8 +166,9 @@ indicator.style.transform = `translateX(0) scaleX(1)`; } - private onTabClick_(e: DomRepeatEvent<string>) { - this.selected = e.model.index; + protected onTabClick_(e: Event) { + const target = e.target as HTMLElement; + this.selected = Number(target.dataset['index']); } private updateIndicator_(
diff --git a/url/mojom/origin_mojom_traits.h b/url/mojom/origin_mojom_traits.h index cabd91b7..234e2045 100644 --- a/url/mojom/origin_mojom_traits.h +++ b/url/mojom/origin_mojom_traits.h
@@ -6,6 +6,7 @@ #define URL_MOJOM_ORIGIN_MOJOM_TRAITS_H_ #include <optional> + #include "base/component_export.h" #include "base/unguessable_token.h" #include "mojo/public/cpp/base/unguessable_token_mojom_traits.h"
diff --git a/url/origin.h b/url/origin.h index 3e639b0..1c290dc 100644 --- a/url/origin.h +++ b/url/origin.h
@@ -8,10 +8,10 @@ #include <stdint.h> #include <memory> +#include <optional> #include <string> #include <string_view> -#include <optional> #include "base/component_export.h" #include "base/debug/alias.h" #include "base/debug/crash_logging.h"
diff --git a/url/url_canon_path.cc b/url/url_canon_path.cc index 5307817..06c1324 100644 --- a/url/url_canon_path.cc +++ b/url/url_canon_path.cc
@@ -5,6 +5,7 @@ #include <limits.h> #include <optional> + #include "base/check.h" #include "base/check_op.h" #include "url/url_canon.h"