diff --git a/DEPS b/DEPS index 3670c24..ac4afd1 100644 --- a/DEPS +++ b/DEPS
@@ -175,11 +175,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '4f17b60208fa022309ecce72b99bacf942f5ca09', + 'skia_revision': 'ad653d8378d7a17502956c4addebb68eb3129961', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': 'e5287caf07e74f7fdffdc886384b9638e2bad673', + 'v8_revision': '02ab339626274f8c4040dd94bda29136e206827f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -187,15 +187,15 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '32457326e05294f7bce458d4e239aff85c9f3d00', + 'angle_revision': '965eedbfbf1e613ff4ebffe8bf4c291bc39a259c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': '9d2fd9c161ab6af2cd17c4170e083a63a2a3077f', + 'swiftshader_revision': '20220a0b0640436b659d0361a9d0789bc81d4177', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': 'e6e9fec904b871b94d1b58690e0917dc3153b7e8', + 'pdfium_revision': '5bc1f981df4d02a2c2329891268667a0ff3a4e0f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -238,7 +238,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '297fffa4987be3a1dd6524ffd730d4acc2c1f18f', + 'catapult_revision': 'a79a2f646d240979f54ef9faa4d45863d0e194a0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -246,7 +246,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': 'b0f7984519b7b785bd623f6374937fe307cc3baf', + 'devtools_frontend_revision': '5e43b27e8b453a22e365561b6a9a08d47999e6d4', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -286,7 +286,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'spv_tools_revision': '34be23373b9e73694c3b214ba857283bad65aedb', + 'spv_tools_revision': 'e70d25f6fa5d6a560f621aaaf6505472be8cc069', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -881,7 +881,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'a01816b0bae90d983e18bcd54893e5f0cb4c4aab', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '08f4d59e0b177d3d15b65f9826bbf05491b3841d', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -937,7 +937,7 @@ Var('chromium_git') + '/codecs/libgav1.git' + '@' + '638ef84819f8b3cd614dcf63378fe4814aa4cb2a', 'src/third_party/glslang/src': - Var('chromium_git') + '/external/github.com/KhronosGroup/glslang.git' + '@' + '46572440189ead394654b0d06d5d689012ebdd00', + Var('chromium_git') + '/external/github.com/KhronosGroup/glslang.git' + '@' + '4d2298bfd78a82f77f2325c4ade096ccdab1f00d', 'src/third_party/google_toolbox_for_mac/src': { 'url': Var('chromium_git') + '/external/github.com/google/google-toolbox-for-mac.git' + '@' + Var('google_toolbox_for_mac_revision'), @@ -1313,7 +1313,7 @@ 'packages': [ { 'package': 'fuchsia/third_party/aemu/linux-amd64', - 'version': 'kg4AQWldlUbrSINRvDKudP1qBfdVvASJyoJwgrRpf-8C' + 'version': 'vN52wWr_Zy2xIpWpVpYoKVEtVi0AFVR4YrjNEPti9goC' }, ], 'condition': 'host_os == "linux" and checkout_fuchsia', @@ -1465,7 +1465,7 @@ }, 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '0574822f9f69e4083e0070c1b137a1d9a2369421', + Var('webrtc_git') + '/src.git' + '@' + '8a948a3e2b43db313e3afef36af4109e9d401746', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1540,7 +1540,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@6bed80858d3b8f8ced39c4165194dad0251ce700', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@8c8408b7248ca4e68d9a3b740a99cb89cef392d5', 'condition': 'checkout_src_internal', },
diff --git a/ash/ash_prefs.cc b/ash/ash_prefs.cc index 44d0c90..53a8c715 100644 --- a/ash/ash_prefs.cc +++ b/ash/ash_prefs.cc
@@ -27,6 +27,7 @@ #include "ash/system/palette/palette_welcome_bubble.h" #include "ash/system/power/power_prefs.h" #include "ash/system/session/logout_button_tray.h" +#include "ash/system/unified/top_shortcuts_view.h" #include "ash/touch/touch_devices_controller.h" #include "ash/wallpaper/wallpaper_controller_impl.h" #include "ash/wm/desks/desks_restore_util.h" @@ -79,6 +80,7 @@ DetachableBaseHandler::RegisterPrefs(registry); PowerPrefs::RegisterLocalStatePrefs(registry); DisplayPrefs::RegisterLocalStatePrefs(registry); + TopShortcutsView::RegisterLocalStatePrefs(registry); } void RegisterSigninProfilePrefs(PrefRegistrySimple* registry, bool for_test) {
diff --git a/ash/public/cpp/ash_pref_names.cc b/ash/public/cpp/ash_pref_names.cc index 86b1c4b9..047297ea 100644 --- a/ash/public/cpp/ash_pref_names.cc +++ b/ash/public/cpp/ash_pref_names.cc
@@ -370,6 +370,10 @@ // Boolean controlling whether ALS logging is enabled. const char kPowerAlsLoggingEnabled[] = "power.als_logging_enabled"; +// Boolean controlling whether the settings is enabled. This pref is intended to +// be set only by policy not by user. +const char kOsSettingsEnabled[] = "os_settings_enabled"; + // |kShelfAlignment| and |kShelfAutoHideBehavior| have a local variant. The // local variant is not synced and is used if set. If the local variant is not // set its value is set from the synced value (once prefs have been
diff --git a/ash/public/cpp/ash_pref_names.h b/ash/public/cpp/ash_pref_names.h index 020e4b43..b0d8c1054 100644 --- a/ash/public/cpp/ash_pref_names.h +++ b/ash/public/cpp/ash_pref_names.h
@@ -103,6 +103,8 @@ ASH_PUBLIC_EXPORT extern const char kNightLightCachedLongitude[]; ASH_PUBLIC_EXPORT extern const char kAutoNightLightNotificationDismissed[]; +ASH_PUBLIC_EXPORT extern const char kOsSettingsEnabled[]; + ASH_PUBLIC_EXPORT extern const char kAllowScreenLock[]; ASH_PUBLIC_EXPORT extern const char kEnableAutoScreenLock[]; ASH_PUBLIC_EXPORT extern const char kPowerAcScreenBrightnessPercent[];
diff --git a/ash/system/power/power_button_screenshot_controller.cc b/ash/system/power/power_button_screenshot_controller.cc index 81080b65..87e7e13 100644 --- a/ash/system/power/power_button_screenshot_controller.cc +++ b/ash/system/power/power_button_screenshot_controller.cc
@@ -5,9 +5,11 @@ #include "ash/system/power/power_button_screenshot_controller.h" #include "ash/accelerators/accelerator_controller_impl.h" +#include "ash/public/cpp/window_properties.h" #include "ash/shell.h" #include "ash/system/power/power_button_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/window_util.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" #include "base/time/tick_clock.h" @@ -21,6 +23,11 @@ return Shell::Get()->tablet_mode_controller()->InTabletMode(); } +bool VolumeKeyMaybeUsedByApp() { + aura::Window* active = window_util::GetActiveWindow(); + return active && active->GetProperty(ash::kCanConsumeSystemKeysKey); +} + } // namespace constexpr base::TimeDelta @@ -70,9 +77,21 @@ if (key_code != ui::VKEY_VOLUME_DOWN && key_code != ui::VKEY_VOLUME_UP) return; + bool did_consume_volume_keys = + volume_down_key_pressed_ || volume_up_key_pressed_; + bool volume_key_maybe_used_by_app = VolumeKeyMaybeUsedByApp(); + // Even if the app is requesting to consume volume key, do not give it if + // 1) power button is already pressed. This should trigger screenshot. + // 2) if this is already handling volume key. We need to continue processing + // volume eve after power button is released, until volume keys are released. + if (volume_key_maybe_used_by_app && !power_button_pressed_ && + !did_consume_volume_keys) { + return; + } + const bool is_volume_down = key_code == ui::VKEY_VOLUME_DOWN; if (event->type() == ui::ET_KEY_PRESSED) { - if (!volume_down_key_pressed_ && !volume_up_key_pressed_) { + if (!did_consume_volume_keys) { if (is_volume_down) { volume_down_key_pressed_ = true; volume_down_key_pressed_time_ = tick_clock_->NowTicks(); @@ -86,8 +105,12 @@ } } - if (consume_volume_down_ || consume_volume_up_) + // Do no pass the event to the app if the events are being + // processed + if (consume_volume_down_ || consume_volume_up_ || + volume_key_maybe_used_by_app) { event->StopPropagation(); + } } else { is_volume_down ? volume_down_key_pressed_ = false : volume_up_key_pressed_ = false;
diff --git a/ash/system/power/power_button_screenshot_controller_unittest.cc b/ash/system/power/power_button_screenshot_controller_unittest.cc index 212bd627e..df1d5cc 100644 --- a/ash/system/power/power_button_screenshot_controller_unittest.cc +++ b/ash/system/power/power_button_screenshot_controller_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "ash/login_status.h" +#include "ash/public/cpp/window_properties.h" #include "ash/shell.h" #include "ash/system/power/power_button_controller.h" #include "ash/system/power/power_button_controller_test_api.h" @@ -16,10 +17,37 @@ #include "ash/wm/lock_state_controller_test_api.h" #include "base/test/simple_test_tick_clock.h" #include "chromeos/dbus/power/fake_power_manager_client.h" +#include "ui/aura/test/test_window_delegate.h" #include "ui/events/event.h" +#include "ui/wm/core/window_util.h" namespace ash { +namespace { +class KeyEventWindowDelegate : public aura::test::TestWindowDelegate { + public: + KeyEventWindowDelegate() = default; + ~KeyEventWindowDelegate() override = default; + + KeyEventWindowDelegate(const KeyEventWindowDelegate&) = delete; + KeyEventWindowDelegate& operator=(const KeyEventWindowDelegate&) = delete; + + void OnKeyEvent(ui::KeyEvent* event) override { + key_code_ = event->key_code(); + } + + ui::KeyboardCode GetReceivedKeyCodeAndReset() { + ui::KeyboardCode tmp = key_code_; + key_code_ = ui::VKEY_UNKNOWN; + return tmp; + } + + private: + ui::KeyboardCode key_code_ = ui::VKEY_UNKNOWN; +}; + +} // namespace + // Test fixture used for testing power button screenshot behavior under tablet // power button. class PowerButtonScreenshotControllerTest : public PowerButtonTestBase { @@ -85,9 +113,34 @@ DISALLOW_COPY_AND_ASSIGN(PowerButtonScreenshotControllerTest); }; +class PowerButtonScreenshotControllerWithSystemKeysTest + : public PowerButtonScreenshotControllerTest, + public ::testing::WithParamInterface<bool> { + public: + PowerButtonScreenshotControllerWithSystemKeysTest() = default; + ~PowerButtonScreenshotControllerWithSystemKeysTest() override = default; + + PowerButtonScreenshotControllerWithSystemKeysTest( + const PowerButtonScreenshotControllerWithSystemKeysTest&) = delete; + PowerButtonScreenshotControllerWithSystemKeysTest& operator=( + const PowerButtonScreenshotControllerWithSystemKeysTest&) = delete; + + void SetUp() override { + PowerButtonScreenshotControllerTest::SetUp(); + if (GetParam()) { + aura::Window* window = + CreateTestWindowInShellWithDelegate(&delegate_, 1, gfx::Rect()); + window->SetProperty(ash::kCanConsumeSystemKeysKey, true); + } + } + + private: + KeyEventWindowDelegate delegate_; +}; + // Tests the functionalities that press the power button first and then press // volume down and volume up key alternative. -TEST_F(PowerButtonScreenshotControllerTest, +TEST_P(PowerButtonScreenshotControllerWithSystemKeysTest, PowerButtonPressedFirst_Screenshot) { PressPowerButton(); tick_clock_.Advance(PowerButtonScreenshotController::kScreenshotChordDelay - @@ -135,6 +188,10 @@ EXPECT_FALSE(LastKeyConsumed()); } +INSTANTIATE_TEST_SUITE_P(All, + PowerButtonScreenshotControllerWithSystemKeysTest, + testing::Bool()); + // Tests the functionalities that press the volume key first and then press // volume down and volume up key alternative. TEST_F(PowerButtonScreenshotControllerTest, VolumeKeyPressedFirst_Screenshot) { @@ -186,6 +243,56 @@ EXPECT_FALSE(LastKeyConsumed()); } +// If the window with kConsumeSystemKeysKey property is active in tablet mode, +// volume keys will be passed to the window if they are pressed first. +TEST_F(PowerButtonScreenshotControllerTest, WindowWithSystemKeys) { + EnableTabletMode(true); + + KeyEventWindowDelegate delegate; + std::unique_ptr<aura::Window> window = base::WrapUnique( + CreateTestWindowInShellWithDelegate(&delegate, 1, gfx::Rect())); + window->SetProperty(ash::kCanConsumeSystemKeysKey, true); + ::wm::ActivateWindow(window.get()); + + // Tests when volume up pressed first, it's consumed by an app. + // screenshot chord. + GetEventGenerator()->PressKey(ui::VKEY_VOLUME_UP, ui::EF_NONE); + EXPECT_EQ(ui::VKEY_VOLUME_UP, delegate.GetReceivedKeyCodeAndReset()); + + GetEventGenerator()->PressKey(ui::VKEY_VOLUME_UP, ui::EF_NONE); + EXPECT_EQ(ui::VKEY_VOLUME_UP, delegate.GetReceivedKeyCodeAndReset()); + EXPECT_EQ(0, GetScreenshotCount()); + + // Tests when volume down pressed first, it's consumed by an app. + // screenshot chord. + GetEventGenerator()->PressKey(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); + EXPECT_EQ(ui::VKEY_VOLUME_DOWN, delegate.GetReceivedKeyCodeAndReset()); + + GetEventGenerator()->PressKey(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); + EXPECT_EQ(ui::VKEY_VOLUME_DOWN, delegate.GetReceivedKeyCodeAndReset()); + EXPECT_EQ(0, GetScreenshotCount()); + + // Delete the window, and volume will be consumed by shortcut. + // Screenshot using up. + window.reset(); + GetEventGenerator()->PressKey(ui::VKEY_VOLUME_UP, ui::EF_NONE); + EXPECT_EQ(ui::VKEY_UNKNOWN, delegate.GetReceivedKeyCodeAndReset()); + PressPowerButton(); + ReleasePowerButton(); + GetEventGenerator()->ReleaseKey(ui::VKEY_VOLUME_UP, ui::EF_NONE); + EXPECT_EQ(ui::VKEY_UNKNOWN, delegate.GetReceivedKeyCodeAndReset()); + EXPECT_EQ(1, GetScreenshotCount()); + + // Screenshot using down. + GetEventGenerator()->PressKey(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); + EXPECT_EQ(ui::VKEY_UNKNOWN, delegate.GetReceivedKeyCodeAndReset()); + PressPowerButton(); + ReleasePowerButton(); + GetEventGenerator()->ReleaseKey(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); + EXPECT_EQ(ui::VKEY_UNKNOWN, delegate.GetReceivedKeyCodeAndReset()); + EXPECT_EQ(2, GetScreenshotCount()); +} + class PowerButtonScreenshotControllerWithKeyCodeTest : public PowerButtonScreenshotControllerTest, public testing::WithParamInterface<ui::KeyboardCode> {
diff --git a/ash/system/unified/top_shortcuts_view.cc b/ash/system/unified/top_shortcuts_view.cc index ecc0043..05ae1a6 100644 --- a/ash/system/unified/top_shortcuts_view.cc +++ b/ash/system/unified/top_shortcuts_view.cc
@@ -7,6 +7,7 @@ #include <numeric> #include "ash/accessibility/accessibility_controller_impl.h" +#include "ash/public/cpp/ash_pref_names.h" #include "ash/public/cpp/ash_view_ids.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/session/session_controller_impl.h" @@ -23,7 +24,10 @@ #include "ash/system/unified/user_chooser_detailed_view_controller.h" #include "ash/system/unified/user_chooser_view.h" #include "base/numerics/ranges.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" #include "ui/gfx/paint_vector_icon.h" +#include "ui/views/controls/button/button.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" @@ -198,6 +202,12 @@ settings_button_ = new TopShortcutButton(this, kUnifiedMenuSettingsIcon, IDS_ASH_STATUS_TRAY_SETTINGS); container_->AddChildView(settings_button_); + local_state_pref_change_registrar_.Init(Shell::Get()->local_state()); + local_state_pref_change_registrar_.Add( + prefs::kOsSettingsEnabled, + base::BindRepeating(&TopShortcutsView::UpdateSettingsButtonState, + base::Unretained(this))); + UpdateSettingsButtonState(); } // |collapse_button_| should be right-aligned, so we make the buttons @@ -208,6 +218,11 @@ AddChildView(collapse_button_); } +// static +void TopShortcutsView::RegisterLocalStatePrefs(PrefRegistrySimple* registry) { + registry->RegisterBooleanPref(prefs::kOsSettingsEnabled, true); +} + void TopShortcutsView::SetExpandedAmount(double expanded_amount) { collapse_button_->SetExpandedAmount(expanded_amount); } @@ -232,4 +247,14 @@ return "TopShortcutsView"; } +void TopShortcutsView::UpdateSettingsButtonState() { + PrefService* const local_state = Shell::Get()->local_state(); + const bool settings_icon_enabled = + local_state->GetBoolean(prefs::kOsSettingsEnabled); + + settings_button_->SetState(settings_icon_enabled + ? views::Button::STATE_NORMAL + : views::Button::STATE_DISABLED); +} + } // namespace ash
diff --git a/ash/system/unified/top_shortcuts_view.h b/ash/system/unified/top_shortcuts_view.h index d448abdd..e627d4bc 100644 --- a/ash/system/unified/top_shortcuts_view.h +++ b/ash/system/unified/top_shortcuts_view.h
@@ -7,9 +7,12 @@ #include "ash/accessibility/accessibility_observer.h" #include "ash/ash_export.h" +#include "components/prefs/pref_change_registrar.h" #include "ui/views/controls/button/button.h" #include "ui/views/view.h" +class PrefRegistrySimple; + namespace ash { class CollapseButton; @@ -48,6 +51,8 @@ public: explicit TopShortcutsView(UnifiedSystemTrayController* controller); + static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); + // Change the expanded state. CollapseButton icon will rotate. void SetExpandedAmount(double expanded_amount); @@ -60,6 +65,9 @@ private: friend class TopShortcutsViewTest; + // Disables/Enables the |settings_button_| based on kSettingsIconEnabled pref. + void UpdateSettingsButtonState(); + UnifiedSystemTrayController* controller_; // Owned by views hierarchy. @@ -71,6 +79,8 @@ TopShortcutButton* power_button_ = nullptr; CollapseButton* collapse_button_ = nullptr; + PrefChangeRegistrar local_state_pref_change_registrar_; + DISALLOW_COPY_AND_ASSIGN(TopShortcutsView); };
diff --git a/ash/system/unified/top_shortcuts_view_unittest.cc b/ash/system/unified/top_shortcuts_view_unittest.cc index f4342e52..6930d42 100644 --- a/ash/system/unified/top_shortcuts_view_unittest.cc +++ b/ash/system/unified/top_shortcuts_view_unittest.cc
@@ -4,6 +4,7 @@ #include "ash/system/unified/top_shortcuts_view.h" +#include "ash/public/cpp/ash_pref_names.h" #include "ash/session/test_session_controller_client.h" #include "ash/system/unified/collapse_button.h" #include "ash/system/unified/sign_out_button.h" @@ -12,6 +13,7 @@ #include "ash/system/unified/unified_system_tray_model.h" #include "ash/test/ash_test_base.h" #include "base/macros.h" +#include "components/prefs/pref_registry_simple.h" namespace ash { @@ -172,4 +174,19 @@ Layout(); } +// Settings button is disabled when kSettingsIconDisabled is set. +TEST_F(TopShortcutsViewTest, DisableSettingsIconPolicy) { + const bool enable_settings = true; + GetSessionControllerClient()->AddUserSession( + "foo@example.com", user_manager::USER_TYPE_REGULAR, enable_settings); + SetUpView(); + EXPECT_EQ(views::Button::STATE_NORMAL, GetSettingsButton()->state()); + + local_state()->SetBoolean(prefs::kOsSettingsEnabled, false); + EXPECT_EQ(views::Button::STATE_DISABLED, GetSettingsButton()->state()); + + local_state()->SetBoolean(prefs::kOsSettingsEnabled, true); + EXPECT_EQ(views::Button::STATE_NORMAL, GetSettingsButton()->state()); +} + } // namespace ash
diff --git a/base/allocator/partition_allocator/partition_alloc_unittest.cc b/base/allocator/partition_allocator/partition_alloc_unittest.cc index c2094cb..4f76b10c 100644 --- a/base/allocator/partition_allocator/partition_alloc_unittest.cc +++ b/base/allocator/partition_allocator/partition_alloc_unittest.cc
@@ -12,7 +12,6 @@ #include <vector> #include "base/allocator/partition_allocator/address_space_randomization.h" -#include "base/allocator/partition_allocator/partition_alloc.h" #include "base/logging.h" #include "base/rand_util.h" #include "base/stl_util.h" @@ -110,9 +109,8 @@ } for (size_t i = 0; i < count; ++i) { - if (allocations[i]) { - base::PartitionFree(allocations[i]); - } + if (allocations[i]) + root->Free(allocations[i]); } } @@ -2200,7 +2198,7 @@ } EXPECT_EQ(kAllZerosSentinel, non_zero_position) << "test allocation size: " << size; - PartitionFree(p); + generic_allocator.root()->Free(p); } for (int i = 0; i < 10; ++i) { @@ -2224,7 +2222,7 @@ kDesiredSize, nullptr); ASSERT_NE(nullptr, ptr); memset(ptr, 0xbd, kDesiredSize); - PartitionFree(ptr); + generic_allocator.root()->Free(ptr); } TEST_F(PartitionAllocTest, OverrideHooks) { @@ -2266,7 +2264,7 @@ kOverriddenSize, kOverriddenType); ASSERT_EQ(ptr, overridden_allocation); - PartitionFree(ptr); + generic_allocator.root()->Free(ptr); EXPECT_TRUE(free_called); // overridden_allocation has not actually been freed so we can now immediately @@ -2278,7 +2276,7 @@ EXPECT_NE(ptr, overridden_allocation); EXPECT_TRUE(free_called); EXPECT_EQ(*(char*)ptr, kOverriddenChar); - PartitionFree(ptr); + generic_allocator.root()->Free(ptr); PartitionAllocHooks::SetOverrideHooks(nullptr, nullptr, nullptr); free(overridden_allocation);
diff --git a/base/sequence_checker.h b/base/sequence_checker.h index 60ffd75..9b910eb7 100644 --- a/base/sequence_checker.h +++ b/base/sequence_checker.h
@@ -74,7 +74,7 @@ #define SEQUENCE_CHECKER(name) base::SequenceChecker name #define DCHECK_CALLED_ON_VALID_SEQUENCE(name, ...) \ base::ScopedValidateSequenceChecker SEQUENCE_CHECKER_INTERNAL_UID( \ - scoped_validate_sequence_checker_)(name, ##__VA_ARGS__); + scoped_validate_sequence_checker_)(name, ##__VA_ARGS__) #define DETACH_FROM_SEQUENCE(name) (name).DetachFromSequence() #else // DCHECK_IS_ON() #if __OBJC__ && defined(OS_IOS) && !HAS_FEATURE(objc_cxx_static_assert)
diff --git a/chrome/VERSION b/chrome/VERSION index d8175a70..2d68d73 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=84 MINOR=0 -BUILD=4114 +BUILD=4115 PATCH=0
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index f6a60f47..eeca7fc 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -1059,6 +1059,11 @@ "java/src/org/chromium/chrome/browser/ntp/cards/StatusItem.java", "java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java", "java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java", + "java/src/org/chromium/chrome/browser/ntp/search/SearchBoxContainerView.java", + "java/src/org/chromium/chrome/browser/ntp/search/SearchBoxCoordinator.java", + "java/src/org/chromium/chrome/browser/ntp/search/SearchBoxMediator.java", + "java/src/org/chromium/chrome/browser/ntp/search/SearchBoxProperties.java", + "java/src/org/chromium/chrome/browser/ntp/search/SearchBoxViewBinder.java", "java/src/org/chromium/chrome/browser/ntp/snippets/CategoryInt.java", "java/src/org/chromium/chrome/browser/ntp/snippets/EmptySuggestionsSource.java", "java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeader.java",
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni index 13a01d02..38fbddec 100644 --- a/chrome/android/chrome_test_java_sources.gni +++ b/chrome/android/chrome_test_java_sources.gni
@@ -451,6 +451,7 @@ "javatests/src/org/chromium/chrome/browser/signin/DummyAccountPickerTargetFragment.java", "javatests/src/org/chromium/chrome/browser/signin/IdentityManagerIntegrationTest.java", "javatests/src/org/chromium/chrome/browser/signin/ProfileDataCacheRenderTest.java", + "javatests/src/org/chromium/chrome/browser/signin/ProfileDataCacheWithBadgeRenderTest.java", "javatests/src/org/chromium/chrome/browser/signin/SignOutDialogRenderTest.java", "javatests/src/org/chromium/chrome/browser/signin/SigninFragmentTest.java", "javatests/src/org/chromium/chrome/browser/signin/SigninHelperTest.java",
diff --git a/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/ExploreSurfaceCoordinator.java b/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/ExploreSurfaceCoordinator.java index d2ac0a4..098944f0 100644 --- a/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/ExploreSurfaceCoordinator.java +++ b/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/ExploreSurfaceCoordinator.java
@@ -96,8 +96,10 @@ sectionHeaderView = (SectionHeaderView) inflater.inflate(R.layout.ss_feed_header, null, false); } - FeedSurfaceCoordinator feedSurfaceCoordinator = new FeedSurfaceCoordinator(mActivity, null, - null, sectionHeaderView, exploreSurfaceActionHandler, isInNightMode, this); + FeedSurfaceCoordinator feedSurfaceCoordinator = + new FeedSurfaceCoordinator(mActivity, mActivity.getSnackbarManager(), + mActivity.getTabModelSelector(), mActivity.getActivityTabProvider(), null, + null, sectionHeaderView, exploreSurfaceActionHandler, isInNightMode, this); feedSurfaceCoordinator.getView().setId(R.id.start_surface_explore_view); return feedSurfaceCoordinator; // TODO(crbug.com/982018): Customize surface background for incognito and dark mode.
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/TasksView.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/TasksView.java index 56bd0cfe..51bc1e4 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/TasksView.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/TasksView.java
@@ -6,16 +6,15 @@ import android.content.Context; import android.content.res.Resources; -import android.text.TextWatcher; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.ViewStub; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.FrameLayout; -import android.widget.TextView; import androidx.annotation.Nullable; +import androidx.appcompat.content.res.AppCompatResources; import com.google.android.material.appbar.AppBarLayout; @@ -23,7 +22,7 @@ import org.chromium.chrome.browser.coordinator.CoordinatorLayoutForPointer; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.ntp.IncognitoDescriptionView; -import org.chromium.chrome.browser.ntp.NewTabPageLayout.SearchBoxContainerView; +import org.chromium.chrome.browser.ntp.search.SearchBoxCoordinator; import org.chromium.chrome.tab_ui.R; import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.components.content_settings.CookieControlsEnforcement; @@ -34,8 +33,7 @@ private FrameLayout mBodyViewContainer; private FrameLayout mCarouselTabSwitcherContainer; private AppBarLayout mHeaderView; - private SearchBoxContainerView mSearchBoxContainerView; - private TextView mSearchBoxText; + private SearchBoxCoordinator mSearchBoxCoordinator; private IncognitoDescriptionView mIncognitoDescriptionView; private View.OnClickListener mIncognitoDescriptionLearnMoreListener; private boolean mIncognitoCookieControlsCardIsVisible; @@ -52,10 +50,10 @@ } public void initialize(ActivityLifecycleDispatcher activityLifecycleDispatcher) { - assert mSearchBoxContainerView + assert mSearchBoxCoordinator != null : "#onFinishInflate should be completed before the call to initialize."; - mSearchBoxContainerView.initialize(activityLifecycleDispatcher); + mSearchBoxCoordinator.initialize(activityLifecycleDispatcher); } @Override @@ -64,12 +62,11 @@ mCarouselTabSwitcherContainer = (FrameLayout) findViewById(R.id.carousel_tab_switcher_container); - mSearchBoxContainerView = findViewById(R.id.search_box); + mSearchBoxCoordinator = new SearchBoxCoordinator(getContext(), this); mHeaderView = (AppBarLayout) findViewById(R.id.task_surface_header); AppBarLayout.LayoutParams layoutParams = - (AppBarLayout.LayoutParams) mSearchBoxContainerView.getLayoutParams(); + (AppBarLayout.LayoutParams) mSearchBoxCoordinator.getView().getLayoutParams(); layoutParams.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL); - mSearchBoxText = (TextView) mSearchBoxContainerView.findViewById(R.id.search_box_text); } ViewGroup getCarouselTabSwitcherContainer() { @@ -90,43 +87,10 @@ } /** - * Set the given listener for the fake search box. - * @param listener The given listener. + * @return The {@link SearchBoxCoordinator} representing the fake search box. */ - void setFakeSearchBoxClickListener(@Nullable View.OnClickListener listener) { - mSearchBoxText.setOnClickListener(listener); - } - - /** - * Set the given watcher for the fake search box. - * @param textWatcher The given {@link TextWatcher}. - */ - void setFakeSearchBoxTextWatcher(TextWatcher textWatcher) { - mSearchBoxText.addTextChangedListener(textWatcher); - } - - /** - * Set the visibility of the fake search box. - * @param isVisible Whether it's visible. - */ - void setFakeSearchBoxVisibility(boolean isVisible) { - mSearchBoxContainerView.setVisibility(isVisible ? View.VISIBLE : View.GONE); - } - - /** - * Set the visibility of the voice recognition button. - * @param isVisible Whether it's visible. - */ - void setVoiceRecognitionButtonVisibility(boolean isVisible) { - findViewById(R.id.voice_search_button).setVisibility(isVisible ? View.VISIBLE : View.GONE); - } - - /** - * Set the voice recognition button click listener. - * @param listener The given listener. - */ - void setVoiceRecognitionButtonClickListener(@Nullable View.OnClickListener listener) { - findViewById(R.id.voice_search_button).setOnClickListener(listener); + SearchBoxCoordinator getSearchBoxCoordinator() { + return mSearchBoxCoordinator; } /** @@ -152,12 +116,13 @@ int backgroundColor = ChromeColors.getPrimaryBackgroundColor(resources, isIncognito); setBackgroundColor(backgroundColor); mHeaderView.setBackgroundColor(backgroundColor); - mSearchBoxContainerView.setBackgroundResource( - isIncognito ? R.drawable.fake_search_box_bg_incognito : R.drawable.ntp_search_box); + + mSearchBoxCoordinator.setBackground(AppCompatResources.getDrawable(mContext, + isIncognito ? R.drawable.fake_search_box_bg_incognito : R.drawable.ntp_search_box)); int hintTextColor = isIncognito ? ApiCompatibilityUtils.getColor(resources, R.color.locationbar_light_hint_text) : ApiCompatibilityUtils.getColor(resources, R.color.locationbar_dark_hint_text); - mSearchBoxText.setHintTextColor(hintTextColor); + mSearchBoxCoordinator.setSearchBoxHintColor(hintTextColor); } /**
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/TasksViewBinder.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/TasksViewBinder.java index b808a860..77a69f08 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/TasksViewBinder.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/TasksViewBinder.java
@@ -32,9 +32,11 @@ class TasksViewBinder { public static void bind(PropertyModel model, TasksView view, PropertyKey propertyKey) { if (propertyKey == FAKE_SEARCH_BOX_CLICK_LISTENER) { - view.setFakeSearchBoxClickListener(model.get(FAKE_SEARCH_BOX_CLICK_LISTENER)); + view.getSearchBoxCoordinator().setSearchBoxClickListener( + model.get(FAKE_SEARCH_BOX_CLICK_LISTENER)); } else if (propertyKey == FAKE_SEARCH_BOX_TEXT_WATCHER) { - view.setFakeSearchBoxTextWatcher(model.get(FAKE_SEARCH_BOX_TEXT_WATCHER)); + view.getSearchBoxCoordinator().setSearchBoxTextWatcher( + model.get(FAKE_SEARCH_BOX_TEXT_WATCHER)); } else if (propertyKey == INCOGNITO_COOKIE_CONTROLS_CARD_VISIBILITY) { view.setIncognitoCookieControlsCardVisibility( model.get(INCOGNITO_COOKIE_CONTROLS_CARD_VISIBILITY)); @@ -54,7 +56,7 @@ view.setIncognitoDescriptionLearnMoreClickListener( model.get(INCOGNITO_LEARN_MORE_CLICK_LISTENER)); } else if (propertyKey == IS_FAKE_SEARCH_BOX_VISIBLE) { - view.setFakeSearchBoxVisibility(model.get(IS_FAKE_SEARCH_BOX_VISIBLE)); + view.getSearchBoxCoordinator().setVisibility(model.get(IS_FAKE_SEARCH_BOX_VISIBLE)); } else if (propertyKey == IS_INCOGNITO) { view.setIncognitoMode(model.get(IS_INCOGNITO)); } else if (propertyKey == IS_INCOGNITO_DESCRIPTION_INITIALIZED) { @@ -72,14 +74,14 @@ } else if (propertyKey == IS_TAB_CAROUSEL_VISIBLE) { view.setTabCarouselVisibility(model.get(IS_TAB_CAROUSEL_VISIBLE)); } else if (propertyKey == IS_VOICE_RECOGNITION_BUTTON_VISIBLE) { - view.setVoiceRecognitionButtonVisibility( + view.getSearchBoxCoordinator().setVoiceSearchButtonVisibility( model.get(IS_VOICE_RECOGNITION_BUTTON_VISIBLE)); } else if (propertyKey == MORE_TABS_CLICK_LISTENER) { view.setMoreTabsOnClickListener(model.get(MORE_TABS_CLICK_LISTENER)); } else if (propertyKey == MV_TILES_VISIBLE) { view.setMostVisitedVisibility(model.get(MV_TILES_VISIBLE) ? View.VISIBLE : View.GONE); } else if (propertyKey == VOICE_SEARCH_BUTTON_CLICK_LISTENER) { - view.setVoiceRecognitionButtonClickListener( + view.getSearchBoxCoordinator().setVoiceSearchButtonClickListener( model.get(VOICE_SEARCH_BUTTON_CLICK_LISTENER)); } }
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java index fc4ba47d..d040c11 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java
@@ -5,22 +5,21 @@ package org.chromium.chrome.browser.feed; import android.app.Activity; -import android.content.Context; import android.graphics.Canvas; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; +import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; -import org.chromium.chrome.browser.ActivityTabProvider; -import org.chromium.chrome.browser.ChromeActivity; -import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.feed.action.FeedActionHandler; import org.chromium.chrome.browser.feed.library.api.client.stream.Stream; import org.chromium.chrome.browser.feed.library.api.host.action.ActionApi; +import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.native_page.ContextMenuManager; import org.chromium.chrome.browser.ntp.NewTabPage; @@ -32,8 +31,8 @@ import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tab.TabImpl; import org.chromium.chrome.browser.tabmodel.TabModelSelector; +import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.browser.ui.native_page.NativePageHost; import org.chromium.ui.base.DeviceFormFactor; @@ -48,59 +47,63 @@ /** * Constructs a new {@link FeedNewTabPage}. * - * @param activity The containing {@link ChromeActivity}. + * @param activity The containing {@link Activity}. + * @param fullscreenManager {@link ChromeFullscreenManager} to observe for offset changes. + * @param activityTabProvider Provides the current active tab. + * @param overviewModeBehavior Overview mode to observe for mode changes. + * @param snackbarManager {@link SnackBarManager} object. + * @param lifecycleDispatcher Activity lifecycle dispatcher. + * @param tabModelSelector {@link TabModelSelector} object. + * @param isTablet {@code true} if running on a Tablet device. + * @param uma {@link NewTabPageUma} object recording user metrics. + * @param isInNightMode {@code true} if the night mode setting is on. * @param nativePageHost The host for this native page. - * @param tabModelSelector The {@link TabModelSelector} for the containing activity. - * @param activityTabProvider Allows us to check if we are the current tab. - * @param activityLifecycleDispatcher Allows us to subscribe to backgrounding events. * @param tab The {@link Tab} that contains this new tab page. */ - public FeedNewTabPage(ChromeActivity activity, NativePageHost nativePageHost, - TabModelSelector tabModelSelector, ActivityTabProvider activityTabProvider, - ActivityLifecycleDispatcher activityLifecycleDispatcher, Tab tab) { - super(activity, nativePageHost, tabModelSelector, activityTabProvider, - activityLifecycleDispatcher, tab); + public FeedNewTabPage(Activity activity, ChromeFullscreenManager fullscreenManager, + Supplier<Tab> activityTabProvider, @Nullable OverviewModeBehavior overviewModeBehavior, + SnackbarManager snackbarManager, ActivityLifecycleDispatcher lifecycleDispatcher, + TabModelSelector tabModelSelector, boolean isTablet, NewTabPageUma uma, + boolean isInNightMode, NativePageHost nativePageHost, Tab tab) { + super(activity, fullscreenManager, activityTabProvider, overviewModeBehavior, + snackbarManager, lifecycleDispatcher, tabModelSelector, isTablet, uma, + isInNightMode, nativePageHost, tab); - // Don't store a direct reference to the activity, because it might change later if the tab - // is reparented. // TODO(twellington): Move this somewhere it can be shared with NewTabPageView? - Runnable closeContextMenuCallback = () -> activity.closeContextMenu(); + Runnable closeContextMenuCallback = activity::closeContextMenu; mContextMenuManager = new ContextMenuManager(mNewTabPageManager.getNavigationDelegate(), mCoordinator.getTouchEnabledDelegate(), closeContextMenuCallback, NewTabPage.CONTEXT_MENU_USER_ACTION_PREFIX); mTab.getWindowAndroid().addContextMenuCloseListener(mContextMenuManager); - OverviewModeBehavior overviewModeBehavior = activity instanceof ChromeTabbedActivity - ? activity.getOverviewModeBehavior() - : null; - - mNewTabPageLayout.initialize(mNewTabPageManager, activity, overviewModeBehavior, - mTileGroupDelegate, mSearchProviderHasLogo, + mNewTabPageLayout.initialize(mNewTabPageManager, activity, mTileGroupDelegate, + mSearchProviderHasLogo, TemplateUrlServiceFactory.get().isDefaultSearchEngineGoogle(), mCoordinator.getScrollDelegate(), mContextMenuManager, mCoordinator.getUiConfig(), - activityLifecycleDispatcher); + activityTabProvider, lifecycleDispatcher, overviewModeBehavior, uma); } @Override - protected void initializeMainView(Context context, NativePageHost host) { + protected void initializeMainView(Activity activity, NativePageHost host, + Supplier<Tab> tabProvider, ActivityLifecycleDispatcher lifecycleDispatcher, + SnackbarManager snackbarManager, @Nullable OverviewModeBehavior overviewModeBehavior, + TabModelSelector tabModelSelector, NewTabPageUma uma, boolean isInNightMode) { Profile profile = Profile.fromWebContents(mTab.getWebContents()); ActionApi actionApi = new FeedActionHandler(mNewTabPageManager.getNavigationDelegate(), FeedProcessScopeFactory.getFeedConsumptionObserver(), FeedProcessScopeFactory.getFeedOfflineIndicator(), OfflinePageBridge.getForProfile(profile), - FeedProcessScopeFactory.getFeedLoggingBridge(), ((TabImpl) mTab).getActivity(), - profile); - LayoutInflater inflater = LayoutInflater.from(((TabImpl) mTab).getActivity()); + FeedProcessScopeFactory.getFeedLoggingBridge(), activity, profile); + LayoutInflater inflater = LayoutInflater.from(activity); mNewTabPageLayout = (NewTabPageLayout) inflater.inflate(R.layout.new_tab_page_layout, null); SectionHeaderView sectionHeaderView = (SectionHeaderView) inflater.inflate( R.layout.new_tab_page_snippets_expandable_header, null, false); - mCoordinator = new FeedSurfaceCoordinator(((TabImpl) mTab).getActivity(), - new SnapScrollHelper(mNewTabPageManager, mNewTabPageLayout), mNewTabPageLayout, - sectionHeaderView, actionApi, - ((TabImpl) mTab).getActivity().getNightModeStateProvider().isInNightMode(), this); + mCoordinator = new FeedSurfaceCoordinator(activity, snackbarManager, tabModelSelector, + tabProvider, new SnapScrollHelper(mNewTabPageManager, mNewTabPageLayout), + mNewTabPageLayout, sectionHeaderView, actionApi, isInNightMode, this); // Record the timestamp at which the new tab page's construction started. - NewTabPageUma.trackTimeToFirstDraw(mCoordinator.getView(), mConstructedTimeNs); + uma.trackTimeToFirstDraw(mCoordinator.getView(), mConstructedTimeNs); } @Override
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 e6e3204..eba96b69 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
@@ -21,6 +21,7 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.GlobalDiscardableReferencePool; import org.chromium.chrome.browser.feed.library.api.client.scope.ProcessScope; @@ -42,6 +43,8 @@ import org.chromium.chrome.browser.ntp.SnapScrollHelper; import org.chromium.chrome.browser.ntp.snippets.SectionHeaderView; import org.chromium.chrome.browser.signin.PersonalizedSigninPromoView; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.feed.R; @@ -56,7 +59,8 @@ * Provides a surface that displays an interest feed rendered list of content suggestions. */ public class FeedSurfaceCoordinator { - private final ChromeActivity mActivity; + private final Activity mActivity; + private final SnackbarManager mSnackbarManager; @Nullable private final View mNtpHeader; private final ActionApi mActionApi; @@ -266,6 +270,9 @@ * Constructs a new FeedSurfaceCoordinator. * * @param activity The containing {@link ChromeActivity}. + * @param snackbarManager The {@link SnackbarManager} displaying Snackbar UI. + * @param tabModelSelector {@link TabModelSelector} object. + * @param tabProvider Provides the current active tab. * @param snapScrollHelper The {@link SnapScrollHelper} for the New Tab Page. * @param ntpHeader The extra header on top of the feeds for the New Tab Page. * @param sectionHeaderView The {@link SectionHeaderView} for the feed. @@ -273,11 +280,13 @@ * @param showDarkBackground Whether is shown on dark background. * @param delegate The constructing {@link FeedSurfaceDelegate}. */ - public FeedSurfaceCoordinator(ChromeActivity activity, + public FeedSurfaceCoordinator(Activity activity, SnackbarManager snackbarManager, + TabModelSelector tabModelSelector, Supplier<Tab> tabProvider, @Nullable SnapScrollHelper snapScrollHelper, @Nullable View ntpHeader, @Nullable SectionHeaderView sectionHeaderView, ActionApi actionApi, boolean showDarkBackground, FeedSurfaceDelegate delegate) { mActivity = activity; + mSnackbarManager = snackbarManager; mNtpHeader = ntpHeader; mSectionHeaderView = sectionHeaderView; mActionApi = actionApi; @@ -300,7 +309,7 @@ if (ChromeFeatureList.isEnabled(ChromeFeatureList.INTEREST_FEED_V2)) { // TODO(jianli): Temporary: simulate opening the feed V2 surface. This should probably // move to FeedSurfaceMediator. - mFeedStreamSurface = new FeedStreamSurface(mActivity); + mFeedStreamSurface = new FeedStreamSurface(tabModelSelector, tabProvider); mFeedStreamSurface.surfaceOpened(); } } @@ -376,7 +385,7 @@ .createStreamScopeBuilder(mActivity, mImageLoader, mActionApi, new BasicStreamConfiguration(), new BasicCardConfiguration(mActivity.getResources(), mUiConfig), - new BasicSnackbarApi(mActivity.getSnackbarManager()), + new BasicSnackbarApi(mSnackbarManager), FeedProcessScopeFactory.getFeedOfflineIndicator(), tooltipApi) .setIsBackgroundDark(mShowDarkBackground) .build();
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurface.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurface.java index e20b523..f2ca952 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurface.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurface.java
@@ -12,7 +12,7 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.NativeMethods; -import org.chromium.chrome.browser.ChromeActivity; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabLaunchType; import org.chromium.chrome.browser.tabmodel.TabModelSelector; @@ -38,16 +38,18 @@ public class FeedStreamSurface implements SurfaceActionsHandler, FeedActionsHandler { private static final String TAG = "FeedStreamSurface"; private final long mNativeFeedStreamSurface; - private final ChromeActivity mActivity; private final FeedListContentManager mContentManager; + private final TabModelSelector mTabModelSelector; + private final Supplier<Tab> mTabProvider; /** * Creates a {@link FeedStreamSurface} for creating native side bridge to access native feed * client implementation. */ - public FeedStreamSurface(ChromeActivity activity) { + public FeedStreamSurface(TabModelSelector tabModelSelector, Supplier<Tab> tabProvider) { mNativeFeedStreamSurface = FeedStreamSurfaceJni.get().init(FeedStreamSurface.this); - mActivity = activity; + mTabModelSelector = tabModelSelector; + mTabProvider = tabProvider; mContentManager = new FeedListContentManager(this, this); @@ -147,16 +149,15 @@ public void navigateTab(String url) { LoadUrlParams loadUrlParams = new LoadUrlParams(url); loadUrlParams.setTransitionType(PageTransition.AUTO_BOOKMARK); - mActivity.getActivityTabProvider().get().loadUrl(loadUrlParams); + mTabProvider.get().loadUrl(loadUrlParams); FeedStreamSurfaceJni.get().reportNavigationStarted( mNativeFeedStreamSurface, FeedStreamSurface.this, url, false /*inNewTab*/); } @Override public void navigateNewTab(String url) { - TabModelSelector tabModelSelector = mActivity.getTabModelSelector(); - Tab tab = mActivity.getActivityTabProvider().get(); - tabModelSelector.openNewTab( + Tab tab = mTabProvider.get(); + mTabModelSelector.openNewTab( new LoadUrlParams(url), TabLaunchType.FROM_CHROME_UI, tab, tab.isIncognito()); FeedStreamSurfaceJni.get().reportNavigationStarted( mNativeFeedStreamSurface, FeedStreamSurface.this, url, true /*inNewTab*/);
diff --git a/chrome/android/java/res/layout/fake_search_box_layout.xml b/chrome/android/java/res/layout/fake_search_box_layout.xml index 8af7763..56c529ff 100644 --- a/chrome/android/java/res/layout/fake_search_box_layout.xml +++ b/chrome/android/java/res/layout/fake_search_box_layout.xml
@@ -4,7 +4,7 @@ found in the LICENSE file. --> <view - class="org.chromium.chrome.browser.ntp.NewTabPageLayout$SearchBoxContainerView" + class="org.chromium.chrome.browser.ntp.search.SearchBoxContainerView" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml index 0e544e38..7814fc92 100644 --- a/chrome/android/java/res/values/dimens.xml +++ b/chrome/android/java/res/values/dimens.xml
@@ -157,6 +157,7 @@ <dimen name="badge_position_x">26dp</dimen> <dimen name="badge_position_y">20dp</dimen> <dimen name="badge_border_size">1.3dp</dimen> + <dimen name="badge_size">20dp</dimen> <!-- First Run Experience dimensions --> <dimen name="fre_content_margin">24dp</dimen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index 89fa08d..f8a9ef829 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -598,7 +598,6 @@ mIncognitoTabCreator = tabCreators.second; OfflinePageUtils.observeTabModelSelector(this, mTabModelSelector); - NewTabPageUma.monitorNTPCreation(mTabModelSelector); if (mTabModelSelectorTabObserver != null) mTabModelSelectorTabObserver.destroy();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java index 72bf933..e2c46a3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java
@@ -10,6 +10,7 @@ import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl; +import org.chromium.chrome.browser.native_page.NativePageFactory; import org.chromium.chrome.browser.share.ShareDelegate; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabContextMenuItemDelegate; @@ -30,6 +31,7 @@ private final BrowserControlsVisibilityDelegate mAppBrowserControlsVisibilityDelegate; private final Supplier<ShareDelegate> mShareDelegateSupplier; private final Supplier<EphemeralTabCoordinator> mEphemeralTabCoordinatorSupplier; + private NativePageFactory mNativePageFactory; public TabbedModeTabDelegateFactory(ChromeActivity activity, BrowserControlsVisibilityDelegate appBrowserControlsVisibilityDelegate, @@ -65,4 +67,10 @@ new TabStateBrowserControlsVisibilityDelegate(tab), mAppBrowserControlsVisibilityDelegate); } + + @Override + public NativePageFactory getNativePageFactory() { + if (mNativePageFactory == null) mNativePageFactory = new NativePageFactory(mActivity); + return mNativePageFactory; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java index 65b0fcf0..7cb5df7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
@@ -34,6 +34,7 @@ import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl; import org.chromium.chrome.browser.flags.ActivityType; import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; +import org.chromium.chrome.browser.native_page.NativePageFactory; import org.chromium.chrome.browser.share.ShareDelegate; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabAssociatedApp; @@ -473,6 +474,12 @@ shareDelegateSupplier, contextMenuMode, ExternalAuthUtils.getInstance()); } + @Override + public NativePageFactory getNativePageFactory() { + // Custom tab does not create native pages. + return null; + } + /** * @return The {@link CustomTabNavigationDelegate} in this tab. For test purpose only. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java index 33673e6..673a006 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
@@ -282,7 +282,7 @@ } if (!TextUtils.isEmpty(filterPackageName) && (info.activityInfo == null - || !info.activityInfo.packageName.equals(filterPackageName))) { + || !info.activityInfo.packageName.equals(filterPackageName))) { return false; } return true; @@ -701,6 +701,11 @@ } @Override + public boolean isIntentToAutofillAssistant(Intent intent) { + return AutofillAssistantFacade.isAutofillAssistantByIntentTriggeringEnabled(intent); + } + + @Override public boolean isValidWebApk(String packageName) { return WebApkValidator.isValidWebApk(ContextUtils.getApplicationContext(), packageName); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java index 39436d7..496b996 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java
@@ -12,7 +12,7 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.supplier.DestroyableObservableSupplier; -import org.chromium.chrome.browser.ActivityTabProvider; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.bookmarks.BookmarkPage; import org.chromium.chrome.browser.download.DownloadPage; @@ -22,9 +22,9 @@ import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.history.HistoryManagerUtils; import org.chromium.chrome.browser.history.HistoryPage; -import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.ntp.IncognitoNewTabPage; import org.chromium.chrome.browser.ntp.NewTabPage; +import org.chromium.chrome.browser.ntp.NewTabPageUma; import org.chromium.chrome.browser.ntp.RecentTabsManager; import org.chromium.chrome.browser.ntp.RecentTabsPage; import org.chromium.chrome.browser.profiles.Profile; @@ -43,54 +43,82 @@ * Creates NativePage objects to show chrome-native:// URLs using the native Android view system. */ public class NativePageFactory { - private static NativePageBuilder sNativePageBuilder = new NativePageBuilder(); + private final ChromeActivity mActivity; + private NewTabPageUma mNewTabPageUma; + + private NativePageBuilder mNativePageBuilder; + + public NativePageFactory(ChromeActivity activity) { + mActivity = activity; + } + + private NativePageBuilder getBuilder() { + if (mNativePageBuilder == null) { + mNativePageBuilder = new NativePageBuilder(mActivity, this::getNewTabPageUma); + } + return mNativePageBuilder; + } + + private NewTabPageUma getNewTabPageUma() { + if (mNewTabPageUma == null) { + mNewTabPageUma = new NewTabPageUma(mActivity.getTabModelSelector(), + mActivity::getLastUserInteractionTime, mActivity.hadWarmStart(), + mActivity::getIntent); + mNewTabPageUma.monitorNTPCreation(); + } + return mNewTabPageUma; + } @VisibleForTesting static class NativePageBuilder { - protected NativePage buildNewTabPage( - ChromeActivity activity, Tab tab, TabModelSelector tabModelSelector) { - ActivityTabProvider activityTabProvider = activity.getActivityTabProvider(); - ActivityLifecycleDispatcher activityLifecycleDispatcher = - activity.getLifecycleDispatcher(); + private final ChromeActivity mActivity; + private final Supplier<NewTabPageUma> mUma; - if (tab.isIncognito()) { - return new IncognitoNewTabPage( - activity, new TabShim(tab, activity.getFullscreenManager())); - } + public NativePageBuilder(ChromeActivity activity, Supplier<NewTabPageUma> uma) { + mActivity = activity; + mUma = uma; + } + protected NativePage buildNewTabPage(Tab tab) { + NativePageHost nativePageHost = new TabShim(tab, mActivity.getFullscreenManager()); + if (tab.isIncognito()) return new IncognitoNewTabPage(mActivity, nativePageHost); if (ChromeFeatureList.isEnabled(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)) { - return new FeedNewTabPage(activity, - new TabShim(tab, activity.getFullscreenManager()), tabModelSelector, - activityTabProvider, activityLifecycleDispatcher, tab); + return new FeedNewTabPage(mActivity, mActivity.getFullscreenManager(), + mActivity.getActivityTabProvider(), mActivity.getOverviewModeBehavior(), + mActivity.getSnackbarManager(), mActivity.getLifecycleDispatcher(), + mActivity.getTabModelSelector(), mActivity.isTablet(), mUma.get(), + mActivity.getNightModeStateProvider().isInNightMode(), nativePageHost, tab); } - - return new NewTabPage(activity, new TabShim(tab, activity.getFullscreenManager()), - tabModelSelector, activityTabProvider, activityLifecycleDispatcher, tab); + return new NewTabPage(mActivity, mActivity.getFullscreenManager(), + mActivity.getActivityTabProvider(), mActivity.getOverviewModeBehavior(), + mActivity.getSnackbarManager(), mActivity.getLifecycleDispatcher(), + mActivity.getTabModelSelector(), mActivity.isTablet(), mUma.get(), + mActivity.getNightModeStateProvider().isInNightMode(), nativePageHost, tab); } - protected NativePage buildBookmarksPage(ChromeActivity activity, Tab tab) { - return new BookmarkPage(activity, new TabShim(tab, activity.getFullscreenManager())); + protected NativePage buildBookmarksPage(Tab tab) { + return new BookmarkPage(mActivity, new TabShim(tab, mActivity.getFullscreenManager())); } - protected NativePage buildDownloadsPage(ChromeActivity activity, Tab tab) { - return new DownloadPage(activity, new TabShim(tab, activity.getFullscreenManager())); + protected NativePage buildDownloadsPage(Tab tab) { + return new DownloadPage(mActivity, new TabShim(tab, mActivity.getFullscreenManager())); } - protected NativePage buildExploreSitesPage(ChromeActivity activity, Tab tab) { + protected NativePage buildExploreSitesPage(Tab tab) { return new ExploreSitesPage( - activity, new TabShim(tab, activity.getFullscreenManager()), tab); + mActivity, new TabShim(tab, mActivity.getFullscreenManager()), tab); } - protected NativePage buildHistoryPage(ChromeActivity activity, Tab tab) { - return new HistoryPage(activity, new TabShim(tab, activity.getFullscreenManager())); + protected NativePage buildHistoryPage(Tab tab) { + return new HistoryPage(mActivity, new TabShim(tab, mActivity.getFullscreenManager())); } - protected NativePage buildRecentTabsPage(ChromeActivity activity, Tab tab) { - RecentTabsManager recentTabsManager = - new RecentTabsManager(tab, Profile.fromWebContents(tab.getWebContents()), - activity, () -> HistoryManagerUtils.showHistoryManager(activity, tab)); - return new RecentTabsPage( - activity, recentTabsManager, new TabShim(tab, activity.getFullscreenManager())); + protected NativePage buildRecentTabsPage(Tab tab) { + RecentTabsManager recentTabsManager = new RecentTabsManager(tab, + Profile.fromWebContents(tab.getWebContents()), mActivity, + () -> HistoryManagerUtils.showHistoryManager(mActivity, tab)); + return new RecentTabsPage(mActivity, recentTabsManager, + new TabShim(tab, mActivity.getFullscreenManager())); } } @@ -148,17 +176,15 @@ * @param url The URL to be handled. * @param candidatePage A NativePage to be reused if it matches the url, or null. * @param tab The Tab that will show the page. - * @param activity The activity used to create the views for the page. * @return A NativePage showing the specified url or null. */ - public static NativePage createNativePageForURL( - String url, NativePage candidatePage, Tab tab, ChromeActivity activity) { - return createNativePageForURL(url, candidatePage, tab, activity, tab.isIncognito()); + public NativePage createNativePageForURL(String url, NativePage candidatePage, Tab tab) { + return createNativePageForURL(url, candidatePage, tab, tab.isIncognito()); } @VisibleForTesting - static NativePage createNativePageForURL(String url, NativePage candidatePage, Tab tab, - ChromeActivity activity, boolean isIncognito) { + NativePage createNativePageForURL( + String url, NativePage candidatePage, Tab tab, boolean isIncognito) { NativePage page; switch (nativePageType(url, candidatePage, isIncognito)) { @@ -168,23 +194,22 @@ page = candidatePage; break; case NativePageType.NTP: - page = sNativePageBuilder.buildNewTabPage( - activity, tab, TabModelSelector.from(tab)); + page = getBuilder().buildNewTabPage(tab); break; case NativePageType.BOOKMARKS: - page = sNativePageBuilder.buildBookmarksPage(activity, tab); + page = getBuilder().buildBookmarksPage(tab); break; case NativePageType.DOWNLOADS: - page = sNativePageBuilder.buildDownloadsPage(activity, tab); + page = getBuilder().buildDownloadsPage(tab); break; case NativePageType.HISTORY: - page = sNativePageBuilder.buildHistoryPage(activity, tab); + page = getBuilder().buildHistoryPage(tab); break; case NativePageType.RECENT_TABS: - page = sNativePageBuilder.buildRecentTabsPage(activity, tab); + page = getBuilder().buildRecentTabsPage(tab); break; case NativePageType.EXPLORE: - page = sNativePageBuilder.buildExploreSitesPage(activity, tab); + page = getBuilder().buildExploreSitesPage(tab); break; default: assert false; @@ -207,8 +232,8 @@ } @VisibleForTesting - static void setNativePageBuilderForTesting(NativePageBuilder builder) { - sNativePageBuilder = builder; + void setNativePageBuilderForTesting(NativePageBuilder builder) { + mNativePageBuilder = builder; } /** Simple implementation of NativePageHost backed by a {@link Tab} */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageNavigationDelegateImpl.java index ed2d313..bed795a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageNavigationDelegateImpl.java
@@ -4,11 +4,10 @@ package org.chromium.chrome.browser.native_page; +import android.app.Activity; + import androidx.annotation.Nullable; -import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeActivity; -import org.chromium.chrome.browser.device.DeviceClassManager; import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; import org.chromium.chrome.browser.offlinepages.DownloadUiActionFlags; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; @@ -19,11 +18,8 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.document.TabDelegate; import org.chromium.chrome.browser.ui.native_page.NativePageHost; -import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController; -import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController.SheetState; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.ui.mojom.WindowOpenDisposition; -import org.chromium.ui.widget.Toast; /** * {@link NativePageNavigationDelegate} implementation. @@ -34,11 +30,11 @@ private final TabModelSelector mTabModelSelector; private final Tab mTab; - protected final ChromeActivity mActivity; + protected final Activity mActivity; protected final NativePageHost mHost; - public NativePageNavigationDelegateImpl(ChromeActivity activity, Profile profile, - NativePageHost host, TabModelSelector tabModelSelector, Tab tab) { + public NativePageNavigationDelegateImpl(Activity activity, Profile profile, NativePageHost host, + TabModelSelector tabModelSelector, Tab tab) { mActivity = activity; mProfile = profile; mHost = host; @@ -86,20 +82,8 @@ } private Tab openUrlInNewTab(LoadUrlParams loadUrlParams) { - Tab tab = mTabModelSelector.openNewTab(loadUrlParams, - TabLaunchType.FROM_LONGPRESS_BACKGROUND, mTab, - /* incognito = */ false); - - // If animations are disabled in the DeviceClassManager, a toast is already displayed for - // all tabs opened in the background. - // TODO(twellington): Replace this with an animation. - BottomSheetController controller = mActivity.getBottomSheetController(); - if (controller != null && controller.getSheetState() == SheetState.FULL - && DeviceClassManager.enableAnimations()) { - Toast.makeText(mActivity, R.string.open_in_new_tab_toast, Toast.LENGTH_SHORT).show(); - } - - return tab; + return mTabModelSelector.openNewTab(loadUrlParams, TabLaunchType.FROM_LONGPRESS_BACKGROUND, + mTab, /* incognito = */ false); } private void saveUrlForOffline(String url) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/FakeboxDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/FakeboxDelegate.java index 9f2bb0a..8fca74ce 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/FakeboxDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/FakeboxDelegate.java
@@ -27,6 +27,14 @@ boolean shouldBeFocused, @Nullable String pastedText, @OmniboxFocusReason int reason); /** + * Performs a search query on the current {@link Tab}. This calls {@link + * TemplateUrlService#getUrlForSearchQuery(String)} to get a url based on {@code query} and + * loads that url in the current {@link Tab}. + * @param query The {@link String} that represents the text query that should be searched for. + */ + void performSearchQuery(String query); + + /** * @return Whether the URL bar is currently focused. */ boolean isUrlBarFocused();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java index 067d8c9..6cd6e7b2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.ntp; +import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.graphics.Point; @@ -26,10 +27,10 @@ import org.chromium.base.TraceEvent; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; -import org.chromium.chrome.browser.ActivityTabProvider; -import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.GlobalDiscardableReferencePool; +import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider; import org.chromium.chrome.browser.download.DownloadManagerService; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; @@ -55,7 +56,6 @@ import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabHidingType; -import org.chromium.chrome.browser.tab.TabImpl; import org.chromium.chrome.browser.tab.TabObserver; import org.chromium.chrome.browser.tab.TabSelectionType; import org.chromium.chrome.browser.tabmodel.TabModelSelector; @@ -87,7 +87,7 @@ public static final String CONTEXT_MENU_USER_ACTION_PREFIX = "Suggestions"; protected final Tab mTab; - private final ActivityTabProvider mActivityTabProvider; + private final Supplier<Tab> mActivityTabProvider; private final ActivityLifecycleDispatcher mActivityLifecycleDispatcher; private final String mTitle; @@ -96,6 +96,7 @@ protected final TileGroup.Delegate mTileGroupDelegate; private final boolean mIsTablet; private final ChromeFullscreenManager mFullscreenManager; + private final NewTabPageUma mNewTabPageUma; /** * The {@link NewTabPageView} shown in this NewTabPageLayout. This may be null in sub-classes. @@ -219,6 +220,12 @@ } @Override + public void performSearchQuery(String query) { + if (mFakeboxDelegate == null) return; + mFakeboxDelegate.performSearchQuery(query); + } + + @Override public boolean isCurrentPage() { if (mIsDestroyed) return false; if (mFakeboxDelegate == null) return false; @@ -243,9 +250,9 @@ * {@link NewTabPage}. */ private class NewTabPageTileGroupDelegate extends TileGroupDelegateImpl { - private NewTabPageTileGroupDelegate(ChromeActivity activity, Profile profile, - SuggestionsNavigationDelegate navigationDelegate) { - super(activity, profile, navigationDelegate, activity.getSnackbarManager()); + private NewTabPageTileGroupDelegate(Context context, Profile profile, + SuggestionsNavigationDelegate navigationDelegate, SnackbarManager snackbarManager) { + super(context, profile, navigationDelegate, snackbarManager); } @Override @@ -273,22 +280,30 @@ /** * Constructs a NewTabPage. * @param activity The activity used for context to create the new tab page's View. + * @param fullscreenManager {@link ChromeFullscreenManager} to observe for offset changes. + * @param activityTabProvider Provides the current active tab. + * @param overviewModeBehavior Overview mode to observe for mode changes. + * @param snackbarManager {@link SnackBarManager} object. + * @param lifecycleDispatcher Activity lifecycle dispatcher. + * @param tabModelSelector {@link TabModelSelector} object. + * @param isTablet {@code true} if running on a Tablet device. + * @param uma {@link NewTabPageUma} object recording user metrics. + * @param isInNightMode {@code true} if the night mode setting is on. * @param nativePageHost The host that is showing this new tab page. - * @param tabModelSelector The TabModelSelector used to open tabs. - * @param activityTabProvider Allows us to check if we are the current tab. - * @param activityLifecycleDispatcher Allows us to subscribe to backgrounding events. - * @param tab The {@link TabImpl} that contains this new tab page. + * @param tab The {@link Tab} that contains this new tab page. */ - public NewTabPage(ChromeActivity activity, NativePageHost nativePageHost, - TabModelSelector tabModelSelector, ActivityTabProvider activityTabProvider, - ActivityLifecycleDispatcher activityLifecycleDispatcher, Tab tab) { + public NewTabPage(Activity activity, ChromeFullscreenManager fullscreenManager, + Supplier<Tab> activityTabProvider, @Nullable OverviewModeBehavior overviewModeBehavior, + SnackbarManager snackbarManager, ActivityLifecycleDispatcher lifecycleDispatcher, + TabModelSelector tabModelSelector, boolean isTablet, NewTabPageUma uma, + boolean isInNightMode, NativePageHost nativePageHost, Tab tab) { mConstructedTimeNs = System.nanoTime(); TraceEvent.begin(TAG); mActivityTabProvider = activityTabProvider; - mActivityLifecycleDispatcher = activityLifecycleDispatcher; - + mActivityLifecycleDispatcher = lifecycleDispatcher; mTab = tab; + mNewTabPageUma = uma; Profile profile = Profile.fromWebContents(mTab.getWebContents()); SuggestionsDependencyFactory depsFactory = SuggestionsDependencyFactory.getInstance(); @@ -299,13 +314,14 @@ activity, profile, nativePageHost, tabModelSelector, mTab); mNewTabPageManager = new NewTabPageManagerImpl(suggestionsSource, eventReporter, navigationDelegate, profile, nativePageHost, - GlobalDiscardableReferencePool.getReferencePool(), activity.getSnackbarManager()); - mTileGroupDelegate = new NewTabPageTileGroupDelegate(activity, profile, navigationDelegate); + GlobalDiscardableReferencePool.getReferencePool(), snackbarManager); + mTileGroupDelegate = new NewTabPageTileGroupDelegate( + activity, profile, navigationDelegate, snackbarManager); mTitle = activity.getResources().getString(R.string.button_new_tab); mBackgroundColor = ApiCompatibilityUtils.getColor(activity.getResources(), R.color.default_bg_color); - mIsTablet = activity.isTablet(); + mIsTablet = isTablet; TemplateUrlServiceFactory.get().addObserver(this); mTabObserver = new EmptyTabObserver() { @@ -344,9 +360,10 @@ mActivityLifecycleDispatcher.register(mLifecycleObserver); updateSearchProviderHasLogo(); - initializeMainView(activity, nativePageHost); + initializeMainView(activity, nativePageHost, activityTabProvider, lifecycleDispatcher, + snackbarManager, overviewModeBehavior, tabModelSelector, uma, isInNightMode); - mFullscreenManager = activity.getFullscreenManager(); + mFullscreenManager = fullscreenManager; getView().addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { @Override public void onViewAttachedToWindow(View view) { @@ -367,27 +384,37 @@ mTabStripAndToolbarHeight = activity.getResources().getDimensionPixelSize(R.dimen.tab_strip_and_toolbar_height); - NewTabPageUma.recordIsUserOnline(); - NewTabPageUma.recordLoadType(activity); - NewTabPageUma.recordContentSuggestionsDisplayStatus(); + mNewTabPageUma.recordIsUserOnline(); + mNewTabPageUma.recordLoadType(); + mNewTabPageUma.recordContentSuggestionsDisplayStatus(); TraceEvent.end(TAG); } /** * Create and initialize the main view contained in this NewTabPage. - * @param context The context used to inflate the view. + * @param activity The activity used to initialize the view. * @param host NativePageHost used for initialization. + * @param tabProvider Provides the current active tab. + * @param lifecycleDispatcher Activity lifecycle dispatcher. + * @param snackbarManager {@link SnackBarManager} object. + * @param overviewModeBehavior Overview mode to observe for mode changes. + * @param tabModelSelector {@link TabModelSelector} object. + * @param uma {@link NewTabPageUma} object recording user metrics. + * @param isInNightMode {@code true} if the night mode setting is on. */ - protected void initializeMainView(Context context, NativePageHost host) { - LayoutInflater inflater = LayoutInflater.from(context); + protected void initializeMainView(Activity activity, NativePageHost host, + Supplier<Tab> tabProvider, ActivityLifecycleDispatcher lifecycleDispatcher, + SnackbarManager snackbarManager, @Nullable OverviewModeBehavior overviewModeBehavior, + TabModelSelector tabModelSelector, NewTabPageUma uma, boolean isInNightMode) { + LayoutInflater inflater = LayoutInflater.from(activity); mNewTabPageView = (NewTabPageView) inflater.inflate(R.layout.new_tab_page_view, null); mNewTabPageLayout = mNewTabPageView.getNewTabPageLayout(); - mNewTabPageView.initialize(mNewTabPageManager, mTab, mTileGroupDelegate, + mNewTabPageView.initialize(mNewTabPageManager, activity, mTab, mTileGroupDelegate, mSearchProviderHasLogo, TemplateUrlServiceFactory.get().isDefaultSearchEngineGoogle(), getScrollPositionFromNavigationEntry(NAVIGATION_ENTRY_SCROLL_POSITION_KEY, mTab), - mConstructedTimeNs, mActivityLifecycleDispatcher); + mConstructedTimeNs, tabProvider, lifecycleDispatcher, overviewModeBehavior, uma); } /**
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 480e1d23..5de63a5 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
@@ -4,34 +4,28 @@ package org.chromium.chrome.browser.ntp; +import android.app.Activity; import android.content.Context; -import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.graphics.drawable.RippleDrawable; -import android.os.Build; import android.text.Editable; import android.text.TextWatcher; import android.util.AttributeSet; -import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewStub; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.TextView; -import androidx.annotation.ColorRes; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; -import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.MathUtils; import org.chromium.base.TraceEvent; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.compositor.layouts.EmptyOverviewModeObserver; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider; @@ -39,21 +33,16 @@ import org.chromium.chrome.browser.download.DownloadUtils; import org.chromium.chrome.browser.explore_sites.ExperimentalExploreSitesSection; import org.chromium.chrome.browser.explore_sites.ExploreSitesBridge; -import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; -import org.chromium.chrome.browser.gsa.GSAState; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; -import org.chromium.chrome.browser.lifecycle.Destroyable; -import org.chromium.chrome.browser.lifecycle.NativeInitObserver; import org.chromium.chrome.browser.native_page.ContextMenuManager; import org.chromium.chrome.browser.ntp.NewTabPage.OnSearchBoxScrollListener; import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager; import org.chromium.chrome.browser.ntp.cards.ExploreOfflineCard; +import org.chromium.chrome.browser.ntp.search.SearchBoxCoordinator; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; import org.chromium.chrome.browser.omnibox.SearchEngineLogoUtils; -import org.chromium.chrome.browser.omnibox.voice.AssistantVoiceSearchService; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.query_tiles.QueryTileSection; -import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.suggestions.SuggestionsConfig; import org.chromium.chrome.browser.suggestions.SuggestionsDependencyFactory; import org.chromium.chrome.browser.suggestions.tile.SiteSection; @@ -62,11 +51,10 @@ import org.chromium.chrome.browser.suggestions.tile.TileGridLayout; import org.chromium.chrome.browser.suggestions.tile.TileGroup; import org.chromium.chrome.browser.suggestions.tile.TileRenderer; +import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.vr.VrModuleProvider; -import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; import org.chromium.ui.base.DeviceFormFactor; -import org.chromium.ui.base.ViewUtils; import org.chromium.ui.vr.VrModeObserver; /** @@ -84,7 +72,7 @@ private View mMiddleSpacer; // Spacer between toolbar and Most Likely. private LogoView mSearchProviderLogoView; - private SearchBoxContainerView mSearchBoxContainerView; + private SearchBoxCoordinator mSearchBoxCoordinator; private ViewGroup mSiteSectionView; private SiteSectionViewHolder mSiteSectionViewHolder; private ImageView mVoiceSearchButton; @@ -100,11 +88,11 @@ private OnSearchBoxScrollListener mSearchBoxScrollListener; private NewTabPageManager mManager; - private ChromeActivity mActivity; - private OverviewModeBehavior mOverviewModeBehavior; + private Activity mActivity; private LogoDelegateImpl mLogoDelegate; private TileGroup mTileGroup; private UiConfig mUiConfig; + private Supplier<Tab> mTabProvider; /** * Whether the tiles shown in the layout have finished loading. @@ -120,6 +108,7 @@ /** Observer for overview mode. */ private EmptyOverviewModeObserver mOverviewObserver; + private OverviewModeBehavior mOverviewModeBehavior; private boolean mSearchProviderHasLogo = true; private boolean mSearchProviderIsGoogle; @@ -143,6 +132,8 @@ private ScrollDelegate mScrollDelegate; private ExploreOfflineCard mExploreOfflineCard; + private NewTabPageUma mNewTabPageUma; + /** * A delegate used to obtain information about scroll state and perform various scroll * functions. @@ -188,7 +179,6 @@ super.onFinishInflate(); mMiddleSpacer = findViewById(R.id.ntp_middle_spacer); mSearchProviderLogoView = findViewById(R.id.search_provider_logo); - mSearchBoxContainerView = findViewById(R.id.search_box); mExploreOfflineCard = new ExploreOfflineCard(this, openDownloadHomeCallback()); insertSiteSectionView(); @@ -199,12 +189,13 @@ mExploreSectionView = exploreStub.inflate(); } + View searchBoxContainerView = findViewById(R.id.search_box); if (SearchEngineLogoUtils.isSearchEngineLogoEnabled()) { int lateral_padding = getResources().getDimensionPixelOffset(R.dimen.sei_search_box_lateral_padding); - mSearchBoxContainerView.setPaddingRelative(lateral_padding, - mSearchBoxContainerView.getPaddingTop(), lateral_padding, - mSearchBoxContainerView.getPaddingBottom()); + searchBoxContainerView.setPaddingRelative(lateral_padding, + searchBoxContainerView.getPaddingTop(), lateral_padding, + searchBoxContainerView.getPaddingBottom()); } } @@ -215,25 +206,30 @@ * @param manager NewTabPageManager used to perform various actions when the user interacts * with the page. * @param activity The activity that currently owns the new tab page - * @param overviewModeBehavior The overview mode behavior associated with the new tab page. + * @param tileGroupDelegate Delegate for {@link TileGroup}. * @param searchProviderHasLogo Whether the search provider has a logo. * @param searchProviderIsGoogle Whether the search provider is Google. * @param scrollDelegate The delegate used to obtain information about scroll state. * @param contextMenuManager The manager for long-press context menus. * @param uiConfig UiConfig that provides display information about this view. - * @param activityLifecycleDispatcher Allows us to subscribe to lifecycle events. + * @param tabProvider Provides the current active tab. + * @param lifecycleDispatcher Activity lifecycle dispatcher. + * @param overviewModeBehavior Overview mode to observe for mode changes. + * @param uma {@link NewTabPageUma} object recording user metrics. */ - public void initialize(NewTabPageManager manager, ChromeActivity activity, - @Nullable OverviewModeBehavior overviewModeBehavior, + public void initialize(NewTabPageManager manager, Activity activity, TileGroup.Delegate tileGroupDelegate, boolean searchProviderHasLogo, boolean searchProviderIsGoogle, ScrollDelegate scrollDelegate, - ContextMenuManager contextMenuManager, UiConfig uiConfig, - ActivityLifecycleDispatcher activityLifecycleDispatcher) { + ContextMenuManager contextMenuManager, UiConfig uiConfig, Supplier<Tab> tabProvider, + ActivityLifecycleDispatcher lifecycleDispatcher, + @Nullable OverviewModeBehavior overviewModeBehavior, NewTabPageUma uma) { TraceEvent.begin(TAG + ".initialize()"); mScrollDelegate = scrollDelegate; mManager = manager; mActivity = activity; mUiConfig = uiConfig; + mTabProvider = tabProvider; + mNewTabPageUma = uma; Profile profile = Profile.getLastUsedRegularProfile(); OfflinePageBridge offlinePageBridge = @@ -247,11 +243,6 @@ mSiteSectionViewHolder = SiteSection.createViewHolder(getSiteSectionView(), mUiConfig); mSiteSectionViewHolder.bindDataSource(mTileGroup, tileRenderer); - final TextView searchBoxTextView = - mSearchBoxContainerView.findViewById(R.id.search_box_text); - mQueryTileSection = - new QueryTileSection(findViewById(R.id.query_tiles), searchBoxTextView, profile); - int variation = ExploreSitesBridge.getVariation(); if (ExploreSitesBridge.isExperimental(variation)) { mExploreSection = new ExperimentalExploreSitesSection( @@ -262,9 +253,9 @@ mLogoDelegate = new LogoDelegateImpl( mManager.getNavigationDelegate(), mSearchProviderLogoView, profile); - mSearchBoxContainerView = findViewById(R.id.search_box); - mSearchBoxContainerView.initialize(activityLifecycleDispatcher); - if (!DeviceFormFactor.isWindowOnTablet(mActivity.getWindowAndroid())) { + mSearchBoxCoordinator = new SearchBoxCoordinator(getContext(), this); + mSearchBoxCoordinator.initialize(lifecycleDispatcher); + if (!DeviceFormFactor.isNonMultiDisplayContextOnTablet(activity)) { mSearchBoxBoundsVerticalInset = getResources().getDimensionPixelSize( R.dimen.ntp_search_box_bounds_vertical_inset_modern); } @@ -276,7 +267,11 @@ setSearchProviderInfo(searchProviderHasLogo, searchProviderIsGoogle); mSearchProviderLogoView.showSearchProviderInitialView(); - mTileGroup.startObserving(getMaxTileRows() * getMaxTileColumns()); + mQueryTileSection = new QueryTileSection(findViewById(R.id.query_tiles), + mSearchBoxCoordinator, profile, mManager::performSearchQuery); + + mTileGroup.startObserving( + getMaxRowsForMostVisitedTiles() * getMaxColumnsForMostVisitedTiles()); VrModuleProvider.registerVrModeObserver(this); if (VrModuleProvider.getDelegate().isInVr()) onEnterVr(); @@ -313,10 +308,8 @@ private void initializeSearchBoxTextView() { TraceEvent.begin(TAG + ".initializeSearchBoxTextView()"); - final TextView searchBoxTextView = - mSearchBoxContainerView.findViewById(R.id.search_box_text); - searchBoxTextView.setOnClickListener(v -> mManager.focusSearchBox(false, null)); - searchBoxTextView.addTextChangedListener(new TextWatcher() { + mSearchBoxCoordinator.setSearchBoxClickListener(v -> mManager.focusSearchBox(false, null)); + mSearchBoxCoordinator.setSearchBoxTextWatcher(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {} @@ -327,7 +320,7 @@ public void afterTextChanged(Editable s) { if (s.length() == 0) return; mManager.focusSearchBox(false, s.toString()); - searchBoxTextView.setText(""); + mSearchBoxCoordinator.setSearchText(""); } }); TraceEvent.end(TAG + ".initializeSearchBoxTextView()"); @@ -335,15 +328,16 @@ private void initializeVoiceSearchButton() { TraceEvent.begin(TAG + ".initializeVoiceSearchButton()"); - mVoiceSearchButton = findViewById(R.id.voice_search_button); - mVoiceSearchButton.setOnClickListener(v -> mManager.focusSearchBox(true, null)); + mSearchBoxCoordinator.setVoiceSearchButtonClickListener( + v -> mManager.focusSearchBox(true, null)); if (SearchEngineLogoUtils.isSearchEngineLogoEnabled()) { // View is 48dp, image is 24dp. Increasing the padding from 4dp -> 8dp will split the // remaining 16dp evenly between start/end resulting in a paddingEnd of 8dp. int paddingStart = getResources().getDimensionPixelSize( R.dimen.sei_ntp_voice_button_start_padding); - mVoiceSearchButton.setPaddingRelative(paddingStart, mVoiceSearchButton.getPaddingTop(), - getPaddingEnd(), mVoiceSearchButton.getPaddingBottom()); + ImageView voiceSearchButton = findViewById(R.id.voice_search_button); + voiceSearchButton.setPaddingRelative(paddingStart, voiceSearchButton.getPaddingTop(), + getPaddingEnd(), voiceSearchButton.getPaddingBottom()); } TraceEvent.end(TAG + ".initializeVoiceSearchButton()"); @@ -409,12 +403,12 @@ // During startup the view may not be fully initialized, so we only calculate the current // percentage if some basic view properties (position of the search box) are sane. - int searchBoxTop = mSearchBoxContainerView.getTop(); + int searchBoxTop = getSearchBoxView().getTop(); if (searchBoxTop == 0) return 0f; // For all other calculations, add the search box padding, because it defines where the // visible "border" of the search box is. - searchBoxTop += mSearchBoxContainerView.getPaddingTop(); + searchBoxTop += getSearchBoxView().getPaddingTop(); final int scrollY = mScrollDelegate.getVerticalScrollOffset(); // Use int pixel size instead of float dimension to avoid precision error on the percentage. @@ -451,7 +445,7 @@ * @return The fake search box view. */ public View getSearchBoxView() { - return mSearchBoxContainerView; + return mSearchBoxCoordinator.getView(); } @Override @@ -538,7 +532,7 @@ // Hide or show the views above the tile grid as needed, including logo, search box, and // spacers. mSearchProviderLogoView.setVisibility(shouldShowLogo() ? View.VISIBLE : View.GONE); - mSearchBoxContainerView.setVisibility(mSearchProviderHasLogo ? View.VISIBLE : View.GONE); + mSearchBoxCoordinator.setVisibility(mSearchProviderHasLogo); updateTileGridPlaceholderVisibility(); onUrlFocusAnimationChanged(); @@ -602,7 +596,7 @@ float percent = mSearchProviderHasLogo ? mUrlFocusChangePercent : 0; int basePosition = mScrollDelegate.getVerticalScrollOffset() + getPaddingTop(); int target = Math.max(basePosition, - mSearchBoxContainerView.getBottom() - mSearchBoxContainerView.getPaddingBottom() + getSearchBoxView().getBottom() - getSearchBoxView().getPaddingBottom() - mSearchBoxBoundsVerticalInset); setTranslationY(percent * (basePosition - target)); @@ -623,11 +617,7 @@ * @param alpha opacity (alpha) value to use. */ public void setSearchBoxAlpha(float alpha) { - mSearchBoxContainerView.setAlpha(alpha); - - // Disable the search box contents if it is the process of being animated away. - ViewUtils.setEnabledRecursive( - mSearchBoxContainerView, mSearchBoxContainerView.getAlpha() == 1.0f); + mSearchBoxCoordinator.setAlpha(alpha); } /** @@ -645,7 +635,7 @@ * @param drawable The search box background. */ public void setSearchBoxBackground(Drawable drawable) { - mSearchBoxContainerView.setBackground(drawable); + mSearchBoxCoordinator.setBackground(drawable); } /** @@ -657,17 +647,17 @@ * @param parentView The top level parent view used to translate search box bounds. */ void getSearchBoxBounds(Rect bounds, Point translation, View parentView) { - int searchBoxX = (int) mSearchBoxContainerView.getX(); - int searchBoxY = (int) mSearchBoxContainerView.getY(); - bounds.set(searchBoxX, searchBoxY, searchBoxX + mSearchBoxContainerView.getWidth(), - searchBoxY + mSearchBoxContainerView.getHeight()); + int searchBoxX = (int) getSearchBoxView().getX(); + int searchBoxY = (int) getSearchBoxView().getY(); + bounds.set(searchBoxX, searchBoxY, searchBoxX + getSearchBoxView().getWidth(), + searchBoxY + getSearchBoxView().getHeight()); translation.set(0, 0); if (isSearchBoxOffscreen()) { translation.y = Integer.MIN_VALUE; } else { - View view = mSearchBoxContainerView; + View view = getSearchBoxView(); while (true) { view = (View) view.getParent(); if (view == null) { @@ -697,7 +687,7 @@ */ private boolean isSearchBoxOffscreen() { return !mScrollDelegate.isChildVisibleAtPosition(0) - || mScrollDelegate.getVerticalScrollOffset() > mSearchBoxContainerView.getTop(); + || mScrollDelegate.getVerticalScrollOffset() > getSearchBoxView().getTop(); } /** @@ -717,7 +707,7 @@ if (!mHasShownView) { mHasShownView = true; onInitializationProgressChanged(); - NewTabPageUma.recordSearchAvailableLoadTime(mActivity); + mNewTabPageUma.recordSearchAvailableLoadTime(); TraceEvent.instant("NewTabPageSearchAvailable)"); } } @@ -732,11 +722,12 @@ ? getResources().getDimensionPixelSize(R.dimen.sei_search_box_lateral_padding) : getResources().getDimensionPixelSize(R.dimen.location_bar_lateral_padding); } - mVoiceSearchButton.setVisibility(mManager.isVoiceSearchEnabled() ? VISIBLE : GONE); - mSearchBoxContainerView.setPadding(mSearchBoxContainerView.getPaddingStart(), - mSearchBoxContainerView.getPaddingTop(), + mSearchBoxCoordinator.setVoiceSearchButtonVisibility(mManager.isVoiceSearchEnabled()); + View searchBoxContainerView = mSearchBoxCoordinator.getView(); + searchBoxContainerView.setPadding(searchBoxContainerView.getPaddingStart(), + searchBoxContainerView.getPaddingTop(), mManager.isVoiceSearchEnabled() ? 0 : mSearchBoxEndPadding, - mSearchBoxContainerView.getPaddingBottom()); + searchBoxContainerView.getPaddingBottom()); } @Override @@ -795,15 +786,15 @@ } } - private static int getMaxTileRows() { - return 2; + private int getMaxRowsForMostVisitedTiles() { + return mQueryTileSection != null && mQueryTileSection.shouldConsiderAsSmallScreen() ? 1 : 2; } /** * Determines The maximum number of tiles to try and fit in a row. On smaller screens, there * may not be enough space to fit all of them. */ - private int getMaxTileColumns() { + private int getMaxColumnsForMostVisitedTiles() { return 4; } @@ -854,12 +845,12 @@ @Override public void onEnterVr() { - mSearchBoxContainerView.setVisibility(GONE); + mSearchBoxCoordinator.setVisibility(false); } @Override public void onExitVr() { - mSearchBoxContainerView.setVisibility(VISIBLE); + mSearchBoxCoordinator.setVisibility(true); } private void onDestroy() { @@ -868,11 +859,11 @@ // Need to null-check compositor view holder and layout manager since they might've // been cleared by now. if (mOverviewObserver != null) { - mActivity.getOverviewModeBehavior().removeOverviewModeObserver(mOverviewObserver); + mOverviewModeBehavior.removeOverviewModeObserver(mOverviewObserver); mOverviewObserver = null; } - mSearchBoxContainerView.destroy(); + mSearchBoxCoordinator.destroy(); } /** @@ -881,8 +872,7 @@ private void unifyElementWidths() { if (mSiteSectionView.getVisibility() != GONE) { final int width = mSiteSectionView.getMeasuredWidth() - mTileGridLayoutBleed; - measureExactly( - mSearchBoxContainerView, width, mSearchBoxContainerView.getMeasuredHeight()); + measureExactly(getSearchBoxView(), width, getSearchBoxView().getMeasuredHeight()); measureExactly( mSearchProviderLogoView, width, mSearchProviderLogoView.getMeasuredHeight()); @@ -892,8 +882,8 @@ } } else if (mExploreSectionView != null) { final int exploreWidth = mExploreSectionView.getMeasuredWidth() - mTileGridLayoutBleed; - measureExactly(mSearchBoxContainerView, exploreWidth, - mSearchBoxContainerView.getMeasuredHeight()); + measureExactly( + getSearchBoxView(), exploreWidth, getSearchBoxView().getMeasuredHeight()); measureExactly(mSearchProviderLogoView, exploreWidth, mSearchProviderLogoView.getMeasuredHeight()); } @@ -901,7 +891,7 @@ private Runnable openDownloadHomeCallback() { return () -> { - DownloadUtils.showDownloadManager(mActivity, mActivity.getActivityTabProvider().get(), + DownloadUtils.showDownloadManager(mActivity, mTabProvider.get(), DownloadOpenSource.NEW_TAB_PAGE, true /*showPrefetchedContent*/); }; } @@ -914,89 +904,4 @@ view.measure(MeasureSpec.makeMeasureSpec(widthPx, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(heightPx, MeasureSpec.EXACTLY)); } - - /** - * Provides the additional capabilities needed for the SearchBox container layout. - */ - // TODO (crbug.com/1048813): MVC-ize SearchBoxContainerView. - public static class SearchBoxContainerView extends LinearLayout - implements Destroyable, NativeInitObserver, AssistantVoiceSearchService.Observer { - ImageView mVoiceSearchButton; - - private ActivityLifecycleDispatcher mActivityLifecycleDispatcher; - private AssistantVoiceSearchService mAssistantVoiceSearchService; - - /** Constructor for inflating from XML. */ - public SearchBoxContainerView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - /** - * Initializes the SearchBoxContainerView with the given params. This must be called for - * classes that use the SearchBoxContainerView. - * - * @param activityLifecycleDispatcher Used to register for lifecycle events. - */ - public void initialize(ActivityLifecycleDispatcher activityLifecycleDispatcher) { - mActivityLifecycleDispatcher = activityLifecycleDispatcher; - mActivityLifecycleDispatcher.register(this); - if (mActivityLifecycleDispatcher.isNativeInitializationFinished()) { - onFinishNativeInitialization(); - } - } - - @Override - public void destroy() { - if (mAssistantVoiceSearchService != null) { - mAssistantVoiceSearchService.destroy(); - mAssistantVoiceSearchService = null; - } - - if (mActivityLifecycleDispatcher != null) { - mActivityLifecycleDispatcher.unregister(this); - mActivityLifecycleDispatcher = null; - } - } - - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - - mVoiceSearchButton = findViewById(R.id.voice_search_button); - } - - @Override - public void onFinishNativeInitialization() { - mAssistantVoiceSearchService = new AssistantVoiceSearchService(getContext(), - ExternalAuthUtils.getInstance(), TemplateUrlServiceFactory.get(), - GSAState.getInstance(getContext()), this); - onAssistantVoiceSearchServiceChanged(); - } - - @Override - public boolean onInterceptTouchEvent(MotionEvent ev) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP - && ev.getActionMasked() == MotionEvent.ACTION_DOWN) { - if (getBackground() instanceof RippleDrawable) { - ((RippleDrawable) getBackground()).setHotspot(ev.getX(), ev.getY()); - } - } - return super.onInterceptTouchEvent(ev); - } - - @Override - public void onAssistantVoiceSearchServiceChanged() { - // Potential race condition between destroy and the observer, see crbug.com/1055274. - if (mAssistantVoiceSearchService == null) return; - - Drawable drawable = mAssistantVoiceSearchService.getCurrentMicDrawable(); - mVoiceSearchButton.setImageDrawable(drawable); - - final @ColorRes int primaryColor = ChromeColors.getDefaultThemeColor( - getResources(), /* forceDarkBgColor= */ false); - ColorStateList colorStateList = mAssistantVoiceSearchService.getMicButtonColorStateList( - primaryColor, getContext()); - ApiCompatibilityUtils.setImageTintList(mVoiceSearchButton, colorStateList); - } - } -} \ No newline at end of file +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java index 5e1f855..93282f6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.ntp; +import android.content.Intent; import android.os.SystemClock; import android.view.View; import android.view.ViewTreeObserver; @@ -13,7 +14,7 @@ import org.chromium.base.TimeUtils; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; -import org.chromium.chrome.browser.ChromeActivity; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.preferences.PrefServiceBridge; @@ -32,9 +33,7 @@ * Records UMA stats for which actions the user takes on the NTP in the * "NewTabPage.ActionAndroid2" histogram. */ -public final class NewTabPageUma { - private NewTabPageUma() {} - +public class NewTabPageUma { // Possible actions taken by the user on the NTP. These values are also defined in // enums.xml as NewTabPageActionAndroid2. // WARNING: these values must stay in sync with enums.xml. @@ -154,6 +153,26 @@ /** The number of load types. */ private static final int LOAD_TYPE_COUNT = 3; + private final TabModelSelector mTabModelSelector; + private final Supplier<Long> mLastInteractionTime; + private final boolean mActivityHadWarmStart; + private final Supplier<Intent> mActivityIntent; + + /** + * Constructor. + * @param tabModelSelector Tab model selector to observe tab creation event. + * @param lastInteractionTime The time user interacted with UI lastly. + * @param activityHadWarmStart {@code true} if the activity did a warm start. + * @param intent Supplier of the activity intent. + */ + public NewTabPageUma(TabModelSelector tabModelSelector, Supplier<Long> lastInteractionTime, + boolean activityHadWarmStart, Supplier<Intent> intent) { + mTabModelSelector = tabModelSelector; + mLastInteractionTime = lastInteractionTime; + mActivityHadWarmStart = activityHadWarmStart; + mActivityIntent = intent; + } + /** * Records an action taken by the user on the NTP. * @param action One of the ACTION_* values defined in this class. @@ -196,23 +215,22 @@ /** * Records how often new tabs with a NewTabPage are created. This helps to determine how often * users navigate back to already opened NTPs. - * @param tabModelSelector Model selector controlling the creation of new tabs. */ - public static void monitorNTPCreation(TabModelSelector tabModelSelector) { - tabModelSelector.addObserver(new TabCreationRecorder()); + public void monitorNTPCreation() { + mTabModelSelector.addObserver(new TabCreationRecorder()); } /** * Records the type of load for the NTP, such as cold or warm start. */ - public static void recordLoadType(ChromeActivity activity) { - if (activity.getLastUserInteractionTime() > 0) { + public void recordLoadType() { + if (mLastInteractionTime.get() > 0) { RecordHistogram.recordEnumeratedHistogram( "NewTabPage.LoadType", LOAD_TYPE_OTHER, LOAD_TYPE_COUNT); return; } - if (activity.hadWarmStart()) { + if (mActivityHadWarmStart) { RecordHistogram.recordEnumeratedHistogram( "NewTabPage.LoadType", LOAD_TYPE_WARM_START, LOAD_TYPE_COUNT); return; @@ -225,32 +243,23 @@ /** * Records the network status of the user. */ - public static void recordIsUserOnline() { + public void recordIsUserOnline() { RecordHistogram.recordBooleanHistogram( "NewTabPage.MobileIsUserOnline", NetworkChangeNotifier.isOnline()); } /** - * Records the time duration that the NTP was visible. - * @param lastShownTimeNs A long as returned by System#nanoTime() - this should have been - * called at the moment the new tab page is shown. - */ - public static void recordTimeSpentOnNtp(long lastShownTimeNs) { - RecordHistogram.recordMediumTimesHistogram("NewTabPage.TimeSpent", - (System.nanoTime() - lastShownTimeNs) / TimeUtils.NANOSECONDS_PER_MILLISECOND); - } - /** * Records how much time elapsed from start until the search box became available to the user. */ - public static void recordSearchAvailableLoadTime(ChromeActivity activity) { + public void recordSearchAvailableLoadTime() { // Log the time it took for the search box to be displayed at startup, based on the // timestamp on the intent for the activity. If the user has interacted with the // activity already, it's not a startup, and the timestamp on the activity would not be // relevant either. - if (activity.getLastUserInteractionTime() != 0) return; + if (mLastInteractionTime.get() != 0) return; long timeFromIntent = SystemClock.elapsedRealtime() - - IntentHandler.getTimestampFromIntent(activity.getIntent()); - if (activity.hadWarmStart()) { + - IntentHandler.getTimestampFromIntent(mActivityIntent.get()); + if (mActivityHadWarmStart) { RecordHistogram.recordMediumTimesHistogram( "NewTabPage.SearchAvailableLoadTime2.WarmStart", timeFromIntent); } else { @@ -274,7 +283,7 @@ * Records position of a prefetched article suggestion, which was seen by the user on the * suggestions surface when there was no network connection. */ - public static void recordPrefetchedArticleSuggestionImpressionPosition(int positionInSection) { + public void recordPrefetchedArticleSuggestionImpressionPosition(int positionInSection) { RecordHistogram.recordEnumeratedHistogram("NewTabPage.ContentSuggestions.Shown.Articles." + "Prefetched.Offline2", positionInSection, MAX_SUGGESTIONS_PER_SECTION); @@ -283,7 +292,7 @@ /** * Records Content Suggestions Display Status when NTPs opened. */ - public static void recordContentSuggestionsDisplayStatus() { + public void recordContentSuggestionsDisplayStatus() { @ContentSuggestionsDisplayStatus int status = ContentSuggestionsDisplayStatus.VISIBLE; if (!PrefServiceBridge.getInstance().getBoolean(Pref.NTP_ARTICLES_SECTION_ENABLED)) { @@ -317,7 +326,7 @@ * @param view The UI element to track. * @param constructedTimeNs The timestamp at which the new tab page's construction started. */ - public static void trackTimeToFirstDraw(View view, long constructedTimeNs) { + public void trackTimeToFirstDraw(View view, long constructedTimeNs) { // Use preDraw instead of draw because api level 25 and earlier doesn't seem to call the // onDraw listener. Also, the onDraw version cannot be removed inside of the // notification, which complicates this.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java index 7a1b1b94..7451c42 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
@@ -4,12 +4,14 @@ package org.chromium.chrome.browser.ntp; +import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.util.AttributeSet; import android.view.LayoutInflater; import android.widget.FrameLayout; +import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.RecyclerView; @@ -17,8 +19,8 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder; import org.chromium.base.TraceEvent; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; @@ -31,8 +33,6 @@ import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; import org.chromium.chrome.browser.suggestions.tile.TileGroup; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tab.TabImpl; -import org.chromium.chrome.browser.tab.TabUtils; import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; import org.chromium.components.browser_ui.widget.displaystyle.ViewResizer; import org.chromium.ui.base.ViewUtils; @@ -78,6 +78,12 @@ void focusSearchBox(boolean beginVoiceSearch, String pastedText); /** + * Performs a search query on the current {@link Tab}. + * @param query The {@link String} representing the query text. + */ + void performSearchQuery(String query); + + /** * @return whether the {@link NewTabPage} associated with this manager is the current page * displayed to the user. */ @@ -109,16 +115,23 @@ * * @param manager NewTabPageManager used to perform various actions when the user interacts * with the page. + * @param activity Activity associated with the tab and this new tab page. * @param tab The Tab that is showing this new tab page. + * @param tileGroupDelegate Delegate for {@link TileGroup}. * @param searchProviderHasLogo Whether the search provider has a logo. * @param searchProviderIsGoogle Whether the search provider is Google. * @param scrollPosition The adapter scroll position to initialize to. * @param constructedTimeNs The timestamp at which the new tab page's construction started. - * @param activityLifecycleDispatcher Allows us to subscribe to lifecycle events. + * @param tabProvider Provides the current active tab. + * @param lifecycleDispatcher Activity lifecycle dispatcher. + * @param overviewModeBehavior Overview mode to observe for mode changes. + * @param uma {@link NewTabPageUma} object recording user metrics. */ - public void initialize(NewTabPageManager manager, Tab tab, TileGroup.Delegate tileGroupDelegate, - boolean searchProviderHasLogo, boolean searchProviderIsGoogle, int scrollPosition, - long constructedTimeNs, ActivityLifecycleDispatcher activityLifecycleDispatcher) { + public void initialize(NewTabPageManager manager, Activity activity, Tab tab, + TileGroup.Delegate tileGroupDelegate, boolean searchProviderHasLogo, + boolean searchProviderIsGoogle, int scrollPosition, long constructedTimeNs, + Supplier<Tab> tabProvider, ActivityLifecycleDispatcher lifecycleDispatcher, + @Nullable OverviewModeBehavior overviewModeBehavior, NewTabPageUma uma) { TraceEvent.begin(TAG + ".initialize()"); mTab = tab; mManager = manager; @@ -126,22 +139,17 @@ assert manager.getSuggestionsSource() != null; - Runnable closeContextMenuCallback = TabUtils.getActivity(tab)::closeContextMenu; + Runnable closeContextMenuCallback = activity::closeContextMenu; mContextMenuManager = new ContextMenuManager(mManager.getNavigationDelegate(), mRecyclerView::setTouchEnabled, closeContextMenuCallback, NewTabPage.CONTEXT_MENU_USER_ACTION_PREFIX); mTab.getWindowAndroid().addContextMenuCloseListener(mContextMenuManager); - OverviewModeBehavior overviewModeBehavior = - ((TabImpl) tab).getActivity() instanceof ChromeTabbedActivity - ? ((TabImpl) tab).getActivity().getOverviewModeBehavior() - : null; + mNewTabPageLayout.initialize(manager, activity, tileGroupDelegate, searchProviderHasLogo, + searchProviderIsGoogle, mRecyclerView, mContextMenuManager, mUiConfig, tabProvider, + lifecycleDispatcher, overviewModeBehavior, uma); - mNewTabPageLayout.initialize(manager, ((TabImpl) tab).getActivity(), overviewModeBehavior, - tileGroupDelegate, searchProviderHasLogo, searchProviderIsGoogle, mRecyclerView, - mContextMenuManager, mUiConfig, activityLifecycleDispatcher); - - NewTabPageUma.trackTimeToFirstDraw(this, constructedTimeNs); + uma.trackTimeToFirstDraw(this, constructedTimeNs); mSnapScrollHelper = new SnapScrollHelper(mManager, mNewTabPageLayout); mSnapScrollHelper.setView(mRecyclerView); @@ -192,8 +200,8 @@ mRecyclerView.init(mUiConfig, closeContextMenuCallback); // Set up snippets - NewTabPageAdapter newTabPageAdapter = new NewTabPageAdapter( - mManager, mNewTabPageLayout, mUiConfig, offlinePageBridge, mContextMenuManager); + NewTabPageAdapter newTabPageAdapter = new NewTabPageAdapter(mManager, mNewTabPageLayout, + mUiConfig, offlinePageBridge, mContextMenuManager, uma); newTabPageAdapter.refreshSuggestions(); mRecyclerView.setAdapter(newTabPageAdapter); mRecyclerView.getLinearLayoutManager().scrollToPosition(scrollPosition);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java index 783d826..ad412d9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
@@ -17,6 +17,7 @@ import org.chromium.base.task.PostTask; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.native_page.ContextMenuManager; +import org.chromium.chrome.browser.ntp.NewTabPageUma; import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.PartialBindCallback; import org.chromium.chrome.browser.ntp.snippets.CategoryInt; import org.chromium.chrome.browser.ntp.snippets.CategoryStatus; @@ -62,6 +63,8 @@ private final RemoteSuggestionsStatusObserver mRemoteSuggestionsStatusObserver; + private final NewTabPageUma mNewTabPageUma; + // Used to track if the NTP has loaded or not. This assumes that there's only one // NewTabPageAdapter per NTP. This does not fully tear down even when the main activity is // destroyed. This is actually convenient in mimicking the current behavior of @@ -78,11 +81,12 @@ * @param uiConfig the NTP UI configuration, to be passed to created views. * @param offlinePageBridge used to determine if articles are available. * @param contextMenuManager used to build context menus. + * @param uma {@link NewTabPageUma} object recording user metrics. */ public NewTabPageAdapter(SuggestionsUiDelegate uiDelegate, @Nullable View aboveTheFoldView, UiConfig uiConfig, OfflinePageBridge offlinePageBridge, - ContextMenuManager contextMenuManager) { - this(uiDelegate, aboveTheFoldView, uiConfig, offlinePageBridge, contextMenuManager, + ContextMenuManager contextMenuManager, NewTabPageUma uma) { + this(uiDelegate, aboveTheFoldView, uiConfig, offlinePageBridge, contextMenuManager, uma, IdentityServicesProvider.get().getSigninManager()); } @@ -96,12 +100,13 @@ * @param uiConfig the NTP UI configuration, to be passed to created views. * @param offlinePageBridge used to determine if articles are available. * @param contextMenuManager used to build context menus. + * @param uma {@link NewTabPageUma} object recording user metrics. * @param signinManager used by SectionList for SignInPromo. */ @VisibleForTesting public NewTabPageAdapter(SuggestionsUiDelegate uiDelegate, @Nullable View aboveTheFoldView, UiConfig uiConfig, OfflinePageBridge offlinePageBridge, - ContextMenuManager contextMenuManager, SigninManager signinManager) { + ContextMenuManager contextMenuManager, NewTabPageUma uma, SigninManager signinManager) { mUiDelegate = uiDelegate; mContextMenuManager = contextMenuManager; @@ -109,6 +114,7 @@ mUiConfig = uiConfig; mRoot = new InnerNode<>(); mSections = new SectionList(mUiDelegate, offlinePageBridge, signinManager); + mNewTabPageUma = uma; if (mAboveTheFoldView != null) mRoot.addChildren(new AboveTheFoldItem()); mFooter = new Footer(); @@ -159,7 +165,7 @@ case ItemViewType.SNIPPET: return new SnippetArticleViewHolder(mRecyclerView, mContextMenuManager, mUiDelegate, - mUiConfig, mOfflinePageBridge); + mUiConfig, mOfflinePageBridge, mNewTabPageUma); case ItemViewType.STATUS: return new StatusCardViewHolder(mRecyclerView, mContextMenuManager, mUiConfig);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxContainerView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxContainerView.java new file mode 100644 index 0000000..da34d759 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxContainerView.java
@@ -0,0 +1,33 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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.ntp.search; + +import android.content.Context; +import android.graphics.drawable.RippleDrawable; +import android.os.Build; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.widget.LinearLayout; + +/** + * Provides the additional capabilities needed for the SearchBox container layout. + */ +public class SearchBoxContainerView extends LinearLayout { + /** Constructor for inflating from XML. */ + public SearchBoxContainerView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + public boolean onInterceptTouchEvent(MotionEvent ev) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP + && ev.getActionMasked() == MotionEvent.ACTION_DOWN) { + if (getBackground() instanceof RippleDrawable) { + ((RippleDrawable) getBackground()).setHotspot(ev.getX(), ev.getY()); + } + } + return super.onInterceptTouchEvent(ev); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxCoordinator.java new file mode 100644 index 0000000..b0641ee3 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxCoordinator.java
@@ -0,0 +1,82 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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.ntp.search; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.text.TextWatcher; +import android.view.View; +import android.view.View.OnClickListener; +import android.view.ViewGroup; + +import org.chromium.chrome.R; +import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; +import org.chromium.ui.modelutil.PropertyModel; + +/** + * This class is responsible for reacting to events from the outside world, interacting with other + * coordinators, running most of the business logic associated with the fake search box component, + * and updating the model accordingly. + */ +public class SearchBoxCoordinator { + private final PropertyModel mModel; + private final ViewGroup mView; + private final SearchBoxMediator mMediator; + + /** Constructor. */ + public SearchBoxCoordinator(Context context, ViewGroup parent) { + mModel = new PropertyModel(SearchBoxProperties.ALL_KEYS); + mView = parent.findViewById(R.id.search_box); + mMediator = new SearchBoxMediator(context, mModel, mView); + } + + public void initialize(ActivityLifecycleDispatcher activityLifecycleDispatcher) { + mMediator.initialize(activityLifecycleDispatcher); + } + + public View getView() { + return mView; + } + + public void destroy() { + mMediator.destroy(); + } + + public void setAlpha(float alpha) { + mModel.set(SearchBoxProperties.ALPHA, alpha); + } + + public void setBackground(Drawable background) { + mModel.set(SearchBoxProperties.BACKGROUND, background); + } + + public void setVisibility(boolean visible) { + mModel.set(SearchBoxProperties.VISIBILITY, visible); + } + + public void setSearchText(String text) { + mModel.set(SearchBoxProperties.SEARCH_TEXT, text); + } + + public void setSearchBoxClickListener(OnClickListener listener) { + mModel.set(SearchBoxProperties.SEARCH_BOX_CLICK_CALLBACK, listener); + } + + public void setSearchBoxTextWatcher(TextWatcher textWatcher) { + mModel.set(SearchBoxProperties.SEARCH_BOX_TEXT_WATCHER, textWatcher); + } + + public void setSearchBoxHintColor(int hintTextColor) { + mModel.set(SearchBoxProperties.SEARCH_BOX_HINT_COLOR, hintTextColor); + } + + public void setVoiceSearchButtonVisibility(boolean visible) { + mModel.set(SearchBoxProperties.VOICE_SEARCH_VISIBILITY, visible); + } + + public void setVoiceSearchButtonClickListener(OnClickListener listener) { + mModel.set(SearchBoxProperties.VOICE_SEARCH_CLICK_CALLBACK, listener); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxMediator.java new file mode 100644 index 0000000..61cce7e2 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxMediator.java
@@ -0,0 +1,91 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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.ntp.search; + +import android.content.Context; +import android.content.res.ColorStateList; +import android.graphics.drawable.Drawable; +import android.view.ViewGroup; + +import androidx.annotation.ColorRes; + +import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; +import org.chromium.chrome.browser.gsa.GSAState; +import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; +import org.chromium.chrome.browser.lifecycle.Destroyable; +import org.chromium.chrome.browser.lifecycle.NativeInitObserver; +import org.chromium.chrome.browser.omnibox.voice.AssistantVoiceSearchService; +import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; +import org.chromium.components.browser_ui.styles.ChromeColors; +import org.chromium.ui.modelutil.PropertyModel; +import org.chromium.ui.modelutil.PropertyModelChangeProcessor; + +class SearchBoxMediator + implements Destroyable, NativeInitObserver, AssistantVoiceSearchService.Observer { + private final Context mContext; + private final PropertyModel mModel; + private final ViewGroup mView; + private ActivityLifecycleDispatcher mActivityLifecycleDispatcher; + private AssistantVoiceSearchService mAssistantVoiceSearchService; + + public SearchBoxMediator(Context context, PropertyModel model, ViewGroup view) { + mContext = context; + mModel = model; + mView = view; + + PropertyModelChangeProcessor.create(mModel, mView, new SearchBoxViewBinder()); + } + + /** + * Initializes the SearchBoxContainerView with the given params. This must be called for + * classes that use the SearchBoxContainerView. + * + * @param activityLifecycleDispatcher Used to register for lifecycle events. + */ + public void initialize(ActivityLifecycleDispatcher activityLifecycleDispatcher) { + assert mActivityLifecycleDispatcher == null; + mActivityLifecycleDispatcher = activityLifecycleDispatcher; + mActivityLifecycleDispatcher.register(this); + if (mActivityLifecycleDispatcher.isNativeInitializationFinished()) { + onFinishNativeInitialization(); + } + } + + @Override + public void destroy() { + if (mAssistantVoiceSearchService != null) { + mAssistantVoiceSearchService.destroy(); + mAssistantVoiceSearchService = null; + } + + if (mActivityLifecycleDispatcher != null) { + mActivityLifecycleDispatcher.unregister(this); + mActivityLifecycleDispatcher = null; + } + } + + @Override + public void onFinishNativeInitialization() { + mAssistantVoiceSearchService = + new AssistantVoiceSearchService(mContext, ExternalAuthUtils.getInstance(), + TemplateUrlServiceFactory.get(), GSAState.getInstance(mContext), this); + onAssistantVoiceSearchServiceChanged(); + } + + @Override + public void onAssistantVoiceSearchServiceChanged() { + // Potential race condition between destroy and the observer, see crbug.com/1055274. + if (mAssistantVoiceSearchService == null) return; + + Drawable drawable = mAssistantVoiceSearchService.getCurrentMicDrawable(); + mModel.set(SearchBoxProperties.VOICE_SEARCH_DRAWABLE, drawable); + + final @ColorRes int primaryColor = ChromeColors.getDefaultThemeColor( + mContext.getResources(), false /* forceDarkBgColor= */); + ColorStateList colorStateList = + mAssistantVoiceSearchService.getMicButtonColorStateList(primaryColor, mContext); + mModel.set(SearchBoxProperties.VOICE_SEARCH_COLOR_STATE_LIST, colorStateList); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxProperties.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxProperties.java new file mode 100644 index 0000000..d3ce63b --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxProperties.java
@@ -0,0 +1,42 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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.ntp.search; + +import android.content.res.ColorStateList; +import android.graphics.drawable.Drawable; +import android.text.TextWatcher; +import android.view.View.OnClickListener; + +import org.chromium.ui.modelutil.PropertyKey; +import org.chromium.ui.modelutil.PropertyModel.WritableBooleanPropertyKey; +import org.chromium.ui.modelutil.PropertyModel.WritableFloatPropertyKey; +import org.chromium.ui.modelutil.PropertyModel.WritableIntPropertyKey; +import org.chromium.ui.modelutil.PropertyModel.WritableObjectPropertyKey; + +/** + * The properties required to build the fake search box on new tab page. + */ +interface SearchBoxProperties { + WritableFloatPropertyKey ALPHA = new WritableFloatPropertyKey(); + WritableObjectPropertyKey<Drawable> BACKGROUND = new WritableObjectPropertyKey<>(); + WritableBooleanPropertyKey VISIBILITY = new WritableBooleanPropertyKey(); + WritableBooleanPropertyKey VOICE_SEARCH_VISIBILITY = new WritableBooleanPropertyKey(); + WritableObjectPropertyKey<Drawable> VOICE_SEARCH_DRAWABLE = new WritableObjectPropertyKey<>(); + WritableObjectPropertyKey<ColorStateList> VOICE_SEARCH_COLOR_STATE_LIST = + new WritableObjectPropertyKey<>(); + WritableObjectPropertyKey<OnClickListener> VOICE_SEARCH_CLICK_CALLBACK = + new WritableObjectPropertyKey<>(); + WritableObjectPropertyKey<String> SEARCH_TEXT = new WritableObjectPropertyKey<>(); + WritableObjectPropertyKey<OnClickListener> SEARCH_BOX_CLICK_CALLBACK = + new WritableObjectPropertyKey<>(); + WritableObjectPropertyKey<TextWatcher> SEARCH_BOX_TEXT_WATCHER = + new WritableObjectPropertyKey<>(); + WritableIntPropertyKey SEARCH_BOX_HINT_COLOR = new WritableIntPropertyKey(); + + PropertyKey[] ALL_KEYS = new PropertyKey[] {ALPHA, BACKGROUND, VISIBILITY, + VOICE_SEARCH_VISIBILITY, VOICE_SEARCH_DRAWABLE, VOICE_SEARCH_COLOR_STATE_LIST, + VOICE_SEARCH_CLICK_CALLBACK, SEARCH_TEXT, SEARCH_BOX_CLICK_CALLBACK, + SEARCH_BOX_TEXT_WATCHER, SEARCH_BOX_HINT_COLOR}; +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxViewBinder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxViewBinder.java new file mode 100644 index 0000000..dff4481 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxViewBinder.java
@@ -0,0 +1,68 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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.ntp.search; + +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.ui.base.ViewUtils; +import org.chromium.ui.modelutil.PropertyKey; +import org.chromium.ui.modelutil.PropertyModel; +import org.chromium.ui.modelutil.PropertyModelChangeProcessor; + +/** + * Responsible for building and setting properties on the search box on new tab page. + */ +class SearchBoxViewBinder + implements PropertyModelChangeProcessor.ViewBinder<PropertyModel, View, PropertyKey> { + @Override + public final void bind(PropertyModel model, View view, PropertyKey propertyKey) { + ImageView voiceSearchButton = + view.findViewById(org.chromium.chrome.R.id.voice_search_button); + View searchBoxContainer = view; + final TextView searchBoxTextView = + searchBoxContainer.findViewById(org.chromium.chrome.R.id.search_box_text); + + if (SearchBoxProperties.VISIBILITY == propertyKey) { + searchBoxContainer.setVisibility( + model.get(SearchBoxProperties.VISIBILITY) ? View.VISIBLE : View.GONE); + } else if (SearchBoxProperties.ALPHA == propertyKey) { + searchBoxContainer.setAlpha(model.get(SearchBoxProperties.ALPHA)); + // Disable the search box contents if it is the process of being animated away. + ViewUtils.setEnabledRecursive( + searchBoxContainer, searchBoxContainer.getAlpha() == 1.0f); + } else if (SearchBoxProperties.BACKGROUND == propertyKey) { + searchBoxContainer.setBackground(model.get(SearchBoxProperties.BACKGROUND)); + } else if (SearchBoxProperties.VOICE_SEARCH_COLOR_STATE_LIST == propertyKey) { + ApiCompatibilityUtils.setImageTintList(voiceSearchButton, + model.get(SearchBoxProperties.VOICE_SEARCH_COLOR_STATE_LIST)); + } else if (SearchBoxProperties.VOICE_SEARCH_DRAWABLE == propertyKey) { + voiceSearchButton.setImageDrawable( + model.get(SearchBoxProperties.VOICE_SEARCH_DRAWABLE)); + } else if (SearchBoxProperties.VOICE_SEARCH_VISIBILITY == propertyKey) { + voiceSearchButton.setVisibility(model.get(SearchBoxProperties.VOICE_SEARCH_VISIBILITY) + ? View.VISIBLE + : View.GONE); + } else if (SearchBoxProperties.SEARCH_BOX_CLICK_CALLBACK == propertyKey) { + searchBoxTextView.setOnClickListener( + model.get(SearchBoxProperties.SEARCH_BOX_CLICK_CALLBACK)); + } else if (SearchBoxProperties.SEARCH_BOX_TEXT_WATCHER == propertyKey) { + searchBoxTextView.addTextChangedListener( + model.get(SearchBoxProperties.SEARCH_BOX_TEXT_WATCHER)); + } else if (SearchBoxProperties.SEARCH_TEXT == propertyKey) { + searchBoxTextView.setText(model.get(SearchBoxProperties.SEARCH_TEXT)); + } else if (SearchBoxProperties.VOICE_SEARCH_CLICK_CALLBACK == propertyKey) { + voiceSearchButton.setOnClickListener( + model.get(SearchBoxProperties.VOICE_SEARCH_CLICK_CALLBACK)); + } else if (SearchBoxProperties.SEARCH_BOX_HINT_COLOR == propertyKey) { + searchBoxTextView.setHintTextColor( + model.get(SearchBoxProperties.SEARCH_BOX_HINT_COLOR)); + } else { + assert false : "Unhandled property detected in SearchBoxViewBinder!"; + } + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java index ee24ef7..73bfc00 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
@@ -33,6 +33,7 @@ private final SuggestionsUiDelegate mUiDelegate; private final SuggestionsBinder mSuggestionsBinder; private final OfflinePageBridge mOfflinePageBridge; + private final NewTabPageUma mNewTabPageUma; private SuggestionsCategoryInfo mCategoryInfo; private SnippetArticle mArticle; @@ -46,11 +47,12 @@ * @param uiDelegate The delegate object used to open an article, fetch thumbnails, etc. * @param uiConfig The NTP UI configuration object used to adjust the article UI. * @param offlinePageBridge used to determine if article is prefetched. + * @param uma {@link NewTabPageUma} object recording user metrics. */ public SnippetArticleViewHolder(SuggestionsRecyclerView parent, ContextMenuManager contextMenuManager, SuggestionsUiDelegate uiDelegate, - UiConfig uiConfig, OfflinePageBridge offlinePageBridge) { - this(parent, contextMenuManager, uiDelegate, uiConfig, offlinePageBridge, getLayout()); + UiConfig uiConfig, OfflinePageBridge offlinePageBridge, NewTabPageUma uma) { + this(parent, contextMenuManager, uiDelegate, uiConfig, offlinePageBridge, uma, getLayout()); } /** @@ -60,11 +62,13 @@ * @param uiDelegate The delegate object used to open an article, fetch thumbnails, etc. * @param uiConfig The NTP UI configuration object used to adjust the article UI. * @param offlinePageBridge used to determine if article is prefetched. + * @param uma {@link NewTabPageUma} object recording user metrics. * @param layoutId The layout resource reference for this card. */ protected SnippetArticleViewHolder(SuggestionsRecyclerView parent, ContextMenuManager contextMenuManager, SuggestionsUiDelegate uiDelegate, - UiConfig uiConfig, OfflinePageBridge offlinePageBridge, int layoutId) { + UiConfig uiConfig, OfflinePageBridge offlinePageBridge, NewTabPageUma uma, + int layoutId) { super(layoutId, parent, uiConfig, contextMenuManager); mUiDelegate = uiDelegate; @@ -76,6 +80,7 @@ mExposureTracker = new ImpressionTracker(itemView); mExposureTracker.setImpressionThreshold(/* impressionThresholdPx */ 1); + mNewTabPageUma = uma; } @Override @@ -237,7 +242,7 @@ if (!SuggestionsOfflineModelObserver.isPrefetchedOfflinePage(item)) { return; } - NewTabPageUma.recordPrefetchedArticleSuggestionImpressionPosition( + mNewTabPageUma.recordPrefetchedArticleSuggestionImpressionPosition( mArticle.getPerSectionRank()); }); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java index 1b4b961..9c4f4e4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
@@ -66,7 +66,6 @@ import org.chromium.chrome.browser.util.AccessibilityUtil; import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.components.browser_ui.widget.CompositeTouchDelegate; -import org.chromium.components.search_engines.TemplateUrlService; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.common.ResourceRequestBody; import org.chromium.ui.base.DeviceFormFactor; @@ -730,14 +729,8 @@ // When we restore tabs, we focus the selected tab so the URL of the page shows. } - /** - * Performs a search query on the current {@link Tab}. This calls - * {@link TemplateUrlService#getUrlForSearchQuery(String)} to get a url based on {@code query} - * and loads that url in the current {@link Tab}. - * @param query The {@link String} that represents the text query that should be searched for. - */ - @VisibleForTesting - public void performSearchQueryForTest(String query) { + @Override + public void performSearchQuery(String query) { if (TextUtils.isEmpty(query)) return; String queryUrl = TemplateUrlServiceFactory.get().getUrlForSearchQuery(query);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/query_tiles/QueryTileSection.java b/chrome/android/java/src/org/chromium/chrome/browser/query_tiles/QueryTileSection.java index fbdcc9c..7f8ef90e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/query_tiles/QueryTileSection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/query_tiles/QueryTileSection.java
@@ -8,11 +8,13 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; -import android.widget.TextView; import org.chromium.base.Callback; import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.ntp.search.SearchBoxCoordinator; import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.ui.display.DisplayAndroid; +import org.chromium.ui.display.DisplayUtil; import java.util.List; @@ -22,17 +24,24 @@ * section. */ public class QueryTileSection { + private static final String QUERY_TILES_SHORTEN_MOST_VISITED_TILES_FOR_SMALL_SCREEN = + "shorten_most_visited_tiles_for_small_screen"; + private static final int SMALL_SCREEN_HEIGHT_THRESHOLD_DP = 600; + private final ViewGroup mQueryTileSectionView; - private final TextView mSearchBox; + private final SearchBoxCoordinator mSearchBoxCoordinator; + private final Callback<String> mSubmitQueryCallback; private QueryTileCoordinator mQueryTileCoordinator; private TileProvider mTileProvider; /** Constructor. */ - public QueryTileSection( - ViewGroup queryTileSectionView, TextView searchTextView, Profile profile) { + public QueryTileSection(ViewGroup queryTileSectionView, + SearchBoxCoordinator searchBoxCoordinator, Profile profile, + Callback<String> performSearchQueryCallback) { mQueryTileSectionView = queryTileSectionView; - mSearchBox = searchTextView; - if (!ChromeFeatureList.isEnabled(ChromeFeatureList.QUERY_TILES)) return; + mSearchBoxCoordinator = searchBoxCoordinator; + mSubmitQueryCallback = performSearchQueryCallback; + if (!isFeatureEnabled()) return; mTileProvider = TileProviderFactory.getForProfile(profile); mQueryTileCoordinator = QueryTileCoordinatorFactory.create( @@ -43,15 +52,46 @@ } private void onTileClicked(Tile tile) { - mTileProvider.getQueryTiles(tiles -> { - mQueryTileCoordinator.setTiles(tiles); - mQueryTileSectionView.setVisibility(tiles.isEmpty() ? View.GONE : View.VISIBLE); - }); + if (tile == null) { + mTileProvider.getQueryTiles(this::setTiles); + } else { + boolean isLastLevelTile = tile.children.isEmpty(); + setTiles(tile.children); + if (isLastLevelTile) { + mSubmitQueryCallback.onResult(tile.queryText); + } else { + // TODO(shaktisahu): Show chip on fakebox; + } + } + } - if (tile != null) mSearchBox.setText(tile.queryText); + private void setTiles(List<Tile> tiles) { + mQueryTileCoordinator.setTiles(tiles); + mQueryTileSectionView.setVisibility(tiles.isEmpty() ? View.GONE : View.VISIBLE); } private void getVisuals(Tile tile, Callback<List<Bitmap>> callback) { mTileProvider.getVisuals(tile.id, callback); } -} \ No newline at end of file + + /** + * @return Whether the screen height is small. Used for shortening the most visited tiles + * section on NTP so that feed is still visible above the fold. + */ + public boolean shouldConsiderAsSmallScreen() { + if (!isFeatureEnabled()) return false; + boolean shortenMostVisitedTiles = ChromeFeatureList.getFieldTrialParamByFeatureAsBoolean( + ChromeFeatureList.QUERY_TILES, + QUERY_TILES_SHORTEN_MOST_VISITED_TILES_FOR_SMALL_SCREEN, false); + if (!shortenMostVisitedTiles) return false; + + DisplayAndroid display = + DisplayAndroid.getNonMultiDisplay(mQueryTileSectionView.getContext()); + int screenHeightDp = DisplayUtil.pxToDp(display, display.getDisplayHeight()); + return screenHeightDp < SMALL_SCREEN_HEIGHT_THRESHOLD_DP; + } + + private static boolean isFeatureEnabled() { + return ChromeFeatureList.isEnabled(ChromeFeatureList.QUERY_TILES); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java index 7ff7b7a..4d39bc0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
@@ -31,6 +31,7 @@ import org.chromium.chrome.browser.init.AsyncInitializationActivity; import org.chromium.chrome.browser.init.SingleWindowKeyboardVisibilityDelegate; import org.chromium.chrome.browser.locale.LocaleManager; +import org.chromium.chrome.browser.native_page.NativePageFactory; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabBuilder; import org.chromium.chrome.browser.tab.TabDelegateFactory; @@ -219,6 +220,12 @@ Tab tab) { return null; } + + @Override + public NativePageFactory getNativePageFactory() { + // SearchActivity does not create native pages. + return null; + } }; mTab = new TabBuilder() .setWindow(getWindowAndroid())
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/ProfileDataCache.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/ProfileDataCache.java index fc1f258..a0fb79f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/ProfileDataCache.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/ProfileDataCache.java
@@ -19,6 +19,7 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; +import androidx.annotation.DrawableRes; import androidx.annotation.MainThread; import androidx.annotation.Nullable; import androidx.annotation.Px; @@ -58,30 +59,36 @@ * a user avatar. */ public static class BadgeConfig { - private final Bitmap mBadge; + private final Drawable mBadge; + private final int mBadgeSize; private final Point mPosition; private final int mBorderSize; /** - * @param badge Square badge bitmap to overlay on user avatar. Will be cropped to a circular - * one while overlaying. + * @param badge Square badge drawable to overlay on user avatar. Will be cropped to a + * circular one while overlaying. + * @param badgeSize Size of a side the square badge * @param position Position of top left corner of a badge relative to top left corner of * avatar. * @param borderSize Size of a transparent border around badge. */ - public BadgeConfig(Bitmap badge, Point position, int borderSize) { - assert badge.getHeight() == badge.getWidth(); + public BadgeConfig(Drawable badge, int badgeSize, Point position, int borderSize) { assert position != null; mBadge = badge; + mBadgeSize = badgeSize; mPosition = position; mBorderSize = borderSize; } - Bitmap getBadge() { + Drawable getBadge() { return mBadge; } + int getBadgeSize() { + return mBadgeSize; + } + Point getPosition() { return mPosition; } @@ -245,6 +252,40 @@ return new BitmapDrawable(resources, output); } + /** + * Returns a profile data cache object with the badgeResId provided. The badge is put with + * respect to R.dimen.user_picture_size. So this method only works with the user avatar of this + * size. + * @param context Context of the application to extract resources from + * @param badgeResId Resource id of the badge to be attached. If it is 0 then no badge is + * attached + */ + public static ProfileDataCache createProfileDataCache( + Context context, @DrawableRes int badgeResId) { + return createProfileDataCache(context, badgeResId, + AccountManagerFacadeProvider.getInstance().getProfileDataSource()); + } + + @VisibleForTesting + static ProfileDataCache createProfileDataCache( + Context context, @DrawableRes int badgeResId, ProfileDataSource profileDataSource) { + Resources resources = context.getResources(); + int userPictureSize = resources.getDimensionPixelSize(R.dimen.user_picture_size); + if (badgeResId == 0) { + return new ProfileDataCache(context, userPictureSize, null, profileDataSource); + } + + Drawable badge = AppCompatResources.getDrawable(context, badgeResId); + int badgePositionX = resources.getDimensionPixelOffset(R.dimen.badge_position_x); + int badgePositionY = resources.getDimensionPixelOffset(R.dimen.badge_position_y); + int badgeBorderSize = resources.getDimensionPixelSize(R.dimen.badge_border_size); + int badgeSize = resources.getDimensionPixelSize(R.dimen.badge_size); + return new ProfileDataCache(context, userPictureSize, + new BadgeConfig(badge, badgeSize, new Point(badgePositionX, badgePositionY), + badgeBorderSize), + profileDataSource); + } + private Drawable prepareAvatar(Bitmap bitmap) { Drawable croppedAvatar = bitmap != null ? makeRoundAvatar(mContext.getResources(), bitmap, mImageSize) @@ -256,7 +297,7 @@ } private Drawable overlayBadgeOnUserPicture(Drawable userPicture) { - int badgeSize = mBadgeConfig.getBadge().getHeight(); + int badgeSize = mBadgeConfig.getBadgeSize(); int badgedPictureWidth = Math.max(mBadgeConfig.getPosition().x + badgeSize, mImageSize); int badgedPictureHeight = Math.max(mBadgeConfig.getPosition().y + badgeSize, mImageSize); Bitmap badgedPicture = Bitmap.createBitmap( @@ -277,8 +318,10 @@ badgeCenterX, badgeCenterY, badgeRadius + mBadgeConfig.getBorderSize(), paint); // Draw the badge - canvas.drawBitmap(mBadgeConfig.getBadge(), mBadgeConfig.getPosition().x, - mBadgeConfig.getPosition().y, null); + Drawable badge = mBadgeConfig.getBadge(); + badge.setBounds(mBadgeConfig.getPosition().x, mBadgeConfig.getPosition().y, + mBadgeConfig.getPosition().x + badgeSize, mBadgeConfig.getPosition().y + badgeSize); + badge.draw(canvas); return new BitmapDrawable(mContext.getResources(), badgedPicture); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragmentBase.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragmentBase.java index 7e38097c..a1754a5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragmentBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragmentBase.java
@@ -7,9 +7,6 @@ import android.accounts.AccountManager; import android.app.Activity; import android.content.Intent; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Point; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.SystemClock; @@ -221,18 +218,9 @@ mConsentTextTracker = new ConsentTextTracker(getResources()); - ProfileDataCache.BadgeConfig badgeConfig = null; - if (ChildAccountStatus.isChild(mChildAccountStatus)) { - Bitmap badge = - BitmapFactory.decodeResource(getResources(), R.drawable.ic_account_child_20dp); - int badgePositionX = getResources().getDimensionPixelOffset(R.dimen.badge_position_x); - int badgePositionY = getResources().getDimensionPixelOffset(R.dimen.badge_position_y); - int badgeBorderSize = getResources().getDimensionPixelSize(R.dimen.badge_border_size); - badgeConfig = new ProfileDataCache.BadgeConfig( - badge, new Point(badgePositionX, badgePositionY), badgeBorderSize); - } - mProfileDataCache = new ProfileDataCache(getActivity(), - getResources().getDimensionPixelSize(R.dimen.user_picture_size), badgeConfig); + mProfileDataCache = ProfileDataCache.createProfileDataCache(getActivity(), + ChildAccountStatus.isChild(mChildAccountStatus) ? R.drawable.ic_account_child_20dp + : 0); // By default this is set to true so that when system back button is pressed user action // is recorded in onDestroy(). mRecordUndoSignin = true;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java index a871575..df8595a6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
@@ -4,7 +4,8 @@ package org.chromium.chrome.browser.suggestions; -import org.chromium.chrome.browser.ChromeActivity; +import android.app.Activity; + import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.native_page.NativePageNavigationDelegateImpl; import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; @@ -29,8 +30,8 @@ public class SuggestionsNavigationDelegate extends NativePageNavigationDelegateImpl { private static final String NEW_TAB_URL_HELP = "https://support.google.com/chrome/?p=new_tab"; - public SuggestionsNavigationDelegate(ChromeActivity activity, Profile profile, - NativePageHost host, TabModelSelector tabModelSelector, Tab tab) { + public SuggestionsNavigationDelegate(Activity activity, Profile profile, NativePageHost host, + TabModelSelector tabModelSelector, Tab tab) { super(activity, profile, host, tabModelSelector, tab); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/tile/TileGroupDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/tile/TileGroupDelegateImpl.java index edee3a2..3617dd2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/tile/TileGroupDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/tile/TileGroupDelegateImpl.java
@@ -9,7 +9,6 @@ import org.chromium.base.Callback; import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ntp.NewTabPageUma; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.suggestions.SuggestionsDependencyFactory; @@ -36,9 +35,9 @@ private boolean mIsDestroyed; private SnackbarController mTileRemovedSnackbarController; - public TileGroupDelegateImpl(ChromeActivity activity, Profile profile, + public TileGroupDelegateImpl(Context context, Profile profile, SuggestionsNavigationDelegate navigationDelegate, SnackbarManager snackbarManager) { - mContext = activity; + mContext = context; mSnackbarManager = snackbarManager; mNavigationDelegate = navigationDelegate; mMostVisitedSites =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/AccountManagementFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/AccountManagementFragment.java index f6f73b7..4723752 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/AccountManagementFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/AccountManagementFragment.java
@@ -10,9 +10,6 @@ import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Point; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.os.Build; @@ -112,18 +109,8 @@ SigninUtils.logEvent(ProfileAccountManagementMetrics.VIEW, mGaiaServiceType); - int avatarImageSize = getResources().getDimensionPixelSize(R.dimen.user_picture_size); - ProfileDataCache.BadgeConfig badgeConfig = null; - if (mProfile.isChild()) { - Bitmap badge = - BitmapFactory.decodeResource(getResources(), R.drawable.ic_account_child_20dp); - int badgePositionX = getResources().getDimensionPixelOffset(R.dimen.badge_position_x); - int badgePositionY = getResources().getDimensionPixelOffset(R.dimen.badge_position_y); - int badgeBorderSize = getResources().getDimensionPixelSize(R.dimen.badge_border_size); - badgeConfig = new ProfileDataCache.BadgeConfig( - badge, new Point(badgePositionX, badgePositionY), badgeBorderSize); - } - mProfileDataCache = new ProfileDataCache(getActivity(), avatarImageSize, badgeConfig); + mProfileDataCache = ProfileDataCache.createProfileDataCache( + getActivity(), mProfile.isChild() ? R.drawable.ic_account_child_20dp : 0); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/DEPS b/chrome/android/java/src/org/chromium/chrome/browser/tab/DEPS index 904009f..ae773c6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/DEPS +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/DEPS
@@ -20,6 +20,7 @@ "+components/browser_ui/widget/android", "+content/public/android/java/src/org/chromium/content_public", "+chrome/browser/android/crypto/java/src/org/chromium/chrome/browser/crypto/CipherFactory.java", + "+chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java", "+chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicy.java", "+chrome/android/public/crypto/java/src/org/chromium/chrome/browser/crypto/CipherFactory.java", "+chrome/browser/profiles/android/java/src/org/chromium/chrome/browser/profiles/Profile.java", @@ -46,7 +47,6 @@ "+chrome/android/java/src/org/chromium/chrome/browser/native_page/FrozenNativePage.java", "+chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePage.java", "+chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageAssassin.java", - "+chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java", "+chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java", "+chrome/android/java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java", "+chrome/android/java/src/org/chromium/chrome/browser/rlz/RevenueStats.java",
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateClientImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateClientImpl.java index 962db2e..c70432c5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateClientImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateClientImpl.java
@@ -6,6 +6,8 @@ import android.app.Activity; +import androidx.annotation.Nullable; + import org.chromium.chrome.browser.AppHooks; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.tabmodel.TabModelSelector; @@ -13,7 +15,9 @@ import org.chromium.components.external_intents.ExternalNavigationHandler; import org.chromium.components.external_intents.InterceptNavigationDelegateClient; import org.chromium.components.external_intents.RedirectHandlerImpl; +import org.chromium.content_public.browser.NavigationHandle; import org.chromium.content_public.browser.WebContents; +import org.chromium.ui.base.WindowAndroid; /** * Class that provides embedder-level information to InterceptNavigationDelegateImpl based off a @@ -21,9 +25,35 @@ */ public class InterceptNavigationDelegateClientImpl implements InterceptNavigationDelegateClient { private TabImpl mTab; + private final TabObserver mTabObserver; + private InterceptNavigationDelegateImpl mInterceptNavigationDelegate; InterceptNavigationDelegateClientImpl(Tab tab) { mTab = (TabImpl) tab; + mTabObserver = new EmptyTabObserver() { + @Override + public void onContentChanged(Tab tab) { + mInterceptNavigationDelegate.associateWithWebContents(tab.getWebContents()); + } + + @Override + public void onActivityAttachmentChanged(Tab tab, @Nullable WindowAndroid window) { + if (window != null) { + mInterceptNavigationDelegate.setExternalNavigationHandler( + createExternalNavigationHandler()); + } + } + + @Override + public void onDidFinishNavigation(Tab tab, NavigationHandle navigation) { + mInterceptNavigationDelegate.onNavigationFinished(navigation); + } + + @Override + public void onDestroyed(Tab tab) { + mInterceptNavigationDelegate.associateWithWebContents(null); + } + }; } @Override @@ -84,4 +114,15 @@ public void closeTab() { TabModelSelector.from(mTab).closeTab(mTab); } + + public void initializeWithDelegate(InterceptNavigationDelegateImpl delegate) { + mInterceptNavigationDelegate = delegate; + mTab.addObserver(mTabObserver); + } + + public void destroy() { + assert mInterceptNavigationDelegate != null; + mTab.removeObserver(mTabObserver); + mInterceptNavigationDelegate = null; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java index e8a8520..889792b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.tab; -import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import org.chromium.base.ContextUtils; @@ -25,7 +24,6 @@ import org.chromium.content_public.browser.UiThreadTaskTraits; import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.common.ConsoleMessageLevel; -import org.chromium.ui.base.WindowAndroid; /** * Class that controls navigations and allows to intercept them. It is used on Android to 'convert' @@ -36,12 +34,10 @@ * See https://crbug.com/732260. */ public class InterceptNavigationDelegateImpl implements InterceptNavigationDelegate { - private final TabImpl mTab; private final AuthenticatorNavigationInterceptor mAuthenticatorHelper; private InterceptNavigationDelegateClient mClient; private @OverrideUrlLoadingResult int mLastOverrideUrlLoadingResult = OverrideUrlLoadingResult.NO_OVERRIDE; - private final TabObserver mDelegateObserver; private WebContents mWebContents; private ExternalNavigationHandler mExternalNavHandler; @@ -55,48 +51,24 @@ * Default constructor of {@link InterceptNavigationDelegateImpl}. */ @VisibleForTesting - InterceptNavigationDelegateImpl(Tab tab, InterceptNavigationDelegateClient client) { - mTab = (TabImpl) tab; + InterceptNavigationDelegateImpl(InterceptNavigationDelegateClient client) { mClient = client; mAuthenticatorHelper = mClient.createAuthenticatorNavigationInterceptor(); - mDelegateObserver = new EmptyTabObserver() { - @Override - public void onContentChanged(Tab tab) { - associateWithWebContents(tab.getWebContents()); - } - - @Override - public void onActivityAttachmentChanged(Tab tab, @Nullable WindowAndroid window) { - if (window != null) { - setExternalNavigationHandler(mClient.createExternalNavigationHandler()); - } - } - - @Override - public void onDidFinishNavigation(Tab tab, NavigationHandle navigation) { - if (!navigation.hasCommitted() || !navigation.isInMainFrame()) return; - maybeUpdateNavigationHistory(); - } - - @Override - public void onDestroyed(Tab tab) { - associateWithWebContents(null); - } - }; - mTab.addObserver(mDelegateObserver); associateWithWebContents(mClient.getWebContents()); } - public void destroy() { - mTab.removeObserver(mDelegateObserver); + // Invoked by the client when a navigation has finished in the context in which this object is + // operating. + public void onNavigationFinished(NavigationHandle navigation) { + if (!navigation.hasCommitted() || !navigation.isInMainFrame()) return; + maybeUpdateNavigationHistory(); } - @VisibleForTesting - void setExternalNavigationHandler(ExternalNavigationHandler handler) { + public void setExternalNavigationHandler(ExternalNavigationHandler handler) { mExternalNavHandler = handler; } - private void associateWithWebContents(WebContents webContents) { + public void associateWithWebContents(WebContents webContents) { if (mWebContents == webContents) return; mWebContents = webContents; if (mWebContents == null) return; @@ -322,11 +294,6 @@ ContextUtils.getApplicationContext().getString(resId, url)); } - @VisibleForTesting - static void initDelegateForTesting(Tab tab, InterceptNavigationDelegateImpl delegate) { - delegate.associateWithWebContents(tab.getWebContents()); - } - @NativeMethods interface Natives { void associateWithWebContents(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateTabHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateTabHelper.java index a944ddb3..c477a03 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateTabHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateTabHelper.java
@@ -14,6 +14,7 @@ InterceptNavigationDelegateTabHelper.class; private final InterceptNavigationDelegateImpl mInterceptNavigationDelegate; + private final InterceptNavigationDelegateClientImpl mInterceptNavigationDelegateClient; public static void createForTab(Tab tab) { assert get(tab) == null; @@ -29,12 +30,14 @@ } InterceptNavigationDelegateTabHelper(Tab tab) { - mInterceptNavigationDelegate = new InterceptNavigationDelegateImpl( - tab, new InterceptNavigationDelegateClientImpl(tab)); + mInterceptNavigationDelegateClient = new InterceptNavigationDelegateClientImpl(tab); + mInterceptNavigationDelegate = + new InterceptNavigationDelegateImpl(mInterceptNavigationDelegateClient); + mInterceptNavigationDelegateClient.initializeWithDelegate(mInterceptNavigationDelegate); } @Override public void destroy() { - mInterceptNavigationDelegate.destroy(); + mInterceptNavigationDelegateClient.destroy(); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabDelegateFactory.java index 8d7ae55..27fe455 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabDelegateFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabDelegateFactory.java
@@ -4,7 +4,10 @@ package org.chromium.chrome.browser.tab; +import androidx.annotation.Nullable; + import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; +import org.chromium.chrome.browser.native_page.NativePageFactory; import org.chromium.components.browser_ui.util.BrowserControlsVisibilityDelegate; import org.chromium.components.embedder_support.delegate.WebContentsDelegateAndroid; import org.chromium.components.external_intents.ExternalNavigationHandler; @@ -41,4 +44,10 @@ * @param tab The associated {@link Tab}. */ BrowserControlsVisibilityDelegate createBrowserControlsVisibilityDelegate(Tab tab); + + /** + * @return {@link NativePageFactory} providing a method that creates a new native page. + */ + @Nullable + NativePageFactory getNativePageFactory(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java index c014142..3738986 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java
@@ -31,7 +31,6 @@ import org.chromium.chrome.browser.content.ContentUtils; import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; import org.chromium.chrome.browser.native_page.NativePageAssassin; -import org.chromium.chrome.browser.native_page.NativePageFactory; import org.chromium.chrome.browser.night_mode.NightModeUtils; import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.prerender.ExternalPrerenderHandler; @@ -1069,10 +1068,10 @@ // While detached for reparenting we don't have an owning Activity, or TabModelSelector, // so we can't create the native page. The native page will be created once reparenting is // completed. - if (isDetached(this)) return false; + if (isDetached(this) || mDelegateFactory.getNativePageFactory() == null) return false; NativePage candidateForReuse = forceReload ? null : getNativePage(); - NativePage nativePage = NativePageFactory.createNativePageForURL( - url, candidateForReuse, this, getActivity()); + NativePage nativePage = mDelegateFactory.getNativePageFactory().createNativePageForURL( + url, candidateForReuse, this); if (nativePage != null) { showNativePage(nativePage); notifyPageTitleChanged();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/CustomTabToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/CustomTabToolbar.java index e6883bf..66a1142 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/CustomTabToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/CustomTabToolbar.java
@@ -848,6 +848,9 @@ } @Override + public void performSearchQuery(String query) {} + + @Override public void setUrlBarFocus(boolean shouldBeFocused, @Nullable String pastedText, @LocationBar.OmniboxFocusReason int reason) {}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java index 3bd6621..ccb2da2 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java
@@ -99,8 +99,8 @@ "intent:///name/nm0000158#Intent;scheme=imdb;package=com.imdb.mobile;end"; private static final String INTENT_APP_NOT_INSTALLED_WITH_MARKET_REFERRER = "intent:///name/nm0000158#Intent;scheme=imdb;package=com.imdb.mobile;S." - + ExternalNavigationHandler.EXTRA_MARKET_REFERRER + "=" - + ENCODED_MARKET_REFERRER + ";end"; + + ExternalNavigationHandler.EXTRA_MARKET_REFERRER + "=" + ENCODED_MARKET_REFERRER + + ";end"; private static final String INTENT_APP_PACKAGE_NAME = "com.imdb.mobile"; private static final String YOUTUBE_URL = "http://youtube.com"; private static final String YOUTUBE_MOBILE_URL = "http://m.youtube.com"; @@ -120,12 +120,17 @@ "com.google.android.instantapps.START", "com.google.android.instantapps.nmr1.INSTALL", "com.google.android.instantapps.nmr1.VIEW"}; - private static final String AUTOFILL_ASSISTANT_INTENT_URL = + private static final String AUTOFILL_ASSISTANT_INTENT_URL_WITH_FALLBACK = "intent://www.example.com#Intent;scheme=https;" + "B.org.chromium.chrome.browser.autofill_assistant.ENABLED=true;" + "S." + ExternalNavigationHandler.EXTRA_BROWSER_FALLBACK_URL + "=" + Uri.encode("https://www.example.com") + ";end"; + private static final String AUTOFILL_ASSISTANT_INTENT_URL_WITHOUT_FALLBACK = + "intent://www.example.com#Intent;scheme=https;" + + "B.org.chromium.chrome.browser.autofill_assistant.ENABLED=true;" + + "end;"; + private static final String IS_INSTANT_APP_EXTRA = "IS_INSTANT_APP"; private Context mContext; @@ -1204,7 +1209,7 @@ mDelegate.add(new IntentActivity(CALENDAR_URL, "calendar")); checkUrl(CALENDAR_URL + "/file.pdf") - .expecting(OverrideUrlLoadingResult.NO_OVERRIDE, IGNORE); + .expecting(OverrideUrlLoadingResult.NO_OVERRIDE, IGNORE); } @Test @@ -1524,10 +1529,9 @@ @Test @SmallTest - public void testAutofillAssistantIntent_handledByDelegate() { - mDelegate.setHandleIntentWithAutofillAssistant(true); - - checkUrl(AUTOFILL_ASSISTANT_INTENT_URL) + public void testAutofillAssistantIntentWithFallback_InRegular() { + mDelegate.setIsIntentToAutofillAssistant(true); + checkUrl(AUTOFILL_ASSISTANT_INTENT_URL_WITH_FALLBACK) .expecting(OverrideUrlLoadingResult.OVERRIDE_WITH_CLOBBERING_TAB, IGNORE); Assert.assertNull(mDelegate.startActivityIntent); @@ -1535,16 +1539,35 @@ @Test @SmallTest - public void testAutofillAssistantIntent_notHandledByDelegate() { - mDelegate.setHandleIntentWithAutofillAssistant(false); - - checkUrl(AUTOFILL_ASSISTANT_INTENT_URL) + public void testAutofillAssistantIntentWithFallback_InIncognito() { + mDelegate.setIsIntentToAutofillAssistant(true); + checkUrl(AUTOFILL_ASSISTANT_INTENT_URL_WITH_FALLBACK) .withIsIncognito(true) - .expecting(OverrideUrlLoadingResult.OVERRIDE_WITH_EXTERNAL_INTENT, - START_OTHER_ACTIVITY); + .expecting(OverrideUrlLoadingResult.OVERRIDE_WITH_CLOBBERING_TAB, IGNORE); - Assert.assertNotNull(mDelegate.startActivityIntent); - Assert.assertTrue(mDelegate.startActivityIntent.getScheme().startsWith("https")); + Assert.assertNull(mDelegate.startActivityIntent); + } + + @Test + @SmallTest + public void testAutofillAssistantIntentWithoutFallback_InRegular() { + mDelegate.setIsIntentToAutofillAssistant(true); + checkUrl(AUTOFILL_ASSISTANT_INTENT_URL_WITHOUT_FALLBACK) + .withIsIncognito(false) + .expecting(OverrideUrlLoadingResult.NO_OVERRIDE, IGNORE); + + Assert.assertNull(mDelegate.startActivityIntent); + } + + @Test + @SmallTest + public void testAutofillAssistantIntentWithoutFallback_InIncognito() { + mDelegate.setIsIntentToAutofillAssistant(true); + checkUrl(AUTOFILL_ASSISTANT_INTENT_URL_WITHOUT_FALLBACK) + .withIsIncognito(true) + .expecting(OverrideUrlLoadingResult.NO_OVERRIDE, IGNORE); + + Assert.assertNull(mDelegate.startActivityIntent); } @Test @@ -1685,8 +1708,7 @@ String chromePackageName = ContextUtils.getApplicationContext().getPackageName(); if (chromePackageName.equals(intent.getPackage()) || (intent.getComponent() != null - && chromePackageName.equals( - intent.getComponent().getPackageName()))) { + && chromePackageName.equals(intent.getComponent().getPackageName()))) { return true; } @@ -1844,6 +1866,11 @@ } @Override + public boolean isIntentToAutofillAssistant(Intent intent) { + return mIsIntentToAutofillAssistant; + } + + @Override public boolean isValidWebApk(String packageName) { for (IntentActivity activity : mIntentActivities) { if (activity.packageName().equals(packageName)) { @@ -1926,6 +1953,10 @@ mIsIntentToInstantApp = value; } + public void setIsIntentToAutofillAssistant(boolean value) { + mIsIntentToAutofillAssistant = value; + } + public Intent startActivityIntent; public boolean startIncognitoIntentCalled; public boolean maybeSetUserGestureCalled; @@ -1948,6 +1979,7 @@ private boolean mIsCallingAppTrusted; private boolean mShouldDisableExternalIntentRequests; private boolean mIsIntentToInstantApp; + private boolean mIsIntentToAutofillAssistant; public boolean shouldRequestFileAccess; }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java index 177bb14b..94866c07 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java
@@ -162,7 +162,7 @@ mRecyclerView.init(mUiConfig, activity::closeContextMenu); mSuggestion = new SnippetArticleViewHolder(mRecyclerView, mContextMenuManager, - mUiDelegate, mUiConfig, /* offlinePageBridge = */ null); + mUiDelegate, mUiConfig, /* offlinePageBridge = */ null, null); }); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/ProfileDataCacheWithBadgeRenderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/ProfileDataCacheWithBadgeRenderTest.java new file mode 100644 index 0000000..9691afd5 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/ProfileDataCacheWithBadgeRenderTest.java
@@ -0,0 +1,109 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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.signin; + +import android.app.Activity; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.support.test.filters.MediumTest; +import android.view.ViewGroup; +import android.widget.FrameLayout; +import android.widget.ImageView; + +import androidx.annotation.DrawableRes; + +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.test.util.Feature; +import org.chromium.chrome.R; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.util.ChromeRenderTestRule; +import org.chromium.components.signin.ProfileDataSource; +import org.chromium.components.signin.test.util.FakeProfileDataSource; +import org.chromium.content_public.browser.test.util.TestThreadUtils; +import org.chromium.ui.test.util.DummyUiActivityTestCase; +import org.chromium.ui.widget.ChromeImageView; + +import java.io.IOException; + +/** + * Tests for ProfileDataCache with a badge. Leverages RenderTest instead of reimplementing + * bitmap comparison to simplify access to the compared images on buildbots (via result_details). + */ +@RunWith(ChromeJUnit4ClassRunner.class) +public class ProfileDataCacheWithBadgeRenderTest extends DummyUiActivityTestCase { + @Rule + public ChromeRenderTestRule mRenderTestRule = new ChromeRenderTestRule(); + + private FrameLayout mContentView; + private ImageView mImageView; + private FakeProfileDataSource mProfileDataSource; + private ProfileDataCache mProfileDataCache; + + @Override + public void setUpTest() throws Exception { + super.setUpTest(); + TestThreadUtils.runOnUiThreadBlocking(() -> { + Activity activity = getActivity(); + mContentView = new FrameLayout(activity); + mImageView = new ChromeImageView(activity); + mContentView.addView(mImageView, ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT); + activity.setContentView(mContentView); + + mProfileDataSource = new FakeProfileDataSource(); + }); + } + + @Test + @MediumTest + @Feature("RenderTest") + public void testProfileDataCacheWithChildBadge() throws IOException { + setUpProfileDataCache(R.drawable.ic_account_child_20dp); + + mRenderTestRule.render(mImageView, "profile_data_cache_with_child_badge"); + } + + private void setUpProfileDataCache(@DrawableRes int badgeResId) { + TestThreadUtils.runOnUiThreadBlocking(() -> { + mProfileDataCache = ProfileDataCache.createProfileDataCache( + getActivity(), badgeResId, mProfileDataSource); + // ProfileDataCache only populates the cache when an observer is added. + mProfileDataCache.addObserver(accountId -> {}); + + String accountName = "test@example.com"; + ProfileDataSource.ProfileData profileData = new ProfileDataSource.ProfileData( + accountName, createAvatar(), "Full Name", "Given Name"); + mProfileDataSource.setProfileData(accountName, profileData); + mImageView.setImageDrawable( + mProfileDataCache.getProfileDataOrDefault(accountName).getImage()); + }); + } + + /** + * Creates a simple dummy bitmap to use as the avatar picture. + */ + private Bitmap createAvatar() { + final int avatarSize = + getActivity().getResources().getDimensionPixelSize(R.dimen.user_picture_size); + Assert.assertTrue("avatarSize must not be 0", avatarSize > 0); + Bitmap result = Bitmap.createBitmap(avatarSize, avatarSize, Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(result); + canvas.drawColor(Color.RED); + + Paint paint = new Paint(); + paint.setAntiAlias(true); + + paint.setColor(Color.BLUE); + canvas.drawCircle(0, 0, avatarSize, paint); + + return result; + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateTest.java index f06fbaec..6e21bc2f 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateTest.java
@@ -100,16 +100,18 @@ mActivity = mActivityTestRule.getActivity(); final Tab tab = mActivity.getActivityTab(); TestThreadUtils.runOnUiThreadBlocking(() -> { - InterceptNavigationDelegateImpl delegate = new InterceptNavigationDelegateImpl( - tab, new InterceptNavigationDelegateClientImpl(tab)) { + InterceptNavigationDelegateClientImpl client = + new InterceptNavigationDelegateClientImpl(tab); + InterceptNavigationDelegateImpl delegate = new InterceptNavigationDelegateImpl(client) { @Override public boolean shouldIgnoreNavigation(NavigationParams navigationParams) { mNavParamHistory.add(navigationParams); return super.shouldIgnoreNavigation(navigationParams); } }; + client.initializeWithDelegate(delegate); delegate.setExternalNavigationHandler(new TestExternalNavigationHandler()); - InterceptNavigationDelegateImpl.initDelegateForTesting(tab, delegate); + delegate.associateWithWebContents(tab.getWebContents()); }); mTestServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext()); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurfaceTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurfaceTest.java index ac923d6..f0a88dd 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurfaceTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurfaceTest.java
@@ -42,7 +42,7 @@ public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mocker.mock(FeedStreamSurfaceJni.TEST_HOOKS, mFeedStreamSurfaceJniMock); - mFeedStreamSurface = new FeedStreamSurface(null); + mFeedStreamSurface = new FeedStreamSurface(null, () -> null); } @Test
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/native_page/NativePageFactoryTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/native_page/NativePageFactoryTest.java index 4fe30cad..7a54b4f 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/native_page/NativePageFactoryTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/native_page/NativePageFactoryTest.java
@@ -13,10 +13,8 @@ import org.robolectric.annotation.Config; import org.chromium.base.test.BaseRobolectricTestRunner; -import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.native_page.NativePageFactory.NativePageType; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.ui.native_page.NativePage; import org.chromium.components.embedder_support.util.UrlConstants; @@ -26,6 +24,8 @@ @RunWith(BaseRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class NativePageFactoryTest { + private NativePageFactory mNativePageFactory; + private static class MockNativePage implements NativePage { public final @NativePageType int type; public int updateForUrlCalls; @@ -84,19 +84,22 @@ } private static class MockNativePageBuilder extends NativePageFactory.NativePageBuilder { + private MockNativePageBuilder() { + super(null, null); + } + @Override - public NativePage buildNewTabPage(ChromeActivity activity, Tab tab, - TabModelSelector tabModelSelector) { + public NativePage buildNewTabPage(Tab tab) { return new MockNativePage(NativePageType.NTP); } @Override - public NativePage buildBookmarksPage(ChromeActivity activity, Tab tab) { + public NativePage buildBookmarksPage(Tab tab) { return new MockNativePage(NativePageType.BOOKMARKS); } @Override - public NativePage buildRecentTabsPage(ChromeActivity activity, Tab tab) { + public NativePage buildRecentTabsPage(Tab tab) { return new MockNativePage(NativePageType.RECENT_TABS); } } @@ -155,7 +158,8 @@ @Before public void setUp() { - NativePageFactory.setNativePageBuilderForTesting(new MockNativePageBuilder()); + mNativePageFactory = new NativePageFactory(null); + mNativePageFactory.setNativePageBuilderForTesting(new MockNativePageBuilder()); } /** @@ -199,8 +203,9 @@ for (@NativePageType int candidateType : candidateTypes) { MockNativePage candidate = candidateType == NativePageType.NONE ? null : new MockNativePage(candidateType); - MockNativePage page = (MockNativePage) NativePageFactory.createNativePageForURL( - urlCombo.url, candidate, null, null, isIncognito); + MockNativePage page = + (MockNativePage) mNativePageFactory.createNativePageForURL( + urlCombo.url, candidate, null, isIncognito); String debugMessage = String.format( "Failed test case: isIncognito=%s, urlCombo={%s,%s}, candidateType=%s", isIncognito, urlCombo.url, urlCombo.expectedType, candidateType); @@ -226,15 +231,14 @@ for (UrlCombo urlCombo : VALID_URLS) { if (!isValidInIncognito(urlCombo)) { Assert.assertNull(urlCombo.url, - NativePageFactory.createNativePageForURL( - urlCombo.url, null, null, null, true)); + mNativePageFactory.createNativePageForURL(urlCombo.url, null, null, true)); } } for (boolean isIncognito : new boolean[] {true, false}) { for (String invalidUrl : INVALID_URLS) { Assert.assertNull(invalidUrl, - NativePageFactory.createNativePageForURL( - invalidUrl, null, null, null, isIncognito)); + mNativePageFactory.createNativePageForURL( + invalidUrl, null, null, isIncognito)); } } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java index 1fbc569..927276043e 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
@@ -62,6 +62,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.native_page.ContextMenuManager; +import org.chromium.chrome.browser.ntp.NewTabPageUma; import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.PartialBindCallback; import org.chromium.chrome.browser.ntp.cards.SignInPromo.SigninObserver; import org.chromium.chrome.browser.ntp.snippets.CategoryInt; @@ -1233,7 +1234,7 @@ mSource.removeObservers(); mAdapter = new NewTabPageAdapter(mUiDelegate, mock(View.class), /* logoView = */ makeUiConfig(), mOfflinePageBridge, mock(ContextMenuManager.class), - mMockSigninManager + mock(NewTabPageUma.class), mMockSigninManager /* tileGroupDelegate = */); mAdapter.refreshSuggestions(); }
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index 282b66f3..872221fe 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-84.0.4111.0_rc-r1-merged.afdo.bz2 \ No newline at end of file +chromeos-chrome-amd64-84.0.4112.0_rc-r1-merged.afdo.bz2 \ No newline at end of file
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index cfd613a..ca39bc9 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -4234,12 +4234,6 @@ flag_descriptions::kPaintHoldingDescription, kOsAll, FEATURE_VALUE_TYPE(blink::features::kPaintHolding)}, -#if !defined(OS_ANDROID) - {"app-management", flag_descriptions::kAppManagementName, - flag_descriptions::kAppManagementDescription, kOsDesktop, - FEATURE_VALUE_TYPE(features::kAppManagement)}, -#endif // !defined(OS_ANDROID) - #if defined(OS_CHROMEOS) {"app-service-instance-registry", flag_descriptions::kAppServiceInstanceRegistryName,
diff --git a/chrome/browser/apps/platform_apps/app_browsertest.cc b/chrome/browser/apps/platform_apps/app_browsertest.cc index b6d47020..e496077 100644 --- a/chrome/browser/apps/platform_apps/app_browsertest.cc +++ b/chrome/browser/apps/platform_apps/app_browsertest.cc
@@ -1238,7 +1238,7 @@ const Extension* file_manager = extension_registry()->GetExtensionById( "hhaomjibdihmijegdhdafkllkbggdgoj", ExtensionRegistry::ENABLED); ASSERT_TRUE(file_manager != NULL); - Profile* incognito_profile = profile()->GetOffTheRecordProfile(); + Profile* incognito_profile = profile()->GetPrimaryOTRProfile(); ASSERT_TRUE(incognito_profile != NULL); // Wait until the file manager has had a chance to register its listener
diff --git a/chrome/browser/chromeos/account_manager/account_manager_migrator.cc b/chrome/browser/chromeos/account_manager/account_manager_migrator.cc index f4dda7c..d166ba5 100644 --- a/chrome/browser/chromeos/account_manager/account_manager_migrator.cc +++ b/chrome/browser/chromeos/account_manager/account_manager_migrator.cc
@@ -96,9 +96,10 @@ ~AccountMigrationBaseStep() override = default; protected: - bool IsAccountPresentInAccountManager( + bool IsAccountWithNonDummyTokenPresentInAccountManager( const AccountManager::AccountKey& account) const { - return base::Contains(account_manager_accounts_, account); + return base::Contains(account_manager_accounts_, account) && + !account_manager_->HasDummyGaiaToken(account); } bool IsAccountManagerEmpty() const { @@ -184,7 +185,7 @@ private: void StartMigration() override { - if (IsAccountPresentInAccountManager(device_account_)) { + if (IsAccountWithNonDummyTokenPresentInAccountManager(device_account_)) { FinishWithSuccess(); return; }
diff --git a/chrome/browser/chromeos/drive/drive_integration_service.h b/chrome/browser/chromeos/drive/drive_integration_service.h index dd431cd..7996242b 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service.h +++ b/chrome/browser/chromeos/drive/drive_integration_service.h
@@ -15,6 +15,7 @@ #include "base/memory/singleton.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" +#include "base/observer_list_types.h" #include "base/scoped_observer.h" #include "chromeos/components/drivefs/drivefs_host.h" #include "chromeos/dbus/power/power_manager_client.h" @@ -66,7 +67,7 @@ // Interface for classes that need to observe events from // DriveIntegrationService. All events are notified on UI thread. -class DriveIntegrationServiceObserver { +class DriveIntegrationServiceObserver : public base::CheckedObserver { public: // Triggered when the file system is mounted. virtual void OnFileSystemMounted() { @@ -79,9 +80,6 @@ // Triggered when mounting the filesystem has failed in a fashion that will // not be automatically retried. virtual void OnFileSystemMountFailed() {} - - protected: - virtual ~DriveIntegrationServiceObserver() {} }; // DriveIntegrationService is used to integrate Drive to Chrome. This class @@ -256,7 +254,7 @@ std::unique_ptr<internal::ResourceMetadataStorage, util::DestroyHelper> metadata_storage_; - base::ObserverList<DriveIntegrationServiceObserver>::Unchecked observers_; + base::ObserverList<DriveIntegrationServiceObserver> observers_; std::unique_ptr<DriveFsHolder> drivefs_holder_; std::unique_ptr<PreferenceWatcher> preference_watcher_;
diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc index 2385cdb..b93913b 100644 --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
@@ -306,7 +306,8 @@ TestCase("fileDisplayCheckSelectWithFakeItemSelected"), TestCase("fileDisplayCheckReadOnlyIconOnFakeDirectory"), TestCase("fileDisplayCheckNoReadOnlyIconOnDownloads"), - TestCase("fileDisplayCheckNoReadOnlyIconOnLinuxFiles"))); + TestCase("fileDisplayCheckNoReadOnlyIconOnLinuxFiles"), + TestCase("fileDisplayStartupError"))); WRAPPED_INSTANTIATE_TEST_SUITE_P( OpenVideoFiles, /* open_video_files.js */
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc index 16ca5b50..18077598 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.cc +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -1282,109 +1282,90 @@ DCHECK(!gaia_id.empty()); } - bool should_use_legacy_flow = false; - if (!identity_manager - ->FindExtendedAccountInfoForAccountWithRefreshTokenByGaiaId( - gaia_id) - .has_value() && - user_context.GetRefreshToken().empty()) { - // Edge case: |AccountManager| is enabled but neither |IdentityManager| - // nor |user_context| has the refresh token. This means that an existing - // user has switched on Account Manager for the first time and has not - // undergone the migration flow yet. This migration will be done shorty - // in-session. - // TODO(https://crbug.com/987955): Remove this. - should_use_legacy_flow = true; + // We need to set the Primary Account. This is handled by + // |IdentityManager|, which enforces the invariant that only an account + // previously known to |IdentityManager| can be set as the Primary + // Account. |IdentityManager| gets its knowledge of accounts from + // |AccountManager| and hence, before we set the Primary Account, we need + // to make sure that: + // 1. The account is present in |AccountManager|, and + // 2. |IdentityManager| has been notified about it. + + AccountManager* account_manager = + g_browser_process->platform_part() + ->GetAccountManagerFactory() + ->GetAccountManager(profile->GetPath().value()); + + // |AccountManager| MUST have been fully initialized at this point (via + // |UserSessionManager::InitializeAccountManager|), otherwise we cannot + // guarantee that |IdentityManager| will have this account in Step (2). + // Reason: |AccountManager::UpsertAccount| is an async API that can + // technically take an arbitrarily long amount of time to complete and + // notify |AccountManager|'s observers. However, if |AccountManager| has + // been fully initialized, |AccountManager::UpsertAccount| and the + // associated notifications happen synchronously. We are relying on that + // (undocumented) behaviour here. + // TODO(sinhak): This is a leaky abstraction. Explore if + // |UserSessionManager::InitProfilePreferences| can handle an asynchronous + // callback and continue. + DCHECK(account_manager->IsInitialized()); + + const AccountManager::AccountKey account_key{ + gaia_id, account_manager::AccountType::ACCOUNT_TYPE_GAIA}; + + // 1. Make sure that the account is present in |AccountManager|. + if (!user_context.GetRefreshToken().empty()) { + // |AccountManager::UpsertAccount| is idempotent. We can safely call it + // without checking for re-auth cases. + // We MUST NOT revoke old Device Account tokens (|revoke_old_token| = + // |false|), otherwise Gaia will revoke all tokens associated to this + // user's device id, including |refresh_token_| and the user will be + // stuck performing an online auth with Gaia at every login. See + // https://crbug.com/952570 and https://crbug.com/865189 for context. + account_manager->UpsertAccount(account_key, + user->GetDisplayEmail() /* raw_email */, + user_context.GetRefreshToken()); + } else if (!account_manager->IsTokenAvailable(account_key)) { + // When |user_context| does not contain a refresh token and account is not + // present in the AccountManager it means the migration to the + // AccountManager didn't happen. + // Set account with dummy token to let IdentitManager know that account + // exists and we can safely configure the primary account at the step 2. + // The real token will be set later during the migration. + account_manager->UpsertAccount(account_key, + user->GetDisplayEmail() /* raw_email */, + AccountManager::kInvalidToken); } - base::UmaHistogramBoolean( - "AccountManager.LegacySetPrimaryAccountAndUpdateAccountInfo", - should_use_legacy_flow); + DCHECK(account_manager->IsTokenAvailable(account_key)); - if (!should_use_legacy_flow) { - // We need to set the Primary Account. This is handled by - // |IdentityManager|, which enforces the invariant that only an account - // previously known to |IdentityManager| can be set as the Primary - // Account. |IdentityManager| gets its knowledge of accounts from - // |AccountManager| and hence, before we set the Primary Account, we need - // to make sure that: - // 1. The account is present in |AccountManager|, and - // 2. |IdentityManager| has been notified about it. + // 2. Make sure that IdentityManager has been notified about it. + base::Optional<AccountInfo> account_info = + identity_manager + ->FindExtendedAccountInfoForAccountWithRefreshTokenByGaiaId( + gaia_id); - AccountManager* account_manager = - g_browser_process->platform_part() - ->GetAccountManagerFactory() - ->GetAccountManager(profile->GetPath().value()); - - // |AccountManager| MUST have been fully initialized at this point (via - // |UserSessionManager::InitializeAccountManager|), otherwise we cannot - // guarantee that |IdentityManager| will have this account in Step (2). - // Reason: |AccountManager::UpsertAccount| is an async API that can - // technically take an arbitrarily long amount of time to complete and - // notify |AccountManager|'s observers. However, if |AccountManager| has - // been fully initialized, |AccountManager::UpsertAccount| and the - // associated notifications happen synchronously. We are relying on that - // (undocumented) behaviour here. - // TODO(sinhak): This is a leaky abstraction. Explore if - // |UserSessionManager::InitProfilePreferences| can handle an asynchronous - // callback and continue. - DCHECK(account_manager->IsInitialized()); - - // 1. Make sure that the account is present in |AccountManager|. - if (!user_context.GetRefreshToken().empty()) { - // |AccountManager::UpsertAccount| is idempotent. We can safely call it - // without checking for re-auth cases. - // We MUST NOT revoke old Device Account tokens (|revoke_old_token| = - // |false|), otherwise Gaia will revoke all tokens associated to this - // user's device id, including |refresh_token_| and the user will be - // stuck performing an online auth with Gaia at every login. See - // https://crbug.com/952570 and https://crbug.com/865189 for context. - account_manager->UpsertAccount( - AccountManager::AccountKey{ - gaia_id, account_manager::AccountType::ACCOUNT_TYPE_GAIA}, - user->GetDisplayEmail() /* raw_email */, - user_context.GetRefreshToken()); - } - // else: If |user_context| does not contain a refresh token, then we are - // restoring an existing Profile, in which case the account will be - // already present in |AccountManager|. - - // 2. Make sure that IdentityManager has been notified about it. - base::Optional<AccountInfo> account_info = - identity_manager - ->FindExtendedAccountInfoForAccountWithRefreshTokenByGaiaId( - gaia_id); - DCHECK(account_info.has_value()); - if (features::IsSplitSyncConsentEnabled()) { - if (is_new_profile) { - if (!identity_manager->HasPrimaryAccount(ConsentLevel::kSync)) { - // Set the account without recording browser sync consent. - identity_manager->GetPrimaryAccountMutator() - ->SetUnconsentedPrimaryAccount(account_info->account_id); - } + DCHECK(account_info.has_value()); + if (features::IsSplitSyncConsentEnabled()) { + if (is_new_profile) { + if (!identity_manager->HasPrimaryAccount(ConsentLevel::kSync)) { + // Set the account without recording browser sync consent. + identity_manager->GetPrimaryAccountMutator() + ->SetUnconsentedPrimaryAccount(account_info->account_id); } - CHECK(identity_manager->HasPrimaryAccount(ConsentLevel::kNotRequired)); - CHECK_EQ( - identity_manager->GetPrimaryAccountInfo(ConsentLevel::kNotRequired) - .gaia, - gaia_id); - } else { - // Set a primary account here because the profile might have been - // created with the feature SplitSyncConsent enabled. Then the - // profile might only have an unconsented primary account. - identity_manager->GetPrimaryAccountMutator()->SetPrimaryAccount( - account_info->account_id); - CHECK(identity_manager->HasPrimaryAccount(ConsentLevel::kSync)); - CHECK_EQ(identity_manager->GetPrimaryAccountInfo().gaia, gaia_id); } + CHECK(identity_manager->HasPrimaryAccount(ConsentLevel::kNotRequired)); + CHECK_EQ( + identity_manager->GetPrimaryAccountInfo(ConsentLevel::kNotRequired) + .gaia, + gaia_id); } else { - // Make sure that the google service username is properly set (we do this - // on every sign in, not just the first login, to deal with existing - // profiles that might not have it set yet). - // TODO(https://crbug.com/987955): Check the UMA stat and remove it when - // all users have been migrated to Account Manager. - identity_manager->GetPrimaryAccountMutator() - ->DeprecatedSetPrimaryAccountAndUpdateAccountInfo( - gaia_id, user_context.GetAccountId().GetUserEmail()); + // Set a primary account here because the profile might have been + // created with the feature SplitSyncConsent enabled. Then the + // profile might only have an unconsented primary account. + identity_manager->GetPrimaryAccountMutator()->SetPrimaryAccount( + account_info->account_id); + CHECK(identity_manager->HasPrimaryAccount(ConsentLevel::kSync)); + CHECK_EQ(identity_manager->GetPrimaryAccountInfo().gaia, gaia_id); } CoreAccountId account_id =
diff --git a/chrome/browser/chromeos/policy/system_features_disable_list_policy_handler.cc b/chrome/browser/chromeos/policy/system_features_disable_list_policy_handler.cc index 935a223..aa81b0b0 100644 --- a/chrome/browser/chromeos/policy/system_features_disable_list_policy_handler.cc +++ b/chrome/browser/chromeos/policy/system_features_disable_list_policy_handler.cc
@@ -4,6 +4,7 @@ #include "system_features_disable_list_policy_handler.h" +#include "ash/public/cpp/ash_pref_names.h" #include "base/values.h" #include "components/policy/core/common/policy_pref_names.h" #include "components/policy/policy_constants.h" @@ -28,11 +29,16 @@ PrefValueMap* prefs) { DCHECK(filtered_list.is_list()); base::Value enums_list(base::Value::Type::LIST); + bool os_settings_enabled = true; for (const auto& element : filtered_list.GetList()) { - enums_list.Append(ConvertToEnum(element.GetString())); + SystemFeature feature = ConvertToEnum(element.GetString()); + enums_list.Append(feature); + if (feature == SystemFeature::OS_SETTINGS) + os_settings_enabled = false; } prefs->SetValue(policy_prefs::kSystemFeaturesDisableList, std::move(enums_list)); + prefs->SetBoolean(ash::prefs::kOsSettingsEnabled, os_settings_enabled); } SystemFeature SystemFeaturesDisableListPolicyHandler::ConvertToEnum(
diff --git a/chrome/browser/devtools/devtools_sanity_browsertest.cc b/chrome/browser/devtools/devtools_sanity_browsertest.cc index 8e9af66..8b30867 100644 --- a/chrome/browser/devtools/devtools_sanity_browsertest.cc +++ b/chrome/browser/devtools/devtools_sanity_browsertest.cc
@@ -955,6 +955,8 @@ ASSERT_TRUE(content::ExecuteScript(web_frame_rfh, about_blank_javascript)); web_about_blank_manager.WaitForNavigationFinished(); + // After navigation, the frame may change. + web_frame_rfh = ChildFrameAt(panel_frame_rfh, 2); EXPECT_EQ(about_blank_url, web_frame_rfh->GetLastCommittedURL()); EXPECT_EQ(web_url.host(),
diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.cc b/chrome/browser/extensions/api/identity/web_auth_flow.cc index 22ebf71..56269b2fd 100644 --- a/chrome/browser/extensions/api/identity/web_auth_flow.cc +++ b/chrome/browser/extensions/api/identity/web_auth_flow.cc
@@ -37,6 +37,7 @@ #include "extensions/browser/extension_system.h" #include "extensions/browser/guest_view/web_view/web_view_guest.h" #include "net/http/http_response_headers.h" +#include "net/http/http_status_code.h" #include "url/gurl.h" #include "url/url_constants.h" @@ -247,6 +248,13 @@ // the web auth flow. DCHECK_EQ(net::ERR_UNKNOWN_URL_SCHEME, navigation_handle->GetNetErrorCode()); + } else if (navigation_handle->GetResponseHeaders() && + navigation_handle->GetResponseHeaders()->response_code() == + net::HTTP_NO_CONTENT) { + // Navigation to no content URLs is aborted but shouldn't be treated as a + // failure. + // In particular, Gaia navigates to a no content page to pass Mirror + // response headers. } else { failed = true; TRACE_EVENT_NESTABLE_ASYNC_INSTANT1(
diff --git a/chrome/browser/extensions/chrome_url_request_util.cc b/chrome/browser/extensions/chrome_url_request_util.cc index 48cea5ec..2672596 100644 --- a/chrome/browser/extensions/chrome_url_request_util.cc +++ b/chrome/browser/extensions/chrome_url_request_util.cc
@@ -160,13 +160,11 @@ return; } head->headers = response_headers_; - head->headers->AddHeader( - base::StringPrintf("%s: %s", net::HttpRequestHeaders::kContentLength, - base::NumberToString(head->content_length).c_str())); + head->headers->AddHeader(net::HttpRequestHeaders::kContentLength, + base::NumberToString(head->content_length)); if (!head->mime_type.empty()) { - head->headers->AddHeader( - base::StringPrintf("%s: %s", net::HttpRequestHeaders::kContentType, - head->mime_type.c_str())); + head->headers->AddHeader(net::HttpRequestHeaders::kContentType, + head->mime_type.c_str()); } client_->OnReceiveResponse(std::move(head)); client_->OnStartLoadingResponseBody(std::move(pipe.consumer_handle));
diff --git a/chrome/browser/extensions/extension_service_sync_unittest.cc b/chrome/browser/extensions/extension_service_sync_unittest.cc index d252c0f7..a49513f0 100644 --- a/chrome/browser/extensions/extension_service_sync_unittest.cc +++ b/chrome/browser/extensions/extension_service_sync_unittest.cc
@@ -2337,6 +2337,50 @@ "SupervisedUsers_Extensions_Removed")); } +// Tests that the kNewVersionApprovalGranted UMA metric only increments when +// there's an actual change in the approved version. +// Prevents a regression to crbug/1068438. +TEST_F(ExtensionServiceTestSupervised, DontTriggerUpdateIfNoVersionChange) { + InitSupervisedUserExtensionInstallFeatures( + SupervisedUserExtensionInstallFeatureMode::kFull); + InitServices(/*profile_is_supervised=*/true); + SetSupervisedUserExtensionsMayRequestPermissionsPref(true); + + base::HistogramTester histogram_tester; + + base::FilePath path = data_dir().AppendASCII("good.crx"); + const Extension* extension = InstallCRX(path, INSTALL_WITHOUT_LOAD); + ASSERT_TRUE(extension); + // The extension should be installed but disabled pending custodian approval. + EXPECT_TRUE(registry()->disabled_extensions().Contains(extension->id())); + + // Simulate parent approval for the extension installation. + supervised_user_service()->AddOrUpdateExtensionApproval(*extension); + // The extension should be enabled now. + EXPECT_TRUE(registry()->enabled_extensions().Contains(extension->id())); + + // Should see 1 kNewExtensionApprovalGranted metric count recorded. + histogram_tester.ExpectUniqueSample( + "SupervisedUsers.Extensions", + SupervisedUserExtensionsMetricsRecorder::UmaExtensionState:: + kNewExtensionApprovalGranted, + 1); + histogram_tester.ExpectTotalCount("SupervisedUsers.Extensions", 1); + + // Simulate the supervised user disabling and re-enabling the extension + // without changing the extension version. + supervised_user_service()->AddOrUpdateExtensionApproval(*extension); + + // Should not see kNewVersionApprovalGranted metric count recorded because + // there was no version change. + histogram_tester.ExpectBucketCount( + "SupervisedUsers.Extensions", + SupervisedUserExtensionsMetricsRecorder::UmaExtensionState:: + kNewVersionApprovalGranted, + 0); + histogram_tester.ExpectTotalCount("SupervisedUsers.Extensions", 1); +} + TEST_F(ExtensionServiceTestSupervised, SupervisedUserInitiatedInstalls) { InitSupervisedUserExtensionInstallFeatures( SupervisedUserExtensionInstallFeatureMode::kFull);
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 8f459492..ede26a7 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -118,11 +118,6 @@ "expiry_milestone": 86 }, { - "name": "app-management", - "owners": [ "//chrome/browser/ui/webui/app_management/OWNERS" ], - "expiry_milestone": 81 - }, - { "name": "app-service-instance-registry", "owners": [ "//chrome/services/app_service/OWNERS" ], "expiry_milestone": 85
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 2e164d2..d0a5b83 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2726,10 +2726,6 @@ #else // !defined(OS_ANDROID) -const char kAppManagementName[] = "Enable App Management page"; -const char kAppManagementDescription[] = - "Shows the new app management page at chrome://apps."; - const char kCastMediaRouteProviderName[] = "Cast Media Route Provider"; const char kCastMediaRouteProviderDescription[] = "Enables the native Cast Media Route Provider implementation to be used "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index a66ad67..b7f1c2b 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1564,9 +1564,6 @@ #else // !defined(OS_ANDROID) -extern const char kAppManagementName[]; -extern const char kAppManagementDescription[]; - extern const char kCastMediaRouteProviderName[]; extern const char kCastMediaRouteProviderDescription[];
diff --git a/chrome/browser/focus_ring_browsertest.cc b/chrome/browser/focus_ring_browsertest.cc deleted file mode 100644 index 6e9d1507..0000000 --- a/chrome/browser/focus_ring_browsertest.cc +++ /dev/null
@@ -1,110 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/path_service.h" -#include "base/test/scoped_feature_list.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/common/chrome_paths.h" -#include "chrome/test/base/in_process_browser_test.h" -#include "chrome/test/base/interactive_test_utils.h" -#include "chrome/test/base/ui_test_utils.h" -#include "content/public/browser/render_widget_host_view.h" -#include "content/public/test/screenshot_test_utils.h" -#include "ui/base/ui_base_features.h" - -// TODO(crbug.com/958242): Move the baselines to skia gold for easier -// rebaselining when all platforms are supported - -// To rebaseline this test on all platforms: -// 1. Run a CQ+1 dry run. -// 2. Click the failing bots for android, windows, mac, and linux. -// 3. Find the failing interactive_ui_browsertests step. -// 4. Click the "Deterministic failure" link for the failing test case. -// 5. Copy the "Actual pixels" data url and paste into browser. -// 6. Save the image into your chromium checkout in -// chrome/test/data/focus_rings. - -class FocusRingBrowserTest : public InProcessBrowserTest { - public: - FocusRingBrowserTest() { - feature_list_.InitWithFeatures({features::kFormControlsRefresh}, {}); - } - - void SetUp() override { - EnablePixelOutput(); - InProcessBrowserTest::SetUp(); - } - - void SetUpCommandLine(base::CommandLine* command_line) override { - InProcessBrowserTest::SetUpCommandLine(command_line); - content::SetUpCommandLineForScreenshotTest(command_line); - } - - void RunTest(const std::string& screenshot_filename, - const std::string& body_html, - int screenshot_width, - int screenshot_height) { - base::ScopedAllowBlockingForTesting allow_blocking; - - ASSERT_TRUE(features::IsFormControlsRefreshEnabled()); - - base::FilePath dir_test_data; - ASSERT_TRUE(base::PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); - base::FilePath golden_screenshot_filepath = - dir_test_data.AppendASCII("focus_rings") - .AppendASCII(screenshot_filename + ".png"); - - content::WebContents* web_contents = - browser()->tab_strip_model()->GetActiveWebContents(); - ASSERT_TRUE(content::NavigateToURL( - web_contents, - GURL("data:text/html,<!DOCTYPE html><body>" + body_html + "</body>"))); - ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); - - content::RunScreenshotTest(web_contents, golden_screenshot_filepath, - screenshot_width, screenshot_height); - } - - private: - base::test::ScopedFeatureList feature_list_; -}; - -IN_PROC_BROWSER_TEST_F(FocusRingBrowserTest, Checkbox) { - RunTest("focus_ring_browsertest_checkbox", - "<input type=checkbox autofocus>" - "<input type=checkbox>", - /* screenshot_width */ 60, - /* screenshot_height */ 40); -} - -IN_PROC_BROWSER_TEST_F(FocusRingBrowserTest, Radio) { - RunTest("focus_ring_browsertest_radio", - "<input type=radio autofocus>" - "<input type=radio>", - /* screenshot_width */ 60, - /* screenshot_height */ 40); -} - -IN_PROC_BROWSER_TEST_F(FocusRingBrowserTest, Button) { - RunTest("focus_ring_browsertest_button", - "<button autofocus>button</button>" - "<br>" - "<br>" - "<button>button</button>", - /* screenshot_width */ 80, - /* screenshot_height */ 80); -} - -IN_PROC_BROWSER_TEST_F(FocusRingBrowserTest, Anchor) { - RunTest("focus_ring_browsertest_anchor", - "<div style='text-align: center; width: 80px;'>" - " <a href='foo' autofocus>line one<br>two</a>" - "</div>" - "<br>" - "<div style='text-align: center; width: 80px;'>" - " <a href='foo'>line one<br>two</a>" - "</div>", - /* screenshot_width */ 90, - /* screenshot_height */ 130); -}
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc index 2f43eab..0819194 100644 --- a/chrome/browser/printing/print_job_worker.cc +++ b/chrome/browser/printing/print_job_worker.cc
@@ -209,7 +209,9 @@ DCHECK_CURRENTLY_ON(BrowserThread::UI); std::unique_ptr<crash_keys::ScopedPrinterInfo> crash_key; - if (new_settings.FindIntKey(kSettingPrinterType).value() == kLocalPrinter) { + PrinterType type = static_cast<PrinterType>( + new_settings.FindIntKey(kSettingPrinterType).value()); + if (type == PrinterType::kLocal) { #if defined(OS_WIN) // Blocking is needed here because Windows printer drivers are oftentimes // not thread-safe and have to be accessed on the UI thread.
diff --git a/chrome/browser/printing/print_test_utils.cc b/chrome/browser/printing/print_test_utils.cc index ab3585c1..3fd8cc1 100644 --- a/chrome/browser/printing/print_test_utils.cc +++ b/chrome/browser/printing/print_test_utils.cc
@@ -38,7 +38,7 @@ ticket.SetBoolKey(kSettingShouldPrintSelectionOnly, false); ticket.SetBoolKey(kSettingPreviewModifiable, true); ticket.SetBoolKey(kSettingPreviewIsPdf, false); - ticket.SetIntKey(kSettingPrinterType, type); + ticket.SetIntKey(kSettingPrinterType, static_cast<int>(type)); ticket.SetBoolKey(kSettingRasterizePdf, false); ticket.SetIntKey(kSettingScaleFactor, 100); ticket.SetIntKey(kSettingScalingType, FIT_TO_PAGE); @@ -50,9 +50,9 @@ ticket.SetIntKey(kSettingPageHeight, 279400); ticket.SetBoolKey(kSettingShowSystemDialog, false); - if (type == kCloudPrinter) { + if (type == PrinterType::kCloud) { ticket.SetStringKey(kSettingCloudPrintId, kDummyPrinterName); - } else if (type == kPrivetPrinter || type == kExtensionPrinter) { + } else if (type == PrinterType::kPrivet || type == PrinterType::kExtension) { base::Value capabilities(base::Value::Type::DICTIONARY); capabilities.SetBoolKey("duplex", true); // non-empty std::string caps_string;
diff --git a/chrome/browser/printing/print_view_manager_basic_unittest.cc b/chrome/browser/printing/print_view_manager_basic_unittest.cc index ba2a2670..d7f6728 100644 --- a/chrome/browser/printing/print_view_manager_basic_unittest.cc +++ b/chrome/browser/printing/print_view_manager_basic_unittest.cc
@@ -56,7 +56,7 @@ auto query = queue->CreatePrinterQuery(main_rfh()->GetProcess()->GetID(), main_rfh()->GetRoutingID()); base::RunLoop runloop; - query->SetSettings(GetPrintTicket(printing::kLocalPrinter), + query->SetSettings(GetPrintTicket(PrinterType::kLocal), runloop.QuitClosure()); runloop.Run(); auto cookie = query->cookie();
diff --git a/chrome/browser/printing/print_view_manager_unittest.cc b/chrome/browser/printing/print_view_manager_unittest.cc index 951972c..81d6a2c 100644 --- a/chrome/browser/printing/print_view_manager_unittest.cc +++ b/chrome/browser/printing/print_view_manager_unittest.cc
@@ -146,7 +146,7 @@ print_view_manager->PrintPreviewNow(web_contents->GetMainFrame(), false); - base::Value print_ticket = GetPrintTicket(printing::kLocalPrinter); + base::Value print_ticket = GetPrintTicket(PrinterType::kLocal); const char kTestData[] = "abc"; auto print_data = base::MakeRefCounted<base::RefCountedStaticMemory>( kTestData, sizeof(kTestData));
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc index ba0a4ad..7e0e0fa6 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc
@@ -111,6 +111,16 @@ return OTRProfileID("profile::primary_otr"); } +// static +int Profile::OTRProfileID::first_unused_index_ = 0; + +// static +Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( + const std::string& profile_id_prefix) { + return OTRProfileID(base::StringPrintf("%s-%i", profile_id_prefix.c_str(), + first_unused_index_++)); +} + const std::string& Profile::OTRProfileID::ToString() const { return profile_id_; }
diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h index fd9b2978..8963d11 100644 --- a/chrome/browser/profiles/profile.h +++ b/chrome/browser/profiles/profile.h
@@ -115,6 +115,9 @@ // |GuestID| when the use cases are reduced. static const OTRProfileID PrimaryID(); + // Creates a unique OTR profile id with the given profile id prefix. + static OTRProfileID CreateUnique(const std::string& profile_id_prefix); + bool operator==(const OTRProfileID& other) const { return profile_id_ == other.profile_id_; } @@ -137,6 +140,8 @@ // message. const std::string& ToString() const; + static int first_unused_index_; + const std::string profile_id_; };
diff --git a/chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js b/chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js index bf798c7..690e49f 100644 --- a/chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js +++ b/chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js
@@ -43,7 +43,7 @@ windowId = win.id; } webview.executeScript({file: 'inject.js'}); - }); + }, {once: true}); } chrome.runtime.onMessageExternal.addListener(function(
diff --git a/chrome/browser/resources/print_preview/BUILD.gn b/chrome/browser/resources/print_preview/BUILD.gn index b55cb154..cd1726d 100644 --- a/chrome/browser/resources/print_preview/BUILD.gn +++ b/chrome/browser/resources/print_preview/BUILD.gn
@@ -67,8 +67,7 @@ is_polymer3 = true deps = [ ":cloud_print_interface", - ":cloud_print_interface_js", - ":cloud_print_interface_manager", + ":cloud_print_interface_impl", ":dark_mode_behavior", ":metrics", ":native_layer", @@ -90,22 +89,14 @@ js_library("cloud_print_interface") { deps = [ + ":native_layer", "data:destination", "data:invitation", "//ui/webui/resources/js/cr:event_target.m", ] } -js_library("cloud_print_interface_manager") { - deps = [ - ":cloud_print_interface", - ":cloud_print_interface_js", - ":native_layer", - "//ui/webui/resources/js:load_time_data.m", - ] -} - -js_library("cloud_print_interface_js") { +js_library("cloud_print_interface_impl") { deps = [ ":cloud_print_interface", ":native_layer", @@ -113,6 +104,7 @@ "data:destination", "data:invitation", "//ui/webui/resources/js:assert.m", + "//ui/webui/resources/js:cr.m", "//ui/webui/resources/js/cr:event_target.m", ] }
diff --git a/chrome/browser/resources/print_preview/cloud_print_interface.js b/chrome/browser/resources/print_preview/cloud_print_interface.js index de2a7ba..e144820 100644 --- a/chrome/browser/resources/print_preview/cloud_print_interface.js +++ b/chrome/browser/resources/print_preview/cloud_print_interface.js
@@ -5,6 +5,7 @@ import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; import {Destination, DestinationOrigin} from './data/destination.js'; import {Invitation} from './data/invitation.js'; +import {NativeLayer} from './native_layer.js'; /** * Event types dispatched by the cloudprint interface. @@ -76,6 +77,21 @@ areCookieDestinationsDisabled() {} /** + * @param {string} baseUrl Base part of the Google Cloud Print service URL + * with no trailing slash. For example, + * 'https://www.google.com/cloudprint'. + * @param {!NativeLayer} nativeLayer Native layer used to get + * Auth2 tokens. + * @param {boolean} isInAppKioskMode Whether the print preview is in App + * Kiosk mode. + * @param {string} uiLocale The UI locale. + */ + configure(baseUrl, nativeLayer, isInAppKioskMode, uiLocale) {} + + /** @return {boolean} Whether the interface has been configured. */ + isConfigured() {} + + /** * @return {boolean} Whether a search for cloud destinations is in progress. */ isCloudDestinationSearchInProgress() {}
diff --git a/chrome/browser/resources/print_preview/cloud_print_interface_js.js b/chrome/browser/resources/print_preview/cloud_print_interface_impl.js similarity index 97% rename from chrome/browser/resources/print_preview/cloud_print_interface_js.js rename to chrome/browser/resources/print_preview/cloud_print_interface_impl.js index 16af928..6044257 100644 --- a/chrome/browser/resources/print_preview/cloud_print_interface_js.js +++ b/chrome/browser/resources/print_preview/cloud_print_interface_impl.js
@@ -3,6 +3,7 @@ // found in the LICENSE file. import {assert} from 'chrome://resources/js/assert.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; import {CloudPrintInterface, CloudPrintInterfaceErrorEventDetail, CloudPrintInterfaceEventType} from './cloud_print_interface.js'; @@ -13,44 +14,33 @@ /** @implements {CloudPrintInterface} */ -export class CloudPrintInterfaceJS { - /** - * API to the Google Cloud Print service. - * @param {string} baseUrl Base part of the Google Cloud Print service URL - * with no trailing slash. For example, - * 'https://www.google.com/cloudprint'. - * @param {!NativeLayer} nativeLayer Native layer used to get - * Auth2 tokens. - * @param {boolean} isInAppKioskMode Whether the print preview is in App - * Kiosk mode. - * @param {string} uiLocale The UI locale. - */ - constructor(baseUrl, nativeLayer, isInAppKioskMode, uiLocale) { +export class CloudPrintInterfaceImpl { + constructor() { /** * The base URL of the Google Cloud Print API. * @private {string} */ - this.baseUrl_ = baseUrl; + this.baseUrl_ = ''; /** * Used to get Auth2 tokens. - * @private {!NativeLayer} + * @private {?NativeLayer} */ - this.nativeLayer_ = nativeLayer; + this.nativeLayer_ = null; /** * Whether Print Preview is in App Kiosk mode; use only printers available * for the device and disable cookie destinations. * @private {boolean} */ - this.isInAppKioskMode_ = isInAppKioskMode; + this.isInAppKioskMode_ = false; /** * The UI locale, used to get printer information in the correct locale * from Google Cloud Print. * @private {string} */ - this.uiLocale_ = uiLocale; + this.uiLocale_ = ''; /** * Currently logged in users (identified by email) mapped to the Google @@ -87,6 +77,19 @@ } /** @override */ + configure(baseUrl, nativeLayer, isInAppKioskMode, uiLocale) { + this.baseUrl_ = baseUrl; + this.nativeLayer_ = nativeLayer; + this.isInAppKioskMode_ = isInAppKioskMode; + this.uiLocale_ = uiLocale; + } + + /** @override */ + isConfigured() { + return this.baseUrl_ !== ''; + } + + /** @override */ areCookieDestinationsDisabled() { return this.isInAppKioskMode_; } @@ -625,6 +628,8 @@ } } +addSingletonGetter(CloudPrintInterfaceImpl); + /** * Content type header value for a URL encoded HTTP request. * @const {string}
diff --git a/chrome/browser/resources/print_preview/cloud_print_interface_manager.js b/chrome/browser/resources/print_preview/cloud_print_interface_manager.js deleted file mode 100644 index b004d5a0..0000000 --- a/chrome/browser/resources/print_preview/cloud_print_interface_manager.js +++ /dev/null
@@ -1,38 +0,0 @@ -// Copyright (c) 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; -import {CloudPrintInterface} from './cloud_print_interface.js'; -import {CloudPrintInterfaceJS} from './cloud_print_interface_js.js'; -import {NativeLayer} from './native_layer.js'; - -/** @type {?CloudPrintInterface} */ -let instance = null; - -/** - * @param {string} baseUrl Base part of the Google Cloud Print service URL - * with no trailing slash. For example, - * 'https://www.google.com/cloudprint'. - * @param {!NativeLayer} nativeLayer Native layer instance. - * @param {boolean} isInAppKioskMode Whether the print preview is in App - * Kiosk mode. - * @param {string} uiLocale The UI locale, for example "en-US" or "fr". - * @return {!CloudPrintInterface} - */ -export function getCloudPrintInterface( - baseUrl, nativeLayer, isInAppKioskMode, uiLocale) { - if (instance === null) { - instance = new CloudPrintInterfaceJS( - baseUrl, nativeLayer, isInAppKioskMode, uiLocale); - } - return instance; -} - -/** - * Sets the CloudPrintInterface singleton instance, useful for testing. - * @param {!CloudPrintInterface} cloudPrintInterface - */ -export function setCloudPrintInterfaceForTesting(cloudPrintInterface) { - instance = cloudPrintInterface; -}
diff --git a/chrome/browser/resources/print_preview/data/user_manager.js b/chrome/browser/resources/print_preview/data/user_manager.js index fb96c98..7fc1ee4 100644 --- a/chrome/browser/resources/print_preview/data/user_manager.js +++ b/chrome/browser/resources/print_preview/data/user_manager.js
@@ -8,6 +8,7 @@ import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {CloudPrintInterface, CloudPrintInterfaceErrorEventDetail, CloudPrintInterfaceEventType} from '../cloud_print_interface.js'; +import {CloudPrintInterfaceImpl} from '../cloud_print_interface_impl.js'; import {Destination, DestinationOrigin} from './destination.js'; import {DestinationStore} from './destination_store.js'; @@ -34,14 +35,7 @@ cloudPrintDisabled: { type: Boolean, - value: true, - notify: true, - }, - - /** @type {?CloudPrintInterface} */ - cloudPrintInterface: { - type: Object, - observer: 'onCloudPrintInterfaceSet_', + observer: 'onCloudPrintDisabledChanged_', }, /** @type {?DestinationStore} */ @@ -62,6 +56,9 @@ }, }, + /** @private {?CloudPrintInterface} */ + cloudPrintInterface_: null, + /** @private {boolean} */ initialized_: false, @@ -108,23 +105,26 @@ }, /** @private */ - onCloudPrintInterfaceSet_() { + onCloudPrintDisabledChanged_() { + if (this.cloudPrintDisabled) { + return; + } + + this.cloudPrintInterface_ = CloudPrintInterfaceImpl.getInstance(); this.tracker_.add( - this.cloudPrintInterface.getEventTarget(), + this.cloudPrintInterface_.getEventTarget(), CloudPrintInterfaceEventType.UPDATE_USERS, this.onCloudPrintUpdateUsers_.bind(this)); [CloudPrintInterfaceEventType.SEARCH_FAILED, CloudPrintInterfaceEventType.PRINTER_FAILED, ].forEach(eventType => { this.tracker_.add( - this.cloudPrintInterface.getEventTarget(), eventType, + this.cloudPrintInterface_.getEventTarget(), eventType, this.checkCloudPrintStatus_.bind(this)); }); if (this.users.length > 0) { - this.cloudPrintInterface.setUsers(this.users); + this.cloudPrintInterface_.setUsers(this.users); } - assert(this.cloudPrintDisabled); - this.cloudPrintDisabled = false; }, /** @@ -136,7 +136,7 @@ */ checkCloudPrintStatus_(event) { if (event.detail.status !== 403 || - this.cloudPrintInterface.areCookieDestinationsDisabled()) { + this.cloudPrintInterface_.areCookieDestinationsDisabled()) { return; } @@ -167,8 +167,8 @@ const updateActiveUser = (users.length > 0 && this.users.length === 0) || !users.includes(this.activeUser); this.users = users; - if (this.cloudPrintInterface) { - this.cloudPrintInterface.setUsers(users); + if (this.cloudPrintInterface_) { + this.cloudPrintInterface_.setUsers(users); } if (updateActiveUser) { this.updateActiveUser(this.users[0] || '');
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js index 80aa82a..21658c8 100644 --- a/chrome/browser/resources/print_preview/print_preview.js +++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -5,7 +5,7 @@ import './ui/app.js'; export {CloudPrintInterface, CloudPrintInterfaceEventType} from './cloud_print_interface.js'; -export {setCloudPrintInterfaceForTesting} from './cloud_print_interface_manager.js'; +export {CloudPrintInterfaceImpl} from './cloud_print_interface_impl.js'; export {ColorMode, createDestinationKey, Destination, DestinationCertificateStatus, DestinationConnectionStatus, DestinationOrigin, DestinationType, makeRecentDestination} from './data/destination.js'; export {PrinterType} from './data/destination_match.js'; // <if expr="chromeos">
diff --git a/chrome/browser/resources/print_preview/print_preview_resources.grd b/chrome/browser/resources/print_preview/print_preview_resources.grd index 4ae825d..89004fc 100644 --- a/chrome/browser/resources/print_preview/print_preview_resources.grd +++ b/chrome/browser/resources/print_preview/print_preview_resources.grd
@@ -148,13 +148,10 @@ <structure name="IDR_PRINT_PREVIEW_CLOUD_PRINT_INTERFACE_JS" file="cloud_print_interface.js" type="chrome_html" /> - <structure name="IDR_PRINT_PREVIEW_CLOUD_PRINT_INTERFACE_JS_JS" - file="cloud_print_interface_js.js" + <structure name="IDR_PRINT_PREVIEW_CLOUD_PRINT_INTERFACE_IMPL_JS" + file="cloud_print_interface_impl.js" type="chrome_html" preprocess="true" /> - <structure name="IDR_PRINT_PREVIEW_CLOUD_PRINT_INTERFACE_MANAGER_JS" - file="cloud_print_interface_manager.js" - type="chrome_html" /> <structure name="IDR_PRINT_PREVIEW_NATIVE_LAYER_JS" file="native_layer.js" type="chrome_html"
diff --git a/chrome/browser/resources/print_preview/ui/BUILD.gn b/chrome/browser/resources/print_preview/ui/BUILD.gn index b33e1f7..a093fca 100644 --- a/chrome/browser/resources/print_preview/ui/BUILD.gn +++ b/chrome/browser/resources/print_preview/ui/BUILD.gn
@@ -62,7 +62,7 @@ ":preview_area", ":sidebar", "..:cloud_print_interface", - "..:cloud_print_interface_manager", + "..:cloud_print_interface_impl", "..:native_layer", "../data:destination", "../data:document_info", @@ -98,7 +98,6 @@ ":pages_per_sheet_settings", ":pages_settings", ":scaling_settings", - "..:cloud_print_interface", "..:dark_mode_behavior", "..:metrics", "../data:destination", @@ -136,7 +135,7 @@ ":destination_dialog", ":destination_select", ":settings_behavior", - "..:cloud_print_interface", + "..:cloud_print_interface_impl", "../data:destination", "../data:destination_store", "../data:invitation_store",
diff --git a/chrome/browser/resources/print_preview/ui/app.html b/chrome/browser/resources/print_preview/ui/app.html index 7e82be9..0d6e6ae0 100644 --- a/chrome/browser/resources/print_preview/ui/app.html +++ b/chrome/browser/resources/print_preview/ui/app.html
@@ -46,7 +46,6 @@ </print-preview-preview-area> </div> <print-preview-sidebar id="sidebar" - cloud-print-interface="[[cloudPrintInterface_]]" cloud-print-error-message="[[cloudPrintErrorMessage_]]" destination-state="{{destinationState_}}" controls-managed="[[controlsManaged_]]" destination="{{destination_}}"
diff --git a/chrome/browser/resources/print_preview/ui/app.js b/chrome/browser/resources/print_preview/ui/app.js index 7e8e246..f97079de8 100644 --- a/chrome/browser/resources/print_preview/ui/app.js +++ b/chrome/browser/resources/print_preview/ui/app.js
@@ -17,7 +17,7 @@ import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {CloudPrintInterface, CloudPrintInterfaceErrorEventDetail, CloudPrintInterfaceEventType} from '../cloud_print_interface.js'; -import {getCloudPrintInterface} from '../cloud_print_interface_manager.js'; +import {CloudPrintInterfaceImpl} from '../cloud_print_interface_impl.js'; import {Destination} from '../data/destination.js'; import {DocumentSettings} from '../data/document_info.js'; import {Margins} from '../data/margins.js'; @@ -340,7 +340,8 @@ */ initializeCloudPrint_(cloudPrintUrl, appKioskMode, uiLocale) { assert(!this.cloudPrintInterface_); - this.cloudPrintInterface_ = getCloudPrintInterface( + this.cloudPrintInterface_ = CloudPrintInterfaceImpl.getInstance(); + this.cloudPrintInterface_.configure( cloudPrintUrl, assert(this.nativeLayer_), appKioskMode, uiLocale); this.tracker_.add( assert(this.cloudPrintInterface_).getEventTarget(),
diff --git a/chrome/browser/resources/print_preview/ui/destination_settings.html b/chrome/browser/resources/print_preview/ui/destination_settings.html index 9c6d5c8..4de6fcb 100644 --- a/chrome/browser/resources/print_preview/ui/destination_settings.html +++ b/chrome/browser/resources/print_preview/ui/destination_settings.html
@@ -33,8 +33,7 @@ } </style> <print-preview-user-manager id="userManager" active-user="{{activeUser_}}" - cloud-print-disabled="{{cloudPrintDisabled_}}" - cloud-print-interface="[[cloudPrintInterface]]" + cloud-print-disabled="[[cloudPrintDisabled_]]" users="{{users_}}" destination-store="[[destinationStore_]]" invitation-store="[[invitationStore_]]" should-reload-cookies="[[isDialogOpen_]]">
diff --git a/chrome/browser/resources/print_preview/ui/destination_settings.js b/chrome/browser/resources/print_preview/ui/destination_settings.js index 6d1d029..5419222 100644 --- a/chrome/browser/resources/print_preview/ui/destination_settings.js +++ b/chrome/browser/resources/print_preview/ui/destination_settings.js
@@ -20,7 +20,7 @@ import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; import {beforeNextRender, html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {CloudPrintInterface} from '../cloud_print_interface.js'; +import {CloudPrintInterfaceImpl} from '../cloud_print_interface_impl.js'; import {createDestinationKey, createRecentDestinationKey, Destination, DestinationOrigin, makeRecentDestination, RecentDestination} from '../data/destination.js'; import {DestinationErrorType, DestinationStore} from '../data/destination_store.js'; import {InvitationStore} from '../data/invitation_store.js'; @@ -52,12 +52,6 @@ ], properties: { - /** @type {CloudPrintInterface} */ - cloudPrintInterface: { - type: Object, - observer: 'onCloudPrintInterfaceSet_', - }, - dark: Boolean, /** @type {?Destination} */ @@ -96,7 +90,10 @@ }, /** @private {boolean} */ - cloudPrintDisabled_: Boolean, + cloudPrintDisabled_: { + type: Boolean, + value: true, + }, /** @private {?DestinationStore} */ destinationStore_: { @@ -205,13 +202,6 @@ }, /** @private */ - onCloudPrintInterfaceSet_() { - const cloudPrintInterface = assert(this.cloudPrintInterface); - this.destinationStore_.setCloudPrintInterface(cloudPrintInterface); - this.invitationStore_.setCloudPrintInterface(cloudPrintInterface); - }, - - /** @private */ updateDriveDestinationReady_() { const key = createDestinationKey( Destination.GooglePromotedId.DOCS, DestinationOrigin.COOKIES, @@ -293,6 +283,12 @@ init( defaultPrinter, pdfPrinterDisabled, serializedDefaultDestinationRulesStr, userAccounts, syncAvailable) { + const cloudPrintInterface = CloudPrintInterfaceImpl.getInstance(); + if (cloudPrintInterface.isConfigured()) { + this.cloudPrintDisabled_ = false; + this.destinationStore_.setCloudPrintInterface(cloudPrintInterface); + this.invitationStore_.setCloudPrintInterface(cloudPrintInterface); + } this.pdfPrinterDisabled_ = pdfPrinterDisabled; this.$.userManager.initUserAccounts(userAccounts, syncAvailable); this.destinationStore_.init(
diff --git a/chrome/browser/resources/print_preview/ui/sidebar.html b/chrome/browser/resources/print_preview/ui/sidebar.html index 81f744fc..85f028c 100644 --- a/chrome/browser/resources/print_preview/ui/sidebar.html +++ b/chrome/browser/resources/print_preview/ui/sidebar.html
@@ -42,8 +42,8 @@ </print-preview-header> <div id="container" show-bottom-shadow> <print-preview-destination-settings id="destinationSettings" - cloud-print-interface="[[cloudPrintInterface]]" dark="[[inDarkMode]]" - destination="{{destination}}" destination-state="{{destinationState}}" + dark="[[inDarkMode]]" destination="{{destination}}" + destination-state="{{destinationState}}" error="{{error}}" first-load="[[firstLoad_]]" settings="[[settings]]" state="[[state]]" app-kiosk-mode="[[isInAppKioskMode_]]" disabled="[[controlsDisabled_]]"
diff --git a/chrome/browser/resources/print_preview/ui/sidebar.js b/chrome/browser/resources/print_preview/ui/sidebar.js index 53ae52d6..b85fbb77 100644 --- a/chrome/browser/resources/print_preview/ui/sidebar.js +++ b/chrome/browser/resources/print_preview/ui/sidebar.js
@@ -35,7 +35,6 @@ import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {CloudPrintInterface} from '../cloud_print_interface.js'; import {DarkModeBehavior} from '../dark_mode_behavior.js'; import {Destination} from '../data/destination.js'; import {Error, State} from '../data/state.js'; @@ -65,9 +64,6 @@ properties: { cloudPrintErrorMessage: String, - /** @type {CloudPrintInterface} */ - cloudPrintInterface: Object, - controlsManaged: Boolean, /** @type {Destination} */
diff --git a/chrome/browser/resources/settings/chromeos/os_about_page/os_about_page.html b/chrome/browser/resources/settings/chromeos/os_about_page/os_about_page.html index a6df326a..77d3c91a 100644 --- a/chrome/browser/resources/settings/chromeos/os_about_page/os_about_page.html +++ b/chrome/browser/resources/settings/chromeos/os_about_page/os_about_page.html
@@ -63,7 +63,7 @@ } iron-icon[icon='settings:check-circle'] { - fill: var(--cros-default-button-color); + fill: var(--cros-default-icon-color-prominent); } iron-icon[icon='cr:error'] {
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/os_apps_page.html b/chrome/browser/resources/settings/chromeos/os_apps_page/os_apps_page.html index 0d9aa09..e78e562 100644 --- a/chrome/browser/resources/settings/chromeos/os_apps_page/os_apps_page.html +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/os_apps_page.html
@@ -31,13 +31,11 @@ <settings-animated-pages id="pages" section="apps" focus-config="[[focusConfig_]]"> <div route-path="default"> - <template is="dom-if" if="[[showAppManagement]]"> - <cr-link-row id="appManagement" - label="$i18n{appManagementTitle}" - on-click="onClickAppManagement_" - role-description="$i18n{subpageArrowRoleDescription}"> - </cr-link-row> - </template> + <cr-link-row id="appManagement" + label="$i18n{appManagementTitle}" + on-click="onClickAppManagement_" + role-description="$i18n{subpageArrowRoleDescription}"> + </cr-link-row> <template is="dom-if" if="[[showAndroidApps]]"> <template is="dom-if" if="[[havePlayStoreApp]]" restamp> <div id="android-apps" class="settings-box first" @@ -80,28 +78,27 @@ </template> </template> </div> - <!-- APP MANAGEMENT --> - <template is="dom-if" if="[[showAppManagement]]"> - <template is="dom-if" route-path="/app-management" no-search> - <settings-subpage - page-title="$i18n{appManagementTitle}" - search-label="$i18n{appManagementSearchPrompt}" - search-term="{{searchTerm}}"> - <settings-app-management-page search-term="[[searchTerm]]"> - </settings-app-management-page> - </settings-subpage> - </template> - <template is="dom-if" route-path="/app-management/detail" no-search> - <settings-subpage - page-title="[[app_.title]]" - title-icon="[[iconUrlFromId_(app_)]]"> - <app-management-uninstall-button slot="subpage-title-extra"> - </app-management-uninstall-button> - <app-management-app-detail-view> - </app-management-app-detail-view> - </settings-subpage> - </template> + <!-- APP MANAGEMENT --> + <template is="dom-if" route-path="/app-management" no-search> + <settings-subpage + page-title="$i18n{appManagementTitle}" + search-label="$i18n{appManagementSearchPrompt}" + search-term="{{searchTerm}}"> + <settings-app-management-page search-term="[[searchTerm]]"> + </settings-app-management-page> + </settings-subpage> + </template> + + <template is="dom-if" route-path="/app-management/detail" no-search> + <settings-subpage + page-title="[[app_.title]]" + title-icon="[[iconUrlFromId_(app_)]]"> + <app-management-uninstall-button slot="subpage-title-extra"> + </app-management-uninstall-button> + <app-management-app-detail-view> + </app-management-app-detail-view> + </settings-subpage> </template> <!-- ANDROID APPS -->
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/os_apps_page.js b/chrome/browser/resources/settings/chromeos/os_apps_page/os_apps_page.js index f0a7a2b..44f2b56 100644 --- a/chrome/browser/resources/settings/chromeos/os_apps_page/os_apps_page.js +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/os_apps_page.js
@@ -46,13 +46,6 @@ */ showAndroidApps: Boolean, - - /** - * Show link to App Management. - * @type {boolean} - */ - showAppManagement: Boolean, - /** @private {!Map<string, string>} */ focusConfig_: { type: Object,
diff --git a/chrome/browser/resources/settings/chromeos/os_route.js b/chrome/browser/resources/settings/chromeos/os_route.js index 738a87a..f7c8252d 100644 --- a/chrome/browser/resources/settings/chromeos/os_route.js +++ b/chrome/browser/resources/settings/chromeos/os_route.js
@@ -132,21 +132,15 @@ r.OS_RESET = r.ADVANCED.createSection('/osReset', 'osReset'); } - const showAppManagement = loadTimeData.valueExists('showAppManagement') && - loadTimeData.getBoolean('showAppManagement'); - const showAndroidApps = loadTimeData.valueExists('androidAppsVisible') && - loadTimeData.getBoolean('androidAppsVisible'); // Apps - if (showAppManagement || showAndroidApps) { - r.APPS = r.BASIC.createSection('/apps', 'apps'); - if (showAppManagement) { - r.APP_MANAGEMENT = r.APPS.createChild('/app-management'); - r.APP_MANAGEMENT_DETAIL = - r.APP_MANAGEMENT.createChild('/app-management/detail'); - } - if (showAndroidApps) { - r.ANDROID_APPS_DETAILS = r.APPS.createChild('/androidAppsDetails'); - } + r.APPS = r.BASIC.createSection('/apps', 'apps'); + r.APP_MANAGEMENT = r.APPS.createChild('/app-management'); + r.APP_MANAGEMENT_DETAIL = + r.APP_MANAGEMENT.createChild('/app-management/detail'); + // Android apps page + if (loadTimeData.valueExists('androidAppsVisible') && + loadTimeData.getBoolean('androidAppsVisible')) { + r.ANDROID_APPS_DETAILS = r.APPS.createChild('/androidAppsDetails'); } r.DATETIME = r.ADVANCED.createSection('/dateTime', 'dateTime');
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.html b/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.html index 92b9795..41c13b8 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.html +++ b/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.html
@@ -64,8 +64,6 @@ <os-settings-page prefs="{{prefs}}" page-visibility="[[pageVisibility]]" show-android-apps="[[showAndroidApps]]" - show-app-management="[[showAppManagement]]" - show-apps="[[showApps]]" show-crostini="[[showCrostini]]" show-plugin-vm="[[showPluginVm]]" show-reset="[[showReset]]"
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.js b/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.js index 113faf1..63a70603 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.js +++ b/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.js
@@ -81,10 +81,6 @@ showAndroidApps: Boolean, - showAppManagement: Boolean, - - showApps: Boolean, - showCrostini: Boolean, showReset: Boolean,
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.html b/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.html index bf394417..6ead3d5 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.html +++ b/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.html
@@ -18,7 +18,7 @@ <template> <style include="settings-shared"> :host { - --menu-link-color: var(--cros-default-button-color); + --menu-link-color: var(--cros-default-icon-color-prominent); --menu-text-color: var(--cros-default-text-color-secondary); --menu-icon-color: var(--cros-default-text-color-secondary); /* The tap target extends slightly above each visible menu item. */ @@ -204,7 +204,7 @@ $i18n{osSearchPageTitle} </div> </a> - <a href="/apps" hidden="[[!showApps]]"> + <a href="/apps"> <div class="item"> <iron-icon icon="os-settings:apps"></iron-icon> $i18n{appsPageTitle}
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.js b/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.js index 2a6b6b8a..e30b400 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.js +++ b/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.js
@@ -28,8 +28,6 @@ readOnly: true, }, - showApps: Boolean, - showCrostini: Boolean, showReset: Boolean,
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.html b/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.html index 5f42776f3..a8977af 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.html +++ b/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.html
@@ -168,17 +168,14 @@ <os-settings-search-page prefs="{{prefs}}"> </os-settings-search-page> </settings-section> - <template is="dom-if" if="[[showApps]]" restamp> - <settings-section page-title="$i18n{appsPageTitle}" section="apps"> - <os-settings-apps-page - prefs="{{prefs}}" - android-apps-info="[[androidAppsInfo]]" - have-play-store-app="[[havePlayStoreApp]]" - show-android-apps="[[showAndroidApps]]" - show-app-management="[[showAppManagement]]"> - </os-settings-apps-page> - </settings-section> - </template> + <settings-section page-title="$i18n{appsPageTitle}" section="apps"> + <os-settings-apps-page + prefs="{{prefs}}" + android-apps-info="[[androidAppsInfo]]" + have-play-store-app="[[havePlayStoreApp]]" + show-android-apps="[[showAndroidApps]]"> + </os-settings-apps-page> + </settings-section> <template is="dom-if" if="[[showCrostini]]" restamp> <settings-section page-title="$i18n{crostiniPageTitle}" section="crostini">
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.js b/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.js index 1dc14339..5a27c15 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.js +++ b/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.js
@@ -43,10 +43,6 @@ showAndroidApps: Boolean, - showAppManagement: Boolean, - - showApps: Boolean, - showCrostini: Boolean, showReset: Boolean,
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_ui/os_settings_ui.html b/chrome/browser/resources/settings/chromeos/os_settings_ui/os_settings_ui.html index f25f9e2..958f8ee 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_ui/os_settings_ui.html +++ b/chrome/browser/resources/settings/chromeos/os_settings_ui/os_settings_ui.html
@@ -122,7 +122,6 @@ <div class="drawer-content"> <template is="dom-if" id="drawerTemplate"> <os-settings-menu - show-apps="[[showApps_]]" show-crostini="[[showCrostini_]]" show-plugin-vm="[[showPluginVm_]]" show-reset="[[showReset_]]" @@ -136,7 +135,6 @@ <div id="container" class="no-outline"> <div id="left"> <os-settings-menu page-visibility="[[pageVisibility_]]" - show-apps="[[showApps_]]" show-crostini="[[showCrostini_]]" show-plugin-vm="[[showPluginVm_]]" show-reset="[[showReset_]]" @@ -149,8 +147,6 @@ toolbar-spinner-active="{{toolbarSpinnerActive_}}" page-visibility="[[pageVisibility_]]" show-android-apps="[[showAndroidApps_]]" - show-app-management="[[showAppManagement_]]" - show-apps="[[showApps_]]" show-crostini="[[showCrostini_]]" show-plugin-vm="[[showPluginVm_]]" show-reset="[[showReset_]]"
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_ui/os_settings_ui.js b/chrome/browser/resources/settings/chromeos/os_settings_ui/os_settings_ui.js index 0d7cf8f..b476ff3 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_ui/os_settings_ui.js +++ b/chrome/browser/resources/settings/chromeos/os_settings_ui/os_settings_ui.js
@@ -81,12 +81,6 @@ showAndroidApps_: Boolean, /** @private */ - showAppManagement_: Boolean, - - /** @private */ - showApps_: Boolean, - - /** @private */ showCrostini_: Boolean, /** @private */ @@ -158,9 +152,7 @@ }; this.havePlayStoreApp_ = loadTimeData.getBoolean('havePlayStoreApp'); - this.showAppManagement_ = loadTimeData.getBoolean('showAppManagement'); this.showAndroidApps_ = loadTimeData.getBoolean('androidAppsVisible'); - this.showApps_ = this.showAppManagement_ || this.showAndroidApps_; this.showCrostini_ = loadTimeData.getBoolean('showCrostini'); this.showPluginVm_ = loadTimeData.getBoolean('showPluginVm'); this.showReset_ = loadTimeData.getBoolean('allowPowerwash');
diff --git a/chrome/browser/search_engines/template_url_service_sync_unittest.cc b/chrome/browser/search_engines/template_url_service_sync_unittest.cc index 7b6a33a4..300449984 100644 --- a/chrome/browser/search_engines/template_url_service_sync_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_sync_unittest.cc
@@ -695,19 +695,16 @@ } TEST_F(TemplateURLServiceSyncTest, StartSyncEmpty) { + ASSERT_TRUE(model()->GetAllSyncData(syncer::SEARCH_ENGINES).empty()); syncer::SyncMergeResult merge_result = MergeAndExpectNotify(syncer::SyncDataList(), 0); EXPECT_EQ(0U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); EXPECT_EQ(0U, processor()->change_list_size()); - EXPECT_EQ(0, merge_result.num_items_added()); - EXPECT_EQ(0, merge_result.num_items_modified()); - EXPECT_EQ(0, merge_result.num_items_deleted()); - EXPECT_EQ(0, merge_result.num_items_before_association()); - EXPECT_EQ(0, merge_result.num_items_after_association()); } TEST_F(TemplateURLServiceSyncTest, MergeIntoEmpty) { + ASSERT_TRUE(model()->GetAllSyncData(syncer::SEARCH_ENGINES).empty()); syncer::SyncDataList initial_data = CreateInitialSyncData(); syncer::SyncMergeResult merge_result = MergeAndExpectNotify(initial_data, 1); @@ -721,13 +718,6 @@ } EXPECT_EQ(0U, processor()->change_list_size()); - - // Locally the three new TemplateURL's should have been added. - EXPECT_EQ(3, merge_result.num_items_added()); - EXPECT_EQ(0, merge_result.num_items_modified()); - EXPECT_EQ(0, merge_result.num_items_deleted()); - EXPECT_EQ(0, merge_result.num_items_before_association()); - EXPECT_EQ(3, merge_result.num_items_after_association()); } TEST_F(TemplateURLServiceSyncTest, MergeInAllNewData) { @@ -737,6 +727,7 @@ "def")); model()->Add(CreateTestTemplateURL(ASCIIToUTF16("xyz.com"), "http://xyz.com", "xyz")); + ASSERT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); syncer::SyncDataList initial_data = CreateInitialSyncData(); syncer::SyncMergeResult merge_result = MergeAndExpectNotify(initial_data, 1); @@ -757,13 +748,6 @@ EXPECT_TRUE(processor()->contains_guid("abc")); EXPECT_TRUE(processor()->contains_guid("def")); EXPECT_TRUE(processor()->contains_guid("xyz")); - - // Locally the three new TemplateURL's should have been added. - EXPECT_EQ(3, merge_result.num_items_added()); - EXPECT_EQ(0, merge_result.num_items_modified()); - EXPECT_EQ(0, merge_result.num_items_deleted()); - EXPECT_EQ(3, merge_result.num_items_before_association()); - EXPECT_EQ(6, merge_result.num_items_after_association()); } TEST_F(TemplateURLServiceSyncTest, MergeSyncIsTheSame) { @@ -775,6 +759,7 @@ iter != initial_data.end(); ++iter) { model()->Add(Deserialize(*iter)); } + ASSERT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); syncer::SyncMergeResult merge_result = MergeAndExpectNotify(initial_data, 0); EXPECT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); @@ -784,13 +769,6 @@ EXPECT_TRUE(model()->GetTemplateURLForGUID(guid)); } EXPECT_EQ(0U, processor()->change_list_size()); - - // Locally everything should remain the same. - EXPECT_EQ(0, merge_result.num_items_added()); - EXPECT_EQ(0, merge_result.num_items_modified()); - EXPECT_EQ(0, merge_result.num_items_deleted()); - EXPECT_EQ(3, merge_result.num_items_before_association()); - EXPECT_EQ(3, merge_result.num_items_after_association()); } TEST_F(TemplateURLServiceSyncTest, MergeUpdateFromSync) { @@ -812,6 +790,7 @@ initial_data.push_back( TemplateURLService::CreateSyncDataFromTemplateURL(*turl2_older)); + ASSERT_EQ(2U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); syncer::SyncMergeResult merge_result = MergeAndExpectNotify(initial_data, 1); // Both were local updates, so we expect the same count. @@ -827,13 +806,6 @@ syncer::SyncChange change = processor()->change_for_guid("xyz"); EXPECT_TRUE(change.change_type() == syncer::SyncChange::ACTION_UPDATE); EXPECT_EQ("http://xyz.com", GetURL(change.sync_data())); - - // Locally only the older item should have been modified. - EXPECT_EQ(0, merge_result.num_items_added()); - EXPECT_EQ(1, merge_result.num_items_modified()); - EXPECT_EQ(0, merge_result.num_items_deleted()); - EXPECT_EQ(2, merge_result.num_items_before_association()); - EXPECT_EQ(2, merge_result.num_items_after_association()); } TEST_F(TemplateURLServiceSyncTest, MergeAddFromOlderSyncData) { @@ -849,6 +821,7 @@ model()->Add(CreateTestTemplateURL(ASCIIToUTF16("unique"), "http://unique.com", "ccc")); // add + ASSERT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); syncer::SyncMergeResult merge_result = MergeAndExpectNotify(CreateInitialSyncData(), 1); @@ -895,15 +868,6 @@ ASSERT_TRUE(processor()->contains_guid("ccc")); EXPECT_EQ(syncer::SyncChange::ACTION_ADD, processor()->change_for_guid("ccc").change_type()); - - // All the sync items had new guids, but only one doesn't conflict and is - // added. The other two conflicting cases result in local modifications - // to override the local guids but preserve the local data. - EXPECT_EQ(1, merge_result.num_items_added()); - EXPECT_EQ(2, merge_result.num_items_modified()); - EXPECT_EQ(0, merge_result.num_items_deleted()); - EXPECT_EQ(3, merge_result.num_items_before_association()); - EXPECT_EQ(4, merge_result.num_items_after_association()); } TEST_F(TemplateURLServiceSyncTest, MergeAddFromNewerSyncData) { @@ -921,6 +885,7 @@ "http://unique.com", "ccc", 10, false, false, 113)); // add + ASSERT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); syncer::SyncMergeResult merge_result = MergeAndExpectNotify(CreateInitialSyncData(), 1); @@ -954,15 +919,6 @@ ASSERT_TRUE(processor()->contains_guid("ccc")); EXPECT_EQ(syncer::SyncChange::ACTION_ADD, processor()->change_for_guid("ccc").change_type()); - - // One of the sync items is added directly without conflict. The other two - // conflict but are newer than the local items so are added while the local - // is deleted. - EXPECT_EQ(3, merge_result.num_items_added()); - EXPECT_EQ(0, merge_result.num_items_modified()); - EXPECT_EQ(2, merge_result.num_items_deleted()); - EXPECT_EQ(3, merge_result.num_items_before_association()); - EXPECT_EQ(4, merge_result.num_items_after_association()); } TEST_F(TemplateURLServiceSyncTest, ProcessChangesEmptyModel) { @@ -2001,8 +1957,10 @@ model()->pre_sync_deletes_.insert("aaa"); model()->Add(CreateTestTemplateURL(ASCIIToUTF16("whatever"), "http://key1.com", "bbb")); + ASSERT_EQ(1U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); syncer::SyncMergeResult merge_result = MergeAndExpectNotify(CreateInitialSyncData(), 1); + EXPECT_EQ(2U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); // We expect the model to have GUIDs {bbb, key3} after our initial merge. EXPECT_TRUE(model()->GetTemplateURLForGUID("bbb")); @@ -2016,14 +1974,6 @@ // The set of pre-sync deletes should be cleared so they're not reused if // MergeDataAndStartSyncing gets called again. EXPECT_TRUE(model()->pre_sync_deletes_.empty()); - - // Those sync items deleted via pre-sync-deletes should not get added. The - // remaining sync item (key3) should though. - EXPECT_EQ(1, merge_result.num_items_added()); - EXPECT_EQ(0, merge_result.num_items_modified()); - EXPECT_EQ(0, merge_result.num_items_deleted()); - EXPECT_EQ(1, merge_result.num_items_before_association()); - EXPECT_EQ(2, merge_result.num_items_after_association()); } TEST_F(TemplateURLServiceSyncTest, PreSyncUpdates) { @@ -2072,9 +2022,13 @@ initial_data.push_back( TemplateURLService::CreateSyncDataFromTemplateURL(*sync_turl)); + ASSERT_EQ(prepop_turls.size(), + model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); syncer::SyncMergeResult merge_result = model()->MergeDataAndStartSyncing( syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); + EXPECT_EQ(prepop_turls.size(), + model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); ASSERT_EQ(added_turl, model()->GetTemplateURLForKeyword( ASCIIToUTF16(kNewKeyword))); @@ -2085,15 +2039,6 @@ change.sync_data().GetSpecifics().search_engine().keyword()); EXPECT_EQ(new_timestamp, base::Time::FromInternalValue( change.sync_data().GetSpecifics().search_engine().last_modified())); - - // All the sync data is old, so nothing should change locally. - EXPECT_EQ(0, merge_result.num_items_added()); - EXPECT_EQ(0, merge_result.num_items_modified()); - EXPECT_EQ(0, merge_result.num_items_deleted()); - EXPECT_EQ(static_cast<int>(prepop_turls.size()), - merge_result.num_items_before_association()); - EXPECT_EQ(static_cast<int>(prepop_turls.size()), - merge_result.num_items_after_association()); } TEST_F(TemplateURLServiceSyncTest, SyncBaseURLs) { @@ -2153,24 +2098,25 @@ ExpectedTemplateURL turl_uniquified; ExpectedTemplateURL present_in_model; bool keywords_conflict; - int merge_results[3]; // in Added, Modified, Deleted order. + size_t final_num_turls; } test_cases[] = { - // Both are synced and the new sync entry is better: Local is uniquified and - // UPDATE sent. Sync is added. - {SYNC, BOTH, LOCAL, LOCAL, BOTH, true, {1, 1, 0}}, - // Both are synced and the local entry is better: Sync is uniquified and - // added to the model. An UPDATE is sent for it. - {LOCAL, BOTH, SYNC, SYNC, BOTH, true, {1, 1, 0}}, - // Local was not known to Sync and the new sync entry is better: Sync is - // added. Local is removed. No updates. - {SYNC, SYNC, NEITHER, NEITHER, SYNC, true, {1, 0, 1}}, - // Local was not known to sync and the local entry is better: Local is - // updated with sync GUID, Sync is not added. UPDATE sent for Sync. - {LOCAL, SYNC, SYNC, NEITHER, SYNC, true, {0, 1, 0}}, - // No conflicting keyword. Both should be added with their original - // keywords, with no updates sent. Note that MergeDataAndStartSyncing is - // responsible for creating the ACTION_ADD for the local TemplateURL. - {NEITHER, SYNC, NEITHER, NEITHER, BOTH, false, {1, 0, 0}}, + // Both are synced and the new sync entry is better: Local is uniquified + // and + // UPDATE sent. Sync is added. + {SYNC, BOTH, LOCAL, LOCAL, BOTH, true, 2}, + // Both are synced and the local entry is better: Sync is uniquified and + // added to the model. An UPDATE is sent for it. + {LOCAL, BOTH, SYNC, SYNC, BOTH, true, 2}, + // Local was not known to Sync and the new sync entry is better: Sync is + // added. Local is removed. No updates. + {SYNC, SYNC, NEITHER, NEITHER, SYNC, true, 1}, + // Local was not known to sync and the local entry is better: Local is + // updated with sync GUID, Sync is not added. UPDATE sent for Sync. + {LOCAL, SYNC, SYNC, NEITHER, SYNC, true, 1}, + // No conflicting keyword. Both should be added with their original + // keywords, with no updates sent. Note that MergeDataAndStartSyncing is + // responsible for creating the ACTION_ADD for the local TemplateURL. + {NEITHER, SYNC, NEITHER, NEITHER, BOTH, false, 2}, }; for (size_t i = 0; i < base::size(test_cases); ++i) { @@ -2220,16 +2166,13 @@ syncer::SyncChangeList change_list; syncer::SyncMergeResult merge_result(syncer::SEARCH_ENGINES); test_util_a_->ResetObserverCount(); + ASSERT_EQ(1u, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); model()->MergeInSyncTemplateURL(sync_turl.get(), sync_data, &change_list, &initial_data, &merge_result); + EXPECT_EQ(test_cases[i].final_num_turls, + model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); EXPECT_EQ(1, test_util_a_->GetObserverCount()); - // Verify the merge results were set appropriately. - EXPECT_EQ(test_cases[i].merge_results[0], merge_result.num_items_added()); - EXPECT_EQ(test_cases[i].merge_results[1], - merge_result.num_items_modified()); - EXPECT_EQ(test_cases[i].merge_results[2], merge_result.num_items_deleted()); - // Check for expected updates, if any. std::string expected_update_guid; if (test_cases[i].update_sent == LOCAL)
diff --git a/chrome/browser/signin/chrome_signin_helper.cc b/chrome/browser/signin/chrome_signin_helper.cc index 5d7d5969..f861012 100644 --- a/chrome/browser/signin/chrome_signin_helper.cc +++ b/chrome/browser/signin/chrome_signin_helper.cc
@@ -29,6 +29,7 @@ #include "chrome/browser/signin/cookie_reminter_factory.h" #include "chrome/browser/signin/dice_response_handler.h" #include "chrome/browser/signin/dice_tab_helper.h" +#include "chrome/browser/signin/header_modification_delegate_impl.h" #include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/signin/process_dice_header_delegate_impl.h" #include "chrome/browser/tab_contents/tab_util.h" @@ -192,9 +193,19 @@ signin_metrics::LogAccountReconcilorStateOnGaiaResponse( account_reconcilor->GetState()); + bool should_ignore_guest_webview = true; +#if BUILDFLAG(ENABLE_EXTENSIONS) + // The mirror headers from some guest web views need to be processed. + should_ignore_guest_webview = + HeaderModificationDelegateImpl::ShouldIgnoreGuestWebViewRequest( + web_contents); +#endif + // Do not do anything if the navigation happened in the "background". - if (!chrome::FindBrowserWithWebContents(web_contents)) + if (!chrome::FindBrowserWithWebContents(web_contents) && + should_ignore_guest_webview) { return; + } // Record the service type. UMA_HISTOGRAM_ENUMERATION("AccountManager.ManageAccountsServiceType",
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc index fa92ed2c..0ce0832f 100644 --- a/chrome/browser/supervised_user/supervised_user_service.cc +++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -332,12 +332,18 @@ #if BUILDFLAG(ENABLE_EXTENSIONS) void SupervisedUserService::AddOrUpdateExtensionApproval( const extensions::Extension& extension) { - bool has_key = base::Contains(approved_extensions_map_, extension.id()); - ApprovedExtensionChange update_type = has_key + auto it = approved_extensions_map_.find(extension.id()); + bool has_key = it != approved_extensions_map_.end(); + ApprovedExtensionChange change_type = has_key ? ApprovedExtensionChange::kUpdate : ApprovedExtensionChange::kNew; - UpdateApprovedExtension(extension.id(), extension.VersionString(), - update_type); + if (change_type != ApprovedExtensionChange::kUpdate || + it->second.CompareTo(extension.version())) { + // If the type is kUpdate, we don't need to do anything if there's no change + // in the approved version. + UpdateApprovedExtension(extension.id(), extension.VersionString(), + change_type); + } } void SupervisedUserService::RemoveExtensionApproval(
diff --git a/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc index 9a961c56..215452c0 100644 --- a/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc
@@ -204,11 +204,9 @@ TEST_F(SupervisedUserSettingsServiceTest, Merge) { syncer::SyncMergeResult result = StartSyncing(syncer::SyncDataList()); - EXPECT_EQ(0, result.num_items_before_association()); - EXPECT_EQ(0, result.num_items_added()); - EXPECT_EQ(0, result.num_items_modified()); - EXPECT_EQ(0, result.num_items_deleted()); - EXPECT_EQ(0, result.num_items_after_association()); + EXPECT_TRUE(settings_service_ + .GetAllSyncDataForTesting(syncer::SUPERVISED_USER_SETTINGS) + .empty()); ASSERT_TRUE(settings_); const base::Value* value = nullptr; @@ -234,11 +232,10 @@ it.value())); } result = StartSyncing(sync_data); - EXPECT_EQ(0, result.num_items_before_association()); - EXPECT_EQ(3, result.num_items_added()); - EXPECT_EQ(0, result.num_items_modified()); - EXPECT_EQ(0, result.num_items_deleted()); - EXPECT_EQ(3, result.num_items_after_association()); + EXPECT_EQ(3u, + settings_service_ + .GetAllSyncDataForTesting(syncer::SUPERVISED_USER_SETTINGS) + .size()); settings_service_.StopSyncing(syncer::SUPERVISED_USER_SETTINGS); } @@ -264,11 +261,10 @@ it.value())); } result = StartSyncing(sync_data); - EXPECT_EQ(6, result.num_items_before_association()); - EXPECT_EQ(0, result.num_items_added()); - EXPECT_EQ(1, result.num_items_modified()); - EXPECT_EQ(2, result.num_items_deleted()); - EXPECT_EQ(4, result.num_items_after_association()); + EXPECT_EQ(4u, + settings_service_ + .GetAllSyncDataForTesting(syncer::SUPERVISED_USER_SETTINGS) + .size()); } }
diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc index 38fdf38..eaecf5d 100644 --- a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc +++ b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc
@@ -213,6 +213,29 @@ DCHECK_EQ(syncer::SUPERVISED_USER_WHITELISTS, type); } +syncer::SyncDataList SupervisedUserWhitelistService::GetAllSyncDataForTesting( + syncer::ModelType type) const { + syncer::SyncDataList sync_data; + const base::DictionaryValue* whitelists = + prefs_->GetDictionary(prefs::kSupervisedUserWhitelists); + for (base::DictionaryValue::Iterator it(*whitelists); !it.IsAtEnd(); + it.Advance()) { + const std::string& id = it.key(); + const base::DictionaryValue* dict = nullptr; + it.value().GetAsDictionary(&dict); + std::string name; + bool result = dict->GetString(kName, &name); + DCHECK(result); + sync_pb::EntitySpecifics specifics; + sync_pb::ManagedUserWhitelistSpecifics* whitelist = + specifics.mutable_managed_user_whitelist(); + whitelist->set_id(id); + whitelist->set_name(name); + sync_data.push_back(syncer::SyncData::CreateLocalData(id, name, specifics)); + } + return sync_data; +} + syncer::SyncError SupervisedUserWhitelistService::ProcessSyncChanges( const base::Location& from_here, const syncer::SyncChangeList& change_list) {
diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service.h b/chrome/browser/supervised_user/supervised_user_whitelist_service.h index 4b6b8a1..abe19e2 100644 --- a/chrome/browser/supervised_user/supervised_user_whitelist_service.h +++ b/chrome/browser/supervised_user/supervised_user_whitelist_service.h
@@ -89,6 +89,8 @@ const base::Location& from_here, const syncer::SyncChangeList& change_list) override; + syncer::SyncDataList GetAllSyncDataForTesting(syncer::ModelType type) const; + private: // The following methods handle whitelist additions, updates and removals, // usually coming from Sync.
diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc index 75731ee..24c481c 100644 --- a/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc
@@ -169,16 +169,17 @@ TEST_F(SupervisedUserWhitelistServiceTest, MergeEmpty) { service_->Init(); + ASSERT_TRUE( + service_->GetAllSyncDataForTesting(syncer::SUPERVISED_USER_WHITELISTS) + .empty()); syncer::SyncMergeResult result = service_->MergeDataAndStartSyncing( syncer::SUPERVISED_USER_WHITELISTS, syncer::SyncDataList(), std::unique_ptr<syncer::SyncChangeProcessor>(), std::unique_ptr<syncer::SyncErrorFactory>()); + EXPECT_TRUE( + service_->GetAllSyncDataForTesting(syncer::SUPERVISED_USER_WHITELISTS) + .empty()); EXPECT_FALSE(result.error().IsSet()); - EXPECT_EQ(0, result.num_items_added()); - EXPECT_EQ(0, result.num_items_modified()); - EXPECT_EQ(0, result.num_items_deleted()); - EXPECT_EQ(0, result.num_items_before_association()); - EXPECT_EQ(0, result.num_items_after_association()); EXPECT_EQ(0u, installer_->registered_whitelists().size()); } @@ -214,16 +215,17 @@ initial_data.push_back( SupervisedUserWhitelistService::CreateWhitelistSyncData( "cccc", "Whitelist C")); + ASSERT_EQ( + 2u, service_->GetAllSyncDataForTesting(syncer::SUPERVISED_USER_WHITELISTS) + .size()); syncer::SyncMergeResult result = service_->MergeDataAndStartSyncing( syncer::SUPERVISED_USER_WHITELISTS, initial_data, std::unique_ptr<syncer::SyncChangeProcessor>(), std::unique_ptr<syncer::SyncErrorFactory>()); + EXPECT_EQ( + 2u, service_->GetAllSyncDataForTesting(syncer::SUPERVISED_USER_WHITELISTS) + .size()); EXPECT_FALSE(result.error().IsSet()); - EXPECT_EQ(1, result.num_items_added()); - EXPECT_EQ(1, result.num_items_modified()); - EXPECT_EQ(1, result.num_items_deleted()); - EXPECT_EQ(2, result.num_items_before_association()); - EXPECT_EQ(2, result.num_items_after_association()); // Whitelist A (which was previously ready) should be removed now, and // whitelist B was never ready.
diff --git a/chrome/browser/sync/test/integration/password_manager_sync_test.cc b/chrome/browser/sync/test/integration/password_manager_sync_test.cc index 027e28c..078b2f8d 100644 --- a/chrome/browser/sync/test/integration/password_manager_sync_test.cc +++ b/chrome/browser/sync/test/integration/password_manager_sync_test.cc
@@ -541,6 +541,36 @@ ASSERT_THAT(GetAllLoginsFromAccountPasswordStore(), ElementsAre(MatchesLogin("user", "pass"))); } + +IN_PROC_BROWSER_TEST_F(PasswordManagerSyncTest, + AutoUpdatePSLMatchInBothStoresOnSuccessfulUse) { + ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; + + // Add the same PSL-matched credential to both stores (i.e. it's stored for + // psl.example.com instead of www.example.com). + AddCredentialToFakeServer(CreateTestPSLPasswordForm("user", "pass")); + AddLocalCredential(CreateTestPSLPasswordForm("user", "pass")); + + SetupSyncTransportWithPasswordAccountStorage(); + + content::WebContents* web_contents = nullptr; + GetNewTab(GetBrowser(0), &web_contents); + + // Go to a form (on www.) and submit it with the saved credentials. + NavigateToFile(web_contents, "/password/simple_password.html"); + FillAndSubmitPasswordForm(web_contents, "user", "pass"); + + // Now the PSL-matched credential should have been automatically saved for + // www. as well, in both stores. + EXPECT_THAT(GetAllLoginsFromAccountPasswordStore(), + UnorderedElementsAre( + MatchesLoginAndRealm("user", "pass", GetWWWOrigin()), + MatchesLoginAndRealm("user", "pass", GetPSLOrigin()))); + EXPECT_THAT(GetAllLoginsFromProfilePasswordStore(), + UnorderedElementsAre( + MatchesLoginAndRealm("user", "pass", GetWWWOrigin()), + MatchesLoginAndRealm("user", "pass", GetPSLOrigin()))); +} #endif // !defined(OS_CHROMEOS) } // namespace
diff --git a/chrome/browser/ui/app_list/app_context_menu_unittest.cc b/chrome/browser/ui/app_list/app_context_menu_unittest.cc index 871f4de..1aa6b283c 100644 --- a/chrome/browser/ui/app_list/app_context_menu_unittest.cc +++ b/chrome/browser/ui/app_list/app_context_menu_unittest.cc
@@ -75,10 +75,6 @@ return open_apps_.count(app_id) != 0; } - void SetCanShowAppInfo(bool can_show_app_info) { - can_show_app_info_ = can_show_app_info; - } - // test::TestAppListControllerDelegate overrides: Pinnable GetPinnable(const std::string& app_id) override { std::map<std::string, Pinnable>::const_iterator it; @@ -87,12 +83,10 @@ return NO_PIN; return it->second; } - bool CanDoShowAppInfoFlow() override { return can_show_app_info_; } private: std::map<std::string, Pinnable> pinnable_apps_; std::unordered_set<std::string> open_apps_; - bool can_show_app_info_ = false; DISALLOW_COPY_AND_ASSIGN(FakeAppListControllerDelegate); }; @@ -225,12 +219,10 @@ void TestExtensionApp(const std::string& app_id, bool platform_app, - bool can_show_app_info, AppListControllerDelegate::Pinnable pinnable, extensions::LaunchType launch_type) { controller_ = std::make_unique<FakeAppListControllerDelegate>(); controller_->SetAppPinnable(app_id, pinnable); - controller_->SetCanShowAppInfo(can_show_app_info); controller_->SetExtensionLaunchType(profile(), app_id, launch_type); app_list::ExtensionAppContextMenu menu(menu_delegate(), profile(), app_id, controller(), platform_app); @@ -251,15 +243,13 @@ if (!platform_app) AddToStates(menu, MenuState(ash::OPTIONS, false, false), &states); AddToStates(menu, MenuState(ash::UNINSTALL), &states); - if (can_show_app_info) - AddToStates(menu, MenuState(ash::SHOW_APP_INFO), &states); + AddToStates(menu, MenuState(ash::SHOW_APP_INFO), &states); ValidateMenuState(menu_model.get(), states); } - void TestChromeApp(bool can_show_app_info) { + void TestChromeApp() { controller_ = std::make_unique<FakeAppListControllerDelegate>(); - controller_->SetCanShowAppInfo(can_show_app_info); app_list::ExtensionAppContextMenu menu( menu_delegate(), profile(), extension_misc::kChromeAppId, controller(), false /* is_platform_app */); @@ -271,8 +261,7 @@ if (!profile()->IsOffTheRecord()) AddToStates(menu, MenuState(ash::APP_CONTEXT_MENU_NEW_INCOGNITO_WINDOW), &states); - if (can_show_app_info) - AddToStates(menu, MenuState(ash::SHOW_APP_INFO), &states); + AddToStates(menu, MenuState(ash::SHOW_APP_INFO), &states); ValidateMenuState(menu_model.get(), states); } @@ -299,14 +288,11 @@ static_cast<AppListControllerDelegate::Pinnable>(pinnable + 1)) { for (size_t combinations = 0; combinations < (1 << 2); ++combinations) { TestExtensionApp(AppListTestBase::kHostedAppId, - (combinations & (1 << 0)) != 0, - (combinations & (1 << 1)) != 0, pinnable, launch_type); + (combinations & (1 << 0)) != 0, pinnable, launch_type); TestExtensionApp(AppListTestBase::kPackagedApp1Id, - (combinations & (1 << 0)) != 0, - (combinations & (1 << 1)) != 0, pinnable, launch_type); + (combinations & (1 << 0)) != 0, pinnable, launch_type); TestExtensionApp(AppListTestBase::kPackagedApp2Id, - (combinations & (1 << 0)) != 0, - (combinations & (1 << 1)) != 0, pinnable, launch_type); + (combinations & (1 << 0)) != 0, pinnable, launch_type); } } } @@ -315,8 +301,7 @@ TEST_F(AppContextMenuTest, ChromeApp) { app_list::ExtensionAppContextMenu::DisableInstalledExtensionCheckForTesting( true); - for (bool can_show_app_info : {true, false}) - TestChromeApp(can_show_app_info); + TestChromeApp(); } TEST_F(AppContextMenuTest, NonExistingExtensionApp) {
diff --git a/chrome/browser/ui/app_list/app_list_client_impl.cc b/chrome/browser/ui/app_list/app_list_client_impl.cc index faa3dc0c..87dd501 100644 --- a/chrome/browser/ui/app_list/app_list_client_impl.cc +++ b/chrome/browser/ui/app_list/app_list_client_impl.cc
@@ -351,12 +351,12 @@ if (!profile_) return; - // If we are in guest mode, the new profile should be an incognito profile. + // If we are in guest mode, the new profile should be an OffTheRecord profile. // Otherwise, this may later hit a check (same condition as this one) in // Browser::Browser when opening links in a browser window (see // http://crbug.com/460437). DCHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) - << "Guest mode must use incognito profile"; + << "Guest mode must use OffTheRecord profile"; template_url_service_observer_.Add( TemplateURLServiceFactory::GetForProfile(profile_)); @@ -484,7 +484,7 @@ void AppListClientImpl::CreateNewWindow(Profile* profile, bool incognito) { if (incognito) - chrome::NewEmptyWindow(profile->GetOffTheRecordProfile()); + chrome::NewEmptyWindow(profile->GetPrimaryOTRProfile()); else chrome::NewEmptyWindow(profile); }
diff --git a/chrome/browser/ui/app_list/app_list_client_impl_browsertest.cc b/chrome/browser/ui/app_list/app_list_client_impl_browsertest.cc index 6848f92..0daeffa8 100644 --- a/chrome/browser/ui/app_list/app_list_client_impl_browsertest.cc +++ b/chrome/browser/ui/app_list/app_list_client_impl_browsertest.cc
@@ -13,6 +13,7 @@ #include "base/macros.h" #include "base/path_service.h" #include "base/run_loop.h" +#include "base/strings/strcat.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind_test_util.h" #include "base/test/metrics/histogram_tester.h" @@ -39,10 +40,14 @@ #include "chrome/browser/ui/app_list/test/chrome_app_list_test_support.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" -#include "chrome/common/chrome_features.h" +#include "chrome/browser/ui/chrome_pages.h" +#include "chrome/browser/ui/settings_window_manager_chromeos.h" +#include "chrome/browser/web_applications/system_web_app_manager.h" +#include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "chrome/common/webui_url_constants.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/testing_profile.h" #include "chromeos/constants/chromeos_switches.h" @@ -137,10 +142,9 @@ } IN_PROC_BROWSER_TEST_F(AppListClientImplBrowserTest, ShowAppInfo) { - if (base::FeatureList::IsEnabled(features::kAppManagement)) { - // When App Management is enabled, App Info opens in the browser. - return; - } + web_app::WebAppProvider::Get(profile()) + ->system_web_app_manager() + .InstallSystemAppsForTesting(); AppListClientImpl* client = AppListClientImpl::GetInstance(); const extensions::Extension* app = InstallPlatformApp("minimal"); @@ -152,14 +156,20 @@ EXPECT_TRUE(wm::GetTransientChildren(client->GetAppListWindow()).empty()); // Open the app info dialog. - base::RunLoop run_loop; client->DoShowAppInfoFlow(profile(), app->id()); - run_loop.RunUntilIdle(); - EXPECT_FALSE(wm::GetTransientChildren(client->GetAppListWindow()).empty()); + Browser* settings_app = + chrome::SettingsWindowManager::GetInstance()->FindBrowserForProfile( + profile()); + content::WaitForLoadStop( + settings_app->tab_strip_model()->GetActiveWebContents()); - // The app list should not be dismissed when the dialog is shown. - EXPECT_TRUE(client->app_list_visible()); - EXPECT_TRUE(client->GetAppListWindow()); + EXPECT_EQ( + chrome::GetOSSettingsUrl(base::StrCat( + {chrome::kAppManagementDetailSubPage, "?id=", app->id()})), + settings_app->tab_strip_model()->GetActiveWebContents()->GetVisibleURL()); + // The app list should be dismissed when the dialog is shown. + EXPECT_FALSE(client->app_list_visible()); + EXPECT_FALSE(client->GetAppListWindow()); } // Test the CreateNewWindow function of the controller delegate. @@ -170,14 +180,14 @@ EXPECT_EQ(1U, chrome::GetBrowserCount(browser()->profile())); EXPECT_EQ(0U, chrome::GetBrowserCount( - browser()->profile()->GetOffTheRecordProfile())); + browser()->profile()->GetPrimaryOTRProfile())); controller->CreateNewWindow(browser()->profile(), false); EXPECT_EQ(2U, chrome::GetBrowserCount(browser()->profile())); controller->CreateNewWindow(browser()->profile(), true); EXPECT_EQ(1U, chrome::GetBrowserCount( - browser()->profile()->GetOffTheRecordProfile())); + browser()->profile()->GetPrimaryOTRProfile())); } // When getting activated, SelfDestroyAppItem has itself removed from the @@ -312,7 +322,7 @@ ASSERT_TRUE(controller); Profile* profile = browser()->profile(); - Profile* profile_otr = profile->GetOffTheRecordProfile(); + Profile* profile_otr = profile->GetPrimaryOTRProfile(); extensions::ExtensionPrefs* prefs = extensions::ExtensionPrefs::Get(profile);
diff --git a/chrome/browser/ui/app_list/app_list_controller_delegate.cc b/chrome/browser/ui/app_list/app_list_controller_delegate.cc index 3822e47..e276c37 100644 --- a/chrome/browser/ui/app_list/app_list_controller_delegate.cc +++ b/chrome/browser/ui/app_list/app_list_controller_delegate.cc
@@ -7,9 +7,6 @@ #include <utility> #include "ash/public/cpp/app_list/app_list_switches.h" -#include "base/bind.h" -#include "base/feature_list.h" -#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "build/build_config.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" @@ -18,17 +15,13 @@ #include "chrome/browser/extensions/install_tracker_factory.h" #include "chrome/browser/extensions/launch_util.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/apps/app_info_dialog.h" #include "chrome/browser/ui/ash/tablet_mode_page_behavior.h" #include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h" #include "chrome/browser/web_applications/components/app_registrar.h" #include "chrome/browser/web_applications/components/web_app_utils.h" #include "chrome/browser/web_applications/web_app_provider.h" -#include "chrome/common/chrome_features.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chromeos/constants/chromeos_features.h" #include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" @@ -89,62 +82,25 @@ !policy->MustRemainInstalled(extension, nullptr); } -bool AppListControllerDelegate::CanDoShowAppInfoFlow() { - return CanPlatformShowAppInfoDialog(); -} - void AppListControllerDelegate::DoShowAppInfoFlow(Profile* profile, const std::string& app_id) { - DCHECK(CanDoShowAppInfoFlow()); + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile); + DCHECK(proxy); + DCHECK_NE(proxy->AppRegistryCache().GetAppType(app_id), + apps::mojom::AppType::kUnknown); - if (base::FeatureList::IsEnabled(features::kAppManagement)) { - apps::AppServiceProxy* proxy = - apps::AppServiceProxyFactory::GetForProfile(profile); - DCHECK(proxy && proxy->AppRegistryCache().GetAppType(app_id) != - apps::mojom::AppType::kUnknown); - - chrome::ShowAppManagementPage(profile, app_id); - - web_app::WebAppProvider* web_app_provider = - web_app::WebAppProvider::Get(profile); - if (web_app_provider && web_app_provider->registrar().IsInstalled(app_id)) { - base::UmaHistogramEnumeration( - kAppManagementEntryPointsHistogramName, - AppManagementEntryPoint::kAppListContextMenuAppInfoWebApp); - } else { - base::UmaHistogramEnumeration( - kAppManagementEntryPointsHistogramName, - AppManagementEntryPoint::kAppListContextMenuAppInfoChromeApp); - } - return; + web_app::AppRegistrar& registrar = + web_app::WebAppProvider::Get(profile)->registrar(); + if (registrar.IsInstalled(app_id)) { + chrome::ShowAppManagementPage( + profile, app_id, + AppManagementEntryPoint::kAppListContextMenuAppInfoWebApp); + } else { + chrome::ShowAppManagementPage( + profile, app_id, + AppManagementEntryPoint::kAppListContextMenuAppInfoChromeApp); } - - // TODO(crbug.com/1065766): Remove below code. - const extensions::Extension* extension = GetExtension(profile, app_id); - DCHECK(extension); - - if (extension->is_hosted_app() && extension->from_bookmark()) { - chrome::ShowSiteSettings( - profile, extensions::AppLaunchInfo::GetFullLaunchURL(extension)); - return; - } - - UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialog.Launches", - AppInfoLaunchSource::FROM_APP_LIST, - AppInfoLaunchSource::NUM_LAUNCH_SOURCES); - - // Since the AppListControllerDelegate is a leaky singleton, passing its raw - // pointer around is OK. - GetAppInfoDialogBounds(base::BindOnce( - [](base::WeakPtr<AppListControllerDelegate> self, Profile* profile, - const std::string& extension_id, const gfx::Rect& bounds) { - const extensions::Extension* extension = - GetExtension(profile, extension_id); - DCHECK(extension); - ShowAppInfoInAppList(self->GetAppListWindow(), bounds, profile, - extension); - }, - weak_ptr_factory_.GetWeakPtr(), profile, app_id)); } void AppListControllerDelegate::UninstallApp(Profile* profile,
diff --git a/chrome/browser/ui/app_list/app_list_controller_delegate.h b/chrome/browser/ui/app_list/app_list_controller_delegate.h index 437d087..d726479 100644 --- a/chrome/browser/ui/app_list/app_list_controller_delegate.h +++ b/chrome/browser/ui/app_list/app_list_controller_delegate.h
@@ -76,9 +76,6 @@ // Returns true if requested app is open. virtual bool IsAppOpen(const std::string& app_id) const = 0; - // Whether the controller supports a Show App Info flow. - virtual bool CanDoShowAppInfoFlow(); - // Show the dialog with the application's information. Call only if // CanDoShowAppInfoFlow() returns true. virtual void DoShowAppInfoFlow(Profile* profile, const std::string& app_id);
diff --git a/chrome/browser/ui/app_list/app_service/app_service_context_menu.cc b/chrome/browser/ui/app_list/app_service/app_service_context_menu.cc index 4e24690..d421b18 100644 --- a/chrome/browser/ui/app_list/app_service/app_service_context_menu.cc +++ b/chrome/browser/ui/app_list/app_service/app_service_context_menu.cc
@@ -276,9 +276,8 @@ void AppServiceContextMenu::ShowAppInfo() { if (app_type_ == apps::mojom::AppType::kArc) { - chrome::ShowAppManagementPage(profile(), app_id()); - base::UmaHistogramEnumeration( - kAppManagementEntryPointsHistogramName, + chrome::ShowAppManagementPage( + profile(), app_id(), AppManagementEntryPoint::kAppListContextMenuAppInfoArc); return; }
diff --git a/chrome/browser/ui/app_list/arc/arc_app_context_menu.cc b/chrome/browser/ui/app_list/arc/arc_app_context_menu.cc index 3f2f9d6..8e6bb03 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_context_menu.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_context_menu.cc
@@ -8,8 +8,6 @@ #include "ash/public/cpp/tablet_mode.h" #include "base/bind.h" -#include "base/feature_list.h" -#include "base/metrics/histogram_functions.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/chromeos/arc/app_shortcuts/arc_app_shortcuts_menu_builder.h" @@ -18,13 +16,10 @@ #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" #include "chrome/browser/ui/app_list/arc/arc_app_dialog.h" #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" -#include "chrome/browser/ui/app_list/arc/arc_app_utils.h" #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" #include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h" -#include "chrome/common/chrome_features.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/constants/chromeos_features.h" ArcAppContextMenu::ArcAppContextMenu(app_list::AppContextMenuDelegate* delegate, Profile* profile, @@ -132,26 +127,13 @@ } void ArcAppContextMenu::ShowPackageInfo() { - const ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(profile()); - DCHECK(arc_prefs); - std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = - arc_prefs->GetApp(app_id()); - if (!app_info) { - VLOG(2) << "Requesting AppInfo for package that does not exist: " - << app_id() << "."; - return; - } - if (base::FeatureList::IsEnabled(features::kAppManagement)) { - chrome::ShowAppManagementPage(profile(), app_id()); - base::UmaHistogramEnumeration( - kAppManagementEntryPointsHistogramName, - AppManagementEntryPoint::kAppListContextMenuAppInfoArc); - return; - } - if (arc::ShowPackageInfo(app_info->package_name, - arc::mojom::ShowPackageInfoPage::MAIN, - controller()->GetAppListDisplayId()) && - !(ash::TabletMode::Get() && ash::TabletMode::Get()->InTabletMode())) { - controller()->DismissView(); - } + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile()); + DCHECK(proxy); + DCHECK_NE(proxy->AppRegistryCache().GetAppType(app_id()), + apps::mojom::AppType::kUnknown); + + chrome::ShowAppManagementPage( + profile(), app_id(), + AppManagementEntryPoint::kAppListContextMenuAppInfoArc); }
diff --git a/chrome/browser/ui/app_list/extension_app_context_menu.cc b/chrome/browser/ui/app_list/extension_app_context_menu.cc index bb46325..0f8856d5 100644 --- a/chrome/browser/ui/app_list/extension_app_context_menu.cc +++ b/chrome/browser/ui/app_list/extension_app_context_menu.cc
@@ -77,10 +77,8 @@ ash::APP_CONTEXT_MENU_NEW_INCOGNITO_WINDOW, IDS_APP_LIST_NEW_INCOGNITO_WINDOW); } - if (controller()->CanDoShowAppInfoFlow()) { - AddContextMenuOption(menu_model, ash::SHOW_APP_INFO, - IDS_APP_CONTEXT_MENU_SHOW_INFO); - } + AddContextMenuOption(menu_model, ash::SHOW_APP_INFO, + IDS_APP_CONTEXT_MENU_SHOW_INFO); } else { extension_menu_items_ = std::make_unique<extensions::ContextMenuMatcher>( profile(), this, menu_model, @@ -117,7 +115,7 @@ is_platform_app_ ? IDS_APP_LIST_UNINSTALL_ITEM : IDS_APP_LIST_EXTENSIONS_UNINSTALL); - if (controller()->CanDoShowAppInfoFlow() && !is_system_web_app) { + if (!is_system_web_app) { AddContextMenuOption(menu_model, ash::SHOW_APP_INFO, IDS_APP_CONTEXT_MENU_SHOW_INFO); }
diff --git a/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.cc b/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.cc index 14b4144..3e25921 100644 --- a/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.cc +++ b/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.cc
@@ -46,10 +46,6 @@ return false; } -bool TestAppListControllerDelegate::CanDoShowAppInfoFlow() { - return false; -} - void TestAppListControllerDelegate::DoShowAppInfoFlow( Profile* profile, const std::string& extension_id) {
diff --git a/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h b/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h index 3529ca66..dfba60fb 100644 --- a/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h +++ b/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h
@@ -24,7 +24,6 @@ void UnpinApp(const std::string& app_id) override; Pinnable GetPinnable(const std::string& app_id) override; bool IsAppOpen(const std::string& app_id) const override; - bool CanDoShowAppInfoFlow() override; void DoShowAppInfoFlow(Profile* profile, const std::string& extension_id) override; void CreateNewWindow(Profile* profile, bool incognito) override;
diff --git a/chrome/browser/ui/app_list/web_app_context_menu.cc b/chrome/browser/ui/app_list/web_app_context_menu.cc index a862eb8..8cad10f 100644 --- a/chrome/browser/ui/app_list/web_app_context_menu.cc +++ b/chrome/browser/ui/app_list/web_app_context_menu.cc
@@ -76,7 +76,7 @@ AddContextMenuOption(menu_model, ash::UNINSTALL, IDS_APP_LIST_UNINSTALL_ITEM); - if (controller()->CanDoShowAppInfoFlow() && !is_system_web_app) { + if (!is_system_web_app) { AddContextMenuOption(menu_model, ash::SHOW_APP_INFO, IDS_APP_CONTEXT_MENU_SHOW_INFO); }
diff --git a/chrome/browser/ui/ash/launcher/app_service/app_service_shelf_context_menu.cc b/chrome/browser/ui/ash/launcher/app_service/app_service_shelf_context_menu.cc index 62e1535..b823f72 100644 --- a/chrome/browser/ui/ash/launcher/app_service/app_service_shelf_context_menu.cc +++ b/chrome/browser/ui/ash/launcher/app_service/app_service_shelf_context_menu.cc
@@ -394,9 +394,8 @@ void AppServiceShelfContextMenu::ShowAppInfo() { if (app_type_ == apps::mojom::AppType::kArc) { - chrome::ShowAppManagementPage(controller()->profile(), item().id.app_id); - base::UmaHistogramEnumeration( - kAppManagementEntryPointsHistogramName, + chrome::ShowAppManagementPage( + controller()->profile(), item().id.app_id, AppManagementEntryPoint::kShelfContextMenuAppInfoArc); return; }
diff --git a/chrome/browser/ui/ash/launcher/arc_shelf_context_menu.cc b/chrome/browser/ui/ash/launcher/arc_shelf_context_menu.cc index 1ed4e36..eadb2f0 100644 --- a/chrome/browser/ui/ash/launcher/arc_shelf_context_menu.cc +++ b/chrome/browser/ui/ash/launcher/arc_shelf_context_menu.cc
@@ -9,7 +9,6 @@ #include "ash/public/cpp/app_menu_constants.h" #include "ash/public/cpp/shelf_item.h" -#include "base/metrics/histogram_functions.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/chromeos/arc/app_shortcuts/arc_app_shortcuts_menu_builder.h" @@ -17,12 +16,10 @@ #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" #include "chrome/browser/ui/app_list/arc/arc_app_dialog.h" #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" -#include "chrome/browser/ui/app_list/arc/arc_app_utils.h" #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" #include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h" -#include "chrome/common/chrome_features.h" #include "chrome/grit/generated_resources.h" ArcShelfContextMenu::ArcShelfContextMenu(ChromeLauncherController* controller, @@ -123,23 +120,13 @@ } void ArcShelfContextMenu::ShowPackageInfo() { - const ArcAppListPrefs* arc_prefs = - ArcAppListPrefs::Get(controller()->profile()); - DCHECK(arc_prefs); - std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = - arc_prefs->GetApp(item().id.app_id); - if (!app_info) { - VLOG(2) << "Requesting AppInfo for package that does not exist: " - << item().id.app_id << "."; - return; - } - if (base::FeatureList::IsEnabled(features::kAppManagement)) { - chrome::ShowAppManagementPage(controller()->profile(), item().id.app_id); - base::UmaHistogramEnumeration( - kAppManagementEntryPointsHistogramName, - AppManagementEntryPoint::kShelfContextMenuAppInfoArc); - return; - } - arc::ShowPackageInfo(app_info->package_name, - arc::mojom::ShowPackageInfoPage::MAIN, display_id()); + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(controller()->profile()); + DCHECK(proxy); + DCHECK_NE(proxy->AppRegistryCache().GetAppType(item().id.app_id), + apps::mojom::AppType::kUnknown); + + chrome::ShowAppManagementPage( + controller()->profile(), item().id.app_id, + AppManagementEntryPoint::kShelfContextMenuAppInfoArc); }
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index 16a4aac..58352973 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -18,7 +18,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/feature_list.h" -#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/strings/pattern.h" #include "base/strings/string_util.h" @@ -132,13 +131,6 @@ return app_id_opt.value_or(""); } -const extensions::Extension* GetExtension(Profile* profile, - const std::string& extension_id) { - const extensions::ExtensionRegistry* registry = - extensions::ExtensionRegistry::Get(profile); - return registry->GetInstalledExtension(extension_id); -} - apps::mojom::LaunchSource ConvertLaunchSource(ash::ShelfLaunchSource source) { switch (source) { case ash::LAUNCH_FROM_UNKNOWN: @@ -891,48 +883,26 @@ void ChromeLauncherController::DoShowAppInfoFlow(Profile* profile, const std::string& app_id) { - DCHECK(CanPlatformShowAppInfoDialog()); - - if (base::FeatureList::IsEnabled(features::kAppManagement)) { - apps::AppServiceProxy* proxy = - apps::AppServiceProxyFactory::GetForProfile(profile); - if (proxy && proxy->AppRegistryCache().GetAppType(app_id) == - apps::mojom::AppType::kUnknown) { - return; - } - - chrome::ShowAppManagementPage(profile, app_id); - - web_app::WebAppProvider* web_app_provider = - web_app::WebAppProvider::Get(profile); - if (web_app_provider && web_app_provider->registrar().IsInstalled(app_id)) { - base::UmaHistogramEnumeration( - kAppManagementEntryPointsHistogramName, - AppManagementEntryPoint::kShelfContextMenuAppInfoWebApp); - } else { - base::UmaHistogramEnumeration( - kAppManagementEntryPointsHistogramName, - AppManagementEntryPoint::kShelfContextMenuAppInfoChromeApp); - } + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile); + // Apps that are not in the App Service may call this function. + // E.g. extensions, apps that are using their platform specific IDs. + if (proxy && proxy->AppRegistryCache().GetAppType(app_id) == + apps::mojom::AppType::kUnknown) { return; } - // TODO(crbug.com/1065766): Remove below code. - const extensions::Extension* extension = GetExtension(profile, app_id); - if (!extension) - return; - - if (extension->is_hosted_app() && extension->from_bookmark()) { - chrome::ShowSiteSettings( - profile, extensions::AppLaunchInfo::GetFullLaunchURL(extension)); - return; + web_app::WebAppProvider* web_app_provider = + web_app::WebAppProvider::Get(profile); + if (web_app_provider && web_app_provider->registrar().IsInstalled(app_id)) { + chrome::ShowAppManagementPage( + profile, app_id, + AppManagementEntryPoint::kShelfContextMenuAppInfoWebApp); + } else { + chrome::ShowAppManagementPage( + profile, app_id, + AppManagementEntryPoint::kShelfContextMenuAppInfoChromeApp); } - - UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialog.Launches", - AppInfoLaunchSource::FROM_SHELF, - AppInfoLaunchSource::NUM_LAUNCH_SOURCES); - - ShowAppInfo(profile, extension, base::Closure()); } ///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc index 98a4164..0ae86ae7 100644 --- a/chrome/browser/ui/chrome_pages.cc +++ b/chrome/browser/ui/chrome_pages.cc
@@ -63,7 +63,9 @@ #include "url/url_util.h" #if defined(OS_CHROMEOS) +#include "base/metrics/histogram_functions.h" #include "chrome/browser/ui/settings_window_manager_chromeos.h" +#include "chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h" #include "chrome/common/webui_url_constants.h" #include "chromeos/constants/chromeos_features.h" #include "components/version_info/version_info.h" @@ -474,8 +476,16 @@ ShowSingletonTabIgnorePathOverwriteNTP(browser, GURL(kChromeUIManagementURL)); } -void ShowAppManagementPage(Profile* profile, const std::string& app_id) { - DCHECK(base::FeatureList::IsEnabled(features::kAppManagement)); +void ShowAppManagementPage(Profile* profile, + const std::string& app_id, + AppManagementEntryPoint entry_point) { + // This histogram is also declared and used at chrome/browser/resources/ + // settings/chrome_os/os_apps_page/app_management_page/constants.js. + constexpr char kAppManagementEntryPointsHistogramName[] = + "AppManagement.EntryPoints"; + + base::UmaHistogramEnumeration(kAppManagementEntryPointsHistogramName, + entry_point); std::string sub_page = base::StrCat({chrome::kAppManagementDetailSubPage, "?id=", app_id}); chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(profile,
diff --git a/chrome/browser/ui/chrome_pages.h b/chrome/browser/ui/chrome_pages.h index 9022072..7ac2043 100644 --- a/chrome/browser/ui/chrome_pages.h +++ b/chrome/browser/ui/chrome_pages.h
@@ -17,6 +17,10 @@ #include "chrome/browser/signin/signin_promo.h" #endif +#if defined(OS_CHROMEOS) +#include "chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h" +#endif + class Browser; class Profile; @@ -117,8 +121,6 @@ void ShowSiteSettings(Profile* profile, const GURL& url); void ShowSiteSettings(Browser* browser, const GURL& url); -void ShowAppManagementPage(Profile* profile, const std::string& app_id); - void ShowContentSettings(Browser* browser, ContentSettingsType content_settings_type); void ShowSettingsSubPageInTabbedBrowser(Browser* browser, @@ -136,6 +138,10 @@ // Constructs an OS settings GURL for the specified |sub_page|. GURL GetOSSettingsUrl(const std::string& sub_page); + +void ShowAppManagementPage(Profile* profile, + const std::string& app_id, + AppManagementEntryPoint entry_point); #endif #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
diff --git a/chrome/browser/ui/views/accessibility/caption_bubble.cc b/chrome/browser/ui/views/accessibility/caption_bubble.cc index f3d14a1..060d7eb4 100644 --- a/chrome/browser/ui/views/accessibility/caption_bubble.cc +++ b/chrome/browser/ui/views/accessibility/caption_bubble.cc
@@ -10,6 +10,7 @@ #include <utility> #include <vector> +#include "base/strings/string16.h" #include "chrome/grit/generated_resources.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" @@ -105,6 +106,7 @@ label->SetBackgroundColor(SK_ColorTRANSPARENT); label->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); label->SetLineHeight(kLineHeightDip); + label->SetTooltipText(base::string16()); // TODO(crbug.com/1055150): Respect the user's font size and minimum font size // settings rather than having a fixed font size.
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc index 5857da4..82a26ead 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
@@ -87,8 +87,7 @@ } // App Management only displays apps that are displayed in the launcher. - if (base::FeatureList::IsEnabled(features::kAppManagement) && - !extension->ShouldDisplayInAppLauncher()) { + if (!extension->ShouldDisplayInAppLauncher()) { return false; } #endif
diff --git a/chrome/browser/ui/web_applications/web_app_file_handling_browsertest.cc b/chrome/browser/ui/web_applications/web_app_file_handling_browsertest.cc index 282eb43..48567e08 100644 --- a/chrome/browser/ui/web_applications/web_app_file_handling_browsertest.cc +++ b/chrome/browser/ui/web_applications/web_app_file_handling_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 "base/bind.h" +#include "base/callback_forward.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/strings/strcat.h" @@ -53,11 +55,23 @@ void RequestOriginTrialExpiryTime( RequestOriginTrialExpiryTimeCallback callback) override { + if (before_reply_callback_) { + std::move(before_reply_callback_).Run(); + } + std::move(callback).Run(expiry_time_); } + // Set a callback to be called before FileHandlingExpiry interface replies + // the expiry time. Useful for testing inflight IPC. + void SetBeforeReplyCallback(base::RepeatingClosure before_reply_callback) { + before_reply_callback_ = before_reply_callback; + } + private: base::Time expiry_time_; + RequestOriginTrialExpiryTimeCallback callback_; + base::RepeatingClosure before_reply_callback_; mojo::AssociatedReceiver<blink::mojom::FileHandlingExpiry> receiver_{this}; }; @@ -397,6 +411,66 @@ EXPECT_EQ(nullptr, file_handler_manager().GetEnabledFileHandlers(app_id())); } +IN_PROC_BROWSER_TEST_P(WebAppFileHandlingOriginTrialBrowserTest, + ForceEnabledFileHandling_IgnoreExpiryTimeUpdate) { + InstallFileHandlingPWA(); + SetUpInterceptorNavigateToAppAndMaybeWait(); + + EXPECT_FALSE(file_handler_manager().IsFileHandlingForceEnabled(app_id())); + + // Force enables file handling. + file_handler_manager().ForceEnableFileHandlingOriginTrial(app_id()); + EXPECT_TRUE(file_handler_manager().IsFileHandlingForceEnabled(app_id())); + + // Update origin trial expiry time from the App's WebContents. + base::RunLoop loop; + file_handler_manager().SetOnFileHandlingExpiryUpdatedForTesting( + loop.QuitClosure()); + file_handling_expiry().SetExpiryTime(base::Time()); + file_handler_manager().MaybeUpdateFileHandlingOriginTrialExpiry( + web_contents(), app_id()); + loop.Run(); + + // Force enabled file handling should not be updated by the expiry time in + // App's WebContents (i.e. origin trial token expiry). + EXPECT_TRUE(file_handler_manager().IsFileHandlingForceEnabled(app_id())); + EXPECT_TRUE(file_handler_manager().IsFileHandlingAPIAvailable(app_id())); + EXPECT_TRUE(file_handler_manager().GetEnabledFileHandlers(app_id())); +} + +IN_PROC_BROWSER_TEST_P(WebAppFileHandlingOriginTrialBrowserTest, + ForceEnabledFileHandling_IgnoreExpiryTimeInflightIPC) { + InstallFileHandlingPWA(); + SetUpInterceptorNavigateToAppAndMaybeWait(); + + EXPECT_FALSE(file_handler_manager().IsFileHandlingForceEnabled(app_id())); + + // Request to update origin trial expiry time from the App's WebContents, and + // force enables file handling origin trial before the expiry time reply is + // received. + base::RunLoop loop; + file_handler_manager().SetOnFileHandlingExpiryUpdatedForTesting( + loop.QuitClosure()); + file_handling_expiry().SetExpiryTime(base::Time()); + file_handling_expiry().SetBeforeReplyCallback( + base::BindLambdaForTesting([&]() { + EXPECT_FALSE( + file_handler_manager().IsFileHandlingForceEnabled(app_id())); + file_handler_manager().ForceEnableFileHandlingOriginTrial(app_id()); + })); + + EXPECT_FALSE(file_handler_manager().IsFileHandlingForceEnabled(app_id())); + file_handler_manager().MaybeUpdateFileHandlingOriginTrialExpiry( + web_contents(), app_id()); + loop.Run(); + + // Force enabled file handling should not be updated by the inflight expiry + // time IPC. + EXPECT_TRUE(file_handler_manager().IsFileHandlingForceEnabled(app_id())); + EXPECT_TRUE(file_handler_manager().IsFileHandlingAPIAvailable(app_id())); + EXPECT_TRUE(file_handler_manager().GetEnabledFileHandlers(app_id())); +} + namespace { static constexpr char kBaseDataDir[] = "chrome/test/data/web_app_file_handling";
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc index aa4915c..c7cfeb0 100644 --- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc +++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -876,13 +876,14 @@ web_app_provider_->install_finalizer().UninstallExternalAppByUser( extension_id_prompting_, std::move(uninstall_success_callback)); } else { + Browser* browser = + chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); web_app::WebAppUiManagerImpl::Get(Profile::FromWebUI(web_ui())) ->dialog_manager() .UninstallWebApp( extension_id_prompting_, web_app::WebAppDialogManager::UninstallSource::kAppsPage, - /*browser_window=*/nullptr, - std::move(uninstall_success_callback)); + browser->window(), std::move(uninstall_success_callback)); } return; }
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc index ec12c351..2f1bf60 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -191,18 +191,18 @@ PrinterType GetPrinterTypeForUserAction(UserActionBuckets user_action) { switch (user_action) { case PRINT_WITH_PRIVET: - return PrinterType::kPrivetPrinter; + return PrinterType::kPrivet; case PRINT_WITH_EXTENSION: - return PrinterType::kExtensionPrinter; + return PrinterType::kExtension; case PRINT_TO_PDF: - return PrinterType::kPdfPrinter; + return PrinterType::kPdf; case PRINT_TO_PRINTER: case FALLBACK_TO_ADVANCED_SETTINGS_DIALOG: case OPEN_IN_MAC_PREVIEW: - return PrinterType::kLocalPrinter; + return PrinterType::kLocal; default: NOTREACHED(); - return PrinterType::kLocalPrinter; + return PrinterType::kLocal; } } @@ -424,13 +424,13 @@ PrinterType type = static_cast<PrinterType>( settings.FindIntKey(kSettingPrinterType).value()); switch (type) { - case kPrivetPrinter: + case PrinterType::kPrivet: return PRINT_WITH_PRIVET; - case kExtensionPrinter: + case PrinterType::kExtension: return PRINT_WITH_EXTENSION; - case kPdfPrinter: + case PrinterType::kPdf: return PRINT_TO_PDF; - case kLocalPrinter: + case PrinterType::kLocal: break; default: NOTREACHED(); @@ -646,15 +646,15 @@ // components/policy/resources/policy_templates.json const std::string& deny_list_str = deny_list_type.GetString(); if (deny_list_str == "privet") - printer_type_deny_list_.insert(kPrivetPrinter); + printer_type_deny_list_.insert(PrinterType::kPrivet); else if (deny_list_str == "extension") - printer_type_deny_list_.insert(kExtensionPrinter); + printer_type_deny_list_.insert(PrinterType::kExtension); else if (deny_list_str == "pdf") - printer_type_deny_list_.insert(kPdfPrinter); + printer_type_deny_list_.insert(PrinterType::kPdf); else if (deny_list_str == "local") - printer_type_deny_list_.insert(kLocalPrinter); + printer_type_deny_list_.insert(PrinterType::kLocal); else if (deny_list_str == "cloud") - printer_type_deny_list_.insert(kCloudPrinter); + printer_type_deny_list_.insert(PrinterType::kCloud); } } @@ -731,11 +731,11 @@ args->GetString(1, &printer_id) && !callback_id.empty(); DCHECK(ok); - GetPrinterHandler(PrinterType::kExtensionPrinter) - ->StartGrantPrinterAccess( - printer_id, - base::BindOnce(&PrintPreviewHandler::OnGotExtensionPrinterInfo, - weak_factory_.GetWeakPtr(), callback_id)); + PrinterHandler* handler = GetPrinterHandler(PrinterType::kExtension); + handler->StartGrantPrinterAccess( + printer_id, + base::BindOnce(&PrintPreviewHandler::OnGotExtensionPrinterInfo, + weak_factory_.GetWeakPtr(), callback_id)); } void PrintPreviewHandler::HandleGetPrinterCapabilities( @@ -934,11 +934,11 @@ return; } - GetPrinterHandler(PrinterType::kLocalPrinter) - ->StartGetCapability( - printer_name, base::BindOnce(&PrintPreviewHandler::SendPrinterSetup, - weak_factory_.GetWeakPtr(), callback_id, - printer_name)); + PrinterHandler* handler = GetPrinterHandler(PrinterType::kLocal); + handler->StartGetCapability( + printer_name, + base::BindOnce(&PrintPreviewHandler::SendPrinterSetup, + weak_factory_.GetWeakPtr(), callback_id, printer_name)); } void PrintPreviewHandler::HandleSignin(const base::ListValue* args) { @@ -1036,12 +1036,7 @@ const std::string& callback_id = args->GetList()[0].GetString(); const std::string& destination_id = args->GetList()[1].GetString(); - PrinterHandler* handler = GetPrinterHandler(kLocalPrinter); - if (!handler) { - RejectJavascriptCallback(base::Value(callback_id), base::Value()); - return; - } - + PrinterHandler* handler = GetPrinterHandler(PrinterType::kLocal); handler->StartGetEulaUrl( destination_id, base::BindOnce(&PrintPreviewHandler::SendEulaUrl, weak_factory_.GetWeakPtr(), callback_id)); @@ -1083,10 +1078,10 @@ AllowJavascript(); - GetPrinterHandler(PrinterType::kLocalPrinter) - ->GetDefaultPrinter( - base::BindOnce(&PrintPreviewHandler::SendInitialSettings, - weak_factory_.GetWeakPtr(), callback_id)); + PrinterHandler* handler = GetPrinterHandler(PrinterType::kLocal); + handler->GetDefaultPrinter( + base::BindOnce(&PrintPreviewHandler::SendInitialSettings, + weak_factory_.GetWeakPtr(), callback_id)); } void PrintPreviewHandler::GetUserAccountList(base::Value* settings) { @@ -1143,7 +1138,7 @@ initial_settings.SetBoolKey( kPdfPrinterDisabled, - base::Contains(printer_type_deny_list_, kPdfPrinter)); + base::Contains(printer_type_deny_list_, PrinterType::kPdf)); const bool destinations_managed = !printer_type_deny_list_.empty() && @@ -1386,7 +1381,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( PrinterType printer_type) { - if (printer_type == PrinterType::kExtensionPrinter) { + if (printer_type == PrinterType::kExtension) { if (!extension_printer_handler_) { extension_printer_handler_ = PrinterHandler::CreateForExtensionPrinters( Profile::FromWebUI(web_ui())); @@ -1394,7 +1389,7 @@ return extension_printer_handler_.get(); } #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) - if (printer_type == PrinterType::kPrivetPrinter) { + if (printer_type == PrinterType::kPrivet) { if (!privet_printer_handler_) { privet_printer_handler_ = PrinterHandler::CreateForPrivetPrinters(Profile::FromWebUI(web_ui())); @@ -1402,7 +1397,7 @@ return privet_printer_handler_.get(); } #endif - if (printer_type == PrinterType::kPdfPrinter) { + if (printer_type == PrinterType::kPdf) { if (!pdf_printer_handler_) { pdf_printer_handler_ = PrinterHandler::CreateForPdfPrinter( Profile::FromWebUI(web_ui()), preview_web_contents(), @@ -1410,7 +1405,7 @@ } return pdf_printer_handler_.get(); } - if (printer_type == PrinterType::kLocalPrinter) { + if (printer_type == PrinterType::kLocal) { if (!local_printer_handler_) { local_printer_handler_ = PrinterHandler::CreateForLocalPrinters( preview_web_contents(), Profile::FromWebUI(web_ui())); @@ -1422,20 +1417,19 @@ } PdfPrinterHandler* PrintPreviewHandler::GetPdfPrinterHandler() { - return static_cast<PdfPrinterHandler*>( - GetPrinterHandler(PrinterType::kPdfPrinter)); + return static_cast<PdfPrinterHandler*>(GetPrinterHandler(PrinterType::kPdf)); } void PrintPreviewHandler::OnAddedPrinters(PrinterType printer_type, const base::ListValue& printers) { - DCHECK(printer_type == PrinterType::kExtensionPrinter || - printer_type == PrinterType::kPrivetPrinter || - printer_type == PrinterType::kLocalPrinter); + DCHECK(printer_type == PrinterType::kExtension || + printer_type == PrinterType::kPrivet || + printer_type == PrinterType::kLocal); DCHECK(!printers.empty()); - FireWebUIListener("printers-added", base::Value(printer_type), printers); + FireWebUIListener("printers-added", + base::Value(static_cast<int>(printer_type)), printers); - if (printer_type == PrinterType::kLocalPrinter && - !has_logged_printers_count_) { + if (printer_type == PrinterType::kLocal && !has_logged_printers_count_) { UMA_HISTOGRAM_COUNTS_1M("PrintPreview.NumberOfPrinters", printers.GetSize()); has_logged_printers_count_ = true; @@ -1477,7 +1471,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { DCHECK(!identity_manager_); cloud_print_enabled_ = - !base::Contains(printer_type_deny_list_, kCloudPrinter) && + !base::Contains(printer_type_deny_list_, PrinterType::kCloud) && GetPrefs()->GetBoolean(prefs::kCloudPrintSubmitEnabled); if (!cloud_print_enabled_)
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc index 286ec9b1..33e01f8 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc
@@ -49,16 +49,18 @@ const char kTestData[] = "abc"; // Array of all PrinterTypes. -constexpr PrinterType kAllTypes[] = {kPrivetPrinter, kExtensionPrinter, - kPdfPrinter, kLocalPrinter, kCloudPrinter}; +constexpr PrinterType kAllTypes[] = {PrinterType::kPrivet, + PrinterType::kExtension, PrinterType::kPdf, + PrinterType::kLocal, PrinterType::kCloud}; // Array of all PrinterTypes that have working PrinterHandlers. -constexpr PrinterType kAllSupportedTypes[] = {kPrivetPrinter, kExtensionPrinter, - kPdfPrinter, kLocalPrinter}; +constexpr PrinterType kAllSupportedTypes[] = { + PrinterType::kPrivet, PrinterType::kExtension, PrinterType::kPdf, + PrinterType::kLocal}; // All three printer types that implement PrinterHandler::StartGetPrinters(). -constexpr PrinterType kFetchableTypes[] = {kPrivetPrinter, kExtensionPrinter, - kLocalPrinter}; +constexpr PrinterType kFetchableTypes[] = { + PrinterType::kPrivet, PrinterType::kExtension, PrinterType::kLocal}; struct PrinterInfo { std::string id; @@ -99,7 +101,7 @@ } base::Value GetPrintPreviewTicket() { - base::Value print_ticket = GetPrintTicket(kLocalPrinter); + base::Value print_ticket = GetPrintTicket(PrinterType::kLocal); // Make some modifications to match a preview print ticket. print_ticket.SetKey(kSettingPageRange, base::Value()); @@ -479,7 +481,7 @@ void SendGetPrinters(PrinterType type, const std::string& callback_id_in) { base::Value args(base::Value::Type::LIST); args.Append(callback_id_in); - args.Append(type); + args.Append(static_cast<int>(type)); handler()->HandleGetPrinters(&base::Value::AsListValue(args)); } @@ -492,7 +494,7 @@ const content::TestWebUI::CallData& add_data = *web_ui()->call_data()[call_data_size - 2]; AssertWebUIEventFired(add_data, "printers-added"); - const int type = add_data.arg2()->GetInt(); + const auto type = static_cast<PrinterType>(add_data.arg2()->GetInt()); EXPECT_EQ(expected_type, type); ASSERT_TRUE(add_data.arg3()); base::Value::ConstListView printer_list = add_data.arg3()->GetList(); @@ -509,7 +511,7 @@ base::Value args(base::Value::Type::LIST); args.Append(callback_id_in); args.Append(printer_name); - args.Append(type); + args.Append(static_cast<int>(type)); handler()->HandleGetPrinterCapabilities(&base::Value::AsListValue(args)); } @@ -705,7 +707,7 @@ // type that isn't on the deny list (one for printers-added, and one for the // response), and only 1 more for each type on the deny list (just for // response). - const bool is_allowed_type = type == kLocalPrinter; + const bool is_allowed_type = type == PrinterType::kLocal; EXPECT_EQ(is_allowed_type, handler()->CalledOnlyForType(type)); expected_callbacks += is_allowed_type ? 2 : 1; ASSERT_EQ(expected_callbacks, web_ui()->call_data().size()); @@ -787,7 +789,7 @@ SendGetPrinterCapabilities(type, callback_id_in, kDummyPrinterName); const bool is_allowed_type = - type == kPrivetPrinter || type == kExtensionPrinter; + type == PrinterType::kPrivet || type == PrinterType::kExtension; EXPECT_EQ(is_allowed_type, handler()->CalledOnlyForType(type)); // Start with 1 call from initial settings, then add 1 more for each loop @@ -819,7 +821,7 @@ // Verify correct PrinterHandler was called or that no handler was requested // for cloud printers. - if (type == kCloudPrinter) { + if (type == PrinterType::kCloud) { EXPECT_TRUE(handler()->NotCalled()); } else { EXPECT_TRUE(handler()->CalledOnlyForType(type)); @@ -830,7 +832,7 @@ CheckWebUIResponse(data, callback_id_in, true); // For cloud print, should also get the encoded data back as a string. - if (type == kCloudPrinter) { + if (type == PrinterType::kCloud) { std::string print_data; ASSERT_TRUE(data.arg3()->GetAsString(&print_data)); std::string expected_data; @@ -999,7 +1001,7 @@ "test-callback-id-" + base::NumberToString(i + 1); args.Append(callback_id_in); args.Append(kDummyPrinterName); - args.Append(type); + args.Append(static_cast<int>(type)); std::unique_ptr<base::ListValue> list_args = base::ListValue::From(base::Value::ToUniquePtrValue(std::move(args))); handler()->HandleGetPrinterCapabilities(list_args.get());
diff --git a/chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h b/chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h index c2da963..05322cd6 100644 --- a/chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h +++ b/chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h
@@ -23,9 +23,4 @@ kMaxValue = kOsSettingsMainPage, }; -// This histogram is also declared and used at chrome/browser/resources/ -// settings/chrome_os/os_apps_page/app_management_page/constants.js. -constexpr char kAppManagementEntryPointsHistogramName[] = - "AppManagement.EntryPoints"; - #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_APP_MANAGEMENT_APP_MANAGEMENT_UMA_H_
diff --git a/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc b/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc index d6f8325..2d3265e 100644 --- a/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc +++ b/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc
@@ -173,8 +173,6 @@ AddSettingsPageUIHandler( std::make_unique<::settings::SearchEnginesHandler>(profile)); - html_source->AddBoolean("showAppManagement", base::FeatureList::IsEnabled( - ::features::kAppManagement)); html_source->AddBoolean("splitSettingsSyncEnabled", chromeos::features::IsSplitSettingsSyncEnabled()); html_source->AddBoolean("splitSyncConsent",
diff --git a/chrome/browser/upboarding/query_tiles/android/javatests/src/org/chromium/chrome/browser/query_tiles/QueryTileSectionTest.java b/chrome/browser/upboarding/query_tiles/android/javatests/src/org/chromium/chrome/browser/query_tiles/QueryTileSectionTest.java index 0a5615d8..edf01c1 100644 --- a/chrome/browser/upboarding/query_tiles/android/javatests/src/org/chromium/chrome/browser/query_tiles/QueryTileSectionTest.java +++ b/chrome/browser/upboarding/query_tiles/android/javatests/src/org/chromium/chrome/browser/query_tiles/QueryTileSectionTest.java
@@ -8,8 +8,11 @@ import static android.support.test.espresso.assertion.ViewAssertions.matches; import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.support.test.espresso.action.ViewActions; import android.support.test.filters.SmallTest; import org.junit.After; @@ -19,6 +22,7 @@ import org.junit.runner.RunWith; import org.chromium.base.Callback; +import org.chromium.base.ContextUtils; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.chrome.R; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -28,6 +32,8 @@ import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.NewTabPageTestUtils; import org.chromium.chrome.test.util.browser.Features; +import org.chromium.content_public.browser.test.util.Criteria; +import org.chromium.content_public.browser.test.util.CriteriaHelper; import java.util.ArrayList; import java.util.List; @@ -38,6 +44,8 @@ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) public class QueryTileSectionTest { + private static final String SEARCH_URL_PATTERN = "https://www.google.com/search?q="; + @Rule public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); @@ -58,13 +66,35 @@ @Features.EnableFeatures(ChromeFeatureList.QUERY_TILES) public void testSimpleTest() throws Exception { onView(withId(R.id.query_tiles)).check(matches(isDisplayed())); + onView(withText("Tile 1")).check(matches(isDisplayed())); + } + + @Test + @SmallTest + @Features.EnableFeatures(ChromeFeatureList.QUERY_TILES) + public void testLeafLevelTileLoadsSearchResultsPage() throws Exception { + onView(withId(R.id.query_tiles)).check(matches(isDisplayed())); + onView(withText("Tile 1")).perform(ViewActions.click()); + onView(withText("Tile 1_1")).check(matches(isDisplayed())).perform(ViewActions.click()); + waitForSearchResultsPage(mActivityTestRule.getActivity().getActivityTab()); + } + + private static void waitForSearchResultsPage(final Tab tab) { + CriteriaHelper.pollUiThread(new Criteria("The SRP was never loaded.") { + @Override + public boolean isSatisfied() { + return tab.getUrl().getValidSpecOrEmpty().contains(SEARCH_URL_PATTERN); + } + }); } private static class TestTileProvider implements TileProvider { private List<Tile> mTiles = new ArrayList<>(); private TestTileProvider() { - Tile tile = new Tile("1", "Tile 1", "Tile 1", "Tile 1", null); + List<Tile> children = new ArrayList<>(); + children.add(new Tile("tile1_1", "Tile 1_1", "Tile 1_1", "Tile 1_1 Query", null)); + Tile tile = new Tile("1", "Tile 1", "Tile 1", "Tile 1 Query", children); mTiles.add(tile); } @@ -75,7 +105,12 @@ @Override public void getVisuals(String id, Callback<List<Bitmap>> callback) { - callback.onResult(null); + List<Bitmap> bitmapList = new ArrayList<>(); + Bitmap bitmap = BitmapFactory.decodeResource( + ContextUtils.getApplicationContext().getResources(), + R.drawable.chrome_sync_logo); + bitmapList.add(bitmap); + callback.onResult(bitmapList); } } -} +} \ No newline at end of file
diff --git a/chrome/browser/web_applications/components/file_handler_manager.cc b/chrome/browser/web_applications/components/file_handler_manager.cc index 4e796f8..8a88b9d2 100644 --- a/chrome/browser/web_applications/components/file_handler_manager.cc +++ b/chrome/browser/web_applications/components/file_handler_manager.cc
@@ -108,9 +108,17 @@ UnregisterFileHandlersWithOs(app_id, profile()); } -void FileHandlerManager::UpdateFileHandlingOriginTrialExpiry( +void FileHandlerManager::MaybeUpdateFileHandlingOriginTrialExpiry( content::WebContents* web_contents, const AppId& app_id) { + // If an App has force enabled file handling, there is no need to check its + // WebContents. + if (IsFileHandlingForceEnabled(app_id)) { + if (on_file_handling_expiry_updated_for_testing_) + on_file_handling_expiry_updated_for_testing_.Run(); + return; + } + mojo::AssociatedRemote<blink::mojom::FileHandlingExpiry> expiry_service; web_contents->GetMainFrame()->GetRemoteAssociatedInterfaces()->GetInterface( &expiry_service); @@ -167,7 +175,15 @@ mojo::AssociatedRemote<blink::mojom::FileHandlingExpiry> /*interface*/, const AppId& app_id, base::Time expiry_time) { - UpdateFileHandlersForOriginTrialExpiryTime(app_id, expiry_time); + // Updates the expiry time, if file handling is enabled by origin trial + // tokens. If an App has force enabled file handling, it might not have expiry + // time associated with it. + if (!IsFileHandlingForceEnabled(app_id)) { + UpdateFileHandlersForOriginTrialExpiryTime(app_id, expiry_time); + } + + if (on_file_handling_expiry_updated_for_testing_) + on_file_handling_expiry_updated_for_testing_.Run(); } void FileHandlerManager::UpdateFileHandlersForOriginTrialExpiryTime( @@ -189,9 +205,6 @@ } else if (file_handlers_enabled) { DisableAndUnregisterOsFileHandlers(app_id); } - - if (on_file_handling_expiry_updated_for_testing_) - on_file_handling_expiry_updated_for_testing_.Run(); } void FileHandlerManager::DisableAutomaticFileHandlerCleanupForTesting() { @@ -264,4 +277,12 @@ return base::nullopt; } +bool FileHandlerManager::IsFileHandlingForceEnabled(const AppId& app_id) { + double pref_expiry_time = + GetDoubleWebAppPref(profile()->GetPrefs(), app_id, + kFileHandlingOriginTrialExpiryTime) + .value_or(0); + return pref_expiry_time == kMaxOriginTrialExpiryTime; +} + } // namespace web_app
diff --git a/chrome/browser/web_applications/components/file_handler_manager.h b/chrome/browser/web_applications/components/file_handler_manager.h index 85bad84f..bed31385 100644 --- a/chrome/browser/web_applications/components/file_handler_manager.h +++ b/chrome/browser/web_applications/components/file_handler_manager.h
@@ -74,9 +74,11 @@ void DisableAndUnregisterOsFileHandlers(const AppId& app_id); // Updates the file handling origin trial expiry timer based on a currently - // open instance of the site. - void UpdateFileHandlingOriginTrialExpiry(content::WebContents* web_contents, - const AppId& app_id); + // open instance of the site. This will not update the expiry timer if + // |app_id| has force enabled file handling origin trial. + void MaybeUpdateFileHandlingOriginTrialExpiry( + content::WebContents* web_contents, + const AppId& app_id); // Force enables File Handling origin trial. This will register the App's file // handlers even if the App does not have a valid origin trial token. @@ -86,6 +88,9 @@ // App's file handlers. void DisableForceEnabledFileHandlingOriginTrial(const AppId& app_id); + // Returns whether App's file handling is force enabled. + bool IsFileHandlingForceEnabled(const AppId& app_id); + // Gets all enabled file handlers for |app_id|. |nullptr| if the app has no // enabled file handlers. Note: The lifetime of the file handlers are tied to // the app they belong to.
diff --git a/chrome/browser/web_applications/components/web_app_shortcut_mac.mm b/chrome/browser/web_applications/components/web_app_shortcut_mac.mm index 2f4d75e..7082d2b 100644 --- a/chrome/browser/web_applications/components/web_app_shortcut_mac.mm +++ b/chrome/browser/web_applications/components/web_app_shortcut_mac.mm
@@ -1200,11 +1200,19 @@ void WebAppShortcutCreator::RevealAppShimInFinder( const base::FilePath& app_path) const { - // Use selectFile to show the contents of parent directory with the app - // shim selected. - [[NSWorkspace sharedWorkspace] - selectFile:base::mac::FilePathToNSString(app_path) - inFileViewerRootedAtPath:@""]; + auto closure = base::BindOnce( + [](const base::FilePath& app_path) { + // Use selectFile to show the contents of parent directory with the app + // shim selected. + [[NSWorkspace sharedWorkspace] + selectFile:base::mac::FilePathToNSString(app_path) + inFileViewerRootedAtPath:@""]; + }, + app_path); + // Perform the call to NSWorkSpace on the UI thread. Calling it on the IO + // thread appears to cause crashes. + // https://crbug.com/1067367 + base::PostTask(FROM_HERE, {content::BrowserThread::UI}, std::move(closure)); } void LaunchShim(LaunchShimUpdateBehavior update_behavior,
diff --git a/chrome/browser/web_applications/web_app_tab_helper.cc b/chrome/browser/web_applications/web_app_tab_helper.cc index d842e83..5e5ad8d 100644 --- a/chrome/browser/web_applications/web_app_tab_helper.cc +++ b/chrome/browser/web_applications/web_app_tab_helper.cc
@@ -106,11 +106,9 @@ if (app_id_.empty()) return; - // Ordinary Web Apps need to hold valid origin trial tokens to continue using - // File Handling API. - if (provider_->system_web_app_manager().IsSystemWebApp(app_id_)) - return; - provider_->file_handler_manager().UpdateFileHandlingOriginTrialExpiry( + // There is no way to reliably know if |app_id_| is for a System Web App + // during startup, so we always call MaybeUpdateFileHandlingOriginTrialExpiry. + provider_->file_handler_manager().MaybeUpdateFileHandlingOriginTrialExpiry( web_contents(), app_id_); } @@ -138,17 +136,8 @@ SetAppId(app_id); - // Ordinary Web Apps need valid origin trial tokens to use File Handling API. - // When an App is installed, record its origin trial expiry time. - // // TODO(crbug.com/1053371): Clean up where we install file handlers. - // The following check is not necessary. This tab helper is not attached to - // the WebContents we used to install the WebApp. When a System Web App is - // installed, there is no associated tab and we early return at `app_id != - // installed_app_id`. - if (provider_->system_web_app_manager().IsSystemWebApp(installed_app_id)) - return; - provider_->file_handler_manager().UpdateFileHandlingOriginTrialExpiry( + provider_->file_handler_manager().MaybeUpdateFileHandlingOriginTrialExpiry( web_contents(), installed_app_id); }
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 648c94a..cb677e0 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -656,10 +656,6 @@ const base::Feature kSystemWebApps{"SystemWebApps", base::FEATURE_ENABLED_BY_DEFAULT}; -// Enables or disables the App Management UI. -const base::Feature kAppManagement{"AppManagement", - base::FEATURE_ENABLED_BY_DEFAULT}; - // Disable downloads of unsafe file types over insecure transports if initiated // from a secure page const base::Feature kTreatUnsafeDownloadsAsActive{
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 503b034..29db0d7f 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -391,9 +391,6 @@ COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kSystemWebApps; -COMPONENT_EXPORT(CHROME_FEATURES) -extern const base::Feature kAppManagement; - #if !defined(OS_ANDROID) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kTabMetricsLogging; #endif
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 4afb971..a4a9d562 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -5680,7 +5680,6 @@ "../browser/extensions/extension_keybinding_apitest.cc", "../browser/extensions/omnibox_focus_interactive_test.cc", "../browser/extensions/window_open_interactive_apitest.cc", - "../browser/focus_ring_browsertest.cc", "../browser/global_keyboard_shortcuts_mac_browsertest.mm", "../browser/mouse_events_interactive_uitest.cc", "../browser/notifications/platform_notification_service_interactive_uitest.cc",
diff --git a/chrome/test/data/android/render_tests/ProfileDataCacheWithBadgeRenderTest.profile_data_cache_with_child_badge.Nexus_5X-23.png.sha1 b/chrome/test/data/android/render_tests/ProfileDataCacheWithBadgeRenderTest.profile_data_cache_with_child_badge.Nexus_5X-23.png.sha1 new file mode 100644 index 0000000..c075922 --- /dev/null +++ b/chrome/test/data/android/render_tests/ProfileDataCacheWithBadgeRenderTest.profile_data_cache_with_child_badge.Nexus_5X-23.png.sha1
@@ -0,0 +1 @@ +847af162240fa3742b8484c5fca7621f8666daa7 \ No newline at end of file
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_anchor.png b/chrome/test/data/focus_rings/focus_ring_browsertest_anchor.png deleted file mode 100644 index ea3d026..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_anchor.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_anchor_mac.png b/chrome/test/data/focus_rings/focus_ring_browsertest_anchor_mac.png deleted file mode 100644 index d8cc1c5..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_anchor_mac.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_anchor_win.png b/chrome/test/data/focus_rings/focus_ring_browsertest_anchor_win.png deleted file mode 100644 index 638deaa..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_anchor_win.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_button.png b/chrome/test/data/focus_rings/focus_ring_browsertest_button.png deleted file mode 100644 index 0ab3f0e..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_button.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_button_mac.png b/chrome/test/data/focus_rings/focus_ring_browsertest_button_mac.png deleted file mode 100644 index d5d47b4..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_button_mac.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_button_win.png b/chrome/test/data/focus_rings/focus_ring_browsertest_button_win.png deleted file mode 100644 index e3c735b..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_button_win.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_checkbox.png b/chrome/test/data/focus_rings/focus_ring_browsertest_checkbox.png deleted file mode 100644 index 73ec818..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_checkbox.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_checkbox_mac.png b/chrome/test/data/focus_rings/focus_ring_browsertest_checkbox_mac.png deleted file mode 100644 index 784322f..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_checkbox_mac.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_checkbox_win.png b/chrome/test/data/focus_rings/focus_ring_browsertest_checkbox_win.png deleted file mode 100644 index 73ec818..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_checkbox_win.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_radio.png b/chrome/test/data/focus_rings/focus_ring_browsertest_radio.png deleted file mode 100644 index 0f7250a..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_radio.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_radio_mac.png b/chrome/test/data/focus_rings/focus_ring_browsertest_radio_mac.png deleted file mode 100644 index 42feacec..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_radio_mac.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/focus_rings/focus_ring_browsertest_radio_win.png b/chrome/test/data/focus_rings/focus_ring_browsertest_radio_win.png deleted file mode 100644 index 0f7250a..0000000 --- a/chrome/test/data/focus_rings/focus_ring_browsertest_radio_win.png +++ /dev/null Binary files differ
diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index d6f411c..960439e 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json
@@ -3680,7 +3680,8 @@ "policies": { "SystemFeaturesDisableList": ["os_settings"] }, - "prefs": { "policy.system_features_disable_list": { "local_state": true } } + "prefs": { "policy.system_features_disable_list": { "local_state": true }, + "os_settings_enabled": { "local_state": true } } } ] },
diff --git a/chrome/test/data/webui/print_preview/cloud_print_interface_stub.js b/chrome/test/data/webui/print_preview/cloud_print_interface_stub.js index be4359e2..5b29206 100644 --- a/chrome/test/data/webui/print_preview/cloud_print_interface_stub.js +++ b/chrome/test/data/webui/print_preview/cloud_print_interface_stub.js
@@ -29,6 +29,14 @@ /** @private {!Array<string>} */ this.users_ = []; + + /** @private {boolean} */ + this.configured_ = false; + } + + /** @override */ + configure() { + this.configured_ = true; } /** @override */ @@ -42,6 +50,11 @@ } /** @override */ + isConfigured() { + return this.configured_; + } + + /** @override */ setUsers(users) { this.users_ = users; }
diff --git a/chrome/test/data/webui/print_preview/destination_dialog_interactive_test.js b/chrome/test/data/webui/print_preview/destination_dialog_interactive_test.js index 07fb1f6f..0082140 100644 --- a/chrome/test/data/webui/print_preview/destination_dialog_interactive_test.js +++ b/chrome/test/data/webui/print_preview/destination_dialog_interactive_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {Destination, makeRecentDestination, NativeLayer, State} from 'chrome://print/print_preview.js'; +import {CloudPrintInterfaceImpl, Destination, makeRecentDestination, NativeLayer, State} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {keyDownOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; import {CloudPrintInterfaceStub} from 'chrome://test/print_preview/cloud_print_interface_stub.js'; @@ -44,6 +44,8 @@ const recentDestinations = [makeRecentDestination(destinations[4])]; nativeLayer.setLocalDestinations(localDestinations); const cloudPrintInterface = new CloudPrintInterfaceStub(); + CloudPrintInterfaceImpl.instance_ = cloudPrintInterface; + cloudPrintInterface.configure(); const model = document.createElement('print-preview-model'); document.body.appendChild(model);
diff --git a/chrome/test/data/webui/print_preview/destination_settings_test.js b/chrome/test/data/webui/print_preview/destination_settings_test.js index 927e843..739077a 100644 --- a/chrome/test/data/webui/print_preview/destination_settings_test.js +++ b/chrome/test/data/webui/print_preview/destination_settings_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {CloudPrintInterfaceEventType, Destination, DestinationConnectionStatus, DestinationErrorType, DestinationOrigin, DestinationState, DestinationStore, DestinationType, Error, makeRecentDestination, NativeLayer, State} from 'chrome://print/print_preview.js'; +import {CloudPrintInterfaceEventType, CloudPrintInterfaceImpl, Destination, DestinationConnectionStatus, DestinationErrorType, DestinationOrigin, DestinationState, DestinationStore, DestinationType, Error, makeRecentDestination, NativeLayer, State} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {isChromeOS} from 'chrome://resources/js/cr.m.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -78,6 +78,8 @@ destinations = getDestinations(nativeLayer, localDestinations); nativeLayer.setLocalDestinations(localDestinations); cloudPrintInterface = new CloudPrintInterfaceStub(); + CloudPrintInterfaceImpl.instance_ = cloudPrintInterface; + cloudPrintInterface.configure(); const model = document.createElement('print-preview-model'); document.body.appendChild(model);
diff --git a/chrome/test/data/webui/print_preview/invalid_settings_browsertest.js b/chrome/test/data/webui/print_preview/invalid_settings_browsertest.js index d4da77f0..1fb11da 100644 --- a/chrome/test/data/webui/print_preview/invalid_settings_browsertest.js +++ b/chrome/test/data/webui/print_preview/invalid_settings_browsertest.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {CloudPrintInterfaceEventType, Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, makeRecentDestination, NativeLayer, PluginProxy, ScalingType, setCloudPrintInterfaceForTesting, State, whenReady} from 'chrome://print/print_preview.js'; +import {CloudPrintInterfaceEventType, CloudPrintInterfaceImpl, Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, makeRecentDestination, NativeLayer, PluginProxy, ScalingType, State, whenReady} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {isWindows} from 'chrome://resources/js/cr.m.js'; import {CloudPrintInterfaceStub} from 'chrome://test/print_preview/cloud_print_interface_stub.js'; @@ -60,7 +60,7 @@ nativeLayer = new NativeLayerStub(); NativeLayer.setInstance(nativeLayer); cloudPrintInterface = new CloudPrintInterfaceStub(); - setCloudPrintInterfaceForTesting(cloudPrintInterface); + CloudPrintInterfaceImpl.instance_ = cloudPrintInterface; PolymerTest.clearBody(); });
diff --git a/chrome/test/data/webui/print_preview/print_preview_app_test.js b/chrome/test/data/webui/print_preview/print_preview_app_test.js index 2eeee54a..52fd81e 100644 --- a/chrome/test/data/webui/print_preview/print_preview_app_test.js +++ b/chrome/test/data/webui/print_preview/print_preview_app_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {CloudPrintInterface, Destination, DuplexMode, NativeLayer, PluginProxy, setCloudPrintInterfaceForTesting} from 'chrome://print/print_preview.js'; +import {CloudPrintInterface, CloudPrintInterfaceImpl, Destination, DuplexMode, NativeLayer, PluginProxy} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {CloudPrintInterfaceStub} from 'chrome://test/print_preview/cloud_print_interface_stub.js'; import {NativeLayerStub} from 'chrome://test/print_preview/native_layer_stub.js'; @@ -75,7 +75,7 @@ nativeLayer = new NativeLayerStub(); NativeLayer.setInstance(nativeLayer); cloudPrintInterface = new CloudPrintInterfaceStub(); - setCloudPrintInterfaceForTesting(cloudPrintInterface); + CloudPrintInterfaceImpl.instance_ = cloudPrintInterface; pluginProxy = new PDFPluginStub(); PluginProxy.setInstance(pluginProxy); });
diff --git a/chrome/test/data/webui/print_preview/print_preview_sidebar_test.js b/chrome/test/data/webui/print_preview/print_preview_sidebar_test.js index cfd3c29..06e0a01 100644 --- a/chrome/test/data/webui/print_preview/print_preview_sidebar_test.js +++ b/chrome/test/data/webui/print_preview/print_preview_sidebar_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {CloudPrintInterface, NativeLayer, setCloudPrintInterfaceForTesting} from 'chrome://print/print_preview.js'; +import {CloudPrintInterface, CloudPrintInterfaceImpl, NativeLayer} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {CloudPrintInterfaceStub} from 'chrome://test/print_preview/cloud_print_interface_stub.js'; import {NativeLayerStub} from 'chrome://test/print_preview/native_layer_stub.js'; @@ -38,6 +38,7 @@ NativeLayer.setInstance(nativeLayer); nativeLayer.setLocalDestinationCapabilities(getCddTemplate('FooDevice')); cloudPrintInterface = new CloudPrintInterfaceStub(); + CloudPrintInterfaceImpl.instance_ = cloudPrintInterface; PolymerTest.clearBody(); model = document.createElement('print-preview-model'); @@ -50,7 +51,6 @@ fakeDataBind(model, sidebar, 'settings'); document.body.appendChild(sidebar); sidebar.init(false, 'FooDevice', null); - sidebar.cloudPrintInterface = cloudPrintInterface; return nativeLayer.whenCalled('getPrinterCapabilities'); });
diff --git a/chrome/test/data/webui/print_preview/user_manager_test.js b/chrome/test/data/webui/print_preview/user_manager_test.js index 95f0aafc..d3043b8 100644 --- a/chrome/test/data/webui/print_preview/user_manager_test.js +++ b/chrome/test/data/webui/print_preview/user_manager_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {DestinationStore, InvitationStore, NativeLayer} from 'chrome://print/print_preview.js'; +import {CloudPrintInterfaceImpl, DestinationStore, InvitationStore, NativeLayer} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {CloudPrintInterfaceStub} from 'chrome://test/print_preview/cloud_print_interface_stub.js'; import {NativeLayerStub} from 'chrome://test/print_preview/native_layer_stub.js'; @@ -37,6 +37,7 @@ nativeLayer = new NativeLayerStub(); NativeLayer.setInstance(nativeLayer); cloudPrintInterface = new CloudPrintInterfaceStub(); + CloudPrintInterfaceImpl.instance_ = cloudPrintInterface; userManager = document.createElement('print-preview-user-manager'); @@ -64,12 +65,9 @@ cloudPrintInterface.setPrinter(getGoogleDriveDestination(account1)); cloudPrintInterface.setPrinter(getGoogleDriveDestination(account2)); - assertTrue(userManager.cloudPrintDisabled); - - userManager.cloudPrintInterface = cloudPrintInterface; - assertFalse(userManager.cloudPrintDisabled); assertEquals(undefined, userManager.activeUser); + userManager.cloudPrintDisabled = false; userManager.initUserAccounts([], true /* syncAvailable */); assertEquals('', userManager.activeUser); assertEquals(0, userManager.users.length); @@ -102,13 +100,10 @@ // Checks that initializing and updating user accounts works as expected // when sync is unavailable. test('update users without sync', function() { - assertTrue(userManager.cloudPrintDisabled); - const whenCalled = cloudPrintInterface.whenCalled('printer'); - userManager.cloudPrintInterface = cloudPrintInterface; - assertFalse(userManager.cloudPrintDisabled); assertEquals(undefined, userManager.activeUser); + userManager.cloudPrintDisabled = false; userManager.initUserAccounts([], false /* syncAvailable */); return whenCalled .then(() => { @@ -147,10 +142,7 @@ // Checks that initializing and updating user accounts works as expected // when sync is unavailable. test('update users without sync', function() { - assertTrue(userManager.cloudPrintDisabled); - - userManager.cloudPrintInterface = cloudPrintInterface; - assertFalse(userManager.cloudPrintDisabled); + userManager.cloudPrintDisabled = false; assertEquals(undefined, userManager.activeUser); userManager.initUserAccounts([], false /* syncAvailable */); @@ -192,10 +184,9 @@ // Set up a cloud printer for each account. cloudPrintInterface.setPrinter(getGoogleDriveDestination(account1)); cloudPrintInterface.setPrinter(getGoogleDriveDestination(account2)); - userManager.cloudPrintInterface = cloudPrintInterface; + userManager.cloudPrintDisabled = false; userManager.initUserAccounts( [account1, account2], true /* syncAvailable */); - assertFalse(userManager.cloudPrintDisabled); assertEquals(account1, userManager.activeUser); assertEquals(2, userManager.users.length);
diff --git a/chrome/test/data/webui/settings/chromeos/apps_page_test.js b/chrome/test/data/webui/settings/chromeos/apps_page_test.js index 42f84338..4c1c15b 100644 --- a/chrome/test/data/webui/settings/chromeos/apps_page_test.js +++ b/chrome/test/data/webui/settings/chromeos/apps_page_test.js
@@ -32,26 +32,7 @@ const AndroidAppsShown = () => !!appsPage.$$('#android-apps'); const AppManagementShown = () => !!appsPage.$$('#appManagement'); - test('Nothing Shown', function() { - appsPage.showAppManagement = false; - appsPage.showAndroidApps = false; - Polymer.dom.flush(); - - assertFalse(AppManagementShown()); - assertFalse(AndroidAppsShown()); - }); - - test('Only Android Apps Shown', function() { - appsPage.showAppManagement = false; - appsPage.showAndroidApps = true; - Polymer.dom.flush(); - - assertFalse(AppManagementShown()); - assertTrue(AndroidAppsShown()); - }); - test('Only App Management Shown', function() { - appsPage.showAppManagement = true; appsPage.showAndroidApps = false; Polymer.dom.flush(); @@ -60,7 +41,6 @@ }); test('Android Apps and App Management Shown', function() { - appsPage.showAppManagement = true; appsPage.showAndroidApps = true; Polymer.dom.flush();
diff --git a/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js b/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js index 104c4105..1f70f7f2 100644 --- a/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js +++ b/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js
@@ -294,11 +294,6 @@ } /** @override */ - get featureList() { - return {enabled: ['features::kAppManagement']}; - } - - /** @override */ get extraLibraries() { return super.extraLibraries.concat([ '//ui/webui/resources/js/cr/ui/store.js',
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index a70df8e..59c33e9 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -13037.0.0 \ No newline at end of file +13038.0.0 \ No newline at end of file
diff --git a/chromeos/components/media_app_ui/resources/js/dom_draft.externs.js b/chromeos/components/media_app_ui/resources/js/dom_draft.externs.js index 7e51c7f..98ba9ea 100644 --- a/chromeos/components/media_app_ui/resources/js/dom_draft.externs.js +++ b/chromeos/components/media_app_ui/resources/js/dom_draft.externs.js
@@ -7,5 +7,5 @@ * Externs for draft interfaces not yet upstreamed to closure. */ -/** @type {function(): Promise<ArrayBuffer>} */ +/** @type {function(): !Promise<!ArrayBuffer>} */ Blob.prototype.arrayBuffer;
diff --git a/chromeos/components/media_app_ui/resources/js/launch.js b/chromeos/components/media_app_ui/resources/js/launch.js index 9826942..8cabe15 100644 --- a/chromeos/components/media_app_ui/resources/js/launch.js +++ b/chromeos/components/media_app_ui/resources/js/launch.js
@@ -55,10 +55,8 @@ if (!currentlyWritableFile || overwrite.token !== fileToken) { throw new Error('File not current.'); } - const writer = await currentlyWritableFile.handle.createWritable(); - await writer.write(overwrite.blob); - await writer.truncate(overwrite.blob.size); - await writer.close(); + + await saveToFile(currentlyWritableFile.handle, overwrite.blob); }); guestMessagePipe.registerHandler(Message.DELETE_FILE, async (message) => { @@ -90,11 +88,8 @@ renameMsg.newFilename, {create: true}); // Copy file data over to the new file. - const writer = await renamedFileHandle.createWritable(); // TODO(b/153021155): Use originalFile.stream(). - await writer.write(await originalFile.arrayBuffer()); - await writer.truncate(originalFile.size); - await writer.close(); + await saveToFile(renamedFileHandle, await originalFile.arrayBuffer()); // Remove the old file since the new file has all the data & the new name. // Note even though removing an entry that doesn't exist is considered @@ -117,6 +112,71 @@ await advance(navigate.direction); }); +guestMessagePipe.registerHandler(Message.SAVE_COPY, async (message) => { + const {blob, suggestedName} = /** @type {!SaveCopyMessage} */ (message); + const extension = suggestedName.split('.').reverse()[0]; + // TODO(b/141587270): Add a default filename when it's supported by the native + // file api. + /** @type {!ChooseFileSystemEntriesOptions} */ + const options = { + type: 'save-file', + accepts: [{extension, mimeTypes: [blob.type]}] + }; + /** @type {!FileSystemHandle} */ + let fileSystemHandle; + // chooseFileSystem is where recoverable errors happen, errors in the write + // process should be treated as unexpected and propagated through + // MessagePipe's standard exception handling. + try { + fileSystemHandle = + /** @type {!FileSystemHandle} */ ( + await window.chooseFileSystemEntries(options)); + } catch (/** @type {!DOMException} */ err) { + if (err.name !== 'SecurityError' && err.name !== 'AbortError') { + // Unknown error. + throw err; + } + console.log(`Aborting SAVE_COPY: ${err.message}`); + return err.name; + } + + const {handle} = await getFileFromHandle(fileSystemHandle); + if (await handle.isSameEntry(currentlyWritableFile.handle)) { + return 'attemptedCurrentlyWritableFileOverwrite'; + } + + // Load this file into the app. + await saveToFile(handle, blob); +}); + +/** + * Saves the provided blob or arrayBuffer to the provided fileHandle. Assumes + * the handle is writable. + * @param {!FileSystemFileHandle} handle + * @param {!Blob|!ArrayBuffer} data + * @return {!Promise<undefined>} + */ +async function saveToFile(handle, data) { + const writer = await handle.createWritable(); + await writer.write(data); + await writer.truncate(data.size); + await writer.close(); +} + +/** + * Loads a single file into the guest. + * @param {{file: !File, handle: !FileSystemFileHandle}} fileHandle + * @returns {!Promise<undefined>} + */ +async function loadSingleFile(fileHandle) { + /** @type {!FileDescriptor} */ + const fd = {token: -1, file: fileHandle.file, handle: fileHandle.handle}; + currentFiles.length = 0; + currentFiles.push(fd); + entryIndex = 0; + await sendFilesToGuest(); +} + /** * Loads the current file list into the guest. * @return {!Promise<undefined>} @@ -205,7 +265,7 @@ if (!fileSystemHandle || !fileSystemHandle.isFile) { return null; } - const handle = /** @type{!FileSystemFileHandle} */ (fileSystemHandle); + const handle = /** @type {!FileSystemFileHandle} */ (fileSystemHandle); const file = await handle.getFile(); return {file, handle}; }
diff --git a/chromeos/components/media_app_ui/resources/js/media_app.externs.js b/chromeos/components/media_app_ui/resources/js/media_app.externs.js index ee28dba..5b90027 100644 --- a/chromeos/components/media_app_ui/resources/js/media_app.externs.js +++ b/chromeos/components/media_app_ui/resources/js/media_app.externs.js
@@ -92,6 +92,15 @@ * an error message, resolves with null otherwise. */ mediaApp.ClientApiDelegate.prototype.openFeedbackDialog = function() {}; +/** + * Saves a copy of `file` in a custom location with a custom + * name which the user is prompted for via a native save file dialog. + * @param {!mediaApp.AbstractFile} file + * @return {!Promise<?string>} Promise which resolves when the request has been + * acknowledged. If the dialog could not be opened the promise resolves with + * an error message. Otherwise, with null after writing is complete. + */ +mediaApp.ClientApiDelegate.prototype.saveCopy = function(file) {}; /** * The client Api for interacting with the media app instance.
diff --git a/chromeos/components/media_app_ui/resources/js/message_types.js b/chromeos/components/media_app_ui/resources/js/message_types.js index 6d5f2d4..415f7852 100644 --- a/chromeos/components/media_app_ui/resources/js/message_types.js +++ b/chromeos/components/media_app_ui/resources/js/message_types.js
@@ -18,6 +18,7 @@ OPEN_FEEDBACK_DIALOG: 'open-feedback-dialog', OVERWRITE_FILE: 'overwrite-file', RENAME_FILE: 'rename-file', + SAVE_COPY: 'save-copy' }; /** @@ -83,9 +84,30 @@ * Message sent by the unprivileged context to request the privileged context to * rename the currently writable file. * If the supplied file `token` is invalid the request is rejected. - @typedef {{token: number, newFilename: string}} + * @typedef {{token: number, newFilename: string}} */ let RenameFileMessage; /** @typedef {{renameResult: RenameResult}} */ let RenameFileResponse; + +/** + * Message sent by the unprivileged context to the privileged context requesting + * for the provided file to be copied and saved in a new location which the user + * is prompted for, i.e a 'save as' operation. Once the native filesystem api + * allows, this save as dialog will have the filename input be pre-filled with + * `suggestedName`. `suggestedName` is additionally used to determine the file + * extension which helps inform the save as dialog as to which files should be + * overwritable. This method can be called with any file, not just the currently + * writable file. + * @typedef {{blob: !Blob, suggestedName: string}} + */ +let SaveCopyMessage; + +/** + * Response message sent by the privileged context indicating the error message + * if the associated save as operation could not be performed. Returns nothing + * if the operation was successful. + * @typedef {{ errorMessage: ?string }} + */ +let SaveCopyResponse;
diff --git a/chromeos/components/media_app_ui/resources/js/receiver.js b/chromeos/components/media_app_ui/resources/js/receiver.js index e21b46e..86d5583 100644 --- a/chromeos/components/media_app_ui/resources/js/receiver.js +++ b/chromeos/components/media_app_ui/resources/js/receiver.js
@@ -133,7 +133,7 @@ } parentMessagePipe.registerHandler(Message.LOAD_FILES, async (message) => { - const filesMessage = /** @type{!LoadFilesMessage} */ (message); + const filesMessage = /** @type {!LoadFilesMessage} */ (message); await loadFiles(new ReceivedFileList(filesMessage)); }); @@ -143,11 +143,18 @@ * @type {!mediaApp.ClientApiDelegate} */ const DELEGATE = { - /** @override */ async openFeedbackDialog() { const response = await parentMessagePipe.sendMessage(Message.OPEN_FEEDBACK_DIALOG); return /** @type {?string} */ (response['errorMessage']); + }, + async saveCopy(/** !mediaApp.AbstractFile */ abstractFile) { + /** @type {!SaveCopyMessage} */ + const msg = {blob: abstractFile.blob, suggestedName: abstractFile.name}; + const response = + /** @type {!SaveCopyResponse} */ ( + await parentMessagePipe.sendMessage(Message.SAVE_COPY, msg)); + return response.errorMessage; } };
diff --git a/chromeos/components/media_app_ui/resources/js/web_app_file_handling.externs.js b/chromeos/components/media_app_ui/resources/js/web_app_file_handling.externs.js index 445d1d0f..9b31fad 100644 --- a/chromeos/components/media_app_ui/resources/js/web_app_file_handling.externs.js +++ b/chromeos/components/media_app_ui/resources/js/web_app_file_handling.externs.js
@@ -139,7 +139,7 @@ /** * @param {string} name * @param {FileSystemGetFileOptions=} options - * @return {Promise<!FileSystemFileHandle>} + * @return {!Promise<!FileSystemFileHandle>} */ getFile(name, options) {} @@ -204,10 +204,10 @@ * excludeAcceptAllOption: (boolean|undefined) * }} */ -let chooseFileSystemEntriesOptions; +let ChooseFileSystemEntriesOptions; /** - * @param {(!chooseFileSystemEntriesOptions|undefined)} options + * @param {(!ChooseFileSystemEntriesOptions|undefined)} options * @return {!Promise<(!FileSystemHandle|!Array<!FileSystemHandle>)>} */ window.chooseFileSystemEntries;
diff --git a/chromeos/components/media_app_ui/test/driver_api.js b/chromeos/components/media_app_ui/test/driver_api.js index 5e9208f..3af6754 100644 --- a/chromeos/components/media_app_ui/test/driver_api.js +++ b/chromeos/components/media_app_ui/test/driver_api.js
@@ -14,6 +14,7 @@ * property: (string|undefined), * renameLastFile: (string|undefined), * requestFullscreen: (boolean|undefined), + * saveCopy: (boolean|undefined), * testQuery: string, * }} */
diff --git a/chromeos/components/media_app_ui/test/guest_query_receiver.js b/chromeos/components/media_app_ui/test/guest_query_receiver.js index 1628dece0..a173b51 100644 --- a/chromeos/components/media_app_ui/test/guest_query_receiver.js +++ b/chromeos/components/media_app_ui/test/guest_query_receiver.js
@@ -75,6 +75,14 @@ } catch (/** @type{Error} */ error) { result = `renameOriginalFile failed Error: ${error}`; } + } else if (data.saveCopy) { + const existingFile = lastReceivedFileList.item(0); + if (!existingFile) { + result = 'saveCopy failed, no file loaded'; + } else { + DELEGATE.saveCopy(existingFile); + result = 'boo yah!'; + } } return {testQueryResult: result}; }
diff --git a/chromeos/components/media_app_ui/test/media_app_ui_browsertest.js b/chromeos/components/media_app_ui/test/media_app_ui_browsertest.js index 2decb9e6..ff92c2383 100644 --- a/chromeos/components/media_app_ui/test/media_app_ui_browsertest.js +++ b/chromeos/components/media_app_ui/test/media_app_ui_browsertest.js
@@ -72,9 +72,14 @@ const TEST_IMAGE_WIDTH = 123; const TEST_IMAGE_HEIGHT = 456; -/** @return {Promise<File>} A 123x456 transparent encoded image/png. */ -async function createTestImageFile() { - const canvas = new OffscreenCanvas(TEST_IMAGE_WIDTH, TEST_IMAGE_HEIGHT); +/** + * @param {number=} width + * @param {number=} height + * @return {Promise<File>} A {width}x{height} transparent encoded image/png. + */ +async function createTestImageFile( + width = TEST_IMAGE_WIDTH, height = TEST_IMAGE_HEIGHT) { + const canvas = new OffscreenCanvas(width, height); canvas.getContext('2d'); // convertToBlob fails without a rendering context. const blob = await canvas.convertToBlob(); return new File([blob], 'test_file.png', {type: 'image/png'}); @@ -108,7 +113,7 @@ }); // Tests that chrome://media-app can successfully send a request to open the -// feedback dialog and recieve a response. +// feedback dialog and receive a response. TEST_F('MediaAppUIBrowserTest', 'CanOpenFeedbackDialog', async () => { const result = await mediaAppPageHandler.openFeedbackDialog(); @@ -297,6 +302,35 @@ testDone(); }); +// Tests the IPC behind the saveCopy delegate function. +TEST_F('MediaAppUIBrowserTest', 'SaveCopyIPC', async () => { + // Mock out choose file system entries since it can only be interacted with + // via trusted user gestures. + const newFileHandle = new FakeFileSystemFileHandle(); + const chooseEntries = new Promise(resolve => { + window.chooseFileSystemEntries = options => { + resolve(options); + return newFileHandle; + }; + }); + const testImage = await createTestImageFile(10, 10); + loadFile(testImage, new FakeFileSystemFileHandle()); + + const result = await guestMessagePipe.sendMessage('test', {saveCopy: true}); + assertEquals(result.testQueryResult, 'boo yah!'); + const options = await chooseEntries; + + assertEquals(options.type, 'save-file'); + assertEquals(options.accepts.length, 1); + assertEquals(options.accepts[0].extension, 'png'); + assertEquals(options.accepts[0].mimeTypes.length, 1); + assertEquals(options.accepts[0].mimeTypes[0], 'image/png'); + + const writeResult = await newFileHandle.lastWritable.closePromise; + assertEquals(await writeResult.text(), await testImage.text()); + testDone(); +}); + // Test cases injected into the guest context. // See implementations in media_app_guest_ui_browsertest.js.
diff --git a/components/autofill/core/browser/autofill_test_utils.cc b/components/autofill/core/browser/autofill_test_utils.cc index 373d664..2472d97 100644 --- a/components/autofill/core/browser/autofill_test_utils.cc +++ b/components/autofill/core/browser/autofill_test_utils.cc
@@ -413,27 +413,25 @@ CreditCard GetMaskedServerCard() { CreditCard credit_card(CreditCard::MASKED_SERVER_CARD, "a123"); - // TODO(crbug/1059087): Change hardcoded year to NextYear. test::SetCreditCardInfo(&credit_card, "Bonnie Parker", - "2109" /* Mastercard */, "12", "2020", "1"); + "2109" /* Mastercard */, NextMonth().c_str(), + NextYear().c_str(), "1"); credit_card.SetNetworkForMaskedCard(kMasterCard); return credit_card; } CreditCard GetMaskedServerCardAmex() { CreditCard credit_card(CreditCard::MASKED_SERVER_CARD, "b456"); - // TODO(crbug/1059087): Change hardcoded year to NextYear. - test::SetCreditCardInfo(&credit_card, "Justin Thyme", "8431" /* Amex */, "9", - "2020", "1"); + test::SetCreditCardInfo(&credit_card, "Justin Thyme", "8431" /* Amex */, + NextMonth().c_str(), NextYear().c_str(), "1"); credit_card.SetNetworkForMaskedCard(kAmericanExpressCard); return credit_card; } CreditCard GetMaskedServerCardWithNickname() { CreditCard credit_card(CreditCard::MASKED_SERVER_CARD, "c789"); - // TODO(crbug/1059087): Change hardcoded year to NextYear. - test::SetCreditCardInfo(&credit_card, "Test user", "1111" /* Visa */, "9", - "2050", "1"); + test::SetCreditCardInfo(&credit_card, "Test user", "1111" /* Visa */, + NextMonth().c_str(), NextYear().c_str(), "1"); credit_card.SetNetworkForMaskedCard(kVisaCard); credit_card.SetNickname(ASCIIToUTF16("Test nickname")); return credit_card; @@ -441,9 +439,9 @@ CreditCard GetFullServerCard() { CreditCard credit_card(CreditCard::FULL_SERVER_CARD, "c123"); - // TODO(crbug/1059087): Change hardcoded year to NextYear. test::SetCreditCardInfo(&credit_card, "Full Carter", - "4111111111111111" /* Visa */, "12", "2020", "1"); + "4111111111111111" /* Visa */, NextMonth().c_str(), + NextYear().c_str(), "1"); return credit_card; }
diff --git a/components/autofill_assistant/browser/user_model.cc b/components/autofill_assistant/browser/user_model.cc index c4f7b8a4..26986d5 100644 --- a/components/autofill_assistant/browser/user_model.cc +++ b/components/autofill_assistant/browser/user_model.cc
@@ -4,10 +4,47 @@ #include "components/autofill_assistant/browser/user_model.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" +#include "third_party/re2/src/re2/re2.h" namespace autofill_assistant { +namespace { + +// Matches an ASCII identifier (w+) which ends in [<string>], e.g., +// test_identifier[sub_identifier[2]]. +static const char* const kExtractArraySubidentifierRegex = R"(^(\w+)\[(.+)\]$)"; + +// Simple wrapper around value_util::GetNthValue to unwrap the base::optional +// |value|. +base::Optional<ValueProto> GetNthValue(const base::Optional<ValueProto>& value, + int index) { + if (!value.has_value()) { + return base::nullopt; + } + + return GetNthValue(*value, index); +} + +// Same as above, but expects |index_value| to point to a single integer value +// specifying the index to retrieve. +base::Optional<ValueProto> GetNthValue( + const base::Optional<ValueProto>& value, + const base::Optional<ValueProto>& index_value) { + if (!value.has_value() || !index_value.has_value()) { + return base::nullopt; + } + if (!AreAllValuesOfSize({*index_value}, 1) || + !AreAllValuesOfType({*index_value}, ValueProto::kInts)) { + return base::nullopt; + } + + return GetNthValue(*value, index_value->ints().values().at(0)); +} + +} // namespace + UserModel::Observer::Observer() = default; UserModel::Observer::~Observer() = default; @@ -38,6 +75,21 @@ auto it = values_.find(identifier); if (it != values_.end()) { return it->second; + } else if (base::EndsWith(identifier, "]", base::CompareCase::SENSITIVE)) { + std::string identifier_without_suffix; + std::string subidentifier; + if (re2::RE2::FullMatch(identifier, kExtractArraySubidentifierRegex, + &identifier_without_suffix, &subidentifier)) { + int index; + if (base::StringToInt(subidentifier, &index)) { + // The case 'identifier[n]'. + return GetNthValue(GetValue(identifier_without_suffix), index); + } else { + // The case 'identifier[subidentifier]'. + return GetNthValue(GetValue(identifier_without_suffix), + GetValue(subidentifier)); + } + } } return base::nullopt; }
diff --git a/components/autofill_assistant/browser/user_model.h b/components/autofill_assistant/browser/user_model.h index c131da3..520b907d 100644 --- a/components/autofill_assistant/browser/user_model.h +++ b/components/autofill_assistant/browser/user_model.h
@@ -47,6 +47,8 @@ bool force_notification = false); // Returns the value for |identifier| or nullopt if there is no such value. + // Also supports the array operator to retrieve a specific element of a list, + // e.g., "identifier[0]" to get the first item. base::Optional<ValueProto> GetValue(const std::string& identifier) const; // Returns the value for |reference| or nullopt if there is no such value.
diff --git a/components/autofill_assistant/browser/user_model_unittest.cc b/components/autofill_assistant/browser/user_model_unittest.cc index c4b9c2f6..b7316fea 100644 --- a/components/autofill_assistant/browser/user_model_unittest.cc +++ b/components/autofill_assistant/browser/user_model_unittest.cc
@@ -219,4 +219,90 @@ Property(&ModelProto::ModelValue::value, Eq(value_c))))); } +TEST_F(UserModelTest, SubscriptAccess) { + ValueProto value; + value.mutable_strings()->add_values("a"); + value.mutable_strings()->add_values("b"); + value.mutable_strings()->add_values("c"); + + model_.SetValue("value", value); + EXPECT_EQ(model_.GetValue("value"), value); + EXPECT_EQ(model_.GetValue("value[0]"), SimpleValue(std::string("a"))); + EXPECT_EQ(model_.GetValue("value[1]"), SimpleValue(std::string("b"))); + EXPECT_EQ(model_.GetValue("value[2]"), SimpleValue(std::string("c"))); + EXPECT_EQ(model_.GetValue("value[001]"), SimpleValue(std::string("b"))); + + EXPECT_EQ(model_.GetValue("value[3]"), base::nullopt); + EXPECT_EQ(model_.GetValue("value[-1]"), base::nullopt); + + model_.SetValue("index", SimpleValue(0)); + EXPECT_EQ(model_.GetValue("value[index]"), SimpleValue(std::string("a"))); + model_.SetValue("index", SimpleValue(1)); + EXPECT_EQ(model_.GetValue("value[index]"), SimpleValue(std::string("b"))); + model_.SetValue("index", SimpleValue(2)); + EXPECT_EQ(model_.GetValue("value[index]"), SimpleValue(std::string("c"))); + model_.SetValue("index", SimpleValue(3)); + EXPECT_EQ(model_.GetValue("value[index]"), base::nullopt); + model_.SetValue("index", SimpleValue(-1)); + EXPECT_EQ(model_.GetValue("value[index]"), base::nullopt); + + model_.SetValue("index", SimpleValue(0)); + EXPECT_EQ(model_.GetValue("value[index[0]]"), SimpleValue(std::string("a"))); + model_.SetValue("index", SimpleValue(std::string("not an index"))); + EXPECT_EQ(model_.GetValue("value[index]"), base::nullopt); + + ValueProto indices; + indices.mutable_ints()->add_values(2); + indices.mutable_ints()->add_values(0); + indices.mutable_ints()->add_values(1); + model_.SetValue("indices", indices); + + model_.SetValue("index", SimpleValue(0)); + EXPECT_EQ(model_.GetValue("value[indices[index]]"), + SimpleValue(std::string("c"))); + + model_.SetValue("index", SimpleValue(1)); + EXPECT_EQ(model_.GetValue("value[indices[index]]"), + SimpleValue(std::string("a"))); + + model_.SetValue("index", SimpleValue(2)); + EXPECT_EQ(model_.GetValue("value[indices[index]]"), + SimpleValue(std::string("b"))); +} + +TEST_F(UserModelTest, IrregularModelIdentifiers) { + ValueProto value; + value.mutable_strings()->add_values("a"); + value.mutable_strings()->add_values("b"); + value.mutable_strings()->add_values("c"); + + model_.SetValue("normal_identifier", value); + model_.SetValue("utf_8_ü万𠜎", value); + model_.SetValue("ends_in_bracket]", value); + model_.SetValue("contains_[brackets]", value); + model_.SetValue("[]", value); + model_.SetValue("empty_brackets[]", value); + + // Retrieving simple values works for any identifiers. + EXPECT_EQ(model_.GetValue("normal_identifier"), value); + EXPECT_EQ(model_.GetValue("utf_8_ü万𠜎"), value); + EXPECT_EQ(model_.GetValue("ends_in_bracket]"), value); + EXPECT_EQ(model_.GetValue("contains_[brackets]"), value); + EXPECT_EQ(model_.GetValue("[]"), value); + EXPECT_EQ(model_.GetValue("empty_brackets[]"), value); + + // Subscript access is not supported for model identifiers containing + // irregular characters (i.e., outside of \w+). + EXPECT_EQ(model_.GetValue("normal_identifier[1]"), + SimpleValue(std::string("b"))); + EXPECT_EQ(model_.GetValue("ends_in_bracket][1]"), base::nullopt); + EXPECT_EQ(model_.GetValue("contains_[brackets][1]"), base::nullopt); + EXPECT_EQ(model_.GetValue("[][0]"), base::nullopt); + EXPECT_EQ(model_.GetValue("empty_brackets[1]"), base::nullopt); + EXPECT_EQ(model_.GetValue("empty_brackets[][1]"), base::nullopt); + + // Subscript access into UTF-8 identifiers is not supported. + EXPECT_EQ(model_.GetValue("utf_8_ü万𠜎[1]"), base::nullopt); +} + } // namespace autofill_assistant
diff --git a/components/autofill_assistant/browser/value_util.cc b/components/autofill_assistant/browser/value_util.cc index eae6d731..63fd926 100644 --- a/components/autofill_assistant/browser/value_util.cc +++ b/components/autofill_assistant/browser/value_util.cc
@@ -279,37 +279,63 @@ return false; } for (const auto& value : values) { - switch (value.kind_case()) { - case ValueProto::kStrings: - if (value.strings().values_size() != target_size) - return false; - break; - case ValueProto::kBooleans: - if (value.booleans().values_size() != target_size) - return false; - break; - case ValueProto::kInts: - if (value.ints().values_size() != target_size) - return false; - break; - case ValueProto::kUserActions: - if (value.user_actions().values_size() != target_size) - return false; - break; - case ValueProto::kDates: - if (value.dates().values_size() != target_size) - return false; - break; - case ValueProto::KIND_NOT_SET: - if (target_size != 0) { - return false; - } - break; + if (GetValueSize(value) != target_size) { + return false; } } return true; } +int GetValueSize(const ValueProto& value) { + switch (value.kind_case()) { + case ValueProto::kStrings: + return value.strings().values_size(); + case ValueProto::kBooleans: + return value.booleans().values_size(); + case ValueProto::kInts: + return value.ints().values_size(); + case ValueProto::kUserActions: + return value.user_actions().values_size(); + case ValueProto::kDates: + return value.dates().values_size(); + case ValueProto::KIND_NOT_SET: + return 0; + } +} + +base::Optional<ValueProto> GetNthValue(const ValueProto& value, int index) { + if (value == ValueProto()) { + return base::nullopt; + } + if (index < 0 || index >= GetValueSize(value)) { + return base::nullopt; + } + ValueProto nth_value; + switch (value.kind_case()) { + case ValueProto::kStrings: + nth_value.mutable_strings()->add_values( + value.strings().values().at(index)); + return nth_value; + case ValueProto::kBooleans: + nth_value.mutable_booleans()->add_values( + value.booleans().values().at(index)); + return nth_value; + case ValueProto::kInts: + nth_value.mutable_ints()->add_values(value.ints().values().at(index)); + return nth_value; + case ValueProto::kUserActions: + *nth_value.mutable_user_actions()->add_values() = + value.user_actions().values().at(index); + return nth_value; + case ValueProto::kDates: + *nth_value.mutable_dates()->add_values() = + value.dates().values().at(index); + return nth_value; + case ValueProto::KIND_NOT_SET: + return base::nullopt; + } +} + base::Optional<ValueProto> CombineValues( const std::vector<ValueProto>& values) { if (values.empty()) {
diff --git a/components/autofill_assistant/browser/value_util.h b/components/autofill_assistant/browser/value_util.h index 0cfeb0a..eb94d90 100644 --- a/components/autofill_assistant/browser/value_util.h +++ b/components/autofill_assistant/browser/value_util.h
@@ -62,6 +62,13 @@ // Returns true if all |values| share the specified |target_size|. bool AreAllValuesOfSize(const std::vector<ValueProto>& values, int target_size); +// Returns the number of elements in |value|. +int GetValueSize(const ValueProto& value); + +// Returns the |index|'th item of |value| or nullopt if |index| is +// out-of-bounds. +base::Optional<ValueProto> GetNthValue(const ValueProto& value, int index); + // Combines all specified |values| in a single ValueProto where the individual // value lists are appended after each other. Returns nullopt if |values| do not // share the same type.
diff --git a/components/autofill_assistant/browser/value_util_unittest.cc b/components/autofill_assistant/browser/value_util_unittest.cc index e5cca05..33773e8 100644 --- a/components/autofill_assistant/browser/value_util_unittest.cc +++ b/components/autofill_assistant/browser/value_util_unittest.cc
@@ -350,5 +350,19 @@ EXPECT_TRUE(value_a != value_b); } +TEST_F(ValueUtilTest, TestGetNthValue) { + ValueProto value; + value.mutable_strings()->add_values("a"); + value.mutable_strings()->add_values("b"); + value.mutable_strings()->add_values("c"); + + EXPECT_EQ(GetNthValue(value, 0), SimpleValue(std::string("a"))); + EXPECT_EQ(GetNthValue(value, 1), SimpleValue(std::string("b"))); + EXPECT_EQ(GetNthValue(value, 2), SimpleValue(std::string("c"))); + + EXPECT_EQ(GetNthValue(value, -1), base::nullopt); + EXPECT_EQ(GetNthValue(value, 3), base::nullopt); +} + } // namespace value_util } // namespace autofill_assistant
diff --git a/components/exo/drag_drop_operation.cc b/components/exo/drag_drop_operation.cc index 44c633f..818a4e7 100644 --- a/components/exo/drag_drop_operation.cc +++ b/components/exo/drag_drop_operation.cc
@@ -114,9 +114,9 @@ base::BindOnce(&DragDropOperation::ScheduleStartDragDropOperation, weak_ptr_factory_.GetWeakPtr()); - // Make the count kMaxClipboardDataTypes + 1 so we can wait for the icon to be - // captured as well. - counter_ = base::BarrierClosure(kMaxClipboardDataTypes + 1, + // When the icon is present, make the count kMaxClipboardDataTypes + 1 so we + // can wait for the icon to be captured as well. + counter_ = base::BarrierClosure(kMaxClipboardDataTypes + (icon ? 1 : 0), std::move(start_op_callback)); source->GetDataForPreferredMimeTypes(
diff --git a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationDelegate.java b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationDelegate.java index f906d0eb..9000b375 100644 --- a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationDelegate.java +++ b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationDelegate.java
@@ -182,6 +182,12 @@ boolean isIntentToInstantApp(Intent intent); /** + * @param intent The intent to launch + * @return Whether the Intent points to Autofill Assistant + */ + boolean isIntentToAutofillAssistant(Intent intent); + + /** * @param packageName The package to check. * @return Whether the package is a valid WebAPK package. */
diff --git a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java index 6347287..31d6fb3 100644 --- a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java +++ b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java
@@ -766,10 +766,15 @@ return true; } + // This will handle external navigations only for intent meant for Autofill Assistant. private boolean handleWithAutofillAssistant( ExternalNavigationParams params, Intent targetIntent, String browserFallbackUrl) { - if (mDelegate.handleWithAutofillAssistant(params, targetIntent, browserFallbackUrl)) { - if (DEBUG) Log.i(TAG, "Handling with Assistant"); + if (mDelegate.isIntentToAutofillAssistant(targetIntent)) { + if (mDelegate.handleWithAutofillAssistant(params, targetIntent, browserFallbackUrl)) { + if (DEBUG) Log.i(TAG, "Handled with Autofill Assistant."); + } else { + if (DEBUG) Log.i(TAG, "Not handled with Autofill Assistant."); + } return true; } return false;
diff --git a/components/password_manager/core/browser/multi_store_password_save_manager.cc b/components/password_manager/core/browser/multi_store_password_save_manager.cc index 585f5e6..7b26a77 100644 --- a/components/password_manager/core/browser/multi_store_password_save_manager.cc +++ b/components/password_manager/core/browser/multi_store_password_save_manager.cc
@@ -54,27 +54,23 @@ PendingCredentialsState ResolvePendingCredentialsStates( PendingCredentialsState profile_state, PendingCredentialsState account_state) { - // Resolve the two states to a single canonical one, according to the - // following hierarchy: + // The result of this resolution will be used to decide whether to show a + // save or update prompt to the user. Resolve the two states to a single + // "canonical" one according to the following hierarchy: // AUTOMATIC_SAVE > EQUAL_TO_SAVED_MATCH > UPDATE > NEW_LOGIN - // Note that UPDATE and NEW_LOGIN will result in an Update or Save bubble to + // Note that UPDATE or NEW_LOGIN will result in an Update or Save bubble to // be shown, while AUTOMATIC_SAVE and EQUAL_TO_SAVED_MATCH will result in a // silent save/update. // Some interesting cases: // NEW_LOGIN means that store doesn't know about the credential yet. If the // other store knows anything at all, then that always wins. // EQUAL_TO_SAVED_MATCH vs UPDATE: This means one store had a match, the other - // had a mismatch (same username but different password). We want to silently - // update the mismatch, which EQUAL achieves (since it'll still result in an - // update to date_last_used, and updates always go to both stores). - // TODO(crbug.com/1012203): AUTOMATIC_SAVE vs EQUAL: We should still perform - // the silent update for EQUAL (so last_use_date gets updated). - // TODO(crbug.com/1012203): AUTOMATIC_SAVE vs UPDATE: What's the expected - // outcome? Currently we'll auto-save the PSL match and ignore the update - // (which isn't too bad, since on the next submission the update will become - // a silent update through EQUAL_TO_SAVED_MATCH). - // TODO(crbug.com/1012203): AUTOMATIC_SAVE vs AUTOMATIC_SAVE: Somehow make - // sure that the save goes to both stores. + // had a mismatch (same username but different password). The mismatch should + // be updated silently, so resolve to EQUAL so that there's no visible prompt. + // AUTOMATIC_SAVE vs EQUAL_TO_SAVED_MATCH: These are both silent, so it + // doesn't really matter to which one we resolve. + // AUTOMATIC_SAVE vs UPDATE: Similar to EQUAL_TO_SAVED_MATCH vs UPDATE, the + // mismatch should be silently updated. if (profile_state == PendingCredentialsState::AUTOMATIC_SAVE || account_state == PendingCredentialsState::AUTOMATIC_SAVE) { return PendingCredentialsState::AUTOMATIC_SAVE; @@ -101,60 +97,91 @@ std::unique_ptr<FormSaver> profile_form_saver, std::unique_ptr<FormSaver> account_form_saver) : PasswordSaveManagerImpl(std::move(profile_form_saver)), - account_store_form_saver_(std::move(account_form_saver)) {} + account_store_form_saver_(std::move(account_form_saver)) { + DCHECK(account_store_form_saver_); +} MultiStorePasswordSaveManager::~MultiStorePasswordSaveManager() = default; -void MultiStorePasswordSaveManager::SaveInternal( - const std::vector<const PasswordForm*>& matches, - const base::string16& old_password) { - // For New Credentials, we should respect the default password store selected - // by user. In other cases such PSL matching, we respect the store in the - // retrieved credentials. - if (pending_credentials_state_ == PendingCredentialsState::NEW_LOGIN) { - pending_credentials_.in_store = - client_->GetPasswordFeatureManager()->GetDefaultPasswordStore(); - } +void MultiStorePasswordSaveManager::SavePendingToStoreImpl( + const PasswordForm& parsed_submitted_form) { + auto matches = form_fetcher_->GetAllRelevantMatches(); + PendingCredentialsStates states = + ComputePendingCredentialsStates(parsed_submitted_form, matches); - switch (pending_credentials_.in_store) { - case PasswordForm::Store::kAccountStore: - if (account_store_form_saver_ && IsOptedInForAccountStorage()) { - account_store_form_saver_->Save( - pending_credentials_, AccountStoreMatches(matches), old_password); - } + auto account_matches = AccountStoreMatches(matches); + auto profile_matches = ProfileStoreMatches(matches); + + base::string16 old_account_password = + states.similar_saved_form_from_account_store + ? states.similar_saved_form_from_account_store->password_value + : base::string16(); + base::string16 old_profile_password = + states.similar_saved_form_from_profile_store + ? states.similar_saved_form_from_profile_store->password_value + : base::string16(); + + if (states.profile_store_state == PendingCredentialsState::NEW_LOGIN && + states.account_store_state == PendingCredentialsState::NEW_LOGIN) { + // If the credential is new to both stores, store it only in the default + // store. + if (AccountStoreIsDefault()) { // TODO(crbug.com/1012203): Record UMA for how many passwords get dropped // here. In rare cases it could happen that the user *was* opted in when // the save dialog was shown, but now isn't anymore. + if (IsOptedInForAccountStorage()) { + account_store_form_saver_->Save(pending_credentials_, account_matches, + old_account_password); + } + } else { + form_saver_->Save(pending_credentials_, profile_matches, + old_profile_password); + } + return; + } + + switch (states.profile_store_state) { + case PendingCredentialsState::AUTOMATIC_SAVE: + form_saver_->Save(pending_credentials_, profile_matches, + old_profile_password); break; - case PasswordForm::Store::kProfileStore: - form_saver_->Save(pending_credentials_, ProfileStoreMatches(matches), - old_password); + case PendingCredentialsState::UPDATE: + case PendingCredentialsState::EQUAL_TO_SAVED_MATCH: + form_saver_->Update(pending_credentials_, profile_matches, + old_profile_password); break; - case PasswordForm::Store::kNotSet: - NOTREACHED(); + // The NEW_LOGIN case was already handled separately above. + case PendingCredentialsState::NEW_LOGIN: + case PendingCredentialsState::NONE: break; } -} -void MultiStorePasswordSaveManager::UpdateInternal( - const std::vector<const PasswordForm*>& matches, - const base::string16& old_password) { - // Try to update both stores anyway because if credentials don't exist, the - // update operation is no-op. - form_saver_->Update(pending_credentials_, ProfileStoreMatches(matches), - old_password); - if (account_store_form_saver_ && IsOptedInForAccountStorage()) { - account_store_form_saver_->Update( - pending_credentials_, AccountStoreMatches(matches), old_password); + // TODO(crbug.com/1012203): Record UMA for how many passwords get dropped + // here. In rare cases it could happen that the user *was* opted in when + // the save dialog was shown, but now isn't anymore. + if (IsOptedInForAccountStorage()) { + switch (states.account_store_state) { + case PendingCredentialsState::AUTOMATIC_SAVE: + account_store_form_saver_->Save(pending_credentials_, account_matches, + old_account_password); + break; + case PendingCredentialsState::UPDATE: + case PendingCredentialsState::EQUAL_TO_SAVED_MATCH: + account_store_form_saver_->Update(pending_credentials_, account_matches, + old_account_password); + break; + // The NEW_LOGIN case was already handled separately above. + case PendingCredentialsState::NEW_LOGIN: + case PendingCredentialsState::NONE: + break; + } } } void MultiStorePasswordSaveManager::PermanentlyBlacklist( const PasswordStore::FormDigest& form_digest) { DCHECK(!client_->IsIncognito()); - if (account_store_form_saver_ && IsOptedInForAccountStorage() && - client_->GetPasswordFeatureManager()->GetDefaultPasswordStore() == - PasswordForm::Store::kAccountStore) { + if (IsOptedInForAccountStorage() && AccountStoreIsDefault()) { account_store_form_saver_->PermanentlyBlacklist(form_digest); } else { // For users who aren't yet opted-in to the account storage, we store their @@ -168,9 +195,8 @@ // Try to unblacklist in both stores anyway because if credentials don't // exist, the unblacklist operation is no-op. form_saver_->Unblacklist(form_digest); - if (account_store_form_saver_ && IsOptedInForAccountStorage()) { + if (IsOptedInForAccountStorage()) account_store_form_saver_->Unblacklist(form_digest); - } } std::unique_ptr<PasswordSaveManager> MultiStorePasswordSaveManager::Clone() { @@ -218,61 +244,78 @@ } } -std::pair<const autofill::PasswordForm*, PendingCredentialsState> +std::pair<const PasswordForm*, PendingCredentialsState> MultiStorePasswordSaveManager::FindSimilarSavedFormAndComputeState( const PasswordForm& parsed_submitted_form) const { - const std::vector<const PasswordForm*> matches = - form_fetcher_->GetBestMatches(); - const PasswordForm* similar_saved_form_from_profile_store = - password_manager_util::GetMatchForUpdating(parsed_submitted_form, - ProfileStoreMatches(matches)); - const PasswordForm* similar_saved_form_from_account_store = - password_manager_util::GetMatchForUpdating(parsed_submitted_form, - AccountStoreMatches(matches)); + PendingCredentialsStates states = ComputePendingCredentialsStates( + parsed_submitted_form, form_fetcher_->GetBestMatches()); - // Compute the PendingCredentialsState (i.e. what to do - save, update, silent - // update) separately for the two stores. - PendingCredentialsState profile_state = ComputePendingCredentialsState( - parsed_submitted_form, similar_saved_form_from_profile_store); - PendingCredentialsState account_state = ComputePendingCredentialsState( - parsed_submitted_form, similar_saved_form_from_account_store); - - // Resolve the two states to a single canonical one. - PendingCredentialsState state = - ResolvePendingCredentialsStates(profile_state, account_state); + // Resolve the two states to a single canonical one. This will be used to + // decide what UI bubble (if any) to show to the user. + PendingCredentialsState resolved_state = ResolvePendingCredentialsStates( + states.profile_store_state, states.account_store_state); // Choose which of the saved forms (if any) to use as the base for updating, // based on which of the two states won the resolution. // Note that if we got the same state for both stores, then it doesn't really // matter which one we pick for updating, since the result will be the same // anyway. - const PasswordForm* similar_saved_form = nullptr; - if (state == profile_state) - similar_saved_form = similar_saved_form_from_profile_store; - else if (state == account_state) - similar_saved_form = similar_saved_form_from_account_store; + const PasswordForm* resolved_similar_saved_form = nullptr; + if (resolved_state == states.profile_store_state) + resolved_similar_saved_form = states.similar_saved_form_from_profile_store; + else if (resolved_state == states.account_store_state) + resolved_similar_saved_form = states.similar_saved_form_from_account_store; - return std::make_pair(similar_saved_form, state); + return std::make_pair(resolved_similar_saved_form, resolved_state); } FormSaver* MultiStorePasswordSaveManager::GetFormSaverForGeneration() { - return IsOptedInForAccountStorage() && account_store_form_saver_ - ? account_store_form_saver_.get() - : form_saver_.get(); + return IsOptedInForAccountStorage() ? account_store_form_saver_.get() + : form_saver_.get(); } -std::vector<const autofill::PasswordForm*> +std::vector<const PasswordForm*> MultiStorePasswordSaveManager::GetRelevantMatchesForGeneration( - const std::vector<const autofill::PasswordForm*>& matches) { + const std::vector<const PasswordForm*>& matches) { // For account store users, only matches in the account store should be // considered for conflict resolution during generation. - return IsOptedInForAccountStorage() && account_store_form_saver_ + return IsOptedInForAccountStorage() ? MatchesInStore(matches, PasswordForm::Store::kAccountStore) : matches; } -bool MultiStorePasswordSaveManager::IsOptedInForAccountStorage() { +// static +MultiStorePasswordSaveManager::PendingCredentialsStates +MultiStorePasswordSaveManager::ComputePendingCredentialsStates( + const PasswordForm& parsed_submitted_form, + const std::vector<const PasswordForm*>& matches) { + PendingCredentialsStates result; + + // Try to find a similar existing saved form from each of the stores. + result.similar_saved_form_from_profile_store = + password_manager_util::GetMatchForUpdating(parsed_submitted_form, + ProfileStoreMatches(matches)); + result.similar_saved_form_from_account_store = + password_manager_util::GetMatchForUpdating(parsed_submitted_form, + AccountStoreMatches(matches)); + + // Compute the PendingCredentialsState (i.e. what to do - save, update, silent + // update) separately for the two stores. + result.profile_store_state = ComputePendingCredentialsState( + parsed_submitted_form, result.similar_saved_form_from_profile_store); + result.account_store_state = ComputePendingCredentialsState( + parsed_submitted_form, result.similar_saved_form_from_account_store); + + return result; +} + +bool MultiStorePasswordSaveManager::IsOptedInForAccountStorage() const { return client_->GetPasswordFeatureManager()->IsOptedInForAccountStorage(); } +bool MultiStorePasswordSaveManager::AccountStoreIsDefault() const { + return client_->GetPasswordFeatureManager()->GetDefaultPasswordStore() == + PasswordForm::Store::kAccountStore; +} + } // namespace password_manager
diff --git a/components/password_manager/core/browser/multi_store_password_save_manager.h b/components/password_manager/core/browser/multi_store_password_save_manager.h index e4eab0b..e2d260d 100644 --- a/components/password_manager/core/browser/multi_store_password_save_manager.h +++ b/components/password_manager/core/browser/multi_store_password_save_manager.h
@@ -27,12 +27,6 @@ std::unique_ptr<FormSaver> account_form_saver); ~MultiStorePasswordSaveManager() override; - void SaveInternal(const std::vector<const autofill::PasswordForm*>& matches, - const base::string16& old_password) override; - - void UpdateInternal(const std::vector<const autofill::PasswordForm*>& matches, - const base::string16& old_password) override; - void PermanentlyBlacklist( const PasswordStore::FormDigest& form_digest) override; void Unblacklist(const PasswordStore::FormDigest& form_digest) override; @@ -42,6 +36,8 @@ void MoveCredentialsToAccountStore() override; protected: + void SavePendingToStoreImpl( + const autofill::PasswordForm& parsed_submitted_form) override; std::pair<const autofill::PasswordForm*, PendingCredentialsState> FindSimilarSavedFormAndComputeState( const autofill::PasswordForm& parsed_submitted_form) const override; @@ -50,9 +46,24 @@ const std::vector<const autofill::PasswordForm*>& matches) override; private: - bool IsOptedInForAccountStorage(); + struct PendingCredentialsStates { + PendingCredentialsState profile_store_state = PendingCredentialsState::NONE; + PendingCredentialsState account_store_state = PendingCredentialsState::NONE; + + const autofill::PasswordForm* similar_saved_form_from_profile_store = + nullptr; + const autofill::PasswordForm* similar_saved_form_from_account_store = + nullptr; + }; + static PendingCredentialsStates ComputePendingCredentialsStates( + const autofill::PasswordForm& parsed_submitted_form, + const std::vector<const autofill::PasswordForm*>& matches); + + bool IsOptedInForAccountStorage() const; + bool AccountStoreIsDefault() const; const std::unique_ptr<FormSaver> account_store_form_saver_; + DISALLOW_COPY_AND_ASSIGN(MultiStorePasswordSaveManager); };
diff --git a/components/password_manager/core/browser/multi_store_password_save_manager_unittest.cc b/components/password_manager/core/browser/multi_store_password_save_manager_unittest.cc index 4c19e70c..02c590ec 100644 --- a/components/password_manager/core/browser/multi_store_password_save_manager_unittest.cc +++ b/components/password_manager/core/browser/multi_store_password_save_manager_unittest.cc
@@ -239,11 +239,10 @@ fetcher()->NotifyFetchCompleted(); - PasswordForm parsed_submitted_form(parsed_submitted_form_); SetDefaultPasswordStore(PasswordForm::Store::kAccountStore); password_save_manager()->CreatePendingCredentials( - parsed_submitted_form, observed_form_, submitted_form_, + parsed_submitted_form_, observed_form_, submitted_form_, /*is_http_auth=*/false, /*is_credential_api_save=*/false); @@ -252,7 +251,7 @@ EXPECT_CALL(*mock_profile_form_saver(), Save(_, _, _)).Times(0); EXPECT_CALL(*mock_account_form_saver(), Save(_, _, _)); - password_save_manager()->Save(observed_form_, parsed_submitted_form); + password_save_manager()->Save(observed_form_, parsed_submitted_form_); } TEST_F(MultiStorePasswordSaveManagerTest, @@ -261,11 +260,10 @@ fetcher()->NotifyFetchCompleted(); - PasswordForm parsed_submitted_form(parsed_submitted_form_); SetDefaultPasswordStore(PasswordForm::Store::kAccountStore); password_save_manager()->CreatePendingCredentials( - parsed_submitted_form, observed_form_, submitted_form_, + parsed_submitted_form_, observed_form_, submitted_form_, /*is_http_auth=*/false, /*is_credential_api_save=*/false); @@ -274,7 +272,7 @@ EXPECT_CALL(*mock_profile_form_saver(), Save(_, _, _)).Times(0); EXPECT_CALL(*mock_account_form_saver(), Save(_, _, _)).Times(0); - password_save_manager()->Save(observed_form_, parsed_submitted_form); + password_save_manager()->Save(observed_form_, parsed_submitted_form_); } TEST_F(MultiStorePasswordSaveManagerTest, SaveInProfileStore) { @@ -282,11 +280,10 @@ fetcher()->NotifyFetchCompleted(); - PasswordForm parsed_submitted_form(parsed_submitted_form_); SetDefaultPasswordStore(PasswordForm::Store::kProfileStore); password_save_manager()->CreatePendingCredentials( - parsed_submitted_form, observed_form_, submitted_form_, + parsed_submitted_form_, observed_form_, submitted_form_, /*is_http_auth=*/false, /*is_credential_api_save=*/false); @@ -295,11 +292,10 @@ EXPECT_CALL(*mock_profile_form_saver(), Save(_, _, _)); EXPECT_CALL(*mock_account_form_saver(), Save(_, _, _)).Times(0); - password_save_manager()->Save(observed_form_, parsed_submitted_form); + password_save_manager()->Save(observed_form_, parsed_submitted_form_); } -TEST_F(MultiStorePasswordSaveManagerTest, - UpdateBothStoresIfCredentialsExistInAccountStoreOnly) { +TEST_F(MultiStorePasswordSaveManagerTest, UpdateInAccountStoreOnly) { SetAccountStoreEnabled(/*is_enabled=*/true); PasswordForm saved_match_in_account_store(saved_match_); @@ -317,14 +313,13 @@ // An update prompt should be shown. EXPECT_TRUE(password_save_manager()->IsPasswordUpdate()); - EXPECT_CALL(*mock_profile_form_saver(), Update(_, _, _)); + EXPECT_CALL(*mock_profile_form_saver(), Update(_, _, _)).Times(0); EXPECT_CALL(*mock_account_form_saver(), Update(_, _, _)); password_save_manager()->Save(observed_form_, parsed_submitted_form_); } -TEST_F(MultiStorePasswordSaveManagerTest, - UpdateBothStoresIfCredentialsExistInProfileStoreOnly) { +TEST_F(MultiStorePasswordSaveManagerTest, UpdateInProfileStoreOnly) { SetAccountStoreEnabled(/*is_enabled=*/true); PasswordForm saved_match_in_profile_store(saved_match_); @@ -343,13 +338,12 @@ EXPECT_TRUE(password_save_manager()->IsPasswordUpdate()); EXPECT_CALL(*mock_profile_form_saver(), Update(_, _, _)); - EXPECT_CALL(*mock_account_form_saver(), Update(_, _, _)); + EXPECT_CALL(*mock_account_form_saver(), Update(_, _, _)).Times(0); password_save_manager()->Save(observed_form_, parsed_submitted_form_); } -TEST_F(MultiStorePasswordSaveManagerTest, - UpdateBothStoresIfCredentialsExistInBothStores) { +TEST_F(MultiStorePasswordSaveManagerTest, UpdateInBothStores) { SetAccountStoreEnabled(/*is_enabled=*/true); PasswordForm saved_match_in_profile_store(saved_match_); @@ -523,37 +517,107 @@ TEST_F(MultiStorePasswordSaveManagerTest, SaveInAccountStoreWhenPSLMatchExistsInTheAccountStore) { SetAccountStoreEnabled(/*is_enabled=*/true); + PasswordForm psl_saved_match(psl_saved_match_); + psl_saved_match.username_value = parsed_submitted_form_.username_value; + psl_saved_match.password_value = parsed_submitted_form_.password_value; psl_saved_match.in_store = PasswordForm::Store::kAccountStore; SetNonFederatedAndNotifyFetchCompleted({&psl_saved_match}); password_save_manager()->CreatePendingCredentials( - saved_match_, observed_form_, submitted_form_, + parsed_submitted_form_, observed_form_, submitted_form_, /*is_http_auth=*/false, /*is_credential_api_save=*/false); EXPECT_CALL(*mock_profile_form_saver(), Save(_, _, _)).Times(0); EXPECT_CALL(*mock_account_form_saver(), Save(_, _, _)); - password_save_manager()->Save(observed_form_, saved_match_); + password_save_manager()->Save(observed_form_, parsed_submitted_form_); } TEST_F(MultiStorePasswordSaveManagerTest, SaveInProfileStoreWhenPSLMatchExistsInTheProfileStore) { SetAccountStoreEnabled(/*is_enabled=*/true); + PasswordForm psl_saved_match(psl_saved_match_); + psl_saved_match.username_value = parsed_submitted_form_.username_value; + psl_saved_match.password_value = parsed_submitted_form_.password_value; psl_saved_match.in_store = PasswordForm::Store::kProfileStore; SetNonFederatedAndNotifyFetchCompleted({&psl_saved_match}); password_save_manager()->CreatePendingCredentials( - saved_match_, observed_form_, submitted_form_, + parsed_submitted_form_, observed_form_, submitted_form_, /*is_http_auth=*/false, /*is_credential_api_save=*/false); EXPECT_CALL(*mock_profile_form_saver(), Save(_, _, _)); EXPECT_CALL(*mock_account_form_saver(), Save(_, _, _)).Times(0); - password_save_manager()->Save(observed_form_, saved_match_); + password_save_manager()->Save(observed_form_, parsed_submitted_form_); +} + +TEST_F(MultiStorePasswordSaveManagerTest, + SaveInBothStoresWhenPSLMatchExistsInBothStores) { + SetAccountStoreEnabled(/*is_enabled=*/true); + + PasswordForm profile_psl_saved_match(psl_saved_match_); + profile_psl_saved_match.username_value = + parsed_submitted_form_.username_value; + profile_psl_saved_match.password_value = + parsed_submitted_form_.password_value; + profile_psl_saved_match.in_store = PasswordForm::Store::kProfileStore; + + PasswordForm account_psl_saved_match(psl_saved_match_); + account_psl_saved_match.username_value = + parsed_submitted_form_.username_value; + account_psl_saved_match.password_value = + parsed_submitted_form_.password_value; + account_psl_saved_match.in_store = PasswordForm::Store::kAccountStore; + + SetNonFederatedAndNotifyFetchCompleted( + {&profile_psl_saved_match, &account_psl_saved_match}); + + password_save_manager()->CreatePendingCredentials( + parsed_submitted_form_, observed_form_, submitted_form_, + /*is_http_auth=*/false, + /*is_credential_api_save=*/false); + + EXPECT_CALL(*mock_profile_form_saver(), Save(_, _, _)); + EXPECT_CALL(*mock_account_form_saver(), Save(_, _, _)); + + password_save_manager()->Save(observed_form_, parsed_submitted_form_); +} + +TEST_F(MultiStorePasswordSaveManagerTest, UpdateVsPSLMatch) { + SetAccountStoreEnabled(/*is_enabled=*/true); + + PasswordForm profile_saved_match(saved_match_); + profile_saved_match.username_value = parsed_submitted_form_.username_value; + profile_saved_match.password_value = base::ASCIIToUTF16("old_password"); + profile_saved_match.in_store = PasswordForm::Store::kProfileStore; + + PasswordForm account_psl_saved_match(psl_saved_match_); + account_psl_saved_match.username_value = + parsed_submitted_form_.username_value; + account_psl_saved_match.password_value = + parsed_submitted_form_.password_value; + account_psl_saved_match.in_store = PasswordForm::Store::kAccountStore; + + SetNonFederatedAndNotifyFetchCompleted( + {&profile_saved_match, &account_psl_saved_match}); + + password_save_manager()->CreatePendingCredentials( + parsed_submitted_form_, observed_form_, submitted_form_, + /*is_http_auth=*/false, + /*is_credential_api_save=*/false); + + // This should *not* result in an update prompt. + EXPECT_FALSE(password_save_manager()->IsPasswordUpdate()); + + EXPECT_CALL(*mock_profile_form_saver(), Update(_, _, _)); + EXPECT_CALL(*mock_account_form_saver(), Save(_, _, _)); + + password_save_manager()->Save(observed_form_, parsed_submitted_form_); } TEST_F(MultiStorePasswordSaveManagerTest, UnblacklistInBothStores) {
diff --git a/components/password_manager/core/browser/password_save_manager_impl.cc b/components/password_manager/core/browser/password_save_manager_impl.cc index f7f32e7..75bbf18 100644 --- a/components/password_manager/core/browser/password_save_manager_impl.cc +++ b/components/password_manager/core/browser/password_save_manager_impl.cc
@@ -157,7 +157,7 @@ const FormData& submitted_form, bool is_http_auth, bool is_credential_api_save) { - const PasswordForm* similar_saved_form; + const PasswordForm* similar_saved_form = nullptr; std::tie(similar_saved_form, pending_credentials_state_) = FindSimilarSavedFormAndComputeState(parsed_submitted_form); @@ -451,29 +451,37 @@ const PasswordForm& parsed_submitted_form) { UploadVotesAndMetrics(observed_form, parsed_submitted_form); - bool update = !IsNewLogin(); - const PasswordForm* similar_saved_form = - FindSimilarSavedFormAndComputeState(parsed_submitted_form).first; - if (update && !pending_credentials_.IsFederatedCredential()) - DCHECK(similar_saved_form); - - base::string16 old_password = similar_saved_form - ? similar_saved_form->password_value - : base::string16(); if (HasGeneratedPassword()) { generation_manager_->CommitGeneratedPassword( pending_credentials_, form_fetcher_->GetAllRelevantMatches(), - old_password, GetFormSaverForGeneration()); - } else if (update) { + GetOldPassword(parsed_submitted_form), GetFormSaverForGeneration()); + } else { + SavePendingToStoreImpl(parsed_submitted_form); + } +} + +void PasswordSaveManagerImpl::SavePendingToStoreImpl( + const PasswordForm& parsed_submitted_form) { + auto matches = form_fetcher_->GetAllRelevantMatches(); + base::string16 old_password = GetOldPassword(parsed_submitted_form); + if (IsNewLogin()) { + form_saver_->Save(pending_credentials_, matches, old_password); + } else { // It sounds wrong that we still update even if the state is NONE. We // should double check if this actually necessary. Currently some tests // depend on this behavior. - UpdateInternal(form_fetcher_->GetAllRelevantMatches(), old_password); - } else { - SaveInternal(form_fetcher_->GetAllRelevantMatches(), old_password); + form_saver_->Update(pending_credentials_, matches, old_password); } } +base::string16 PasswordSaveManagerImpl::GetOldPassword( + const PasswordForm& parsed_submitted_form) const { + const PasswordForm* similar_saved_form = + FindSimilarSavedFormAndComputeState(parsed_submitted_form).first; + return similar_saved_form ? similar_saved_form->password_value + : base::string16(); +} + void PasswordSaveManagerImpl::UploadVotesAndMetrics( const FormData& observed_form, const PasswordForm& parsed_submitted_form) { @@ -530,18 +538,6 @@ return matches; } -void PasswordSaveManagerImpl::SaveInternal( - const std::vector<const PasswordForm*>& matches, - const base::string16& old_password) { - form_saver_->Save(pending_credentials_, matches, old_password); -} - -void PasswordSaveManagerImpl::UpdateInternal( - const std::vector<const PasswordForm*>& matches, - const base::string16& old_password) { - form_saver_->Update(pending_credentials_, matches, old_password); -} - void PasswordSaveManagerImpl::CloneInto(PasswordSaveManagerImpl* clone) { DCHECK(clone); if (generation_manager_)
diff --git a/components/password_manager/core/browser/password_save_manager_impl.h b/components/password_manager/core/browser/password_save_manager_impl.h index 99614b9..0db56db 100644 --- a/components/password_manager/core/browser/password_save_manager_impl.h +++ b/components/password_manager/core/browser/password_save_manager_impl.h
@@ -111,13 +111,8 @@ GetRelevantMatchesForGeneration( const std::vector<const autofill::PasswordForm*>& matches); - virtual void SaveInternal( - const std::vector<const autofill::PasswordForm*>& matches, - const base::string16& old_password); - - virtual void UpdateInternal( - const std::vector<const autofill::PasswordForm*>& matches, - const base::string16& old_password); + virtual void SavePendingToStoreImpl( + const autofill::PasswordForm& parsed_submitted_form); // Clones the current object into |clone|. |clone| must not be null. void CloneInto(PasswordSaveManagerImpl* clone); @@ -142,6 +137,9 @@ const FormFetcher* form_fetcher_; private: + base::string16 GetOldPassword( + const autofill::PasswordForm& parsed_submitted_form) const; + void SetVotesAndRecordMetricsForPendingCredentials( const autofill::PasswordForm& parsed_submitted_form);
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 1e644fa..73e17c8 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -7841,7 +7841,7 @@ 'owners': ['file://components/policy/resources/OWNERS'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome_os:82-'], + 'supported_on': ['chrome_os:83-'], 'supported_chrome_os_management': ['google_cloud'], 'device_only': True, 'features': {
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc index fa68814..214893c6 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -368,7 +368,9 @@ #if BUILDFLAG(ENABLE_PRINT_PREVIEW) bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) { - return job_settings.FindIntKey(kSettingPrinterType).value() == kPdfPrinter; + PrinterType type = static_cast<PrinterType>( + job_settings.FindIntKey(kSettingPrinterType).value()); + return type == PrinterType::kPdf; } bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
diff --git a/components/printing/test/print_render_frame_helper_browsertest.cc b/components/printing/test/print_render_frame_helper_browsertest.cc index c3d8de73..d585072 100644 --- a/components/printing/test/print_render_frame_helper_browsertest.cc +++ b/components/printing/test/print_render_frame_helper_browsertest.cc
@@ -118,7 +118,7 @@ dict->SetBoolean(kSettingLandscape, false); dict->SetBoolean(kSettingCollate, false); dict->SetInteger(kSettingColor, GRAY); - dict->SetInteger(kSettingPrinterType, kPdfPrinter); + dict->SetInteger(kSettingPrinterType, static_cast<int>(PrinterType::kPdf)); dict->SetInteger(kSettingDuplexMode, SIMPLEX); dict->SetInteger(kSettingCopies, 1); dict->SetString(kSettingDeviceName, "dummy"); @@ -801,7 +801,7 @@ // Fill in some dummy values. base::DictionaryValue dict; CreatePrintSettingsDictionary(&dict); - dict.SetInteger(kSettingPrinterType, kLocalPrinter); + dict.SetInteger(kSettingPrinterType, static_cast<int>(PrinterType::kLocal)); OnPrintPreview(dict); EXPECT_EQ(0, print_render_thread()->print_preview_pages_remaining()); @@ -823,7 +823,7 @@ // Fill in some dummy values. base::DictionaryValue dict; CreatePrintSettingsDictionary(&dict); - dict.SetInteger(kSettingPrinterType, kLocalPrinter); + dict.SetInteger(kSettingPrinterType, static_cast<int>(PrinterType::kLocal)); dict.SetInteger(kSettingMarginsType, NO_MARGINS); OnPrintPreview(dict); @@ -970,7 +970,7 @@ // Fill in some dummy values. base::DictionaryValue dict; CreatePrintSettingsDictionary(&dict); - dict.SetInteger(kSettingPrinterType, kLocalPrinter); + dict.SetInteger(kSettingPrinterType, static_cast<int>(PrinterType::kLocal)); OnPrintPreview(dict); EXPECT_EQ(0, print_render_thread()->print_preview_pages_remaining()); @@ -1026,7 +1026,7 @@ // Fill in some dummy values. base::DictionaryValue dict; CreatePrintSettingsDictionary(&dict); - dict.SetInteger(kSettingPrinterType, kLocalPrinter); + dict.SetInteger(kSettingPrinterType, static_cast<int>(PrinterType::kLocal)); OnPrintPreview(dict); EXPECT_EQ(0, print_render_thread()->print_preview_pages_remaining()); @@ -1058,7 +1058,7 @@ // Fill in some dummy values. base::DictionaryValue dict; CreatePrintSettingsDictionary(&dict); - dict.SetInteger(kSettingPrinterType, kLocalPrinter); + dict.SetInteger(kSettingPrinterType, static_cast<int>(PrinterType::kLocal)); OnPrintPreview(dict); EXPECT_EQ(0, print_render_thread()->print_preview_pages_remaining()); @@ -1080,7 +1080,7 @@ // Fill in some dummy values. base::DictionaryValue dict; CreatePrintSettingsDictionary(&dict); - dict.SetInteger(kSettingPrinterType, kLocalPrinter); + dict.SetInteger(kSettingPrinterType, static_cast<int>(PrinterType::kLocal)); dict.SetInteger(kSettingMarginsType, NO_MARGINS); OnPrintPreview(dict);
diff --git a/components/signin/internal/identity_manager/primary_account_mutator_impl.cc b/components/signin/internal/identity_manager/primary_account_mutator_impl.cc index 668f6602..2e762ae 100644 --- a/components/signin/internal/identity_manager/primary_account_mutator_impl.cc +++ b/components/signin/internal/identity_manager/primary_account_mutator_impl.cc
@@ -64,14 +64,6 @@ AccountInfo account_info = account_tracker_->GetAccountInfo(account_id); primary_account_manager_->SetUnconsentedPrimaryAccountInfo(account_info); } - -bool PrimaryAccountMutatorImpl::DeprecatedSetPrimaryAccountAndUpdateAccountInfo( - const std::string& gaia_id, - const std::string& email) { - CoreAccountId account_id = account_tracker_->SeedAccountInfo(gaia_id, email); - SetPrimaryAccount(account_id); - return true; -} #endif #if !defined(OS_CHROMEOS)
diff --git a/components/signin/internal/identity_manager/primary_account_mutator_impl.h b/components/signin/internal/identity_manager/primary_account_mutator_impl.h index 184c3ac4..8781868 100644 --- a/components/signin/internal/identity_manager/primary_account_mutator_impl.h +++ b/components/signin/internal/identity_manager/primary_account_mutator_impl.h
@@ -29,9 +29,6 @@ #if defined(OS_CHROMEOS) void RevokeSyncConsent() override; void SetUnconsentedPrimaryAccount(const CoreAccountId& account_id) override; - bool DeprecatedSetPrimaryAccountAndUpdateAccountInfo( - const std::string& gaia_id, - const std::string& email) override; #endif #if !defined(OS_CHROMEOS) bool ClearPrimaryAccount(
diff --git a/components/signin/public/identity_manager/primary_account_mutator.h b/components/signin/public/identity_manager/primary_account_mutator.h index 6dfab8d..9afcbf4f 100644 --- a/components/signin/public/identity_manager/primary_account_mutator.h +++ b/components/signin/public/identity_manager/primary_account_mutator.h
@@ -72,18 +72,6 @@ // of "unconsented". virtual void SetUnconsentedPrimaryAccount( const CoreAccountId& account_id) = 0; - - // Updates the info of the account corresponding to (|gaia_id|, |email|), - // marks it as the primary account, and returns whether the operation - // succeeded or not. Currently, this method is guaranteed to succeed. - // NOTE: Unlike SetPrimaryAccount(), this method does not require that the - // account is known by IdentityManager. The reason is that there are - // contexts on ChromeOS where the primary account is not guaranteed to be - // known by IdentityManager when it is set. - // TODO(https://crbug.com/987955): Remove this API. - virtual bool DeprecatedSetPrimaryAccountAndUpdateAccountInfo( - const std::string& gaia_id, - const std::string& email) = 0; #endif #if !defined(OS_CHROMEOS)
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index b4bbcdff8..ad77d862 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -1924,10 +1924,30 @@ "web_package/web_bundle_handle.h", "web_package/web_bundle_handle_tracker.cc", "web_package/web_bundle_handle_tracker.h", + "web_package/web_bundle_interceptor_for_file.cc", + "web_package/web_bundle_interceptor_for_file.h", + "web_package/web_bundle_interceptor_for_history_navigation.cc", + "web_package/web_bundle_interceptor_for_history_navigation.h", + "web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.cc", + "web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.h", + "web_package/web_bundle_interceptor_for_history_navigation_from_network.cc", + "web_package/web_bundle_interceptor_for_history_navigation_from_network.h", + "web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.cc", + "web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.h", + "web_package/web_bundle_interceptor_for_network.cc", + "web_package/web_bundle_interceptor_for_network.h", + "web_package/web_bundle_interceptor_for_tracked_navigation_from_file.cc", + "web_package/web_bundle_interceptor_for_tracked_navigation_from_file.h", + "web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.cc", + "web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.h", + "web_package/web_bundle_interceptor_for_trustable_file.cc", + "web_package/web_bundle_interceptor_for_trustable_file.h", "web_package/web_bundle_navigation_info.cc", "web_package/web_bundle_navigation_info.h", "web_package/web_bundle_reader.cc", "web_package/web_bundle_reader.h", + "web_package/web_bundle_redirect_url_loader.cc", + "web_package/web_bundle_redirect_url_loader.h", "web_package/web_bundle_source.cc", "web_package/web_bundle_source.h", "web_package/web_bundle_url_loader_factory.cc",
diff --git a/content/browser/form_controls_browsertest.cc b/content/browser/form_controls_browsertest.cc index 3321605..051421ca 100644 --- a/content/browser/form_controls_browsertest.cc +++ b/content/browser/form_controls_browsertest.cc
@@ -3,35 +3,37 @@ // found in the LICENSE file. #include "base/path_service.h" +#include "base/run_loop.h" #include "base/test/scoped_feature_list.h" -#include "content/public/browser/render_widget_host_view.h" +#include "base/threading/thread_restrictions.h" +#include "build/build_config.h" +#include "cc/test/pixel_comparator.h" +#include "cc/test/pixel_test_utils.h" +#include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/public/common/content_paths.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" -#include "content/public/test/screenshot_test_utils.h" #include "content/public/test/test_utils.h" #include "content/shell/browser/shell.h" #include "ui/base/ui_base_features.h" +#include "ui/display/display_switches.h" +#include "ui/gfx/image/image.h" +#include "ui/gfx/skbitmap_operations.h" -// TODO(crbug.com/958242): Move the baselines to skia gold for easier -// rebaselining when all platforms are supported. - -// To rebaseline this test on all platforms: -// 1. Run a CQ+1 dry run. -// 2. Click the failing bots for android, windows, mac, and linux. -// 3. Find the failing interactive_ui_browsertests step. -// 4. Click the "Deterministic failure" link for the failing test case. -// 5. Copy the "Actual pixels" data url and paste into browser. -// 6. Save the image into your chromium checkout in content/test/data/forms/. +// To rebaseline this test on android: +// 1. Run a CQ+1 dry run +// 2. Click the failing android bot +// 3. Find the failing content_browsertests step +// 4. Click the "Deterministic failure" link for the failing test case +// 5. Copy the "Actual pixels" data url and paste into browser +// 6. Save the image into your chromium checkout in content/test/data/forms/ namespace content { class FormControlsBrowserTest : public ContentBrowserTest { public: - FormControlsBrowserTest() { - feature_list_.InitWithFeatures({features::kFormControlsRefresh}, {}); - } + FormControlsBrowserTest() = default; void SetUp() override { EnablePixelOutput(); @@ -40,61 +42,128 @@ void SetUpCommandLine(base::CommandLine* command_line) override { ContentBrowserTest::SetUpCommandLine(command_line); - SetUpCommandLineForScreenshotTest(command_line); + // The --force-device-scale-factor flag helps make the pixel output of + // different android trybots more similar. + command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, "1.0"); + feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); + feature_list_->InitWithFeatures({features::kFormControlsRefresh}, {}); } - void RunTest(const std::string& screenshot_filename, - const std::string& body_html, - int screenshot_width, - int screenshot_height) { - base::ScopedAllowBlockingForTesting allow_blocking; + void TearDown() override { feature_list_.reset(); } + void AsyncSnapshotCallback(const gfx::Image& image) { + got_snapshot_ = true; + snapshot_ = image; + } + + void RunFormControlsTest(const std::string& expected_filename, + const std::string& body_html, + int screenshot_width, + int screenshot_height) { + base::ScopedAllowBlockingForTesting allow_blocking; ASSERT_TRUE(features::IsFormControlsRefreshEnabled()); + std::string url = + "data:text/html,<!DOCTYPE html>" + "<head>" + // The <meta name=viewport> tag helps make the pixel output of + // different android trybots more similar. + " <meta name=\"viewport\" content=\"width=640, initial-scale=1, " + " maximum-scale=1, minimum-scale=1\">" + "</head>" + "<body>" + + body_html + "</body>"; + ASSERT_TRUE(NavigateToURL(shell(), GURL(url))); + + RenderWidgetHostImpl* const rwh = + RenderWidgetHostImpl::From(shell() + ->web_contents() + ->GetRenderWidgetHostView() + ->GetRenderWidgetHost()); + CHECK(rwh); + rwh->GetSnapshotFromBrowser( + base::BindOnce(&FormControlsBrowserTest::AsyncSnapshotCallback, + base::Unretained(this)), + /* from_surface */ true); + while (!got_snapshot_) + base::RunLoop().RunUntilIdle(); + SkBitmap bitmap = SkBitmapOperations::CreateTiledBitmap( + *snapshot_.ToSkBitmap(), /* src_x */ 0, /* src_y */ 0, screenshot_width, + screenshot_height); + base::FilePath dir_test_data; ASSERT_TRUE(base::PathService::Get(DIR_TEST_DATA, &dir_test_data)); - base::FilePath golden_screenshot_filepath = - dir_test_data.AppendASCII("forms").AppendASCII(screenshot_filename + - ".png"); + std::string filename_with_extension = expected_filename; +#if defined(OS_ANDROID) + filename_with_extension += "_android"; +#endif + filename_with_extension += ".png"; + base::FilePath expected_path = + dir_test_data.AppendASCII("forms").AppendASCII(filename_with_extension); + SkBitmap expected_bitmap; + ASSERT_TRUE(cc::ReadPNGFile(expected_path, &expected_bitmap)); - ASSERT_TRUE(NavigateToURL( - shell()->web_contents(), - GURL("data:text/html,<!DOCTYPE html><body>" + body_html + "</body>"))); - - RunScreenshotTest(shell()->web_contents(), golden_screenshot_filepath, - screenshot_width, screenshot_height); + EXPECT_TRUE(cc::MatchesBitmap( + bitmap, expected_bitmap, +#if defined(OS_MACOSX) + // The Mac 10.12 trybot has more significant subpixel rendering + // differences which we accommodate for here with a large avg/max + // per-pixel error limit. + // TODO(crbug.com/1037971): Remove this special case for mac once this + // bug is resolved. + cc::FuzzyPixelComparator(/* discard_alpha */ true, + /* error_pixels_percentage_limit */ 7.f, + /* small_error_pixels_percentage_limit */ 0.f, + /* avg_abs_error_limit */ 16.f, + /* max_abs_error_limit */ 79.f, + /* small_error_threshold */ 0))); +#else + // We use a fuzzy comparator to accommodate for slight + // differences between the kitkat and marshmallow trybots that aren't + // visible to the human eye. We use a very low error limit because the + // pixels that are different are very similar shades of color. + cc::FuzzyPixelComparator(/* discard_alpha */ true, + /* error_pixels_percentage_limit */ 6.f, + /* small_error_pixels_percentage_limit */ 0.f, + /* avg_abs_error_limit */ 4.f, + /* max_abs_error_limit */ 4.f, + /* small_error_threshold */ 0))); +#endif } - private: - base::test::ScopedFeatureList feature_list_; + bool got_snapshot_ = false; + gfx::Image snapshot_; + std::unique_ptr<base::test::ScopedFeatureList> feature_list_; }; IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Checkbox) { - RunTest("form_controls_browsertest_checkbox", - "<input type=checkbox>" - "<input type=checkbox checked>" - "<input type=checkbox disabled>" - "<input type=checkbox checked disabled>" - "<input type=checkbox id=\"indeterminate\">" - "<script>" - " document.getElementById('indeterminate').indeterminate = true" - "</script>", - /* screenshot_width */ 130, - /* screenshot_height */ 40); + RunFormControlsTest( + "form_controls_browsertest_checkbox", + "<input type=checkbox>" + "<input type=checkbox checked>" + "<input type=checkbox disabled>" + "<input type=checkbox checked disabled>" + "<input type=checkbox id=\"indeterminate\">" + "<script>" + " document.getElementById('indeterminate').indeterminate = true" + "</script>", + /* screenshot_width */ 130, + /* screenshot_height */ 40); } IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Radio) { - RunTest("form_controls_browsertest_radio", - "<input type=radio>" - "<input type=radio checked>" - "<input type=radio disabled>" - "<input type=radio checked disabled>" - "<input type=radio id=\"indeterminate\">" - "<script>" - " document.getElementById('indeterminate').indeterminate = true" - "</script>", - /* screenshot_width */ 140, - /* screenshot_height */ 40); + RunFormControlsTest( + "form_controls_browsertest_radio", + "<input type=radio>" + "<input type=radio checked>" + "<input type=radio disabled>" + "<input type=radio checked disabled>" + "<input type=radio id=\"indeterminate\">" + "<script>" + " document.getElementById('indeterminate').indeterminate = true" + "</script>", + /* screenshot_width */ 140, + /* screenshot_height */ 40); } // TODO(jarhar): Add tests for other elements from
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index f76a633..6e8fdb4e 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2226,14 +2226,18 @@ render_view_host->GetMainFrameRoutingIdForCrbug1006814(); std::string message = base::StringPrintf( "created=%d,process=%d,proxy=%d,widget=%d,main_rfh=%d,new_rfh=%d," - "in_pdo=%d", + "in_pdo=%d,in_cpdo=%d,wi=%d", new_render_frame_host->IsRenderFrameCreated(), new_render_frame_host->GetProcess()->IsInitializedAndNotDead(), !!GetRenderFrameProxyHost(instance), widget_renderer_initialized, main_rfh_routing_id, new_render_frame_host->routing_id(), static_cast<RenderProcessHostImpl*>( render_view_host->GetWidget()->GetProcess()) - ->GetWithinProcessDiedObserverForCrbug1006814()); + ->GetWithinProcessDiedObserverForCrbug1006814(), + static_cast<RenderProcessHostImpl*>( + render_view_host->GetWidget()->GetProcess()) + ->GetWithinCleanupProcessDiedObserverForCrbug1006814(), + render_view_host->GetWidget()->get_initializer_for_crbug_1006814()); // This string is whitelisted for collection from Android Webview. It must // only contain booleans to avoid leaking any PII. base::debug::SetCrashKeyString(crash_key, message);
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 1b1724e..f1443f3 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3731,9 +3731,11 @@ info.status = base::TERMINATION_STATUS_NORMAL_TERMINATION; info.exit_code = 0; PopulateTerminationInfoRendererFields(&info); + within_cleanup_process_died_observer_ = true; for (auto& observer : observers_) { observer.RenderProcessExited(this, info); } + within_cleanup_process_died_observer_ = false; } for (auto& observer : observers_) observer.RenderProcessHostDestroyed(this);
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index 089fcd43..178d71a0 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -303,6 +303,11 @@ return within_process_died_observer_; } + // TODO(https://crbug.com/1006814): Delete this. + bool GetWithinCleanupProcessDiedObserverForCrbug1006814() { + return within_cleanup_process_died_observer_; + } + // Used to extend the lifetime of the sessions until the render view // in the renderer is fully closed. This is static because its also called // with mock hosts as input in test cases. The RenderWidget routing associated @@ -1099,10 +1104,15 @@ // longer within the RenderProcessHostObserver::RenderProcessExited callbacks. bool delayed_cleanup_needed_; - // Indicates whether RenderProcessHostImpl is currently iterating and calling - // through RenderProcessHostObserver::RenderProcessExited. + // Indicates whether RenderProcessHostImpl::ProcessDied is currently iterating + // and calling through RenderProcessHostObserver::RenderProcessExited. bool within_process_died_observer_; + // Indicates whether RenderProcessHostImpl::Cleanup is currently iterating and + // calling through RenderProcessHostObserver::RenderProcessExited. + // TODO(https://crbug.com/1006814): Delete this. + bool within_cleanup_process_died_observer_ = false; + std::unique_ptr<P2PSocketDispatcherHost> p2p_socket_dispatcher_host_; // Must be accessed on UI thread.
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 01a4e3dc..851c44e 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -339,7 +339,8 @@ DCHECK(main_rfh); } - GetWidget()->set_renderer_initialized(true); + GetWidget()->set_renderer_initialized( + true, RenderWidgetHostImpl::RendererInitializer::kCreateRenderView); mojom::CreateViewParamsPtr params = mojom::CreateViewParams::New(); params->renderer_preferences =
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index e33060e..cf64f7c 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -514,7 +514,7 @@ void RenderWidgetHostImpl::Init() { DCHECK(process_->IsInitializedAndNotDead()); - renderer_initialized_ = true; + set_renderer_initialized(true, RendererInitializer::kInit); SendScreenRects(); SynchronizeVisualProperties(); @@ -575,7 +575,7 @@ void RenderWidgetHostImpl::InitForFrame() { DCHECK(process_->IsInitializedAndNotDead()); - renderer_initialized_ = true; + set_renderer_initialized(true, RendererInitializer::kInitForFrame); if (view_) view_->OnRenderWidgetInit(); @@ -1946,7 +1946,7 @@ // Clearing this flag causes us to re-create the renderer when recovering // from a crashed renderer. - renderer_initialized_ = false; + set_renderer_initialized(false, RendererInitializer::kUnknown); // After the renderer crashes, the view is destroyed and so the // RenderWidgetHost cannot track its visibility anymore. We assume such
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 57865bc..244f352 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -593,10 +593,26 @@ void RejectMouseLockOrUnlockIfNecessary( blink::mojom::PointerLockResult reason); - void set_renderer_initialized(bool renderer_initialized) { + // The places in our codebase that call set_renderer_initialized or set the + // state to true directly. + // TODO(https://crbug.com/1006814): Delete this. + enum class RendererInitializer { + kUnknown, + kTest, // We don't care about tests, this can be used for any test call. + kInit, // RenderWidgetHostImpl + kInitForFrame, // RenderWidgetHostImpl + kWebContentsInit, + kCreateRenderView, + }; + void set_renderer_initialized(bool renderer_initialized, + RendererInitializer initializer) { renderer_initialized_ = renderer_initialized; + initializer_ = initializer; } - + // TODO(https://crbug.com/1006814): Delete this. + RendererInitializer get_initializer_for_crbug_1006814() { + return initializer_; + } // Store values received in a child frame RenderWidgetHost from a parent // RenderWidget, in order to pass them to the renderer and continue their // propagation down the RenderWidget tree. @@ -1267,6 +1283,10 @@ blink_widget_host_receiver_{this}; mojo::AssociatedRemote<blink::mojom::Widget> blink_widget_; + // Who initialized us. + // TODO(https://crbug.com/1006814): Delete this. + RendererInitializer initializer_ = RendererInitializer::kUnknown; + base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_{this}; DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm index 4e31d0a88..c93f366 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -371,7 +371,7 @@ /*hidden=*/false, std::make_unique<FrameTokenMessageQueue>()), widget_impl_(std::move(widget_impl)) { - set_renderer_initialized(true); + set_renderer_initialized(true, RendererInitializer::kTest); lastWheelEventLatencyInfo = ui::LatencyInfo(); ON_CALL(*this, Focus())
diff --git a/content/browser/service_worker/service_worker_storage_control_impl_unittest.cc b/content/browser/service_worker/service_worker_storage_control_impl_unittest.cc index 0d4ddc3..dfb01b62 100644 --- a/content/browser/service_worker/service_worker_storage_control_impl_unittest.cc +++ b/content/browser/service_worker/service_worker_storage_control_impl_unittest.cc
@@ -34,6 +34,28 @@ namespace { +struct ReadResponseHeadResult { + int status; + network::mojom::URLResponseHeadPtr response_head; + base::Optional<mojo_base::BigBuffer> metadata; +}; + +struct GetRegistrationsForOriginResult { + DatabaseStatus status; + std::vector<storage::mojom::SerializedServiceWorkerRegistrationPtr> + registrations; +}; + +struct DeleteRegistrationResult { + DatabaseStatus status; + storage::mojom::ServiceWorkerStorageOriginState origin_state; +}; + +struct GetUserDataResult { + DatabaseStatus status; + std::vector<std::string> values; +}; + struct GetUserDataByKeyPrefixResult { DatabaseStatus status; std::vector<std::string> values; @@ -44,21 +66,20 @@ base::flat_map<std::string, std::string> user_data; }; -int ReadResponseHead(storage::mojom::ServiceWorkerResourceReader* reader, - network::mojom::URLResponseHeadPtr& out_response_head, - base::Optional<mojo_base::BigBuffer>& out_metadata) { - int return_value; +ReadResponseHeadResult ReadResponseHead( + storage::mojom::ServiceWorkerResourceReader* reader) { + ReadResponseHeadResult result; base::RunLoop loop; reader->ReadResponseHead(base::BindLambdaForTesting( - [&](int result, network::mojom::URLResponseHeadPtr response_head, + [&](int status, network::mojom::URLResponseHeadPtr response_head, base::Optional<mojo_base::BigBuffer> metadata) { - return_value = result; - out_response_head = std::move(response_head); - out_metadata = std::move(metadata); + result.status = status; + result.response_head = std::move(response_head); + result.metadata = std::move(metadata); loop.Quit(); })); loop.Run(); - return return_value; + return result; } std::string ReadResponseData( @@ -185,11 +206,9 @@ return return_value; } - void GetRegistrationsForOrigin( - const GURL& origin, - DatabaseStatus& out_status, - std::vector<storage::mojom::SerializedServiceWorkerRegistrationPtr>& - out_registrations) { + GetRegistrationsForOriginResult GetRegistrationsForOrigin( + const GURL& origin) { + GetRegistrationsForOriginResult result; base::RunLoop loop; storage()->GetRegistrationsForOrigin( origin, @@ -198,17 +217,18 @@ std::vector< storage::mojom::SerializedServiceWorkerRegistrationPtr> registrations) { - out_status = status; - out_registrations = std::move(registrations); + result.status = status; + result.registrations = std::move(registrations); loop.Quit(); })); loop.Run(); + return result; } - void StoreRegistration( + DatabaseStatus StoreRegistration( storage::mojom::ServiceWorkerRegistrationDataPtr registration, - std::vector<storage::mojom::ServiceWorkerResourceRecordPtr> resources, - DatabaseStatus& out_status) { + std::vector<storage::mojom::ServiceWorkerResourceRecordPtr> resources) { + DatabaseStatus out_status; base::RunLoop loop; storage()->StoreRegistration( std::move(registration), std::move(resources), @@ -217,24 +237,24 @@ loop.Quit(); })); loop.Run(); + return out_status; } - void DeleteRegistration( - int64_t registration_id, - const GURL& origin, - DatabaseStatus& out_status, - storage::mojom::ServiceWorkerStorageOriginState& out_origin_state) { + DeleteRegistrationResult DeleteRegistration(int64_t registration_id, + const GURL& origin) { + DeleteRegistrationResult result; base::RunLoop loop; storage()->DeleteRegistration( registration_id, origin, base::BindLambdaForTesting( [&](DatabaseStatus status, storage::mojom::ServiceWorkerStorageOriginState origin_state) { - out_status = status; - out_origin_state = origin_state; + result.status = status; + result.origin_state = origin_state; loop.Quit(); })); loop.Run(); + return result; } int64_t GetNewRegistrationId() { @@ -261,20 +281,20 @@ return return_value; } - void GetUserData(int64_t registration_id, - const std::vector<std::string>& keys, - DatabaseStatus& out_status, - std::vector<std::string>& out_values) { + GetUserDataResult GetUserData(int64_t registration_id, + const std::vector<std::string>& keys) { + GetUserDataResult result; base::RunLoop loop; storage()->GetUserData( registration_id, keys, base::BindLambdaForTesting( [&](DatabaseStatus status, const std::vector<std::string>& values) { - out_status = status; - out_values = values; + result.status = status; + result.values = values; loop.Quit(); })); loop.Run(); + return result; } DatabaseStatus StoreUserData( @@ -379,8 +399,8 @@ } data->resources_total_size_bytes = resources_total_size_bytes; - DatabaseStatus status; - StoreRegistration(std::move(data), std::move(resources), status); + DatabaseStatus status = + StoreRegistration(std::move(data), std::move(resources)); return status; } @@ -469,8 +489,8 @@ // Store the registration data. { - DatabaseStatus status; - StoreRegistration(std::move(data), std::move(resources), status); + DatabaseStatus status = + StoreRegistration(std::move(data), std::move(resources)); ASSERT_EQ(status, DatabaseStatus::kOk); } @@ -493,12 +513,10 @@ // Delete the registration. { - DatabaseStatus status; - storage::mojom::ServiceWorkerStorageOriginState origin_state; - DeleteRegistration(kRegistrationId, kScope.GetOrigin(), status, - origin_state); - ASSERT_EQ(status, DatabaseStatus::kOk); - EXPECT_EQ(origin_state, + DeleteRegistrationResult result = + DeleteRegistration(kRegistrationId, kScope.GetOrigin()); + ASSERT_EQ(result.status, DatabaseStatus::kOk); + EXPECT_EQ(result.origin_state, storage::mojom::ServiceWorkerStorageOriginState::kDelete); } @@ -541,11 +559,11 @@ std::vector<storage::mojom::SerializedServiceWorkerRegistrationPtr> registrations; - GetRegistrationsForOrigin(origin, status, registrations); - ASSERT_EQ(status, DatabaseStatus::kOk); - EXPECT_EQ(registrations.size(), 2UL); + GetRegistrationsForOriginResult result = GetRegistrationsForOrigin(origin); + ASSERT_EQ(result.status, DatabaseStatus::kOk); + EXPECT_EQ(result.registrations.size(), 2UL); - for (auto& registration : registrations) { + for (auto& registration : result.registrations) { EXPECT_EQ(registration->registration_data->scope.GetOrigin(), origin); EXPECT_EQ(registration->registration_data->resources_total_size_bytes, kScriptSize); @@ -559,9 +577,9 @@ std::vector<storage::mojom::SerializedServiceWorkerRegistrationPtr> registrations; - GetRegistrationsForOrigin(origin, status, registrations); - ASSERT_EQ(status, DatabaseStatus::kOk); - EXPECT_EQ(registrations.size(), 0UL); + GetRegistrationsForOriginResult result = GetRegistrationsForOrigin(origin); + ASSERT_EQ(result.status, DatabaseStatus::kOk); + EXPECT_EQ(result.registrations.size(), 0UL); } } @@ -611,18 +629,15 @@ // Read the response head, metadata and the content. { - network::mojom::URLResponseHeadPtr response_head; - base::Optional<mojo_base::BigBuffer> response_metadata; - int result = - ReadResponseHead(reader.get(), response_head, response_metadata); - ASSERT_GT(result, 0); + ReadResponseHeadResult result = ReadResponseHead(reader.get()); + ASSERT_GT(result.status, 0); - EXPECT_EQ(response_head->mime_type, "application/javascript"); - EXPECT_EQ(response_head->content_length, data_size); - EXPECT_TRUE(response_head->ssl_info->is_valid()); - EXPECT_EQ(response_head->ssl_info->cert->serial_number(), + EXPECT_EQ(result.response_head->mime_type, "application/javascript"); + EXPECT_EQ(result.response_head->content_length, data_size); + EXPECT_TRUE(result.response_head->ssl_info->is_valid()); + EXPECT_EQ(result.response_head->ssl_info->cert->serial_number(), ssl_info.cert->serial_number()); - EXPECT_EQ(response_metadata, base::nullopt); + EXPECT_EQ(result.metadata, base::nullopt); std::string data = ReadResponseData(reader.get(), data_size); EXPECT_EQ(data, kData); @@ -642,16 +657,12 @@ // Read the response head again. This time metadata should be read. { - network::mojom::URLResponseHeadPtr response_head; - base::Optional<mojo_base::BigBuffer> response_metadata; - int result = - ReadResponseHead(reader.get(), response_head, response_metadata); - ASSERT_GT(result, 0); - ASSERT_TRUE(response_metadata.has_value()); - EXPECT_EQ(response_metadata->size(), kMetadata.size()); + ReadResponseHeadResult result = ReadResponseHead(reader.get()); + ASSERT_GT(result.status, 0); + ASSERT_TRUE(result.metadata.has_value()); + EXPECT_EQ(result.metadata->size(), kMetadata.size()); EXPECT_EQ( - memcmp(response_metadata->data(), kMetadata.data(), kMetadata.size()), - 0); + memcmp(result.metadata->data(), kMetadata.data(), kMetadata.size()), 0); } } @@ -685,21 +696,19 @@ // Get user data. { std::vector<std::string> keys = {"key1", "key2"}; - std::vector<std::string> values; - GetUserData(registration_id, keys, status, values); - ASSERT_EQ(status, DatabaseStatus::kOk); - EXPECT_EQ(values.size(), 2UL); - EXPECT_EQ("value1", values[0]); - EXPECT_EQ("value2", values[1]); + GetUserDataResult result = GetUserData(registration_id, keys); + ASSERT_EQ(result.status, DatabaseStatus::kOk); + EXPECT_EQ(result.values.size(), 2UL); + EXPECT_EQ("value1", result.values[0]); + EXPECT_EQ("value2", result.values[1]); } // Try to get user data with an unknown key should fail. { std::vector<std::string> keys = {"key1", "key2", "key3"}; - std::vector<std::string> values; - GetUserData(registration_id, keys, status, values); - ASSERT_EQ(status, DatabaseStatus::kErrorNotFound); - EXPECT_EQ(values.size(), 0UL); + GetUserDataResult result = GetUserData(registration_id, keys); + ASSERT_EQ(result.status, DatabaseStatus::kErrorNotFound); + EXPECT_EQ(result.values.size(), 0UL); } // Clear the first entry. @@ -707,31 +716,27 @@ std::vector<std::string> keys = {"key1"}; status = ClearUserData(registration_id, keys); ASSERT_EQ(status, DatabaseStatus::kOk); - - std::vector<std::string> values; - GetUserData(registration_id, keys, status, values); - ASSERT_EQ(status, DatabaseStatus::kErrorNotFound); - EXPECT_EQ(values.size(), 0UL); + GetUserDataResult result = GetUserData(registration_id, keys); + ASSERT_EQ(result.status, DatabaseStatus::kErrorNotFound); + EXPECT_EQ(result.values.size(), 0UL); } // Getting the second entry should succeed. { std::vector<std::string> keys = {"key2"}; - std::vector<std::string> values; - GetUserData(registration_id, keys, status, values); - ASSERT_EQ(status, DatabaseStatus::kOk); - EXPECT_EQ(values.size(), 1UL); - EXPECT_EQ("value2", values[0]); + GetUserDataResult result = GetUserData(registration_id, keys); + ASSERT_EQ(result.status, DatabaseStatus::kOk); + EXPECT_EQ(result.values.size(), 1UL); + EXPECT_EQ("value2", result.values[0]); } // Delete the registration and store a new registration for the same // scope. const int64_t new_registration_id = GetNewRegistrationId(); { - storage::mojom::ServiceWorkerStorageOriginState origin_state; - DeleteRegistration(registration_id, kScope.GetOrigin(), status, - origin_state); - ASSERT_EQ(status, DatabaseStatus::kOk); + DeleteRegistrationResult result = + DeleteRegistration(registration_id, kScope.GetOrigin()); + ASSERT_EQ(result.status, DatabaseStatus::kOk); status = CreateAndStoreRegistration(new_registration_id, kScope, kScriptUrl, kScriptSize); @@ -741,10 +746,9 @@ // Try to get user data stored for the previous registration should fail. { std::vector<std::string> keys = {"key2"}; - std::vector<std::string> values; - GetUserData(new_registration_id, keys, status, values); - ASSERT_EQ(status, DatabaseStatus::kErrorNotFound); - EXPECT_EQ(values.size(), 0UL); + GetUserDataResult result = GetUserData(new_registration_id, keys); + ASSERT_EQ(result.status, DatabaseStatus::kErrorNotFound); + EXPECT_EQ(result.values.size(), 0UL); } }
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index a4a2c55..b93b364 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2114,7 +2114,8 @@ // corresponding RenderView and main RenderFrame have already been created. // Ensure observers are notified about this. if (params.renderer_initiated_creation) { - GetRenderViewHost()->GetWidget()->set_renderer_initialized(true); + GetRenderViewHost()->GetWidget()->set_renderer_initialized( + true, RenderWidgetHostImpl::RendererInitializer::kWebContentsInit); GetRenderViewHost()->DispatchRenderViewCreated(); GetRenderManager()->current_frame_host()->SetRenderFrameCreated(true); }
diff --git a/content/browser/web_package/web_bundle_handle.cc b/content/browser/web_package/web_bundle_handle.cc index adec318..24863bc 100644 --- a/content/browser/web_package/web_bundle_handle.cc +++ b/content/browser/web_package/web_bundle_handle.cc
@@ -4,1161 +4,31 @@ #include "content/browser/web_package/web_bundle_handle.h" -#include <string> -#include <utility> -#include <vector> - -#include "base/bind.h" -#include "base/feature_list.h" -#include "base/memory/ptr_util.h" -#include "base/sequence_checker.h" -#include "base/strings/stringprintf.h" -#include "base/task/post_task.h" -#include "content/browser/loader/navigation_loader_interceptor.h" -#include "content/browser/loader/single_request_url_loader_factory.h" -#include "content/browser/web_package/signed_exchange_utils.h" #include "content/browser/web_package/web_bundle_handle_tracker.h" +#include "content/browser/web_package/web_bundle_interceptor_for_file.h" +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.h" +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_network.h" +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.h" +#include "content/browser/web_package/web_bundle_interceptor_for_network.h" +#include "content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_file.h" +#include "content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.h" +#include "content/browser/web_package/web_bundle_interceptor_for_trustable_file.h" #include "content/browser/web_package/web_bundle_navigation_info.h" #include "content/browser/web_package/web_bundle_reader.h" #include "content/browser/web_package/web_bundle_source.h" -#include "content/browser/web_package/web_bundle_url_loader_factory.h" #include "content/browser/web_package/web_bundle_utils.h" -#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" -#include "content/public/browser/download_utils.h" #include "content/public/browser/render_frame_host.h" -#include "content/public/browser/web_contents.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/receiver.h" -#include "mojo/public/cpp/bindings/self_owned_receiver.h" -#include "net/http/http_util.h" -#include "net/traffic_annotation/network_traffic_annotation.h" -#include "services/data_decoder/public/mojom/web_bundle_parser.mojom.h" -#include "services/network/public/mojom/url_loader.mojom.h" -#include "third_party/blink/public/common/loader/throttling_url_loader.h" namespace content { - -namespace { - -using DoneCallback = base::OnceCallback<void( - const GURL& target_inner_url, - std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory)>; - -constexpr char kNoSniffErrorMessage[] = - "Web Bundle response must have \"X-Content-Type-Options: nosniff\" header."; - -const net::NetworkTrafficAnnotationTag kTrafficAnnotation = - net::DefineNetworkTrafficAnnotation("web_bundle_start_url_loader", - R"( - semantics { - sender: "Web Bundle primary_url Loader" - description: - "Navigation request for the primary_url provided by a Web Bundle " - "that is requested by the user. This does not trigger any network " - "transaction directly, but access to an entry in a local file, or in a " - "previously fetched resource over network." - trigger: "The user navigates to a Web Bundle." - data: "Nothing." - destination: LOCAL - } - policy { - cookies_allowed: NO - setting: "These requests cannot be disabled in settings." - policy_exception_justification: - "Not implemented. This request does not make any network transaction." - } - comments: - "Usually the request accesses an entry in a local file that contains " - "multiple archived entries. But once the feature is exposed to the public " - "web API, the archive file can be streamed over network. In such case, the " - "streaming should be provided by another URLLoader request that is issued " - "by Blink, but based on a user initiated navigation." - )"); - -std::string GetMetadataParseErrorMessage( - const data_decoder::mojom::BundleMetadataParseErrorPtr& metadata_error) { - return std::string("Failed to read metadata of Web Bundle file: ") + - metadata_error->message; -} - -void CompleteWithInvalidWebBundleError( - mojo::Remote<network::mojom::URLLoaderClient> client, - int frame_tree_node_id, - const std::string& error_message) { - WebContents* web_contents = - WebContents::FromFrameTreeNodeId(frame_tree_node_id); - if (web_contents) { - web_contents->GetMainFrame()->AddMessageToConsole( - blink::mojom::ConsoleMessageLevel::kError, error_message); - } - std::move(client)->OnComplete( - network::URLLoaderCompletionStatus(net::ERR_INVALID_WEB_BUNDLE)); -} - -// A class to provide a network::mojom::URLLoader interface to redirect a -// request to the Web Bundle to the main resource url. -class RedirectURLLoader final : public network::mojom::URLLoader { - public: - RedirectURLLoader(mojo::PendingRemote<network::mojom::URLLoaderClient> client) - : client_(std::move(client)) {} - - void OnReadyToRedirect(const network::ResourceRequest& resource_request, - const GURL& url) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(client_.is_connected()); - auto response_head = network::mojom::URLResponseHead::New(); - response_head->encoded_data_length = 0; - response_head->headers = base::MakeRefCounted<net::HttpResponseHeaders>( - net::HttpUtil::AssembleRawHeaders( - base::StringPrintf("HTTP/1.1 %d %s\r\n", 303, "See Other"))); - - net::RedirectInfo redirect_info = net::RedirectInfo::ComputeRedirectInfo( - "GET", resource_request.url, resource_request.site_for_cookies, - resource_request.update_first_party_url_on_redirect - ? net::URLRequest::FirstPartyURLPolicy:: - UPDATE_FIRST_PARTY_URL_ON_REDIRECT - : net::URLRequest::FirstPartyURLPolicy:: - NEVER_CHANGE_FIRST_PARTY_URL, - resource_request.referrer_policy, resource_request.referrer.spec(), 303, - url, /*referrer_policy_header=*/base::nullopt, - /*insecure_scheme_was_upgraded=*/false, /*copy_fragment=*/true, - /*is_signed_exchange_fallback_redirect=*/false); - client_->OnReceiveRedirect(redirect_info, std::move(response_head)); - } - - private: - // mojom::URLLoader overrides: - void FollowRedirect(const std::vector<std::string>& removed_headers, - const net::HttpRequestHeaders& modified_headers, - const base::Optional<GURL>& new_url) override {} - void SetPriority(net::RequestPriority priority, - int intra_priority_value) override {} - void PauseReadingBodyFromNet() override {} - void ResumeReadingBodyFromNet() override {} - - SEQUENCE_CHECKER(sequence_checker_); - - mojo::Remote<network::mojom::URLLoaderClient> client_; - - DISALLOW_COPY_AND_ASSIGN(RedirectURLLoader); -}; - -// A class to inherit NavigationLoaderInterceptor for a navigation to an -// untrustable Web Bundle file (eg: "file:///tmp/a.wbn"). -// The overridden methods of NavigationLoaderInterceptor are called in the -// following sequence: -// [1] MaybeCreateLoader() is called for all navigation requests. It calls the -// |callback| with a null RequestHandler. -// [2] MaybeCreateLoaderForResponse() is called for all navigation responses. -// If the response mime type is not "application/webbundle", returns false. -// Otherwise starts reading the metadata and returns true. Once the metadata -// is read, OnMetadataReady() is called, and a redirect loader is -// created to redirect the navigation request to the Bundle's synthesized -// primary URL ("file:///tmp/a.wbn?https://example.com/a.html"). -// [3] MaybeCreateLoader() is called again for the redirect. It continues on -// StartResponse() to create the loader for the main resource. -class InterceptorForFile final : public NavigationLoaderInterceptor { - public: - explicit InterceptorForFile(DoneCallback done_callback, - int frame_tree_node_id) - : done_callback_(std::move(done_callback)), - frame_tree_node_id_(frame_tree_node_id) {} - ~InterceptorForFile() override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - } - - private: - // NavigationLoaderInterceptor implementation - void MaybeCreateLoader( - const network::ResourceRequest& tentative_resource_request, - BrowserContext* browser_context, - LoaderCallback callback, - FallbackCallback fallback_callback) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - // InterceptorForFile::MaybeCreateLoader() creates a loader only after - // recognising that the response is a Web Bundle file at - // MaybeCreateLoaderForResponse() and successfully created - // |url_loader_factory_|. - if (!url_loader_factory_) { - std::move(callback).Run({}); - return; - } - std::move(callback).Run( - base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( - &InterceptorForFile::StartResponse, weak_factory_.GetWeakPtr()))); - } - - bool MaybeCreateLoaderForResponse( - const network::ResourceRequest& request, - network::mojom::URLResponseHeadPtr* response_head, - mojo::ScopedDataPipeConsumerHandle* response_body, - mojo::PendingRemote<network::mojom::URLLoader>* loader, - mojo::PendingReceiver<network::mojom::URLLoaderClient>* client_receiver, - blink::ThrottlingURLLoader* url_loader, - bool* skip_other_interceptors, - bool* will_return_unsafe_redirect) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(web_bundle_utils::IsSupportedFileScheme(request.url)); - if ((*response_head)->mime_type != - web_bundle_utils::kWebBundleFileMimeTypeWithoutParameters) { - return false; - } - std::unique_ptr<WebBundleSource> source = - WebBundleSource::MaybeCreateFromFileUrl(request.url); - if (!source) - return false; - reader_ = base::MakeRefCounted<WebBundleReader>(std::move(source)); - reader_->ReadMetadata(base::BindOnce(&InterceptorForFile::OnMetadataReady, - weak_factory_.GetWeakPtr(), request)); - *client_receiver = forwarding_client_.BindNewPipeAndPassReceiver(); - *will_return_unsafe_redirect = true; - return true; - } - - void OnMetadataReady( - network::ResourceRequest request, - data_decoder::mojom::BundleMetadataParseErrorPtr metadata_error) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (metadata_error) { - CompleteWithInvalidWebBundleError( - std::move(forwarding_client_), frame_tree_node_id_, - GetMetadataParseErrorMessage(metadata_error)); - return; - } - DCHECK(reader_); - primary_url_ = reader_->GetPrimaryURL(); - url_loader_factory_ = std::make_unique<WebBundleURLLoaderFactory>( - std::move(reader_), frame_tree_node_id_); - - const GURL new_url = web_bundle_utils::GetSynthesizedUrlForWebBundle( - request.url, primary_url_); - auto redirect_loader = - std::make_unique<RedirectURLLoader>(forwarding_client_.Unbind()); - redirect_loader->OnReadyToRedirect(request, new_url); - } - - void StartResponse( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - network::ResourceRequest new_resource_request = resource_request; - new_resource_request.url = primary_url_; - url_loader_factory_->CreateLoaderAndStart( - std::move(receiver), /*routing_id=*/0, /*request_id=*/0, /*options=*/0, - new_resource_request, std::move(client), - net::MutableNetworkTrafficAnnotationTag(kTrafficAnnotation)); - std::move(done_callback_).Run(primary_url_, std::move(url_loader_factory_)); - } - - DoneCallback done_callback_; - const int frame_tree_node_id_; - scoped_refptr<WebBundleReader> reader_; - GURL primary_url_; - std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; - - mojo::Remote<network::mojom::URLLoaderClient> forwarding_client_; - - SEQUENCE_CHECKER(sequence_checker_); - - base::WeakPtrFactory<InterceptorForFile> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(InterceptorForFile); -}; - -// A class to inherit NavigationLoaderInterceptor for a navigation to a -// trustable Web Bundle file (eg: "file:///tmp/a.wbn"). -// The overridden methods of NavigationLoaderInterceptor are called in the -// following sequence: -// [1] MaybeCreateLoader() is called for the navigation request to the trustable -// Web Bundle file. It continues on CreateURLLoader() to create the loader -// for the main resource. -// - If OnMetadataReady() has not been called yet: -// Wait for OnMetadataReady() to be called. -// - If OnMetadataReady() was called with an error: -// Completes the request with ERR_INVALID_WEB_BUNDLE. -// - If OnMetadataReady() was called whthout errors: -// A redirect loader is created to redirect the navigation request to -// the Bundle's primary URL ("https://example.com/a.html"). -// [2] MaybeCreateLoader() is called again for the redirect. It continues on -// CreateURLLoader() to create the loader for the main resource. -class InterceptorForTrustableFile final : public NavigationLoaderInterceptor { - public: - InterceptorForTrustableFile(std::unique_ptr<WebBundleSource> source, - DoneCallback done_callback, - int frame_tree_node_id) - : source_(std::move(source)), - reader_(base::MakeRefCounted<WebBundleReader>(source_->Clone())), - done_callback_(std::move(done_callback)), - frame_tree_node_id_(frame_tree_node_id) { - reader_->ReadMetadata( - base::BindOnce(&InterceptorForTrustableFile::OnMetadataReady, - weak_factory_.GetWeakPtr())); - } - ~InterceptorForTrustableFile() override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - } - - private: - // NavigationLoaderInterceptor implementation - void MaybeCreateLoader(const network::ResourceRequest& resource_request, - BrowserContext* browser_context, - LoaderCallback callback, - FallbackCallback fallback_callback) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - std::move(callback).Run(base::MakeRefCounted<SingleRequestURLLoaderFactory>( - base::BindOnce(&InterceptorForTrustableFile::CreateURLLoader, - weak_factory_.GetWeakPtr()))); - } - - void CreateURLLoader( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (metadata_error_) { - CompleteWithInvalidWebBundleError( - mojo::Remote<network::mojom::URLLoaderClient>(std::move(client)), - frame_tree_node_id_, GetMetadataParseErrorMessage(metadata_error_)); - return; - } - - if (!url_loader_factory_) { - // This must be the first request to the Web Bundle file. - DCHECK_EQ(source_->url(), resource_request.url); - pending_resource_request_ = resource_request; - pending_receiver_ = std::move(receiver); - pending_client_ = std::move(client); - return; - } - - // Currently |source_| must be a local file. And the bundle's primary URL - // can't be a local file URL. So while handling redirected request to the - // primary URL, |resource_request.url| must not be same as the |source_|'s - // URL. - if (source_->url() != resource_request.url) { - url_loader_factory_->CreateLoaderAndStart( - std::move(receiver), /*routing_id=*/0, /*request_id=*/0, - /*options=*/0, resource_request, std::move(client), - net::MutableNetworkTrafficAnnotationTag(kTrafficAnnotation)); - std::move(done_callback_) - .Run(resource_request.url, std::move(url_loader_factory_)); - return; - } - - auto redirect_loader = - std::make_unique<RedirectURLLoader>(std::move(client)); - redirect_loader->OnReadyToRedirect(resource_request, primary_url_); - mojo::MakeSelfOwnedReceiver( - std::move(redirect_loader), - mojo::PendingReceiver<network::mojom::URLLoader>(std::move(receiver))); - } - - void OnMetadataReady(data_decoder::mojom::BundleMetadataParseErrorPtr error) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(!url_loader_factory_); - - if (error) { - metadata_error_ = std::move(error); - } else { - primary_url_ = reader_->GetPrimaryURL(); - url_loader_factory_ = std::make_unique<WebBundleURLLoaderFactory>( - std::move(reader_), frame_tree_node_id_); - } - - if (pending_receiver_) { - DCHECK(pending_client_); - CreateURLLoader(pending_resource_request_, std::move(pending_receiver_), - std::move(pending_client_)); - } - } - - std::unique_ptr<WebBundleSource> source_; - scoped_refptr<WebBundleReader> reader_; - DoneCallback done_callback_; - const int frame_tree_node_id_; - - network::ResourceRequest pending_resource_request_; - mojo::PendingReceiver<network::mojom::URLLoader> pending_receiver_; - mojo::PendingRemote<network::mojom::URLLoaderClient> pending_client_; - - std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; - - GURL primary_url_; - data_decoder::mojom::BundleMetadataParseErrorPtr metadata_error_; - - SEQUENCE_CHECKER(sequence_checker_); - - base::WeakPtrFactory<InterceptorForTrustableFile> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(InterceptorForTrustableFile); -}; - -// A class to inherit NavigationLoaderInterceptor for a navigation to a -// Web Bundle file on HTTPS server (eg: "https://example.com/a.wbn"). -// The overridden methods of NavigationLoaderInterceptor are called in the -// following sequence: -// [1] MaybeCreateLoader() is called for all navigation requests. It calls the -// |callback| with a null RequestHandler. -// [2] MaybeCreateLoaderForResponse() is called for all navigation responses. -// - If the response mime type is not "application/webbundle", or attachment -// Content-Disposition header is set, returns false. -// - If the URL isn't HTTPS nor localhost HTTP, or the Content-Length header -// is not a positive value, completes the requests with -// ERR_INVALID_WEB_BUNDLE and returns true. -// - Otherwise starts reading the metadata and returns true. Once the -// metadata is read, OnMetadataReady() is called, and a redirect loader is -// created to redirect the navigation request to the Bundle's primary URL -// ("https://example.com/a.html"). -// [3] MaybeCreateLoader() is called again for the redirect. It continues on -// StartResponse() to create the loader for the main resource. -class InterceptorForNetwork final : public NavigationLoaderInterceptor { - public: - InterceptorForNetwork(DoneCallback done_callback, - BrowserContext* browser_context, - int frame_tree_node_id) - : done_callback_(std::move(done_callback)), - browser_context_(browser_context), - frame_tree_node_id_(frame_tree_node_id) { - DCHECK(browser_context_); - } - ~InterceptorForNetwork() override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - } - - private: - // NavigationLoaderInterceptor implementation - void MaybeCreateLoader( - const network::ResourceRequest& tentative_resource_request, - BrowserContext* browser_context, - LoaderCallback callback, - FallbackCallback fallback_callback) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!reader_) { - std::move(callback).Run({}); - return; - } - std::move(callback).Run(base::MakeRefCounted<SingleRequestURLLoaderFactory>( - base::BindOnce(&InterceptorForNetwork::StartResponse, - weak_factory_.GetWeakPtr()))); - } - - bool MaybeCreateLoaderForResponse( - const network::ResourceRequest& request, - network::mojom::URLResponseHeadPtr* response_head, - mojo::ScopedDataPipeConsumerHandle* response_body, - mojo::PendingRemote<network::mojom::URLLoader>* loader, - mojo::PendingReceiver<network::mojom::URLLoaderClient>* client_receiver, - blink::ThrottlingURLLoader* url_loader, - bool* skip_other_interceptors, - bool* will_return_and_handle_unsafe_redirect) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if ((*response_head)->mime_type != - web_bundle_utils::kWebBundleFileMimeTypeWithoutParameters) { - return false; - } - if (download_utils::MustDownload(request.url, - (*response_head)->headers.get(), - (*response_head)->mime_type)) { - return false; - } - *client_receiver = forwarding_client_.BindNewPipeAndPassReceiver(); - - if (!signed_exchange_utils::HasNoSniffHeader(**response_head)) { - CompleteWithInvalidWebBundleError(std::move(forwarding_client_), - frame_tree_node_id_, - kNoSniffErrorMessage); - return true; - } - auto source = WebBundleSource::MaybeCreateFromNetworkUrl(request.url); - if (!source) { - CompleteWithInvalidWebBundleError( - std::move(forwarding_client_), frame_tree_node_id_, - "Web Bundle response must be served from HTTPS or localhost HTTP."); - return true; - } - - uint64_t length_hint = - (*response_head)->content_length > 0 - ? static_cast<uint64_t>((*response_head)->content_length) - : 0; - - // TODO(crbug.com/1018640): Check the special HTTP response header if we - // decided to require one for WBN navigation. - - reader_ = base::MakeRefCounted<WebBundleReader>( - std::move(source), length_hint, std::move(*response_body), - url_loader->Unbind(), - BrowserContext::GetBlobStorageContext(browser_context_)); - reader_->ReadMetadata( - base::BindOnce(&InterceptorForNetwork::OnMetadataReady, - weak_factory_.GetWeakPtr(), request)); - return true; - } - - void OnMetadataReady(network::ResourceRequest request, - data_decoder::mojom::BundleMetadataParseErrorPtr error) { - if (error) { - CompleteWithInvalidWebBundleError(std::move(forwarding_client_), - frame_tree_node_id_, - GetMetadataParseErrorMessage(error)); - return; - } - primary_url_ = reader_->GetPrimaryURL(); - if (!reader_->HasEntry(primary_url_)) { - CompleteWithInvalidWebBundleError( - std::move(forwarding_client_), frame_tree_node_id_, - "The primary URL resource is not found in the web bundle."); - return; - } - if (primary_url_.GetOrigin() != reader_->source().url().GetOrigin()) { - CompleteWithInvalidWebBundleError( - std::move(forwarding_client_), frame_tree_node_id_, - "The origin of primary URL doesn't match with the origin of the web " - "bundle."); - return; - } - if (!reader_->source().IsNavigationPathRestrictionSatisfied(primary_url_)) { - CompleteWithInvalidWebBundleError( - std::move(forwarding_client_), frame_tree_node_id_, - base::StringPrintf("Path restriction mismatch: Can't navigate to %s " - "in the web bundle served from %s.", - primary_url_.spec().c_str(), - reader_->source().url().spec().c_str())); - return; - } - url_loader_factory_ = std::make_unique<WebBundleURLLoaderFactory>( - reader_, frame_tree_node_id_); - auto redirect_loader = - std::make_unique<RedirectURLLoader>(forwarding_client_.Unbind()); - redirect_loader->OnReadyToRedirect(request, primary_url_); - } - - void StartResponse( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - network::ResourceRequest new_resource_request = resource_request; - new_resource_request.url = primary_url_; - url_loader_factory_->CreateLoaderAndStart( - std::move(receiver), 0, 0, 0, new_resource_request, std::move(client), - net::MutableNetworkTrafficAnnotationTag(kTrafficAnnotation)); - std::move(done_callback_).Run(primary_url_, std::move(url_loader_factory_)); - } - - DoneCallback done_callback_; - BrowserContext* browser_context_; - const int frame_tree_node_id_; - scoped_refptr<WebBundleReader> reader_; - GURL primary_url_; - std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; - - mojo::Remote<network::mojom::URLLoaderClient> forwarding_client_; - - SEQUENCE_CHECKER(sequence_checker_); - - base::WeakPtrFactory<InterceptorForNetwork> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(InterceptorForNetwork); -}; - -// A class to inherit NavigationLoaderInterceptor for a navigation within a -// trustable Web Bundle file or within a Web Bundle from network. -// For example: -// A user opened a trustable Web Bundle file "file:///tmp/a.wbn", and -// InterceptorForTrustableFile redirected to "https://example.com/a.html" and -// "a.html" in "a.wbn" was loaded. Or, a user opened a Web Bundle -// "https://example.com/a.wbn", and InterceptorForNetwork redirected to -// "https://example.com/a.html" and "a.html" in "a.wbn" was loaded. And the -// user clicked a link to "https://example.com/b.html" from "a.html". -// -// In this case, this interceptor intecepts the navigation request to "b.html", -// and creates a URLLoader using the WebBundleURLLoaderFactory to load -// the response of "b.html" in "a.wbn". -class InterceptorForTrackedNavigationFromTrustableFileOrFromNetwork final - : public NavigationLoaderInterceptor { - public: - InterceptorForTrackedNavigationFromTrustableFileOrFromNetwork( - scoped_refptr<WebBundleReader> reader, - DoneCallback done_callback, - int frame_tree_node_id) - : url_loader_factory_( - std::make_unique<WebBundleURLLoaderFactory>(std::move(reader), - frame_tree_node_id)), - done_callback_(std::move(done_callback)) { - DCHECK((base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kTrustableWebBundleFileUrl) && - url_loader_factory_->reader()->source().is_trusted_file()) || - (base::FeatureList::IsEnabled(features::kWebBundlesFromNetwork) && - url_loader_factory_->reader()->source().is_network())); - } - ~InterceptorForTrackedNavigationFromTrustableFileOrFromNetwork() override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - } - - private: - // NavigationLoaderInterceptor implementation - void MaybeCreateLoader(const network::ResourceRequest& resource_request, - BrowserContext* browser_context, - LoaderCallback callback, - FallbackCallback fallback_callback) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(url_loader_factory_->reader()->HasEntry(resource_request.url)); - DCHECK(url_loader_factory_->reader()->source().is_trusted_file() || - (url_loader_factory_->reader()->source().is_network() && - url_loader_factory_->reader() - ->source() - .IsNavigationPathRestrictionSatisfied(resource_request.url))); - std::move(callback).Run( - base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( - &InterceptorForTrackedNavigationFromTrustableFileOrFromNetwork:: - CreateURLLoader, - weak_factory_.GetWeakPtr()))); - } - - void CreateURLLoader( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - url_loader_factory_->CreateLoaderAndStart( - std::move(receiver), /*routing_id=*/0, /*request_id=*/0, - /*options=*/0, resource_request, std::move(client), - net::MutableNetworkTrafficAnnotationTag(kTrafficAnnotation)); - std::move(done_callback_) - .Run(resource_request.url, std::move(url_loader_factory_)); - } - - std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; - DoneCallback done_callback_; - - SEQUENCE_CHECKER(sequence_checker_); - - base::WeakPtrFactory< - InterceptorForTrackedNavigationFromTrustableFileOrFromNetwork> - weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN( - InterceptorForTrackedNavigationFromTrustableFileOrFromNetwork); -}; - -// A class to inherit NavigationLoaderInterceptor for a navigation within a -// Web Bundle file. -// For example: -// A user opened "file:///tmp/a.wbn", and InterceptorForFile redirected to -// "file:///tmp/a.wbn?https://example.com/a.html" and "a.html" in "a.wbn" was -// loaded. And the user clicked a link to "https://example.com/b.html" from -// "a.html". -// In this case, this interceptor intecepts the navigation request to "b.html", -// and redirect the navigation request to -// "file:///tmp/a.wbn?https://example.com/b.html" and creates a URLLoader using -// the WebBundleURLLoaderFactory to load the response of "b.html" in -// "a.wbn". -class InterceptorForTrackedNavigationFromFile final - : public NavigationLoaderInterceptor { - public: - InterceptorForTrackedNavigationFromFile(scoped_refptr<WebBundleReader> reader, - DoneCallback done_callback, - int frame_tree_node_id) - : url_loader_factory_( - std::make_unique<WebBundleURLLoaderFactory>(std::move(reader), - frame_tree_node_id)), - done_callback_(std::move(done_callback)) {} - ~InterceptorForTrackedNavigationFromFile() override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - } - - private: - // NavigationLoaderInterceptor implementation - void MaybeCreateLoader(const network::ResourceRequest& resource_request, - BrowserContext* browser_context, - LoaderCallback callback, - FallbackCallback fallback_callback) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - std::move(callback).Run( - base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( - &InterceptorForTrackedNavigationFromFile::CreateURLLoader, - weak_factory_.GetWeakPtr()))); - } - - bool ShouldBypassRedirectChecks() override { return true; } - - void CreateURLLoader( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!is_redirected_) { - DCHECK(url_loader_factory_->reader()->HasEntry(resource_request.url)); - is_redirected_ = true; - original_request_url_ = resource_request.url; - - GURL web_bundle_url = url_loader_factory_->reader()->source().url(); - const GURL new_url = web_bundle_utils::GetSynthesizedUrlForWebBundle( - web_bundle_url, original_request_url_); - auto redirect_loader = - std::make_unique<RedirectURLLoader>(std::move(client)); - redirect_loader->OnReadyToRedirect(resource_request, new_url); - mojo::MakeSelfOwnedReceiver( - std::move(redirect_loader), - mojo::PendingReceiver<network::mojom::URLLoader>( - std::move(receiver))); - return; - } - network::ResourceRequest new_resource_request = resource_request; - new_resource_request.url = original_request_url_; - url_loader_factory_->CreateLoaderAndStart( - std::move(receiver), /*routing_id=*/0, /*request_id=*/0, /*options=*/0, - new_resource_request, std::move(client), - net::MutableNetworkTrafficAnnotationTag(kTrafficAnnotation)); - std::move(done_callback_) - .Run(original_request_url_, std::move(url_loader_factory_)); - } - - std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; - DoneCallback done_callback_; - - bool is_redirected_ = false; - GURL original_request_url_; - - SEQUENCE_CHECKER(sequence_checker_); - - base::WeakPtrFactory<InterceptorForTrackedNavigationFromFile> weak_factory_{ - this}; - - DISALLOW_COPY_AND_ASSIGN(InterceptorForTrackedNavigationFromFile); -}; - -// A base class of the following NavigationLoaderInterceptor classes. They are -// used to intercept history navigation to a Web Bundle. -// - InterceptorForHistoryNavigationWithExistingReader: -// This class is used when the WebBundleReader for the Web Bundle is still -// alive. -// - InterceptorForHistoryNavigationFromFileOrFromTrustableFile: -// This class is used when the WebBundleReader was already deleted, and -// the Web Bundle is a file or a trustable file. -// - InterceptorForHistoryNavigationFromNetwork: -// This class is used when the WebBundleReader was already deleted, and -// the Web Bundle was from network. -class InterceptorForHistoryNavigation : public NavigationLoaderInterceptor { - protected: - InterceptorForHistoryNavigation(const GURL& target_inner_url, - DoneCallback done_callback, - int frame_tree_node_id) - : target_inner_url_(target_inner_url), - frame_tree_node_id_(frame_tree_node_id), - done_callback_(std::move(done_callback)) {} - ~InterceptorForHistoryNavigation() override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - } - - void CreateWebBundleURLLoaderFactory(scoped_refptr<WebBundleReader> reader) { - DCHECK(reader->HasEntry(target_inner_url_)); - url_loader_factory_ = std::make_unique<WebBundleURLLoaderFactory>( - std::move(reader), frame_tree_node_id_); - } - void CreateLoaderAndStartAndDone( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - network::ResourceRequest new_resource_request = resource_request; - new_resource_request.url = target_inner_url_; - url_loader_factory_->CreateLoaderAndStart( - std::move(receiver), /*routing_id=*/0, /*request_id=*/0, - /*options=*/0, new_resource_request, std::move(client), - net::MutableNetworkTrafficAnnotationTag(kTrafficAnnotation)); - std::move(done_callback_) - .Run(target_inner_url_, std::move(url_loader_factory_)); - } - - const GURL target_inner_url_; - const int frame_tree_node_id_; - std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; - SEQUENCE_CHECKER(sequence_checker_); - - private: - DoneCallback done_callback_; - - DISALLOW_COPY_AND_ASSIGN(InterceptorForHistoryNavigation); -}; - -// A class to inherit NavigationLoaderInterceptor for the history navigation to -// a Web Bundle when the previous WebBundleReader is still alive. -// - MaybeCreateLoader() is called for the history navigation request. It -// continues on CreateURLLoader() to create the loader for the main resource. -class InterceptorForHistoryNavigationWithExistingReader final - : public InterceptorForHistoryNavigation { - public: - InterceptorForHistoryNavigationWithExistingReader( - scoped_refptr<WebBundleReader> reader, - const GURL& target_inner_url, - DoneCallback done_callback, - int frame_tree_node_id) - : InterceptorForHistoryNavigation(target_inner_url, - std::move(done_callback), - frame_tree_node_id) { - CreateWebBundleURLLoaderFactory(std::move(reader)); - } - ~InterceptorForHistoryNavigationWithExistingReader() override {} - - private: - // NavigationLoaderInterceptor implementation - void MaybeCreateLoader(const network::ResourceRequest& resource_request, - BrowserContext* browser_context, - LoaderCallback callback, - FallbackCallback fallback_callback) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_EQ(resource_request.url, - url_loader_factory_->reader()->source().is_file() - ? web_bundle_utils::GetSynthesizedUrlForWebBundle( - url_loader_factory_->reader()->source().url(), - target_inner_url_) - : target_inner_url_); - std::move(callback).Run( - base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( - &InterceptorForHistoryNavigationWithExistingReader::CreateURLLoader, - weak_factory_.GetWeakPtr()))); - } - - void CreateURLLoader( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_EQ(resource_request.url, - url_loader_factory_->reader()->source().is_file() - ? web_bundle_utils::GetSynthesizedUrlForWebBundle( - url_loader_factory_->reader()->source().url(), - target_inner_url_) - : target_inner_url_); - CreateLoaderAndStartAndDone(resource_request, std::move(receiver), - std::move(client)); - } - - base::WeakPtrFactory<InterceptorForHistoryNavigationWithExistingReader> - weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(InterceptorForHistoryNavigationWithExistingReader); -}; - -// A class to inherit NavigationLoaderInterceptor for the history navigation to -// a Web Bundle file or a trustable Web Bundle file when the previous -// WebBundleReader was deleted. -// - MaybeCreateLoader() is called for the history navigation request. It -// continues on CreateURLLoader() to create the loader for the main resource. -// - If OnMetadataReady() has not been called yet: -// Wait for OnMetadataReady() to be called. -// - If OnMetadataReady() was called with an error: -// Completes the request with ERR_INVALID_WEB_BUNDLE. -// - If OnMetadataReady() was called whthout errors: -// Creates the loader for the main resource. -class InterceptorForHistoryNavigationFromFileOrFromTrustableFile final - : public InterceptorForHistoryNavigation { - public: - InterceptorForHistoryNavigationFromFileOrFromTrustableFile( - std::unique_ptr<WebBundleSource> source, - const GURL& target_inner_url, - DoneCallback done_callback, - int frame_tree_node_id) - : InterceptorForHistoryNavigation(target_inner_url, - std::move(done_callback), - frame_tree_node_id), - reader_(base::MakeRefCounted<WebBundleReader>(std::move(source))) { - reader_->ReadMetadata(base::BindOnce( - &InterceptorForHistoryNavigationFromFileOrFromTrustableFile:: - OnMetadataReady, - weak_factory_.GetWeakPtr())); - } - ~InterceptorForHistoryNavigationFromFileOrFromTrustableFile() override {} - - private: - // NavigationLoaderInterceptor implementation - void MaybeCreateLoader(const network::ResourceRequest& resource_request, - BrowserContext* browser_context, - LoaderCallback callback, - FallbackCallback fallback_callback) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - std::move(callback).Run( - base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( - &InterceptorForHistoryNavigationFromFileOrFromTrustableFile:: - CreateURLLoader, - weak_factory_.GetWeakPtr()))); - } - - void CreateURLLoader( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (metadata_error_) { - CompleteWithInvalidWebBundleError( - mojo::Remote<network::mojom::URLLoaderClient>(std::move(client)), - frame_tree_node_id_, GetMetadataParseErrorMessage(metadata_error_)); - return; - } - - if (!url_loader_factory_) { - pending_resource_request_ = resource_request; - pending_receiver_ = std::move(receiver); - pending_client_ = std::move(client); - return; - } - CreateLoaderAndStartAndDone(resource_request, std::move(receiver), - std::move(client)); - } - - void OnMetadataReady(data_decoder::mojom::BundleMetadataParseErrorPtr error) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(!url_loader_factory_); - - if (error) { - metadata_error_ = std::move(error); - } else { - CreateWebBundleURLLoaderFactory(std::move(reader_)); - } - - if (pending_receiver_) { - DCHECK(pending_client_); - CreateURLLoader(pending_resource_request_, std::move(pending_receiver_), - std::move(pending_client_)); - } - } - - scoped_refptr<WebBundleReader> reader_; - - network::ResourceRequest pending_resource_request_; - mojo::PendingReceiver<network::mojom::URLLoader> pending_receiver_; - mojo::PendingRemote<network::mojom::URLLoaderClient> pending_client_; - - data_decoder::mojom::BundleMetadataParseErrorPtr metadata_error_; - - base::WeakPtrFactory< - InterceptorForHistoryNavigationFromFileOrFromTrustableFile> - weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN( - InterceptorForHistoryNavigationFromFileOrFromTrustableFile); -}; - -// A class to inherit NavigationLoaderInterceptor for the history navigation to -// a Web Bundle from network when the previous WebBundleReader was deleted. -// The overridden methods of NavigationLoaderInterceptor are called in the -// following sequence: -// [1] MaybeCreateLoader() is called for the history navigation request. It -// continues on StartRedirectResponse() to redirect to the Web Bundle URL. -// [2] MaybeCreateLoader() is called again for the Web Bundle request. It calls -// the |callback| with a null RequestHandler. -// If server returned a redirect response instead of the Web Bundle, -// MaybeCreateLoader() is called again for the redirected new URL, in such -// it continues on StartErrorResponseForUnexpectedRedirect() and returns an -// error. -// Note that the Web Bundle URL should be loaded as cache-preferring load, -// but it may still go to the server if the Bundle is served with -// "no-store". -// [3] MaybeCreateLoaderForResponse() is called for all navigation responses. -// - If the response mime type is not "application/webbundle", this means -// the server response is not a Web Bundle. So handles as an error. -// - If the Content-Length header is not a positive value, handles as an -// error. -// - Otherwise starts reading the metadata and returns true. Once the -// metadata is read, OnMetadataReady() is called, and a redirect loader is -// created to redirect the navigation request to the target inner URL. -// [4] MaybeCreateLoader() is called again for target inner URL. It continues -// on StartResponse() to create the loader for the main resource. -class InterceptorForHistoryNavigationFromNetwork final - : public InterceptorForHistoryNavigation { - public: - InterceptorForHistoryNavigationFromNetwork( - std::unique_ptr<WebBundleSource> source, - const GURL& target_inner_url, - DoneCallback done_callback, - int frame_tree_node_id) - : InterceptorForHistoryNavigation(target_inner_url, - std::move(done_callback), - frame_tree_node_id), - source_(std::move(source)) { - DCHECK(source_->IsNavigationPathRestrictionSatisfied(target_inner_url_)); - } - ~InterceptorForHistoryNavigationFromNetwork() override {} - - private: - enum class State { - kInitial, - kRedirectedToWebBundle, - kWebBundleRecieved, - kMetadataReady, - }; - - // NavigationLoaderInterceptor implementation - void MaybeCreateLoader( - const network::ResourceRequest& tentative_resource_request, - BrowserContext* browser_context, - LoaderCallback callback, - FallbackCallback fallback_callback) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - switch (state_) { - case State::kInitial: - DCHECK_EQ(tentative_resource_request.url, target_inner_url_); - std::move(callback).Run(base::MakeRefCounted< - SingleRequestURLLoaderFactory>(base::BindOnce( - &InterceptorForHistoryNavigationFromNetwork::StartRedirectResponse, - weak_factory_.GetWeakPtr()))); - return; - case State::kRedirectedToWebBundle: - DCHECK(!reader_); - if (tentative_resource_request.url != source_->url()) { - std::move(callback).Run( - base::MakeRefCounted<SingleRequestURLLoaderFactory>( - base::BindOnce(&InterceptorForHistoryNavigationFromNetwork:: - StartErrorResponseForUnexpectedRedirect, - weak_factory_.GetWeakPtr()))); - } else { - std::move(callback).Run({}); - } - return; - case State::kWebBundleRecieved: - NOTREACHED(); - return; - case State::kMetadataReady: - std::move(callback).Run( - base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( - &InterceptorForHistoryNavigationFromNetwork::StartResponse, - weak_factory_.GetWeakPtr()))); - } - } - - bool MaybeCreateLoaderForResponse( - const network::ResourceRequest& request, - network::mojom::URLResponseHeadPtr* response_head, - mojo::ScopedDataPipeConsumerHandle* response_body, - mojo::PendingRemote<network::mojom::URLLoader>* loader, - mojo::PendingReceiver<network::mojom::URLLoaderClient>* client_receiver, - blink::ThrottlingURLLoader* url_loader, - bool* skip_other_interceptors, - bool* will_return_and_handle_unsafe_redirect) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_EQ(State::kRedirectedToWebBundle, state_); - DCHECK_EQ(source_->url(), request.url); - state_ = State::kWebBundleRecieved; - *client_receiver = forwarding_client_.BindNewPipeAndPassReceiver(); - if ((*response_head)->mime_type != - web_bundle_utils::kWebBundleFileMimeTypeWithoutParameters) { - CompleteWithInvalidWebBundleError(std::move(forwarding_client_), - frame_tree_node_id_, - "Unexpected content type."); - return true; - } - if (!signed_exchange_utils::HasNoSniffHeader(**response_head)) { - CompleteWithInvalidWebBundleError(std::move(forwarding_client_), - frame_tree_node_id_, - kNoSniffErrorMessage); - return true; - } - uint64_t length_hint = - (*response_head)->content_length > 0 - ? static_cast<uint64_t>((*response_head)->content_length) - : 0; - - // TODO(crbug.com/1018640): Check the special HTTP response header if we - // decided to require one for WBN navigation. - - WebContents* web_contents = - WebContents::FromFrameTreeNodeId(frame_tree_node_id_); - DCHECK(web_contents); - BrowserContext* browser_context = web_contents->GetBrowserContext(); - DCHECK(browser_context); - reader_ = base::MakeRefCounted<WebBundleReader>( - std::move(source_), length_hint, std::move(*response_body), - url_loader->Unbind(), - BrowserContext::GetBlobStorageContext(browser_context)); - reader_->ReadMetadata(base::BindOnce( - &InterceptorForHistoryNavigationFromNetwork::OnMetadataReady, - weak_factory_.GetWeakPtr(), request)); - return true; - } - - void OnMetadataReady(network::ResourceRequest request, - data_decoder::mojom::BundleMetadataParseErrorPtr error) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_EQ(State::kWebBundleRecieved, state_); - state_ = State::kMetadataReady; - if (error) { - CompleteWithInvalidWebBundleError(std::move(forwarding_client_), - frame_tree_node_id_, - GetMetadataParseErrorMessage(error)); - return; - } - if (!reader_->HasEntry(target_inner_url_)) { - CompleteWithInvalidWebBundleError( - std::move(forwarding_client_), frame_tree_node_id_, - "The expected URL resource is not found in the web bundle."); - return; - } - CreateWebBundleURLLoaderFactory(reader_); - auto redirect_loader = - std::make_unique<RedirectURLLoader>(forwarding_client_.Unbind()); - redirect_loader->OnReadyToRedirect(request, target_inner_url_); - } - - void StartRedirectResponse( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_EQ(State::kInitial, state_); - state_ = State::kRedirectedToWebBundle; - auto redirect_loader = - std::make_unique<RedirectURLLoader>(std::move(client)); - redirect_loader->OnReadyToRedirect(resource_request, source_->url()); - mojo::MakeSelfOwnedReceiver( - std::move(redirect_loader), - mojo::PendingReceiver<network::mojom::URLLoader>(std::move(receiver))); - } - - void StartErrorResponseForUnexpectedRedirect( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_EQ(State::kRedirectedToWebBundle, state_); - DCHECK_NE(source_->url(), resource_request.url); - CompleteWithInvalidWebBundleError( - mojo::Remote<network::mojom::URLLoaderClient>(std::move(client)), - frame_tree_node_id_, "Unexpected redirect."); - } - - void StartResponse( - const network::ResourceRequest& resource_request, - mojo::PendingReceiver<network::mojom::URLLoader> receiver, - mojo::PendingRemote<network::mojom::URLLoaderClient> client) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_EQ(State::kMetadataReady, state_); - CreateLoaderAndStartAndDone(resource_request, std::move(receiver), - std::move(client)); - } - - State state_ = State::kInitial; - std::unique_ptr<WebBundleSource> source_; - scoped_refptr<WebBundleReader> reader_; - - mojo::Remote<network::mojom::URLLoaderClient> forwarding_client_; - - base::WeakPtrFactory<InterceptorForHistoryNavigationFromNetwork> - weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(InterceptorForHistoryNavigationFromNetwork); -}; - -} // namespace - // static std::unique_ptr<WebBundleHandle> WebBundleHandle::CreateForFile( int frame_tree_node_id) { auto handle = base::WrapUnique(new WebBundleHandle()); - handle->SetInterceptor(std::make_unique<InterceptorForFile>( + handle->SetInterceptor(std::make_unique<WebBundleInterceptorForFile>( base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, handle->weak_factory_.GetWeakPtr()), frame_tree_node_id)); @@ -1171,7 +41,7 @@ int frame_tree_node_id) { DCHECK(source->is_trusted_file()); auto handle = base::WrapUnique(new WebBundleHandle()); - handle->SetInterceptor(std::make_unique<InterceptorForTrustableFile>( + handle->SetInterceptor(std::make_unique<WebBundleInterceptorForTrustableFile>( std::move(source), base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, handle->weak_factory_.GetWeakPtr()), @@ -1185,7 +55,7 @@ int frame_tree_node_id) { DCHECK(base::FeatureList::IsEnabled(features::kWebBundlesFromNetwork)); auto handle = base::WrapUnique(new WebBundleHandle()); - handle->SetInterceptor(std::make_unique<InterceptorForNetwork>( + handle->SetInterceptor(std::make_unique<WebBundleInterceptorForNetwork>( base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, handle->weak_factory_.GetWeakPtr()), browser_context, frame_tree_node_id)); @@ -1202,19 +72,21 @@ case WebBundleSource::Type::kNetwork: handle->SetInterceptor( std::make_unique< - InterceptorForTrackedNavigationFromTrustableFileOrFromNetwork>( + + WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork>( std::move(reader), base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, handle->weak_factory_.GetWeakPtr()), frame_tree_node_id)); break; case WebBundleSource::Type::kFile: - handle->SetInterceptor( - std::make_unique<InterceptorForTrackedNavigationFromFile>( - std::move(reader), - base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, - handle->weak_factory_.GetWeakPtr()), - frame_tree_node_id)); + handle->SetInterceptor(std::make_unique< + + WebBundleInterceptorForTrackedNavigationFromFile>( + std::move(reader), + base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, + handle->weak_factory_.GetWeakPtr()), + frame_tree_node_id)); break; } return handle; @@ -1228,25 +100,28 @@ if (navigation_info->GetReader()) { scoped_refptr<WebBundleReader> reader = navigation_info->GetReader().get(); handle->SetInterceptor( - std::make_unique<InterceptorForHistoryNavigationWithExistingReader>( + std::make_unique< + + WebBundleInterceptorForHistoryNavigationWithExistingReader>( std::move(reader), navigation_info->target_inner_url(), base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, handle->weak_factory_.GetWeakPtr()), frame_tree_node_id)); } else if (navigation_info->source().is_network()) { - handle->SetInterceptor( - std::make_unique<InterceptorForHistoryNavigationFromNetwork>( - navigation_info->source().Clone(), - navigation_info->target_inner_url(), - base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, - handle->weak_factory_.GetWeakPtr()), - frame_tree_node_id)); + handle->SetInterceptor(std::make_unique< + + WebBundleInterceptorForHistoryNavigationFromNetwork>( + navigation_info->source().Clone(), navigation_info->target_inner_url(), + base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, + handle->weak_factory_.GetWeakPtr()), + frame_tree_node_id)); } else { DCHECK(navigation_info->source().is_trusted_file() || navigation_info->source().is_file()); handle->SetInterceptor( std::make_unique< - InterceptorForHistoryNavigationFromFileOrFromTrustableFile>( + + WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile>( navigation_info->source().Clone(), navigation_info->target_inner_url(), base::BindOnce(&WebBundleHandle::OnWebBundleFileLoaded, @@ -1303,5 +178,4 @@ url_loader_factory->reader()->GetWeakPtr()); url_loader_factory_ = std::move(url_loader_factory); } - } // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_file.cc b/content/browser/web_package/web_bundle_interceptor_for_file.cc new file mode 100644 index 0000000..f8c4191 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_file.cc
@@ -0,0 +1,111 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_interceptor_for_file.h" + +#include "content/browser/loader/single_request_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_reader.h" +#include "content/browser/web_package/web_bundle_redirect_url_loader.h" +#include "content/browser/web_package/web_bundle_source.h" +#include "content/browser/web_package/web_bundle_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "net/traffic_annotation/network_traffic_annotation.h" +#include "services/network/public/cpp/resource_request.h" +#include "third_party/blink/public/common/loader/throttling_url_loader.h" + +namespace content { +WebBundleInterceptorForFile::WebBundleInterceptorForFile( + WebBundleDoneCallback done_callback, + int frame_tree_node_id) + : done_callback_(std::move(done_callback)), + frame_tree_node_id_(frame_tree_node_id) {} + +WebBundleInterceptorForFile::~WebBundleInterceptorForFile() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +void WebBundleInterceptorForFile::MaybeCreateLoader( + const network::ResourceRequest& tentative_resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + // WebBundleInterceptorForFile::MaybeCreateLoader() creates a loader only + // after recognising that the response is a Web Bundle file at + // MaybeCreateLoaderForResponse() and successfully created + // |url_loader_factory_|. + if (!url_loader_factory_) { + std::move(callback).Run({}); + return; + } + std::move(callback).Run(base::MakeRefCounted<SingleRequestURLLoaderFactory>( + base::BindOnce(&WebBundleInterceptorForFile::StartResponse, + weak_factory_.GetWeakPtr()))); +} + +bool WebBundleInterceptorForFile::MaybeCreateLoaderForResponse( + const network::ResourceRequest& request, + network::mojom::URLResponseHeadPtr* response_head, + mojo::ScopedDataPipeConsumerHandle* response_body, + mojo::PendingRemote<network::mojom::URLLoader>* loader, + mojo::PendingReceiver<network::mojom::URLLoaderClient>* client_receiver, + blink::ThrottlingURLLoader* url_loader, + bool* skip_other_interceptors, + bool* will_return_unsafe_redirect) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(web_bundle_utils::IsSupportedFileScheme(request.url)); + if ((*response_head)->mime_type != + web_bundle_utils::kWebBundleFileMimeTypeWithoutParameters) { + return false; + } + std::unique_ptr<WebBundleSource> source = + WebBundleSource::MaybeCreateFromFileUrl(request.url); + if (!source) + return false; + reader_ = base::MakeRefCounted<WebBundleReader>(std::move(source)); + reader_->ReadMetadata( + base::BindOnce(&WebBundleInterceptorForFile::OnMetadataReady, + weak_factory_.GetWeakPtr(), request)); + *client_receiver = forwarding_client_.BindNewPipeAndPassReceiver(); + *will_return_unsafe_redirect = true; + return true; +} + +void WebBundleInterceptorForFile::OnMetadataReady( + const network::ResourceRequest& request, + data_decoder::mojom::BundleMetadataParseErrorPtr metadata_error) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (metadata_error) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + web_bundle_utils::GetMetadataParseErrorMessage(metadata_error)); + return; + } + DCHECK(reader_); + primary_url_ = reader_->GetPrimaryURL(); + url_loader_factory_ = std::make_unique<WebBundleURLLoaderFactory>( + std::move(reader_), frame_tree_node_id_); + + const GURL new_url = web_bundle_utils::GetSynthesizedUrlForWebBundle( + request.url, primary_url_); + auto redirect_loader = + std::make_unique<WebBundleRedirectURLLoader>(forwarding_client_.Unbind()); + redirect_loader->OnReadyToRedirect(request, new_url); +} + +void WebBundleInterceptorForFile::StartResponse( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + network::ResourceRequest new_resource_request = resource_request; + new_resource_request.url = primary_url_; + url_loader_factory_->CreateLoaderAndStart( + std::move(receiver), /*routing_id=*/0, /*request_id=*/0, /*options=*/0, + new_resource_request, std::move(client), + net::MutableNetworkTrafficAnnotationTag( + web_bundle_utils::kTrafficAnnotation)); + std::move(done_callback_).Run(primary_url_, std::move(url_loader_factory_)); +} +} // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_file.h b/content/browser/web_package/web_bundle_interceptor_for_file.h new file mode 100644 index 0000000..b08b86e --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_file.h
@@ -0,0 +1,94 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_FILE_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_FILE_H_ + +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "content/browser/loader/navigation_loader_interceptor.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "services/data_decoder/public/mojom/web_bundle_parser.mojom.h" +#include "services/network/public/mojom/url_loader.mojom.h" +#include "url/gurl.h" + +namespace blink { +class ThrottlingURLLoader; +} // namespace blink + +namespace network { +struct ResourceRequest; +} // namespace network + +namespace content { + +class WebBundleReader; +class WebBundleURLLoaderFactory; + +// A class to inherit NavigationLoaderInterceptor for a navigation to an +// untrustable Web Bundle file (eg: "file:///tmp/a.wbn"). +// The overridden methods of NavigationLoaderInterceptor are called in the +// following sequence: +// [1] MaybeCreateLoader() is called for all navigation requests. It calls the +// |callback| with a null RequestHandler. +// [2] MaybeCreateLoaderForResponse() is called for all navigation responses. +// If the response mime type is not "application/webbundle", returns false. +// Otherwise starts reading the metadata and returns true. Once the metadata +// is read, OnMetadataReady() is called, and a redirect loader is +// created to redirect the navigation request to the Bundle's synthesized +// primary URL ("file:///tmp/a.wbn?https://example.com/a.html"). +// [3] MaybeCreateLoader() is called again for the redirect. It continues on +// StartResponse() to create the loader for the main resource. +class WebBundleInterceptorForFile final : public NavigationLoaderInterceptor { + public: + WebBundleInterceptorForFile(WebBundleDoneCallback done_callback, + int frame_tree_node_id); + WebBundleInterceptorForFile(const WebBundleInterceptorForFile&) = delete; + WebBundleInterceptorForFile& operator=(const WebBundleInterceptorForFile&) = + delete; + + ~WebBundleInterceptorForFile() override; + + private: + void MaybeCreateLoader( + const network::ResourceRequest& tentative_resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) override; + + bool MaybeCreateLoaderForResponse( + const network::ResourceRequest& request, + network::mojom::URLResponseHeadPtr* response_head, + mojo::ScopedDataPipeConsumerHandle* response_body, + mojo::PendingRemote<network::mojom::URLLoader>* loader, + mojo::PendingReceiver<network::mojom::URLLoaderClient>* client_receiver, + blink::ThrottlingURLLoader* url_loader, + bool* skip_other_interceptors, + bool* will_return_unsafe_redirect) override; + + void OnMetadataReady( + const network::ResourceRequest& request, + data_decoder::mojom::BundleMetadataParseErrorPtr metadata_error); + + void StartResponse( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + WebBundleDoneCallback done_callback_; + const int frame_tree_node_id_; + scoped_refptr<WebBundleReader> reader_; + GURL primary_url_; + std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; + + mojo::Remote<network::mojom::URLLoaderClient> forwarding_client_; + + SEQUENCE_CHECKER(sequence_checker_); + + base::WeakPtrFactory<WebBundleInterceptorForFile> weak_factory_{this}; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_FILE_H_
diff --git a/content/browser/web_package/web_bundle_interceptor_for_history_navigation.cc b/content/browser/web_package/web_bundle_interceptor_for_history_navigation.cc new file mode 100644 index 0000000..0be143a --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_history_navigation.cc
@@ -0,0 +1,49 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation.h" + +#include "content/browser/web_package/web_bundle_reader.h" +#include "content/browser/web_package/web_bundle_url_loader_factory.h" +#include "net/traffic_annotation/network_traffic_annotation.h" +#include "services/network/public/cpp/resource_request.h" + +namespace content { + +WebBundleInterceptorForHistoryNavigation:: + WebBundleInterceptorForHistoryNavigation( + const GURL& target_inner_url, + WebBundleDoneCallback done_callback, + int frame_tree_node_id) + : target_inner_url_(target_inner_url), + frame_tree_node_id_(frame_tree_node_id), + done_callback_(std::move(done_callback)) {} + +WebBundleInterceptorForHistoryNavigation:: + ~WebBundleInterceptorForHistoryNavigation() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +void WebBundleInterceptorForHistoryNavigation::CreateWebBundleURLLoaderFactory( + scoped_refptr<WebBundleReader> reader) { + DCHECK(reader->HasEntry(target_inner_url_)); + url_loader_factory_ = std::make_unique<WebBundleURLLoaderFactory>( + std::move(reader), frame_tree_node_id_); +} + +void WebBundleInterceptorForHistoryNavigation::CreateLoaderAndStartAndDone( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + network::ResourceRequest new_resource_request = resource_request; + new_resource_request.url = target_inner_url_; + url_loader_factory_->CreateLoaderAndStart( + std::move(receiver), /*routing_id=*/0, /*request_id=*/0, + /*options=*/0, new_resource_request, std::move(client), + net::MutableNetworkTrafficAnnotationTag( + web_bundle_utils::kTrafficAnnotation)); + std::move(done_callback_) + .Run(target_inner_url_, std::move(url_loader_factory_)); +} +} // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_history_navigation.h b/content/browser/web_package/web_bundle_interceptor_for_history_navigation.h new file mode 100644 index 0000000..17013e8 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_history_navigation.h
@@ -0,0 +1,68 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_H_ + +#include "base/sequence_checker.h" +#include "content/browser/loader/navigation_loader_interceptor.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "services/network/public/mojom/url_loader.mojom.h" +#include "url/gurl.h" + +namespace network { +struct ResourceRequest; +} // namespace network + +namespace content { + +class WebBundleReader; +class WebBundleURLLoaderFactory; + +// A base class of the following NavigationLoaderInterceptor classes. They are +// used to intercept history navigation to a Web Bundle. +// - WebBundleInterceptorForHistoryNavigationWithExistingReader: +// This class is used when the WebBundleReader for the Web Bundle is still +// alive. +// - WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile: +// This class is used when the WebBundleReader was already deleted, and +// the Web Bundle is a file or a trustable file. +// - WebBundleInterceptorForHistoryNavigationFromNetwork: +// This class is used when the WebBundleReader was already deleted, and +// the Web Bundle was from network. +class WebBundleInterceptorForHistoryNavigation + : public NavigationLoaderInterceptor { + public: + WebBundleInterceptorForHistoryNavigation( + const WebBundleInterceptorForHistoryNavigation&) = delete; + WebBundleInterceptorForHistoryNavigation& operator=( + const WebBundleInterceptorForHistoryNavigation&) = delete; + + protected: + WebBundleInterceptorForHistoryNavigation(const GURL& target_inner_url, + WebBundleDoneCallback done_callback, + int frame_tree_node_id); + + ~WebBundleInterceptorForHistoryNavigation() override; + + void CreateWebBundleURLLoaderFactory(scoped_refptr<WebBundleReader> reader); + + void CreateLoaderAndStartAndDone( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + const GURL target_inner_url_; + const int frame_tree_node_id_; + std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; + SEQUENCE_CHECKER(sequence_checker_); + + private: + WebBundleDoneCallback done_callback_; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_H_
diff --git a/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.cc b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.cc new file mode 100644 index 0000000..8cb9a03d --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.cc
@@ -0,0 +1,91 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.h" + +#include "content/browser/loader/single_request_url_loader_factory.h" +#include "content/browser/web_package/signed_exchange_utils.h" +#include "content/browser/web_package/web_bundle_reader.h" +#include "content/browser/web_package/web_bundle_source.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "url/gurl.h" + +namespace content { + +WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile:: + WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile( + std::unique_ptr<WebBundleSource> source, + const GURL& target_inner_url, + WebBundleDoneCallback done_callback, + int frame_tree_node_id) + : WebBundleInterceptorForHistoryNavigation(target_inner_url, + std::move(done_callback), + frame_tree_node_id), + reader_(base::MakeRefCounted<WebBundleReader>(std::move(source))) { + reader_->ReadMetadata(base::BindOnce( + &WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile:: + OnMetadataReady, + weak_factory_.GetWeakPtr())); +} + +WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile:: + ~WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile() = + default; + +// NavigationLoaderInterceptor implementation +void WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile:: + MaybeCreateLoader(const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + std::move(callback).Run( + base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( + &WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile:: + CreateURLLoader, + weak_factory_.GetWeakPtr()))); +} + +void WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile:: + CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (metadata_error_) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + mojo::Remote<network::mojom::URLLoaderClient>(std::move(client)), + frame_tree_node_id_, + web_bundle_utils::GetMetadataParseErrorMessage(metadata_error_)); + return; + } + + if (!url_loader_factory_) { + pending_resource_request_ = resource_request; + pending_receiver_ = std::move(receiver); + pending_client_ = std::move(client); + return; + } + CreateLoaderAndStartAndDone(resource_request, std::move(receiver), + std::move(client)); +} + +void WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile:: + OnMetadataReady(data_decoder::mojom::BundleMetadataParseErrorPtr error) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(!url_loader_factory_); + + if (error) { + metadata_error_ = std::move(error); + } else { + CreateWebBundleURLLoaderFactory(std::move(reader_)); + } + + if (pending_receiver_) { + DCHECK(pending_client_); + CreateURLLoader(pending_resource_request_, std::move(pending_receiver_), + std::move(pending_client_)); + } +} +} // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.h b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.h new file mode 100644 index 0000000..eaae458 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_file_or_from_trustable_file.h
@@ -0,0 +1,81 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_FROM_FILE_OR_FROM_TRUSTABLE_FILE_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_FROM_FILE_OR_FROM_TRUSTABLE_FILE_H_ + +#include "base/memory/weak_ptr.h" +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "services/data_decoder/public/mojom/web_bundle_parser.mojom.h" +#include "services/network/public/cpp/resource_request.h" +#include "services/network/public/mojom/url_loader.mojom.h" + +class GURL; + +namespace content { + +class WebBundleReader; +class WebBundleSource; + +// A class to inherit NavigationLoaderInterceptor for the history navigation to +// a Web Bundle file or a trustable Web Bundle file when the previous +// WebBundleReader was deleted. +// - MaybeCreateLoader() is called for the history navigation request. It +// continues on CreateURLLoader() to create the loader for the main resource. +// - If OnMetadataReady() has not been called yet: +// Wait for OnMetadataReady() to be called. +// - If OnMetadataReady() was called with an error: +// Completes the request with ERR_INVALID_WEB_BUNDLE. +// - If OnMetadataReady() was called whthout errors: +// Creates the loader for the main resource. +class WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile final + : public WebBundleInterceptorForHistoryNavigation { + public: + WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile( + std::unique_ptr<WebBundleSource> source, + const GURL& target_inner_url, + WebBundleDoneCallback done_callback, + int frame_tree_node_id); + WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile( + const WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile&) = + delete; + WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile& + operator=( + const WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile&) = + delete; + + ~WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile() + override; + + private: + void MaybeCreateLoader(const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) override; + + void CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + void OnMetadataReady(data_decoder::mojom::BundleMetadataParseErrorPtr error); + + scoped_refptr<WebBundleReader> reader_; + + network::ResourceRequest pending_resource_request_; + mojo::PendingReceiver<network::mojom::URLLoader> pending_receiver_; + mojo::PendingRemote<network::mojom::URLLoaderClient> pending_client_; + + data_decoder::mojom::BundleMetadataParseErrorPtr metadata_error_; + + base::WeakPtrFactory< + WebBundleInterceptorForHistoryNavigationFromFileOrFromTrustableFile> + weak_factory_{this}; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_FROM_FILE_OR_FROM_TRUSTABLE_FILE_H_
diff --git a/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_network.cc b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_network.cc new file mode 100644 index 0000000..2eb7f44c --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_network.cc
@@ -0,0 +1,189 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_network.h" + +#include "content/browser/loader/single_request_url_loader_factory.h" +#include "content/browser/web_package/signed_exchange_utils.h" +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation.h" +#include "content/browser/web_package/web_bundle_reader.h" +#include "content/browser/web_package/web_bundle_redirect_url_loader.h" +#include "content/browser/web_package/web_bundle_source.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "content/public/browser/web_contents.h" +#include "mojo/public/cpp/bindings/self_owned_receiver.h" +#include "services/network/public/cpp/resource_request.h" +#include "third_party/blink/public/common/loader/throttling_url_loader.h" +#include "url/gurl.h" + +namespace content { + +WebBundleInterceptorForHistoryNavigationFromNetwork:: + WebBundleInterceptorForHistoryNavigationFromNetwork( + std::unique_ptr<WebBundleSource> source, + const GURL& target_inner_url, + WebBundleDoneCallback done_callback, + int frame_tree_node_id) + : WebBundleInterceptorForHistoryNavigation(target_inner_url, + std::move(done_callback), + frame_tree_node_id), + source_(std::move(source)) { + DCHECK(source_->IsNavigationPathRestrictionSatisfied(target_inner_url_)); +} + +WebBundleInterceptorForHistoryNavigationFromNetwork:: + ~WebBundleInterceptorForHistoryNavigationFromNetwork() = default; + +// NavigationLoaderInterceptor implementation +void WebBundleInterceptorForHistoryNavigationFromNetwork::MaybeCreateLoader( + const network::ResourceRequest& tentative_resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + switch (state_) { + case State::kInitial: + DCHECK_EQ(tentative_resource_request.url, target_inner_url_); + std::move(callback).Run( + base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( + &WebBundleInterceptorForHistoryNavigationFromNetwork:: + StartRedirectResponse, + weak_factory_.GetWeakPtr()))); + return; + case State::kRedirectedToWebBundle: + DCHECK(!reader_); + if (tentative_resource_request.url != source_->url()) { + std::move(callback).Run( + base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( + &WebBundleInterceptorForHistoryNavigationFromNetwork:: + StartErrorResponseForUnexpectedRedirect, + weak_factory_.GetWeakPtr()))); + } else { + std::move(callback).Run({}); + } + return; + case State::kWebBundleRecieved: + NOTREACHED(); + return; + case State::kMetadataReady: + std::move(callback).Run(base::MakeRefCounted< + SingleRequestURLLoaderFactory>(base::BindOnce( + &WebBundleInterceptorForHistoryNavigationFromNetwork::StartResponse, + weak_factory_.GetWeakPtr()))); + } +} + +bool WebBundleInterceptorForHistoryNavigationFromNetwork:: + MaybeCreateLoaderForResponse( + const network::ResourceRequest& request, + network::mojom::URLResponseHeadPtr* response_head, + mojo::ScopedDataPipeConsumerHandle* response_body, + mojo::PendingRemote<network::mojom::URLLoader>* loader, + mojo::PendingReceiver<network::mojom::URLLoaderClient>* client_receiver, + blink::ThrottlingURLLoader* url_loader, + bool* skip_other_interceptors, + bool* will_return_and_handle_unsafe_redirect) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_EQ(State::kRedirectedToWebBundle, state_); + DCHECK_EQ(source_->url(), request.url); + state_ = State::kWebBundleRecieved; + *client_receiver = forwarding_client_.BindNewPipeAndPassReceiver(); + if ((*response_head)->mime_type != + web_bundle_utils::kWebBundleFileMimeTypeWithoutParameters) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + "Unexpected content type."); + return true; + } + if (!signed_exchange_utils::HasNoSniffHeader(**response_head)) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + web_bundle_utils::kNoSniffErrorMessage); + return true; + } + uint64_t length_hint = + (*response_head)->content_length > 0 + ? static_cast<uint64_t>((*response_head)->content_length) + : 0; + + // TODO(crbug.com/1018640): Check the special HTTP response header if we + // decided to require one for WBN navigation. + + WebContents* web_contents = + WebContents::FromFrameTreeNodeId(frame_tree_node_id_); + DCHECK(web_contents); + BrowserContext* browser_context = web_contents->GetBrowserContext(); + DCHECK(browser_context); + reader_ = base::MakeRefCounted<WebBundleReader>( + std::move(source_), length_hint, std::move(*response_body), + url_loader->Unbind(), + BrowserContext::GetBlobStorageContext(browser_context)); + reader_->ReadMetadata(base::BindOnce( + &WebBundleInterceptorForHistoryNavigationFromNetwork::OnMetadataReady, + weak_factory_.GetWeakPtr(), request)); + return true; +} + +void WebBundleInterceptorForHistoryNavigationFromNetwork::OnMetadataReady( + network::ResourceRequest request, + data_decoder::mojom::BundleMetadataParseErrorPtr error) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_EQ(State::kWebBundleRecieved, state_); + state_ = State::kMetadataReady; + if (error) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + web_bundle_utils::GetMetadataParseErrorMessage(error)); + return; + } + if (!reader_->HasEntry(target_inner_url_)) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + "The expected URL resource is not found in the web bundle."); + return; + } + CreateWebBundleURLLoaderFactory(reader_); + auto redirect_loader = + std::make_unique<WebBundleRedirectURLLoader>(forwarding_client_.Unbind()); + redirect_loader->OnReadyToRedirect(request, target_inner_url_); +} + +void WebBundleInterceptorForHistoryNavigationFromNetwork::StartRedirectResponse( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_EQ(State::kInitial, state_); + state_ = State::kRedirectedToWebBundle; + auto redirect_loader = + std::make_unique<WebBundleRedirectURLLoader>(std::move(client)); + redirect_loader->OnReadyToRedirect(resource_request, source_->url()); + mojo::MakeSelfOwnedReceiver( + std::move(redirect_loader), + mojo::PendingReceiver<network::mojom::URLLoader>(std::move(receiver))); +} + +void WebBundleInterceptorForHistoryNavigationFromNetwork:: + StartErrorResponseForUnexpectedRedirect( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_EQ(State::kRedirectedToWebBundle, state_); + DCHECK_NE(source_->url(), resource_request.url); + web_bundle_utils::CompleteWithInvalidWebBundleError( + mojo::Remote<network::mojom::URLLoaderClient>(std::move(client)), + frame_tree_node_id_, "Unexpected redirect."); +} + +void WebBundleInterceptorForHistoryNavigationFromNetwork::StartResponse( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_EQ(State::kMetadataReady, state_); + CreateLoaderAndStartAndDone(resource_request, std::move(receiver), + std::move(client)); +} +} // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_network.h b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_network.h new file mode 100644 index 0000000..9dfcb1cf --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_from_network.h
@@ -0,0 +1,122 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_FROM_NETWORK_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_FROM_NETWORK_H_ + +#include "base/memory/weak_ptr.h" +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation.h" +#include "content/browser/web_package/web_bundle_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "services/data_decoder/public/mojom/web_bundle_parser.mojom.h" +#include "services/network/public/mojom/url_loader.mojom.h" + +class GURL; + +namespace network { +struct ResourceRequest; +} // namespace network + +namespace content { + +class WebBundleReader; +class WebBundleSource; + +// A class to inherit NavigationLoaderInterceptor for the history navigation to +// a Web Bundle from network when the previous WebBundleReader was deleted. +// The overridden methods of NavigationLoaderInterceptor are called in the +// following sequence: +// [1] MaybeCreateLoader() is called for the history navigation request. It +// continues on StartRedirectResponse() to redirect to the Web Bundle URL. +// [2] MaybeCreateLoader() is called again for the Web Bundle request. It calls +// the |callback| with a null RequestHandler. +// If server returned a redirect response instead of the Web Bundle, +// MaybeCreateLoader() is called again for the redirected new URL, in such +// it continues on StartErrorResponseForUnexpectedRedirect() and returns an +// error. +// Note that the Web Bundle URL should be loaded as cache-preferring load, +// but it may still go to the server if the Bundle is served with +// "no-store". +// [3] MaybeCreateLoaderForResponse() is called for all navigation responses. +// - If the response mime type is not "application/webbundle", this means +// the server response is not a Web Bundle. So handles as an error. +// - If the Content-Length header is not a positive value, handles as an +// error. +// - Otherwise starts reading the metadata and returns true. Once the +// metadata is read, OnMetadataReady() is called, and a redirect loader is +// created to redirect the navigation request to the target inner URL. +// [4] MaybeCreateLoader() is called again for target inner URL. It continues +// on StartResponse() to create the loader for the main resource. +class WebBundleInterceptorForHistoryNavigationFromNetwork final + : public WebBundleInterceptorForHistoryNavigation { + public: + WebBundleInterceptorForHistoryNavigationFromNetwork( + std::unique_ptr<WebBundleSource> source, + const GURL& target_inner_url, + WebBundleDoneCallback done_callback, + int frame_tree_node_id); + WebBundleInterceptorForHistoryNavigationFromNetwork( + const WebBundleInterceptorForHistoryNavigationFromNetwork&) = delete; + WebBundleInterceptorForHistoryNavigationFromNetwork& operator=( + const WebBundleInterceptorForHistoryNavigationFromNetwork&) = delete; + + ~WebBundleInterceptorForHistoryNavigationFromNetwork() override; + + private: + enum class State { + kInitial, + kRedirectedToWebBundle, + kWebBundleRecieved, + kMetadataReady, + }; + + // NavigationLoaderInterceptor implementation + void MaybeCreateLoader( + const network::ResourceRequest& tentative_resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) override; + + bool MaybeCreateLoaderForResponse( + const network::ResourceRequest& request, + network::mojom::URLResponseHeadPtr* response_head, + mojo::ScopedDataPipeConsumerHandle* response_body, + mojo::PendingRemote<network::mojom::URLLoader>* loader, + mojo::PendingReceiver<network::mojom::URLLoaderClient>* client_receiver, + blink::ThrottlingURLLoader* url_loader, + bool* skip_other_interceptors, + bool* will_return_and_handle_unsafe_redirect) override; + + void OnMetadataReady(network::ResourceRequest request, + data_decoder::mojom::BundleMetadataParseErrorPtr error); + + void StartRedirectResponse( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + void StartErrorResponseForUnexpectedRedirect( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + void StartResponse( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + State state_ = State::kInitial; + std::unique_ptr<WebBundleSource> source_; + scoped_refptr<WebBundleReader> reader_; + + mojo::Remote<network::mojom::URLLoaderClient> forwarding_client_; + + base::WeakPtrFactory<WebBundleInterceptorForHistoryNavigationFromNetwork> + weak_factory_{this}; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_FROM_NETWORK_H_
diff --git a/content/browser/web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.cc b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.cc new file mode 100644 index 0000000..cb9d37d --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.cc
@@ -0,0 +1,66 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.h" + +#include "content/browser/loader/single_request_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_reader.h" +#include "content/browser/web_package/web_bundle_source.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "services/network/public/cpp/resource_request.h" +#include "url/gurl.h" + +namespace content { + +WebBundleInterceptorForHistoryNavigationWithExistingReader:: + WebBundleInterceptorForHistoryNavigationWithExistingReader( + scoped_refptr<WebBundleReader> reader, + const GURL& target_inner_url, + WebBundleDoneCallback done_callback, + int frame_tree_node_id) + : WebBundleInterceptorForHistoryNavigation(target_inner_url, + std::move(done_callback), + frame_tree_node_id) { + CreateWebBundleURLLoaderFactory(std::move(reader)); +} + +WebBundleInterceptorForHistoryNavigationWithExistingReader:: + ~WebBundleInterceptorForHistoryNavigationWithExistingReader() = default; + +// NavigationLoaderInterceptor implementation +void WebBundleInterceptorForHistoryNavigationWithExistingReader:: + MaybeCreateLoader(const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_EQ(resource_request.url, + url_loader_factory_->reader()->source().is_file() + ? web_bundle_utils::GetSynthesizedUrlForWebBundle( + url_loader_factory_->reader()->source().url(), + target_inner_url_) + : target_inner_url_); + std::move(callback).Run( + base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( + &WebBundleInterceptorForHistoryNavigationWithExistingReader:: + CreateURLLoader, + weak_factory_.GetWeakPtr()))); +} + +void WebBundleInterceptorForHistoryNavigationWithExistingReader:: + CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_EQ(resource_request.url, + url_loader_factory_->reader()->source().is_file() + ? web_bundle_utils::GetSynthesizedUrlForWebBundle( + url_loader_factory_->reader()->source().url(), + target_inner_url_) + : target_inner_url_); + CreateLoaderAndStartAndDone(resource_request, std::move(receiver), + std::move(client)); +} +} // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.h b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.h new file mode 100644 index 0000000..3799d64 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_history_navigation_with_existing_reader.h
@@ -0,0 +1,64 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_WITH_EXISTING_READER_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_WITH_EXISTING_READER_H_ + +#include "base/memory/weak_ptr.h" +#include "content/browser/web_package/web_bundle_interceptor_for_history_navigation.h" +#include "content/browser/web_package/web_bundle_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "services/network/public/mojom/url_loader.mojom.h" + +class GURL; + +namespace network { +struct ResourceRequest; +} // namespace network + +namespace content { + +class WebBundleReader; + +// A class to inherit NavigationLoaderInterceptor for the history navigation to +// a Web Bundle when the previous WebBundleReader is still alive. +// - MaybeCreateLoader() is called for the history navigation request. It +// continues on CreateURLLoader() to create the loader for the main resource. +class WebBundleInterceptorForHistoryNavigationWithExistingReader final + : public WebBundleInterceptorForHistoryNavigation { + public: + WebBundleInterceptorForHistoryNavigationWithExistingReader( + scoped_refptr<WebBundleReader> reader, + const GURL& target_inner_url, + WebBundleDoneCallback done_callback, + int frame_tree_node_id); + WebBundleInterceptorForHistoryNavigationWithExistingReader( + const WebBundleInterceptorForHistoryNavigationWithExistingReader&) = + delete; + WebBundleInterceptorForHistoryNavigationWithExistingReader& operator=( + const WebBundleInterceptorForHistoryNavigationWithExistingReader&) = + delete; + + ~WebBundleInterceptorForHistoryNavigationWithExistingReader() override; + + private: + void MaybeCreateLoader(const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) override; + + void CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + base::WeakPtrFactory< + WebBundleInterceptorForHistoryNavigationWithExistingReader> + weak_factory_{this}; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_HISTORY_NAVIGATION_WITH_EXISTING_READER_H_
diff --git a/content/browser/web_package/web_bundle_interceptor_for_network.cc b/content/browser/web_package/web_bundle_interceptor_for_network.cc new file mode 100644 index 0000000..bc9970f --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_network.cc
@@ -0,0 +1,154 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_interceptor_for_network.h" + +#include "base/strings/stringprintf.h" +#include "content/browser/loader/navigation_loader_interceptor.h" +#include "content/browser/loader/single_request_url_loader_factory.h" +#include "content/browser/web_package/signed_exchange_utils.h" +#include "content/browser/web_package/web_bundle_reader.h" +#include "content/browser/web_package/web_bundle_redirect_url_loader.h" +#include "content/browser/web_package/web_bundle_source.h" +#include "content/browser/web_package/web_bundle_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "content/public/browser/download_utils.h" +#include "net/traffic_annotation/network_traffic_annotation.h" + +namespace content { + +WebBundleInterceptorForNetwork::WebBundleInterceptorForNetwork( + WebBundleDoneCallback done_callback, + BrowserContext* browser_context, + int frame_tree_node_id) + : done_callback_(std::move(done_callback)), + browser_context_(browser_context), + frame_tree_node_id_(frame_tree_node_id) { + DCHECK(browser_context_); +} + +WebBundleInterceptorForNetwork::~WebBundleInterceptorForNetwork() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +// NavigationLoaderInterceptor implementation +void WebBundleInterceptorForNetwork::MaybeCreateLoader( + const network::ResourceRequest& tentative_resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!reader_) { + std::move(callback).Run({}); + return; + } + std::move(callback).Run(base::MakeRefCounted<SingleRequestURLLoaderFactory>( + base::BindOnce(&WebBundleInterceptorForNetwork::StartResponse, + weak_factory_.GetWeakPtr()))); +} + +bool WebBundleInterceptorForNetwork::MaybeCreateLoaderForResponse( + const network::ResourceRequest& request, + network::mojom::URLResponseHeadPtr* response_head, + mojo::ScopedDataPipeConsumerHandle* response_body, + mojo::PendingRemote<network::mojom::URLLoader>* loader, + mojo::PendingReceiver<network::mojom::URLLoaderClient>* client_receiver, + blink::ThrottlingURLLoader* url_loader, + bool* skip_other_interceptors, + bool* will_return_and_handle_unsafe_redirect) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if ((*response_head)->mime_type != + web_bundle_utils::kWebBundleFileMimeTypeWithoutParameters) { + return false; + } + if (download_utils::MustDownload(request.url, (*response_head)->headers.get(), + (*response_head)->mime_type)) { + return false; + } + *client_receiver = forwarding_client_.BindNewPipeAndPassReceiver(); + + if (!signed_exchange_utils::HasNoSniffHeader(**response_head)) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + web_bundle_utils::kNoSniffErrorMessage); + return true; + } + auto source = WebBundleSource::MaybeCreateFromNetworkUrl(request.url); + if (!source) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + "Web Bundle response must be served from HTTPS or localhost HTTP."); + return true; + } + + uint64_t length_hint = + (*response_head)->content_length > 0 + ? static_cast<uint64_t>((*response_head)->content_length) + : 0; + + // TODO(crbug.com/1018640): Check the special HTTP response header if we + // decided to require one for WBN navigation. + + reader_ = base::MakeRefCounted<WebBundleReader>( + std::move(source), length_hint, std::move(*response_body), + url_loader->Unbind(), + BrowserContext::GetBlobStorageContext(browser_context_)); + reader_->ReadMetadata( + base::BindOnce(&WebBundleInterceptorForNetwork::OnMetadataReady, + weak_factory_.GetWeakPtr(), request)); + return true; +} + +void WebBundleInterceptorForNetwork::OnMetadataReady( + network::ResourceRequest request, + data_decoder::mojom::BundleMetadataParseErrorPtr error) { + if (error) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + web_bundle_utils::GetMetadataParseErrorMessage(error)); + return; + } + primary_url_ = reader_->GetPrimaryURL(); + if (!reader_->HasEntry(primary_url_)) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + "The primary URL resource is not found in the web bundle."); + return; + } + if (primary_url_.GetOrigin() != reader_->source().url().GetOrigin()) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + "The origin of primary URL doesn't match with the origin of the web " + "bundle."); + return; + } + if (!reader_->source().IsNavigationPathRestrictionSatisfied(primary_url_)) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + std::move(forwarding_client_), frame_tree_node_id_, + base::StringPrintf("Path restriction mismatch: Can't navigate to %s " + "in the web bundle served from %s.", + primary_url_.spec().c_str(), + reader_->source().url().spec().c_str())); + return; + } + url_loader_factory_ = + std::make_unique<WebBundleURLLoaderFactory>(reader_, frame_tree_node_id_); + auto redirect_loader = + std::make_unique<WebBundleRedirectURLLoader>(forwarding_client_.Unbind()); + redirect_loader->OnReadyToRedirect(request, primary_url_); +} + +void WebBundleInterceptorForNetwork::StartResponse( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + network::ResourceRequest new_resource_request = resource_request; + new_resource_request.url = primary_url_; + url_loader_factory_->CreateLoaderAndStart( + std::move(receiver), 0, 0, 0, new_resource_request, std::move(client), + net::MutableNetworkTrafficAnnotationTag( + web_bundle_utils::kTrafficAnnotation)); + std::move(done_callback_).Run(primary_url_, std::move(url_loader_factory_)); +} +} // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_network.h b/content/browser/web_package/web_bundle_interceptor_for_network.h new file mode 100644 index 0000000..fd4ead0 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_network.h
@@ -0,0 +1,93 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_NETWORK_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_NETWORK_H_ + +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "content/browser/loader/navigation_loader_interceptor.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "services/network/public/mojom/url_loader.mojom.h" +#include "third_party/blink/public/common/loader/throttling_url_loader.h" +#include "url/gurl.h" + +namespace content { + +class WebBundleReader; +class WebBundleURLLoaderFactory; + +// A class to inherit NavigationLoaderInterceptor for a navigation to a +// Web Bundle file on HTTPS server (eg: "https://example.com/a.wbn"). +// The overridden methods of NavigationLoaderInterceptor are called in the +// following sequence: +// [1] MaybeCreateLoader() is called for all navigation requests. It calls the +// |callback| with a null RequestHandler. +// [2] MaybeCreateLoaderForResponse() is called for all navigation responses. +// - If the response mime type is not "application/webbundle", or attachment +// Content-Disposition header is set, returns false. +// - If the URL isn't HTTPS nor localhost HTTP, or the Content-Length header +// is not a positive value, completes the requests with +// ERR_INVALID_WEB_BUNDLE and returns true. +// - Otherwise starts reading the metadata and returns true. Once the +// metadata is read, OnMetadataReady() is called, and a redirect loader is +// created to redirect the navigation request to the Bundle's primary URL +// ("https://example.com/a.html"). +// [3] MaybeCreateLoader() is called again for the redirect. It continues on +// StartResponse() to create the loader for the main resource. +class WebBundleInterceptorForNetwork final + : public NavigationLoaderInterceptor { + public: + WebBundleInterceptorForNetwork(WebBundleDoneCallback done_callback, + BrowserContext* browser_context, + int frame_tree_node_id); + WebBundleInterceptorForNetwork(const WebBundleInterceptorForNetwork&) = + delete; + WebBundleInterceptorForNetwork& operator=( + const WebBundleInterceptorForNetwork&) = delete; + + ~WebBundleInterceptorForNetwork() override; + + private: + void MaybeCreateLoader( + const network::ResourceRequest& tentative_resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) override; + + bool MaybeCreateLoaderForResponse( + const network::ResourceRequest& request, + network::mojom::URLResponseHeadPtr* response_head, + mojo::ScopedDataPipeConsumerHandle* response_body, + mojo::PendingRemote<network::mojom::URLLoader>* loader, + mojo::PendingReceiver<network::mojom::URLLoaderClient>* client_receiver, + blink::ThrottlingURLLoader* url_loader, + bool* skip_other_interceptors, + bool* will_return_and_handle_unsafe_redirect) override; + + void OnMetadataReady(network::ResourceRequest request, + data_decoder::mojom::BundleMetadataParseErrorPtr error); + + void StartResponse( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + WebBundleDoneCallback done_callback_; + BrowserContext* browser_context_; + const int frame_tree_node_id_; + scoped_refptr<WebBundleReader> reader_; + GURL primary_url_; + std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; + + mojo::Remote<network::mojom::URLLoaderClient> forwarding_client_; + + SEQUENCE_CHECKER(sequence_checker_); + + base::WeakPtrFactory<WebBundleInterceptorForNetwork> weak_factory_{this}; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_NETWORK_H_
diff --git a/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_file.cc b/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_file.cc new file mode 100644 index 0000000..8ca4292 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_file.cc
@@ -0,0 +1,93 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_file.h" + +#include "content/browser/loader/single_request_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_reader.h" +#include "content/browser/web_package/web_bundle_redirect_url_loader.h" +#include "content/browser/web_package/web_bundle_source.h" +#include "content/browser/web_package/web_bundle_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/self_owned_receiver.h" +#include "net/traffic_annotation/network_traffic_annotation.h" + +namespace content { + +// A class to inherit NavigationLoaderInterceptor for a navigation within a +// Web Bundle file. +// For example: +// A user opened "file:///tmp/a.wbn", and InterceptorForFile redirected to +// "file:///tmp/a.wbn?https://example.com/a.html" and "a.html" in "a.wbn" was +// loaded. And the user clicked a link to "https://example.com/b.html" from +// "a.html". +// In this case, this interceptor intecepts the navigation request to "b.html", +// and redirect the navigation request to +// "file:///tmp/a.wbn?https://example.com/b.html" and creates a URLLoader using +// the WebBundleURLLoaderFactory to load the response of "b.html" in +// "a.wbn". +WebBundleInterceptorForTrackedNavigationFromFile:: + WebBundleInterceptorForTrackedNavigationFromFile( + scoped_refptr<WebBundleReader> reader, + WebBundleDoneCallback done_callback, + int frame_tree_node_id) + : url_loader_factory_( + std::make_unique<WebBundleURLLoaderFactory>(std::move(reader), + frame_tree_node_id)), + done_callback_(std::move(done_callback)) {} +WebBundleInterceptorForTrackedNavigationFromFile:: + ~WebBundleInterceptorForTrackedNavigationFromFile() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +// NavigationLoaderInterceptor implementation +void WebBundleInterceptorForTrackedNavigationFromFile::MaybeCreateLoader( + const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + std::move(callback).Run( + base::MakeRefCounted<SingleRequestURLLoaderFactory>(base::BindOnce( + &WebBundleInterceptorForTrackedNavigationFromFile::CreateURLLoader, + weak_factory_.GetWeakPtr()))); +} + +bool WebBundleInterceptorForTrackedNavigationFromFile:: + ShouldBypassRedirectChecks() { + return true; +} + +void WebBundleInterceptorForTrackedNavigationFromFile::CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!is_redirected_) { + DCHECK(url_loader_factory_->reader()->HasEntry(resource_request.url)); + is_redirected_ = true; + original_request_url_ = resource_request.url; + + GURL web_bundle_url = url_loader_factory_->reader()->source().url(); + const GURL new_url = web_bundle_utils::GetSynthesizedUrlForWebBundle( + web_bundle_url, original_request_url_); + auto redirect_loader = + std::make_unique<WebBundleRedirectURLLoader>(std::move(client)); + redirect_loader->OnReadyToRedirect(resource_request, new_url); + mojo::MakeSelfOwnedReceiver( + std::move(redirect_loader), + mojo::PendingReceiver<network::mojom::URLLoader>(std::move(receiver))); + return; + } + network::ResourceRequest new_resource_request = resource_request; + new_resource_request.url = original_request_url_; + url_loader_factory_->CreateLoaderAndStart( + std::move(receiver), /*routing_id=*/0, /*request_id=*/0, /*options=*/0, + new_resource_request, std::move(client), + net::MutableNetworkTrafficAnnotationTag( + web_bundle_utils::kTrafficAnnotation)); + std::move(done_callback_) + .Run(original_request_url_, std::move(url_loader_factory_)); +} +} // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_file.h b/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_file.h new file mode 100644 index 0000000..de5c876 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_file.h
@@ -0,0 +1,73 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_TRACKED_NAVIGATION_FROM_FILE_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_TRACKED_NAVIGATION_FROM_FILE_H_ + +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "content/browser/loader/navigation_loader_interceptor.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "services/network/public/mojom/url_loader.mojom.h" + +namespace content { + +class WebBundleReader; +class WebBundleURLLoaderFactory; + +// A class to inherit NavigationLoaderInterceptor for a navigation within a +// Web Bundle file. +// For example: +// A user opened "file:///tmp/a.wbn", and InterceptorForFile redirected to +// "file:///tmp/a.wbn?https://example.com/a.html" and "a.html" in "a.wbn" was +// loaded. And the user clicked a link to "https://example.com/b.html" from +// "a.html". +// In this case, this interceptor intecepts the navigation request to "b.html", +// and redirect the navigation request to +// "file:///tmp/a.wbn?https://example.com/b.html" and creates a URLLoader using +// the WebBundleURLLoaderFactory to load the response of "b.html" in +// "a.wbn". +class WebBundleInterceptorForTrackedNavigationFromFile final + : public NavigationLoaderInterceptor { + public: + WebBundleInterceptorForTrackedNavigationFromFile( + scoped_refptr<WebBundleReader> reader, + WebBundleDoneCallback done_callback, + int frame_tree_node_id); + WebBundleInterceptorForTrackedNavigationFromFile( + const WebBundleInterceptorForTrackedNavigationFromFile&) = delete; + WebBundleInterceptorForTrackedNavigationFromFile& operator=( + const WebBundleInterceptorForTrackedNavigationFromFile&) = delete; + + ~WebBundleInterceptorForTrackedNavigationFromFile() override; + + private: + void MaybeCreateLoader(const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) override; + + bool ShouldBypassRedirectChecks() override; + + void CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; + WebBundleDoneCallback done_callback_; + + bool is_redirected_ = false; + GURL original_request_url_; + + SEQUENCE_CHECKER(sequence_checker_); + + base::WeakPtrFactory<WebBundleInterceptorForTrackedNavigationFromFile> + weak_factory_{this}; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_TRACKED_NAVIGATION_FROM_FILE_H_
diff --git a/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.cc b/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.cc new file mode 100644 index 0000000..d34dac17 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.cc
@@ -0,0 +1,75 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.h" + +#include "content/browser/loader/single_request_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_reader.h" +#include "content/browser/web_package/web_bundle_source.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "content/public/common/content_features.h" +#include "content/public/common/content_switches.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "net/traffic_annotation/network_traffic_annotation.h" +#include "services/network/public/mojom/url_loader.mojom.h" + +namespace content { + +WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork:: + WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork( + scoped_refptr<WebBundleReader> reader, + WebBundleDoneCallback done_callback, + int frame_tree_node_id) + : url_loader_factory_( + std::make_unique<WebBundleURLLoaderFactory>(std::move(reader), + frame_tree_node_id)), + done_callback_(std::move(done_callback)) { + DCHECK((base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kTrustableWebBundleFileUrl) && + url_loader_factory_->reader()->source().is_trusted_file()) || + (base::FeatureList::IsEnabled(features::kWebBundlesFromNetwork) && + url_loader_factory_->reader()->source().is_network())); +} + +WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork:: + ~WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +// NavigationLoaderInterceptor implementation +void WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork:: + MaybeCreateLoader(const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(url_loader_factory_->reader()->HasEntry(resource_request.url)); + DCHECK(url_loader_factory_->reader()->source().is_trusted_file() || + (url_loader_factory_->reader()->source().is_network() && + url_loader_factory_->reader() + ->source() + .IsNavigationPathRestrictionSatisfied(resource_request.url))); + std::move(callback).Run(base::MakeRefCounted< + SingleRequestURLLoaderFactory>(base::BindOnce( + &WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork:: + CreateURLLoader, + weak_factory_.GetWeakPtr()))); +} + +void WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork:: + CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + url_loader_factory_->CreateLoaderAndStart( + std::move(receiver), /*routing_id=*/0, /*request_id=*/0, + /*options=*/0, resource_request, std::move(client), + net::MutableNetworkTrafficAnnotationTag( + web_bundle_utils::kTrafficAnnotation)); + std::move(done_callback_) + .Run(resource_request.url, std::move(url_loader_factory_)); +} +} // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.h b/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.h new file mode 100644 index 0000000..433fadb8 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_tracked_navigation_from_trustable_file_or_from_network.h
@@ -0,0 +1,74 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_TRACKED_NAVIGATION_FROM_TRUSTABLE_FILE_OR_FROM_NETWORK_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_TRACKED_NAVIGATION_FROM_TRUSTABLE_FILE_OR_FROM_NETWORK_H_ + +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "content/browser/loader/navigation_loader_interceptor.h" +#include "content/browser/web_package/web_bundle_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "services/network/public/mojom/url_loader.mojom.h" + +namespace content { + +class WebBundleReader; + +// A class to inherit NavigationLoaderInterceptor for a navigation within a +// trustable Web Bundle file or within a Web Bundle from network. +// For example: +// A user opened a trustable Web Bundle file "file:///tmp/a.wbn", and +// InterceptorForTrustableFile redirected to "https://example.com/a.html" and +// "a.html" in "a.wbn" was loaded. Or, a user opened a Web Bundle +// "https://example.com/a.wbn", and InterceptorForNetwork redirected to +// "https://example.com/a.html" and "a.html" in "a.wbn" was loaded. And the +// user clicked a link to "https://example.com/b.html" from "a.html". +// +// In this case, this interceptor intecepts the navigation request to "b.html", +// and creates a URLLoader using the WebBundleURLLoaderFactory to load +// the response of "b.html" in "a.wbn". +class WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork + final : public NavigationLoaderInterceptor { + public: + WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork( + scoped_refptr<WebBundleReader> reader, + WebBundleDoneCallback done_callback, + int frame_tree_node_id); + WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork( + const WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork&) = + delete; + WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork& + operator=( + const WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork&) = + delete; + + ~WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork() + override; + + private: + void MaybeCreateLoader(const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) override; + + void CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; + WebBundleDoneCallback done_callback_; + + SEQUENCE_CHECKER(sequence_checker_); + + base::WeakPtrFactory< + WebBundleInterceptorForTrackedNavigationFromTrustableFileOrFromNetwork> + weak_factory_{this}; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_TRACKED_NAVIGATION_FROM_TRUSTABLE_FILE_OR_FROM_NETWORK_H_
diff --git a/content/browser/web_package/web_bundle_interceptor_for_trustable_file.cc b/content/browser/web_package/web_bundle_interceptor_for_trustable_file.cc new file mode 100644 index 0000000..8ae3300 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_trustable_file.cc
@@ -0,0 +1,109 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_interceptor_for_trustable_file.h" + +#include "base/bind.h" +#include "content/browser/loader/single_request_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_reader.h" +#include "content/browser/web_package/web_bundle_redirect_url_loader.h" +#include "content/browser/web_package/web_bundle_source.h" +#include "mojo/public/cpp/bindings/self_owned_receiver.h" +#include "net/traffic_annotation/network_traffic_annotation.h" + +namespace content { + +WebBundleInterceptorForTrustableFile::WebBundleInterceptorForTrustableFile( + std::unique_ptr<WebBundleSource> source, + WebBundleDoneCallback done_callback, + int frame_tree_node_id) + : source_(std::move(source)), + reader_(base::MakeRefCounted<WebBundleReader>(source_->Clone())), + done_callback_(std::move(done_callback)), + frame_tree_node_id_(frame_tree_node_id) { + reader_->ReadMetadata( + base::BindOnce(&WebBundleInterceptorForTrustableFile::OnMetadataReady, + weak_factory_.GetWeakPtr())); +} +WebBundleInterceptorForTrustableFile::~WebBundleInterceptorForTrustableFile() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +// NavigationLoaderInterceptor implementation +void WebBundleInterceptorForTrustableFile::MaybeCreateLoader( + const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + std::move(callback).Run(base::MakeRefCounted<SingleRequestURLLoaderFactory>( + base::BindOnce(&WebBundleInterceptorForTrustableFile::CreateURLLoader, + weak_factory_.GetWeakPtr()))); +} + +void WebBundleInterceptorForTrustableFile::CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (metadata_error_) { + web_bundle_utils::CompleteWithInvalidWebBundleError( + mojo::Remote<network::mojom::URLLoaderClient>(std::move(client)), + frame_tree_node_id_, + web_bundle_utils::GetMetadataParseErrorMessage(metadata_error_)); + return; + } + + if (!url_loader_factory_) { + // This must be the first request to the Web Bundle file. + DCHECK_EQ(source_->url(), resource_request.url); + pending_resource_request_ = resource_request; + pending_receiver_ = std::move(receiver); + pending_client_ = std::move(client); + return; + } + + // Currently |source_| must be a local file. And the bundle's primary URL + // can't be a local file URL. So while handling redirected request to the + // primary URL, |resource_request.url| must not be same as the |source_|'s + // URL. + if (source_->url() != resource_request.url) { + url_loader_factory_->CreateLoaderAndStart( + std::move(receiver), /*routing_id=*/0, /*request_id=*/0, + /*options=*/0, resource_request, std::move(client), + net::MutableNetworkTrafficAnnotationTag( + web_bundle_utils::kTrafficAnnotation)); + std::move(done_callback_) + .Run(resource_request.url, std::move(url_loader_factory_)); + return; + } + + auto redirect_loader = + std::make_unique<WebBundleRedirectURLLoader>(std::move(client)); + redirect_loader->OnReadyToRedirect(resource_request, primary_url_); + mojo::MakeSelfOwnedReceiver( + std::move(redirect_loader), + mojo::PendingReceiver<network::mojom::URLLoader>(std::move(receiver))); +} + +void WebBundleInterceptorForTrustableFile::OnMetadataReady( + data_decoder::mojom::BundleMetadataParseErrorPtr error) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(!url_loader_factory_); + + if (error) { + metadata_error_ = std::move(error); + } else { + primary_url_ = reader_->GetPrimaryURL(); + url_loader_factory_ = std::make_unique<WebBundleURLLoaderFactory>( + std::move(reader_), frame_tree_node_id_); + } + + if (pending_receiver_) { + DCHECK(pending_client_); + CreateURLLoader(pending_resource_request_, std::move(pending_receiver_), + std::move(pending_client_)); + } +} +} // namespace content
diff --git a/content/browser/web_package/web_bundle_interceptor_for_trustable_file.h b/content/browser/web_package/web_bundle_interceptor_for_trustable_file.h new file mode 100644 index 0000000..01116b0 --- /dev/null +++ b/content/browser/web_package/web_bundle_interceptor_for_trustable_file.h
@@ -0,0 +1,86 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_TRUSTABLE_FILE_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_TRUSTABLE_FILE_H_ + +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "content/browser/loader/navigation_loader_interceptor.h" +#include "content/browser/web_package/web_bundle_url_loader_factory.h" +#include "content/browser/web_package/web_bundle_utils.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "services/network/public/cpp/resource_request.h" +#include "services/network/public/mojom/url_loader.mojom.h" + +namespace content { + +class WebBundleReader; +class WebBundleSource; + +// A class to inherit NavigationLoaderInterceptor for a navigation to a +// trustable Web Bundle file (eg: "file:///tmp/a.wbn"). +// The overridden methods of NavigationLoaderInterceptor are called in the +// following sequence: +// [1] MaybeCreateLoader() is called for the navigation request to the trustable +// Web Bundle file. It continues on CreateURLLoader() to create the loader +// for the main resource. +// - If OnMetadataReady() has not been called yet: +// Wait for OnMetadataReady() to be called. +// - If OnMetadataReady() was called with an error: +// Completes the request with ERR_INVALID_WEB_BUNDLE. +// - If OnMetadataReady() was called whthout errors: +// A redirect loader is created to redirect the navigation request to +// the Bundle's primary URL ("https://example.com/a.html"). +// [2] MaybeCreateLoader() is called again for the redirect. It continues on +// CreateURLLoader() to create the loader for the main resource. +class WebBundleInterceptorForTrustableFile final + : public NavigationLoaderInterceptor { + public: + WebBundleInterceptorForTrustableFile(std::unique_ptr<WebBundleSource> source, + WebBundleDoneCallback done_callback, + int frame_tree_node_id); + WebBundleInterceptorForTrustableFile( + const WebBundleInterceptorForTrustableFile&) = delete; + WebBundleInterceptorForTrustableFile& operator=( + const WebBundleInterceptorForTrustableFile&) = delete; + + ~WebBundleInterceptorForTrustableFile() override; + + private: + void MaybeCreateLoader(const network::ResourceRequest& resource_request, + BrowserContext* browser_context, + LoaderCallback callback, + FallbackCallback fallback_callback) override; + + void CreateURLLoader( + const network::ResourceRequest& resource_request, + mojo::PendingReceiver<network::mojom::URLLoader> receiver, + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + + void OnMetadataReady(data_decoder::mojom::BundleMetadataParseErrorPtr error); + + std::unique_ptr<WebBundleSource> source_; + scoped_refptr<WebBundleReader> reader_; + WebBundleDoneCallback done_callback_; + const int frame_tree_node_id_; + + network::ResourceRequest pending_resource_request_; + mojo::PendingReceiver<network::mojom::URLLoader> pending_receiver_; + mojo::PendingRemote<network::mojom::URLLoaderClient> pending_client_; + + std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory_; + + GURL primary_url_; + data_decoder::mojom::BundleMetadataParseErrorPtr metadata_error_; + + SEQUENCE_CHECKER(sequence_checker_); + + base::WeakPtrFactory<WebBundleInterceptorForTrustableFile> weak_factory_{ + this}; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_INTERCEPTOR_FOR_TRUSTABLE_FILE_H_
diff --git a/content/browser/web_package/web_bundle_redirect_url_loader.cc b/content/browser/web_package/web_bundle_redirect_url_loader.cc new file mode 100644 index 0000000..8718505 --- /dev/null +++ b/content/browser/web_package/web_bundle_redirect_url_loader.cc
@@ -0,0 +1,46 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/web_package/web_bundle_redirect_url_loader.h" + +#include "base/strings/stringprintf.h" +#include "content/public/browser/web_contents.h" +#include "net/http/http_util.h" +#include "services/network/public/cpp/resource_request.h" + +namespace content { + +WebBundleRedirectURLLoader::WebBundleRedirectURLLoader( + mojo::PendingRemote<network::mojom::URLLoaderClient> client) + : client_(std::move(client)) {} + +WebBundleRedirectURLLoader::~WebBundleRedirectURLLoader() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +void WebBundleRedirectURLLoader::OnReadyToRedirect( + const network::ResourceRequest& resource_request, + const GURL& url) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(client_.is_connected()); + auto response_head = network::mojom::URLResponseHead::New(); + response_head->encoded_data_length = 0; + response_head->headers = base::MakeRefCounted<net::HttpResponseHeaders>( + net::HttpUtil::AssembleRawHeaders( + base::StringPrintf("HTTP/1.1 %d %s\r\n", 303, "See Other"))); + + net::RedirectInfo redirect_info = net::RedirectInfo::ComputeRedirectInfo( + "GET", resource_request.url, resource_request.site_for_cookies, + resource_request.update_first_party_url_on_redirect + ? net::URLRequest::FirstPartyURLPolicy:: + UPDATE_FIRST_PARTY_URL_ON_REDIRECT + : net::URLRequest::FirstPartyURLPolicy::NEVER_CHANGE_FIRST_PARTY_URL, + resource_request.referrer_policy, resource_request.referrer.spec(), 303, + url, /*referrer_policy_header=*/base::nullopt, + /*insecure_scheme_was_upgraded=*/false, /*copy_fragment=*/true, + /*is_signed_exchange_fallback_redirect=*/false); + client_->OnReceiveRedirect(redirect_info, std::move(response_head)); +} + +} // namespace content
diff --git a/content/browser/web_package/web_bundle_redirect_url_loader.h b/content/browser/web_package/web_bundle_redirect_url_loader.h new file mode 100644 index 0000000..43d54c07e --- /dev/null +++ b/content/browser/web_package/web_bundle_redirect_url_loader.h
@@ -0,0 +1,54 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_REDIRECT_URL_LOADER_H_ +#define CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_REDIRECT_URL_LOADER_H_ + +#include <string> +#include <vector> + +#include "base/sequence_checker.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "services/network/public/mojom/url_loader.mojom.h" +#include "url/gurl.h" + +namespace network { +struct ResourceRequest; +} // namespace network + +namespace content { + +// A class to provide a network::mojom::URLLoader interface to redirect a +// request to the Web Bundle to the main resource url. +class WebBundleRedirectURLLoader final : public network::mojom::URLLoader { + public: + explicit WebBundleRedirectURLLoader( + mojo::PendingRemote<network::mojom::URLLoaderClient> client); + WebBundleRedirectURLLoader(const WebBundleRedirectURLLoader&) = delete; + WebBundleRedirectURLLoader& operator=(const WebBundleRedirectURLLoader&) = + delete; + + ~WebBundleRedirectURLLoader() override; + + void OnReadyToRedirect(const network::ResourceRequest& resource_request, + const GURL& url); + + private: + // mojom::URLLoader overrides: + void FollowRedirect(const std::vector<std::string>& removed_headers, + const net::HttpRequestHeaders& modified_headers, + const base::Optional<GURL>& new_url) override {} + void SetPriority(net::RequestPriority priority, + int intra_priority_value) override {} + void PauseReadingBodyFromNet() override {} + void ResumeReadingBodyFromNet() override {} + + SEQUENCE_CHECKER(sequence_checker_); + + mojo::Remote<network::mojom::URLLoaderClient> client_; +}; +} // namespace content + +#endif // CONTENT_BROWSER_WEB_PACKAGE_WEB_BUNDLE_REDIRECT_URL_LOADER_H_
diff --git a/content/browser/web_package/web_bundle_utils.cc b/content/browser/web_package/web_bundle_utils.cc index 1404513..42c75b8 100644 --- a/content/browser/web_package/web_bundle_utils.cc +++ b/content/browser/web_package/web_bundle_utils.cc
@@ -7,7 +7,10 @@ #include "base/command_line.h" #include "base/feature_list.h" #include "build/build_config.h" +#include "content/browser/web_package/web_bundle_url_loader_factory.h" #include "content/public/browser/content_browser_client.h" +#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 "content/public/common/content_switches.h" @@ -26,6 +29,35 @@ } // namespace +const net::NetworkTrafficAnnotationTag kTrafficAnnotation = + net::DefineNetworkTrafficAnnotation("web_bundle_loader", + R"( + semantics { + sender: "Web Bundle Loader" + description: + "Navigation request and subresource request inside a Web Bundle. " + "This does not trigger any network transaction directly, but " + "access to an entry in a local file, or in a previously fetched " + "resource over network." + trigger: "The user navigates to a Web Bundle." + data: "Nothing." + destination: LOCAL + } + policy { + cookies_allowed: NO + setting: "These requests cannot be disabled in settings." + policy_exception_justification: + "Not implemented. This request does not make any network transaction." + } + comments: + "Usually the request accesses an entry in a local file or a previously " + "fetched resource over network that contains multiple archived entries. " + "But once the feature is exposed to the public web API, the archive file " + "can be streamed over network. In such case, the streaming should be " + "provided by another URLLoader request that is issued by Blink, but based " + "on a user initiated navigation." + )"); + bool IsSupportedFileScheme(const GURL& url) { if (url.SchemeIsFile()) return true; @@ -96,5 +128,25 @@ return web_bundle_file_url.ReplaceComponents(replacements); } +void CompleteWithInvalidWebBundleError( + mojo::Remote<network::mojom::URLLoaderClient> client, + int frame_tree_node_id, + const std::string& error_message) { + WebContents* web_contents = + WebContents::FromFrameTreeNodeId(frame_tree_node_id); + if (web_contents) { + web_contents->GetMainFrame()->AddMessageToConsole( + blink::mojom::ConsoleMessageLevel::kError, error_message); + } + std::move(client)->OnComplete( + network::URLLoaderCompletionStatus(net::ERR_INVALID_WEB_BUNDLE)); +} + +std::string GetMetadataParseErrorMessage( + const data_decoder::mojom::BundleMetadataParseErrorPtr& metadata_error) { + return std::string("Failed to read metadata of Web Bundle file: ") + + metadata_error->message; +} + } // namespace web_bundle_utils } // namespace content
diff --git a/content/browser/web_package/web_bundle_utils.h b/content/browser/web_package/web_bundle_utils.h index 548470bb..e43bb5f 100644 --- a/content/browser/web_package/web_bundle_utils.h +++ b/content/browser/web_package/web_bundle_utils.h
@@ -9,10 +9,20 @@ #include "base/files/file_path.h" #include "content/common/content_export.h" - -class GURL; +#include "mojo/public/cpp/bindings/remote.h" +#include "net/traffic_annotation/network_traffic_annotation.h" +#include "services/data_decoder/public/mojom/web_bundle_parser.mojom.h" +#include "services/network/public/mojom/url_loader.mojom.h" +#include "url/gurl.h" namespace content { + +class WebBundleURLLoaderFactory; + +using WebBundleDoneCallback = base::OnceCallback<void( + const GURL& target_inner_url, + std::unique_ptr<WebBundleURLLoaderFactory> url_loader_factory)>; + namespace web_bundle_utils { // The "application/webbundle" MIME type must have a "v" parameter whose value @@ -33,6 +43,20 @@ constexpr char kWebBundleFileMimeTypeWithoutParameters[] = "application/webbundle"; +constexpr char kNoSniffErrorMessage[] = + "Web Bundle response must have \"X-Content-Type-Options: nosniff\" header."; + +extern const net::NetworkTrafficAnnotationTag kTrafficAnnotation; + +// Adds |error_message| to the console and calls OnComplete() of |client|. +void CompleteWithInvalidWebBundleError( + mojo::Remote<network::mojom::URLLoaderClient> client, + int frame_tree_node_id, + const std::string& error_message); + +std::string GetMetadataParseErrorMessage( + const data_decoder::mojom::BundleMetadataParseErrorPtr& metadata_error); + // On Android, returns true if the url scheme is file or content. On other // platforms, returns true if the url scheme is file. bool IsSupportedFileScheme(const GURL& url);
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index e13ae96e..c91b5ae 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -242,8 +242,6 @@ media::kOverflowIconsForMediaControls, kUseFeatureState}, {wf::EnableAllowActivationDelegationAttr, features::kAllowActivationDelegationAttr, kUseFeatureState}, - {wf::EnableScriptStreamingOnPreload, features::kScriptStreamingOnPreload, - kUseFeatureState}, {wf::EnableLazyFrameLoading, features::kLazyFrameLoading, kUseFeatureState}, {wf::EnableLazyFrameVisibleLoadTimeMetrics, features::kLazyFrameVisibleLoadTimeMetrics, kUseFeatureState},
diff --git a/content/common/navigation_params.mojom b/content/common/navigation_params.mojom index b0cb58d3..698a4e8 100644 --- a/content/common/navigation_params.mojom +++ b/content/common/navigation_params.mojom
@@ -200,10 +200,6 @@ int32 previews_state; // The navigationStart time exposed through the Navigation Timing API to JS. - // If this is for a browser-initiated navigation, this can override the - // navigation_start value in Blink. - // For renderer initiated navigations, this will be set on the - // renderer side and sent with FrameHost::BeginNavigation. mojo_base.mojom.TimeTicks navigation_start; // The request method: GET, POST, etc.
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 7a9e88d..b926215a 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -517,10 +517,6 @@ const base::Feature kSavePageAsWebBundle{"SavePageAsWebBundle", base::FEATURE_DISABLED_BY_DEFAULT}; -// Start streaming scripts on script preload. -const base::Feature kScriptStreamingOnPreload{"ScriptStreamingOnPreload", - base::FEATURE_ENABLED_BY_DEFAULT}; - // Make sendBeacon throw for a Blob with a non simple type. const base::Feature kSendBeaconThrowForBlobWithNonSimpleType{ "SendBeaconThrowForBlobWithNonSimpleType",
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 2009916..28d31be8 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -113,7 +113,6 @@ CONTENT_EXPORT extern const base::Feature kRunVideoCaptureServiceInBrowserProcess; CONTENT_EXPORT extern const base::Feature kSavePageAsWebBundle; -CONTENT_EXPORT extern const base::Feature kScriptStreamingOnPreload; CONTENT_EXPORT extern const base::Feature kSendBeaconThrowForBlobWithNonSimpleType; CONTENT_EXPORT extern const base::Feature kServiceWorkerOnUI;
diff --git a/content/public/test/screenshot_test_utils.cc b/content/public/test/screenshot_test_utils.cc deleted file mode 100644 index a7ef5f8..0000000 --- a/content/public/test/screenshot_test_utils.cc +++ /dev/null
@@ -1,120 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/public/test/screenshot_test_utils.h" - -#include "base/run_loop.h" -#include "base/test/bind_test_util.h" -#include "base/threading/thread_restrictions.h" -#include "build/build_config.h" -#include "cc/test/pixel_comparator.h" -#include "cc/test/pixel_test_utils.h" -#include "content/browser/renderer_host/render_widget_host_impl.h" -#include "content/public/common/content_switches.h" -#include "content/public/test/browser_test_utils.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "ui/display/display_switches.h" -#include "ui/gfx/image/image.h" -#include "ui/gfx/skbitmap_operations.h" -#include "ui/gl/gl_switches.h" - -#if defined(OS_ANDROID) -#include "base/android/build_info.h" -#endif - -namespace content { - -void SetUpCommandLineForScreenshotTest(base::CommandLine* command_line) { - // The --force-device-scale-factor flag helps make the pixel output of - // different android trybots more similar. - command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, "1.0"); - - // The --disable-lcd-text flag helps text render more similarly on - // different bots and platform. - command_line->AppendSwitch(switches::kDisableLCDText); -} - -void RunScreenshotTest(WebContents* web_contents, - const base::FilePath& golden_filepath_default, - int screenshot_width, - int screenshot_height) { - // Asserts for SetUpCommandLineForScreenshotTest. - ASSERT_EQ(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kForceDeviceScaleFactor), - "1.0"); - ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableLCDText)); - - // Asserts that BrowserTestBase::EnablePixelOutput was called. - ASSERT_FALSE(base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableGLDrawingForTests)); - - base::ScopedAllowBlockingForTesting allow_blocking; - - content::RenderWidgetHostImpl* const rwh = - content::RenderWidgetHostImpl::From( - web_contents->GetRenderWidgetHostView()->GetRenderWidgetHost()); - ASSERT_TRUE(rwh); - - gfx::Image snapshot; - base::RunLoop screenshot_callback_runloop; - base::RepeatingClosure quit_closure = - screenshot_callback_runloop.QuitClosure(); - rwh->GetSnapshotFromBrowser( - base::BindLambdaForTesting([&](const gfx::Image& image) { - snapshot = image; - quit_closure.Run(); - }), - /* from_surface */ true); - screenshot_callback_runloop.Run(); - - SkBitmap bitmap = SkBitmapOperations::CreateTiledBitmap( - *snapshot.ToSkBitmap(), /* src_x */ 0, /* src_y */ 0, screenshot_width, - screenshot_height); - - base::StringPiece platform_suffix; -#if defined(OS_MACOSX) - platform_suffix = "_mac"; -#elif defined(OS_WIN) - platform_suffix = "_win"; -#elif defined(OS_CHROMEOS) - platform_suffix = "_chromeos"; -#elif defined(OS_ANDROID) - int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int(); - if (sdk_int == base::android::SDK_VERSION_KITKAT) { - platform_suffix = "_android_kitkat"; - } else if (sdk_int == base::android::SDK_VERSION_MARSHMALLOW) { - platform_suffix = "_android_marshmallow"; - } else { - platform_suffix = "_android"; - } -#endif - base::FilePath golden_filepath_platform = - golden_filepath_default.InsertBeforeExtensionASCII(platform_suffix); - - SkBitmap expected_bitmap; - if (!cc::ReadPNGFile(golden_filepath_platform, &expected_bitmap)) { - ASSERT_TRUE(cc::ReadPNGFile(golden_filepath_default, &expected_bitmap)); - } - -#if defined(OS_MACOSX) - // The Mac 10.12 trybot has more significant subpixel rendering - // differences which we accommodate for here with a large avg/max - // per-pixel error limit. - // TODO(crbug.com/1037971): Remove this special case for mac once this - // bug is resolved. - cc::FuzzyPixelComparator comparator( - /* discard_alpha */ true, - /* error_pixels_percentage_limit */ 7.f, - /* small_error_pixels_percentage_limit */ 0.f, - /* avg_abs_error_limit */ 16.f, - /* max_abs_error_limit */ 79.f, - /* small_error_threshold */ 0); -#else - cc::ExactPixelComparator comparator(/* disard_alpha */ true); -#endif - EXPECT_TRUE(cc::MatchesBitmap(bitmap, expected_bitmap, comparator)); -} - -} // namespace content
diff --git a/content/public/test/screenshot_test_utils.h b/content/public/test/screenshot_test_utils.h deleted file mode 100644 index 171d41d..0000000 --- a/content/public/test/screenshot_test_utils.h +++ /dev/null
@@ -1,57 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_PUBLIC_TEST_SCREENSHOT_TEST_UTILS_H_ -#define CONTENT_PUBLIC_TEST_SCREENSHOT_TEST_UTILS_H_ - -#include <string> - -namespace base { -class CommandLine; -class FilePath; -} // namespace base - -namespace content { - -class WebContents; - -// This file contains functions to help build browsertests which take -// screenshots of web content and make pixel comparisons to golden baseline -// images. While you might normally use web_tests to make pixel tests of web -// content, making a browsertest helps highlight platform specific differences -// not rendered in web_tests like the different rendering of focus rings. - -// Adds command-line flags to help unify rendering across devices and -// platforms. This should be called in the SetUpCommandLine function of browser -// tests. -void SetUpCommandLineForScreenshotTest(base::CommandLine* command_line); - -// Runs a screenshot test by taking a screenshot of the given |web_contents| -// and comparing it to a golden baseline image file. -// -// |golden_screenshot_filepath| is the filepath to the golden expected -// screenshot for the test to compare to. For platform-specific differences, a -// different file for that platform can be provided and will be used -// automatically if present and conforms to the correct naming scheme. If no -// such platform specific golden image is present, the "default" one without a -// platform specific extension will be used, which is always used for Linux. -// The KitKat Android bot tends to render differently enough from the other -// Android bot that it is tracked separately. If no kitkat golden image is -// provided, it will default to the Linux golden, like all other platforms. -// Here is an example of all of the golden files present for a test which -// renders differently on all platforms: -// my_screenshot_test.png -// my_screenshot_test_mac.png -// my_screenshot_test_win.png -// my_screenshot_test_chromeos.png -// my_screenshot_test_android.png -// my_screenshot_test_android_kitkat.png -void RunScreenshotTest(WebContents* web_contents, - const base::FilePath& golden_screenshot_filepath, - int screenshot_width, - int screenshot_height); - -} // namespace content - -#endif // CONTENT_PUBLIC_TEST_SCREENSHOT_TEST_UTILS_H_
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 3141516..01f9449 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -169,8 +169,6 @@ "../public/test/render_view_test.h", "../public/test/scoped_overscroll_modes.cc", "../public/test/scoped_overscroll_modes.h", - "../public/test/screenshot_test_utils.cc", - "../public/test/screenshot_test_utils.h", "../public/test/service_worker_host_interceptor.cc", "../public/test/service_worker_host_interceptor.h", "../public/test/service_worker_test_helpers.cc",
diff --git a/content/test/data/forms/form_controls_browsertest_checkbox_android_kitkat.png b/content/test/data/forms/form_controls_browsertest_checkbox_android_kitkat.png deleted file mode 100644 index 296a7d8..0000000 --- a/content/test/data/forms/form_controls_browsertest_checkbox_android_kitkat.png +++ /dev/null Binary files differ
diff --git a/content/test/data/forms/form_controls_browsertest_radio_android_kitkat.png b/content/test/data/forms/form_controls_browsertest_radio_android_kitkat.png deleted file mode 100644 index a3f467dfb..0000000 --- a/content/test/data/forms/form_controls_browsertest_radio_android_kitkat.png +++ /dev/null Binary files differ
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt index adeeea6..ece51d7 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
@@ -194,6 +194,8 @@ crbug.com/822733 [ opengl win nvidia-0x1cb3 ] deqp/functional/gles3/transformfeedback/* [ RetryOnFailure ] crbug.com/1060024 [ opengl win passthrough nvidia-0x1cb3 ] deqp/functional/gles3/shaderloop_do_while.html [ RetryOnFailure ] crbug.com/1060024 [ opengl win passthrough nvidia-0x1cb3 ] deqp/functional/gles3/shaderloop_while.html [ RetryOnFailure ] +crbug.com/angleproject/4555 [ win opengl passthrough nvidia ] conformance/misc/type-conversion-test.html [ Skip ] + # Win / AMD @@ -636,6 +638,9 @@ crbug.com/703779 [ opengl linux nvidia-0x1cb3 ] conformance/textures/misc/texture-size-limit.html [ Failure ] crbug.com/703779 [ opengl linux nvidia-0x1cb3 ] deqp/functional/gles3/fbocompleteness.html [ Failure ] +# Linux / OpenGL / NVIDIA failures +crbug.com/angleproject/4555 [ linux opengl passthrough nvidia ] conformance/misc/type-conversion-test.html [ Skip ] + # Linux AMD only. # It looks like AMD shader compiler rejects many valid ES3 semantics. crbug.com/766776 [ linux amd ] conformance2/attribs/gl-vertex-attrib-normalized-int.html [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt index 3fae69a..b90d655 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt
@@ -287,10 +287,6 @@ crbug.com/1010942 [ win amd vulkan passthrough ] conformance/glsl/samplers/glsl-function-texture2dproj.html [ Failure ] crbug.com/angleproject/4286 [ win amd vulkan passthrough ] conformance/rendering/out-of-bounds-array-buffers.html [ Failure ] -# OpenGL / Win/ Passthrough -crbug.com/angleproject/4555 [ win opengl passthrough ] conformance/misc/type-conversion-test.html [ Skip ] - - #################### # Mac failures # #################### @@ -387,7 +383,6 @@ crbug.com/1028639 [ linux amd opengl passthrough ] conformance/ogles/GL/log2/log2_009_to_012.html [ Failure ] crbug.com/1060632 [ linux amd opengl passthrough ] conformance/more/functions/bindBuffer.html [ RetryOnFailure ] - #################### # Android failures # ####################
diff --git a/content/test/test_render_view_host.cc b/content/test/test_render_view_host.cc index 75bb605..56038c0 100644 --- a/content/test/test_render_view_host.cc +++ b/content/test/test_render_view_host.cc
@@ -264,7 +264,8 @@ const FrameReplicationState& replicated_frame_state, bool window_was_created_with_opener) { DCHECK(!IsRenderViewLive()); - GetWidget()->set_renderer_initialized(true); + GetWidget()->set_renderer_initialized( + true, RenderWidgetHostImpl::RendererInitializer::kTest); DCHECK(IsRenderViewLive()); opener_frame_route_id_ = opener_frame_route_id; RenderFrameHostImpl* main_frame =
diff --git a/docs/render_document.md b/docs/render_document.md new file mode 100644 index 0000000..f212fb71 --- /dev/null +++ b/docs/render_document.md
@@ -0,0 +1,62 @@ +# What is RenderDocument? + +## TL;DR + +RenderDocument stops us reusing RenderFrames and RenderFrameHosts, +simplifying decisions, +eliminating logic for reuse +and making RenderFrameHost a browser-side object +that corresponds to the renderer-side document +(hence RenderDocument). + +## Details + +Previously when we navigate a frame from one page to another, +the second page may appear in a new RenderFrame +or we may reuse the existing RenderFrame to load the second page. +Which happens depends on many things, +including which site-isolation policy we are following +and whether the pages are from the same site or not. +With RenderDocument, +the second page will always use a new RenderFrame +(excluding navigation within a document). + +Also when reloading a crashed frame +we reused the browser-side RenderFrameHost. +With RenderDocument we create a new RenderFrameHost +for crashed frames. + +## Read more + +https://crbug.com/936696 + +[high-level view of the work needed](https://docs.google.com/document/d/1UzVOmTj2IJ0ecz7CZicTK6ow2rr9wgLTGfY5hjyLmT4) + +[discussion of how we can land it safely](https://docs.google.com/document/d/1ZHWWEYT1L5Zgh2lpC7DHXXZjKcptI877KKOqjqxE2Ns) + +# Stages + +We have 3 stages that are behind flags + +1. crashed-frames: + With this enabled we get a new RenderFrameHost when reloading a crashed frame. +2. subframes: + With this enabled, + when a subframe navigates + we get a new RenderFrame and RenderFrameHost. +3. main frames: + With this enabled, + when the main frame navigates + we get a new RenderFrame and RenderFrameHost. + +# Test changes + +## RenderFrameHost reference becomes invalid + +Enabling this for subframes and main frames causes many tests to fail. +It is common for tests to get a reference to a RenderFrameHost +and then navigate that frame, +assuming that the reference will remain valid. +This assumption is no longer valid. +The test needs to get a reference to the new RenderFrameHost, +e.g. by traversing the frame tree again.
diff --git a/extensions/browser/api/web_request/web_request_api_helpers.cc b/extensions/browser/api/web_request/web_request_api_helpers.cc index dd070b0..e8a64ec 100644 --- a/extensions/browser/api/web_request/web_request_api_helpers.cc +++ b/extensions/browser/api/web_request/web_request_api_helpers.cc
@@ -1101,8 +1101,7 @@ scoped_refptr<net::HttpResponseHeaders> override_response_headers) { override_response_headers->RemoveHeader("Set-Cookie"); for (const std::unique_ptr<net::ParsedCookie>& cookie : cookies) { - override_response_headers->AddHeader("Set-Cookie: " + - cookie->ToCookieLine()); + override_response_headers->AddHeader("Set-Cookie", cookie->ToCookieLine()); } } @@ -1377,8 +1376,7 @@ if (added_headers.find(lowercase_header) != added_headers.end()) continue; added_headers.insert(lowercase_header); - (*override_response_headers) - ->AddHeader(header.first + ": " + header.second); + (*override_response_headers)->AddHeader(header.first, header.second); } } *response_headers_modified = true; @@ -1404,8 +1402,7 @@ original_response_headers->raw_headers()); } (*override_response_headers)->ReplaceStatusLine("HTTP/1.1 302 Found"); - (*override_response_headers)->RemoveHeader("location"); - (*override_response_headers)->AddHeader("Location: " + new_url.spec()); + (*override_response_headers)->SetHeader("Location", new_url.spec()); // Prevent the original URL's fragment from being added to the new URL. *preserve_fragment_on_redirect_url = new_url; }
diff --git a/extensions/browser/api/web_request/web_request_proxying_websocket.cc b/extensions/browser/api/web_request/web_request_proxying_websocket.cc index 8bab842..20c8e4f 100644 --- a/extensions/browser/api/web_request/web_request_proxying_websocket.cc +++ b/extensions/browser/api/web_request/web_request_proxying_websocket.cc
@@ -193,7 +193,7 @@ handshake_response_->status_code, handshake_response_->status_text.c_str())); for (const auto& header : handshake_response_->headers) - response_->headers->AddHeader(header->name + ": " + header->value); + response_->headers->AddHeader(header->name, header->value); ContinueToHeadersReceived(); }
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn index e129019..f9b8ec5 100644 --- a/gpu/BUILD.gn +++ b/gpu/BUILD.gn
@@ -348,6 +348,7 @@ if (use_dawn) { sources += [ "command_buffer/service/webgpu_decoder_unittest.cc", + "command_buffer/tests/shared_image_gl_backing_produce_dawn_unittest.cc", "command_buffer/tests/webgpu_fence_unittest.cc", "command_buffer/tests/webgpu_mailbox_unittest.cc", "command_buffer/tests/webgpu_test.cc",
diff --git a/gpu/command_buffer/service/shared_image_backing.cc b/gpu/command_buffer/service/shared_image_backing.cc index 4e49c206..58fc1a4 100644 --- a/gpu/command_buffer/service/shared_image_backing.cc +++ b/gpu/command_buffer/service/shared_image_backing.cc
@@ -6,6 +6,7 @@ #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/shared_context_state.h" +#include "gpu/command_buffer/service/shared_image_factory.h" #include "gpu/command_buffer/service/shared_image_representation.h" #include "gpu/command_buffer/service/texture_manager.h" @@ -24,6 +25,8 @@ color_space_(color_space), usage_(usage), estimated_size_(estimated_size) { + DCHECK_CALLED_ON_VALID_THREAD(factory_thread_checker_); + if (is_thread_safe) lock_.emplace(); } @@ -119,6 +122,19 @@ } } +void SharedImageBacking::RegisterImageFactory(SharedImageFactory* factory) { + DCHECK_CALLED_ON_VALID_THREAD(factory_thread_checker_); + DCHECK(!factory_); + + factory_ = factory; +} + +void SharedImageBacking::UnregisterImageFactory() { + DCHECK_CALLED_ON_VALID_THREAD(factory_thread_checker_); + + factory_ = nullptr; +} + bool SharedImageBacking::HasAnyRefs() const { AutoLock auto_lock(this);
diff --git a/gpu/command_buffer/service/shared_image_backing.h b/gpu/command_buffer/service/shared_image_backing.h index 0e368a80..5e87980 100644 --- a/gpu/command_buffer/service/shared_image_backing.h +++ b/gpu/command_buffer/service/shared_image_backing.h
@@ -14,6 +14,7 @@ #include "base/metrics/histogram_macros.h" #include "base/optional.h" #include "base/synchronization/lock.h" +#include "base/threading/thread_checker.h" #include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/gpu_gles2_export.h" @@ -45,10 +46,11 @@ class SharedImageRepresentationOverlay; class SharedImageRepresentationVaapi; class MemoryTypeTracker; +class SharedImageFactory; class VaapiDependenciesFactory; // Represents the actual storage (GL texture, VkImage, GMB) for a SharedImage. -// Should not be accessed direclty, instead is accessed through a +// Should not be accessed directly, instead is accessed through a // SharedImageRepresentation. class GPU_GLES2_EXPORT SharedImageBacking { public: @@ -81,6 +83,15 @@ // Notify backing a write access is succeeded. void OnWriteSucceeded(); + // This factory is registered when creating backing to help + // create intermediate interop backing buffer + // and share resource from gl backing buffer to dawn. + // The factory pointer needs to be reset if the origin + // factory is destructed. This will handled by destructor of + // SharedImageRepresentationFactoryRef. + void RegisterImageFactory(SharedImageFactory* factory); + void UnregisterImageFactory(); + // Returns the initialized / cleared region of the SharedImage. virtual gfx::Rect ClearedRect() const = 0; @@ -149,6 +160,12 @@ // Used by subclasses during destruction. bool have_context() const EXCLUSIVE_LOCKS_REQUIRED(lock_); + // Used by SharedImageBackingFactoryGLTexture to get register factory. + SharedImageFactory* factory() { + DCHECK_CALLED_ON_VALID_THREAD(factory_thread_checker_); + return factory_; + } + // Helper class used by subclasses to acquire |lock_| if it exists. class SCOPED_LOCKABLE GPU_GLES2_EXPORT AutoLock { public: @@ -195,6 +212,12 @@ const uint32_t usage_; const size_t estimated_size_; + SharedImageFactory* factory_ = nullptr; + + // Bound to the thread on which the backing is created. The |factory_| + // can only be used from this thread. + THREAD_CHECKER(factory_thread_checker_); + bool have_context_ GUARDED_BY(lock_) = true; // A scoped object for recording write UMA.
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc b/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc index 6f9264a..b1ebc154 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc +++ b/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc
@@ -18,12 +18,14 @@ #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/common/shared_image_trace_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" +#include "gpu/command_buffer/service/context_state.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/image_factory.h" #include "gpu/command_buffer/service/mailbox_manager.h" #include "gpu/command_buffer/service/service_utils.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image_backing.h" +#include "gpu/command_buffer/service/shared_image_factory.h" #include "gpu/command_buffer/service/shared_image_representation.h" #include "gpu/command_buffer/service/skia_utils.h" #include "gpu/config/gpu_finch_features.h" @@ -204,6 +206,101 @@ return service_id; } +std::unique_ptr<SharedImageRepresentationDawn> ProduceDawnCommon( + SharedImageFactory* factory, + SharedImageManager* manager, + MemoryTypeTracker* tracker, + WGPUDevice device, + SharedImageBacking* backing, + bool use_passthrough) { + DCHECK(factory); + // Make SharedContextState from factory the current context + SharedContextState* shared_context_state = factory->GetSharedContextState(); + if (!shared_context_state->MakeCurrent(nullptr, true)) { + DLOG(ERROR) << "Cannot make util SharedContextState the current context"; + return nullptr; + } + + Mailbox dst_mailbox = Mailbox::GenerateForSharedImage(); + + bool success = factory->CreateSharedImage( + dst_mailbox, backing->format(), backing->size(), backing->color_space(), + gpu::kNullSurfaceHandle, backing->usage() | SHARED_IMAGE_USAGE_WEBGPU); + if (!success) { + DLOG(ERROR) << "Cannot create a shared image resource for internal blit"; + return nullptr; + } + + // Create a representation for current backing to avoid non-expected release + // and using scope access methods. + std::unique_ptr<SharedImageRepresentationGLTextureBase> src_image; + std::unique_ptr<SharedImageRepresentationGLTextureBase> dst_image; + if (use_passthrough) { + src_image = + manager->ProduceGLTexturePassthrough(backing->mailbox(), tracker); + dst_image = manager->ProduceGLTexturePassthrough(dst_mailbox, tracker); + } else { + src_image = manager->ProduceGLTexture(backing->mailbox(), tracker); + dst_image = manager->ProduceGLTexture(dst_mailbox, tracker); + } + + if (!src_image || !dst_image) { + DLOG(ERROR) << "ProduceDawn: Couldn't produce shared image for copy"; + return nullptr; + } + + std::unique_ptr<SharedImageRepresentationGLTextureBase::ScopedAccess> + source_access = src_image->BeginScopedAccess( + GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM, + SharedImageRepresentation::AllowUnclearedAccess::kNo); + if (!source_access) { + DLOG(ERROR) << "ProduceDawn: Couldn't access shared image for copy."; + return nullptr; + } + + std::unique_ptr<SharedImageRepresentationGLTextureBase::ScopedAccess> + dest_access = dst_image->BeginScopedAccess( + GL_SHARED_IMAGE_ACCESS_MODE_READWRITE_CHROMIUM, + SharedImageRepresentation::AllowUnclearedAccess::kYes); + if (!dest_access) { + DLOG(ERROR) << "ProduceDawn: Couldn't access shared image for copy."; + return nullptr; + } + + GLuint source_texture = src_image->GetTextureBase()->service_id(); + GLuint dest_texture = dst_image->GetTextureBase()->service_id(); + DCHECK_NE(source_texture, dest_texture); + + GLenum target = dst_image->GetTextureBase()->target(); + + // Ensure skia's internal cache of GL context state is reset before using it. + // TODO(crbug.com/1036142: Figure out cases that need this invocation). + shared_context_state->PessimisticallyResetGrContext(); + + if (use_passthrough) { + gl::GLApi* gl = shared_context_state->context_state()->api(); + + gl->glCopyTextureCHROMIUMFn(source_texture, 0, target, dest_texture, 0, + viz::GLDataFormat(backing->format()), + viz::GLDataType(backing->format()), false, + false, false); + } else { + // TODO(crbug.com/1036142: Implement copyTextureCHROMIUM for validating + // path). + NOTREACHED(); + return nullptr; + } + + // Set cleared flag for internal backing to prevent auto clear. + dst_image->SetCleared(); + + // Safe to destroy factory's ref. The backing is kept alive by GL + // representation ref. + factory->DestroySharedImage(dst_mailbox); + + return manager->ProduceDawn(dst_mailbox, tracker, device); +} + } // anonymous namespace // Representation of a SharedImageBackingGLTexture as a GL Texture. @@ -578,6 +675,18 @@ return result; } + std::unique_ptr<SharedImageRepresentationDawn> ProduceDawn( + SharedImageManager* manager, + MemoryTypeTracker* tracker, + WGPUDevice device) override { + if (!factory()) { + DLOG(ERROR) << "No SharedImageFactory to create a dawn representation."; + return nullptr; + } + + return ProduceDawnCommon(factory(), manager, tracker, device, this, false); + } + private: gles2::Texture* texture_ = nullptr; gles2::Texture* rgb_emulation_texture_ = nullptr; @@ -688,6 +797,18 @@ return result; } + std::unique_ptr<SharedImageRepresentationDawn> ProduceDawn( + SharedImageManager* manager, + MemoryTypeTracker* tracker, + WGPUDevice device) override { + if (!factory()) { + DLOG(ERROR) << "No SharedImageFactory to create a dawn representation."; + return nullptr; + } + + return ProduceDawnCommon(factory(), manager, tracker, device, this, true); + } + private: scoped_refptr<gles2::TexturePassthrough> texture_passthrough_; sk_sp<SkPromiseImageTexture> cached_promise_texture_;
diff --git a/gpu/command_buffer/service/shared_image_factory.cc b/gpu/command_buffer/service/shared_image_factory.cc index 36f32b82..1ebcc02 100644 --- a/gpu/command_buffer/service/shared_image_factory.cc +++ b/gpu/command_buffer/service/shared_image_factory.cc
@@ -84,6 +84,7 @@ bool enable_wrapped_sk_image) : mailbox_manager_(mailbox_manager), shared_image_manager_(shared_image_manager), + shared_context_state_(context_state), memory_tracker_(std::make_unique<MemoryTypeTracker>(memory_tracker)), using_vulkan_(context_state && context_state->GrContextIsVulkan()), using_metal_(context_state && context_state->GrContextIsMetal()), @@ -481,6 +482,8 @@ return false; } + shared_image->RegisterImageFactory(this); + // TODO(ericrk): Remove this once no legacy cases remain. if (allow_legacy_mailbox && !shared_image->ProduceLegacyMailbox(mailbox_manager_)) {
diff --git a/gpu/command_buffer/service/shared_image_factory.h b/gpu/command_buffer/service/shared_image_factory.h index 0b91c32d..60cb6aa 100644 --- a/gpu/command_buffer/service/shared_image_factory.h +++ b/gpu/command_buffer/service/shared_image_factory.h
@@ -48,6 +48,7 @@ // SharedImageRepresentationFactory. class GPU_GLES2_EXPORT SharedImageFactory { public: + // All objects passed are expected to outlive this class. SharedImageFactory(const GpuPreferences& gpu_preferences, const GpuDriverBugWorkarounds& workarounds, const GpuFeatureInfo& gpu_feature_info, @@ -109,6 +110,10 @@ bool RegisterBacking(std::unique_ptr<SharedImageBacking> backing, bool allow_legacy_mailbox); + SharedContextState* GetSharedContextState() const { + return shared_context_state_; + } + void RegisterSharedImageBackingFactoryForTesting( SharedImageBackingFactory* factory); @@ -121,6 +126,7 @@ gfx::GpuMemoryBufferType gmb_type = gfx::EMPTY_BUFFER); MailboxManager* mailbox_manager_; SharedImageManager* shared_image_manager_; + SharedContextState* shared_context_state_; std::unique_ptr<MemoryTypeTracker> memory_tracker_; const bool using_vulkan_; const bool using_metal_;
diff --git a/gpu/command_buffer/service/shared_image_representation.cc b/gpu/command_buffer/service/shared_image_representation.cc index 6dd0d77..2019637 100644 --- a/gpu/command_buffer/service/shared_image_representation.cc +++ b/gpu/command_buffer/service/shared_image_representation.cc
@@ -210,6 +210,7 @@ } SharedImageRepresentationFactoryRef::~SharedImageRepresentationFactoryRef() { + backing()->UnregisterImageFactory(); backing()->MarkForDestruction(); }
diff --git a/gpu/command_buffer/service/shared_image_representation.h b/gpu/command_buffer/service/shared_image_representation.h index ceb49c2..d6ad606 100644 --- a/gpu/command_buffer/service/shared_image_representation.h +++ b/gpu/command_buffer/service/shared_image_representation.h
@@ -138,6 +138,9 @@ return backing()->ProduceLegacyMailbox(mailbox_manager); } bool PresentSwapChain() { return backing()->PresentSwapChain(); } + void RegisterImageFactory(SharedImageFactory* factory) { + backing()->RegisterImageFactory(factory); + } }; class GPU_GLES2_EXPORT SharedImageRepresentationGLTextureBase
diff --git a/gpu/command_buffer/tests/shared_image_gl_backing_produce_dawn_unittest.cc b/gpu/command_buffer/tests/shared_image_gl_backing_produce_dawn_unittest.cc new file mode 100644 index 0000000..274838c --- /dev/null +++ b/gpu/command_buffer/tests/shared_image_gl_backing_produce_dawn_unittest.cc
@@ -0,0 +1,196 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/threading/thread_task_runner_handle.h" +#include "build/build_config.h" +#include "components/viz/test/test_gpu_service_holder.h" +#include "gpu/GLES2/gl2extchromium.h" +#include "gpu/command_buffer/client/gles2_implementation.h" +#include "gpu/command_buffer/client/shared_image_interface.h" +#include "gpu/command_buffer/client/webgpu_implementation.h" +#include "gpu/command_buffer/common/mailbox.h" +#include "gpu/command_buffer/common/shared_image_usage.h" +#include "gpu/command_buffer/tests/webgpu_test.h" +#include "gpu/ipc/gl_in_process_context.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/gfx/color_space.h" + +namespace gpu { +namespace { + +class MockBufferMapReadCallback { + public: + MOCK_METHOD4(Call, + void(WGPUBufferMapAsyncStatus status, + const uint32_t* ptr, + uint64_t data_length, + void* userdata)); +}; + +std::unique_ptr<testing::StrictMock<MockBufferMapReadCallback>> + mock_buffer_map_read_callback; +void ToMockBufferMapReadCallback(WGPUBufferMapAsyncStatus status, + const void* ptr, + uint64_t data_length, + void* userdata) { + // Assume the data is uint32_t + mock_buffer_map_read_callback->Call(status, static_cast<const uint32_t*>(ptr), + data_length, userdata); +} + +} // namespace + +class SharedImageGLBackingProduceDawnTest : public WebGPUTest { + protected: + void SetUp() override { + WebGPUTest::SetUp(); + WebGPUTest::Options option; + Initialize(option); + + gpu::ContextCreationAttribs attributes; + attributes.alpha_size = 8; + attributes.depth_size = 24; + attributes.red_size = 8; + attributes.green_size = 8; + attributes.blue_size = 8; + attributes.stencil_size = 8; + attributes.samples = 4; + attributes.sample_buffers = 1; + attributes.bind_generates_resource = false; + + gl_context_ = std::make_unique<GLInProcessContext>(); + ContextResult result = gl_context_->Initialize( + GetGpuServiceHolder()->task_executor(), nullptr, true, + gpu::kNullSurfaceHandle, attributes, option.shared_memory_limits, + nullptr, nullptr, base::ThreadTaskRunnerHandle::Get()); + ASSERT_EQ(result, ContextResult::kSuccess); + mock_buffer_map_read_callback = + std::make_unique<testing::StrictMock<MockBufferMapReadCallback>>(); + } + + void TearDown() override { + WebGPUTest::TearDown(); + gl_context_.reset(); + mock_buffer_map_read_callback = nullptr; + } + + bool ShouldSkipTest() { +// Windows is the only platform enabled passthrough in this test. +#if defined(OS_WIN) + return false; +#else + return true; +#endif // defined(OS_WIN) + } + + gles2::GLES2Implementation* gl() { return gl_context_->GetImplementation(); } + + std::unique_ptr<GLInProcessContext> gl_context_; +}; + +// Tests using Associate/DissociateMailbox to share an image with Dawn. +// For simplicity of the test the image is shared between a Dawn device and +// itself: we render to it using the Dawn device, then re-associate it to a +// Dawn texture and read back the values that were written. +TEST_F(SharedImageGLBackingProduceDawnTest, Basic) { + if (ShouldSkipTest()) + return; + if (!WebGPUSupported()) { + LOG(ERROR) << "Test skipped because WebGPU isn't supported"; + return; + } + if (!WebGPUSharedImageSupported()) { + LOG(ERROR) << "Test skipped because WebGPUSharedImage isn't supported"; + return; + } + + // Create the shared image + SharedImageInterface* sii = gl_context_->GetSharedImageInterface(); + Mailbox gl_mailbox = sii->CreateSharedImage( + viz::ResourceFormat::RGBA_8888, {1, 1}, gfx::ColorSpace::CreateSRGB(), + SHARED_IMAGE_USAGE_GLES2); + SyncToken mailbox_produced_token = sii->GenVerifiedSyncToken(); + gl()->WaitSyncTokenCHROMIUM(mailbox_produced_token.GetConstData()); + GLuint texture = + gl()->CreateAndTexStorage2DSharedImageCHROMIUM(gl_mailbox.name); + + gl()->BeginSharedImageAccessDirectCHROMIUM( + texture, GL_SHARED_IMAGE_ACCESS_MODE_READWRITE_CHROMIUM); + GLuint fbo = 0; + gl()->GenFramebuffers(1, &fbo); + gl()->BindFramebuffer(GL_FRAMEBUFFER, fbo); + + // Attach the texture to FBO. + gl()->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, /* Hard code */ + texture, 0); + + // Set the clear color to green. + gl()->ClearColor(0.0f, 1.0f, 0.0f, 1.0f); + gl()->Clear(GL_COLOR_BUFFER_BIT); + gl()->EndSharedImageAccessDirectCHROMIUM(texture); + + SyncToken gl_op_token; + gl()->GenUnverifiedSyncTokenCHROMIUM(gl_op_token.GetData()); + webgpu()->WaitSyncTokenCHROMIUM(gl_op_token.GetConstData()); + + DeviceAndClientID device_and_id = GetNewDeviceAndClientID(); + wgpu::Device device = device_and_id.device; + webgpu::DawnDeviceClientID device_client_id = device_and_id.client_id; + + { + // Register the shared image as a Dawn texture in the wire. + gpu::webgpu::ReservedTexture reservation = + webgpu()->ReserveTexture(device_client_id); + + webgpu()->AssociateMailbox(device_client_id, 0, reservation.id, + reservation.generation, WGPUTextureUsage_CopySrc, + reinterpret_cast<GLbyte*>(&gl_mailbox)); + wgpu::Texture texture = wgpu::Texture::Acquire(reservation.texture); + + // Copy the texture in a mappable buffer. + wgpu::BufferDescriptor buffer_desc; + buffer_desc.size = 4; + buffer_desc.usage = wgpu::BufferUsage::MapRead | wgpu::BufferUsage::CopyDst; + wgpu::Buffer readback_buffer = device.CreateBuffer(&buffer_desc); + + wgpu::TextureCopyView copy_src; + copy_src.texture = texture; + copy_src.mipLevel = 0; + copy_src.arrayLayer = 0; + copy_src.origin = {0, 0, 0}; + + wgpu::BufferCopyView copy_dst; + copy_dst.buffer = readback_buffer; + copy_dst.offset = 0; + copy_dst.rowPitch = 256; + copy_dst.imageHeight = 0; + + wgpu::Extent3D copy_size = {1, 1, 1}; + + wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); + encoder.CopyTextureToBuffer(©_src, ©_dst, ©_size); + wgpu::CommandBuffer commands = encoder.Finish(); + + wgpu::Queue queue = device.CreateQueue(); + queue.Submit(1, &commands); + + webgpu()->DissociateMailbox(device_client_id, reservation.id, + reservation.generation); + + // Map the buffer and assert the pixel is the correct value. + readback_buffer.MapReadAsync(ToMockBufferMapReadCallback, this); + uint32_t buffer_contents = 0xFF00FF00; + EXPECT_CALL(*mock_buffer_map_read_callback, + Call(WGPUBufferMapAsyncStatus_Success, + testing::Pointee(testing::Eq(buffer_contents)), + sizeof(uint32_t), this)) + .Times(1); + + WaitForCompletion(device); + } +} + +} // namespace gpu
diff --git a/gpu/command_buffer/tests/webgpu_test.h b/gpu/command_buffer/tests/webgpu_test.h index 38697bc3..eef01c50 100644 --- a/gpu/command_buffer/tests/webgpu_test.h +++ b/gpu/command_buffer/tests/webgpu_test.h
@@ -63,6 +63,10 @@ }; DeviceAndClientID GetNewDeviceAndClientID(); + viz::TestGpuServiceHolder* GetGpuServiceHolder() { + return gpu_service_holder_.get(); + } + const uint32_t kAdapterServiceID = 0u; private:
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index 3005e30a6..12a3cb3 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -1150,6 +1150,30 @@ <message name="IDS_IOS_OPTIONS_PRELOAD_WEBPAGES" desc="Title for opening the setting for if/when to preload webpages. [Length: 20em] [iOS only]"> Preload Webpages </message> + <message name="IDS_IOS_OPTIONS_PRIVACY_COOKIES" desc="Title on Privacy screen to open Cookies"> + Cookies + </message> + <message name="IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_TITLE" desc="Option title to allow cookies"> + Allow Cookies + </message> + <message name="IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_DETAIL" desc="Option detail to allow cookies"> + Sites will work normally + </message> + <message name="IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_TITLE" desc="Option title to block all cookies"> + Block All Cookies (Not recommended) + </message> + <message name="IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_DETAIL" desc="Option detail to block all cookies"> + Features on many sites may break + </message> + <message name="IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_TITLE" desc="Option title to block third party cookies"> + Block Third-Party Cookies + </message> + <message name="IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_INCOGNITO_TITLE" desc="Option title to block third party cookies in incognito"> + Block Third-Party Cookies in incognito + </message> + <message name="IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_DETAIL" desc="Option detail to block third party cookies"> + Features on some sites may break + </message> <message name="IDS_IOS_OPTIONS_PRIVACY_GOOGLE_SERVICES_FOOTER" desc="Footer to invite the user to open the Sync and Google Services settings."> For more settings that relate to privacy, security, and data collection, see <ph name="BEGIN_LINK">BEGIN_LINK</ph>Sync and Google Services<ph name="END_LINK">END_LINK</ph>. </message>
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES.png.sha1 new file mode 100644 index 0000000..bd2a154 --- /dev/null +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES.png.sha1
@@ -0,0 +1 @@ +aea330bb9bdf26d2cd5b4fbbf38855d339559e1c \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_DETAIL.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_DETAIL.png.sha1 new file mode 100644 index 0000000..bd2a154 --- /dev/null +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_DETAIL.png.sha1
@@ -0,0 +1 @@ +aea330bb9bdf26d2cd5b4fbbf38855d339559e1c \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_TITLE.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_TITLE.png.sha1 new file mode 100644 index 0000000..bd2a154 --- /dev/null +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_TITLE.png.sha1
@@ -0,0 +1 @@ +aea330bb9bdf26d2cd5b4fbbf38855d339559e1c \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_DETAIL.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_DETAIL.png.sha1 new file mode 100644 index 0000000..bd2a154 --- /dev/null +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_DETAIL.png.sha1
@@ -0,0 +1 @@ +aea330bb9bdf26d2cd5b4fbbf38855d339559e1c \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_TITLE.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_TITLE.png.sha1 new file mode 100644 index 0000000..bd2a154 --- /dev/null +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_TITLE.png.sha1
@@ -0,0 +1 @@ +aea330bb9bdf26d2cd5b4fbbf38855d339559e1c \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_DETAIL.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_DETAIL.png.sha1 new file mode 100644 index 0000000..bd2a154 --- /dev/null +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_DETAIL.png.sha1
@@ -0,0 +1 @@ +aea330bb9bdf26d2cd5b4fbbf38855d339559e1c \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_INCOGNITO_TITLE.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_INCOGNITO_TITLE.png.sha1 new file mode 100644 index 0000000..bd2a154 --- /dev/null +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_INCOGNITO_TITLE.png.sha1
@@ -0,0 +1 @@ +aea330bb9bdf26d2cd5b4fbbf38855d339559e1c \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_TITLE.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_TITLE.png.sha1 new file mode 100644 index 0000000..bd2a154 --- /dev/null +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_TITLE.png.sha1
@@ -0,0 +1 @@ +aea330bb9bdf26d2cd5b4fbbf38855d339559e1c \ No newline at end of file
diff --git a/ios/chrome/browser/ui/first_run/first_run_chrome_signin_view_controller.mm b/ios/chrome/browser/ui/first_run/first_run_chrome_signin_view_controller.mm index 51fdee1..5036f067 100644 --- a/ios/chrome/browser/ui/first_run/first_run_chrome_signin_view_controller.mm +++ b/ios/chrome/browser/ui/first_run/first_run_chrome_signin_view_controller.mm
@@ -72,10 +72,6 @@ - (void)viewDidLoad { [super viewDidLoad]; [self.navigationController setNavigationBarHidden:YES]; - self.primaryButton.accessibilityIdentifier = - first_run::kSignInButtonAccessibilityIdentifier; - self.secondaryButton.accessibilityIdentifier = - first_run::kSignInSkipButtonAccessibilityIdentifier; } - (void)viewDidAppear:(BOOL)animated {
diff --git a/ios/chrome/browser/ui/first_run/first_run_constants.h b/ios/chrome/browser/ui/first_run/first_run_constants.h index 28bab17..cd17e04 100644 --- a/ios/chrome/browser/ui/first_run/first_run_constants.h +++ b/ios/chrome/browser/ui/first_run/first_run_constants.h
@@ -9,10 +9,6 @@ namespace first_run { -// The accessibility identifier for the sign in button shown in first run. -extern NSString* const kSignInButtonAccessibilityIdentifier; -// The accessibility identifier for the skip sign in button shown in first run. -extern NSString* const kSignInSkipButtonAccessibilityIdentifier; // The accessibility identifier for the UMA collection checkbox shown in first // run. extern NSString* const kUMAMetricsButtonAccessibilityIdentifier;
diff --git a/ios/chrome/browser/ui/first_run/first_run_constants.mm b/ios/chrome/browser/ui/first_run/first_run_constants.mm index c7a5d750..40276c9 100644 --- a/ios/chrome/browser/ui/first_run/first_run_constants.mm +++ b/ios/chrome/browser/ui/first_run/first_run_constants.mm
@@ -10,10 +10,6 @@ namespace first_run { -NSString* const kSignInButtonAccessibilityIdentifier = - @"SignInButtonAccessibilityIdentifier"; -NSString* const kSignInSkipButtonAccessibilityIdentifier = - @"SkipButtonAccessibilityIdentifier"; NSString* const kUMAMetricsButtonAccessibilityIdentifier = @"UMAMetricsButtonAccessibilityIdentifier";
diff --git a/ios/chrome/browser/ui/first_run/first_run_egtest.mm b/ios/chrome/browser/ui/first_run/first_run_egtest.mm index 0e21990..6d7769f 100644 --- a/ios/chrome/browser/ui/first_run/first_run_egtest.mm +++ b/ios/chrome/browser/ui/first_run/first_run_egtest.mm
@@ -32,8 +32,8 @@ // Returns matcher for the skip sign in button. id<GREYMatcher> SkipSigninButton() { - return grey_accessibilityID( - first_run::kSignInSkipButtonAccessibilityIdentifier); + return ButtonWithAccessibilityLabel( + l10n_util::GetNSString(IDS_IOS_FIRSTRUN_ACCOUNT_CONSISTENCY_SKIP_BUTTON)); } }
diff --git a/ios/chrome/browser/ui/settings/privacy/BUILD.gn b/ios/chrome/browser/ui/settings/privacy/BUILD.gn index 71fc646..a8da73a4 100644 --- a/ios/chrome/browser/ui/settings/privacy/BUILD.gn +++ b/ios/chrome/browser/ui/settings/privacy/BUILD.gn
@@ -5,6 +5,10 @@ source_set("privacy") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ + "cookies_coordinator.h", + "cookies_coordinator.mm", + "cookies_view_controller.h", + "cookies_view_controller.mm", "handoff_table_view_controller.h", "handoff_table_view_controller.mm", "privacy_coordinator.h", @@ -28,6 +32,7 @@ "//ios/chrome/browser/ui/colors", "//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/coordinators:chrome_coordinators", + "//ios/chrome/browser/ui/page_info:features", "//ios/chrome/browser/ui/settings:constants", "//ios/chrome/browser/ui/settings:settings_root", "//ios/chrome/browser/ui/settings/cells",
diff --git a/ios/chrome/browser/ui/settings/privacy/cookies_coordinator.h b/ios/chrome/browser/ui/settings/privacy/cookies_coordinator.h new file mode 100644 index 0000000..3ac9e05 --- /dev/null +++ b/ios/chrome/browser/ui/settings/privacy/cookies_coordinator.h
@@ -0,0 +1,42 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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_SETTINGS_PRIVACY_COOKIES_COORDINATOR_H_ +#define IOS_CHROME_BROWSER_UI_SETTINGS_PRIVACY_COOKIES_COORDINATOR_H_ + +#import <Foundation/Foundation.h> + +#import "ios/chrome/browser/ui/coordinators/chrome_coordinator.h" + +@class PrivacyCookiesCoordinator; + +// Delegate that allows to dereference the PrivacyCookiesCoordinator. +@protocol PrivacyCookiesCoordinatorDelegate + +// Called when the view controller is removed from navigation controller. +- (void)privacyCookiesCoordinatorViewControllerWasRemoved: + (PrivacyCookiesCoordinator*)coordinator; + +@end +// The coordinator for the Cookies screen. +@interface PrivacyCookiesCoordinator : ChromeCoordinator + +@property(nonatomic, weak) id<PrivacyCookiesCoordinatorDelegate> delegate; + +- (instancetype)initWithBaseViewController:(UIViewController*)viewController + NS_UNAVAILABLE; +- (instancetype)initWithBaseViewController:(UIViewController*)viewController + browserState:(ChromeBrowserState*)browserState + NS_UNAVAILABLE; +- (instancetype)initWithBaseViewController:(UIViewController*)viewController + browser:(Browser*)browser NS_UNAVAILABLE; + +- (instancetype)initWithBaseNavigationController: + (UINavigationController*)navigationController + browser:(Browser*)browser + NS_DESIGNATED_INITIALIZER; + +@end + +#endif // IOS_CHROME_BROWSER_UI_SETTINGS_PRIVACY_COOKIES_COORDINATOR_H_
diff --git a/ios/chrome/browser/ui/settings/privacy/cookies_coordinator.mm b/ios/chrome/browser/ui/settings/privacy/cookies_coordinator.mm new file mode 100644 index 0000000..85dcd64a --- /dev/null +++ b/ios/chrome/browser/ui/settings/privacy/cookies_coordinator.mm
@@ -0,0 +1,56 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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/settings/privacy/cookies_coordinator.h" + +#include "base/logging.h" +#import "ios/chrome/browser/ui/settings/privacy/cookies_view_controller.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@interface PrivacyCookiesCoordinator () < + PrivacyCookiesViewControllerPresentationDelegate> + +@property(nonatomic, strong) PrivacyCookiesViewController* viewController; + +@end + +@implementation PrivacyCookiesCoordinator + +@synthesize baseNavigationController = _baseNavigationController; + +- (instancetype)initWithBaseNavigationController: + (UINavigationController*)navigationController + browser:(Browser*)browser { + if ([super initWithBaseViewController:navigationController browser:browser]) { + _baseNavigationController = navigationController; + } + return self; +} + +#pragma mark - ChromeCoordinator + +- (void)start { + self.viewController = [[PrivacyCookiesViewController alloc] + initWithStyle:UITableViewStylePlain]; + [self.baseNavigationController pushViewController:self.viewController + animated:YES]; + self.viewController.presentationDelegate = self; +} + +- (void)stop { + self.viewController = nil; +} + +#pragma mark - PrivacyCookiesViewControllerPresentationDelegate + +- (void)privacyCookiesViewControllerWasRemoved: + (PrivacyCookiesViewController*)controller { + DCHECK_EQ(self.viewController, controller); + [self.delegate privacyCookiesCoordinatorViewControllerWasRemoved:self]; +} + +@end
diff --git a/ios/chrome/browser/ui/settings/privacy/cookies_view_controller.h b/ios/chrome/browser/ui/settings/privacy/cookies_view_controller.h new file mode 100644 index 0000000..c34656d3 --- /dev/null +++ b/ios/chrome/browser/ui/settings/privacy/cookies_view_controller.h
@@ -0,0 +1,33 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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_SETTINGS_PRIVACY_COOKIES_VIEW_CONTROLLER_H_ +#define IOS_CHROME_BROWSER_UI_SETTINGS_PRIVACY_COOKIES_VIEW_CONTROLLER_H_ + +#import <UIKit/UIKit.h> + +#import "ios/chrome/browser/ui/settings/settings_root_table_view_controller.h" + +@class PrivacyCookiesViewController; + +// Delegate for presentation events related to +// PrivacyCookiesViewController. +@protocol PrivacyCookiesViewControllerPresentationDelegate + +// Called when the view controller is removed from its parent. +- (void)privacyCookiesViewControllerWasRemoved: + (PrivacyCookiesViewController*)controller; + +@end + +// View Controller for displaying the Cookies screen. +@interface PrivacyCookiesViewController : SettingsRootTableViewController + +// Presentation delegate. +@property(nonatomic, weak) id<PrivacyCookiesViewControllerPresentationDelegate> + presentationDelegate; + +@end + +#endif // IOS_CHROME_BROWSER_UI_SETTINGS_PRIVACY_COOKIES_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/settings/privacy/cookies_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/cookies_view_controller.mm new file mode 100644 index 0000000..2f703a57 --- /dev/null +++ b/ios/chrome/browser/ui/settings/privacy/cookies_view_controller.mm
@@ -0,0 +1,96 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// 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/settings/privacy/cookies_view_controller.h" + +#import "ios/chrome/browser/ui/table_view/cells/table_view_multi_detail_text_item.h" +#include "ios/chrome/grit/ios_strings.h" +#include "ui/base/l10n/l10n_util.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { + +typedef NS_ENUM(NSInteger, SectionIdentifier) { + SectionIdentifierContent = kSectionIdentifierEnumZero, +}; + +typedef NS_ENUM(NSInteger, ItemType) { + ItemTypeAllowCookies = kItemTypeEnumZero, + ItemTypeBlockThirdPartyCookiesIncognito, + ItemTypeBlockThirdPartyCookies, + ItemTypeBlockAllCookies, + ItemTypeCookiesDescription, +}; + +} // namespace + +@implementation PrivacyCookiesViewController + +#pragma mark - UIViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.title = l10n_util::GetNSString(IDS_IOS_OPTIONS_PRIVACY_COOKIES); + + [self loadModel]; + // TODO(crbug.com/1064961): Implement this. +} + +- (void)didMoveToParentViewController:(UIViewController*)parent { + [super didMoveToParentViewController:parent]; + if (!parent) { + [self.presentationDelegate privacyCookiesViewControllerWasRemoved:self]; + } +} + +#pragma mark - ChromeTableViewController + +- (void)loadModel { + [super loadModel]; + [self.tableViewModel addSectionWithIdentifier:SectionIdentifierContent]; + + TableViewMultiDetailTextItem* allowCookies = + [[TableViewMultiDetailTextItem alloc] initWithType:ItemTypeAllowCookies]; + allowCookies.text = l10n_util::GetNSString( + IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_TITLE); + allowCookies.leadingDetailText = l10n_util::GetNSString( + IDS_IOS_OPTIONS_PRIVACY_COOKIES_ALLOW_COOKIES_DETAIL); + [self.tableViewModel addItem:allowCookies + toSectionWithIdentifier:SectionIdentifierContent]; + + TableViewMultiDetailTextItem* blockThirdPartyCookiesIncognito = + [[TableViewMultiDetailTextItem alloc] + initWithType:ItemTypeBlockThirdPartyCookiesIncognito]; + blockThirdPartyCookiesIncognito.text = l10n_util::GetNSString( + IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_INCOGNITO_TITLE); + blockThirdPartyCookiesIncognito.leadingDetailText = l10n_util::GetNSString( + IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_DETAIL); + [self.tableViewModel addItem:blockThirdPartyCookiesIncognito + toSectionWithIdentifier:SectionIdentifierContent]; + + TableViewMultiDetailTextItem* blockThirdPartyCookies = + [[TableViewMultiDetailTextItem alloc] + initWithType:ItemTypeBlockThirdPartyCookies]; + blockThirdPartyCookies.text = l10n_util::GetNSString( + IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_TITLE); + blockThirdPartyCookies.leadingDetailText = l10n_util::GetNSString( + IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_THIRD_PARTY_COOKIES_DETAIL); + [self.tableViewModel addItem:blockThirdPartyCookies + toSectionWithIdentifier:SectionIdentifierContent]; + + TableViewMultiDetailTextItem* blockAllCookies = + [[TableViewMultiDetailTextItem alloc] + initWithType:ItemTypeBlockAllCookies]; + blockAllCookies.text = l10n_util::GetNSString( + IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_TITLE); + blockAllCookies.leadingDetailText = l10n_util::GetNSString( + IDS_IOS_OPTIONS_PRIVACY_COOKIES_BLOCK_ALL_COOKIES_DETAIL); + [self.tableViewModel addItem:blockAllCookies + toSectionWithIdentifier:SectionIdentifierContent]; +} + +@end
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_coordinator.mm b/ios/chrome/browser/ui/settings/privacy/privacy_coordinator.mm index cae6a47..bdded27 100644 --- a/ios/chrome/browser/ui/settings/privacy/privacy_coordinator.mm +++ b/ios/chrome/browser/ui/settings/privacy/privacy_coordinator.mm
@@ -11,6 +11,7 @@ #import "ios/chrome/browser/ui/commands/open_new_tab_command.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_table_view_controller.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_ui_delegate.h" +#import "ios/chrome/browser/ui/settings/privacy/cookies_coordinator.h" #import "ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.h" #import "ios/chrome/browser/ui/settings/privacy/privacy_navigation_commands.h" #import "ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.h" @@ -22,11 +23,13 @@ @interface PrivacyCoordinator () < ClearBrowsingDataUIDelegate, + PrivacyCookiesCoordinatorDelegate, PrivacyNavigationCommands, PrivacyTableViewControllerPresentationDelegate> @property(nonatomic, strong) id<ApplicationCommands> handler; @property(nonatomic, strong) PrivacyTableViewController* viewController; +@property(nonatomic, strong) PrivacyCookiesCoordinator* cookiesCoordinator; @end @@ -63,6 +66,25 @@ - (void)stop { self.viewController = nil; + [self.cookiesCoordinator stop]; + self.cookiesCoordinator = nil; +} + +#pragma mark - PrivacyTableViewControllerPresentationDelegate + +- (void)privacyTableViewControllerWasRemoved: + (PrivacyTableViewController*)controller { + DCHECK_EQ(self.viewController, controller); + [self.delegate privacyCoordinatorViewControllerWasRemoved:self]; +} + +#pragma mark - PrivacyCookiesCoordinatorDelegate + +- (void)privacyCookiesCoordinatorViewControllerWasRemoved: + (PrivacyCookiesCoordinator*)coordinator { + DCHECK(self.cookiesCoordinator); + [coordinator stop]; + coordinator = nil; } #pragma mark - PrivacyNavigationCommands @@ -86,6 +108,14 @@ animated:YES]; } +- (void)showCookies { + self.cookiesCoordinator = [[PrivacyCookiesCoordinator alloc] + initWithBaseNavigationController:self.baseNavigationController + browser:self.browser]; + self.cookiesCoordinator.delegate = self; + [self.cookiesCoordinator start]; +} + #pragma mark - PrivacyTableViewControllerPresentationDelegate - (void)privacyTableViewControllerViewControllerWasRemoved: @@ -107,5 +137,4 @@ self.viewController.navigationController); [navigationController closeSettings]; } - @end
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_navigation_commands.h b/ios/chrome/browser/ui/settings/privacy/privacy_navigation_commands.h index a107e606..6c20130 100644 --- a/ios/chrome/browser/ui/settings/privacy/privacy_navigation_commands.h +++ b/ios/chrome/browser/ui/settings/privacy/privacy_navigation_commands.h
@@ -15,6 +15,9 @@ // Shows ClearBrowsingData screen. - (void)showClearBrowsingData; +// Shows Cookies screen. +- (void)showCookies; + @end #endif // IOS_CHROME_BROWSER_UI_SETTINGS_PRIVACY_PRIVACY_NAVIGATION_COMMANDS_H_
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.h b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.h index 412468b..27de883 100644 --- a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.h +++ b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.h
@@ -20,7 +20,7 @@ @protocol PrivacyTableViewControllerPresentationDelegate // Called when the view controller is removed from its parent. -- (void)privacyTableViewControllerViewControllerWasRemoved: +- (void)privacyTableViewControllerWasRemoved: (PrivacyTableViewController*)controller; @end
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm index f51f0bd9..624f5bf 100644 --- a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm
@@ -15,6 +15,8 @@ #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browsing_data/browsing_data_features.h" #import "ios/chrome/browser/main/browser.h" +#import "ios/chrome/browser/ui/commands/open_new_tab_command.h" +#import "ios/chrome/browser/ui/page_info/features.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h" #import "ios/chrome/browser/ui/settings/privacy/privacy_navigation_commands.h" @@ -39,11 +41,13 @@ typedef NS_ENUM(NSInteger, SectionIdentifier) { SectionIdentifierWebServices = kSectionIdentifierEnumZero, + SectionIndentifierCookies, SectionIdentifierClearBrowsingData, }; typedef NS_ENUM(NSInteger, ItemType) { ItemTypeOtherDevicesHandoff = kItemTypeEnumZero, + ItemTypeCookies, ItemTypeClearBrowsingDataClear, // Footer to suggest the user to open Sync and Google services settings. ItemTypeClearBrowsingDataFooter, @@ -112,8 +116,7 @@ - (void)didMoveToParentViewController:(UIViewController*)parent { [super didMoveToParentViewController:parent]; if (!parent) { - [self.presentationDelegate - privacyTableViewControllerViewControllerWasRemoved:self]; + [self.presentationDelegate privacyTableViewControllerWasRemoved:self]; } } @@ -129,6 +132,13 @@ [model addItem:[self handoffDetailItem] toSectionWithIdentifier:SectionIdentifierWebServices]; + if (base::FeatureList::IsEnabled(kPageInfoChromeGuard)) { + // Cookies Section + [model addSectionWithIdentifier:SectionIndentifierCookies]; + [model addItem:[self cookiesItem] + toSectionWithIdentifier:SectionIndentifierCookies]; + } + // Clear Browsing Section [model addSectionWithIdentifier:SectionIdentifierClearBrowsingData]; [model addItem:[self clearBrowsingDetailItem] @@ -166,6 +176,14 @@ return showClearBrowsingDataFooterItem; } +// Returns TableViewHeaderFooterItem instance to open Cookies screen. +- (TableViewItem*)cookiesItem { + return [self detailItemWithType:ItemTypeCookies + titleId:IDS_IOS_OPTIONS_PRIVACY_COOKIES + detailText:nil + accessibilityIdentifier:kSettingsCookiesCellId]; +} + - (TableViewItem*)clearBrowsingDetailItem { return [self detailItemWithType:ItemTypeClearBrowsingDataClear titleId:IDS_IOS_CLEAR_BROWSING_DATA_TITLE @@ -214,6 +232,9 @@ case ItemTypeClearBrowsingDataClear: [self.handler showClearBrowsingData]; break; + case ItemTypeCookies: + [self.handler showCookies]; + break; default: break; }
diff --git a/ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h b/ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h index ee2bca3..178be1a9 100644 --- a/ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h +++ b/ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h
@@ -79,4 +79,7 @@ // The accessibility identifier of the Handoff cell. extern NSString* const kSettingsHandoffCellId; +// The accessibility identifier of the Cookies cell. +extern NSString* const kSettingsCookiesCellId; + #endif // IOS_CHROME_BROWSER_UI_SETTINGS_SETTINGS_TABLE_VIEW_CONTROLLER_CONSTANTS_H_
diff --git a/ios/chrome/browser/ui/settings/settings_table_view_controller_constants.mm b/ios/chrome/browser/ui/settings/settings_table_view_controller_constants.mm index 9d6fe9d..8875d3e 100644 --- a/ios/chrome/browser/ui/settings/settings_table_view_controller_constants.mm +++ b/ios/chrome/browser/ui/settings/settings_table_view_controller_constants.mm
@@ -39,3 +39,4 @@ NSString* const kSettingsClearBrowsingDataCellId = @"kSettingsClearBrowsingDataCellId"; NSString* const kSettingsHandoffCellId = @"kSettingsHandoffCellId"; +NSString* const kSettingsCookiesCellId = @"kSettingsCookiesCellId";
diff --git a/ios/web_view/internal/autofill/cwv_autofill_controller_unittest.mm b/ios/web_view/internal/autofill/cwv_autofill_controller_unittest.mm index 8c7ba146..9a50b75 100644 --- a/ios/web_view/internal/autofill/cwv_autofill_controller_unittest.mm +++ b/ios/web_view/internal/autofill/cwv_autofill_controller_unittest.mm
@@ -19,6 +19,7 @@ #include "components/autofill/ios/form_util/form_activity_params.h" #import "components/autofill/ios/form_util/form_activity_tab_helper.h" #import "components/autofill/ios/form_util/test_form_activity_tab_helper.h" +#include "components/password_manager/core/browser/password_manager.h" #import "ios/web/public/deprecated/crw_test_js_injection_receiver.h" #include "ios/web/public/js_messaging/web_frames_manager.h" #import "ios/web/public/test/fakes/fake_web_frame.h" @@ -29,6 +30,8 @@ #include "ios/web/public/web_client.h" #import "ios/web_view/internal/autofill/cwv_autofill_suggestion_internal.h" #import "ios/web_view/internal/passwords/cwv_password_controller_fake.h" +#import "ios/web_view/internal/passwords/web_view_password_manager_client.h" +#import "ios/web_view/internal/passwords/web_view_password_manager_driver.h" #include "ios/web_view/internal/web_view_browser_state.h" #import "ios/web_view/public/cwv_autofill_controller_delegate.h" #include "ios/web_view/test/test_with_locale_and_resources.h" @@ -79,8 +82,21 @@ fake_web_frames_manager_ = frames_manager.get(); test_web_state_.SetWebFramesManager(std::move(frames_manager)); - password_controller_ = - [[CWVPasswordControllerFake alloc] initWithWebState:&test_web_state_]; + // TODO(crbug.com/1070468): Redo CWVPasswordController so it is easier to + // fake in unit tests. + auto passwordManagerClient = std::make_unique<WebViewPasswordManagerClient>( + &test_web_state_, /*sync_service=*/nullptr, browser_state_.GetPrefs(), + /*identity_manager=*/nullptr, /*log_manager=*/nullptr, + /*profile_store=*/nullptr, /*account_store=*/nullptr); + auto passwordManager = std::make_unique<password_manager::PasswordManager>( + passwordManagerClient.get()); + auto passwordManagerDriver = + std::make_unique<WebViewPasswordManagerDriver>(); + password_controller_ = [[CWVPasswordControllerFake alloc] + initWithWebState:&test_web_state_ + passwordManager:std::move(passwordManager) + passwordManagerClient:std::move(passwordManagerClient) + passwordManagerDriver:std::move(passwordManagerDriver)]; autofill_controller_ = [[CWVAutofillController alloc] initWithWebState:&test_web_state_
diff --git a/ios/web_view/internal/cwv_web_view.mm b/ios/web_view/internal/cwv_web_view.mm index f67bda60..46c96f5e 100644 --- a/ios/web_view/internal/cwv_web_view.mm +++ b/ios/web_view/internal/cwv_web_view.mm
@@ -18,6 +18,7 @@ #import "components/autofill/ios/browser/js_autofill_manager.h" #import "components/autofill/ios/browser/js_suggestion_manager.h" #include "components/language/ios/browser/ios_language_detection_tab_helper.h" +#include "components/password_manager/core/browser/password_manager.h" #include "components/url_formatter/elide_url.h" #include "google_apis/google_api_keys.h" #import "ios/web/public/deprecated/crw_js_injection_receiver.h" @@ -48,6 +49,8 @@ #import "ios/web_view/internal/cwv_web_view_configuration_internal.h" #import "ios/web_view/internal/language/web_view_url_language_histogram_factory.h" #import "ios/web_view/internal/passwords/cwv_password_controller.h" +#import "ios/web_view/internal/passwords/web_view_password_manager_client.h" +#import "ios/web_view/internal/passwords/web_view_password_manager_driver.h" #import "ios/web_view/internal/translate/cwv_translation_controller_internal.h" #import "ios/web_view/internal/translate/web_view_translate_client.h" #include "ios/web_view/internal/web_view_browser_state.h" @@ -643,8 +646,20 @@ [_webState->GetJSInjectionReceiver() instanceOfClass:[JsSuggestionManager class]]); [JSSuggestionManager setWebFramesManager:_webState->GetWebFramesManager()]; - CWVPasswordController* passwordController = - [[CWVPasswordController alloc] initWithWebState:_webState.get()]; + + auto passwordManagerClient = + ios_web_view::WebViewPasswordManagerClient::Create( + _webState.get(), _configuration.browserState); + auto passwordManager = std::make_unique<password_manager::PasswordManager>( + passwordManagerClient.get()); + auto passwordManagerDriver = + std::make_unique<ios_web_view::WebViewPasswordManagerDriver>(); + CWVPasswordController* passwordController = [[CWVPasswordController alloc] + initWithWebState:_webState.get() + passwordManager:std::move(passwordManager) + passwordManagerClient:std::move(passwordManagerClient) + passwordManagerDriver:std::move(passwordManagerDriver)]; + return [[CWVAutofillController alloc] initWithWebState:_webState.get() autofillAgent:autofillAgent JSAutofillManager:JSAutofillManager
diff --git a/ios/web_view/internal/cwv_web_view_configuration.mm b/ios/web_view/internal/cwv_web_view_configuration.mm index 6ed4db4..23e1f64 100644 --- a/ios/web_view/internal/cwv_web_view_configuration.mm +++ b/ios/web_view/internal/cwv_web_view_configuration.mm
@@ -8,7 +8,6 @@ #include "base/logging.h" #include "base/threading/thread_restrictions.h" -#include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/keyed_service/core/service_access_type.h" #include "components/password_manager/core/browser/password_store_default.h" #include "components/sync/driver/sync_service.h" @@ -25,7 +24,6 @@ #import "ios/web_view/internal/sync/web_view_profile_sync_service_factory.h" #include "ios/web_view/internal/web_view_browser_state.h" #include "ios/web_view/internal/web_view_global_state_util.h" -#include "ios/web_view/internal/webdata_services/web_view_web_data_service_wrapper_factory.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -152,24 +150,11 @@ SigninErrorController* signinErrorController = ios_web_view::WebViewSigninErrorControllerFactory::GetForBrowserState( self.browserState); - autofill::PersonalDataManager* personalDataManager = - ios_web_view::WebViewPersonalDataManagerFactory::GetForBrowserState( - self.browserState); - scoped_refptr<autofill::AutofillWebDataService> autofillWebDataService = - ios_web_view::WebViewWebDataServiceWrapperFactory:: - GetAutofillWebDataForBrowserState( - self.browserState, ServiceAccessType::EXPLICIT_ACCESS); - scoped_refptr<password_manager::PasswordStore> passwordStore = - ios_web_view::WebViewAccountPasswordStoreFactory::GetForBrowserState( - self.browserState, ServiceAccessType::EXPLICIT_ACCESS); - _syncController = [[CWVSyncController alloc] - initWithSyncService:syncService - identityManager:identityManager - signinErrorController:signinErrorController - personalDataManager:personalDataManager - autofillWebDataService:autofillWebDataService.get() - passwordStore:passwordStore.get()]; + _syncController = + [[CWVSyncController alloc] initWithSyncService:syncService + identityManager:identityManager + signinErrorController:signinErrorController]; } return _syncController; }
diff --git a/ios/web_view/internal/passwords/cwv_password_controller.h b/ios/web_view/internal/passwords/cwv_password_controller.h index eb7a9ed..2cce18ac 100644 --- a/ios/web_view/internal/passwords/cwv_password_controller.h +++ b/ios/web_view/internal/passwords/cwv_password_controller.h
@@ -7,6 +7,8 @@ #import <Foundation/Foundation.h> +#include <memory> + NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger, CWVPasswordUserDecision); @@ -14,9 +16,18 @@ @class CWVPasswordController; @class CWVPassword; +namespace ios_web_view { +class WebViewPasswordManagerClient; +class WebViewPasswordManagerDriver; +} // namespace ios_web_view + +namespace password_manager { +class PasswordManager; +} // namespace password_manager + namespace web { class WebState; -} +} // namespace web // Internal protocol to receive callbacks related to password autofilling. @protocol CWVPasswordControllerDelegate @@ -52,7 +63,15 @@ // Creates a new password controller with the given |webState|. - (instancetype)initWithWebState:(web::WebState*)webState - NS_DESIGNATED_INITIALIZER; + passwordManager: + (std::unique_ptr<password_manager::PasswordManager>) + passwordManager + passwordManagerClient: + (std::unique_ptr<ios_web_view::WebViewPasswordManagerClient>) + passwordManagerClient + passwordManagerDriver: + (std::unique_ptr<ios_web_view::WebViewPasswordManagerDriver>) + passwordManagerDriver NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE;
diff --git a/ios/web_view/internal/passwords/cwv_password_controller.mm b/ios/web_view/internal/passwords/cwv_password_controller.mm index 6be21f8..03c3c50 100644 --- a/ios/web_view/internal/passwords/cwv_password_controller.mm +++ b/ios/web_view/internal/passwords/cwv_password_controller.mm
@@ -101,7 +101,16 @@ #pragma mark - Initialization -- (instancetype)initWithWebState:(web::WebState*)webState { +- (instancetype)initWithWebState:(web::WebState*)webState + passwordManager: + (std::unique_ptr<password_manager::PasswordManager>) + passwordManager + passwordManagerClient: + (std::unique_ptr<ios_web_view::WebViewPasswordManagerClient>) + passwordManagerClient + passwordManagerDriver: + (std::unique_ptr<ios_web_view::WebViewPasswordManagerDriver>) + passwordManagerDriver { self = [super init]; if (self) { DCHECK(webState); @@ -113,12 +122,11 @@ [[PasswordFormHelper alloc] initWithWebState:webState delegate:self]; _suggestionHelper = [[PasswordSuggestionHelper alloc] initWithDelegate:self]; - _passwordManagerClient = - std::make_unique<WebViewPasswordManagerClient>(self); - _passwordManager = std::make_unique<password_manager::PasswordManager>( - _passwordManagerClient.get()); - _passwordManagerDriver = - std::make_unique<WebViewPasswordManagerDriver>(self); + _passwordManagerClient = std::move(passwordManagerClient); + _passwordManagerClient->set_delegate(self); + _passwordManager = std::move(passwordManager); + _passwordManagerDriver = std::move(passwordManagerDriver); + _passwordManagerDriver->set_delegate(self); // TODO(crbug.com/865114): Credential manager related logic } @@ -176,16 +184,6 @@ #pragma mark - CWVPasswordManagerClientDelegate -- (ios_web_view::WebViewBrowserState*)browserState { - return _webState ? ios_web_view::WebViewBrowserState::FromBrowserState( - _webState->GetBrowserState()) - : nullptr; -} - -- (web::WebState*)webState { - return _webState; -} - - (password_manager::PasswordManager*)passwordManager { return _passwordManager.get(); }
diff --git a/ios/web_view/internal/passwords/web_view_password_manager_client.h b/ios/web_view/internal/passwords/web_view_password_manager_client.h index dc0356bb..a93bc959 100644 --- a/ios/web_view/internal/passwords/web_view_password_manager_client.h +++ b/ios/web_view/internal/passwords/web_view_password_manager_client.h
@@ -5,31 +5,35 @@ #ifndef IOS_WEB_VIEW_INTERNAL_PASSWORDS_WEB_VIEW_PASSWORD_MANAGER_CLIENT_H_ #define IOS_WEB_VIEW_INTERNAL_PASSWORDS_WEB_VIEW_PASSWORD_MANAGER_CLIENT_H_ +#import <Foundation/Foundation.h> #include <memory> #include "base/macros.h" +#include "components/autofill/core/browser/logging/log_manager.h" #include "components/password_manager/core/browser/password_feature_manager.h" +#include "components/password_manager/core/browser/password_form_manager_for_ui.h" +#include "components/password_manager/core/browser/password_manager.h" #import "components/password_manager/core/browser/password_manager_client.h" #include "components/password_manager/core/browser/password_manager_client_helper.h" +#include "components/password_manager/core/browser/password_manager_driver.h" #include "components/password_manager/core/browser/password_manager_metrics_recorder.h" +#include "components/password_manager/core/browser/password_store.h" #include "components/password_manager/core/browser/sync_credentials_filter.h" #include "components/prefs/pref_member.h" +#include "components/signin/public/identity_manager/identity_manager.h" +#include "components/sync/driver/sync_service.h" +#import "ios/web/public/web_state.h" #include "ios/web_view/internal/passwords/web_view_password_feature_manager.h" +#include "ios/web_view/internal/web_view_browser_state.h" +#include "url/gurl.h" -namespace ios_web_view { -class WebViewBrowserState; -} // namespace ios_web_view +@protocol CWVPasswordManagerClientDelegate <NSObject> -namespace password_manager { -class PasswordFormManagerForUI; -class PasswordManagerDriver; -} // namespace password_manager +@property(readonly, nonatomic) + password_manager::PasswordManager* passwordManager; -namespace web { -class WebState; -} // namespace web - -@protocol CWVPasswordManagerClientDelegate +// Returns the current URL of the main frame. +@property(readonly, nonatomic) const GURL& lastCommittedURL; // Shows UI to prompt the user to save the password. - (void)showSavePasswordInfoBar: @@ -43,14 +47,6 @@ - (void)showAutosigninNotification: (std::unique_ptr<autofill::PasswordForm>)formSignedIn; -@property(readonly, nonatomic) ios_web_view::WebViewBrowserState* browserState; -@property(readonly, nonatomic) web::WebState* webState; - -@property(readonly, nonatomic) - password_manager::PasswordManager* passwordManager; - -@property(readonly, nonatomic) const GURL& lastCommittedURL; - @end namespace ios_web_view { @@ -58,8 +54,19 @@ class WebViewPasswordManagerClient : public password_manager::PasswordManagerClient { public: + // Convenience factory method for creating a WebViewPasswordManagerClient. + static std::unique_ptr<WebViewPasswordManagerClient> Create( + web::WebState* web_state, + WebViewBrowserState* browser_state); + explicit WebViewPasswordManagerClient( - id<CWVPasswordManagerClientDelegate> delegate); + web::WebState* web_state, + syncer::SyncService* sync_service, + PrefService* pref_service, + signin::IdentityManager* identity_manager, + std::unique_ptr<autofill::LogManager> log_manager, + password_manager::PasswordStore* profile_store, + password_manager::PasswordStore* account_store); ~WebViewPasswordManagerClient() override; @@ -117,19 +124,28 @@ bool IsNewTabPage() const override; password_manager::FieldInfoManager* GetFieldInfoManager() const override; + void set_delegate(id<CWVPasswordManagerClientDelegate> delegate) { + delegate_ = delegate; + } + const syncer::SyncService* GetSyncService(); + private: __weak id<CWVPasswordManagerClientDelegate> delegate_; + web::WebState* web_state_; + syncer::SyncService* sync_service_; + PrefService* pref_service_; + signin::IdentityManager* identity_manager_; + std::unique_ptr<autofill::LogManager> log_manager_; + password_manager::PasswordStore* profile_store_; + password_manager::PasswordStore* account_store_; WebViewPasswordFeatureManager password_feature_manager_; + const password_manager::SyncCredentialsFilter credentials_filter_; // The preference associated with // password_manager::prefs::kCredentialsEnableService. BooleanPrefMember saving_passwords_enabled_; - const password_manager::SyncCredentialsFilter credentials_filter_; - - std::unique_ptr<autofill::LogManager> log_manager_; - // Helper for performing logic that is common between // ChromePasswordManagerClient and IOSChromePasswordManagerClient. password_manager::PasswordManagerClientHelper helper_;
diff --git a/ios/web_view/internal/passwords/web_view_password_manager_client.mm b/ios/web_view/internal/passwords/web_view_password_manager_client.mm index 92d5ab7..08d0549 100644 --- a/ios/web_view/internal/passwords/web_view_password_manager_client.mm +++ b/ios/web_view/internal/passwords/web_view_password_manager_client.mm
@@ -8,26 +8,18 @@ #include <utility> #include "components/autofill/core/browser/logging/log_manager.h" -#include "components/autofill/core/browser/logging/log_router.h" #include "components/autofill/core/common/password_form.h" #include "components/keyed_service/core/service_access_type.h" -#include "components/password_manager/core/browser/password_form_manager_for_ui.h" -#include "components/password_manager/core/browser/password_manager.h" -#include "components/password_manager/core/browser/password_manager_driver.h" #include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/password_manager/ios/credential_manager_util.h" -#import "ios/web/public/web_state.h" -#include "ios/web_view/internal/app/application_context.h" #import "ios/web_view/internal/passwords/web_view_account_password_store_factory.h" #import "ios/web_view/internal/passwords/web_view_password_manager_log_router_factory.h" #include "ios/web_view/internal/passwords/web_view_password_store_factory.h" #include "ios/web_view/internal/signin/web_view_identity_manager_factory.h" #import "ios/web_view/internal/sync/web_view_profile_sync_service_factory.h" -#include "ios/web_view/internal/web_view_browser_state.h" #include "net/cert/cert_status_flags.h" #include "services/network/public/cpp/shared_url_loader_factory.h" -#include "url/gurl.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -38,30 +30,54 @@ using password_manager::PasswordStore; using password_manager::SyncState; -namespace { - -const syncer::SyncService* GetSyncService( - ios_web_view::WebViewBrowserState* browser_state) { - return ios_web_view::WebViewProfileSyncServiceFactory::GetForBrowserState( - browser_state); -} - -} // namespace - namespace ios_web_view { +// static +std::unique_ptr<WebViewPasswordManagerClient> +WebViewPasswordManagerClient::Create(web::WebState* web_state, + WebViewBrowserState* browser_state) { + syncer::SyncService* sync_service = + ios_web_view::WebViewProfileSyncServiceFactory::GetForBrowserState( + browser_state); + signin::IdentityManager* identity_manager = + ios_web_view::WebViewIdentityManagerFactory::GetForBrowserState( + browser_state); + autofill::LogRouter* logRouter = + ios_web_view::WebViewPasswordManagerLogRouterFactory::GetForBrowserState( + browser_state); + auto log_manager = + autofill::LogManager::Create(logRouter, base::RepeatingClosure()); + scoped_refptr<password_manager::PasswordStore> profile_store = + ios_web_view::WebViewPasswordStoreFactory::GetForBrowserState( + browser_state, ServiceAccessType::EXPLICIT_ACCESS); + scoped_refptr<password_manager::PasswordStore> account_store = + ios_web_view::WebViewAccountPasswordStoreFactory::GetForBrowserState( + browser_state, ServiceAccessType::EXPLICIT_ACCESS); + return std::make_unique<ios_web_view::WebViewPasswordManagerClient>( + web_state, sync_service, browser_state->GetPrefs(), identity_manager, + std::move(log_manager), profile_store.get(), account_store.get()); +} + WebViewPasswordManagerClient::WebViewPasswordManagerClient( - id<CWVPasswordManagerClientDelegate> delegate) - : delegate_(delegate), - password_feature_manager_(GetPrefs(), - GetSyncService(delegate.browserState)), + web::WebState* web_state, + syncer::SyncService* sync_service, + PrefService* pref_service, + signin::IdentityManager* identity_manager, + std::unique_ptr<autofill::LogManager> log_manager, + PasswordStore* profile_store, + PasswordStore* account_store) + : web_state_(web_state), + sync_service_(sync_service), + pref_service_(pref_service), + identity_manager_(identity_manager), + log_manager_(std::move(log_manager)), + profile_store_(profile_store), + account_store_(account_store), + password_feature_manager_(pref_service, sync_service), credentials_filter_( this, - base::BindRepeating(&GetSyncService, delegate_.browserState)), - log_manager_(autofill::LogManager::Create( - ios_web_view::WebViewPasswordManagerLogRouterFactory:: - GetForBrowserState(delegate_.browserState), - base::RepeatingClosure())), + base::Bind(&WebViewPasswordManagerClient::GetSyncService, + base::Unretained(this))), helper_(this) { saving_passwords_enabled_.Init( password_manager::prefs::kCredentialsEnableService, GetPrefs()); @@ -70,9 +86,7 @@ WebViewPasswordManagerClient::~WebViewPasswordManagerClient() = default; SyncState WebViewPasswordManagerClient::GetPasswordSyncState() const { - const syncer::SyncService* sync_service = - GetSyncService(delegate_.browserState); - return password_manager_util::GetPasswordSyncState(sync_service); + return password_manager_util::GetPasswordSyncState(sync_service_); } bool WebViewPasswordManagerClient::PromptUserToChooseCredentials( @@ -135,7 +149,7 @@ } bool WebViewPasswordManagerClient::IsIncognito() const { - return delegate_.browserState->IsOffTheRecord(); + return web_state_->GetBrowserState()->IsOffTheRecord(); } const password_manager::PasswordManager* @@ -149,23 +163,19 @@ } bool WebViewPasswordManagerClient::IsMainFrameSecure() const { - return password_manager::WebStateContentIsSecureHtml(delegate_.webState); + return password_manager::WebStateContentIsSecureHtml(web_state_); } PrefService* WebViewPasswordManagerClient::GetPrefs() const { - return delegate_.browserState->GetPrefs(); + return pref_service_; } PasswordStore* WebViewPasswordManagerClient::GetProfilePasswordStore() const { - return ios_web_view::WebViewPasswordStoreFactory::GetForBrowserState( - delegate_.browserState, ServiceAccessType::EXPLICIT_ACCESS) - .get(); + return profile_store_; } PasswordStore* WebViewPasswordManagerClient::GetAccountPasswordStore() const { - return ios_web_view::WebViewAccountPasswordStoreFactory::GetForBrowserState( - delegate_.browserState, ServiceAccessType::EXPLICIT_ACCESS) - .get(); + return account_store_; } void WebViewPasswordManagerClient::NotifyUserAutoSignin( @@ -223,13 +233,12 @@ } signin::IdentityManager* WebViewPasswordManagerClient::GetIdentityManager() { - return WebViewIdentityManagerFactory::GetForBrowserState( - delegate_.browserState); + return identity_manager_; } scoped_refptr<network::SharedURLLoaderFactory> WebViewPasswordManagerClient::GetURLLoaderFactory() { - return (delegate_.browserState)->GetSharedURLLoaderFactory(); + return web_state_->GetBrowserState()->GetSharedURLLoaderFactory(); } bool WebViewPasswordManagerClient::IsIsolationForPasswordSitesEnabled() const { @@ -245,4 +254,8 @@ return nullptr; } +const syncer::SyncService* WebViewPasswordManagerClient::GetSyncService() { + return sync_service_; +} + } // namespace ios_web_view
diff --git a/ios/web_view/internal/passwords/web_view_password_manager_client_unittest.mm b/ios/web_view/internal/passwords/web_view_password_manager_client_unittest.mm index e07315c..51d40a4 100644 --- a/ios/web_view/internal/passwords/web_view_password_manager_client_unittest.mm +++ b/ios/web_view/internal/passwords/web_view_password_manager_client_unittest.mm
@@ -6,17 +6,24 @@ #include <memory> +#include "base/memory/scoped_refptr.h" #include "base/test/scoped_feature_list.h" +#include "components/autofill/core/browser/logging/stub_log_manager.h" #include "components/autofill/core/common/password_form.h" #include "components/password_manager/core/browser/mock_password_form_manager_for_ui.h" #include "components/password_manager/core/browser/password_form_manager_for_ui.h" #include "components/password_manager/core/browser/password_manager.h" +#include "components/password_manager/core/browser/password_manager_util.h" +#include "components/password_manager/core/browser/test_password_store.h" #include "components/password_manager/core/common/password_manager_features.h" +#include "components/password_manager/core/common/password_manager_pref_names.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/testing_pref_service.h" +#include "components/signin/public/identity_manager/account_info.h" +#include "components/sync/driver/test_sync_service.h" +#import "ios/web/public/test/fakes/test_web_state.h" #include "ios/web/public/test/scoped_testing_web_client.h" -#include "ios/web/public/test/web_task_environment.h" -#include "ios/web/public/web_client.h" #include "ios/web_view/internal/web_view_browser_state.h" -#include "ios/web_view/test/test_with_locale_and_resources.h" #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #include "testing/platform_test.h" @@ -26,102 +33,89 @@ #error "This file requires ARC support." #endif -@interface CWVTestPasswordManagerClientDelegate - : NSObject <CWVPasswordManagerClientDelegate> -@end - -@implementation CWVTestPasswordManagerClientDelegate { - GURL _emptyURL; - std::unique_ptr<ios_web_view::WebViewBrowserState> _browserState; -} - -- (instancetype)init { - self = [super init]; - if (self) { - _browserState = std::make_unique<ios_web_view::WebViewBrowserState>( - /*off_the_record=*/false); - } - return self; -} - -- (void)showSavePasswordInfoBar: - (std::unique_ptr<password_manager::PasswordFormManagerForUI>)formToSave { -} - -- (void)showUpdatePasswordInfoBar: - (std::unique_ptr<password_manager::PasswordFormManagerForUI>)formToUpdate { -} - -- (void)showAutosigninNotification: - (std::unique_ptr<autofill::PasswordForm>)formSignedIn { -} - -- (ios_web_view::WebViewBrowserState*)browserState { - return _browserState.get(); -} - -- (web::WebState*)webState { - return nullptr; -} - -- (password_manager::PasswordManager*)passwordManager { - return nullptr; -} - -- (const GURL&)lastCommittedURL { - return _emptyURL; -} - -@end - namespace ios_web_view { using testing::_; using testing::Invoke; using testing::Return; -class WebViewPasswordManagerClientTest : public TestWithLocaleAndResources { +class WebViewPasswordManagerClientTest : public PlatformTest { protected: WebViewPasswordManagerClientTest() - : web_client_(std::make_unique<web::WebClient>()) {} - web::ScopedTestingWebClient web_client_; - web::WebTaskEnvironment task_environment_; + : profile_store_( + base::MakeRefCounted<password_manager::TestPasswordStore>()), + account_store_( + base::MakeRefCounted<password_manager::TestPasswordStore>( + /*is_account_store=*/true)) { + scoped_feature.InitAndEnableFeature( + password_manager::features::kEnablePasswordsAccountStorage); + + pref_service_.registry()->RegisterBooleanPref( + password_manager::prefs::kCredentialsEnableService, true); + pref_service_.registry()->RegisterDictionaryPref( + password_manager::prefs::kAccountStoragePerAccountSettings); + + password_manager_client_ = std::make_unique<WebViewPasswordManagerClient>( + &web_state_, &sync_service_, &pref_service_, + /*identity_manager=*/nullptr, + std::make_unique<autofill::StubLogManager>(), profile_store_.get(), + account_store_.get()); + } + + ~WebViewPasswordManagerClientTest() override { + profile_store_->ShutdownOnUIThread(); + account_store_->ShutdownOnUIThread(); + } + + base::test::ScopedFeatureList scoped_feature; + web::TestWebState web_state_; + syncer::TestSyncService sync_service_; + TestingPrefServiceSimple pref_service_; + autofill::StubLogManager log_manager_; + scoped_refptr<password_manager::TestPasswordStore> profile_store_; + scoped_refptr<password_manager::TestPasswordStore> account_store_; + std::unique_ptr<WebViewPasswordManagerClient> password_manager_client_; }; TEST_F(WebViewPasswordManagerClientTest, NoPromptIfBlacklisted) { - CWVTestPasswordManagerClientDelegate* test_delegate = - [[CWVTestPasswordManagerClientDelegate alloc] init]; - WebViewPasswordManagerClient client(test_delegate); auto password_manager_for_ui = std::make_unique<password_manager::MockPasswordFormManagerForUI>(); EXPECT_CALL(*password_manager_for_ui, IsBlacklisted()).WillOnce(Return(true)); - base::test::ScopedFeatureList scoped_feature; - scoped_feature.InitAndEnableFeature( - password_manager::features::kEnablePasswordsAccountStorage); - EXPECT_FALSE(client.PromptUserToSaveOrUpdatePassword( + EXPECT_FALSE(password_manager_client_->PromptUserToSaveOrUpdatePassword( std::move(password_manager_for_ui), /*update_password=*/false)); } TEST_F(WebViewPasswordManagerClientTest, NoPromptIfNotOptedInToAccountStorage) { - CWVTestPasswordManagerClientDelegate* test_delegate = - [[CWVTestPasswordManagerClientDelegate alloc] init]; - WebViewPasswordManagerClient client(test_delegate); auto password_manager_for_ui = std::make_unique<password_manager::MockPasswordFormManagerForUI>(); EXPECT_CALL(*password_manager_for_ui, IsBlacklisted()) .WillOnce(Return(false)); - base::test::ScopedFeatureList scoped_feature; - scoped_feature.InitAndDisableFeature( - password_manager::features::kEnablePasswordsAccountStorage); + CoreAccountInfo account_info; + account_info.gaia = "1337"; + sync_service_.SetAuthenticatedAccountInfo(account_info); - EXPECT_FALSE(client.PromptUserToSaveOrUpdatePassword( + EXPECT_FALSE(password_manager_client_->PromptUserToSaveOrUpdatePassword( std::move(password_manager_for_ui), /*update_password=*/false)); } -// TODO(crbug.com/1069338): Write test that verifies it prompts if all -// conditions passes. +TEST_F(WebViewPasswordManagerClientTest, PromptIfAllConditionsPass) { + auto password_manager_for_ui = + std::make_unique<password_manager::MockPasswordFormManagerForUI>(); + + EXPECT_CALL(*password_manager_for_ui, IsBlacklisted()) + .WillOnce(Return(false)); + + CoreAccountInfo account_info; + account_info.gaia = "1337"; + sync_service_.SetAuthenticatedAccountInfo(account_info); + password_manager_util::SetAccountStorageOptIn(&pref_service_, &sync_service_, + /*opt_in=*/true); + + EXPECT_TRUE(password_manager_client_->PromptUserToSaveOrUpdatePassword( + std::move(password_manager_for_ui), /*update_password=*/false)); +} } // namespace ios_web_view
diff --git a/ios/web_view/internal/passwords/web_view_password_manager_driver.h b/ios/web_view/internal/passwords/web_view_password_manager_driver.h index 8ad2ba30..3df96e10 100644 --- a/ios/web_view/internal/passwords/web_view_password_manager_driver.h +++ b/ios/web_view/internal/passwords/web_view_password_manager_driver.h
@@ -5,34 +5,30 @@ #ifndef IOS_WEB_VIEW_INTERNAL_PASSWORDS_WEB_VIEW_PASSWORD_MANAGER_DRIVER_H_ #define IOS_WEB_VIEW_INTERNAL_PASSWORDS_WEB_VIEW_PASSWORD_MANAGER_DRIVER_H_ +#import <Foundation/Foundation.h> #include <vector> #include "base/macros.h" +#include "components/autofill/core/common/password_form_fill_data.h" +#include "components/password_manager/core/browser/password_manager.h" #include "components/password_manager/core/browser/password_manager_driver.h" -namespace autofill { -struct PasswordFormFillData; -} // namespace autofill - -namespace password_manager { -class PasswordAutofillManager; -class PasswordManager; -} // namespace password_manager - // Defines the interface the driver needs to the controller. -@protocol CWVPasswordManagerDriverDelegate +@protocol CWVPasswordManagerDriverDelegate <NSObject> + +@property(readonly, nonatomic) + password_manager::PasswordManager* passwordManager; // Returns the current URL of the main frame. @property(readonly, nonatomic) const GURL& lastCommittedURL; -- (password_manager::PasswordManager*)passwordManager; - // Finds and fills the password form using the supplied |formData| to // match the password form and to populate the field values. - (void)fillPasswordForm:(const autofill::PasswordFormFillData&)formData; // Informs delegate that there are no saved credentials for the current page. - (void)informNoSavedCredentials; + @end namespace ios_web_view { @@ -40,8 +36,7 @@ class WebViewPasswordManagerDriver : public password_manager::PasswordManagerDriver { public: - explicit WebViewPasswordManagerDriver( - id<CWVPasswordManagerDriverDelegate> delegate); + explicit WebViewPasswordManagerDriver(); ~WebViewPasswordManagerDriver() override; // password_manager::PasswordManagerDriver implementation. @@ -65,6 +60,10 @@ bool CanShowAutofillUi() const override; const GURL& GetLastCommittedURL() const override; + void set_delegate(id<CWVPasswordManagerDriverDelegate> delegate) { + delegate_ = delegate; + } + private: __weak id<CWVPasswordManagerDriverDelegate> delegate_;
diff --git a/ios/web_view/internal/passwords/web_view_password_manager_driver.mm b/ios/web_view/internal/passwords/web_view_password_manager_driver.mm index bd576fa..9854cca 100644 --- a/ios/web_view/internal/passwords/web_view_password_manager_driver.mm +++ b/ios/web_view/internal/passwords/web_view_password_manager_driver.mm
@@ -17,9 +17,8 @@ using password_manager::PasswordManager; namespace ios_web_view { -WebViewPasswordManagerDriver::WebViewPasswordManagerDriver( - id<CWVPasswordManagerDriverDelegate> delegate) - : delegate_(delegate) {} + +WebViewPasswordManagerDriver::WebViewPasswordManagerDriver() {} WebViewPasswordManagerDriver::~WebViewPasswordManagerDriver() = default; @@ -64,7 +63,7 @@ } PasswordManager* WebViewPasswordManagerDriver::GetPasswordManager() { - return [delegate_ passwordManager]; + return delegate_.passwordManager; } PasswordAutofillManager*
diff --git a/ios/web_view/internal/sync/cwv_sync_controller.mm b/ios/web_view/internal/sync/cwv_sync_controller.mm index 69cfedb..3e90d97 100644 --- a/ios/web_view/internal/sync/cwv_sync_controller.mm +++ b/ios/web_view/internal/sync/cwv_sync_controller.mm
@@ -12,9 +12,6 @@ #include "base/callback_helpers.h" #include "base/strings/sys_string_conversions.h" #include "base/time/time.h" -#include "components/autofill/core/browser/personal_data_manager.h" -#include "components/autofill/core/browser/webdata/autofill_webdata_service.h" -#include "components/password_manager/core/browser/password_store_default.h" #include "components/signin/core/browser/signin_error_controller.h" #include "components/signin/public/identity_manager/account_info.h" #include "components/signin/public/identity_manager/device_accounts_synchronizer.h" @@ -120,10 +117,6 @@ signin::IdentityManager* _identityManager; SigninErrorController* _signinErrorController; std::unique_ptr<ios_web_view::WebViewSyncControllerObserverBridge> _observer; - autofill::PersonalDataManager* _personalDataManager; - autofill::AutofillWebDataService* _autofillWebDataService; - password_manager::PasswordStore* _passwordStore; - NSInteger _pendingCleanupTasksCount; } @synthesize currentIdentity = _currentIdentity; @@ -142,22 +135,15 @@ return gSyncDataSource; } -- (instancetype) - initWithSyncService:(syncer::SyncService*)syncService - identityManager:(signin::IdentityManager*)identityManager - signinErrorController:(SigninErrorController*)signinErrorController - personalDataManager:(autofill::PersonalDataManager*)personalDataManager - autofillWebDataService: - (autofill::AutofillWebDataService*)autofillWebDataService - passwordStore:(password_manager::PasswordStore*)passwordStore { +- (instancetype)initWithSyncService:(syncer::SyncService*)syncService + identityManager:(signin::IdentityManager*)identityManager + signinErrorController: + (SigninErrorController*)signinErrorController { self = [super init]; if (self) { _syncService = syncService; _identityManager = identityManager; _signinErrorController = signinErrorController; - _personalDataManager = personalDataManager; - _autofillWebDataService = autofillWebDataService; - _passwordStore = passwordStore; _observer = std::make_unique<ios_web_view::WebViewSyncControllerObserverBridge>( self); @@ -200,20 +186,6 @@ DCHECK(!_currentIdentity) << "Already syncing! Call -stopSyncAndClearIdentity first."; - if (_pendingCleanupTasksCount > 0) { - NSError* error = [NSError - errorWithDomain:CWVSyncErrorDomain - code:CWVSyncErrorCleanupPending - userInfo:@{ - NSLocalizedDescriptionKey : @"Sync is not fully stopped.", - NSLocalizedFailureReasonErrorKey : - @"Clean up tasks are still running.", - NSLocalizedRecoverySuggestionErrorKey : @"Try again later." - }]; - [self invokeDelegateDidFailWithError:error]; - return; - } - _currentIdentity = identity; const CoreAccountId accountId = _identityManager->PickAccountIdForAccount( @@ -226,44 +198,14 @@ _identityManager->GetPrimaryAccountMutator()->SetPrimaryAccount(accountId); CHECK_EQ(_identityManager->GetPrimaryAccountId(), accountId); - - _syncService->GetUserSettings()->SetSyncRequested(true); - _syncService->GetUserSettings()->SetFirstSetupComplete( - syncer::SyncFirstSetupCompleteSource::BASIC_FLOW); } - (void)stopSyncAndClearIdentity { - _syncService->StopAndClear(); - auto* primaryAccountMutator = _identityManager->GetPrimaryAccountMutator(); primaryAccountMutator->ClearPrimaryAccount( signin::PrimaryAccountMutator::ClearAccountsAction::kDefault, signin_metrics::ProfileSignout::USER_CLICKED_SIGNOUT_SETTINGS, signin_metrics::SignoutDelete::IGNORE_METRIC); - - if (_pendingCleanupTasksCount > 0) { - // Already stopping - return; - } - - // Remove all remaining autofill data. We do this because we don't support - // data migration between accounts. - - // Clean up address and credit card data. - _personalDataManager->ClearAllLocalData(); - // Clearing server data would usually result in data being deleted from the - // user's data on sync servers, but because this is called after the user has - // been logged out, this merely clears the left over, local copies. - _personalDataManager->ClearAllServerData(); - // Post an empty task with a callback which is guaranteed to be completed - // after the above tasks. - _autofillWebDataService->GetDBTaskRunner()->PostTaskAndReply( - FROM_HERE, base::DoNothing(), [self pendingCleanupTaskCallback]); - - // Clean up password data. - _passwordStore->RemoveLoginsCreatedBetween( - base::Time::Min(), base::Time::Max(), - AdaptCallbackForRepeating([self pendingCleanupTaskCallback])); } - (BOOL)unlockWithPassphrase:(NSString*)passphrase { @@ -297,30 +239,11 @@ _signinErrorController->RemoveObserver(_observer.get()); } -// Create and return a callback that is used to notify when a clean up task -// completes. -- (base::OnceClosure)pendingCleanupTaskCallback { - _pendingCleanupTasksCount++; - __weak CWVSyncController* weakSelf = self; - return base::BindOnce(^{ - CWVSyncController* strongSelf = weakSelf; - if (!strongSelf) { - return; - } - [strongSelf handlePendingTaskCallback]; - }); -} - -- (void)handlePendingTaskCallback { - _pendingCleanupTasksCount--; - if (_pendingCleanupTasksCount == 0 && - [_delegate respondsToSelector:@selector(syncControllerDidStopSync:)]) { - [_delegate syncControllerDidStopSync:self]; - } -} - - (void)didClearPrimaryAccount { _currentIdentity = nil; + if ([_delegate respondsToSelector:@selector(syncControllerDidStopSync:)]) { + [_delegate syncControllerDidStopSync:self]; + } } - (void)didUpdateAuthError {
diff --git a/ios/web_view/internal/sync/cwv_sync_controller_internal.h b/ios/web_view/internal/sync/cwv_sync_controller_internal.h index c7c8b536..fd1da81 100644 --- a/ios/web_view/internal/sync/cwv_sync_controller_internal.h +++ b/ios/web_view/internal/sync/cwv_sync_controller_internal.h
@@ -9,11 +9,6 @@ NS_ASSUME_NONNULL_BEGIN -namespace autofill { -class AutofillWebDataService; -class PersonalDataManager; -} // autofill - namespace syncer { class SyncService; } // namespace syncer @@ -22,10 +17,6 @@ class IdentityManager; } // namespace signin -namespace password_manager { -class PasswordStore; -} // password_manager - class SigninErrorController; @interface CWVSyncController () @@ -35,10 +26,6 @@ initWithSyncService:(syncer::SyncService*)syncService identityManager:(signin::IdentityManager*)identityManager signinErrorController:(SigninErrorController*)signinErrorController - personalDataManager:(autofill::PersonalDataManager*)personalDataManager - autofillWebDataService: - (autofill::AutofillWebDataService*)autofillWebDataService - passwordStore:(password_manager::PasswordStore*)passwordStore NS_DESIGNATED_INITIALIZER; // Called by the associated CWVWebViewConfiguration in order to shut
diff --git a/ios/web_view/internal/sync/cwv_sync_controller_unittest.mm b/ios/web_view/internal/sync/cwv_sync_controller_unittest.mm index 3143b04..fe0eeac 100644 --- a/ios/web_view/internal/sync/cwv_sync_controller_unittest.mm +++ b/ios/web_view/internal/sync/cwv_sync_controller_unittest.mm
@@ -12,9 +12,6 @@ #include "base/files/file_path.h" #include "base/test/bind_test_util.h" #import "base/test/ios/wait_util.h" -#include "components/autofill/core/browser/test_personal_data_manager.h" -#include "components/autofill/core/browser/webdata/autofill_webdata_service.h" -#include "components/password_manager/core/browser/mock_password_store.h" #include "components/signin/core/browser/signin_error_controller.h" #include "components/signin/public/base/account_consistency_method.h" #include "components/signin/public/base/signin_pref_names.h" @@ -90,26 +87,13 @@ EXPECT_CALL(*mock_sync_service(), AddObserver(_)) .WillOnce(Invoke(this, &CWVSyncControllerTest::AddObserver)); - personal_data_manager_ = - std::make_unique<autofill::TestPersonalDataManager>(); - autofill_web_data_service_ = new autofill::AutofillWebDataService( - base::ThreadTaskRunnerHandle::Get(), - base::ThreadTaskRunnerHandle::Get()); - - password_store_ = new password_manager::MockPasswordStore; - password_store_->Init(nullptr); - sync_controller_ = [[CWVSyncController alloc] - initWithSyncService:mock_sync_service() - identityManager:identity_manager() - signinErrorController:signin_error_controller() - personalDataManager:personal_data_manager_.get() - autofillWebDataService:autofill_web_data_service_ - passwordStore:password_store_.get()]; + initWithSyncService:mock_sync_service() + identityManager:identity_manager() + signinErrorController:signin_error_controller()]; } ~CWVSyncControllerTest() override { - password_store_->ShutdownOnUIThread(); EXPECT_CALL(*mock_sync_service(), RemoveObserver(_)); EXPECT_CALL(*mock_sync_service(), Shutdown()); } @@ -135,9 +119,6 @@ web::WebTaskEnvironment task_environment_; web::ScopedTestingWebClient web_client_; ios_web_view::WebViewBrowserState browser_state_; - scoped_refptr<password_manager::MockPasswordStore> password_store_; - std::unique_ptr<autofill::TestPersonalDataManager> personal_data_manager_; - autofill::AutofillWebDataService* autofill_web_data_service_; CWVSyncController* sync_controller_ = nil; syncer::SyncServiceObserver* sync_service_observer_ = nullptr; }; @@ -202,16 +183,8 @@ auth_error); [[delegate expect] syncControllerDidStopSync:sync_controller_]; - EXPECT_CALL(*mock_sync_service(), StopAndClear()); - EXPECT_CALL(*password_store_, RemoveLoginsCreatedBetweenImpl); - EXPECT_CALL(*password_store_, BeginTransaction); - EXPECT_CALL(*password_store_, NotifyLoginsChanged); - EXPECT_CALL(*password_store_, CommitTransaction); [sync_controller_ stopSyncAndClearIdentity]; - // Ensures that |password_store_| has a chance to run its deletion task. - base::RunLoop().RunUntilIdle(); - [delegate verify]; } } @@ -231,16 +204,8 @@ EXPECT_NSEQ(identity.fullName, currentIdentity.fullName); EXPECT_NSEQ(identity.gaiaID, currentIdentity.gaiaID); - EXPECT_CALL(*mock_sync_service(), StopAndClear()); - EXPECT_CALL(*password_store_, RemoveLoginsCreatedBetweenImpl); - EXPECT_CALL(*password_store_, BeginTransaction); - EXPECT_CALL(*password_store_, NotifyLoginsChanged); - EXPECT_CALL(*password_store_, CommitTransaction); [sync_controller_ stopSyncAndClearIdentity]; - // Ensures that |password_store_| has a chance to run its deletion task. - base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(sync_controller_.currentIdentity); }
diff --git a/ios/web_view/internal/web_view_web_main_parts.mm b/ios/web_view/internal/web_view_web_main_parts.mm index 4a25fbf..94ab5a6c 100644 --- a/ios/web_view/internal/web_view_web_main_parts.mm +++ b/ios/web_view/internal/web_view_web_main_parts.mm
@@ -13,6 +13,7 @@ #include "components/autofill/core/common/autofill_payments_features.h" #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/password_manager/core/common/password_manager_features.h" +#include "components/sync/driver/sync_driver_switches.h" #include "ios/web/public/webui/web_ui_ios_controller_factory.h" #include "ios/web_view/internal/app/application_context.h" #import "ios/web_view/internal/cwv_flags_internal.h" @@ -53,10 +54,14 @@ std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); std::string enable_features = base::JoinString( - {autofill::features::kAutofillUpstream.name, - autofill::features::kAutofillNoLocalSaveOnUploadSuccess.name, - autofill::features::kAutofillNoLocalSaveOnUnmaskSuccess.name, - password_manager::features::kEnablePasswordsAccountStorage.name}, + { + autofill::features::kAutofillUpstream.name, + autofill::features::kAutofillNoLocalSaveOnUploadSuccess.name, + autofill::features::kAutofillNoLocalSaveOnUnmaskSuccess.name, + autofill::features::kAutofillEnableAccountWalletStorage.name, + password_manager::features::kEnablePasswordsAccountStorage.name, + switches::kSyncDeviceInfoInTransportMode.name, + }, ","); std::string disabled_features = base::JoinString({}, ","); feature_list->InitializeFromCommandLine(
diff --git a/ios/web_view/public/cwv_sync_controller.h b/ios/web_view/public/cwv_sync_controller.h index 934bde5..fe452fd 100644 --- a/ios/web_view/public/cwv_sync_controller.h +++ b/ios/web_view/public/cwv_sync_controller.h
@@ -39,8 +39,6 @@ // Indicates the service responded to a request, but we cannot // interpret the response. CWVSyncErrorUnexpectedServiceResponse = -600, - // Sync is not fully stopped yet. - CWVSyncErrorCleanupPending = -700, }; // Used to manage syncing for autofill and password data. Usage:
diff --git a/media/gpu/v4l2/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2/v4l2_video_decode_accelerator.cc index 00ee637..72f7b10f 100644 --- a/media/gpu/v4l2/v4l2_video_decode_accelerator.cc +++ b/media/gpu/v4l2/v4l2_video_decode_accelerator.cc
@@ -419,8 +419,6 @@ for (auto&& buffer : v4l2_buffers) { const int i = buffer.BufferId(); - DCHECK(buffers[i].size() == egl_image_size_); - OutputRecord& output_record = output_buffer_map_[i]; DCHECK_EQ(output_record.egl_image, EGL_NO_IMAGE_KHR); DCHECK_EQ(output_record.picture_id, -1);
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc index 3db44ab..42f03386 100644 --- a/pdf/out_of_process_instance.cc +++ b/pdf/out_of_process_instance.cc
@@ -922,8 +922,7 @@ } void OutOfProcessInstance::DidChangeFocus(bool has_focus) { - if (!has_focus) - engine_->KillFormFocus(); + engine_->UpdateFocus(has_focus); } void OutOfProcessInstance::GetPrintPresetOptionsFromDocument(
diff --git a/pdf/pdf_engine.h b/pdf/pdf_engine.h index f28e703b..514e82ea 100644 --- a/pdf/pdf_engine.h +++ b/pdf/pdf_engine.h
@@ -452,6 +452,9 @@ // Remove focus from form widgets, consolidating the user input. virtual void KillFormFocus() = 0; + // Notify whether the PDF currently has the focus or not. + virtual void UpdateFocus(bool has_focus) = 0; + virtual uint32_t GetLoadedByteSize() = 0; virtual bool ReadLoadedBytes(uint32_t length, void* buffer) = 0; };
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index 9566f8a7..3c785e3b 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc
@@ -347,6 +347,13 @@ } } +PDFiumEngine::SetSelectedTextFunction g_set_selected_text_func_for_testing = + nullptr; + +void SetSelectedText(pp::Instance* instance, const std::string& selected_text) { + pp::PDF::SetSelectedText(instance, selected_text.c_str()); +} + } // namespace void InitializeSDK(bool enable_v8) { @@ -426,6 +433,12 @@ doc_loader_set_for_testing_ = true; } +// static +void PDFiumEngine::OverrideSetSelectedTextFunctionForTesting( + SetSelectedTextFunction function) { + g_set_selected_text_func_for_testing = function; +} + bool PDFiumEngine::New(const char* url, const char* headers) { url_ = url; if (headers) @@ -915,6 +928,40 @@ SetInFormTextArea(false); } +void PDFiumEngine::UpdateFocus(bool has_focus) { + if (has_focus) { + focus_item_type_ = last_focused_item_type_; + if (focus_item_type_ == FocusElementType::kPage && + PageIndexInBounds(last_focused_page_) && + last_focused_annot_index_ != -1) { + ScopedFPDFAnnotation last_focused_annot(FPDFPage_GetAnnot( + pages_[last_focused_page_]->GetPage(), last_focused_annot_index_)); + if (last_focused_annot) { + FPDF_BOOL ret = FORM_SetFocusedAnnot(form(), last_focused_annot.get()); + DCHECK(ret); + } + } + } else { + last_focused_item_type_ = focus_item_type_; + if (focus_item_type_ == FocusElementType::kDocument) { + focus_item_type_ = FocusElementType::kNone; + } else if (focus_item_type_ == FocusElementType::kPage) { + FPDF_ANNOTATION last_focused_annot = nullptr; + FPDF_BOOL ret = FORM_GetFocusedAnnot(form(), &last_focused_page_, + &last_focused_annot); + DCHECK(ret); + if (PageIndexInBounds(last_focused_page_) && last_focused_annot) { + last_focused_annot_index_ = FPDFPage_GetAnnotIndex( + pages_[last_focused_page_]->GetPage(), last_focused_annot); + } else { + last_focused_annot_index_ = -1; + } + FPDFPage_CloseAnnot(last_focused_annot); + } + KillFormFocus(); + } +} + uint32_t PDFiumEngine::GetLoadedByteSize() { return doc_loader_->GetDocumentSize(); } @@ -3507,8 +3554,13 @@ // Clearing needs to be done before changing focus to ensure the correct // observer is notified of the change in selection. When |in_form_text_area_| // is true, this is the Renderer. After it flips, the MimeHandler is notified. - if (in_form_text_area_) - pp::PDF::SetSelectedText(GetPluginInstance(), ""); + if (in_form_text_area_) { + SetSelectedTextFunction set_selected_text_func = + g_set_selected_text_func_for_testing + ? g_set_selected_text_func_for_testing + : &SetSelectedText; + set_selected_text_func(GetPluginInstance(), ""); + } client_->FormTextFieldFocusChange(in_form_text_area); in_form_text_area_ = in_form_text_area;
diff --git a/pdf/pdfium/pdfium_engine.h b/pdf/pdfium/pdfium_engine.h index f1b8d32..593a51d31 100644 --- a/pdf/pdfium/pdfium_engine.h +++ b/pdf/pdfium/pdfium_engine.h
@@ -60,6 +60,11 @@ // HandleDocumentLoad(). void SetDocumentLoaderForTesting(std::unique_ptr<DocumentLoader> loader); + using SetSelectedTextFunction = void (*)(pp::Instance* instance, + const std::string& selected_text); + static void OverrideSetSelectedTextFunctionForTesting( + SetSelectedTextFunction function); + // PDFEngine implementation. bool New(const char* url, const char* headers) override; void PageOffsetUpdated(const pp::Point& page_offset) override; @@ -150,6 +155,7 @@ void OnDocumentComplete() override; void OnDocumentCanceled() override; void KillFormFocus() override; + void UpdateFocus(bool has_focus) override; uint32_t GetLoadedByteSize() override; bool ReadLoadedBytes(uint32_t length, void* buffer) override; #if defined(PDF_ENABLE_XFA) @@ -699,6 +705,12 @@ // The focus item type for the currently focused object. FocusElementType focus_item_type_ = FocusElementType::kNone; + // Stores the last focused object's focus item type before PDF loses focus. + FocusElementType last_focused_item_type_ = FocusElementType::kNone; + + // Stores the last focused annotation's index before PDF loses focus. + int last_focused_annot_index_ = -1; + // Holds the zero-based page index of the last page that had the focused // object. int last_focused_page_ = -1;
diff --git a/pdf/pdfium/pdfium_engine_unittest.cc b/pdf/pdfium/pdfium_engine_unittest.cc index 2294113..7c0d3577 100644 --- a/pdf/pdfium/pdfium_engine_unittest.cc +++ b/pdf/pdfium/pdfium_engine_unittest.cc
@@ -244,6 +244,15 @@ return engine->last_focused_page_; } + PDFiumEngine::FocusElementType GetLastFocusedElementType( + PDFiumEngine* engine) { + return engine->last_focused_item_type_; + } + + int GetLastFocusedAnnotationIndex(PDFiumEngine* engine) { + return engine->last_focused_annot_index_; + } + protected: base::test::TaskEnvironment task_environment_{ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; @@ -423,4 +432,88 @@ GetFocusedElementType(engine.get())); } +TEST_F(PDFiumEngineTabbingTest, RestoringDocumentFocusTest) { + /* + * Document structure + * Document + * ++ Page 1 + * ++++ Annotation + * ++++ Annotation + * ++ Page 2 + * ++++ Annotation + */ + TestClient client; + std::unique_ptr<PDFiumEngine> engine = InitializeEngine( + &client, FILE_PATH_LITERAL("annotation_form_fields.pdf")); + ASSERT_TRUE(engine); + + ASSERT_EQ(2, engine->GetNumberOfPages()); + + EXPECT_EQ(PDFiumEngine::FocusElementType::kNone, + GetFocusedElementType(engine.get())); + EXPECT_EQ(-1, GetLastFocusedPage(engine.get())); + + // Tabbing to bring the document into focus. + ASSERT_TRUE(HandleTabEvent(engine.get(), 0)); + EXPECT_EQ(PDFiumEngine::FocusElementType::kDocument, + GetFocusedElementType(engine.get())); + + engine->UpdateFocus(/*has_focus=*/false); + EXPECT_EQ(PDFiumEngine::FocusElementType::kNone, + GetFocusedElementType(engine.get())); + EXPECT_EQ(PDFiumEngine::FocusElementType::kDocument, + GetLastFocusedElementType(engine.get())); + EXPECT_EQ(-1, GetLastFocusedAnnotationIndex(engine.get())); + + engine->UpdateFocus(/*has_focus=*/true); + EXPECT_EQ(PDFiumEngine::FocusElementType::kDocument, + GetFocusedElementType(engine.get())); +} + +TEST_F(PDFiumEngineTabbingTest, RestoringAnnotFocusTest) { + /* + * Document structure + * Document + * ++ Page 1 + * ++++ Annotation + * ++++ Annotation + * ++ Page 2 + * ++++ Annotation + */ + TestClient client; + std::unique_ptr<PDFiumEngine> engine = InitializeEngine( + &client, FILE_PATH_LITERAL("annotation_form_fields.pdf")); + ASSERT_TRUE(engine); + + ASSERT_EQ(2, engine->GetNumberOfPages()); + + EXPECT_EQ(PDFiumEngine::FocusElementType::kNone, + GetFocusedElementType(engine.get())); + EXPECT_EQ(-1, GetLastFocusedPage(engine.get())); + + // Tabbing to bring last annotation of page 0 into focus. + ASSERT_TRUE(HandleTabEvent(engine.get(), 0)); + ASSERT_TRUE(HandleTabEvent(engine.get(), 0)); + ASSERT_TRUE(HandleTabEvent(engine.get(), 0)); + + engine->UpdateFocus(/*has_focus=*/false); + EXPECT_EQ(PDFiumEngine::FocusElementType::kPage, + GetLastFocusedElementType(engine.get())); + EXPECT_EQ(0, GetLastFocusedPage(engine.get())); + EXPECT_EQ(PDFiumEngine::FocusElementType::kPage, + GetFocusedElementType(engine.get())); + EXPECT_EQ(0, GetLastFocusedAnnotationIndex(engine.get())); + + engine->UpdateFocus(/*has_focus=*/true); + EXPECT_EQ(PDFiumEngine::FocusElementType::kPage, + GetFocusedElementType(engine.get())); + EXPECT_EQ(0, GetLastFocusedPage(engine.get())); + + // Tabbing now should bring the second page's annotation to focus. + ASSERT_TRUE(HandleTabEvent(engine.get(), 0)); + EXPECT_EQ(PDFiumEngine::FocusElementType::kPage, + GetFocusedElementType(engine.get())); + EXPECT_EQ(1, GetLastFocusedPage(engine.get())); +} + } // namespace chrome_pdf
diff --git a/pdf/pdfium/pdfium_test_base.cc b/pdf/pdfium/pdfium_test_base.cc index 827f6f9..679ba41 100644 --- a/pdf/pdfium/pdfium_test_base.cc +++ b/pdf/pdfium/pdfium_test_base.cc
@@ -5,6 +5,7 @@ #include "pdf/pdfium/pdfium_test_base.h" #include <memory> +#include <string> #include <utility> #include "build/build_config.h" @@ -24,6 +25,9 @@ return !url.empty(); } +void SetSelectedTextForTesting(pp::Instance* instance, + const std::string& selected_text) {} + } // namespace PDFiumTestBase::PDFiumTestBase() = default; @@ -41,11 +45,14 @@ void PDFiumTestBase::SetUp() { InitializePDFium(); + PDFiumEngine::OverrideSetSelectedTextFunctionForTesting( + &SetSelectedTextForTesting); PDFiumPage::SetIsValidLinkFunctionForTesting(&IsValidLinkForTesting); } void PDFiumTestBase::TearDown() { PDFiumPage::SetIsValidLinkFunctionForTesting(nullptr); + PDFiumEngine::OverrideSetSelectedTextFunctionForTesting(nullptr); FPDF_DestroyLibrary(); }
diff --git a/printing/print_job_constants.h b/printing/print_job_constants.h index b05aa93f..d86e2df 100644 --- a/printing/print_job_constants.h +++ b/printing/print_job_constants.h
@@ -176,13 +176,7 @@ // Must match print_preview.PrinterType in // chrome/browser/resources/print_preview/data/destination_match.js -enum PrinterType { - kPrivetPrinter, - kExtensionPrinter, - kPdfPrinter, - kLocalPrinter, - kCloudPrinter -}; +enum class PrinterType { kPrivet, kExtension, kPdf, kLocal, kCloud }; } // namespace printing
diff --git a/printing/printing_context.cc b/printing/printing_context.cc index 7394019..cd9880f 100644 --- a/printing/printing_context.cc +++ b/printing/printing_context.cc
@@ -81,7 +81,8 @@ pdf_settings.SetIntKey(kSettingDuplexMode, printing::SIMPLEX); pdf_settings.SetBoolKey(kSettingLandscape, false); pdf_settings.SetStringKey(kSettingDeviceName, ""); - pdf_settings.SetIntKey(kSettingPrinterType, kPdfPrinter); + pdf_settings.SetIntKey(kSettingPrinterType, + static_cast<int>(PrinterType::kPdf)); pdf_settings.SetIntKey(kSettingScaleFactor, 100); pdf_settings.SetBoolKey(kSettingRasterizePdf, false); pdf_settings.SetIntKey(kSettingPagesPerSheet, 1); @@ -99,14 +100,15 @@ PrinterType printer_type = static_cast<PrinterType>( job_settings.FindIntKey(kSettingPrinterType).value()); - bool print_with_privet = printer_type == kPrivetPrinter; + bool print_with_privet = printer_type == PrinterType::kPrivet; bool print_to_cloud = !!job_settings.FindKey(kSettingCloudPrintId); bool open_in_external_preview = !!job_settings.FindKey(kSettingOpenPDFInPreview); - if (!open_in_external_preview && - (print_to_cloud || print_with_privet || printer_type == kPdfPrinter || - printer_type == kCloudPrinter || printer_type == kExtensionPrinter)) { + if (!open_in_external_preview && (print_to_cloud || print_with_privet || + printer_type == PrinterType::kPdf || + printer_type == PrinterType::kCloud || + printer_type == PrinterType::kExtension)) { settings_->set_dpi(kDefaultPdfDpi); gfx::Size paper_size(GetPdfPaperSizeDeviceUnits()); if (!settings_->requested_media().size_microns.IsEmpty()) {
diff --git a/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java b/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java index 9cd3668..c5a5a35 100644 --- a/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java +++ b/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java
@@ -100,11 +100,6 @@ private NfcClient mClient; /** - * Watcher id that is incremented for each #watch call. - */ - private int mWatcherId; - - /** * Map of watchId <-> NdefScanOptions. All NdefScanOptions are matched against tag that is in * proximity, when match algorithm (@see #matchesWatchOptions) returns true, watcher with * corresponding ID would be notified using NfcClient interface. @@ -245,6 +240,7 @@ * @see NfcClient#onWatch(int[] id, String serial_number, NdefMessage message) * * @param options used to filter NdefMessages, @see NdefScanOptions. + * @param id request ID from Blink which will be the watch ID if succeeded. * @param callback that is used to notify caller when watch() is completed. */ @Override
diff --git a/services/device/wake_lock/wake_lock.cc b/services/device/wake_lock/wake_lock.cc index f54a7726..96ec41c4 100644 --- a/services/device/wake_lock/wake_lock.cc +++ b/services/device/wake_lock/wake_lock.cc
@@ -36,7 +36,9 @@ &WakeLock::OnConnectionError, base::Unretained(this))); } -WakeLock::~WakeLock() {} +WakeLock::~WakeLock() { + LOG(INFO) << "Destroying WakeLock (browser side)."; +} void WakeLock::AddClient(mojo::PendingReceiver<mojom::WakeLock> receiver) { DCHECK(main_task_runner_->RunsTasksInCurrentSequence());
diff --git a/testing/buildbot/chromium.ci.json b/testing/buildbot/chromium.ci.json index c46dd09..6faa1a7 100644 --- a/testing/buildbot/chromium.ci.json +++ b/testing/buildbot/chromium.ci.json
@@ -19786,6 +19786,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-19.0.2", + "os": "Ubuntu-19.04", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -19806,8 +19829,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -19831,32 +19854,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-19.0.2", - "os": "Ubuntu-19.04", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -19881,8 +19880,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -19907,8 +19906,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -19932,8 +19931,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -19957,8 +19956,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20069,6 +20068,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-418.56", + "os": "Ubuntu-19.04", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -20089,8 +20111,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20114,32 +20136,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-418.56", - "os": "Ubuntu-19.04", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20164,8 +20162,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20190,8 +20188,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20215,8 +20213,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20240,8 +20238,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20352,6 +20350,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-19.0.2", + "os": "Ubuntu-19.04", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -20372,8 +20393,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20397,32 +20418,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-19.0.2", - "os": "Ubuntu-19.04", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20447,8 +20444,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20473,8 +20470,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20498,8 +20495,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20523,8 +20520,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -20562,6 +20559,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-418.56", + "os": "Ubuntu-19.04", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -20582,8 +20602,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20607,32 +20627,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-418.56", - "os": "Ubuntu-19.04", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20657,8 +20653,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20683,8 +20679,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20708,8 +20704,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20733,8 +20729,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -20774,6 +20770,30 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "hidpi": "1", + "os": "Mac-10.14.6", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -20795,8 +20815,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20821,33 +20841,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6821", - "hidpi": "1", - "os": "Mac-10.14.6", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20873,8 +20868,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20900,8 +20895,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20926,8 +20921,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -20952,8 +20947,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21066,6 +21061,28 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14.6" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -21085,8 +21102,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21109,31 +21126,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a2e", - "os": "Mac-10.14.6" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21157,8 +21151,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21182,8 +21176,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21206,8 +21200,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21230,8 +21224,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21336,6 +21330,30 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "hidpi": "1", + "os": "Mac-10.14.6", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -21357,8 +21375,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21383,33 +21401,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6821", - "hidpi": "1", - "os": "Mac-10.14.6", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21435,8 +21428,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21462,8 +21455,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21488,8 +21481,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21514,8 +21507,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -21554,6 +21547,28 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14.6" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -21573,8 +21588,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21597,31 +21612,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a2e", - "os": "Mac-10.14.6" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21645,8 +21637,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21670,8 +21662,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21694,8 +21686,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21718,8 +21710,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -21758,6 +21750,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-24.20.100.6286", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -21778,8 +21793,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21803,32 +21818,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-24.20.100.6286", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21853,8 +21844,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21879,8 +21870,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21904,8 +21895,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -21929,8 +21920,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22040,6 +22031,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-26.21.14.3102", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -22060,8 +22074,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22085,32 +22099,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-26.21.14.3102", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22135,8 +22125,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22161,8 +22151,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22186,8 +22176,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22211,8 +22201,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22322,6 +22312,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-24.20.100.6286", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -22342,8 +22355,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22367,32 +22380,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-24.20.100.6286", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22417,8 +22406,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22443,8 +22432,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22468,8 +22457,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22493,8 +22482,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -22532,6 +22521,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-26.21.14.3102", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -22552,8 +22564,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22577,32 +22589,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-26.21.14.3102", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22627,8 +22615,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22653,8 +22641,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22678,8 +22666,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22703,8 +22691,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -22744,6 +22732,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-24.20.100.6286", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -22764,8 +22775,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22789,32 +22800,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-24.20.100.6286", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22839,8 +22826,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22865,8 +22852,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22890,8 +22877,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -22915,8 +22902,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23025,6 +23012,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-26.21.14.3102", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -23045,8 +23055,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23070,32 +23080,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-26.21.14.3102", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23120,8 +23106,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23146,8 +23132,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23171,8 +23157,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23196,8 +23182,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23306,6 +23292,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-24.20.100.6286", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -23326,8 +23335,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23351,32 +23360,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-24.20.100.6286", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23401,8 +23386,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23427,8 +23412,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23452,8 +23437,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23477,8 +23462,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -23516,6 +23501,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-26.21.14.3102", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -23536,8 +23544,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23561,32 +23569,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-26.21.14.3102", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23611,8 +23595,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23637,8 +23621,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23662,8 +23646,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -23687,8 +23671,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [
diff --git a/testing/buildbot/chromium.dawn.json b/testing/buildbot/chromium.dawn.json index 11da6fd8..5756518 100644 --- a/testing/buildbot/chromium.dawn.json +++ b/testing/buildbot/chromium.dawn.json
@@ -8,6 +8,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-19.0.2", + "os": "Ubuntu-19.04", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -28,8 +51,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -53,32 +76,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-19.0.2", - "os": "Ubuntu-19.04", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -103,8 +102,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -129,8 +128,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -154,8 +153,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -179,8 +178,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -291,6 +290,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-418.56", + "os": "Ubuntu-19.04", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -311,8 +333,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -336,32 +358,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-418.56", - "os": "Ubuntu-19.04", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -386,8 +384,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -412,8 +410,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -437,8 +435,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -462,8 +460,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -574,6 +572,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-19.0.2", + "os": "Ubuntu-19.04", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -594,8 +615,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -619,32 +640,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-19.0.2", - "os": "Ubuntu-19.04", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -669,8 +666,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -695,8 +692,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -720,8 +717,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -745,8 +742,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -784,6 +781,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-418.56", + "os": "Ubuntu-19.04", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -804,8 +824,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -829,32 +849,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-418.56", - "os": "Ubuntu-19.04", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -879,8 +875,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -905,8 +901,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -930,8 +926,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -955,8 +951,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -996,6 +992,30 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "hidpi": "1", + "os": "Mac-10.14.6", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -1017,8 +1037,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1043,33 +1063,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6821", - "hidpi": "1", - "os": "Mac-10.14.6", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1095,8 +1090,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1122,8 +1117,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1148,8 +1143,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1174,8 +1169,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1288,6 +1283,28 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14.6" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -1307,8 +1324,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1331,31 +1348,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a2e", - "os": "Mac-10.14.6" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1379,8 +1373,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1404,8 +1398,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1428,8 +1422,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1452,8 +1446,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1558,6 +1552,30 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "hidpi": "1", + "os": "Mac-10.14.6", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -1579,8 +1597,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1605,33 +1623,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6821", - "hidpi": "1", - "os": "Mac-10.14.6", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1657,8 +1650,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1684,8 +1677,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1710,8 +1703,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1736,8 +1729,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -1776,6 +1769,28 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14.6" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -1795,8 +1810,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1819,31 +1834,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a2e", - "os": "Mac-10.14.6" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1867,8 +1859,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1892,8 +1884,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1916,8 +1908,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -1940,8 +1932,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -1980,6 +1972,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-24.20.100.6286", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -2000,8 +2015,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2025,32 +2040,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-24.20.100.6286", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2075,8 +2066,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2101,8 +2092,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2126,8 +2117,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2151,8 +2142,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2262,6 +2253,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-26.21.14.3102", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -2282,8 +2296,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2307,32 +2321,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-26.21.14.3102", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2357,8 +2347,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2383,8 +2373,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2408,8 +2398,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2433,8 +2423,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2544,6 +2534,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-24.20.100.6286", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -2564,8 +2577,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2589,32 +2602,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-24.20.100.6286", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2639,8 +2628,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2665,8 +2654,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2690,8 +2679,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2715,8 +2704,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -2754,6 +2743,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-26.21.14.3102", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -2774,8 +2786,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2799,32 +2811,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-26.21.14.3102", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2849,8 +2837,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2875,8 +2863,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2900,8 +2888,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -2925,8 +2913,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -2966,6 +2954,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-24.20.100.6286", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -2986,8 +2997,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3011,32 +3022,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-24.20.100.6286", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3061,8 +3048,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3087,8 +3074,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3112,8 +3099,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3137,8 +3124,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3247,6 +3234,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-26.21.14.3102", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -3267,8 +3277,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3292,32 +3302,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-26.21.14.3102", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3342,8 +3328,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3368,8 +3354,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3393,8 +3379,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3418,8 +3404,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3528,6 +3514,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:5912-24.20.100.6286", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -3548,8 +3557,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3573,32 +3582,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:5912-24.20.100.6286", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3623,8 +3608,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3649,8 +3634,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3674,8 +3659,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3699,8 +3684,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [ @@ -3738,6 +3723,29 @@ { "args": [ "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:1cb3-26.21.14.3102", + "os": "Windows-10", + "pool": "chromium.tests.gpu.template" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", "--test-launcher-retry-limit=0", "--no-use-spvc", "--no-use-spvc-parser" @@ -3758,8 +3766,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3783,32 +3791,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" - }, - { - "args": [ - "--use-gpu-in-tests", - "--test-launcher-retry-limit=0" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3-26.21.14.3102", - "os": "Windows-10", - "pool": "chromium.tests.gpu.template" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3833,8 +3817,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3859,8 +3843,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3884,8 +3868,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" }, { "args": [ @@ -3909,8 +3893,8 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "dawn_end2end_tests_tmp", - "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp" + "test": "dawn_end2end_tests", + "test_target": "//third_party/dawn/src/tests:dawn_end2end_tests" } ], "isolated_scripts": [
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 2a277d7..6ef6cdc 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -724,8 +724,8 @@ "label": "//crypto:crypto_unittests", "type": "console_test_launcher", }, - "dawn_end2end_tests_tmp": { - "label": "//third_party/dawn/src/tests:dawn_end2end_tests_tmp", + "dawn_end2end_tests": { + "label": "//third_party/dawn/src/tests:dawn_end2end_tests", "type": "raw", }, "dawn_perf_tests": {
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 8f5af7fd..4bbc7239 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -1893,7 +1893,7 @@ '--no-use-spvc', '--no-use-spvc-parser', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_skip_validation_tests': { 'desktop_args': [ @@ -1902,7 +1902,7 @@ '--test-launcher-retry-limit=0', '--skip-validation', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_tests': { 'desktop_args': [ @@ -1910,7 +1910,6 @@ # Dawn test retries deliberately disabled to prevent flakiness. '--test-launcher-retry-limit=0', ], - 'test': 'dawn_end2end_tests_tmp', }, 'dawn_end2end_use_spvc_parser_tests': { 'desktop_args': [ @@ -1920,7 +1919,7 @@ '--use-spvc', '--use-spvc-parser', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_use_spvc_tests': { 'desktop_args': [ @@ -1930,7 +1929,7 @@ '--use-spvc', '--no-use-spvc-parser', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_validation_layers_tests': { 'desktop_args': [ @@ -1939,7 +1938,7 @@ '--test-launcher-retry-limit=0', '--enable-backend-validation', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_wire_tests': { 'desktop_args': [ @@ -1948,7 +1947,7 @@ '--test-launcher-retry-limit=0', '--use-wire', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, }, @@ -1963,7 +1962,7 @@ '--no-use-spvc', '--no-use-spvc-parser', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_skip_validation_tests': { 'desktop_args': [ @@ -1972,7 +1971,7 @@ '--test-launcher-retry-limit=0', '--skip-validation', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_tests': { 'desktop_args': [ @@ -1980,7 +1979,6 @@ # Dawn test retries deliberately disabled to prevent flakiness. '--test-launcher-retry-limit=0', ], - 'test': 'dawn_end2end_tests_tmp', }, 'dawn_end2end_use_spvc_parser_tests': { 'desktop_args': [ @@ -1990,7 +1988,7 @@ '--use-spvc', '--use-spvc-parser', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_use_spvc_tests': { 'desktop_args': [ @@ -2000,7 +1998,7 @@ '--use-spvc', '--no-use-spvc-parser', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_validation_layers_tests': { 'desktop_args': [ @@ -2009,7 +2007,7 @@ '--test-launcher-retry-limit=0', '--enable-backend-validation', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'dawn_end2end_wire_tests': { 'desktop_args': [ @@ -2018,7 +2016,7 @@ '--test-launcher-retry-limit=0', '--use-wire', ], - 'test': 'dawn_end2end_tests_tmp', + 'test': 'dawn_end2end_tests', }, 'gl_tests': { 'desktop_args': [
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 7f47901..bcf1960c 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1278,6 +1278,25 @@ ] } ], + "CctClientDataHeader": [ + { + "platforms": [ + "android" + ], + "experiments": [ + { + "name": "Enabled", + "params": { + "expected_version": "300000000", + "header_value": "header value" + }, + "enable_features": [ + "CCTClientDataHeader" + ] + } + ] + } + ], "CertDualVerificationTrial": [ { "platforms": [ @@ -5158,26 +5177,6 @@ ] } ], - "ScriptStreamingOnPreload": [ - { - "platforms": [ - "android", - "android_weblayer", - "chromeos", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "ScriptStreamingOnPreload" - ] - } - ] - } - ], "ScrollResamplingRollout": [ { "platforms": [
diff --git a/third_party/blink/perf_tests/webaudio/audio-buffer-source-node.html b/third_party/blink/perf_tests/webaudio/audio-buffer-source-node.html new file mode 100644 index 0000000..0a3a2bbd --- /dev/null +++ b/third_party/blink/perf_tests/webaudio/audio-buffer-source-node.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test performance of 100 AudioBufferSourceNodes. + </title> + <script src="../resources/runner.js"></script> + <script src="resources/webaudio-perf-utils.js"></script> + </head> + <body> + <script> + function graphBuilder() { + const context = new OfflineAudioContext(1, 48000, 48000); + const buffer = createMonoRampBuffer(4800, 48000); + const testNodes = + createNodes(context, 'AudioBufferSourceNode', 100, {buffer}); + + // All the test nodes fan-in to the destination node. + testNodes.forEach(node => { + node.connect(context.destination); + node.start(); + }); + return context; + } + + RunWebAudioPerfTest({ + description: 'Test performance of 100 AudioBufferSourceNodes', + graphBuilder: graphBuilder, + tracingOptions: { + targetCategory: 'disabled-by-default-webaudio.audionode', + targetEvents: ['AudioBufferSourceHandler::Process'], + } + }); + </script> + </body> +</html>
diff --git a/third_party/blink/perf_tests/webaudio/audio-worklet-node.html b/third_party/blink/perf_tests/webaudio/audio-worklet-node.html new file mode 100644 index 0000000..70b17a08 --- /dev/null +++ b/third_party/blink/perf_tests/webaudio/audio-worklet-node.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test performance of 100 AudioWorkletNodes (bypassing). + </title> + <script src="../resources/runner.js"></script> + <script src="resources/webaudio-perf-utils.js"></script> + </head> + <body> + <script> + async function graphBuilder() { + const context = new OfflineAudioContext(1, 48000, 48000); + await context.audioWorklet.addModule('resources/bypass-processor.js'); + const source = new ConstantSourceNode(context); + + // Create 100 AudioWorkletNodes that are serially connected. + const testNodes = []; + for (let i = 0; i < 100; ++i) { + testNodes.push(new AudioWorkletNode(context, 'bypass-processor')); + if (i === 0) continue; + testNodes[i - 1].connect(testNodes[i]); + } + + source.connect(testNodes[0]); + testNodes[99].connect(context.destination); + source.start(); + return context; + } + + RunWebAudioPerfTest({ + description: 'Test performance of 100 AudioWorkletNodes (bypassing)', + graphBuilder: graphBuilder, + tracingOptions: { + targetCategory: 'disabled-by-default-webaudio.audionode', + targetEvents: ['AudioWorkletHandler::Process'], + } + }); + </script> + </body> +</html>
diff --git a/third_party/blink/perf_tests/webaudio/biquad-filter-node.html b/third_party/blink/perf_tests/webaudio/biquad-filter-node.html new file mode 100644 index 0000000..2afa1c6 --- /dev/null +++ b/third_party/blink/perf_tests/webaudio/biquad-filter-node.html
@@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test performance of 100 BiquadFilterNodes. + </title> + <script src="../resources/runner.js"></script> + <script src="resources/webaudio-perf-utils.js"></script> + </head> + <body> + <script> + function graphBuilder() { + const context = new OfflineAudioContext(1, 48000, 48000); + const source = new ConstantSourceNode(context); + const testNodes = + createAndConnectNodesInSeries(context, 'BiquadFilterNode', 100); + source.connect(testNodes.head); + testNodes.tail.connect(context.destination); + source.start(); + return context; + } + + RunWebAudioPerfTest({ + description: 'Test performance of 100 BiquadFilterNodes', + graphBuilder: graphBuilder, + tracingOptions: { + targetCategory: 'disabled-by-default-webaudio.audionode', + targetEvents: ['BiquadFilterHandler::Process'], + } + }); + </script> + </body> +</html> \ No newline at end of file
diff --git a/third_party/blink/perf_tests/webaudio/gain-node.html b/third_party/blink/perf_tests/webaudio/gain-node.html new file mode 100644 index 0000000..d7a9c88 --- /dev/null +++ b/third_party/blink/perf_tests/webaudio/gain-node.html
@@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test performance of 100 GainNodes. + </title> + <script src="../resources/runner.js"></script> + <script src="resources/webaudio-perf-utils.js"></script> + </head> + <body> + <script> + function graphBuilder() { + const context = new OfflineAudioContext(1, 48000, 48000); + const source = new ConstantSourceNode(context); + const testNodes = createAndConnectNodesInSeries( + context, 'GainNode', 100, {gain: 0.707}); + source.connect(testNodes.head); + testNodes.tail.connect(context.destination); + source.start(); + return context; + } + + RunWebAudioPerfTest({ + description: 'Test performance of 100 GainNodes', + graphBuilder: graphBuilder, + tracingOptions: { + targetCategory: 'disabled-by-default-webaudio.audionode', + targetEvents: ['GainHandler::Process'], + } + }); + </script> + </body> +</html>
diff --git a/third_party/blink/perf_tests/webaudio/panner-node.html b/third_party/blink/perf_tests/webaudio/panner-node.html new file mode 100644 index 0000000..4b2df5d --- /dev/null +++ b/third_party/blink/perf_tests/webaudio/panner-node.html
@@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test performance of 100 PannerNodes (HRTF). + </title> + <script src="../resources/runner.js"></script> + <script src="resources/webaudio-perf-utils.js"></script> + </head> + <body> + <script> + function graphBuilder() { + const context = new OfflineAudioContext(1, 48000, 48000); + const source = new ConstantSourceNode(context); + const testNodes = createAndConnectNodesInSeries( + context, 'PannerNode', 100, {panningModel: 'HRTF'}); + source.connect(testNodes.head); + testNodes.tail.connect(context.destination); + source.start(); + return context; + } + + RunWebAudioPerfTest({ + description: 'Test performance of 100 PannerNodes (HRTF)', + graphBuilder: graphBuilder, + tracingOptions: { + targetCategory: 'disabled-by-default-webaudio.audionode', + targetEvents: ['PannerHandler::Process'], + } + }); + </script> + </body> +</html>
diff --git a/third_party/blink/perf_tests/webaudio/resources/bypass-processor.js b/third_party/blink/perf_tests/webaudio/resources/bypass-processor.js new file mode 100644 index 0000000..3e77ea2b --- /dev/null +++ b/third_party/blink/perf_tests/webaudio/resources/bypass-processor.js
@@ -0,0 +1,16 @@ +/** + * @class BypassProcessor + * @extends AudioWorkletProcessor + */ +class BypassProcessor extends AudioWorkletProcessor { + process(inputs, outputs) { + let input = inputs[0]; + let output = outputs[0]; + for (let channel = 0; channel < input.length; ++channel) + output[channel].set(input[channel]); + + return true; + } +} + +registerProcessor('bypass-processor', BypassProcessor); \ No newline at end of file
diff --git a/third_party/blink/perf_tests/webaudio/resources/webaudio-perf-utils.js b/third_party/blink/perf_tests/webaudio/resources/webaudio-perf-utils.js new file mode 100644 index 0000000..c1bee34 --- /dev/null +++ b/third_party/blink/perf_tests/webaudio/resources/webaudio-perf-utils.js
@@ -0,0 +1,100 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * Set up and perform a test with given test options. + * + * @param {!object} testOptions + * @param {string} testOptions.description test description + * @param {function} testOptions.graphBuilder a test function returns an + * OfflineAudioContext. + * @param {object} testOptions.tracingOptions test options + * @param {string} testOptions.tracingOptions.targetCategory + * target trace category + * @param {Array<string>} testOptions.tracingOptions.targetEvents + * target trace events + */ +function RunWebAudioPerfTest(testOptions) { + let isDone = false; + let startTime; + + async function runTest_internal() { + const context = await testOptions.graphBuilder(); + PerfTestRunner.addRunTestStartMarker(); + startTime = PerfTestRunner.now(); + await context.startRendering(); + PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime); + PerfTestRunner.addRunTestEndMarker(); + if (!isDone) + runTest_internal(); + } + + PerfTestRunner.startMeasureValuesAsync({ + unit: 'ms', + description: testOptions.description, + done: () => isDone = true, + run: runTest_internal, + warmUpCount: 2, + iterationCount: 5, + tracingCategories: testOptions.tracingOptions.targetCategory, + traceEventsToMeasure: testOptions.tracingOptions.targetEvents, + }); +} + +/** + * Creates multiple AudioNodes that are serially connected + * + * @param {BaseAudioContext} context + * @param {string} nodeName AudioNode name in string + * @param {number} numberOfNodes + * @param {AudioNodeOptions} nodeOptions + * @returns {object} + */ +function createAndConnectNodesInSeries( + context, nodeName, numberOfNodes, nodeOptions) { + const testNodes = []; + nodeOptions = nodeOptions || {}; + for (let i = 0; i < numberOfNodes; ++i) { + testNodes.push(new window[nodeName](context, nodeOptions)); + if (i === 0) continue; + testNodes[i - 1].connect(testNodes[i]); + } + return { + head: testNodes[0], + tail: testNodes[numberOfNodes - 1], + nodes: testNodes, + }; +} + +/** + * Creates multiple AudioNodes. + * + * @param {BaseAudioContext} context + * @param {string} nodeName AudioNode name in string + * @param {number} numberOfNodes + * @param {AudioNodeOptions} nodeOptions + * @returns {Array<AudioNode>} + */ +function createNodes(context, nodeName, numberOfNodes, nodeOptions) { + const testNodes = []; + nodeOptions = nodeOptions || {}; + for (let i = 0; i < numberOfNodes; ++i) + testNodes.push(new window[nodeName](context, nodeOptions)); + return testNodes; +} + +/** + * Creates an AudioBuffer with up-ramp samples. + * + * @param {number} length number of samples + * @param {number} sampleRate sample rate + * @returns {AudioBuffer} + */ +function createMonoRampBuffer(length, sampleRate) { + let buffer = new AudioBuffer({numberOfChannel: 1, length, sampleRate}); + let channelData = buffer.getChannelData(0); + for (let i = 0; i < length; ++i) + channelData[i] = i / length; + return buffer; +}
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h index 21bb6b2..ffd1f9c 100644 --- a/third_party/blink/public/platform/web_runtime_features.h +++ b/third_party/blink/public/platform/web_runtime_features.h
@@ -208,7 +208,6 @@ BLINK_PLATFORM_EXPORT static void EnableMediaEngagementBypassAutoplayPolicies( bool); BLINK_PLATFORM_EXPORT static void EnableAutomationControlled(bool); - BLINK_PLATFORM_EXPORT static void EnableScriptStreamingOnPreload(bool); BLINK_PLATFORM_EXPORT static void EnableExperimentalProductivityFeatures( bool); BLINK_PLATFORM_EXPORT static void EnableAutoplayIgnoresWebAudio(bool);
diff --git a/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt b/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt index 4bb4a418..5fe62ea 100644 --- a/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt +++ b/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt
@@ -35,7 +35,7 @@ Affects=Nothing AllowShared CEReactions -CachedAccessor +CachedAccessor=* CachedAttribute=* CallWith=ExecutionContext|Isolate|ScriptState|ThisValue CheckSecurity=Receiver|ReturnValue
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.cc b/third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.cc index 53926f2..b11f42b6 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.cc
@@ -165,7 +165,7 @@ v8::Local<FunctionOrTemplate> CreateAccessorFunctionOrTemplate( v8::Isolate*, v8::FunctionCallback, - V8PrivateProperty::CachedAccessorSymbol, + V8PrivateProperty::CachedAccessor, v8::Local<v8::Value> data, v8::Local<v8::Signature>, const char* name, @@ -177,7 +177,7 @@ CreateAccessorFunctionOrTemplate<v8::FunctionTemplate>( v8::Isolate* isolate, v8::FunctionCallback callback, - V8PrivateProperty::CachedAccessorSymbol cached_property_key, + V8PrivateProperty::CachedAccessor cached_property_key, v8::Local<v8::Value> data, v8::Local<v8::Signature> signature, const char* name, @@ -194,7 +194,7 @@ // 7. Perform ! SetFunctionLength(|F|, 1). int length = type == AccessorType::Getter ? 0 : 1; - if (cached_property_key != V8PrivateProperty::kNoCachedAccessor) { + if (cached_property_key != V8PrivateProperty::CachedAccessor::kNone) { function_template = v8::FunctionTemplate::NewWithCache( isolate, callback, V8PrivateProperty::GetCachedAccessor(isolate, cached_property_key) @@ -240,7 +240,7 @@ v8::Local<v8::Function> CreateAccessorFunctionOrTemplate<v8::Function>( v8::Isolate* isolate, v8::FunctionCallback callback, - V8PrivateProperty::CachedAccessorSymbol, + V8PrivateProperty::CachedAccessor, v8::Local<v8::Value> data, v8::Local<v8::Signature> signature, const char* name, @@ -251,7 +251,7 @@ v8::Local<v8::FunctionTemplate> function_template = CreateAccessorFunctionOrTemplate<v8::FunctionTemplate>( - isolate, callback, V8PrivateProperty::kNoCachedAccessor, data, + isolate, callback, V8PrivateProperty::CachedAccessor::kNone, data, signature, name, type, side_effect_type); if (function_template.IsEmpty()) return v8::Local<v8::Function>(); @@ -300,9 +300,12 @@ v8::Local<v8::String> name = V8AtomicString(isolate, config.name); v8::FunctionCallback getter_callback = config.getter; v8::FunctionCallback setter_callback = config.setter; - auto cached_property_key = V8PrivateProperty::kNoCachedAccessor; - if (world.IsMainWorld()) { - cached_property_key = static_cast<V8PrivateProperty::CachedAccessorSymbol>( + auto cached_property_key = V8PrivateProperty::CachedAccessor::kNone; + bool is_window_document = static_cast<V8PrivateProperty::CachedAccessor>( + config.cached_property_key) == + V8PrivateProperty::CachedAccessor::kWindowDocument; + if (!is_window_document || world.IsMainWorld()) { + cached_property_key = static_cast<V8PrivateProperty::CachedAccessor>( config.cached_property_key); } @@ -329,7 +332,7 @@ AccessorType::Getter, getter_side_effect_type); v8::Local<FunctionOrTemplate> setter = CreateAccessorFunctionOrTemplate<FunctionOrTemplate>( - isolate, setter_callback, V8PrivateProperty::kNoCachedAccessor, + isolate, setter_callback, V8PrivateProperty::CachedAccessor::kNone, v8::Local<v8::Value>(), signature, config.name, AccessorType::Setter); if (location & V8DOMConfiguration::kOnInstance && @@ -352,12 +355,12 @@ // type check against a holder. v8::Local<FunctionOrTemplate> getter = CreateAccessorFunctionOrTemplate<FunctionOrTemplate>( - isolate, getter_callback, V8PrivateProperty::kNoCachedAccessor, + isolate, getter_callback, V8PrivateProperty::CachedAccessor::kNone, v8::Local<v8::Value>(), v8::Local<v8::Signature>(), config.name, AccessorType::Getter, getter_side_effect_type); v8::Local<FunctionOrTemplate> setter = CreateAccessorFunctionOrTemplate<FunctionOrTemplate>( - isolate, setter_callback, V8PrivateProperty::kNoCachedAccessor, + isolate, setter_callback, V8PrivateProperty::CachedAccessor::kNone, v8::Local<v8::Value>(), v8::Local<v8::Signature>(), config.name, AccessorType::Setter); interface_or_template->SetAccessorProperty(
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.h b/third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.h index da8b24c8..cbfe522d 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.h +++ b/third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.h
@@ -145,8 +145,8 @@ const char* const name; v8::FunctionCallback getter; v8::FunctionCallback setter; - // V8PrivateProperty::CachedAccessorSymbol - unsigned cached_property_key : 1; + // V8PrivateProperty::CachedAccessor + unsigned cached_property_key : 2; // v8::PropertyAttribute unsigned attribute : 8; // PropertyLocationConfiguration
diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py index bc45acc..8f0187b 100644 --- a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +++ b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py
@@ -166,9 +166,7 @@ property_name = cg_context.property_.identifier.lower() - kind = "Constant" - - return name_style.constant(kind, property_name) + return name_style.constant(property_name) def custom_function_name(cg_context): @@ -1620,7 +1618,7 @@ body = func_def.body v8_set_return_value = _format( - "bindings::V8SetReturnValue(${info}, ${class_name}::{});", + "bindings::V8SetReturnValue(${info}, ${class_name}::Constant::{});", constant_name(cg_context)) body.extend([ make_runtime_call_timer_scope(cg_context), @@ -3200,15 +3198,17 @@ body.append(TextNode("${throw_security_error}")) return func_def - body.append( + bind_return_value(body, cg_context, overriding_args=["${index}"]) + + body.extend([ TextNode("""\ if (${index} >= ${blink_receiver}->length()) { ${throw_security_error} return; } - -${class_name}::IndexedPropertyGetterCallback(${index}, ${info}); -""")) +"""), + make_v8_set_return_value(cg_context), + ]) return func_def @@ -3688,14 +3688,16 @@ "SameOriginProperty_IndexedPropertyGetter") body = func_def.body - body.append( + bind_return_value(body, cg_context, overriding_args=["${index}"]) + + body.extend([ TextNode("""\ if (${index} >= ${blink_receiver}->length()) { return; } - -${class_name}::IndexedPropertyGetterCallback(${index}, ${info}); -""")) +"""), + make_v8_set_return_value(cg_context), + ]) return func_def @@ -3971,6 +3973,11 @@ code_node.register_code_symbol(symbol_node) +def _make_property_entry_cached_accessor(property_): + value = property_.extended_attributes.value_of("CachedAccessor") + return "V8PrivateProperty::CachedAccessor::{}".format(value or "kNone") + + def _make_property_entry_v8_property_attribute(property_): values = [] if "NotEnumerable" in property_.extended_attributes: @@ -4062,7 +4069,7 @@ "\"{property_name}\", " "{attribute_get_callback}, " "{attribute_set_callback}, " - "V8PrivateProperty::kNoCachedAccessor, " + "static_cast<unsigned>({cached_accessor}), " "{v8_property_attribute}, " "{on_which_object}, " "{check_receiver}, " @@ -4075,6 +4082,8 @@ property_name=entry.property_.identifier, attribute_get_callback=entry.attr_get_callback_name, attribute_set_callback=(entry.attr_set_callback_name or "nullptr"), + cached_accessor=_make_property_entry_cached_accessor( + entry.property_), v8_property_attribute=_make_property_entry_v8_property_attribute( entry.property_), on_which_object=_make_property_entry_on_which_object( @@ -4396,7 +4405,8 @@ if const_callback_node is None: const_callback_name = None # IDL constant's C++ constant name - const_constant_name = _format("${class_name}::{}", constant_name(cgc)) + const_constant_name = _format("${class_name}::Constant::{}", + constant_name(cgc)) callback_def_nodes.extend([ const_callback_node, @@ -4603,6 +4613,22 @@ ${v8_context}, V8AtomicString(${isolate}, "constructor")).ToChecked(); """)) + if class_like.identifier == "Window": + nodes.append( + TextNode("""\ +// TODO(yukishiino): Remove the following empty check. Since Blink is +// creating a new object from a boilerplate (i.e. CreateWrapperFromCache), +// we can install all context-dependent properties at a time onto all of +// instance_object, prototype_object, and interface_object by refactoring +// V8PerContextData. +if (!${instance_object}.IsEmpty()) { + // [CachedAccessor=kWindowProxy] + V8PrivateProperty::GetCachedAccessor( + ${isolate}, V8PrivateProperty::CachedAccessor::kWindowProxy) + .Set(${instance_object}, ${v8_context}->Global()); +} +""")) + if ("Global" in class_like.extended_attributes and class_like.indexed_and_named_properties and class_like.indexed_and_named_properties.has_named_properties): @@ -5108,7 +5134,8 @@ install_node = SequenceNode() interface = cg_context.interface - if not (interface and interface.indexed_and_named_properties): + if not (interface and interface.indexed_and_named_properties + and "Global" not in interface.extended_attributes): return func_decls, func_defs, install_node props = interface.indexed_and_named_properties @@ -5125,8 +5152,7 @@ cg_context = cg_context.make_copy( v8_callback_type=CodeGenContext.V8_OTHER_CALLBACK) - if (props.own_named_getter - and "Global" not in interface.extended_attributes): + if props.own_named_getter: add_callback(*make_named_property_getter_callback( cg_context.make_copy(named_property_getter=props.named_getter), "NamedPropertyGetterCallback")) @@ -5145,7 +5171,7 @@ add_callback(*make_named_property_enumerator_callback( cg_context, "NamedPropertyEnumeratorCallback")) - if props.named_getter and "Global" not in interface.extended_attributes: + if props.named_getter: impl_bridge = v8_bridge_class_name( most_derived_interface( props.named_getter.owner, props.named_setter @@ -5241,6 +5267,11 @@ impl_bridge=impl_bridge, property_handler_flags=property_handler_flags)) + func_defs.accumulate( + CodeGenAccumulator.require_include_headers([ + "third_party/blink/renderer/bindings/core/v8/v8_set_return_value_for_core.h", + ])) + return func_decls, func_defs, install_node @@ -5339,6 +5370,7 @@ CROSS_ORIGIN_INTERFACES = ("Window", "Location") if cg_context.interface.identifier not in CROSS_ORIGIN_INTERFACES: return callback_defs, install_node + props = cg_context.interface.indexed_and_named_properties entry_nodes = [] for entry in attribute_entries: @@ -5434,7 +5466,9 @@ make_cross_origin_named_enumerator_callback( cg_context, "CrossOriginNamedEnumeratorCallback"), make_cross_origin_indexed_getter_callback( - cg_context, "CrossOriginIndexedGetterCallback"), + cg_context.make_copy( + indexed_property_getter=(props and props.indexed_getter)), + "CrossOriginIndexedGetterCallback"), make_cross_origin_indexed_setter_callback( cg_context, "CrossOriginIndexedSetterCallback"), make_cross_origin_indexed_deleter_callback( @@ -5490,7 +5524,9 @@ func_defs = [ make_same_origin_indexed_getter_callback( - cg_context, "SameOriginIndexedGetterCallback"), + cg_context.make_copy( + indexed_property_getter=(props and props.indexed_getter)), + "SameOriginIndexedGetterCallback"), make_same_origin_indexed_setter_callback( cg_context, "SameOriginIndexedSetterCallback"), make_same_origin_indexed_deleter_callback( @@ -5864,11 +5900,14 @@ impl_class_def = api_class_def # Constants - constant_defs = ListNode() - for constant in interface.constants: - cgc = cg_context.make_copy(constant=constant) - constant_defs.append( - make_constant_constant_def(cgc, constant_name(cgc))) + constants_def = None + if interface.constants: + constants_def = CxxClassDefNode(name="Constant", final=True) + constants_def.top_section.append(TextNode("STATIC_ONLY(Constant);")) + for constant in interface.constants: + cgc = cg_context.make_copy(constant=constant) + constants_def.public_section.append( + make_constant_constant_def(cgc, constant_name(cgc))) # Custom callback implementations custom_callback_impl_decls = ListNode() @@ -6200,6 +6239,13 @@ if is_cross_components: impl_header_blink_ns.body.append(impl_class_def) + if constants_def: + api_class_def.public_section.extend([ + TextNode("// Constants"), + constants_def, + EmptyNode(), + ]) + api_class_def.public_section.append(get_wrapper_type_info_def) api_class_def.public_section.append(EmptyNode()) api_class_def.public_section.extend([ @@ -6238,13 +6284,6 @@ api_class_def.public_section.append(installer_function_decls) api_class_def.public_section.append(EmptyNode()) - if constant_defs: - api_class_def.public_section.extend([ - TextNode("// Constants"), - constant_defs, - EmptyNode(), - ]) - if custom_callback_impl_decls: api_class_def.public_section.extend([ TextNode("// Custom callback implementations"), @@ -6258,14 +6297,16 @@ indexed_and_named_property_decls, EmptyNode(), ]) + api_source_blink_ns.body.extend([ + indexed_and_named_property_defs, + EmptyNode(), + ]) impl_source_blink_ns.body.extend([ CxxNamespaceNode(name="", body=callback_defs), EmptyNode(), installer_function_defs, EmptyNode(), - indexed_and_named_property_defs, - EmptyNode(), ]) # Write down to the files.
diff --git a/third_party/blink/renderer/bindings/scripts/v8_attributes.py b/third_party/blink/renderer/bindings/scripts/v8_attributes.py index 26fbd98..6cdf62ae 100644 --- a/third_party/blink/renderer/bindings/scripts/v8_attributes.py +++ b/third_party/blink/renderer/bindings/scripts/v8_attributes.py
@@ -196,7 +196,7 @@ 'activity_logging_world_check': v8_utilities.activity_logging_world_check(attribute), 'cached_accessor_name': - '%s%sCachedAccessor' % (interface.name, attribute.name.capitalize()), + 'k%s%s' % (interface.name, attribute.name.capitalize()), 'cached_attribute_validation_method': cached_attribute_validation_method, 'camel_case_name': @@ -733,8 +733,6 @@ def is_data_type_property(interface, attribute): - if 'CachedAccessor' in attribute.extended_attributes: - return False return (is_constructor_attribute(attribute) or 'CrossOrigin' in attribute.extended_attributes)
diff --git a/third_party/blink/renderer/bindings/templates/attributes.cc.tmpl b/third_party/blink/renderer/bindings/templates/attributes.cc.tmpl index 1db515e..ca51c00 100644 --- a/third_party/blink/renderer/bindings/templates/attributes.cc.tmpl +++ b/third_party/blink/renderer/bindings/templates/attributes.cc.tmpl
@@ -562,9 +562,10 @@ {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(attribute.property_attributes) %} -{% set cached_property_key = 'V8PrivateProperty::k' + +{% set cached_property_key = 'V8PrivateProperty::CachedAccessor::' + (attribute.cached_accessor_name if attribute.is_cached_accessor - else 'NoCachedAccessor') %} + else 'kNone') %} +{% set cached_property_key = 'static_cast<unsigned>(%s)' % cached_property_key %} {% set holder_check = 'V8DOMConfiguration::kDoNotCheckHolder' if attribute.is_lenient_this or attribute.has_promise_type else 'V8DOMConfiguration::kCheckHolder' %}
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_svg_test_interface.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_svg_test_interface.cc index 0dd587f25..f5f5ed4f 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_svg_test_interface.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_svg_test_interface.cc
@@ -130,7 +130,7 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "type", V8SVGTestInterface::TypeAttributeGetterCallback, V8SVGTestInterface::TypeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "type", V8SVGTestInterface::TypeAttributeGetterCallback, V8SVGTestInterface::TypeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_attributes.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_attributes.cc index f850254..3c4d967b 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_attributes.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_attributes.cc
@@ -218,12 +218,12 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "lenientThisLongAttribute", V8TestAttributes::LenientThisLongAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "stringPromiseAttribute", V8TestAttributes::StringPromiseAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "lenientThisStringPromiseAttribute", V8TestAttributes::LenientThisStringPromiseAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "raisesExceptionShortPromiseAttribute", V8TestAttributes::RaisesExceptionShortPromiseAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "lenientSetterBoolAttribute", V8TestAttributes::LenientSetterBoolAttributeAttributeGetterCallback, V8TestAttributes::LenientSetterBoolAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "floatAttribute", V8TestAttributes::FloatAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "lenientThisLongAttribute", V8TestAttributes::LenientThisLongAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "stringPromiseAttribute", V8TestAttributes::StringPromiseAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "lenientThisStringPromiseAttribute", V8TestAttributes::LenientThisStringPromiseAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "raisesExceptionShortPromiseAttribute", V8TestAttributes::RaisesExceptionShortPromiseAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "lenientSetterBoolAttribute", V8TestAttributes::LenientSetterBoolAttributeAttributeGetterCallback, V8TestAttributes::LenientSetterBoolAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "floatAttribute", V8TestAttributes::FloatAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_callback_functions.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_callback_functions.cc index 7e3bddf..90bcbb3 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_callback_functions.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_callback_functions.cc
@@ -294,7 +294,7 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "customElementsCallbacksReadonlyAttribute", V8TestCallbackFunctions::CustomElementsCallbacksReadonlyAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "customElementsCallbacksReadonlyAttribute", V8TestCallbackFunctions::CustomElementsCallbacksReadonlyAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_element.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_element.cc index b98b8b7..d3577efe 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_element.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_element.cc
@@ -175,9 +175,9 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "reflectedBoolAttribute", V8TestElement::ReflectedBoolAttributeAttributeGetterCallback, V8TestElement::ReflectedBoolAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectedStringAttribute", V8TestElement::ReflectedStringAttributeAttributeGetterCallback, V8TestElement::ReflectedStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectedNullableStringAttribute", V8TestElement::ReflectedNullableStringAttributeAttributeGetterCallback, V8TestElement::ReflectedNullableStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectedBoolAttribute", V8TestElement::ReflectedBoolAttributeAttributeGetterCallback, V8TestElement::ReflectedBoolAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectedStringAttribute", V8TestElement::ReflectedStringAttributeAttributeGetterCallback, V8TestElement::ReflectedStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectedNullableStringAttribute", V8TestElement::ReflectedNullableStringAttributeAttributeGetterCallback, V8TestElement::ReflectedNullableStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -206,7 +206,7 @@ if (RuntimeEnabledFeatures::RuntimeFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "reflectedRuntimeEnabeld", V8TestElement::ReflectedRuntimeEnabeldAttributeGetterCallback, V8TestElement::ReflectedRuntimeEnabeldAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectedRuntimeEnabeld", V8TestElement::ReflectedRuntimeEnabeldAttributeGetterCallback, V8TestElement::ReflectedRuntimeEnabeldAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_integer_indexed.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_integer_indexed.cc index 6a4e85a..820b38ee 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_integer_indexed.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_integer_indexed.cc
@@ -363,7 +363,7 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "length", V8TestIntegerIndexed::LengthAttributeGetterCallback, V8TestIntegerIndexed::LengthAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "length", V8TestIntegerIndexed::LengthAttributeGetterCallback, V8TestIntegerIndexed::LengthAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_integer_indexed_global.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_integer_indexed_global.cc index 619fa91..22819a5 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_integer_indexed_global.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_integer_indexed_global.cc
@@ -284,7 +284,7 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "length", V8TestIntegerIndexedGlobal::LengthAttributeGetterCallback, V8TestIntegerIndexedGlobal::LengthAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "length", V8TestIntegerIndexedGlobal::LengthAttributeGetterCallback, V8TestIntegerIndexedGlobal::LengthAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface.cc index c517db1..6f77cbb 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface.cc
@@ -4326,37 +4326,37 @@ kAttributeConfigurations, base::size(kAttributeConfigurations)); static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "testInterfaceAttribute", V8TestInterface::TestInterfaceAttributeAttributeGetterCallback, V8TestInterface::TestInterfaceAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "doubleAttribute", V8TestInterface::DoubleAttributeAttributeGetterCallback, V8TestInterface::DoubleAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "floatAttribute", V8TestInterface::FloatAttributeAttributeGetterCallback, V8TestInterface::FloatAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unrestrictedDoubleAttribute", V8TestInterface::UnrestrictedDoubleAttributeAttributeGetterCallback, V8TestInterface::UnrestrictedDoubleAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unrestrictedFloatAttribute", V8TestInterface::UnrestrictedFloatAttributeAttributeGetterCallback, V8TestInterface::UnrestrictedFloatAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testEnumAttribute", V8TestInterface::TestEnumAttributeAttributeGetterCallback, V8TestInterface::TestEnumAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testEnumOrNullAttribute", V8TestInterface::TestEnumOrNullAttributeAttributeGetterCallback, V8TestInterface::TestEnumOrNullAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "stringOrDoubleAttribute", V8TestInterface::StringOrDoubleAttributeAttributeGetterCallback, V8TestInterface::StringOrDoubleAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "withExtendedAttributeStringAttribute", V8TestInterface::WithExtendedAttributeStringAttributeAttributeGetterCallback, V8TestInterface::WithExtendedAttributeStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "uncapitalAttribute", V8TestInterface::UncapitalAttributeAttributeGetterCallback, V8TestInterface::UncapitalAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticStringAttribute", V8TestInterface::StaticStringAttributeAttributeGetterCallback, V8TestInterface::StaticStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticReturnDOMWrapperAttribute", V8TestInterface::StaticReturnDOMWrapperAttributeAttributeGetterCallback, V8TestInterface::StaticReturnDOMWrapperAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticReadOnlyStringAttribute", V8TestInterface::StaticReadOnlyStringAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticReadOnlyReturnDOMWrapperAttribute", V8TestInterface::StaticReadOnlyReturnDOMWrapperAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "stringNullAsEmptyAttribute", V8TestInterface::StringNullAsEmptyAttributeAttributeGetterCallback, V8TestInterface::StringNullAsEmptyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "usvStringOrNullAttribute", V8TestInterface::UsvStringOrNullAttributeAttributeGetterCallback, V8TestInterface::UsvStringOrNullAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "alwaysExposedAttribute", V8TestInterface::AlwaysExposedAttributeAttributeGetterCallback, V8TestInterface::AlwaysExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "lenientThisAttribute", V8TestInterface::LenientThisAttributeAttributeGetterCallback, V8TestInterface::LenientThisAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "attributeWithSideEffectFreeGetter", V8TestInterface::AttributeWithSideEffectFreeGetterAttributeGetterCallback, V8TestInterface::AttributeWithSideEffectFreeGetterAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasNoSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "scriptString", V8TestInterface::ScriptStringAttributeGetterCallback, V8TestInterface::ScriptStringAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "htmlString", V8TestInterface::HTMLStringAttributeGetterCallback, V8TestInterface::HTMLStringAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "scriptURLString", V8TestInterface::ScriptURLStringAttributeGetterCallback, V8TestInterface::ScriptURLStringAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "optionalScriptString", V8TestInterface::OptionalScriptStringAttributeGetterCallback, V8TestInterface::OptionalScriptStringAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "treatNullAsEmptyStringHTMLString", V8TestInterface::TreatNullAsEmptyStringHTMLStringAttributeGetterCallback, V8TestInterface::TreatNullAsEmptyStringHTMLStringAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "mixinReadonlyStringAttribute", V8TestInterface::MixinReadonlyStringAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "mixinStringAttribute", V8TestInterface::MixinStringAttributeAttributeGetterCallback, V8TestInterface::MixinStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "mixinNodeAttribute", V8TestInterface::MixinNodeAttributeAttributeGetterCallback, V8TestInterface::MixinNodeAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "mixinEventHandlerAttribute", V8TestInterface::MixinEventHandlerAttributeAttributeGetterCallback, V8TestInterface::MixinEventHandlerAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "mixin3StringAttribute", V8TestInterface::Mixin3StringAttributeAttributeGetterCallback, V8TestInterface::Mixin3StringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "partial2LongAttribute", V8TestInterface::Partial2LongAttributeAttributeGetterCallback, V8TestInterface::Partial2LongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "partial2StaticLongAttribute", V8TestInterface::Partial2StaticLongAttributeAttributeGetterCallback, V8TestInterface::Partial2StaticLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testInterfaceAttribute", V8TestInterface::TestInterfaceAttributeAttributeGetterCallback, V8TestInterface::TestInterfaceAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "doubleAttribute", V8TestInterface::DoubleAttributeAttributeGetterCallback, V8TestInterface::DoubleAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "floatAttribute", V8TestInterface::FloatAttributeAttributeGetterCallback, V8TestInterface::FloatAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unrestrictedDoubleAttribute", V8TestInterface::UnrestrictedDoubleAttributeAttributeGetterCallback, V8TestInterface::UnrestrictedDoubleAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unrestrictedFloatAttribute", V8TestInterface::UnrestrictedFloatAttributeAttributeGetterCallback, V8TestInterface::UnrestrictedFloatAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testEnumAttribute", V8TestInterface::TestEnumAttributeAttributeGetterCallback, V8TestInterface::TestEnumAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testEnumOrNullAttribute", V8TestInterface::TestEnumOrNullAttributeAttributeGetterCallback, V8TestInterface::TestEnumOrNullAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "stringOrDoubleAttribute", V8TestInterface::StringOrDoubleAttributeAttributeGetterCallback, V8TestInterface::StringOrDoubleAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "withExtendedAttributeStringAttribute", V8TestInterface::WithExtendedAttributeStringAttributeAttributeGetterCallback, V8TestInterface::WithExtendedAttributeStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "uncapitalAttribute", V8TestInterface::UncapitalAttributeAttributeGetterCallback, V8TestInterface::UncapitalAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticStringAttribute", V8TestInterface::StaticStringAttributeAttributeGetterCallback, V8TestInterface::StaticStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticReturnDOMWrapperAttribute", V8TestInterface::StaticReturnDOMWrapperAttributeAttributeGetterCallback, V8TestInterface::StaticReturnDOMWrapperAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticReadOnlyStringAttribute", V8TestInterface::StaticReadOnlyStringAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticReadOnlyReturnDOMWrapperAttribute", V8TestInterface::StaticReadOnlyReturnDOMWrapperAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "stringNullAsEmptyAttribute", V8TestInterface::StringNullAsEmptyAttributeAttributeGetterCallback, V8TestInterface::StringNullAsEmptyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "usvStringOrNullAttribute", V8TestInterface::UsvStringOrNullAttributeAttributeGetterCallback, V8TestInterface::UsvStringOrNullAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "alwaysExposedAttribute", V8TestInterface::AlwaysExposedAttributeAttributeGetterCallback, V8TestInterface::AlwaysExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "lenientThisAttribute", V8TestInterface::LenientThisAttributeAttributeGetterCallback, V8TestInterface::LenientThisAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "attributeWithSideEffectFreeGetter", V8TestInterface::AttributeWithSideEffectFreeGetterAttributeGetterCallback, V8TestInterface::AttributeWithSideEffectFreeGetterAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasNoSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "scriptString", V8TestInterface::ScriptStringAttributeGetterCallback, V8TestInterface::ScriptStringAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "htmlString", V8TestInterface::HTMLStringAttributeGetterCallback, V8TestInterface::HTMLStringAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "scriptURLString", V8TestInterface::ScriptURLStringAttributeGetterCallback, V8TestInterface::ScriptURLStringAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "optionalScriptString", V8TestInterface::OptionalScriptStringAttributeGetterCallback, V8TestInterface::OptionalScriptStringAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "treatNullAsEmptyStringHTMLString", V8TestInterface::TreatNullAsEmptyStringHTMLStringAttributeGetterCallback, V8TestInterface::TreatNullAsEmptyStringHTMLStringAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "mixinReadonlyStringAttribute", V8TestInterface::MixinReadonlyStringAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "mixinStringAttribute", V8TestInterface::MixinStringAttributeAttributeGetterCallback, V8TestInterface::MixinStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "mixinNodeAttribute", V8TestInterface::MixinNodeAttributeAttributeGetterCallback, V8TestInterface::MixinNodeAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "mixinEventHandlerAttribute", V8TestInterface::MixinEventHandlerAttributeAttributeGetterCallback, V8TestInterface::MixinEventHandlerAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "mixin3StringAttribute", V8TestInterface::Mixin3StringAttributeAttributeGetterCallback, V8TestInterface::Mixin3StringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partial2LongAttribute", V8TestInterface::Partial2LongAttributeAttributeGetterCallback, V8TestInterface::Partial2LongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partial2StaticLongAttribute", V8TestInterface::Partial2StaticLongAttributeAttributeGetterCallback, V8TestInterface::Partial2StaticLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -4428,7 +4428,7 @@ if (RuntimeEnabledFeatures::Mixin2RuntimeFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "mixin2StringAttribute", V8TestInterface::Mixin2StringAttributeAttributeGetterCallback, V8TestInterface::Mixin2StringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "mixin2StringAttribute", V8TestInterface::Mixin2StringAttributeAttributeGetterCallback, V8TestInterface::Mixin2StringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -4438,7 +4438,7 @@ if (RuntimeEnabledFeatures::MixinRuntimeFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "mixinRuntimeEnabledNodeAttribute", V8TestInterface::MixinRuntimeEnabledNodeAttributeAttributeGetterCallback, V8TestInterface::MixinRuntimeEnabledNodeAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "mixinRuntimeEnabledNodeAttribute", V8TestInterface::MixinRuntimeEnabledNodeAttributeAttributeGetterCallback, V8TestInterface::MixinRuntimeEnabledNodeAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -4448,13 +4448,13 @@ if (RuntimeEnabledFeatures::PartialRuntimeFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "-dashed-attribute", V8TestInterface::Dec45DashedDec45AttributeAttributeGetterCallback, V8TestInterface::Dec45DashedDec45AttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "-webkit-cased-attribute", V8TestInterface::Dec45WebkitDec45CasedDec45AttributeAttributeGetterCallback, V8TestInterface::Dec45WebkitDec45CasedDec45AttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "partialCallWithExecutionContextLongAttribute", V8TestInterface::PartialCallWithExecutionContextLongAttributeAttributeGetterCallback, V8TestInterface::PartialCallWithExecutionContextLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "partialLongAttribute", V8TestInterface::PartialLongAttributeAttributeGetterCallback, V8TestInterface::PartialLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "partialPartialEnumTypeAttribute", V8TestInterface::PartialPartialEnumTypeAttributeAttributeGetterCallback, V8TestInterface::PartialPartialEnumTypeAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "partialStaticLongAttribute", V8TestInterface::PartialStaticLongAttributeAttributeGetterCallback, V8TestInterface::PartialStaticLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "underline_attribute", V8TestInterface::UnderlineDec95AttributeAttributeGetterCallback, V8TestInterface::UnderlineDec95AttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "-dashed-attribute", V8TestInterface::Dec45DashedDec45AttributeAttributeGetterCallback, V8TestInterface::Dec45DashedDec45AttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "-webkit-cased-attribute", V8TestInterface::Dec45WebkitDec45CasedDec45AttributeAttributeGetterCallback, V8TestInterface::Dec45WebkitDec45CasedDec45AttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialCallWithExecutionContextLongAttribute", V8TestInterface::PartialCallWithExecutionContextLongAttributeAttributeGetterCallback, V8TestInterface::PartialCallWithExecutionContextLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialLongAttribute", V8TestInterface::PartialLongAttributeAttributeGetterCallback, V8TestInterface::PartialLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialPartialEnumTypeAttribute", V8TestInterface::PartialPartialEnumTypeAttributeAttributeGetterCallback, V8TestInterface::PartialPartialEnumTypeAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialStaticLongAttribute", V8TestInterface::PartialStaticLongAttributeAttributeGetterCallback, V8TestInterface::PartialStaticLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "underline_attribute", V8TestInterface::UnderlineDec95AttributeAttributeGetterCallback, V8TestInterface::UnderlineDec95AttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -4464,9 +4464,9 @@ if (RuntimeEnabledFeatures::RuntimeFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "conditionalReadOnlyLongAttribute", V8TestInterface::ConditionalReadOnlyLongAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticConditionalReadOnlyLongAttribute", V8TestInterface::StaticConditionalReadOnlyLongAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "conditionalLongAttribute", V8TestInterface::ConditionalLongAttributeAttributeGetterCallback, V8TestInterface::ConditionalLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "conditionalReadOnlyLongAttribute", V8TestInterface::ConditionalReadOnlyLongAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticConditionalReadOnlyLongAttribute", V8TestInterface::StaticConditionalReadOnlyLongAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "conditionalLongAttribute", V8TestInterface::ConditionalLongAttributeAttributeGetterCallback, V8TestInterface::ConditionalLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -4638,9 +4638,9 @@ if (is_secure_context) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "partial2SecureContextAttribute", V8TestInterface::Partial2SecureContextAttributeAttributeGetterCallback, V8TestInterface::Partial2SecureContextAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "partialSecureContextAttribute", V8TestInterface::PartialSecureContextAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "secureContextAttribute", V8TestInterface::SecureContextAttributeAttributeGetterCallback, V8TestInterface::SecureContextAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partial2SecureContextAttribute", V8TestInterface::Partial2SecureContextAttributeAttributeGetterCallback, V8TestInterface::Partial2SecureContextAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialSecureContextAttribute", V8TestInterface::PartialSecureContextAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextAttribute", V8TestInterface::SecureContextAttributeAttributeGetterCallback, V8TestInterface::SecureContextAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -4650,7 +4650,7 @@ if (RuntimeEnabledFeatures::PartialRuntimeFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "partialSecureContextLongAttribute", V8TestInterface::PartialSecureContextLongAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialSecureContextLongAttribute", V8TestInterface::PartialSecureContextLongAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -4660,8 +4660,8 @@ if (RuntimeEnabledFeatures::SecureFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "partialSecureContextRuntimeEnabledAttribute", V8TestInterface::PartialSecureContextRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "secureContextRuntimeEnabledAttribute", V8TestInterface::SecureContextRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::SecureContextRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialSecureContextRuntimeEnabledAttribute", V8TestInterface::PartialSecureContextRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextRuntimeEnabledAttribute", V8TestInterface::SecureContextRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::SecureContextRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -4672,7 +4672,7 @@ if (is_secure_context || !RuntimeEnabledFeatures::SecureContextnessFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextnessRuntimeEnabledAttribute", V8TestInterface::SecureContextnessRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::SecureContextnessRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextnessRuntimeEnabledAttribute", V8TestInterface::SecureContextnessRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::SecureContextnessRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -4682,7 +4682,7 @@ if (execution_context && (execution_context->IsDocument())) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "windowExposedAttribute", V8TestInterface::WindowExposedAttributeAttributeGetterCallback, V8TestInterface::WindowExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "windowExposedAttribute", V8TestInterface::WindowExposedAttributeAttributeGetterCallback, V8TestInterface::WindowExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -4692,8 +4692,8 @@ if (is_secure_context) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "partialSecureContextWindowExposedAttribute", V8TestInterface::PartialSecureContextWindowExposedAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextWindowExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "secureContextWindowExposedAttribute", V8TestInterface::SecureContextWindowExposedAttributeAttributeGetterCallback, V8TestInterface::SecureContextWindowExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialSecureContextWindowExposedAttribute", V8TestInterface::PartialSecureContextWindowExposedAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextWindowExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWindowExposedAttribute", V8TestInterface::SecureContextWindowExposedAttributeAttributeGetterCallback, V8TestInterface::SecureContextWindowExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -4703,8 +4703,8 @@ if (RuntimeEnabledFeatures::SecureFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "partialSecureContextWindowExposedRuntimeEnabledAttribute", V8TestInterface::PartialSecureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "secureContextWindowExposedRuntimeEnabledAttribute", V8TestInterface::SecureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::SecureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialSecureContextWindowExposedRuntimeEnabledAttribute", V8TestInterface::PartialSecureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWindowExposedRuntimeEnabledAttribute", V8TestInterface::SecureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::SecureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -4716,7 +4716,7 @@ if (execution_context && (execution_context->IsWorkerGlobalScope())) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "workerExposedAttribute", V8TestInterface::WorkerExposedAttributeAttributeGetterCallback, V8TestInterface::WorkerExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "workerExposedAttribute", V8TestInterface::WorkerExposedAttributeAttributeGetterCallback, V8TestInterface::WorkerExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -4726,8 +4726,8 @@ if (is_secure_context) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "partialSecureContextWorkerExposedAttribute", V8TestInterface::PartialSecureContextWorkerExposedAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextWorkerExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "secureContextWorkerExposedAttribute", V8TestInterface::SecureContextWorkerExposedAttributeAttributeGetterCallback, V8TestInterface::SecureContextWorkerExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialSecureContextWorkerExposedAttribute", V8TestInterface::PartialSecureContextWorkerExposedAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextWorkerExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWorkerExposedAttribute", V8TestInterface::SecureContextWorkerExposedAttributeAttributeGetterCallback, V8TestInterface::SecureContextWorkerExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -4737,8 +4737,8 @@ if (RuntimeEnabledFeatures::SecureFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "partialSecureContextWorkerExposedRuntimeEnabledAttribute", V8TestInterface::PartialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "secureContextWorkerExposedRuntimeEnabledAttribute", V8TestInterface::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partialSecureContextWorkerExposedRuntimeEnabledAttribute", V8TestInterface::PartialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::PartialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWorkerExposedRuntimeEnabledAttribute", V8TestInterface::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterface::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_2.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_2.cc index bab13e4..d33909f 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_2.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_2.cc
@@ -774,7 +774,7 @@ static_assert(1 == TestInterface2::kConstValue1, "the value of TestInterface2_kConstValue1 does not match with implementation"); static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "size", V8TestInterface2::SizeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::DontEnum | v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "size", V8TestInterface2::SizeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::DontEnum | v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_check_security.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_check_security.cc index 6aa469b..13327e8 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_check_security.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_check_security.cc
@@ -757,8 +757,8 @@ kAttributeConfigurations, base::size(kAttributeConfigurations)); static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "readonlyLongAttribute", V8TestInterfaceCheckSecurity::ReadonlyLongAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "longAttribute", V8TestInterfaceCheckSecurity::LongAttributeAttributeGetterCallback, V8TestInterfaceCheckSecurity::LongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyLongAttribute", V8TestInterfaceCheckSecurity::ReadonlyLongAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "longAttribute", V8TestInterfaceCheckSecurity::LongAttributeAttributeGetterCallback, V8TestInterfaceCheckSecurity::LongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_conditional_secure_context.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_conditional_secure_context.cc index c1b61b38..f065749 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_conditional_secure_context.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_conditional_secure_context.cc
@@ -487,7 +487,7 @@ if (is_secure_context || !RuntimeEnabledFeatures::SecureContextnessFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextAttribute", V8TestInterfaceConditionalSecureContext::SecureContextAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextAttribute", V8TestInterfaceConditionalSecureContext::SecureContextAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -497,7 +497,7 @@ if (RuntimeEnabledFeatures::SecureFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextRuntimeEnabledAttribute", V8TestInterfaceConditionalSecureContext::SecureContextRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextRuntimeEnabledAttribute", V8TestInterfaceConditionalSecureContext::SecureContextRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -509,7 +509,7 @@ if (is_secure_context || !RuntimeEnabledFeatures::SecureContextnessFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextWindowExposedAttribute", V8TestInterfaceConditionalSecureContext::SecureContextWindowExposedAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextWindowExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWindowExposedAttribute", V8TestInterfaceConditionalSecureContext::SecureContextWindowExposedAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextWindowExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -519,7 +519,7 @@ if (RuntimeEnabledFeatures::SecureFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextWindowExposedRuntimeEnabledAttribute", V8TestInterfaceConditionalSecureContext::SecureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWindowExposedRuntimeEnabledAttribute", V8TestInterfaceConditionalSecureContext::SecureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -532,7 +532,7 @@ if (is_secure_context || !RuntimeEnabledFeatures::SecureContextnessFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextWorkerExposedAttribute", V8TestInterfaceConditionalSecureContext::SecureContextWorkerExposedAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextWorkerExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWorkerExposedAttribute", V8TestInterfaceConditionalSecureContext::SecureContextWorkerExposedAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextWorkerExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -542,7 +542,7 @@ if (RuntimeEnabledFeatures::SecureFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextWorkerExposedRuntimeEnabledAttribute", V8TestInterfaceConditionalSecureContext::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWorkerExposedRuntimeEnabledAttribute", V8TestInterfaceConditionalSecureContext::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceConditionalSecureContext::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_document.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_document.cc index 7669829..70e3f04 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_document.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_document.cc
@@ -142,7 +142,7 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "location", V8TestInterfaceDocument::LocationAttributeGetterCallback, V8TestInterfaceDocument::LocationAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasNoSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "location", V8TestInterfaceDocument::LocationAttributeGetterCallback, V8TestInterfaceDocument::LocationAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasNoSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_event_init_constructor.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_event_init_constructor.cc index db69a61c..4b6dfce9 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_event_init_constructor.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_event_init_constructor.cc
@@ -165,8 +165,8 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "readonlyStringAttribute", V8TestInterfaceEventInitConstructor::ReadonlyStringAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "isTrusted", V8TestInterfaceEventInitConstructor::IsTrustedAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyStringAttribute", V8TestInterfaceEventInitConstructor::ReadonlyStringAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "isTrusted", V8TestInterfaceEventInitConstructor::IsTrustedAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_node.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_node.cc index cd971aa..f206a21 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_node.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_node.cc
@@ -544,14 +544,14 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "nodeName", V8TestInterfaceNode::NodeNameAttributeGetterCallback, V8TestInterfaceNode::NodeNameAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "stringAttribute", V8TestInterfaceNode::StringAttributeAttributeGetterCallback, V8TestInterfaceNode::StringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "readonlyTestInterfaceEmptyAttribute", V8TestInterfaceNode::ReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "eventHandlerAttribute", V8TestInterfaceNode::EventHandlerAttributeAttributeGetterCallback, V8TestInterfaceNode::EventHandlerAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "perWorldBindingsReadonlyTestInterfaceEmptyAttribute", V8TestInterfaceNode::PerWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, - { "perWorldBindingsReadonlyTestInterfaceEmptyAttribute", V8TestInterfaceNode::PerWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, - { "reflectStringAttribute", V8TestInterfaceNode::ReflectStringAttributeAttributeGetterCallback, V8TestInterfaceNode::ReflectStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectUrlStringAttribute", V8TestInterfaceNode::ReflectUrlStringAttributeAttributeGetterCallback, V8TestInterfaceNode::ReflectUrlStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "nodeName", V8TestInterfaceNode::NodeNameAttributeGetterCallback, V8TestInterfaceNode::NodeNameAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "stringAttribute", V8TestInterfaceNode::StringAttributeAttributeGetterCallback, V8TestInterfaceNode::StringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyTestInterfaceEmptyAttribute", V8TestInterfaceNode::ReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "eventHandlerAttribute", V8TestInterfaceNode::EventHandlerAttributeAttributeGetterCallback, V8TestInterfaceNode::EventHandlerAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "perWorldBindingsReadonlyTestInterfaceEmptyAttribute", V8TestInterfaceNode::PerWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, + { "perWorldBindingsReadonlyTestInterfaceEmptyAttribute", V8TestInterfaceNode::PerWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, + { "reflectStringAttribute", V8TestInterfaceNode::ReflectStringAttributeAttributeGetterCallback, V8TestInterfaceNode::ReflectStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectUrlStringAttribute", V8TestInterfaceNode::ReflectUrlStringAttributeAttributeGetterCallback, V8TestInterfaceNode::ReflectUrlStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_origin_trial_enabled.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_origin_trial_enabled.cc index 0f93909e..8c049b9d 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_origin_trial_enabled.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_origin_trial_enabled.cc
@@ -331,8 +331,8 @@ static_assert(1 == TestInterfaceOriginTrialEnabled::kConstJavascript, "the value of TestInterfaceOriginTrialEnabled_kConstJavascript does not match with implementation"); static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "doubleAttribute", V8TestInterfaceOriginTrialEnabled::DoubleAttributeAttributeGetterCallback, V8TestInterfaceOriginTrialEnabled::DoubleAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticStringAttribute", V8TestInterfaceOriginTrialEnabled::StaticStringAttributeAttributeGetterCallback, V8TestInterfaceOriginTrialEnabled::StaticStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "doubleAttribute", V8TestInterfaceOriginTrialEnabled::DoubleAttributeAttributeGetterCallback, V8TestInterfaceOriginTrialEnabled::DoubleAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticStringAttribute", V8TestInterfaceOriginTrialEnabled::StaticStringAttributeAttributeGetterCallback, V8TestInterfaceOriginTrialEnabled::StaticStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -364,9 +364,9 @@ if (RuntimeEnabledFeatures::RuntimeFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "conditionalReadOnlyLongAttribute", V8TestInterfaceOriginTrialEnabled::ConditionalReadOnlyLongAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticConditionalReadOnlyLongAttribute", V8TestInterfaceOriginTrialEnabled::StaticConditionalReadOnlyLongAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "conditionalLongAttribute", V8TestInterfaceOriginTrialEnabled::ConditionalLongAttributeAttributeGetterCallback, V8TestInterfaceOriginTrialEnabled::ConditionalLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "conditionalReadOnlyLongAttribute", V8TestInterfaceOriginTrialEnabled::ConditionalReadOnlyLongAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticConditionalReadOnlyLongAttribute", V8TestInterfaceOriginTrialEnabled::StaticConditionalReadOnlyLongAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "conditionalLongAttribute", V8TestInterfaceOriginTrialEnabled::ConditionalLongAttributeAttributeGetterCallback, V8TestInterfaceOriginTrialEnabled::ConditionalLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_secure_context.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_secure_context.cc index df668b7..0c72d17 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_secure_context.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_secure_context.cc
@@ -487,7 +487,7 @@ if (is_secure_context) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextAttribute", V8TestInterfaceSecureContext::SecureContextAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextAttribute", V8TestInterfaceSecureContext::SecureContextAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -497,7 +497,7 @@ if (RuntimeEnabledFeatures::SecureFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextRuntimeEnabledAttribute", V8TestInterfaceSecureContext::SecureContextRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextRuntimeEnabledAttribute", V8TestInterfaceSecureContext::SecureContextRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -509,7 +509,7 @@ if (is_secure_context) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextWindowExposedAttribute", V8TestInterfaceSecureContext::SecureContextWindowExposedAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextWindowExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWindowExposedAttribute", V8TestInterfaceSecureContext::SecureContextWindowExposedAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextWindowExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -519,7 +519,7 @@ if (RuntimeEnabledFeatures::SecureFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextWindowExposedRuntimeEnabledAttribute", V8TestInterfaceSecureContext::SecureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWindowExposedRuntimeEnabledAttribute", V8TestInterfaceSecureContext::SecureContextWindowExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextWindowExposedRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -532,7 +532,7 @@ if (is_secure_context) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextWorkerExposedAttribute", V8TestInterfaceSecureContext::SecureContextWorkerExposedAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextWorkerExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWorkerExposedAttribute", V8TestInterfaceSecureContext::SecureContextWorkerExposedAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextWorkerExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -542,7 +542,7 @@ if (RuntimeEnabledFeatures::SecureFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "secureContextWorkerExposedRuntimeEnabledAttribute", V8TestInterfaceSecureContext::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "secureContextWorkerExposedRuntimeEnabledAttribute", V8TestInterfaceSecureContext::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetterCallback, V8TestInterfaceSecureContext::SecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_node.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_node.cc index a65c58c9..dfe05ef 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_node.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_node.cc
@@ -287,10 +287,10 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "href", V8TestNode::HrefAttributeGetterCallback, V8TestNode::HrefAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "hrefThrows", V8TestNode::HrefThrowsAttributeGetterCallback, V8TestNode::HrefThrowsAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "hrefCallWith", V8TestNode::HrefCallWithAttributeGetterCallback, V8TestNode::HrefCallWithAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "hrefByteString", V8TestNode::HrefByteStringAttributeGetterCallback, V8TestNode::HrefByteStringAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "href", V8TestNode::HrefAttributeGetterCallback, V8TestNode::HrefAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "hrefThrows", V8TestNode::HrefThrowsAttributeGetterCallback, V8TestNode::HrefThrowsAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "hrefCallWith", V8TestNode::HrefCallWithAttributeGetterCallback, V8TestNode::HrefCallWithAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "hrefByteString", V8TestNode::HrefByteStringAttributeGetterCallback, V8TestNode::HrefByteStringAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_object.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_object.cc index 012ddbf..94a3027 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_object.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_object.cc
@@ -13190,153 +13190,153 @@ kAttributeConfigurations, base::size(kAttributeConfigurations)); static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "stringifierAttribute", V8TestObject::StringifierAttributeAttributeGetterCallback, V8TestObject::StringifierAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "readonlyStringAttribute", V8TestObject::ReadonlyStringAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "readonlyTestInterfaceEmptyAttribute", V8TestObject::ReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "readonlyLongAttribute", V8TestObject::ReadonlyLongAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "stringAttribute", V8TestObject::StringAttributeAttributeGetterCallback, V8TestObject::StringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "byteStringAttribute", V8TestObject::ByteStringAttributeAttributeGetterCallback, V8TestObject::ByteStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "usvStringAttribute", V8TestObject::UsvStringAttributeAttributeGetterCallback, V8TestObject::UsvStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "domTimeStampAttribute", V8TestObject::DOMTimeStampAttributeAttributeGetterCallback, V8TestObject::DOMTimeStampAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "booleanAttribute", V8TestObject::BooleanAttributeAttributeGetterCallback, V8TestObject::BooleanAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "byteAttribute", V8TestObject::ByteAttributeAttributeGetterCallback, V8TestObject::ByteAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "doubleAttribute", V8TestObject::DoubleAttributeAttributeGetterCallback, V8TestObject::DoubleAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "floatAttribute", V8TestObject::FloatAttributeAttributeGetterCallback, V8TestObject::FloatAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "longAttribute", V8TestObject::LongAttributeAttributeGetterCallback, V8TestObject::LongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "longLongAttribute", V8TestObject::LongLongAttributeAttributeGetterCallback, V8TestObject::LongLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "octetAttribute", V8TestObject::OctetAttributeAttributeGetterCallback, V8TestObject::OctetAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "shortAttribute", V8TestObject::ShortAttributeAttributeGetterCallback, V8TestObject::ShortAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unrestrictedDoubleAttribute", V8TestObject::UnrestrictedDoubleAttributeAttributeGetterCallback, V8TestObject::UnrestrictedDoubleAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unrestrictedFloatAttribute", V8TestObject::UnrestrictedFloatAttributeAttributeGetterCallback, V8TestObject::UnrestrictedFloatAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unsignedLongAttribute", V8TestObject::UnsignedLongAttributeAttributeGetterCallback, V8TestObject::UnsignedLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unsignedLongLongAttribute", V8TestObject::UnsignedLongLongAttributeAttributeGetterCallback, V8TestObject::UnsignedLongLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unsignedShortAttribute", V8TestObject::UnsignedShortAttributeAttributeGetterCallback, V8TestObject::UnsignedShortAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testInterfaceEmptyAttribute", V8TestObject::TestInterfaceEmptyAttributeAttributeGetterCallback, V8TestObject::TestInterfaceEmptyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testObjectAttribute", V8TestObject::TestObjectAttributeAttributeGetterCallback, V8TestObject::TestObjectAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "cssAttribute", V8TestObject::CSSAttributeAttributeGetterCallback, V8TestObject::CSSAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "imeAttribute", V8TestObject::ImeAttributeAttributeGetterCallback, V8TestObject::ImeAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "svgAttribute", V8TestObject::SVGAttributeAttributeGetterCallback, V8TestObject::SVGAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "xmlAttribute", V8TestObject::XmlAttributeAttributeGetterCallback, V8TestObject::XmlAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "nodeFilterAttribute", V8TestObject::NodeFilterAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "anyAttribute", V8TestObject::AnyAttributeAttributeGetterCallback, V8TestObject::AnyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "promiseAttribute", V8TestObject::PromiseAttributeAttributeGetterCallback, V8TestObject::PromiseAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "windowAttribute", V8TestObject::WindowAttributeAttributeGetterCallback, V8TestObject::WindowAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "documentAttribute", V8TestObject::DocumentAttributeAttributeGetterCallback, V8TestObject::DocumentAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "documentFragmentAttribute", V8TestObject::DocumentFragmentAttributeAttributeGetterCallback, V8TestObject::DocumentFragmentAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "documentTypeAttribute", V8TestObject::DocumentTypeAttributeAttributeGetterCallback, V8TestObject::DocumentTypeAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "elementAttribute", V8TestObject::ElementAttributeAttributeGetterCallback, V8TestObject::ElementAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "nodeAttribute", V8TestObject::NodeAttributeAttributeGetterCallback, V8TestObject::NodeAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "shadowRootAttribute", V8TestObject::ShadowRootAttributeAttributeGetterCallback, V8TestObject::ShadowRootAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "arrayBufferAttribute", V8TestObject::ArrayBufferAttributeAttributeGetterCallback, V8TestObject::ArrayBufferAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "float32ArrayAttribute", V8TestObject::Float32ArrayAttributeAttributeGetterCallback, V8TestObject::Float32ArrayAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "uint8ArrayAttribute", V8TestObject::Uint8ArrayAttributeAttributeGetterCallback, V8TestObject::Uint8ArrayAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "self", V8TestObject::SelfAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "readonlyEventTargetAttribute", V8TestObject::ReadonlyEventTargetAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "readonlyEventTargetOrNullAttribute", V8TestObject::ReadonlyEventTargetOrNullAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "readonlyWindowAttribute", V8TestObject::ReadonlyWindowAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "htmlCollectionAttribute", V8TestObject::HTMLCollectionAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "htmlElementAttribute", V8TestObject::HTMLElementAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "stringFrozenArrayAttribute", V8TestObject::StringFrozenArrayAttributeAttributeGetterCallback, V8TestObject::StringFrozenArrayAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testInterfaceEmptyFrozenArrayAttribute", V8TestObject::TestInterfaceEmptyFrozenArrayAttributeAttributeGetterCallback, V8TestObject::TestInterfaceEmptyFrozenArrayAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "booleanOrNullAttribute", V8TestObject::BooleanOrNullAttributeAttributeGetterCallback, V8TestObject::BooleanOrNullAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "stringOrNullAttribute", V8TestObject::StringOrNullAttributeAttributeGetterCallback, V8TestObject::StringOrNullAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "longOrNullAttribute", V8TestObject::LongOrNullAttributeAttributeGetterCallback, V8TestObject::LongOrNullAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testInterfaceOrNullAttribute", V8TestObject::TestInterfaceOrNullAttributeAttributeGetterCallback, V8TestObject::TestInterfaceOrNullAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testEnumAttribute", V8TestObject::TestEnumAttributeAttributeGetterCallback, V8TestObject::TestEnumAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testEnumOrNullAttribute", V8TestObject::TestEnumOrNullAttributeAttributeGetterCallback, V8TestObject::TestEnumOrNullAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticStringAttribute", V8TestObject::StaticStringAttributeAttributeGetterCallback, V8TestObject::StaticStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticLongAttribute", V8TestObject::StaticLongAttributeAttributeGetterCallback, V8TestObject::StaticLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "eventHandlerAttribute", V8TestObject::EventHandlerAttributeAttributeGetterCallback, V8TestObject::EventHandlerAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "doubleOrStringAttribute", V8TestObject::DoubleOrStringAttributeAttributeGetterCallback, V8TestObject::DoubleOrStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "doubleOrStringOrNullAttribute", V8TestObject::DoubleOrStringOrNullAttributeAttributeGetterCallback, V8TestObject::DoubleOrStringOrNullAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "doubleOrNullStringAttribute", V8TestObject::DoubleOrNullStringAttributeAttributeGetterCallback, V8TestObject::DoubleOrNullStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "stringOrStringSequenceAttribute", V8TestObject::StringOrStringSequenceAttributeAttributeGetterCallback, V8TestObject::StringOrStringSequenceAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testEnumOrDoubleAttribute", V8TestObject::TestEnumOrDoubleAttributeAttributeGetterCallback, V8TestObject::TestEnumOrDoubleAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unrestrictedDoubleOrStringAttribute", V8TestObject::UnrestrictedDoubleOrStringAttributeAttributeGetterCallback, V8TestObject::UnrestrictedDoubleOrStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "nestedUnionAtribute", V8TestObject::NestedUnionAtributeAttributeGetterCallback, V8TestObject::NestedUnionAtributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "activityLoggingAccessForAllWorldsLongAttribute", V8TestObject::ActivityLoggingAccessForAllWorldsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingAccessForAllWorldsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "activityLoggingGetterForAllWorldsLongAttribute", V8TestObject::ActivityLoggingGetterForAllWorldsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingGetterForAllWorldsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "activityLoggingSetterForAllWorldsLongAttribute", V8TestObject::ActivityLoggingSetterForAllWorldsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingSetterForAllWorldsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "cachedAttributeAnyAttribute", V8TestObject::CachedAttributeAnyAttributeAttributeGetterCallback, V8TestObject::CachedAttributeAnyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "cachedArrayAttribute", V8TestObject::CachedArrayAttributeAttributeGetterCallback, V8TestObject::CachedArrayAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "readonlyCachedAttribute", V8TestObject::ReadonlyCachedAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "cachedStringOrNoneAttribute", V8TestObject::CachedStringOrNoneAttributeAttributeGetterCallback, V8TestObject::CachedStringOrNoneAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "callWithExecutionContextAnyAttribute", V8TestObject::CallWithExecutionContextAnyAttributeAttributeGetterCallback, V8TestObject::CallWithExecutionContextAnyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "callWithScriptStateAnyAttribute", V8TestObject::CallWithScriptStateAnyAttributeAttributeGetterCallback, V8TestObject::CallWithScriptStateAnyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "callWithExecutionContextAndScriptStateAndIsolateAnyAttribute", V8TestObject::CallWithExecutionContextAndScriptStateAndIsolateAnyAttributeAttributeGetterCallback, V8TestObject::CallWithExecutionContextAndScriptStateAndIsolateAnyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "checkSecurityForNodeReadonlyDocumentAttribute", V8TestObject::CheckSecurityForNodeReadonlyDocumentAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "customObjectAttribute", V8TestObject::CustomObjectAttributeAttributeGetterCallback, V8TestObject::CustomObjectAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "customGetterLongAttribute", V8TestObject::CustomGetterLongAttributeAttributeGetterCallback, V8TestObject::CustomGetterLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "customGetterReadonlyObjectAttribute", V8TestObject::CustomGetterReadonlyObjectAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "customSetterLongAttribute", V8TestObject::CustomSetterLongAttributeAttributeGetterCallback, V8TestObject::CustomSetterLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "deprecatedLongAttribute", V8TestObject::DeprecatedLongAttributeAttributeGetterCallback, V8TestObject::DeprecatedLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "enforceRangeLongAttribute", V8TestObject::EnforceRangeLongAttributeAttributeGetterCallback, V8TestObject::EnforceRangeLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "implementedAsLongAttribute", V8TestObject::ImplementedAsLongAttributeAttributeGetterCallback, V8TestObject::ImplementedAsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "customImplementedAsLongAttribute", V8TestObject::CustomImplementedAsLongAttributeAttributeGetterCallback, V8TestObject::CustomImplementedAsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "customGetterImplementedAsLongAttribute", V8TestObject::CustomGetterImplementedAsLongAttributeAttributeGetterCallback, V8TestObject::CustomGetterImplementedAsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "customSetterImplementedAsLongAttribute", V8TestObject::CustomSetterImplementedAsLongAttributeAttributeGetterCallback, V8TestObject::CustomSetterImplementedAsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "measureAsLongAttribute", V8TestObject::MeasureAsLongAttributeAttributeGetterCallback, V8TestObject::MeasureAsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "notEnumerableLongAttribute", V8TestObject::NotEnumerableLongAttributeAttributeGetterCallback, V8TestObject::NotEnumerableLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "perWorldBindingsReadonlyTestInterfaceEmptyAttribute", V8TestObject::PerWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, - { "perWorldBindingsReadonlyTestInterfaceEmptyAttribute", V8TestObject::PerWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, - { "activityLoggingAccessPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, V8TestObject::ActivityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, - { "activityLoggingAccessPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, - { "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, V8TestObject::ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, - { "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, - { "activityLoggingGetterPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, V8TestObject::ActivityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, - { "activityLoggingGetterPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, - { "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, V8TestObject::ActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, - { "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, - { "location", V8TestObject::LocationAttributeGetterCallback, V8TestObject::LocationAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "locationWithException", V8TestObject::LocationWithExceptionAttributeGetterCallback, V8TestObject::LocationWithExceptionAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "locationWithCallWith", V8TestObject::LocationWithCallWithAttributeGetterCallback, V8TestObject::LocationWithCallWithAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "locationByteString", V8TestObject::LocationByteStringAttributeGetterCallback, V8TestObject::LocationByteStringAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "locationWithPerWorldBindings", V8TestObject::LocationWithPerWorldBindingsAttributeGetterCallbackForMainWorld, V8TestObject::LocationWithPerWorldBindingsAttributeSetterCallbackForMainWorld, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, - { "locationWithPerWorldBindings", V8TestObject::LocationWithPerWorldBindingsAttributeGetterCallback, V8TestObject::LocationWithPerWorldBindingsAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, - { "raisesExceptionLongAttribute", V8TestObject::RaisesExceptionLongAttributeAttributeGetterCallback, V8TestObject::RaisesExceptionLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "raisesExceptionGetterLongAttribute", V8TestObject::RaisesExceptionGetterLongAttributeAttributeGetterCallback, V8TestObject::RaisesExceptionGetterLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "setterRaisesExceptionLongAttribute", V8TestObject::SetterRaisesExceptionLongAttributeAttributeGetterCallback, V8TestObject::SetterRaisesExceptionLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "raisesExceptionTestInterfaceEmptyAttribute", V8TestObject::RaisesExceptionTestInterfaceEmptyAttributeAttributeGetterCallback, V8TestObject::RaisesExceptionTestInterfaceEmptyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "cachedAttributeRaisesExceptionGetterAnyAttribute", V8TestObject::CachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetterCallback, V8TestObject::CachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectTestInterfaceAttribute", V8TestObject::ReflectTestInterfaceAttributeAttributeGetterCallback, V8TestObject::ReflectTestInterfaceAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectReflectedNameAttributeTestAttribute", V8TestObject::ReflectReflectedNameAttributeTestAttributeAttributeGetterCallback, V8TestObject::ReflectReflectedNameAttributeTestAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectBooleanAttribute", V8TestObject::ReflectBooleanAttributeAttributeGetterCallback, V8TestObject::ReflectBooleanAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectLongAttribute", V8TestObject::ReflectLongAttributeAttributeGetterCallback, V8TestObject::ReflectLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectUnsignedShortAttribute", V8TestObject::ReflectUnsignedShortAttributeAttributeGetterCallback, V8TestObject::ReflectUnsignedShortAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectUnsignedLongAttribute", V8TestObject::ReflectUnsignedLongAttributeAttributeGetterCallback, V8TestObject::ReflectUnsignedLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "id", V8TestObject::IdAttributeGetterCallback, V8TestObject::IdAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "name", V8TestObject::NameAttributeGetterCallback, V8TestObject::NameAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "class", V8TestObject::ClassAttributeGetterCallback, V8TestObject::ClassAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectedId", V8TestObject::ReflectedIdAttributeGetterCallback, V8TestObject::ReflectedIdAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectedName", V8TestObject::ReflectedNameAttributeGetterCallback, V8TestObject::ReflectedNameAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "reflectedClass", V8TestObject::ReflectedClassAttributeGetterCallback, V8TestObject::ReflectedClassAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "limitedToOnlyOneAttribute", V8TestObject::LimitedToOnlyOneAttributeAttributeGetterCallback, V8TestObject::LimitedToOnlyOneAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "limitedToOnlyAttribute", V8TestObject::LimitedToOnlyAttributeAttributeGetterCallback, V8TestObject::LimitedToOnlyAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "limitedToOnlyOtherAttribute", V8TestObject::LimitedToOnlyOtherAttributeAttributeGetterCallback, V8TestObject::LimitedToOnlyOtherAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "limitedWithMissingDefaultAttribute", V8TestObject::LimitedWithMissingDefaultAttributeAttributeGetterCallback, V8TestObject::LimitedWithMissingDefaultAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "limitedWithInvalidMissingDefaultAttribute", V8TestObject::LimitedWithInvalidMissingDefaultAttributeAttributeGetterCallback, V8TestObject::LimitedWithInvalidMissingDefaultAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "corsSettingAttribute", V8TestObject::CorsSettingAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "limitedWithEmptyMissingInvalidAttribute", V8TestObject::LimitedWithEmptyMissingInvalidAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "RuntimeCallStatsCounterAttribute", V8TestObject::RuntimeCallStatsCounterAttributeAttributeGetterCallback, V8TestObject::RuntimeCallStatsCounterAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "RuntimeCallStatsCounterReadOnlyAttribute", V8TestObject::RuntimeCallStatsCounterReadOnlyAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "replaceableReadonlyLongAttribute", V8TestObject::ReplaceableReadonlyLongAttributeAttributeGetterCallback, V8TestObject::ReplaceableReadonlyLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "locationPutForwards", V8TestObject::LocationPutForwardsAttributeGetterCallback, V8TestObject::LocationPutForwardsAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "setterCallWithExecutionContextStringAttribute", V8TestObject::SetterCallWithExecutionContextStringAttributeAttributeGetterCallback, V8TestObject::SetterCallWithExecutionContextStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "treatNullAsEmptyStringStringAttribute", V8TestObject::TreatNullAsEmptyStringStringAttributeAttributeGetterCallback, V8TestObject::TreatNullAsEmptyStringStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "urlStringAttribute", V8TestObject::UrlStringAttributeAttributeGetterCallback, V8TestObject::UrlStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "urlStringAttribute", V8TestObject::UrlStringAttributeAttributeGetterCallback, V8TestObject::UrlStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unforgeableLongAttribute", V8TestObject::UnforgeableLongAttributeAttributeGetterCallback, V8TestObject::UnforgeableLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "measuredLongAttribute", V8TestObject::MeasuredLongAttributeAttributeGetterCallback, V8TestObject::MeasuredLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "sameObjectAttribute", V8TestObject::SameObjectAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "saveSameObjectAttribute", V8TestObject::SaveSameObjectAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticSaveSameObjectAttribute", V8TestObject::StaticSaveSameObjectAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unscopableLongAttribute", V8TestObject::UnscopableLongAttributeAttributeGetterCallback, V8TestObject::UnscopableLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "highEntropyAttributeWithMeasure", V8TestObject::HighEntropyAttributeWithMeasureAttributeGetterCallback, V8TestObject::HighEntropyAttributeWithMeasureAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "highEntropyReadonlyAttributeWithMeasure", V8TestObject::HighEntropyReadonlyAttributeWithMeasureAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "highEntropyAttributeWithMeasureAs", V8TestObject::HighEntropyAttributeWithMeasureAsAttributeGetterCallback, V8TestObject::HighEntropyAttributeWithMeasureAsAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "highEntropyReadonlyAttributeWithMeasureAs", V8TestObject::HighEntropyReadonlyAttributeWithMeasureAsAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "testInterfaceAttribute", V8TestObject::TestInterfaceAttributeAttributeGetterCallback, V8TestObject::TestInterfaceAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "size", V8TestObject::SizeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::DontEnum | v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "stringifierAttribute", V8TestObject::StringifierAttributeAttributeGetterCallback, V8TestObject::StringifierAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyStringAttribute", V8TestObject::ReadonlyStringAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyTestInterfaceEmptyAttribute", V8TestObject::ReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyLongAttribute", V8TestObject::ReadonlyLongAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "stringAttribute", V8TestObject::StringAttributeAttributeGetterCallback, V8TestObject::StringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "byteStringAttribute", V8TestObject::ByteStringAttributeAttributeGetterCallback, V8TestObject::ByteStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "usvStringAttribute", V8TestObject::UsvStringAttributeAttributeGetterCallback, V8TestObject::UsvStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "domTimeStampAttribute", V8TestObject::DOMTimeStampAttributeAttributeGetterCallback, V8TestObject::DOMTimeStampAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "booleanAttribute", V8TestObject::BooleanAttributeAttributeGetterCallback, V8TestObject::BooleanAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "byteAttribute", V8TestObject::ByteAttributeAttributeGetterCallback, V8TestObject::ByteAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "doubleAttribute", V8TestObject::DoubleAttributeAttributeGetterCallback, V8TestObject::DoubleAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "floatAttribute", V8TestObject::FloatAttributeAttributeGetterCallback, V8TestObject::FloatAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "longAttribute", V8TestObject::LongAttributeAttributeGetterCallback, V8TestObject::LongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "longLongAttribute", V8TestObject::LongLongAttributeAttributeGetterCallback, V8TestObject::LongLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "octetAttribute", V8TestObject::OctetAttributeAttributeGetterCallback, V8TestObject::OctetAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "shortAttribute", V8TestObject::ShortAttributeAttributeGetterCallback, V8TestObject::ShortAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unrestrictedDoubleAttribute", V8TestObject::UnrestrictedDoubleAttributeAttributeGetterCallback, V8TestObject::UnrestrictedDoubleAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unrestrictedFloatAttribute", V8TestObject::UnrestrictedFloatAttributeAttributeGetterCallback, V8TestObject::UnrestrictedFloatAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unsignedLongAttribute", V8TestObject::UnsignedLongAttributeAttributeGetterCallback, V8TestObject::UnsignedLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unsignedLongLongAttribute", V8TestObject::UnsignedLongLongAttributeAttributeGetterCallback, V8TestObject::UnsignedLongLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unsignedShortAttribute", V8TestObject::UnsignedShortAttributeAttributeGetterCallback, V8TestObject::UnsignedShortAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testInterfaceEmptyAttribute", V8TestObject::TestInterfaceEmptyAttributeAttributeGetterCallback, V8TestObject::TestInterfaceEmptyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testObjectAttribute", V8TestObject::TestObjectAttributeAttributeGetterCallback, V8TestObject::TestObjectAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "cssAttribute", V8TestObject::CSSAttributeAttributeGetterCallback, V8TestObject::CSSAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "imeAttribute", V8TestObject::ImeAttributeAttributeGetterCallback, V8TestObject::ImeAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "svgAttribute", V8TestObject::SVGAttributeAttributeGetterCallback, V8TestObject::SVGAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "xmlAttribute", V8TestObject::XmlAttributeAttributeGetterCallback, V8TestObject::XmlAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "nodeFilterAttribute", V8TestObject::NodeFilterAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "anyAttribute", V8TestObject::AnyAttributeAttributeGetterCallback, V8TestObject::AnyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "promiseAttribute", V8TestObject::PromiseAttributeAttributeGetterCallback, V8TestObject::PromiseAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kDoNotCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "windowAttribute", V8TestObject::WindowAttributeAttributeGetterCallback, V8TestObject::WindowAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "documentAttribute", V8TestObject::DocumentAttributeAttributeGetterCallback, V8TestObject::DocumentAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "documentFragmentAttribute", V8TestObject::DocumentFragmentAttributeAttributeGetterCallback, V8TestObject::DocumentFragmentAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "documentTypeAttribute", V8TestObject::DocumentTypeAttributeAttributeGetterCallback, V8TestObject::DocumentTypeAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "elementAttribute", V8TestObject::ElementAttributeAttributeGetterCallback, V8TestObject::ElementAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "nodeAttribute", V8TestObject::NodeAttributeAttributeGetterCallback, V8TestObject::NodeAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "shadowRootAttribute", V8TestObject::ShadowRootAttributeAttributeGetterCallback, V8TestObject::ShadowRootAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "arrayBufferAttribute", V8TestObject::ArrayBufferAttributeAttributeGetterCallback, V8TestObject::ArrayBufferAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "float32ArrayAttribute", V8TestObject::Float32ArrayAttributeAttributeGetterCallback, V8TestObject::Float32ArrayAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "uint8ArrayAttribute", V8TestObject::Uint8ArrayAttributeAttributeGetterCallback, V8TestObject::Uint8ArrayAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "self", V8TestObject::SelfAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyEventTargetAttribute", V8TestObject::ReadonlyEventTargetAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyEventTargetOrNullAttribute", V8TestObject::ReadonlyEventTargetOrNullAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyWindowAttribute", V8TestObject::ReadonlyWindowAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "htmlCollectionAttribute", V8TestObject::HTMLCollectionAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "htmlElementAttribute", V8TestObject::HTMLElementAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "stringFrozenArrayAttribute", V8TestObject::StringFrozenArrayAttributeAttributeGetterCallback, V8TestObject::StringFrozenArrayAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testInterfaceEmptyFrozenArrayAttribute", V8TestObject::TestInterfaceEmptyFrozenArrayAttributeAttributeGetterCallback, V8TestObject::TestInterfaceEmptyFrozenArrayAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "booleanOrNullAttribute", V8TestObject::BooleanOrNullAttributeAttributeGetterCallback, V8TestObject::BooleanOrNullAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "stringOrNullAttribute", V8TestObject::StringOrNullAttributeAttributeGetterCallback, V8TestObject::StringOrNullAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "longOrNullAttribute", V8TestObject::LongOrNullAttributeAttributeGetterCallback, V8TestObject::LongOrNullAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testInterfaceOrNullAttribute", V8TestObject::TestInterfaceOrNullAttributeAttributeGetterCallback, V8TestObject::TestInterfaceOrNullAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testEnumAttribute", V8TestObject::TestEnumAttributeAttributeGetterCallback, V8TestObject::TestEnumAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testEnumOrNullAttribute", V8TestObject::TestEnumOrNullAttributeAttributeGetterCallback, V8TestObject::TestEnumOrNullAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticStringAttribute", V8TestObject::StaticStringAttributeAttributeGetterCallback, V8TestObject::StaticStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticLongAttribute", V8TestObject::StaticLongAttributeAttributeGetterCallback, V8TestObject::StaticLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "eventHandlerAttribute", V8TestObject::EventHandlerAttributeAttributeGetterCallback, V8TestObject::EventHandlerAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "doubleOrStringAttribute", V8TestObject::DoubleOrStringAttributeAttributeGetterCallback, V8TestObject::DoubleOrStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "doubleOrStringOrNullAttribute", V8TestObject::DoubleOrStringOrNullAttributeAttributeGetterCallback, V8TestObject::DoubleOrStringOrNullAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "doubleOrNullStringAttribute", V8TestObject::DoubleOrNullStringAttributeAttributeGetterCallback, V8TestObject::DoubleOrNullStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "stringOrStringSequenceAttribute", V8TestObject::StringOrStringSequenceAttributeAttributeGetterCallback, V8TestObject::StringOrStringSequenceAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testEnumOrDoubleAttribute", V8TestObject::TestEnumOrDoubleAttributeAttributeGetterCallback, V8TestObject::TestEnumOrDoubleAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unrestrictedDoubleOrStringAttribute", V8TestObject::UnrestrictedDoubleOrStringAttributeAttributeGetterCallback, V8TestObject::UnrestrictedDoubleOrStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "nestedUnionAtribute", V8TestObject::NestedUnionAtributeAttributeGetterCallback, V8TestObject::NestedUnionAtributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "activityLoggingAccessForAllWorldsLongAttribute", V8TestObject::ActivityLoggingAccessForAllWorldsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingAccessForAllWorldsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "activityLoggingGetterForAllWorldsLongAttribute", V8TestObject::ActivityLoggingGetterForAllWorldsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingGetterForAllWorldsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "activityLoggingSetterForAllWorldsLongAttribute", V8TestObject::ActivityLoggingSetterForAllWorldsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingSetterForAllWorldsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "cachedAttributeAnyAttribute", V8TestObject::CachedAttributeAnyAttributeAttributeGetterCallback, V8TestObject::CachedAttributeAnyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "cachedArrayAttribute", V8TestObject::CachedArrayAttributeAttributeGetterCallback, V8TestObject::CachedArrayAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "readonlyCachedAttribute", V8TestObject::ReadonlyCachedAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "cachedStringOrNoneAttribute", V8TestObject::CachedStringOrNoneAttributeAttributeGetterCallback, V8TestObject::CachedStringOrNoneAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "callWithExecutionContextAnyAttribute", V8TestObject::CallWithExecutionContextAnyAttributeAttributeGetterCallback, V8TestObject::CallWithExecutionContextAnyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "callWithScriptStateAnyAttribute", V8TestObject::CallWithScriptStateAnyAttributeAttributeGetterCallback, V8TestObject::CallWithScriptStateAnyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "callWithExecutionContextAndScriptStateAndIsolateAnyAttribute", V8TestObject::CallWithExecutionContextAndScriptStateAndIsolateAnyAttributeAttributeGetterCallback, V8TestObject::CallWithExecutionContextAndScriptStateAndIsolateAnyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "checkSecurityForNodeReadonlyDocumentAttribute", V8TestObject::CheckSecurityForNodeReadonlyDocumentAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "customObjectAttribute", V8TestObject::CustomObjectAttributeAttributeGetterCallback, V8TestObject::CustomObjectAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "customGetterLongAttribute", V8TestObject::CustomGetterLongAttributeAttributeGetterCallback, V8TestObject::CustomGetterLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "customGetterReadonlyObjectAttribute", V8TestObject::CustomGetterReadonlyObjectAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "customSetterLongAttribute", V8TestObject::CustomSetterLongAttributeAttributeGetterCallback, V8TestObject::CustomSetterLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "deprecatedLongAttribute", V8TestObject::DeprecatedLongAttributeAttributeGetterCallback, V8TestObject::DeprecatedLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "enforceRangeLongAttribute", V8TestObject::EnforceRangeLongAttributeAttributeGetterCallback, V8TestObject::EnforceRangeLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "implementedAsLongAttribute", V8TestObject::ImplementedAsLongAttributeAttributeGetterCallback, V8TestObject::ImplementedAsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "customImplementedAsLongAttribute", V8TestObject::CustomImplementedAsLongAttributeAttributeGetterCallback, V8TestObject::CustomImplementedAsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "customGetterImplementedAsLongAttribute", V8TestObject::CustomGetterImplementedAsLongAttributeAttributeGetterCallback, V8TestObject::CustomGetterImplementedAsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "customSetterImplementedAsLongAttribute", V8TestObject::CustomSetterImplementedAsLongAttributeAttributeGetterCallback, V8TestObject::CustomSetterImplementedAsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "measureAsLongAttribute", V8TestObject::MeasureAsLongAttributeAttributeGetterCallback, V8TestObject::MeasureAsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "notEnumerableLongAttribute", V8TestObject::NotEnumerableLongAttributeAttributeGetterCallback, V8TestObject::NotEnumerableLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "perWorldBindingsReadonlyTestInterfaceEmptyAttribute", V8TestObject::PerWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, + { "perWorldBindingsReadonlyTestInterfaceEmptyAttribute", V8TestObject::PerWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, + { "activityLoggingAccessPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, V8TestObject::ActivityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, + { "activityLoggingAccessPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, + { "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, V8TestObject::ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, + { "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, + { "activityLoggingGetterPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, V8TestObject::ActivityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, + { "activityLoggingGetterPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, + { "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, V8TestObject::ActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, + { "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", V8TestObject::ActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback, V8TestObject::ActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, + { "location", V8TestObject::LocationAttributeGetterCallback, V8TestObject::LocationAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "locationWithException", V8TestObject::LocationWithExceptionAttributeGetterCallback, V8TestObject::LocationWithExceptionAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "locationWithCallWith", V8TestObject::LocationWithCallWithAttributeGetterCallback, V8TestObject::LocationWithCallWithAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "locationByteString", V8TestObject::LocationByteStringAttributeGetterCallback, V8TestObject::LocationByteStringAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "locationWithPerWorldBindings", V8TestObject::LocationWithPerWorldBindingsAttributeGetterCallbackForMainWorld, V8TestObject::LocationWithPerWorldBindingsAttributeSetterCallbackForMainWorld, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kMainWorld }, + { "locationWithPerWorldBindings", V8TestObject::LocationWithPerWorldBindingsAttributeGetterCallback, V8TestObject::LocationWithPerWorldBindingsAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kNonMainWorlds }, + { "raisesExceptionLongAttribute", V8TestObject::RaisesExceptionLongAttributeAttributeGetterCallback, V8TestObject::RaisesExceptionLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "raisesExceptionGetterLongAttribute", V8TestObject::RaisesExceptionGetterLongAttributeAttributeGetterCallback, V8TestObject::RaisesExceptionGetterLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "setterRaisesExceptionLongAttribute", V8TestObject::SetterRaisesExceptionLongAttributeAttributeGetterCallback, V8TestObject::SetterRaisesExceptionLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "raisesExceptionTestInterfaceEmptyAttribute", V8TestObject::RaisesExceptionTestInterfaceEmptyAttributeAttributeGetterCallback, V8TestObject::RaisesExceptionTestInterfaceEmptyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "cachedAttributeRaisesExceptionGetterAnyAttribute", V8TestObject::CachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetterCallback, V8TestObject::CachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectTestInterfaceAttribute", V8TestObject::ReflectTestInterfaceAttributeAttributeGetterCallback, V8TestObject::ReflectTestInterfaceAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectReflectedNameAttributeTestAttribute", V8TestObject::ReflectReflectedNameAttributeTestAttributeAttributeGetterCallback, V8TestObject::ReflectReflectedNameAttributeTestAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectBooleanAttribute", V8TestObject::ReflectBooleanAttributeAttributeGetterCallback, V8TestObject::ReflectBooleanAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectLongAttribute", V8TestObject::ReflectLongAttributeAttributeGetterCallback, V8TestObject::ReflectLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectUnsignedShortAttribute", V8TestObject::ReflectUnsignedShortAttributeAttributeGetterCallback, V8TestObject::ReflectUnsignedShortAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectUnsignedLongAttribute", V8TestObject::ReflectUnsignedLongAttributeAttributeGetterCallback, V8TestObject::ReflectUnsignedLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "id", V8TestObject::IdAttributeGetterCallback, V8TestObject::IdAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "name", V8TestObject::NameAttributeGetterCallback, V8TestObject::NameAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "class", V8TestObject::ClassAttributeGetterCallback, V8TestObject::ClassAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectedId", V8TestObject::ReflectedIdAttributeGetterCallback, V8TestObject::ReflectedIdAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectedName", V8TestObject::ReflectedNameAttributeGetterCallback, V8TestObject::ReflectedNameAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "reflectedClass", V8TestObject::ReflectedClassAttributeGetterCallback, V8TestObject::ReflectedClassAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "limitedToOnlyOneAttribute", V8TestObject::LimitedToOnlyOneAttributeAttributeGetterCallback, V8TestObject::LimitedToOnlyOneAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "limitedToOnlyAttribute", V8TestObject::LimitedToOnlyAttributeAttributeGetterCallback, V8TestObject::LimitedToOnlyAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "limitedToOnlyOtherAttribute", V8TestObject::LimitedToOnlyOtherAttributeAttributeGetterCallback, V8TestObject::LimitedToOnlyOtherAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "limitedWithMissingDefaultAttribute", V8TestObject::LimitedWithMissingDefaultAttributeAttributeGetterCallback, V8TestObject::LimitedWithMissingDefaultAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "limitedWithInvalidMissingDefaultAttribute", V8TestObject::LimitedWithInvalidMissingDefaultAttributeAttributeGetterCallback, V8TestObject::LimitedWithInvalidMissingDefaultAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "corsSettingAttribute", V8TestObject::CorsSettingAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "limitedWithEmptyMissingInvalidAttribute", V8TestObject::LimitedWithEmptyMissingInvalidAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "RuntimeCallStatsCounterAttribute", V8TestObject::RuntimeCallStatsCounterAttributeAttributeGetterCallback, V8TestObject::RuntimeCallStatsCounterAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "RuntimeCallStatsCounterReadOnlyAttribute", V8TestObject::RuntimeCallStatsCounterReadOnlyAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "replaceableReadonlyLongAttribute", V8TestObject::ReplaceableReadonlyLongAttributeAttributeGetterCallback, V8TestObject::ReplaceableReadonlyLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "locationPutForwards", V8TestObject::LocationPutForwardsAttributeGetterCallback, V8TestObject::LocationPutForwardsAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "setterCallWithExecutionContextStringAttribute", V8TestObject::SetterCallWithExecutionContextStringAttributeAttributeGetterCallback, V8TestObject::SetterCallWithExecutionContextStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "treatNullAsEmptyStringStringAttribute", V8TestObject::TreatNullAsEmptyStringStringAttributeAttributeGetterCallback, V8TestObject::TreatNullAsEmptyStringStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "urlStringAttribute", V8TestObject::UrlStringAttributeAttributeGetterCallback, V8TestObject::UrlStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "urlStringAttribute", V8TestObject::UrlStringAttributeAttributeGetterCallback, V8TestObject::UrlStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unforgeableLongAttribute", V8TestObject::UnforgeableLongAttributeAttributeGetterCallback, V8TestObject::UnforgeableLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "measuredLongAttribute", V8TestObject::MeasuredLongAttributeAttributeGetterCallback, V8TestObject::MeasuredLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "sameObjectAttribute", V8TestObject::SameObjectAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "saveSameObjectAttribute", V8TestObject::SaveSameObjectAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticSaveSameObjectAttribute", V8TestObject::StaticSaveSameObjectAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unscopableLongAttribute", V8TestObject::UnscopableLongAttributeAttributeGetterCallback, V8TestObject::UnscopableLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "highEntropyAttributeWithMeasure", V8TestObject::HighEntropyAttributeWithMeasureAttributeGetterCallback, V8TestObject::HighEntropyAttributeWithMeasureAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "highEntropyReadonlyAttributeWithMeasure", V8TestObject::HighEntropyReadonlyAttributeWithMeasureAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "highEntropyAttributeWithMeasureAs", V8TestObject::HighEntropyAttributeWithMeasureAsAttributeGetterCallback, V8TestObject::HighEntropyAttributeWithMeasureAsAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "highEntropyReadonlyAttributeWithMeasureAs", V8TestObject::HighEntropyReadonlyAttributeWithMeasureAsAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testInterfaceAttribute", V8TestObject::TestInterfaceAttributeAttributeGetterCallback, V8TestObject::TestInterfaceAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "size", V8TestObject::SizeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::DontEnum | v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -13411,8 +13411,8 @@ if (RuntimeEnabledFeatures::RuntimeFeatureEnabled()) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "runtimeEnabledLongAttribute", V8TestObject::RuntimeEnabledLongAttributeAttributeGetterCallback, V8TestObject::RuntimeEnabledLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unscopableRuntimeEnabledLongAttribute", V8TestObject::UnscopableRuntimeEnabledLongAttributeAttributeGetterCallback, V8TestObject::UnscopableRuntimeEnabledLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "runtimeEnabledLongAttribute", V8TestObject::RuntimeEnabledLongAttributeAttributeGetterCallback, V8TestObject::RuntimeEnabledLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unscopableRuntimeEnabledLongAttribute", V8TestObject::UnscopableRuntimeEnabledLongAttributeAttributeGetterCallback, V8TestObject::UnscopableRuntimeEnabledLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -13501,8 +13501,8 @@ ALLOW_UNUSED_LOCAL(signature); static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "originTrialEnabledLongAttribute", V8TestObject::OriginTrialEnabledLongAttributeAttributeGetterCallback, V8TestObject::OriginTrialEnabledLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unscopableOriginTrialEnabledLongAttribute", V8TestObject::UnscopableOriginTrialEnabledLongAttributeAttributeGetterCallback, V8TestObject::UnscopableOriginTrialEnabledLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "originTrialEnabledLongAttribute", V8TestObject::OriginTrialEnabledLongAttributeAttributeGetterCallback, V8TestObject::OriginTrialEnabledLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unscopableOriginTrialEnabledLongAttribute", V8TestObject::UnscopableOriginTrialEnabledLongAttributeAttributeGetterCallback, V8TestObject::UnscopableOriginTrialEnabledLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance, prototype, interface,
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_typedefs.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_typedefs.cc index ddf865de..eefd7cdc 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_typedefs.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_typedefs.cc
@@ -604,9 +604,9 @@ kAttributeConfigurations, base::size(kAttributeConfigurations)); static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "uLongLongAttribute", V8TestTypedefs::ULongLongAttributeAttributeGetterCallback, V8TestTypedefs::ULongLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "longWithClampAttribute", V8TestTypedefs::LongWithClampAttributeAttributeGetterCallback, V8TestTypedefs::LongWithClampAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "domStringOrDoubleOrNullAttribute", V8TestTypedefs::DOMStringOrDoubleOrNullAttributeAttributeGetterCallback, V8TestTypedefs::DOMStringOrDoubleOrNullAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "uLongLongAttribute", V8TestTypedefs::ULongLongAttributeAttributeGetterCallback, V8TestTypedefs::ULongLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "longWithClampAttribute", V8TestTypedefs::LongWithClampAttributeAttributeGetterCallback, V8TestTypedefs::LongWithClampAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "domStringOrDoubleOrNullAttribute", V8TestTypedefs::DOMStringOrDoubleOrNullAttributeAttributeGetterCallback, V8TestTypedefs::DOMStringOrDoubleOrNullAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/modules/v8_test_inherited_legacy_unenumerable_named_properties.cc b/third_party/blink/renderer/bindings/tests/results/modules/v8_test_inherited_legacy_unenumerable_named_properties.cc index 089bac82..2a1dc50d9 100644 --- a/third_party/blink/renderer/bindings/tests/results/modules/v8_test_inherited_legacy_unenumerable_named_properties.cc +++ b/third_party/blink/renderer/bindings/tests/results/modules/v8_test_inherited_legacy_unenumerable_named_properties.cc
@@ -218,7 +218,7 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "longAttribute", V8TestInheritedLegacyUnenumerableNamedProperties::LongAttributeAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "longAttribute", V8TestInheritedLegacyUnenumerableNamedProperties::LongAttributeAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/bindings/tests/results/modules/v8_test_interface_5.cc b/third_party/blink/renderer/bindings/tests/results/modules/v8_test_interface_5.cc index 7b827af3..0283ae8f 100644 --- a/third_party/blink/renderer/bindings/tests/results/modules/v8_test_interface_5.cc +++ b/third_party/blink/renderer/bindings/tests/results/modules/v8_test_interface_5.cc
@@ -1023,14 +1023,14 @@ kAttributeConfigurations, base::size(kAttributeConfigurations)); static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "testInterfaceAttribute", V8TestInterface5::TestInterfaceAttributeAttributeGetterCallback, V8TestInterface5::TestInterfaceAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "doubleAttribute", V8TestInterface5::DoubleAttributeAttributeGetterCallback, V8TestInterface5::DoubleAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "floatAttribute", V8TestInterface5::FloatAttributeAttributeGetterCallback, V8TestInterface5::FloatAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unrestrictedDoubleAttribute", V8TestInterface5::UnrestrictedDoubleAttributeAttributeGetterCallback, V8TestInterface5::UnrestrictedDoubleAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unrestrictedFloatAttribute", V8TestInterface5::UnrestrictedFloatAttributeAttributeGetterCallback, V8TestInterface5::UnrestrictedFloatAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "staticStringAttribute", V8TestInterface5::StaticStringAttributeAttributeGetterCallback, V8TestInterface5::StaticStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "length", V8TestInterface5::LengthAttributeGetterCallback, nullptr, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "alwaysExposedAttribute", V8TestInterface5::AlwaysExposedAttributeAttributeGetterCallback, V8TestInterface5::AlwaysExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "testInterfaceAttribute", V8TestInterface5::TestInterfaceAttributeAttributeGetterCallback, V8TestInterface5::TestInterfaceAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "doubleAttribute", V8TestInterface5::DoubleAttributeAttributeGetterCallback, V8TestInterface5::DoubleAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "floatAttribute", V8TestInterface5::FloatAttributeAttributeGetterCallback, V8TestInterface5::FloatAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unrestrictedDoubleAttribute", V8TestInterface5::UnrestrictedDoubleAttributeAttributeGetterCallback, V8TestInterface5::UnrestrictedDoubleAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unrestrictedFloatAttribute", V8TestInterface5::UnrestrictedFloatAttributeAttributeGetterCallback, V8TestInterface5::UnrestrictedFloatAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "staticStringAttribute", V8TestInterface5::StaticStringAttributeAttributeGetterCallback, V8TestInterface5::StaticStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "length", V8TestInterface5::LengthAttributeGetterCallback, nullptr, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "alwaysExposedAttribute", V8TestInterface5::AlwaysExposedAttributeAttributeGetterCallback, V8TestInterface5::AlwaysExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template, @@ -1135,7 +1135,7 @@ if (execution_context && (execution_context->IsDocument())) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "windowExposedAttribute", V8TestInterface5::WindowExposedAttributeAttributeGetterCallback, V8TestInterface5::WindowExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "windowExposedAttribute", V8TestInterface5::WindowExposedAttributeAttributeGetterCallback, V8TestInterface5::WindowExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object, @@ -1145,7 +1145,7 @@ if (execution_context && (execution_context->IsWorkerGlobalScope())) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "workerExposedAttribute", V8TestInterface5::WorkerExposedAttributeAttributeGetterCallback, V8TestInterface5::WorkerExposedAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "workerExposedAttribute", V8TestInterface5::WorkerExposedAttributeAttributeGetterCallback, V8TestInterface5::WorkerExposedAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_object, prototype_object, interface_object,
diff --git a/third_party/blink/renderer/bindings/tests/results/modules/v8_test_interface_partial.cc b/third_party/blink/renderer/bindings/tests/results/modules/v8_test_interface_partial.cc index 9ec5a343c..36c9964 100644 --- a/third_party/blink/renderer/bindings/tests/results/modules/v8_test_interface_partial.cc +++ b/third_party/blink/renderer/bindings/tests/results/modules/v8_test_interface_partial.cc
@@ -539,8 +539,8 @@ if (is_secure_context) { static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "partial4LongAttribute", V8TestInterfacePartial::Partial4LongAttributeAttributeGetterCallback, V8TestInterfacePartial::Partial4LongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "partial4StaticLongAttribute", V8TestInterfacePartial::Partial4StaticLongAttributeAttributeGetterCallback, V8TestInterfacePartial::Partial4StaticLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partial4LongAttribute", V8TestInterfacePartial::Partial4LongAttributeAttributeGetterCallback, V8TestInterfacePartial::Partial4LongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "partial4StaticLongAttribute", V8TestInterfacePartial::Partial4StaticLongAttributeAttributeGetterCallback, V8TestInterfacePartial::Partial4StaticLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance, prototype, interface,
diff --git a/third_party/blink/renderer/bindings/tests/results/modules/v8_test_sub_object.cc b/third_party/blink/renderer/bindings/tests/results/modules/v8_test_sub_object.cc index d947f7c..b8e973c 100644 --- a/third_party/blink/renderer/bindings/tests/results/modules/v8_test_sub_object.cc +++ b/third_party/blink/renderer/bindings/tests/results/modules/v8_test_sub_object.cc
@@ -169,8 +169,8 @@ // Register IDL constants, attributes and operations. static constexpr V8DOMConfiguration::AccessorConfiguration kAccessorConfigurations[] = { - { "unforgeableStringAttribute", V8TestSubObject::UnforgeableStringAttributeAttributeGetterCallback, V8TestSubObject::UnforgeableStringAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, - { "unforgeableLongAttribute", V8TestSubObject::UnforgeableLongAttributeAttributeGetterCallback, V8TestSubObject::UnforgeableLongAttributeAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unforgeableStringAttribute", V8TestSubObject::UnforgeableStringAttributeAttributeGetterCallback, V8TestSubObject::UnforgeableStringAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, + { "unforgeableLongAttribute", V8TestSubObject::UnforgeableLongAttributeAttributeGetterCallback, V8TestSubObject::UnforgeableLongAttributeAttributeSetterCallback, static_cast<unsigned>(V8PrivateProperty::CachedAccessor::kNone), static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasSideEffect, V8DOMConfiguration::kAlwaysCallGetter, V8DOMConfiguration::kAllWorlds }, }; V8DOMConfiguration::InstallAccessors( isolate, world, instance_template, prototype_template, interface_template,
diff --git a/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.cc b/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.cc index 36fd6aaa..3a5b825 100644 --- a/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.cc +++ b/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.cc
@@ -15,8 +15,8 @@ ExecutionContext* context, const BeginFrameProviderParams& begin_frame_provider_params) : begin_frame_provider_( - std::make_unique<BeginFrameProvider>(begin_frame_provider_params, - this)), + MakeGarbageCollected<BeginFrameProvider>(begin_frame_provider_params, + this)), callback_collection_(context), context_(context) {} @@ -71,21 +71,21 @@ void WorkerAnimationFrameProvider::RegisterOffscreenCanvas( OffscreenCanvas* context) { - DCHECK(offscreen_canvases_.Find(context) == kNotFound); - offscreen_canvases_.push_back(context); + auto result = offscreen_canvases_.insert(context); + DCHECK(result.is_new_entry); } void WorkerAnimationFrameProvider::DeregisterOffscreenCanvas( OffscreenCanvas* offscreen_canvas) { - wtf_size_t pos = offscreen_canvases_.Find(offscreen_canvas); - if (pos != kNotFound) { - offscreen_canvases_.EraseAt(pos); - } + offscreen_canvases_.erase(offscreen_canvas); } void WorkerAnimationFrameProvider::Trace(Visitor* visitor) { + visitor->Trace(begin_frame_provider_); visitor->Trace(callback_collection_); + visitor->Trace(offscreen_canvases_); visitor->Trace(context_); + BeginFrameProviderClient::Trace(visitor); } } // namespace blink
diff --git a/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.h b/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.h index 939883c..d06b7d0 100644 --- a/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.h +++ b/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.h
@@ -9,6 +9,7 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/frame_request_callback_collection.h" #include "third_party/blink/renderer/platform/graphics/begin_frame_provider.h" +#include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/heap/handle.h" namespace blink { @@ -28,6 +29,8 @@ class CORE_EXPORT WorkerAnimationFrameProvider : public GarbageCollected<WorkerAnimationFrameProvider>, public BeginFrameProviderClient { + USING_GARBAGE_COLLECTED_MIXIN(WorkerAnimationFrameProvider); + public: WorkerAnimationFrameProvider( ExecutionContext* context, @@ -36,7 +39,7 @@ int RegisterCallback(FrameRequestCallbackCollection::FrameCallback* callback); void CancelCallback(int id); - void Trace(Visitor* visitor); + void Trace(Visitor* visitor) override; // BeginFrameProviderClient void BeginFrame(const viz::BeginFrameArgs&) override; @@ -47,13 +50,11 @@ static const int kInvalidCallbackId = -1; private: - const std::unique_ptr<BeginFrameProvider> begin_frame_provider_; + const Member<BeginFrameProvider> begin_frame_provider_; DISALLOW_COPY_AND_ASSIGN(WorkerAnimationFrameProvider); FrameRequestCallbackCollection callback_collection_; - // To avoid leaking OffscreenCanvas objects, the following vector must - // not hold strong references. - Vector<UntracedMember<OffscreenCanvas>> offscreen_canvases_; + HeapLinkedHashSet<WeakMember<OffscreenCanvas>> offscreen_canvases_; Member<ExecutionContext> context_;
diff --git a/third_party/blink/renderer/core/clipboard/system_clipboard.cc b/third_party/blink/renderer/core/clipboard/system_clipboard.cc index 905739a4..243efa9f 100644 --- a/third_party/blink/renderer/core/clipboard/system_clipboard.cc +++ b/third_party/blink/renderer/core/clipboard/system_clipboard.cc
@@ -15,6 +15,7 @@ #include "third_party/blink/renderer/core/clipboard/clipboard_mime_types.h" #include "third_party/blink/renderer/core/clipboard/clipboard_utilities.h" #include "third_party/blink/renderer/core/clipboard/data_object.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/platform/graphics/image.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" @@ -31,9 +32,11 @@ } // namespace -SystemClipboard::SystemClipboard(LocalFrame* frame) { +SystemClipboard::SystemClipboard(LocalFrame* frame) + : clipboard_(frame->DomWindow()) { frame->GetBrowserInterfaceBroker().GetInterface( - clipboard_.BindNewPipeAndPassReceiver()); + clipboard_.BindNewPipeAndPassReceiver( + frame->GetTaskRunner(TaskType::kUserInteraction))); } bool SystemClipboard::IsSelectionMode() const { @@ -93,7 +96,7 @@ } void SystemClipboard::WritePlainText(const String& plain_text, - SmartReplaceOption) { + SmartReplaceOption) { // TODO(https://crbug.com/106449): add support for smart replace, which is // currently under-specified. String text = plain_text; @@ -159,8 +162,8 @@ } void SystemClipboard::WriteImageWithTag(Image* image, - const KURL& url, - const String& title) { + const KURL& url, + const String& title) { DCHECK(image); PaintImage paint_image = image->PaintImageForCurrentFrame(); @@ -233,6 +236,10 @@ clipboard_->CommitWrite(); } +void SystemClipboard::Trace(Visitor* visitor) { + visitor->Trace(clipboard_); +} + bool SystemClipboard::IsValidBufferType(mojom::ClipboardBuffer buffer) { switch (buffer) { case mojom::ClipboardBuffer::kStandard:
diff --git a/third_party/blink/renderer/core/clipboard/system_clipboard.h b/third_party/blink/renderer/core/clipboard/system_clipboard.h index 71a11cb6f..dfea6b76 100644 --- a/third_party/blink/renderer/core/clipboard/system_clipboard.h +++ b/third_party/blink/renderer/core/clipboard/system_clipboard.h
@@ -5,10 +5,11 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CLIPBOARD_SYSTEM_CLIPBOARD_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CLIPBOARD_SYSTEM_CLIPBOARD_H_ -#include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/mojom/clipboard/clipboard.mojom-blink.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/heap/heap.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/forward.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" @@ -72,12 +73,14 @@ // the OS clipboard. void CommitWrite(); - void Trace(Visitor*) {} + void Trace(Visitor*); private: bool IsValidBufferType(mojom::ClipboardBuffer); - mojo::Remote<mojom::blink::ClipboardHost> clipboard_; + HeapMojoRemote<mojom::blink::ClipboardHost, + HeapMojoWrapperMode::kWithoutContextObserver> + clipboard_; // In X11, |buffer_| may equal ClipboardBuffer::kStandard or kSelection. // Outside X11, |buffer_| always equals ClipboardBuffer::kStandard. mojom::ClipboardBuffer buffer_ = mojom::ClipboardBuffer::kStandard;
diff --git a/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller.cc b/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller.cc index 748094c..6f84c63 100644 --- a/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller.cc +++ b/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller.cc
@@ -20,6 +20,7 @@ #include "third_party/blink/renderer/core/editing/spellcheck/spell_checker.h" #include "third_party/blink/renderer/core/editing/suggestion/text_suggestion_info.h" #include "third_party/blink/renderer/core/frame/frame_view.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/layout/layout_theme.h" @@ -193,7 +194,9 @@ } // namespace TextSuggestionController::TextSuggestionController(LocalFrame& frame) - : is_suggestion_menu_open_(false), frame_(&frame) {} + : is_suggestion_menu_open_(false), + frame_(&frame), + text_suggestion_host_(frame.DomWindow()) {} void TextSuggestionController::DidAttachDocument(Document* document) { DCHECK(document); @@ -243,9 +246,10 @@ if (marker && marker->Suggestions().IsEmpty()) return; - if (!text_suggestion_host_) { + if (!text_suggestion_host_.is_bound()) { GetFrame().GetBrowserInterfaceBroker().GetInterface( - text_suggestion_host_.BindNewPipeAndPassReceiver()); + text_suggestion_host_.BindNewPipeAndPassReceiver( + GetFrame().GetTaskRunner(TaskType::kMiscPlatformAPI))); } text_suggestion_host_->StartSuggestionMenuTimer(); @@ -253,6 +257,7 @@ void TextSuggestionController::Trace(Visitor* visitor) { visitor->Trace(frame_); + visitor->Trace(text_suggestion_host_); ExecutionContextLifecycleObserver::Trace(visitor); }
diff --git a/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller.h b/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller.h index 29b70a2..186e1b52 100644 --- a/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller.h +++ b/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller.h
@@ -6,7 +6,6 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_SUGGESTION_TEXT_SUGGESTION_CONTROLLER_H_ #include <utility> -#include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/mojom/input/input_host.mojom-blink.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/document.h" @@ -14,6 +13,8 @@ #include "third_party/blink/renderer/core/editing/markers/document_marker.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" #include "third_party/blink/renderer/platform/heap/handle.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" namespace blink { @@ -78,7 +79,9 @@ bool is_suggestion_menu_open_; const Member<LocalFrame> frame_; - mojo::Remote<mojom::blink::TextSuggestionHost> text_suggestion_host_; + HeapMojoRemote<mojom::blink::TextSuggestionHost, + HeapMojoWrapperMode::kWithoutContextObserver> + text_suggestion_host_; DISALLOW_COPY_AND_ASSIGN(TextSuggestionController); };
diff --git a/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller_test.cc b/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller_test.cc index d2a6e5a..6646cf0 100644 --- a/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller_test.cc +++ b/third_party/blink/renderer/core/editing/suggestion/text_suggestion_controller_test.cc
@@ -25,7 +25,7 @@ return bool(GetDocument() .GetFrame() ->GetTextSuggestionController() - .text_suggestion_host_); + .text_suggestion_host_.is_bound()); } void ShowSuggestionMenu(
diff --git a/third_party/blink/renderer/core/execution_context/agent_metrics_collector.cc b/third_party/blink/renderer/core/execution_context/agent_metrics_collector.cc index 202a52d8..e270900 100644 --- a/third_party/blink/renderer/core/execution_context/agent_metrics_collector.cc +++ b/third_party/blink/renderer/core/execution_context/agent_metrics_collector.cc
@@ -12,6 +12,7 @@ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/execution_context/window_agent.h" #include "third_party/blink/renderer/platform/instrumentation/histogram.h" +#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h" #include "third_party/blink/renderer/platform/web_test_support.h" #include "third_party/blink/renderer/platform/wtf/hash_set.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" @@ -41,7 +42,8 @@ : nullptr, this, &AgentMetricsCollector::ReportingTimerFired)), - clock_(base::DefaultTickClock::GetInstance()) { + clock_(base::DefaultTickClock::GetInstance()), + agent_metrics_collector_host_(nullptr) { // From now until we call CreatedNewAgent will be reported as having 0 // agents. time_last_reported_ = clock_->NowTicks(); @@ -160,17 +162,19 @@ ReportToBrowser(); } -mojo::Remote<blink::mojom::blink::AgentMetricsCollectorHost>& +blink::mojom::blink::AgentMetricsCollectorHost* AgentMetricsCollector::GetAgentMetricsCollectorHost() { - if (!agent_metrics_collector_host_) { + if (!agent_metrics_collector_host_.is_bound()) { blink::Platform::Current()->GetBrowserInterfaceBroker()->GetInterface( - agent_metrics_collector_host_.BindNewPipeAndPassReceiver()); + agent_metrics_collector_host_.BindNewPipeAndPassReceiver( + ThreadScheduler::Current()->IPCTaskRunner())); } - return agent_metrics_collector_host_; + return agent_metrics_collector_host_.get(); } void AgentMetricsCollector::Trace(Visitor* visitor) { visitor->Trace(agent_to_documents_map_); + visitor->Trace(agent_metrics_collector_host_); } } // namespace blink
diff --git a/third_party/blink/renderer/core/execution_context/agent_metrics_collector.h b/third_party/blink/renderer/core/execution_context/agent_metrics_collector.h index b92e88b8..6776517 100644 --- a/third_party/blink/renderer/core/execution_context/agent_metrics_collector.h +++ b/third_party/blink/renderer/core/execution_context/agent_metrics_collector.h
@@ -6,8 +6,9 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_EXECUTION_CONTEXT_AGENT_METRICS_COLLECTOR_H_ #include "base/time/time.h" -#include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/mojom/agents/agent_metrics.mojom-blink.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" #include "third_party/blink/renderer/platform/timer.h" namespace base { @@ -61,7 +62,7 @@ void ReportingTimerFired(TimerBase*); - mojo::Remote<blink::mojom::blink::AgentMetricsCollectorHost>& + blink::mojom::blink::AgentMetricsCollectorHost* GetAgentMetricsCollectorHost(); std::unique_ptr<TaskRunnerTimer<AgentMetricsCollector>> reporting_timer_; @@ -77,7 +78,8 @@ const base::TickClock* clock_; - mojo::Remote<blink::mojom::blink::AgentMetricsCollectorHost> + HeapMojoRemote<blink::mojom::blink::AgentMetricsCollectorHost, + HeapMojoWrapperMode::kWithoutContextObserver> agent_metrics_collector_host_; };
diff --git a/third_party/blink/renderer/core/frame/window.idl b/third_party/blink/renderer/core/frame/window.idl index 47dd13ef..ca14034e 100644 --- a/third_party/blink/renderer/core/frame/window.idl +++ b/third_party/blink/renderer/core/frame/window.idl
@@ -35,9 +35,9 @@ ] interface Window : EventTarget { // the current browsing context // FIXME: The spec uses the WindowProxy type for this and many other attributes. - [Affects=Nothing, Unforgeable, CrossOrigin] readonly attribute Window window; - [Replaceable, CrossOrigin] readonly attribute Window self; - [Affects=Nothing, Unforgeable, CachedAccessor] readonly attribute Document document; + [Affects=Nothing, Unforgeable, CrossOrigin, CachedAccessor=kWindowProxy] readonly attribute Window window; + [Replaceable, CrossOrigin, CachedAccessor=kWindowProxy] readonly attribute Window self; + [Affects=Nothing, Unforgeable, CachedAccessor=kWindowDocument] readonly attribute Document document; attribute DOMString name; [Affects=Nothing, PutForwards=href, Unforgeable, CrossOrigin=(Getter,Setter), Custom=Getter] readonly attribute Location location; [CallWith=ScriptState] readonly attribute CustomElementRegistry customElements; @@ -56,7 +56,7 @@ [CrossOrigin] void blur(); // other browsing contexts - [Replaceable, CrossOrigin] readonly attribute Window frames; + [Replaceable, CrossOrigin, CachedAccessor=kWindowProxy] readonly attribute Window frames; [Replaceable, CrossOrigin] readonly attribute unsigned long length; [Unforgeable, CrossOrigin] readonly attribute Window? top; // FIXME: opener should be of type any.
diff --git a/third_party/blink/renderer/core/loader/resource/script_resource.cc b/third_party/blink/renderer/core/loader/resource/script_resource.cc index a7a69c2..4b30c7c 100644 --- a/third_party/blink/renderer/core/loader/resource/script_resource.cc +++ b/third_party/blink/renderer/core/loader/resource/script_resource.cc
@@ -85,9 +85,7 @@ if (streaming_allowed == kAllowStreaming) { // Start streaming the script as soon as we get it. - if (RuntimeEnabledFeatures::ScriptStreamingOnPreloadEnabled()) { - resource->StartStreaming(fetcher->GetTaskRunner()); - } + resource->StartStreaming(fetcher->GetTaskRunner()); } else { // Advance the |streaming_state_| to kStreamingNotAllowed by calling // SetClientIsWaitingForFinished unless it is explicitly allowed.'
diff --git a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc index cbef632e..c15c206f 100644 --- a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc +++ b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
@@ -105,8 +105,6 @@ context_->DetachHost(); context_ = nullptr; } - - DeregisterFromAnimationFrameProvider(); } void OffscreenCanvas::DeregisterFromAnimationFrameProvider() {
diff --git a/third_party/blink/renderer/core/page/spatial_navigation_controller.cc b/third_party/blink/renderer/core/page/spatial_navigation_controller.cc index 0db2f04a..4fa855b 100644 --- a/third_party/blink/renderer/core/page/spatial_navigation_controller.cc +++ b/third_party/blink/renderer/core/page/spatial_navigation_controller.cc
@@ -15,6 +15,7 @@ #include "third_party/blink/renderer/core/editing/frame_selection.h" #include "third_party/blink/renderer/core/events/keyboard_event.h" #include "third_party/blink/renderer/core/events/web_input_event_conversion.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/visual_viewport.h" @@ -162,7 +163,11 @@ SpatialNavigationController::SpatialNavigationController(Page& page) : page_(&page), - spatial_navigation_state_(mojom::blink::SpatialNavigationState::New()) { + spatial_navigation_state_(mojom::blink::SpatialNavigationState::New()), + spatial_navigation_host_( + DynamicTo<LocalFrame>(page.MainFrame()) + ? DynamicTo<LocalFrame>(page.MainFrame())->DomWindow() + : nullptr) { DCHECK(page_->GetSettings().GetSpatialNavigationEnabled()); } @@ -300,6 +305,7 @@ void SpatialNavigationController::Trace(Visitor* visitor) { visitor->Trace(interest_element_); visitor->Trace(page_); + visitor->Trace(spatial_navigation_host_); } bool SpatialNavigationController::Advance( @@ -693,7 +699,8 @@ return true; } -const mojo::Remote<mojom::blink::SpatialNavigationHost>& +const HeapMojoRemote<mojom::blink::SpatialNavigationHost, + HeapMojoWrapperMode::kWithoutContextObserver>& SpatialNavigationController::GetSpatialNavigationHost() { if (!spatial_navigation_host_.is_bound()) { LocalFrame* frame = DynamicTo<LocalFrame>(page_->MainFrame());
diff --git a/third_party/blink/renderer/core/page/spatial_navigation_controller.h b/third_party/blink/renderer/core/page/spatial_navigation_controller.h index fe6831c..efd72e2 100644 --- a/third_party/blink/renderer/core/page/spatial_navigation_controller.h +++ b/third_party/blink/renderer/core/page/spatial_navigation_controller.h
@@ -5,11 +5,12 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_SPATIAL_NAVIGATION_CONTROLLER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_SPATIAL_NAVIGATION_CONTROLLER_H_ -#include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/mojom/page/spatial_navigation.mojom-blink.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/page/spatial_navigation.h" #include "third_party/blink/renderer/platform/heap/handle.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" namespace blink { @@ -106,7 +107,8 @@ bool UpdateIsFormFocused(Element* element); bool UpdateHasDefaultVideoControls(Element* element); - const mojo::Remote<mojom::blink::SpatialNavigationHost>& + const HeapMojoRemote<mojom::blink::SpatialNavigationHost, + HeapMojoWrapperMode::kWithoutContextObserver>& GetSpatialNavigationHost(); void ResetMojoBindings(); @@ -121,7 +123,9 @@ bool enter_key_press_seen_ = false; mojom::blink::SpatialNavigationStatePtr spatial_navigation_state_; - mojo::Remote<mojom::blink::SpatialNavigationHost> spatial_navigation_host_; + HeapMojoRemote<mojom::blink::SpatialNavigationHost, + HeapMojoWrapperMode::kWithoutContextObserver> + spatial_navigation_host_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc index cf5fbf29..043e3619 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
@@ -1433,6 +1433,13 @@ paint_info.phase != PaintPhase::kMask) return; + // Skip if this child does not intersect with CullRect. + if (!paint_info.IntersectsCullRect( + item.InkOverflow(), paint_offset + item.OffsetInContainerBlock()) && + // Don't skip <br>, it doesn't have ink but need to paint selection. + !item.IsLineBreak()) + return; + NGTextFragmentPainter<NGInlineCursor> text_painter(cursor, parent_offset); text_painter.Paint(paint_info, paint_offset); } @@ -1451,7 +1458,10 @@ if (child_fragment.HasSelfPaintingLayer() || child_fragment.IsFloating()) return; - // TODO(kojii): Check CullRect. + // Skip if this child does not intersect with CullRect. + if (!paint_info.IntersectsCullRect( + item.InkOverflow(), paint_offset + item.OffsetInContainerBlock())) + return; if (child_fragment.IsAtomicInline() || child_fragment.IsListMarker()) { if (FragmentRequiresLegacyFallback(child_fragment)) { @@ -1480,6 +1490,11 @@ return; } + // Skip if this child does not intersect with CullRect. + if (!paint_info.IntersectsCullRect( + item.InkOverflow(), paint_offset + item.OffsetInContainerBlock())) + return; + // This |item| is a culled inline box. DCHECK(item.GetLayoutObject()->IsLayoutInline()); NGInlineCursor children = cursor.CursorForDescendants();
diff --git a/third_party/blink/renderer/modules/nfc/ndef_reader.cc b/third_party/blink/renderer/modules/nfc/ndef_reader.cc index 2147253e..013b5e0 100644 --- a/third_party/blink/renderer/modules/nfc/ndef_reader.cc +++ b/third_party/blink/renderer/modules/nfc/ndef_reader.cc
@@ -37,16 +37,6 @@ constexpr char kNotSupportedOrPermissionDenied[] = "WebNFC feature is unavailable or permission denied."; -void OnScanRequestCompleted(ScriptPromiseResolver* resolver, - device::mojom::blink::NDEFErrorPtr error) { - if (error) { - resolver->Reject( - NDEFErrorTypeToDOMException(error->error_type, error->error_message)); - return; - } - resolver->Resolve(); -} - } // namespace // static @@ -118,16 +108,15 @@ // 8. If reader.[[Signal]] is not null, then add the following abort steps to // reader.[[Signal]]: if (options->hasSignal()) { - options->signal()->AddAlgorithm(WTF::Bind(&NDEFReader::Abort, - WrapPersistent(this), - WrapPersistent(resolver_.Get()))); + options->signal()->AddAlgorithm( + WTF::Bind(&NDEFReader::Abort, WrapPersistent(this))); } GetPermissionService()->RequestPermission( CreatePermissionDescriptor(PermissionName::NFC), LocalFrame::HasTransientUserActivation(document->GetFrame()), WTF::Bind(&NDEFReader::OnRequestPermission, WrapPersistent(this), - WrapPersistent(resolver_.Get()), WrapPersistent(options))); + WrapPersistent(options))); return resolver_->Promise(); } @@ -140,17 +129,21 @@ return permission_service_.get(); } -void NDEFReader::OnRequestPermission(ScriptPromiseResolver* resolver, - const NDEFScanOptions* options, +void NDEFReader::OnRequestPermission(const NDEFScanOptions* options, PermissionStatus status) { + if (!resolver_) + return; + if (status != PermissionStatus::GRANTED) { - resolver->Reject(MakeGarbageCollected<DOMException>( + resolver_->Reject(MakeGarbageCollected<DOMException>( DOMExceptionCode::kNotAllowedError, "NFC permission request denied.")); + resolver_.Clear(); return; } if (options->hasSignal() && options->signal()->aborted()) { - resolver->Reject(MakeGarbageCollected<DOMException>( + resolver_->Reject(MakeGarbageCollected<DOMException>( DOMExceptionCode::kAbortError, "The NFC operation was cancelled.")); + resolver_.Clear(); return; } @@ -160,7 +153,22 @@ GetNfcProxy()->StartReading( this, options, - WTF::Bind(&OnScanRequestCompleted, WrapPersistent(resolver))); + WTF::Bind(&NDEFReader::OnScanRequestCompleted, WrapPersistent(this))); +} + +void NDEFReader::OnScanRequestCompleted( + device::mojom::blink::NDEFErrorPtr error) { + if (!resolver_) + return; + + if (error) { + resolver_->Reject( + NDEFErrorTypeToDOMException(error->error_type, error->error_message)); + } else { + resolver_->Resolve(); + } + + resolver_.Clear(); } void NDEFReader::Trace(Visitor* visitor) { @@ -190,6 +198,7 @@ resolver_->Reject(NDEFErrorTypeToDOMException( device::mojom::blink::NDEFErrorType::NOT_SUPPORTED, kNotSupportedOrPermissionDenied)); + resolver_.Clear(); } // Dispatches an error event. @@ -202,14 +211,18 @@ resolver_->Reject(MakeGarbageCollected<DOMException>( DOMExceptionCode::kAbortError, "The execution context is going to be gone.")); + resolver_.Clear(); } GetNfcProxy()->StopReading(this); } -void NDEFReader::Abort(ScriptPromiseResolver* resolver) { - // If |resolver| has already settled this rejection is silently ignored. - resolver->Reject(MakeGarbageCollected<DOMException>( - DOMExceptionCode::kAbortError, "The NFC operation was cancelled.")); +void NDEFReader::Abort() { + if (resolver_) { + resolver_->Reject(MakeGarbageCollected<DOMException>( + DOMExceptionCode::kAbortError, "The NFC operation was cancelled.")); + resolver_.Clear(); + } + GetNfcProxy()->StopReading(this); }
diff --git a/third_party/blink/renderer/modules/nfc/ndef_reader.h b/third_party/blink/renderer/modules/nfc/ndef_reader.h index 224f9d3..f485439 100644 --- a/third_party/blink/renderer/modules/nfc/ndef_reader.h +++ b/third_party/blink/renderer/modules/nfc/ndef_reader.h
@@ -59,13 +59,14 @@ // ExecutionContextLifecycleObserver overrides. void ContextDestroyed() override; - void Abort(ScriptPromiseResolver*); + void Abort(); NFCProxy* GetNfcProxy() const; + void OnScanRequestCompleted(device::mojom::blink::NDEFErrorPtr error); + // Permission handling - void OnRequestPermission(ScriptPromiseResolver* resolver, - const NDEFScanOptions* options, + void OnRequestPermission(const NDEFScanOptions* options, mojom::blink::PermissionStatus status); mojom::blink::PermissionService* GetPermissionService(); mojo::Remote<mojom::blink::PermissionService> permission_service_;
diff --git a/third_party/blink/renderer/modules/wake_lock/wake_lock_manager.cc b/third_party/blink/renderer/modules/wake_lock/wake_lock_manager.cc index 579fdf7..25d4d92 100644 --- a/third_party/blink/renderer/modules/wake_lock/wake_lock_manager.cc +++ b/third_party/blink/renderer/modules/wake_lock/wake_lock_manager.cc
@@ -95,6 +95,7 @@ } void WakeLockManager::OnWakeLockConnectionError() { + LOG(INFO) << "Clearing wake locks on connection error."; wake_lock_.reset(); ClearWakeLocks(); }
diff --git a/third_party/blink/renderer/modules/wake_lock/wake_lock_sentinel.cc b/third_party/blink/renderer/modules/wake_lock/wake_lock_sentinel.cc index 2a6a7bba..8c2d1be 100644 --- a/third_party/blink/renderer/modules/wake_lock/wake_lock_sentinel.cc +++ b/third_party/blink/renderer/modules/wake_lock/wake_lock_sentinel.cc
@@ -90,6 +90,7 @@ if (!GetExecutionContext() || GetExecutionContext()->IsContextDestroyed()) return; + LOG(INFO) << "Dispatching release event."; // 6. Queue a task to fire an event named "release" at lock. DispatchEvent(*Event::Create(event_type_names::kRelease)); }
diff --git a/third_party/blink/renderer/platform/bindings/v8_private_property.cc b/third_party/blink/renderer/platform/bindings/v8_private_property.cc index 5029477..2f6072f 100644 --- a/third_party/blink/renderer/platform/bindings/v8_private_property.cc +++ b/third_party/blink/renderer/platform/bindings/v8_private_property.cc
@@ -52,6 +52,26 @@ private_prop->symbol_window_document_cached_accessor_.NewLocal(isolate)); } +V8PrivateProperty::Symbol V8PrivateProperty::GetCachedAccessor( + v8::Isolate* isolate, + CachedAccessor symbol_id) { + switch (symbol_id) { + case CachedAccessor::kNone: + break; + case CachedAccessor::kWindowProxy: + return Symbol( + isolate, + v8::Private::ForApi( + isolate, + V8String(isolate, + "V8PrivateProperty::CachedAccessor::kWindowProxy"))); + case CachedAccessor::kWindowDocument: + return GetWindowDocumentCachedAccessor(isolate); + } + NOTREACHED(); + return GetEmptySymbol(); +} + V8PrivateProperty::Symbol V8PrivateProperty::GetSymbol( v8::Isolate* isolate, const V8PrivateProperty::SymbolKey& key) {
diff --git a/third_party/blink/renderer/platform/bindings/v8_private_property.h b/third_party/blink/renderer/platform/bindings/v8_private_property.h index bf19f47..53846219 100644 --- a/third_party/blink/renderer/platform/bindings/v8_private_property.h +++ b/third_party/blink/renderer/platform/bindings/v8_private_property.h
@@ -34,9 +34,11 @@ USING_FAST_MALLOC(V8PrivateProperty); public: - enum CachedAccessorSymbol : unsigned { - kNoCachedAccessor = 0, - kWindowDocumentCachedAccessor, + // Private properties used to implement [CachedAccessor]. + enum class CachedAccessor : unsigned { + kNone = 0, + kWindowProxy, + kWindowDocument, }; V8PrivateProperty() = default; @@ -111,16 +113,7 @@ static Symbol GetWindowDocumentCachedAccessor(v8::Isolate* isolate); static Symbol GetCachedAccessor(v8::Isolate* isolate, - CachedAccessorSymbol symbol_id) { - switch (symbol_id) { - case kWindowDocumentCachedAccessor: - return GetWindowDocumentCachedAccessor(isolate); - case kNoCachedAccessor: - break; - } - NOTREACHED(); - return GetEmptySymbol(); - } + CachedAccessor symbol_id); // This is a hack for PopStateEvent to get the same private property of // History, named State.
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc index a95ec42..389b099 100644 --- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc +++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -553,10 +553,6 @@ RuntimeEnabledFeatures::SetAutomationControlledEnabled(enable); } -void WebRuntimeFeatures::EnableScriptStreamingOnPreload(bool enable) { - RuntimeEnabledFeatures::SetScriptStreamingOnPreloadEnabled(enable); -} - void WebRuntimeFeatures::EnableExperimentalProductivityFeatures(bool enable) { RuntimeEnabledFeatures::SetExperimentalProductivityFeaturesEnabled(enable); }
diff --git a/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper.cc b/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper.cc index 36a4d71..dc3e1e7 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper.cc
@@ -31,10 +31,11 @@ GetAssemblyParameters(const HarfBuzzFace* harfbuzz_face, Glyph base_glyph, OpenTypeMathStretchData::StretchAxis stretch_axis, - float target_size) { + float target_size, + float* italic_correction) { Vector<OpenTypeMathStretchData::GlyphPartRecord> parts = OpenTypeMathSupport::GetGlyphPartRecords(harfbuzz_face, base_glyph, - stretch_axis); + stretch_axis, italic_correction); if (parts.IsEmpty()) return base::nullopt; @@ -134,6 +135,7 @@ const HarfBuzzFace* harfbuzz_face = primary_font->PlatformData().GetHarfBuzzFace(); Glyph base_glyph = primary_font->GlyphForCharacter(stretchy_character_); + float italic_correction = 0.0; if (metrics) *metrics = Metrics(); @@ -147,8 +149,11 @@ glyph_variant = variant; FloatRect bounds = primary_font->BoundsForGlyph(glyph_variant); if (metrics) { + italic_correction = + OpenTypeMathSupport::MathItalicCorrection(harfbuzz_face, variant) + .value_or(0); *metrics = {primary_font->WidthForGlyph(variant), -bounds.Y(), - bounds.MaxY()}; + bounds.MaxY(), italic_correction}; } glyph_variant_stretch_size = stretch_axis_ == OpenTypeMathStretchData::StretchAxis::Horizontal @@ -162,7 +167,8 @@ // Try a glyph assembly. auto params = GetAssemblyParameters(harfbuzz_face, base_glyph, stretch_axis_, - target_size); + target_size, + metrics ? &italic_correction : nullptr); if (!params) { return ShapeResult::CreateForStretchyMathOperator( font, direction, glyph_variant, glyph_variant_stretch_size); @@ -176,7 +182,8 @@ // the advance width and ink width, so the latter is returned here. FloatRect bounds = shape_result_for_glyph_assembly->ComputeInkBounds(); if (stretch_axis_ == OpenTypeMathStretchData::StretchAxis::Horizontal) { - *metrics = {bounds.Width(), -bounds.Y(), bounds.MaxY()}; + *metrics = {bounds.Width(), -bounds.Y(), bounds.MaxY(), + italic_correction}; } else { // For assemblies growing in the vertical direction, the distribution of // height between ascent and descent is not defined by the OpenType MATH @@ -186,7 +193,7 @@ // run that is HB_DIRECTION_TTB in order to stack the parts vertically but // the actual glyph assembly is still horizontal text, so height and width // are inverted. - *metrics = {bounds.Height(), bounds.Width(), 0}; + *metrics = {bounds.Height(), bounds.Width(), 0, italic_correction}; } } return shape_result_for_glyph_assembly;
diff --git a/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper.h b/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper.h index 12d6b6c..9a049f3 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper.h +++ b/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper.h
@@ -34,7 +34,7 @@ float advance; float ascent; float descent; - // TODO(https://crbug.com/1057592): Add italic correction. + float italic_correction; }; // Shape the stretched operator. The coordinates of the glyph(s) use the same // origin as the rectangle assigned to the optional OUT Metrics parameter.
diff --git a/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper_test.cc b/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper_test.cc index 192d062..b1ebf0d 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper_test.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper_test.cc
@@ -19,6 +19,7 @@ const UChar32 kLeftBraceCodePoint = '{'; const UChar32 kOverBraceCodePoint = 0x23DE; const UChar32 kArabicMathOperatorHahWithDalCodePoint = 0x1EEF1; +const UChar32 kNAryWhiteVerticalBarCodePoint = 0x2AFF; float kSizeError = .1; ShapeResultTestInfo* TestInfo(const scoped_refptr<ShapeResult>& result) { @@ -265,4 +266,43 @@ } } +// See third_party/blink/web_tests/external/wpt/mathml/tools/largeop.py +TEST_F(StretchyOperatorShaperTest, MathItalicCorrection) { + { + Font math = CreateMathFont( + "largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff"); + StretchyOperatorShaper shaper( + kNAryWhiteVerticalBarCodePoint, + OpenTypeMathStretchData::StretchAxis::Vertical); + + // Base size. + StretchyOperatorShaper::Metrics metrics; + shaper.Shape(&math, 0, &metrics); + EXPECT_EQ(metrics.italic_correction, 0); + + // Larger variant. + float target_size = 2000 - kSizeError; + shaper.Shape(&math, target_size, &metrics); + EXPECT_EQ(metrics.italic_correction, 3000); + } + + { + Font math = CreateMathFont( + "largeop-displayoperatorminheight7000-2AFF-italiccorrection5000.woff"); + StretchyOperatorShaper shaper( + kNAryWhiteVerticalBarCodePoint, + OpenTypeMathStretchData::StretchAxis::Vertical); + + // Base size. + StretchyOperatorShaper::Metrics metrics; + shaper.Shape(&math, 0, &metrics); + EXPECT_EQ(metrics.italic_correction, 0); + + // Glyph assembly. + float target_size = 7000; + shaper.Shape(&math, target_size, &metrics); + EXPECT_EQ(metrics.italic_correction, 5000); + } +} + } // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/DEPS b/third_party/blink/renderer/platform/graphics/DEPS index 9af9d13..7956838 100644 --- a/third_party/blink/renderer/platform/graphics/DEPS +++ b/third_party/blink/renderer/platform/graphics/DEPS
@@ -42,6 +42,8 @@ "+third_party/blink/renderer/platform/image-encoders", "+third_party/blink/renderer/platform/instrumentation", "+third_party/blink/renderer/platform/json", + "+third_party/blink/renderer/platform/mojo/heap_mojo_receiver.h", + "+third_party/blink/renderer/platform/mojo/heap_mojo_remote.h", "+third_party/blink/renderer/platform/mojo/mojo_helper.h", "+third_party/blink/renderer/platform/platform_export.h", "+third_party/blink/renderer/platform/runtime_enabled_features.h",
diff --git a/third_party/blink/renderer/platform/graphics/begin_frame_provider.cc b/third_party/blink/renderer/platform/graphics/begin_frame_provider.cc index 624f216..7595c82 100644 --- a/third_party/blink/renderer/platform/graphics/begin_frame_provider.cc +++ b/third_party/blink/renderer/platform/graphics/begin_frame_provider.cc
@@ -77,7 +77,7 @@ compositor_frame_sink_.BindNewPipeAndPassReceiver()); compositor_frame_sink_.set_disconnect_with_reason_handler(base::BindOnce( - &BeginFrameProvider::OnMojoConnectionError, weak_factory_.GetWeakPtr())); + &BeginFrameProvider::OnMojoConnectionError, WrapWeakPersistent(this))); } void BeginFrameProvider::RequestBeginFrame() { @@ -120,4 +120,8 @@ compositor_frame_sink_->DidNotProduceFrame(viz::BeginFrameAck(args, false)); } +void BeginFrameProvider::Trace(Visitor* visitor) { + visitor->Trace(begin_frame_client_); +} + } // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/begin_frame_provider.h b/third_party/blink/renderer/platform/graphics/begin_frame_provider.h index 85dd881..6672388 100644 --- a/third_party/blink/renderer/platform/graphics/begin_frame_provider.h +++ b/third_party/blink/renderer/platform/graphics/begin_frame_provider.h
@@ -12,7 +12,7 @@ #include "mojo/public/cpp/bindings/remote.h" #include "services/viz/public/mojom/compositing/compositor_frame_sink.mojom-blink.h" #include "third_party/blink/public/mojom/frame_sinks/embedded_frame_sink.mojom-blink.h" -#include "third_party/blink/renderer/platform/graphics/begin_frame_provider.h" +#include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/platform_export.h" namespace blink { @@ -22,14 +22,15 @@ viz::FrameSinkId frame_sink_id; }; -class PLATFORM_EXPORT BeginFrameProviderClient { +class PLATFORM_EXPORT BeginFrameProviderClient : public GarbageCollectedMixin { public: virtual void BeginFrame(const viz::BeginFrameArgs&) = 0; virtual ~BeginFrameProviderClient() = default; }; class PLATFORM_EXPORT BeginFrameProvider - : public viz::mojom::blink::CompositorFrameSinkClient, + : public GarbageCollected<BeginFrameProvider>, + public viz::mojom::blink::CompositorFrameSinkClient, public mojom::blink::EmbeddedFrameSinkClient { public: explicit BeginFrameProvider( @@ -65,6 +66,8 @@ bool IsValidFrameProvider(); + void Trace(Visitor*); + ~BeginFrameProvider() override = default; private: @@ -80,9 +83,7 @@ viz::FrameSinkId frame_sink_id_; viz::FrameSinkId parent_frame_sink_id_; mojo::Remote<viz::mojom::blink::CompositorFrameSink> compositor_frame_sink_; - BeginFrameProviderClient* begin_frame_client_; - - base::WeakPtrFactory<BeginFrameProvider> weak_factory_{this}; + Member<BeginFrameProviderClient> begin_frame_client_; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index fc3988ab..fb33f4f 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1548,9 +1548,6 @@ status: "stable", }, { - name: "ScriptStreamingOnPreload", - }, - { name: "ScrollCustomization", }, {
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index a76bb7f8..ec60930 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -3149,8 +3149,19 @@ crbug.com/947951 [ Win ] external/wpt/pointerevents/pointerevent_touch-action-inherit_child-auto-child-none_touch.html [ Pass Timeout ] crbug.com/1067277 external/wpt/css/css-content/element-replacement-on-replaced-element.tentative.html [ Failure ] +crbug.com/1069300 external/wpt/css/css-pseudo/active-selection-063.html [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Linux ] external/wpt/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html [ Timeout ] +crbug.com/626703 [ Mac ] external/wpt/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html [ Timeout ] +crbug.com/626703 [ Win ] external/wpt/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html [ Timeout ] +crbug.com/626703 [ Linux ] external/wpt/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html [ Timeout ] +crbug.com/626703 [ Mac ] external/wpt/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html [ Timeout ] +crbug.com/626703 [ Win ] external/wpt/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html [ Timeout ] +crbug.com/626703 [ Mac10.13 ] external/wpt/webrtc/RTCRtpSender-replaceTrack.https.html [ Timeout ] +crbug.com/626703 [ Linux ] external/wpt/webxr/hit-test/ar_hittest_subscription_inputSources.https.html [ Timeout ] +crbug.com/626703 [ Mac ] external/wpt/webxr/hit-test/ar_hittest_subscription_inputSources.https.html [ Timeout ] +crbug.com/626703 [ Win ] external/wpt/webxr/hit-test/ar_hittest_subscription_inputSources.https.html [ Timeout ] crbug.com/626703 [ Retina ] external/wpt/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html [ Timeout ] crbug.com/626703 [ Mac10.14 ] external/wpt/webrtc/RTCRtpSender-replaceTrack.https.html [ Timeout ] crbug.com/626703 [ Win7 ] external/wpt/webrtc/RTCRtpSender-replaceTrack.https.html [ Timeout ] @@ -3168,9 +3179,6 @@ crbug.com/626703 [ Linux ] external/wpt/css/css-text/line-break/line-break-normal-015b.xht [ Failure ] crbug.com/626703 [ Mac ] external/wpt/css/css-text/line-break/line-break-normal-015b.xht [ Failure ] crbug.com/626703 [ Win ] external/wpt/css/css-text/line-break/line-break-normal-015b.xht [ Failure ] -crbug.com/626703 [ Linux ] external/wpt/css/css-pseudo/active-selection-063.html [ Failure ] -crbug.com/626703 [ Mac ] external/wpt/css/css-pseudo/active-selection-063.html [ Failure ] -crbug.com/626703 [ Win ] external/wpt/css/css-pseudo/active-selection-063.html [ Failure ] crbug.com/626703 [ Mac10.14 ] external/wpt/preload/onload-event.html [ Timeout ] crbug.com/626703 [ Mac10.10 ] external/wpt/storage/estimate-indexeddb.https.any.worker.html [ Failure Timeout ] crbug.com/626703 [ Mac10.10 ] external/wpt/fetch/origin/assorted.window.html [ Failure Timeout ]
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 3376e9a..505ab11 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -469,12 +469,6 @@ "args": ["--disable-site-isolation-trials"] }, { - "prefix": "streaming-preload", - "bases": ["external/wpt/html/semantics/scripting-1", - "http/tests/fetch"], - "args": ["--enable-features=ScriptStreamingOnPreload"] - }, - { "prefix": "focusless-spat-nav", "bases": [], "args": ["--enable-blink-features=FocuslessSpatialNavigation",
diff --git a/third_party/blink/web_tests/css3/masking/clip-path-reference-nonexisting-existing-local.html b/third_party/blink/web_tests/css3/masking/clip-path-reference-nonexisting-existing-local.html deleted file mode 100644 index 8be423b..0000000 --- a/third_party/blink/web_tests/css3/masking/clip-path-reference-nonexisting-existing-local.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<style> -#target { - width: 100px; - height: 100px; - background-color: green; - -webkit-clip-path: url(notexisting.svg#c); - clip-path: url(notexisting.svg#c); -} -</style> -<div style="background-color: red; width: 100px"> - <div id="target"></div> -</div> -<svg> - <clipPath id="c" clipPathUnits="objectBoundingBox"> - <circle cx="0.5" cy="0.5" r="0.5"/> - </clipPath> -</svg>
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_7.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_7.json index cee598b..f2aa665 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_7.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_7.json
@@ -55,6 +55,12 @@ {} ] ], + "css/css-flexbox/position-relative-with-scrollable-with-abspos-crash.html": [ + [ + "css/css-flexbox/position-relative-with-scrollable-with-abspos-crash.html", + {} + ] + ], "css/css-flexbox/remove-out-of-flow-child-crash.html": [ [ "css/css-flexbox/remove-out-of-flow-child-crash.html", @@ -55949,6 +55955,30 @@ {} ] ], + "css/css-grid/grid-model/grid-layout-stale-001.html": [ + [ + "css/css-grid/grid-model/grid-layout-stale-001.html", + [ + [ + "/css/css-grid/grid-model/reference/grid-layout-stale-001-ref.html", + "==" + ] + ], + {} + ] + ], + "css/css-grid/grid-model/grid-layout-stale-002.html": [ + [ + "css/css-grid/grid-model/grid-layout-stale-002.html", + [ + [ + "/css/css-grid/grid-model/reference/grid-layout-stale-002-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-grid/grid-model/grid-margins-no-collapse-001.html": [ [ "css/css-grid/grid-model/grid-margins-no-collapse-001.html", @@ -61277,6 +61307,18 @@ {} ] ], + "css/css-masking/clip-path/clip-path-descendant-text-mutated-001.html": [ + [ + "css/css-masking/clip-path/clip-path-descendant-text-mutated-001.html", + [ + [ + "/css/css-masking/clip-path/reference/clip-path-descendant-text-mutated-001-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-masking/clip-path/clip-path-element-userSpaceOnUse-001.html": [ [ "css/css-masking/clip-path/clip-path-element-userSpaceOnUse-001.html", @@ -109151,6 +109193,18 @@ {} ] ], + "css/filter-effects/fecomposite-non-zero-inoffset-001.html": [ + [ + "css/filter-effects/fecomposite-non-zero-inoffset-001.html", + [ + [ + "/css/filter-effects/reference/fecomposite-non-zero-inoffset-001-ref.html", + "==" + ] + ], + {} + ] + ], "css/filter-effects/filter-cb-abspos-inline-001.html": [ [ "css/filter-effects/filter-cb-abspos-inline-001.html", @@ -109619,6 +109673,18 @@ {} ] ], + "css/filter-effects/remove-filter-repaint.html": [ + [ + "css/filter-effects/remove-filter-repaint.html", + [ + [ + "/css/filter-effects/reference/remove-filter-repaint-ref.html", + "==" + ] + ], + {} + ] + ], "css/filter-effects/root-element-with-opacity-filter-001.html": [ [ "css/filter-effects/root-element-with-opacity-filter-001.html", @@ -136676,6 +136742,9 @@ "content-security-policy/unsafe-hashes/support/child_window_location_navigate.sub.html": [ [] ], + "contenteditable/META.yml": [ + [] + ], "cookie-store/META.yml": [ [] ], @@ -149699,6 +149768,12 @@ "css/css-grid/grid-model/reference/100x100-grey-box.html": [ [] ], + "css/css-grid/grid-model/reference/grid-layout-stale-001-ref.html": [ + [] + ], + "css/css-grid/grid-model/reference/grid-layout-stale-002-ref.html": [ + [] + ], "css/css-grid/layout-algorithm/grid-flex-track-intrinsic-sizes-001-expected.txt": [ [] ], @@ -150740,6 +150815,9 @@ "css/css-masking/clip-path/reference/clip-path-columns-shape-002-ref.html": [ [] ], + "css/css-masking/clip-path/reference/clip-path-descendant-text-mutated-001-ref.html": [ + [] + ], "css/css-masking/clip-path/reference/clip-path-ellipse-ref.html": [ [] ], @@ -160796,6 +160874,9 @@ "css/filter-effects/reference/empty-element-with-filter-ref.html": [ [] ], + "css/filter-effects/reference/fecomposite-non-zero-inoffset-001-ref.html": [ + [] + ], "css/filter-effects/reference/filter-effect-remove-unattached-ref.html": [ [] ], @@ -160829,6 +160910,9 @@ "css/filter-effects/reference/reference-filter-update-on-attribute-change-001-ref.html": [ [] ], + "css/filter-effects/reference/remove-filter-repaint-ref.html": [ + [] + ], "css/filter-effects/reference/root-element-with-opacity-filter-001-ref.html": [ [] ], @@ -163427,9 +163511,6 @@ "dom/nodes/Document-createProcessingInstruction.js": [ [] ], - "dom/nodes/DocumentFragment-getElementById-expected.txt": [ - [] - ], "dom/nodes/Element-closest-expected.txt": [ [] ], @@ -191051,6 +191132,9 @@ "webxr/ar-module/idlharness.https.window-expected.txt": [ [] ], + "webxr/hit-test/xrRay_constructor.https-expected.txt": [ + [] + ], "webxr/idlharness.https.window-expected.txt": [ [] ], @@ -216020,6 +216104,12 @@ {} ] ], + "contenteditable/plaintext-only.html": [ + [ + "contenteditable/plaintext-only.html", + {} + ] + ], "cookie-store/change_eventhandler_for_document_cookie.tentative.https.window.js": [ [ "cookie-store/change_eventhandler_for_document_cookie.tentative.https.window.html", @@ -221631,6 +221721,12 @@ {} ] ], + "css/css-flexbox/table-as-item-cross-size.html": [ + [ + "css/css-flexbox/table-as-item-cross-size.html", + {} + ] + ], "css/css-font-loading/empty-family-load.html": [ [ "css/css-font-loading/empty-family-load.html", @@ -357959,6 +358055,14 @@ "353a3a0d51b3532e6ef92c2341a863771b072b35", "testharness" ], + "contenteditable/META.yml": [ + "3618b8d29d08c2315f6480c0e02578bb4784b344", + "support" + ], + "contenteditable/plaintext-only.html": [ + "cb8308edcc49a98be5c34c9614bc61b69e44f784", + "testharness" + ], "cookie-store/META.yml": [ "46da8a9fb654cc685e1ba928d2b7adef9c20d4c8", "support" @@ -388103,6 +388207,10 @@ "3ec47c1d42d69330c616a87f0b22208f8d6196a6", "testharness" ], + "css/css-flexbox/position-relative-with-scrollable-with-abspos-crash.html": [ + "f0699f2046089da69c04c0085a2622290b8827b7", + "crashtest" + ], "css/css-flexbox/quirks-auto-block-size-with-percentage-item.html": [ "966f39f173952f01268dcd26a9a5892bf4a689a9", "testharness" @@ -388659,6 +388767,10 @@ "a83f518a232e82bf76a8b9c7a8d6cae71808b420", "reftest" ], + "css/css-flexbox/table-as-item-cross-size.html": [ + "ba788bdd72eb2e121f6baab26f6dd7df364f6301", + "testharness" + ], "css/css-flexbox/table-as-item-fixed-min-width.html": [ "3a676babde0e573f3f801d1f498b02e8a6b891ff", "reftest" @@ -400019,6 +400131,14 @@ "a6c8d2df451fa2d95b565377841cace1f0078b4f", "testharness" ], + "css/css-grid/grid-model/grid-layout-stale-001.html": [ + "bb81546678cea67020c2f46a470098d6454981d9", + "reftest" + ], + "css/css-grid/grid-model/grid-layout-stale-002.html": [ + "ea11cd5c5cb5e869493adb908892c3b8f8d7c35d", + "reftest" + ], "css/css-grid/grid-model/grid-margins-no-collapse-001.html": [ "764cca9ced0077a7376b506f3ef8ca39d8072202", "reftest" @@ -400059,6 +400179,14 @@ "0592f6d2ce582c3c89b9d7f5278eed9458531c3c", "support" ], + "css/css-grid/grid-model/reference/grid-layout-stale-001-ref.html": [ + "3ade075c99cc2009aabc018aa4181b0ff930bea3", + "support" + ], + "css/css-grid/grid-model/reference/grid-layout-stale-002-ref.html": [ + "5d4d996106d13a060cf192efb134e1c74aae024d", + "support" + ], "css/css-grid/grid-tracks-stretched-with-different-flex-factors-sum.html": [ "f2c1d5e95a2df428432f30fc651b4bf06ae15322", "testharness" @@ -403955,6 +404083,10 @@ "6bd11a5e49a0c5ea810a272b44b9b1a081f4b672", "reftest" ], + "css/css-masking/clip-path/clip-path-descendant-text-mutated-001.html": [ + "e41dacc0b54f3f1936d23b3fb6204f394395db37", + "reftest" + ], "css/css-masking/clip-path/clip-path-element-userSpaceOnUse-001.html": [ "1381f53cb0c0aefc82a91a232b712d18be625b97", "reftest" @@ -404159,6 +404291,10 @@ "4337cdf63758c06d261eb42bd0abc595261350c1", "support" ], + "css/css-masking/clip-path/reference/clip-path-descendant-text-mutated-001-ref.html": [ + "f718ea6abfbab54333ba674ff0dcd320d8672bcd", + "support" + ], "css/css-masking/clip-path/reference/clip-path-ellipse-ref.html": [ "5adc91a5c00f27f0d3225c99a6c2534b5b868a8d", "support" @@ -442971,6 +443107,10 @@ "5d003f7f9c5175edfa869567d2fe69b95160644d", "reftest" ], + "css/filter-effects/fecomposite-non-zero-inoffset-001.html": [ + "b2d71cfa981a4a93b0fa9ad0c41d9351c2889956", + "reftest" + ], "css/filter-effects/feimage-circular-reference-foreign-object-crash.html": [ "00f0e362237ab3fdb856ea648e950608e8c3f06c", "crashtest" @@ -443419,6 +443559,10 @@ "cf2c997f6c0d60cac9896c0b0014189cea7790bc", "support" ], + "css/filter-effects/reference/fecomposite-non-zero-inoffset-001-ref.html": [ + "e4900ad0476a208ec82950a80fb36d1481bd8c09", + "support" + ], "css/filter-effects/reference/filter-effect-remove-unattached-ref.html": [ "5f9f7a76ec71bfa5abe4a0a82bc126af8fa0ad5a", "support" @@ -443463,6 +443607,10 @@ "91326ef585e6910cd499ad2d6650f18fca486921", "support" ], + "css/filter-effects/reference/remove-filter-repaint-ref.html": [ + "bde2a93360b62fcf877c270815f252b5ea0c3191", + "support" + ], "css/filter-effects/reference/root-element-with-opacity-filter-001-ref.html": [ "cd16e54c8e5b73b02585c606d0133bb36c821b31", "support" @@ -443487,6 +443635,10 @@ "344ee53e032e1bd588e971e16af2af5d0a6bcf41", "support" ], + "css/filter-effects/remove-filter-repaint.html": [ + "a9af9db34eeaf10235521514f8c17ceca858924e", + "reftest" + ], "css/filter-effects/resources/reference.png": [ "68641b76771abf086dc213b353ac2088fffb931a", "support" @@ -453363,10 +453515,6 @@ "e97a7c483605cc111a429564fa193cc36eb8d07a", "testharness" ], - "dom/nodes/DocumentFragment-getElementById-expected.txt": [ - "1046305df497f8b2b5c93f68a70920b0d1cc6325", - "support" - ], "dom/nodes/DocumentFragment-getElementById.html": [ "ce0d302c12b5c4bd07ec8f4aee675b2060f4dc72", "testharness" @@ -536355,8 +536503,12 @@ "5d8b0322303b57a3011354f27dd31cccb2ecd313", "testharness" ], + "webxr/hit-test/xrRay_constructor.https-expected.txt": [ + "4dfac6161c9a868ea3e7c1b7367891b13c7b2414", + "support" + ], "webxr/hit-test/xrRay_constructor.https.html": [ - "08f20142e38e9366bd016fb92666b5136128fef6", + "d4d727785f1eb5487765249cf6c58dbe1111f3c5", "testharness" ], "webxr/hit-test/xrRay_matrix.https.html": [ @@ -536400,7 +536552,7 @@ "support" ], "webxr/resources/webxr_test_constants_fake_world.js": [ - "4e2adc633fd88bc13a4ab62bee86b4f3fbd19479", + "7e428e21550f6a52461cb8470dee0aa44e3f4578", "support" ], "webxr/resources/webxr_util.js": [
diff --git a/third_party/blink/web_tests/external/wpt/content-security-policy/inheritance/iframe-all-local-schemes.sub.html b/third_party/blink/web_tests/external/wpt/content-security-policy/inheritance/iframe-all-local-schemes.sub.html index cd38c902..20a9cbd 100644 --- a/third_party/blink/web_tests/external/wpt/content-security-policy/inheritance/iframe-all-local-schemes.sub.html +++ b/third_party/blink/web_tests/external/wpt/content-security-policy/inheritance/iframe-all-local-schemes.sub.html
@@ -80,7 +80,26 @@ wait_for_error_from_frame(i, t); document.body.appendChild(i); - }, "<iframe src='javascript:...'>'s inherits policy."); + }, "<iframe src='javascript:...'>'s inherits policy (static <img> is blocked)"); + + // Same as the previous javascript-URL test, but instead of loading the <img> + // from the new document, this one is created from the initial empty document, + // while evaluating the javascript-url. + // See https://crbug.com/1064676 + async_test(t => { + let url = `javascript: + let img = document.createElement('img'); + img.onload = () => window.top.postMessage('load', '*'); + img.onerror = () => window.top.postMessage('error', '*'); + img.src = '{{location[server]}}/images/red-16x16.png'; + document.body.appendChild(img); + `; + var i = document.createElement('iframe'); + i.src = encodeURI(url.replace(/\n/g, "")); + wait_for_error_from_frame(i, t); + + document.body.appendChild(i); + }, "<iframe src='javascript:...'>'s inherits policy (dynamically inserted <img> is blocked)"); async_test(t => { var i = document.createElement('iframe');
diff --git a/third_party/blink/web_tests/external/wpt/contenteditable/META.yml b/third_party/blink/web_tests/external/wpt/contenteditable/META.yml new file mode 100644 index 0000000..3618b8d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/contenteditable/META.yml
@@ -0,0 +1,3 @@ +spec: https://w3c.github.io/contentEditable/ +suggested_reviewers: + - marcoscaceres
diff --git a/third_party/blink/web_tests/external/wpt/contenteditable/plaintext-only.html b/third_party/blink/web_tests/external/wpt/contenteditable/plaintext-only.html new file mode 100644 index 0000000..cb8308e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/contenteditable/plaintext-only.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>contenteditable="plaintext-only" should exist</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="txt" contenteditable="plaintext-only"></div> +<script> +test(function() { + const txt = document.getElementById('txt'); + assert_true(txt.isContentEditable); + assert_equals(txt.contentEditable, 'plaintext-only'); +}, 'plaintext-only is an accepted attribute value for contenteditable'); +test(function() { + const txt = document.createElement('div'); + assert_false(txt.isContentEditable); + txt.contentEditable = 'plaintext-only'; + assert_true(txt.isContentEditable); + assert_equals(txt.contentEditable, 'plaintext-only'); +}, 'plaintext-only can be assigned to contenteditable dynamically'); +</script>
diff --git a/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-columns.html b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-definition/flex-and-minmax-content-resolution-columns-001.html similarity index 85% rename from third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-columns.html rename to third_party/blink/web_tests/external/wpt/css/css-grid/grid-definition/flex-and-minmax-content-resolution-columns-001.html index aeeb62a..b92eb9f 100644 --- a/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-columns.html +++ b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-definition/flex-and-minmax-content-resolution-columns-001.html
@@ -1,6 +1,14 @@ <!DOCTYPE html> <html> -<link href="resources/grid.css" rel="stylesheet"> +<title>CSS Grid Layout Test: Auto repeat tracks, grid-template-columns and minmax sizes.</title> +<link rel="author" title="Julien Chaffraix" href="mailto:jchaffraix@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-grid-1/#track-sizes"> +<link rel="help" href="https://drafts.csswg.org/css-grid-1/#fr-unit"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=235258"> +<link rel="stylesheet" href="/fonts/ahem.css"> +<link rel="stylesheet" href="/css/support/grid.css"> +<meta name="assert" content="Test that resolving auto tracks on grid items inside containers using minmax() with grid-template-columns works properly." /> + <style> .gridMaxMaxContent { grid-template-columns: minmax(10px, max-content) minmax(10px, 1fr); @@ -36,10 +44,15 @@ grid-row: 1; } </style> -<script src="../../resources/check-layout.js"></script> -<body onload="checkLayout('.grid');"> -<p>Test that resolving auto tracks on grid items works properly.</p> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> +<script type="text/javascript"> + setup({ explicit_done: true }); +</script> + +<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })"> <div class="constrainedContainer"> <div class="grid gridMaxMaxContent">
diff --git a/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-definition/flex-and-minmax-content-resolution-rows-001.html similarity index 90% rename from third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html rename to third_party/blink/web_tests/external/wpt/css/css-grid/grid-definition/flex-and-minmax-content-resolution-rows-001.html index 5e20090..ebaa2c08 100644 --- a/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html +++ b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-definition/flex-and-minmax-content-resolution-rows-001.html
@@ -1,6 +1,14 @@ <!DOCTYPE html> <html> -<link href="resources/grid.css" rel="stylesheet"> +<title>CSS Grid Layout Test: Auto repeat tracks, grid-template-rows and minmax sizes.</title> +<link rel="author" title="Julien Chaffraix" href="mailto:jchaffraix@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-grid-1/#track-sizes"> +<link rel="help" href="https://drafts.csswg.org/css-grid-1/#fr-unit"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=235258"> +<link rel="stylesheet" href="/fonts/ahem.css"> +<link rel="stylesheet" href="/css/support/grid.css"> +<meta name="assert" content="Test that resolving auto tracks on grid items inside containers using minmax() with grid-template-rows works properly." /> + <style> .gridMaxMaxContent { grid-template-columns: 50px; @@ -36,8 +44,15 @@ grid-row: 4; } </style> -<script src="../../resources/check-layout.js"></script> -<body onload="checkLayout('.grid');"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> +<script type="text/javascript"> + setup({ explicit_done: true }); +</script> + +<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })"> <p>Test that resolving auto tracks on grid items works properly.</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/grid-layout-stale-001.html b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/grid-layout-stale-001.html new file mode 100644 index 0000000..bb81546 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/grid-layout-stale-001.html
@@ -0,0 +1,42 @@ +<!doctype html> +<title>CSS Grid: Do not add non-children of the grid into the grid container</title> +<link rel="author" title="Sergio Villar" href="mailto:svillar@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid"> +<link rel="help" href="https://crbug.com/313293"> +<link rel="match" href="reference/grid-layout-stale-001-ref.html"> +<meta name="assert" content="Check that we do not add non-children of the grid into the grid representation."/> + +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="/resources/testdriver-vendor.js"></script> + +<style> + embed { position: absolute; } + .c1 { animation-delay: 45762s; } +</style> + +<p>This test passes if it doesn't crash and it matches the reference.</p> +<div style="display: grid;"> + <embed type="something-not-js"> +</div> + +<script> +function keyPress(key) { + let actions = new test_driver.Actions() + .keyDown(key) + .keyUp(key); + + return actions.send(); +} +function crash() { + var highlight = document.createElementNS("http://www.w3.org/1999/xhtml", "highlight"); + highlight.setAttribute("class", "c1"); + document.body.appendChild(highlight); + + for (i=0; i != 8; i++) + keyPress("\t"); + keyPress("X"); +} + +document.addEventListener("DOMContentLoaded", crash, false); +</script> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/grid-layout-stale-002.html b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/grid-layout-stale-002.html new file mode 100644 index 0000000..ea11cd5 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/grid-layout-stale-002.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<title>CSS Grid: Do not leave stale pointers into the grid container</title> +<link rel="author" title="Sergio Villar" href="mailto:svillar@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid"> +<link rel="help" href="https://crbug.com/313293"> +<link rel="match" href="reference/grid-layout-stale-002-ref.html"> +<meta name="assert" content="Check that we don't leave stale pointers into the internal grid representation."/> + +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="/resources/testdriver-vendor.js"></script> + +<p>This test passes if it doesn't crash and it matches the reference.</p> +<span style="display: grid" contenteditable=plaintext-only></span> +<script> +function keyPress(key) { + let actions = new test_driver.Actions() + .keyDown(key) + .keyUp(key); + + return actions.send(); +} +function crash() { + keyPress("\t"); + keyPress("X"); + document.designMode = 'on'; + document.execCommand("InsertHTML", false, "<div>"); +} +document.addEventListener("DOMContentLoaded", crash, false); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/reference/grid-layout-stale-001-ref.html b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/reference/grid-layout-stale-001-ref.html new file mode 100644 index 0000000..3ade075c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/reference/grid-layout-stale-001-ref.html
@@ -0,0 +1,13 @@ +<!doctype html> +<title>CSS Grid: Do not add non-children of the grid into the grid container</title> + +<style> + embed { position: absolute; } + .c1 { animation-delay: 45762s; } +</style> + +<p>This test passes if it doesn't crash and it matches the reference.</p> +<div style="display: grid;"> + <embed type="something-not-js"> +</div> +<highlight class="c1"></highlight>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/reference/grid-layout-stale-002-ref.html b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/reference/grid-layout-stale-002-ref.html new file mode 100644 index 0000000..5d4d996 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/reference/grid-layout-stale-002-ref.html
@@ -0,0 +1,4 @@ +<!DOCTYPE html> +<title>CSS Grid: Do not leave stale pointers into the grid container</title> +<p>This test passes if it doesn't crash and it matches the reference.</p> +<span style="display: grid" contenteditable=plaintext-only></span>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-masking/clip-path/reference-nonexisting-existing-local.html b/third_party/blink/web_tests/external/wpt/css/css-masking/clip-path/reference-nonexisting-existing-local.html new file mode 100644 index 0000000..d02e1439 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-masking/clip-path/reference-nonexisting-existing-local.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<title>CSS Masking: fragment of non valid URL as clip.</title> +<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#the-clip-path"> +<link rel="match" href="reference/reference-nonexisting-existing-local-ref.html"> +<meta name="assert" content="Test ensures that only local URLs with a valid fragment result in a valid clip."/> +<style> +#target { + width: 100px; + height: 100px; + background-color: green; + clip-path: url(notexisting.svg#c); +} +</style> +<div style="background-color: red; width: 100px"> + <div id="target"></div> +</div> +<svg> + <clipPath id="c" clipPathUnits="objectBoundingBox"> + <circle cx="0.5" cy="0.5" r="0.5"/> + </clipPath> +</svg>
diff --git a/third_party/blink/web_tests/css3/masking/clip-path-reference-nonexisting-existing-local-expected.html b/third_party/blink/web_tests/external/wpt/css/css-masking/clip-path/reference/reference-nonexisting-existing-local-ref.html similarity index 100% rename from third_party/blink/web_tests/css3/masking/clip-path-reference-nonexisting-existing-local-expected.html rename to third_party/blink/web_tests/external/wpt/css/css-masking/clip-path/reference/reference-nonexisting-existing-local-ref.html
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/clip-under-filter-003.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/clip-under-filter-003.html new file mode 100644 index 0000000..2cfda2a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/clip-under-filter-003.html
@@ -0,0 +1,13 @@ +<!DOCTYPE html> +<title>CSS filter : Clipping on descendant of filter element</title> +<link rel="help" href="https://drafts.fxtf.org/filter-effects/#FilterProperty"> +<link rel="help" href="https://drafts.fxtf.org/filter-effects/#funcdef-filter-opacity"> +<link rel="help" href="https://crbug.com/734116"> +<link rel="help" href="https://crbug.com/747511"> +<link rel="match" href="reference/clip-under-filter-003-ref.html"> +<meta name="assert" content="This test ensures that overflow clip correctly applies to children in the presence of a filter on the same element"/> +<div style="position:relative; width:100px; height:100px; border:5px dashed black; background:green; overflow:hidden; filter:opacity(1);"> + <div style="margin-left:-5px; margin-top:-5px; width:100px; height:100px; border:5px solid red;"></div> +</div> +This test verifies overflow clip correctly applies to children in the presence of a filter on the same element.<br/> +It succeeds if a green box with dashed black border is shown. No red border should be visible.
diff --git a/third_party/blink/web_tests/paint/filters/clip-under-filter-2-expected.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/reference/clip-under-filter-003-ref.html similarity index 100% rename from third_party/blink/web_tests/paint/filters/clip-under-filter-2-expected.html rename to third_party/blink/web_tests/external/wpt/css/filter-effects/reference/clip-under-filter-003-ref.html
diff --git a/third_party/blink/web_tests/external/wpt/webxr/hit-test/xrRay_constructor.https-expected.txt b/third_party/blink/web_tests/external/wpt/webxr/hit-test/xrRay_constructor.https-expected.txt new file mode 100644 index 0000000..4dfac6161 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/webxr/hit-test/xrRay_constructor.https-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +FAIL XRRay constructors work assert_throws_js: Constructor should throw for zero direction function "() => new XRRay( + DOMPoint.fromPoint(originDict), + DOMPoint.fromPoint({x : 0.0, y : 0.0, z : 0.0, w : 0.0}) + )" threw object "InvalidStateError: Failed to construct 'XRRay': Unable to normalize vector of length 0." ("InvalidStateError") expected instance of function "function TypeError() { [native code] }" ("TypeError") +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/webxr/hit-test/xrRay_constructor.https.html b/third_party/blink/web_tests/external/wpt/webxr/hit-test/xrRay_constructor.https.html index 08f20142..d4d7277 100644 --- a/third_party/blink/web_tests/external/wpt/webxr/hit-test/xrRay_constructor.https.html +++ b/third_party/blink/web_tests/external/wpt/webxr/hit-test/xrRay_constructor.https.html
@@ -91,25 +91,23 @@ { // Check that we throw exception on direction too close to 0,0,0: let originDict = {x : 10.0, y : 10.0, z : 10.0, w : 1.0}; - let directionDict = {x : 0.0, y : 0.0, z : 0.0, w : 0.0}; + let directionDict = {x : 1.0, y : 0.0, z : 0.0, w : 0.0}; - try { - let xrRay = new XRRay( + assert_throws_js(TypeError, () => new XRRay( DOMPoint.fromPoint(originDict), - DOMPoint.fromPoint(directionDict)); + DOMPoint.fromPoint({x : 0.0, y : 0.0, z : 0.0, w : 0.0}) + ), "Constructor should throw for zero direction"); - assert(false, "origin-custom-direction-zero:exception not thrown"); - } - catch(e) - { - if(e instanceof DOMException) { - assert_equals(e.name, "InvalidStateError", "origin-custom-direction-zero:incorrect DOM exception thrown"); - } else { - assert(false, "origin-custom-direction-zero:other exception thrown: " + e); - } - } + assert_throws_js(TypeError, () => new XRRay( + DOMPoint.fromPoint(originDict), + DOMPoint.fromPoint({x : 1.0, y : 0.0, z : 0.0, w : 0.5}) + ), "Constructor should throw for nonzero direction w coordinate"); + + assert_throws_js(TypeError, () => new XRRay( + DOMPoint.fromPoint({x : 10.0, y : 10.0, z : 10.0, w : 0.5}), + DOMPoint.fromPoint(directionDict) + ), "Constructor should throw for non-1 origin w coordinate"); } - // // Constructor 2 - from rigid transform. //
diff --git a/third_party/blink/web_tests/external/wpt/webxr/resources/webxr_test_constants_fake_world.js b/third_party/blink/web_tests/external/wpt/webxr/resources/webxr_test_constants_fake_world.js index 4e2adc6..7e428e2 100644 --- a/third_party/blink/web_tests/external/wpt/webxr/resources/webxr_test_constants_fake_world.js +++ b/third_party/blink/web_tests/external/wpt/webxr/resources/webxr_test_constants_fake_world.js
@@ -29,26 +29,26 @@ // Faces: const FRONT_WALL_AND_FLOOR_FACES = [ // Front wall: - [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT], - [BOTTOM_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_LEFT_FRONT], + { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT] }, + { vertices: [BOTTOM_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_LEFT_FRONT] }, // Floor: - [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK], - [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, BOTTOM_RIGHT_BACK], + { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK] }, + { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, BOTTOM_RIGHT_BACK] }, ]; const CEILING_FACES = [ // Ceiling: - [TOP_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK], - [TOP_LEFT_FRONT, TOP_LEFT_BACK, TOP_RIGHT_BACK], + { vertices: [TOP_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK] }, + { vertices: [TOP_LEFT_FRONT, TOP_LEFT_BACK, TOP_RIGHT_BACK] }, ]; const SIDE_WALLS_FACES = [ // Left: - [BOTTOM_LEFT_FRONT, TOP_LEFT_FRONT, TOP_LEFT_BACK], - [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, TOP_LEFT_BACK], + { vertices: [BOTTOM_LEFT_FRONT, TOP_LEFT_FRONT, TOP_LEFT_BACK] }, + { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, TOP_LEFT_BACK] }, // Right: - [BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK], - [BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK, TOP_RIGHT_BACK], + { vertices: [BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK] }, + { vertices: [BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK, TOP_RIGHT_BACK] }, ]; // Regions:
diff --git a/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-columns-expected.txt b/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-columns-expected.txt deleted file mode 100644 index de41553..0000000 --- a/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-columns-expected.txt +++ /dev/null
@@ -1,26 +0,0 @@ -Test that resolving auto tracks on grid items works properly. - -XXXXX -PASS -XXXXX -PASS -XXXXX -PASS -XX XX -XX XX -PASS -XX XX -XX XX -PASS -XX XX -XX XX -PASS -PASS -XXXXXXXXXX -PASS -XXXXXXXXXX XXXXXXXXX -PASS -XXXXXXXXXX XXXXXXXXX -PASS -XXXXXXXXXX XXXXXXXXX -PASS
diff --git a/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows-expected.txt b/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows-expected.txt deleted file mode 100644 index 21e9aec26..0000000 --- a/third_party/blink/web_tests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows-expected.txt +++ /dev/null
@@ -1,58 +0,0 @@ -Test that resolving auto tracks on grid items works properly. - -XXXXX -PASS -XXXXX -PASS -XXXXX -PASS -XXXXX -PASS -XXXXX -PASS -XXXXX XXXX -XXXXX XXXX -PASS -XXXXX XXXX -XXXXX XXXX -PASS -XXXXX XXXX -XXXXX XXXX -PASS -XXXXX XXXX -XXXXX XXXX -PASS -XXXXX XXXX -XXXXX XXXX -PASS -XXXXX XXXX -XXXXX XXXX -PASS -XXXXX XXXXX XXXXX XXXXX -PASS -XXXXX XXXXX XXXXX XXXXX -PASS -XXXXX XXXXX XXXXX XXXXX XXXXX -XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX -PASS -XXXXX XXXXX XXXXX XXXXX XXXXX -XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX -PASS -XXXXX XXXXX XXXXX XXXXX -XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX -PASS -XXXXX XXXXX XXXXX XXXXX -XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX -PASS -XXXXX XXXXX XXXXX XXXXX -XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX -PASS -XXXXX XXXXX XXXXX XXXXX -XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX -PASS -XXXXX XXXXX XXXXX XXXXX -XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX -PASS -XXXXX XXXXX XXXXX XXXXX -XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX -PASS
diff --git a/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout-2-expected.txt b/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout-2-expected.txt deleted file mode 100644 index 32d36ec..0000000 --- a/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout-2-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -XThe test checks that we don't leave stale pointers into the internal grid representation. - - This test has PASSED if it didn't crash under ASAN. -
diff --git a/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout-2.html b/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout-2.html deleted file mode 100644 index eadda6b..0000000 --- a/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout-2.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<span style="display: grid" contenteditable=plaintext-only> -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -function crash() { - if (!window.eventSender) - return; - eventSender.keyDown("\t"); - eventSender.keyDown("X"); - document.designMode = 'on'; - document.execCommand("InsertHTML", false, "<div>"); -} -document.addEventListener("DOMContentLoaded", crash, false); -</script>The test checks that we don't leave stale pointers into the internal grid representation.<br> This test has PASSED if it didn't crash under ASAN.
diff --git a/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout-expected.txt b/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout-expected.txt deleted file mode 100644 index 7b8fbf7..0000000 --- a/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -The test checks that we don't add non-children of the grid into the grid representation -This test has passed if it didn't crash under ASAN.
diff --git a/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout.html b/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout.html deleted file mode 100644 index 908e1ccb..0000000 --- a/third_party/blink/web_tests/fast/css-grid-layout/stale-grid-layout.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<keygen> -<div style="display: grid;">The test checks that we don't add non-children of the grid into the grid representation<br>This test has passed if it didn't crash under ASAN. - <embed type=something-not-js> -</div> -<style> -embed { position: absolute; } -.c1 { animation-delay: 45762s; } -</style> -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -function crash() { - var highlight = document.createElementNS("http://www.w3.org/1999/xhtml", "highlight"); - highlight.setAttribute("class", "c1"); - document.body.appendChild(highlight); - - for (i=0; i != 8; i++) - eventSender.keyDown("\t"); - eventSender.keyDown("X"); -} - -if (!window.eventSender) - alert("This test needs to be run under DumpRenderTree."); -else - document.addEventListener("DOMContentLoaded", crash, false); -</script>
diff --git a/third_party/blink/web_tests/paint/filters/clip-under-filter-2.html b/third_party/blink/web_tests/paint/filters/clip-under-filter-2.html deleted file mode 100644 index 798444b..0000000 --- a/third_party/blink/web_tests/paint/filters/clip-under-filter-2.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<div style="position:relative; width:100px; height:100px; border:5px dashed black; background:green; overflow:hidden; filter:opacity(1);"> - <div style="margin-left:-5px; margin-top:-5px; width:100px; height:100px; border:5px solid red;"></div> -</div> -This test verifies overflow clip correctly applies to children in the presence of a filter on the same element.<br/> -It succeeds if a green box with dashed black border is shown. No red border should be visible.
diff --git a/third_party/blink/web_tests/virtual/streaming-preload/external/wpt/html/semantics/scripting-1/README.txt b/third_party/blink/web_tests/virtual/streaming-preload/external/wpt/html/semantics/scripting-1/README.txt deleted file mode 100644 index 38c97164..0000000 --- a/third_party/blink/web_tests/virtual/streaming-preload/external/wpt/html/semantics/scripting-1/README.txt +++ /dev/null
@@ -1,2 +0,0 @@ -# This suite runs the tests in external/wpt/html/semantics/scripting-1 with the -# flag --enable-feature=ScriptStreamingOnPreload \ No newline at end of file
diff --git a/third_party/blink/web_tests/virtual/streaming-preload/http/tests/fetch/README.txt b/third_party/blink/web_tests/virtual/streaming-preload/http/tests/fetch/README.txt deleted file mode 100644 index 45ff0e3..0000000 --- a/third_party/blink/web_tests/virtual/streaming-preload/http/tests/fetch/README.txt +++ /dev/null
@@ -1,2 +0,0 @@ -# This suite runs the tests in http/tests/fetch with the flag -# --enable-feature=ScriptStreamingOnPreload \ No newline at end of file
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/invalidation-client-core.cc b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/invalidation-client-core.cc index 70762d0..46c93d7 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/invalidation-client-core.cc +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/invalidation-client-core.cc
@@ -167,7 +167,7 @@ client->config_.heartbeat_interval_ms()), Scheduler::NoDelay()), client_(client) { - next_performance_send_time_ = client_->internal_scheduler_->GetCurrentTime() + + next_performance_send_time_ = client_->internal_scheduler_->CurrentTime() + smearer()->GetSmearedDelay(TimeDelta::FromMilliseconds( client_->config_.perf_counter_delay_ms())); } @@ -179,9 +179,9 @@ client_->ToString().c_str()); Scheduler *scheduler = client_->internal_scheduler_; bool must_send_perf_counters = - next_performance_send_time_ > scheduler->GetCurrentTime(); + next_performance_send_time_ > scheduler->CurrentTime(); if (must_send_perf_counters) { - next_performance_send_time_ = scheduler->GetCurrentTime() + + next_performance_send_time_ = scheduler->CurrentTime() + client_->smearer_.GetSmearedDelay(TimeDelta::FromMilliseconds( client_->config_.perf_counter_delay_ms())); } @@ -762,7 +762,7 @@ void InvalidationClientCore::HandleMessageSent() { CHECK(internal_scheduler_->IsRunningOnThread()) << "Not on internal thread"; - last_message_send_time_ = internal_scheduler_->GetCurrentTime(); + last_message_send_time_ = internal_scheduler_->CurrentTime(); } void InvalidationClientCore::HandleNetworkStatusChange(bool is_online) { @@ -772,13 +772,13 @@ bool was_online = is_online_; is_online_ = is_online; if (is_online && !was_online && - (internal_scheduler_->GetCurrentTime() > + (internal_scheduler_->CurrentTime() > last_message_send_time_ + TimeDelta::FromMilliseconds( config_.offline_heartbeat_threshold_ms()))) { TLOG(logger_, INFO, "Sending heartbeat after reconnection; previous send was %s ms ago", SimpleItoa( - (internal_scheduler_->GetCurrentTime() - last_message_send_time_) + (internal_scheduler_->CurrentTime() - last_message_send_time_) .InMilliseconds()).c_str()); SendInfoMessageToServer( false, !registration_manager_.IsStateInSyncWithServer());
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/invalidation-client-util.h b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/invalidation-client-util.h index 13ea46f..9809bd5d 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/invalidation-client-util.h +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/invalidation-client-util.h
@@ -33,7 +33,7 @@ /* Returns the current time in the scheduler's epoch in milliseconds. */ static int64_t GetCurrentTimeMs(Scheduler* scheduler) { - return GetTimeInMillis(scheduler->GetCurrentTime()); + return GetTimeInMillis(scheduler->CurrentTime()); } };
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/recurring-task.cc b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/recurring-task.cc index 3196c8f..ebc985e 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/recurring-task.cc +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/recurring-task.cc
@@ -52,7 +52,7 @@ TLOG(logger_, FINE, "[%s] Scheduling %d with a delay %d, Now = %d", debug_reason.c_str(), name_.c_str(), delay.ToInternalValue(), - scheduler_->GetCurrentTime().ToInternalValue()); + scheduler_->CurrentTime().ToInternalValue()); scheduler_->Schedule(delay, NewPermanentCallback(this, &RecurringTask::RunTaskAndRescheduleIfNeeded)); is_scheduled_ = true;
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/recurring-task_test.cc b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/recurring-task_test.cc index cbe45e21..5ec0c3ed 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/recurring-task_test.cc +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/recurring-task_test.cc
@@ -68,7 +68,7 @@ virtual bool RunTask() { current_runs++; TLOG(logger_, INFO, "(%d) Task running: %d", - scheduler_->GetCurrentTime().ToInternalValue(), current_runs); + scheduler_->CurrentTime().ToInternalValue(), current_runs); return current_runs < max_runs_; }
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/throttle.cc b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/throttle.cc index fa84fc8..db9176f 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/throttle.cc +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/throttle.cc
@@ -52,7 +52,7 @@ // Go through all of the limits to see if we've hit one. If so, schedule a // task to try again once that limit won't be violated. If no limits would be // violated, send. - Time now = scheduler_->GetCurrentTime(); + Time now = scheduler_->CurrentTime(); for (size_t i = 0; i < static_cast<size_t>(rate_limits_.size()); ++i) { RateLimitP rate_limit = rate_limits_.Get(i); @@ -102,7 +102,7 @@ listener_->Run(); // Record the fact that we're triggering an event now. - recent_event_times_.push_back(scheduler_->GetCurrentTime()); + recent_event_times_.push_back(scheduler_->CurrentTime()); // Only save up to max_recent_events_ event times. if (recent_event_times_.size() > max_recent_events_) {
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/throttle_test.cc b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/throttle_test.cc index 2df0de0..d47cc24 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/throttle_test.cc +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/impl/throttle_test.cc
@@ -39,7 +39,7 @@ // Increment the call count. ++call_count_; // Check that we haven't been called within the last one second. - Time now = scheduler_->GetCurrentTime(); + Time now = scheduler_->CurrentTime(); ASSERT_TRUE((now - last_call_time_) >= TimeDelta::FromSeconds(1)); // Update the last time we were called to now. last_call_time_ = now; @@ -53,7 +53,7 @@ void SetUp() { logger_.reset(new TestLogger()); scheduler_.reset(new DeterministicScheduler(logger_.get())); - start_time_ = scheduler_->GetCurrentTime(); + start_time_ = scheduler_->CurrentTime(); call_count_ = 0; last_call_time_ = Time() - TimeDelta::FromHours(1); ProtoHelpers::InitRateLimitP(1000, kMessagesPerSecond, rate_limits_.Add()); @@ -115,7 +115,7 @@ // ... until the short throttle interval passes, at which time it should be // called once more. scheduler_->PassTime( - start_time_ + TimeDelta::FromSeconds(1) - scheduler_->GetCurrentTime()); + start_time_ + TimeDelta::FromSeconds(1) - scheduler_->CurrentTime()); ASSERT_EQ(2, call_count_); @@ -144,7 +144,7 @@ // Now if we fire slowly, we still shouldn't make calls, since we'd violate // the larger rate limit interval. int fire_attempts = - ((start_time_ + TimeDelta::FromMinutes(1) - scheduler_->GetCurrentTime()) + ((start_time_ + TimeDelta::FromMinutes(1) - scheduler_->CurrentTime()) / long_interval) - 1; // This value should be 20. for (int i = 0; i < fire_attempts; ++i) { @@ -154,7 +154,7 @@ } Time time_to_send_again = start_time_ + TimeDelta::FromMinutes(1); - scheduler_->PassTime(time_to_send_again - scheduler_->GetCurrentTime()); + scheduler_->PassTime(time_to_send_again - scheduler_->CurrentTime()); ASSERT_EQ(kMessagesPerMinute + 1, call_count_); }
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/include/system-resources.h b/third_party/cacheinvalidation/src/google/cacheinvalidation/include/system-resources.h index 979140c..92570434 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/include/system-resources.h +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/include/system-resources.h
@@ -128,7 +128,7 @@ * necessarily the UNIX epoch). The only requirement is that this time * advance at the rate of real time. */ - virtual Time GetCurrentTime() const = 0; + virtual Time CurrentTime() const = 0; }; /* Interface specifying the network functionality provided by
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/test/deterministic-scheduler.cc b/third_party/cacheinvalidation/src/google/cacheinvalidation/test/deterministic-scheduler.cc index 3def8f7..8252912 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/test/deterministic-scheduler.cc +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/test/deterministic-scheduler.cc
@@ -31,7 +31,7 @@ CHECK(run_state_.IsStarted()); TLOG(logger_, INFO, "(Now: %d) Enqueuing %p with delay %d", current_time_.ToInternalValue(), task, delay.InMilliseconds()); - work_queue_.push(TaskEntry(GetCurrentTime() + delay, current_id_++, task)); + work_queue_.push(TaskEntry(CurrentTime() + delay, current_id_++, task)); } void DeterministicScheduler::PassTime(TimeDelta delta_time, TimeDelta step) { @@ -67,7 +67,7 @@ // The queue is not empty, so get the first task and see if its scheduled // execution time has passed. TaskEntry top_elt = work_queue_.top(); - if (top_elt.time <= GetCurrentTime()) { + if (top_elt.time <= CurrentTime()) { // The task is scheduled to run in the past or present, so remove it // from the queue and run the task. work_queue_.pop();
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/test/deterministic-scheduler.h b/third_party/cacheinvalidation/src/google/cacheinvalidation/test/deterministic-scheduler.h index fbe450f..434e9159 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/test/deterministic-scheduler.h +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/test/deterministic-scheduler.h
@@ -65,7 +65,7 @@ // Nothing to do. } - virtual Time GetCurrentTime() const { + virtual Time CurrentTime() const { return current_time_; }
diff --git a/third_party/cacheinvalidation/src/google/cacheinvalidation/test/test-utils.h b/third_party/cacheinvalidation/src/google/cacheinvalidation/test/test-utils.h index 0371877..9ff461c 100644 --- a/third_party/cacheinvalidation/src/google/cacheinvalidation/test/test-utils.h +++ b/third_party/cacheinvalidation/src/google/cacheinvalidation/test/test-utils.h
@@ -86,7 +86,7 @@ public: MOCK_METHOD2(Schedule, void(TimeDelta, Closure*)); // NOLINT MOCK_CONST_METHOD0(IsRunningOnThread, bool()); - MOCK_CONST_METHOD0(GetCurrentTime, Time()); + MOCK_CONST_METHOD0(CurrentTime, Time()); MOCK_METHOD1(SetSystemResources, void(SystemResources*)); // NOLINT };
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 8fc5cc6d..562b0b1 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -124223,40 +124223,46 @@ </histogram> <histogram name="Plugin.PpapiBrokerLoadErrorCode" enum="WinGetLastError" - expires_after="M87"> + expires_after="M88"> <owner>xhwang@chromium.org</owner> + <owner>media-dev@chromium.org</owner> <summary> The error code of a PPAPI broker load failure. Only reported on Windows. </summary> </histogram> <histogram name="Plugin.PpapiBrokerLoadResult" enum="PluginLoadResult" - expires_after="M87"> + expires_after="M88"> <owner>xhwang@chromium.org</owner> + <owner>media-dev@chromium.org</owner> <summary>The result from an attempt to load a PPAPI broker.</summary> </histogram> -<histogram name="Plugin.PpapiBrokerLoadTime" units="ms" expires_after="M87"> +<histogram name="Plugin.PpapiBrokerLoadTime" units="ms" expires_after="M88"> <owner>xhwang@chromium.org</owner> + <owner>media-dev@chromium.org</owner> <summary>The time spent to load a PPAPI broker.</summary> </histogram> <histogram name="Plugin.PpapiPluginLoadErrorCode" enum="WinGetLastError" - expires_after="M85"> + expires_after="M88"> <owner>xhwang@chromium.org</owner> + <owner>media-dev@chromium.org</owner> <summary> The error code of a PPAPI plugin load failure. Only reported on Windows. </summary> </histogram> <histogram name="Plugin.PpapiPluginLoadResult" enum="PluginLoadResult" - expires_after="M81"> + expires_after="M88"> <owner>xhwang@chromium.org</owner> + <owner>media-dev@chromium.org</owner> <summary>The result from an attempt to load a PPAPI plugin.</summary> </histogram> -<histogram name="Plugin.PpapiPluginLoadTime" units="ms" expires_after="M81"> +<histogram name="Plugin.PpapiPluginLoadTime" units="ms" expires_after="M88"> <owner>xhwang@chromium.org</owner> + <owner>media-dev@chromium.org</owner> <summary>The time spent to load a PPAPI plugin.</summary> </histogram>
diff --git a/tools/perf/benchmark.csv b/tools/perf/benchmark.csv index 0d1ed24..04ba2d56 100644 --- a/tools/perf/benchmark.csv +++ b/tools/perf/benchmark.csv
@@ -3,6 +3,7 @@ Googlers can view additional information about internal perf infrastructure at,https://goto.google.com/chrome-benchmarking-sheet Benchmark name,Individual owners,Component,Documentation,Tags UNSCHEDULED_blink_perf.service_worker,"shimazu@chromium.org, falken@chromium.org, ting.shao@intel.com",Blink>ServiceWorker,https://bit.ly/blink-perf-benchmarks, +UNSCHEDULED_blink_perf.webaudio,"hongchan@chromium.org, rtoy@chromium.org",Blink>WebAudio,https://bit.ly/blink-perf-benchmarks,all angle_perftests,"jmadill@chromium.org, chrome-gpu-perf-owners@chromium.org",Internals>GPU>ANGLE,, base_perftests,"skyostil@chromium.org, gab@chromium.org",Internals>SequenceManager,https://chromium.googlesource.com/chromium/src/+/HEAD/base/README.md#performance-testing, blink_perf.accessibility,dmazzoni@chromium.org,Blink>Accessibility,https://bit.ly/blink-perf-benchmarks,all
diff --git a/tools/perf/benchmarks/blink_perf.py b/tools/perf/benchmarks/blink_perf.py index 39733d0..ea8cd58b 100644 --- a/tools/perf/benchmarks/blink_perf.py +++ b/tools/perf/benchmarks/blink_perf.py
@@ -628,3 +628,14 @@ def SetExtraBrowserOptions(self, options): options.AppendExtraBrowserArgs( ['--enable-blink-features=DisplayLocking,CSSContentSize']) + +@benchmark.Info(emails=['hongchan@chromium.org', 'rtoy@chromium.org'], + component='Blink>WebAudio', + documentation_url='https://bit.ly/blink-perf-benchmarks') +class BlinkPerfWebAudio(_BlinkPerfBenchmark): + SUBDIR = 'webaudio' + TAGS = _BlinkPerfBenchmark.TAGS + ['all'] + + @classmethod + def Name(cls): + return 'UNSCHEDULED_blink_perf.webaudio'
diff --git a/tools/traffic_annotation/summary/annotations.xml b/tools/traffic_annotation/summary/annotations.xml index c5c2cb02..7a14a07 100644 --- a/tools/traffic_annotation/summary/annotations.xml +++ b/tools/traffic_annotation/summary/annotations.xml
@@ -302,7 +302,7 @@ <item id="url_prevision_fetcher" hash_code="118389509" type="0" content_hash_code="66145513" os_list="linux,windows" file_path="content/browser/media/url_provision_fetcher.cc"/> <item id="user_info_fetcher" hash_code="22265491" type="0" content_hash_code="72016232" os_list="linux,windows" file_path="components/policy/core/common/cloud/user_info_fetcher.cc"/> <item id="viz_devtools_server" hash_code="16292315" type="0" content_hash_code="70061664" os_list="linux,windows" file_path="components/ui_devtools/devtools_server.cc"/> - <item id="web_bundle_start_url_loader" hash_code="95880423" type="0" content_hash_code="26756886" os_list="linux,windows" file_path="content/browser/web_package/web_bundle_handle.cc"/> + <item id="web_bundle_loader" hash_code="114615359" type="0" content_hash_code="57390734" os_list="linux,windows" file_path="content/browser/web_package/web_bundle_utils.cc"/> <item id="web_history_counter" hash_code="137457845" type="1" second_id="110307337" content_hash_code="49663381" os_list="linux,windows" semantics_fields="2,3,4" policy_fields="4" file_path="components/browsing_data/core/counters/history_counter.cc"/> <item id="web_history_delete_url" hash_code="41749213" type="1" second_id="110307337" content_hash_code="25943026" os_list="linux,windows" semantics_fields="2,3,4" policy_fields="4" file_path="components/history/core/browser/history_service.cc"/> <item id="web_history_expire" hash_code="60946824" type="1" second_id="110307337" content_hash_code="92626030" os_list="linux,windows" semantics_fields="2,3,4" policy_fields="4" file_path="components/history/core/browser/browsing_history_service.cc"/>
diff --git a/ui/file_manager/file_manager/background/js/app_window_wrapper.js b/ui/file_manager/file_manager/background/js/app_window_wrapper.js index 579636a..df8e93dc 100644 --- a/ui/file_manager/file_manager/background/js/app_window_wrapper.js +++ b/ui/file_manager/file_manager/background/js/app_window_wrapper.js
@@ -122,6 +122,10 @@ // Create a window. chrome.app.window.create(this.url_, this.options_, appWindow => { + if (!appWindow) { + callback(); + return; + } // Exit full screen state if it's created as a full screen window. if (appWindow.isFullscreen()) { appWindow.restore(); @@ -141,18 +145,23 @@ // After creating. this.queue.run(callback => { + if (!this.window_) { + opt_callback && opt_callback(); + callback(); + } + // If there is another window in the same position, shift the window. const makeBoundsKey = bounds => { return bounds.left + '/' + bounds.top; }; const notAvailablePositions = {}; for (let i = 0; i < similarWindows.length; i++) { - let key = makeBoundsKey(similarWindows[i].getBounds()); + const key = makeBoundsKey(similarWindows[i].getBounds()); notAvailablePositions[key] = true; } const candidateBounds = this.window_.getBounds(); while (true) { - let key = makeBoundsKey(candidateBounds); + const key = makeBoundsKey(candidateBounds); if (!notAvailablePositions[key]) { break; } @@ -333,8 +342,9 @@ return; // No app state persisted. } + let appState; try { - var appState = assertInstanceof(JSON.parse(value), Object); + appState = assertInstanceof(JSON.parse(value), Object); } catch (e) { console.error('Corrupt launch data for ' + this.id_, value); opt_callback && opt_callback();
diff --git a/ui/file_manager/file_manager/background/js/background.js b/ui/file_manager/file_manager/background/js/background.js index a29df7a0..da6abc6 100644 --- a/ui/file_manager/file_manager/background/js/background.js +++ b/ui/file_manager/file_manager/background/js/background.js
@@ -127,9 +127,7 @@ chrome.fileManagerPrivate.onMountCompleted.addListener( this.onMountCompleted_.bind(this)); - launcher.queue.run(callback => { - this.initializationPromise_.then(callback); - }); + launcher.setInitializationPromise(this.initializationPromise_); } /**
diff --git a/ui/file_manager/file_manager/background/js/launcher.js b/ui/file_manager/file_manager/background/js/launcher.js index 84d69f9..c53ca5df 100644 --- a/ui/file_manager/file_manager/background/js/launcher.js +++ b/ui/file_manager/file_manager/background/js/launcher.js
@@ -55,18 +55,24 @@ const FILES_ID_PATTERN = new RegExp('^' + FILES_ID_PREFIX + '(\\d*)$'); /** - * Synchronous queue for asynchronous calls. - * @type {!AsyncUtil.Queue} + * Promise to serialize asynchronous calls. + * @type {?Promise} */ -launcher.queue = new AsyncUtil.Queue(); +launcher.initializationPromise_ = null; + +launcher.setInitializationPromise = (promise) => { + launcher.initializationPromise_ = promise; +}; + /** * @param {Object=} opt_appState App state. * @param {number=} opt_id Window id. * @param {LaunchType=} opt_type Launch type. Default: ALWAYS_CREATE. - * @param {function(string)=} opt_callback Completion callback with the App ID. + * @param {function(?string)=} opt_callback Completion callback with the App ID. */ -launcher.launchFileManager = (opt_appState, opt_id, opt_type, opt_callback) => { +launcher.launchFileManager = + async (opt_appState, opt_id, opt_type, opt_callback) => { const type = opt_type || LaunchType.ALWAYS_CREATE; opt_appState = /** @@ -76,114 +82,117 @@ */ (opt_appState); - // Wait until all windows are created. - launcher.queue.run(onTaskCompleted => { - // Check if there is already a window with the same URL. If so, then - // reuse it instead of opening a new one. - if (type == LaunchType.FOCUS_SAME_OR_CREATE || - type == LaunchType.FOCUS_ANY_OR_CREATE) { - if (opt_appState) { - for (const key in window.appWindows) { - if (!key.match(FILES_ID_PATTERN)) { - continue; - } - const contentWindow = window.appWindows[key].contentWindow; - if (!contentWindow.appState) { - continue; - } - // Different current directories. - if (opt_appState.currentDirectoryURL !== - contentWindow.appState.currentDirectoryURL) { - continue; - } - // Selection URL specified, and it is different. - if (opt_appState.selectionURL && - opt_appState.selectionURL !== - contentWindow.appState.selectionURL) { - continue; - } - window.appWindows[key].focus(); + // Serialize concurrent calls to launchFileManager. + if (!launcher.initializationPromise_) { + throw new Error('Missing launcher.initializationPromise'); + } + + await launcher.initializationPromise_; + + // Check if there is already a window with the same URL. If so, then + // reuse it instead of opening a new one. + if (opt_appState && + (type == LaunchType.FOCUS_SAME_OR_CREATE || + type == LaunchType.FOCUS_ANY_OR_CREATE)) { + for (const key in window.appWindows) { + if (!key.match(FILES_ID_PATTERN)) { + continue; + } + const contentWindow = window.appWindows[key].contentWindow; + if (!contentWindow.appState) { + continue; + } + // Different current directories. + if (opt_appState.currentDirectoryURL !== + contentWindow.appState.currentDirectoryURL) { + continue; + } + // Selection URL specified, and it is different. + if (opt_appState.selectionURL && + opt_appState.selectionURL !== contentWindow.appState.selectionURL) { + continue; + } + window.appWindows[key].focus(); + if (opt_callback) { + opt_callback(key); + } + return Promise.resolve(key); + } + } + + // Focus any window if none is focused. Try restored first. + if (type == LaunchType.FOCUS_ANY_OR_CREATE) { + // If there is already a focused window, then finish. + for (const key in window.appWindows) { + if (!key.match(FILES_ID_PATTERN)) { + continue; + } + + // The isFocused() method should always be available, but in case + // the Files app's failed on some error, wrap it with try catch. + try { + if (window.appWindows[key].contentWindow.isFocused()) { if (opt_callback) { opt_callback(key); } - onTaskCompleted(); - return; + return Promise.resolve(key); } + } catch (e) { + console.error(e.message); } } - - // Focus any window if none is focused. Try restored first. - if (type == LaunchType.FOCUS_ANY_OR_CREATE) { - // If there is already a focused window, then finish. - for (const key in window.appWindows) { - if (!key.match(FILES_ID_PATTERN)) { - continue; - } - - // The isFocused() method should always be available, but in case - // the Files app's failed on some error, wrap it with try catch. - try { - if (window.appWindows[key].contentWindow.isFocused()) { - if (opt_callback) { - opt_callback(key); - } - onTaskCompleted(); - return; - } - } catch (e) { - console.error(e.message); - } + // Try to focus the first non-minimized window. + for (const key in window.appWindows) { + if (!key.match(FILES_ID_PATTERN)) { + continue; } - // Try to focus the first non-minimized window. - for (const key in window.appWindows) { - if (!key.match(FILES_ID_PATTERN)) { - continue; - } - if (!window.appWindows[key].isMinimized()) { - window.appWindows[key].focus(); - if (opt_callback) { - opt_callback(key); - } - onTaskCompleted(); - return; - } - } - // Restore and focus any window. - for (const key in window.appWindows) { - if (!key.match(FILES_ID_PATTERN)) { - continue; - } - + if (!window.appWindows[key].isMinimized()) { window.appWindows[key].focus(); if (opt_callback) { opt_callback(key); } - onTaskCompleted(); - return; + return Promise.resolve(key); } } + // Restore and focus any window. + for (const key in window.appWindows) { + if (!key.match(FILES_ID_PATTERN)) { + continue; + } - // Create a new instance in case of ALWAYS_CREATE type, or as a fallback - // for other types. - - const id = opt_id || nextFileManagerWindowID; - nextFileManagerWindowID = Math.max(nextFileManagerWindowID, id + 1); - const appId = FILES_ID_PREFIX + id; - - // Make the files-ng frame color white. - if (util.isFilesNg()) { - FILE_MANAGER_WINDOW_CREATE_OPTIONS.frame.color = '#ffffff'; - } - - const appWindow = new AppWindowWrapper( - 'main.html', appId, FILE_MANAGER_WINDOW_CREATE_OPTIONS); - appWindow.launch(opt_appState || {}, false, () => { - appWindow.rawAppWindow.focus(); + window.appWindows[key].focus(); if (opt_callback) { - opt_callback(appId); + opt_callback(key); } - onTaskCompleted(); - }); + return Promise.resolve(key); + } + } + + // Create a new instance in case of ALWAYS_CREATE type, or as a fallback + // for other types. + + const id = opt_id || nextFileManagerWindowID; + nextFileManagerWindowID = Math.max(nextFileManagerWindowID, id + 1); + const appId = FILES_ID_PREFIX + id; + + // Make the files-ng frame color white. + if (util.isFilesNg()) { + FILE_MANAGER_WINDOW_CREATE_OPTIONS.frame.color = '#ffffff'; + } + + const appWindow = new AppWindowWrapper( + 'main.html', appId, FILE_MANAGER_WINDOW_CREATE_OPTIONS); + appWindow.launch(opt_appState || {}, false, () => { + if (!appWindow.rawAppWindow) { + opt_callback && opt_callback(null); + return Promise.resolve(null); + } + + appWindow.rawAppWindow.focus(); + if (opt_callback) { + opt_callback(appId); + } + return Promise.resolve(appId); }); };
diff --git a/ui/file_manager/file_manager/background/js/test_util.js b/ui/file_manager/file_manager/background/js/test_util.js index afe45cb..11b6711e 100644 --- a/ui/file_manager/file_manager/background/js/test_util.js +++ b/ui/file_manager/file_manager/background/js/test_util.js
@@ -524,5 +524,248 @@ }); }; +/** + * Maps the path to the replaced attribute to the PrepareFake instance that + * replaced it, to be able to restore the original value. + * + * @private {Object<string, test.util.PrepareFake} + */ +test.util.backgroundReplacedObjects_ = {}; + +/** + * @param {string} attrName + * @param {*} staticValue + * @return {function(...)} + */ +test.util.staticFakeFactory = (attrName, staticValue) => { + const fake = (...args) => { + console.warn(`staticFake for ${staticValue}`); + // Find the first callback. + for (const arg of args) { + if (arg instanceof Function) { + return arg(staticValue); + } + } + throw new Error(`Couldn't find callback for ${attrName}`); + }; + return fake; +}; + +/** + * Registry of available fakes, it maps the an string ID to a factory function + * which returns the actual fake used to replace an implementation. + * + * @private {Object<string, function(string, *)>} + */ +test.util.fakes_ = { + 'static_fake': test.util.staticFakeFactory, +}; + +/** + * Class holds the information for applying and restoring fakes. + */ +test.util.PrepareFake = class { + /** + * @param {string} attrName Name of the attribute to be replaced by the fake + * e.g.: "chrome.app.window.create". + * @param {string} fakeId The name of the fake to be used from + * test.util.fakes_. + * @param {*} context The context where the attribute will be traversed from, + * e.g.: Window object. + * @param {...} args Additinal args provided from the integration test to the + * fake, e.g.: static return value. + */ + constructor(attrName, fakeId, context, ...args) { + /** + * The instance of the fake to be used, ready to be used. + * @private {*} + */ + this.fake_ = null; + + /** + * The attribute name to be traversed in the |context_|. + * @private {string} + */ + this.attrName_ = attrName; + + /** + * The fake id the key to retrieve from test.util.fakes_. + * @private {string} + */ + this.fakeId_ = fakeId; + + /** + * The context where |attrName_| will be traversed from, e.g. Window. + * @private {*} + */ + this.context_ = context; + + /** + * After traversing |context_| the object that holds the attribute to be + * replaced by the fake. + * @private {*} + */ + this.parentObject_ = null; + + /** + * After traversing |context_| the attribute name in |parentObject_| that + * will be replaced by the fake. + * @private {string} + */ + this.leafAttrName_ = ''; + + /** + * Additional data provided from integration tests to the fake constructor. + * @private {!Array} + */ + this.args_ = args; + + /** + * Original object that was replaced by the fake. + * @private {*} + */ + this.original_ = null; + + /** + * If this fake object has been constructed and everything initialized. + * @private {boolean} + */ + this.prepared_ = false; + } + + /** + * Initializes the fake and traverse |context_| to be ready to replace the + * original implementation with the fake. + */ + prepare() { + this.buildFake_(); + this.traverseContext_(); + this.prepared_ = true; + } + + /** + * Replaces the original implementation with the fake. + * NOTE: It requires prepare() to have been called. + */ + replace() { + const suffix = `for ${this.attrName_} ${this.fakeId_}`; + if (!this.prepared_) { + throw new Error(`PrepareFake prepare() not called ${suffix}`); + } + if (!this.parentObject_) { + throw new Error(`Missing parentObject_ ${suffix}`); + } + if (!this.fake_) { + throw new Error(`Missing fake_ ${suffix}`); + } + if (!this.leafAttrName_) { + throw new Error(`Missing leafAttrName_ ${suffix}`); + } + + this.saveOriginal_(); + this.parentObject_[this.leafAttrName_] = this.fake_; + } + + /** + * Restores the original implementation that had been rpeviously replaced by + * the fake. + */ + restore() { + if (!this.original_) { + return; + } + this.parentObject_[this.leafAttrName_] = this.original_; + this.original_ = null; + } + + /** + * Saves the original implementation to be able restore it later. + */ + saveOriginal_() { + // Only save once, otherwise it can save an object that is already fake. + if (!test.util.backgroundReplacedObjects_[this.attrName_]) { + const original = this.parentObject_[this.leafAttrName_]; + this.original_ = original; + test.util.backgroundReplacedObjects_[this.attrName_] = this; + } + } + + /** + * Constructs the fake. + */ + buildFake_() { + const factory = test.util.fakes_[this.fakeId_]; + if (!factory) { + throw new Error(`Failed to find the fake factory for ${this.fakeId_}`); + } + + this.fake_ = factory(this.attrName_, ...this.args_); + } + + /** + * Finds the parent and the object to be replaced by fake. + */ + traverseContext_() { + let target = this.context_; + let parentObj; + let attr = ''; + + for (const a of this.attrName_.split('.')) { + attr = a; + parentObj = target; + target = target[a]; + + if (target === undefined) { + throw new Error(`Couldn't find "${0}" from "${this.attrName_}"`); + } + } + + this.parentObject_ = parentObj; + this.leafAttrName_ = attr; + } +}; + +/** + * Replaces implementations in the background page with fakes. + * + * @param {Object{<string, Array>}} fakeData An object mapping the path to the + * object to be replaced and the value is the Array with fake id and additinal + * arguments for the fake constructor, e.g.: + * fakeData = { + * 'chrome.app.window.create' : [ + * 'static_fake', + * ['some static value', 'other arg'], + * ] + * } + * + * This will replace the API 'chrome.app.window.create' with a static fake, + * providing the additional data to static fake: ['some static value', 'other + * value']. + */ +test.util.sync.backgroundFake = (fakeData) => { + for (const [path, mockValue] of Object.entries(fakeData)) { + const fakeId = mockValue[0]; + const fakeArgs = mockValue[1] || []; + + const fake = new test.util.PrepareFake(path, fakeId, window, ...fakeArgs); + fake.prepare(); + fake.replace(); + } +}; + +/** + * Removes all fakes that were applied to the background page. + */ +test.util.sync.removeAllBackgroundFakes = () => { + const savedFakes = Object.entries(test.util.backgroundReplacedObjects_); + let removedCount = 0; + for (const [path, fake] of savedFakes) { + fake.restore(); + removedCount++; + } + + return removedCount; +}; + // Register the test utils. test.util.registerRemoteTestUtils();
diff --git a/ui/file_manager/integration_tests/file_manager/file_display.js b/ui/file_manager/integration_tests/file_manager/file_display.js index 0ba1642e..10627f9 100644 --- a/ui/file_manager/integration_tests/file_manager/file_display.js +++ b/ui/file_manager/integration_tests/file_manager/file_display.js
@@ -879,3 +879,27 @@ // Make sure read-only indicator on toolbar is NOT visible. await remoteCall.waitForElement(appId, '#read-only-indicator[hidden]'); }; + +/** + * Tests that a failure opening one window won't block opening other windows. + */ +testcase.fileDisplayStartupError = async () => { + // Fake chrome.app.window.create to return undefined. + const fakeData = { + 'chrome.app.window.create': ['static_fake', [undefined]], + }; + await remoteCall.callRemoteTestUtil('backgroundFake', null, [fakeData]); + + // Check: opening a Files app window should fail and return null. + const failedAppId = await openNewWindow(RootPath.DOWNLOADS); + chrome.test.assertEq(null, failedAppId); + + // Remove fakes. + const removedCount = + await remoteCall.callRemoteTestUtil('removeAllBackgroundFakes', null, []); + chrome.test.assertEq(1, removedCount); + + // Check: opening a Files app window should succeed. + const appId = await openNewWindow(RootPath.DOWNLOADS); + chrome.test.assertTrue(null !== appId); +};
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/ExternalNavigationDelegateImpl.java b/weblayer/browser/java/org/chromium/weblayer_private/ExternalNavigationDelegateImpl.java index 649c578..d73bc81 100644 --- a/weblayer/browser/java/org/chromium/weblayer_private/ExternalNavigationDelegateImpl.java +++ b/weblayer/browser/java/org/chromium/weblayer_private/ExternalNavigationDelegateImpl.java
@@ -491,6 +491,11 @@ } @Override + public boolean isIntentToAutofillAssistant(Intent intent) { + return false; + } + + @Override public boolean isValidWebApk(String packageName) { // TODO(crbug.com/1063874): Determine whether to refine this. return false;