diff --git a/DEPS b/DEPS index 09e8857..987bfbe 100644 --- a/DEPS +++ b/DEPS
@@ -228,7 +228,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '461c539a047244db953f8dfcc8a44ea594d6ffe9', + 'skia_revision': 'f61ec43f84dd73508a566c36ef085156b40285f0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -240,7 +240,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '7e040640ef1ce4dcc2c7b17c851b2536129405e1', + 'angle_revision': 'e3f2acb978d84b9da06e66515d2183b82fa29865', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -248,7 +248,7 @@ # 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': '3ee72a25227c5a4d439c3be9106dd8fb2deab2f9', + 'pdfium_revision': 'aba53245bf116a1d908f851a93236b500988a1ee', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -279,7 +279,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling freetype # and whatever else without interference from each other. - 'freetype_revision': 'fed5521016227bf8cc4475f66450a9963568d162', + 'freetype_revision': 'f44c2d586064bcccdb504bf098b9dc78e660269e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling freetype # and whatever else without interference from each other. @@ -307,7 +307,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': 'c778d8d5caff6811af160be311e2fe2973f037ed', + 'devtools_frontend_revision': '7f672f7f8446ca82c02ad16bc5231c7ef512dd88', # 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. @@ -610,7 +610,7 @@ }, 'src/ios/third_party/material_components_ios/src': { - 'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '08d01596dfd0d79581b58b563e69a1d1f6ff109f', + 'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '93ccaa53c1fce39f8223f2be5ebccebc7214aa4c', 'condition': 'checkout_ios', }, @@ -680,7 +680,7 @@ 'packages': [ { 'package': 'chromium/rts/model/linux-amd64', - 'version': 'WTNOKfvS5fWlCyli-FXWMgNCPTfG7XL7l_dH_fNFe1wC', + 'version': 'ENHtOek4N-PX88QYQKIZz7C8FPilWkxnjf3NMuCmjIUC', }, ], 'dep_type': 'cipd', @@ -691,7 +691,7 @@ 'packages': [ { 'package': 'chromium/rts/model/mac-amd64', - 'version': 'OFiElNrrhC2M0EGp64pW7xJIqhp0JpnZ2YmcdQ7YXEcC', + 'version': '4i5j2QtkIfYe68e8JbvKekBBsDQWGkNp-fV55Sa49j0C', }, ], 'dep_type': 'cipd', @@ -702,7 +702,7 @@ 'packages': [ { 'package': 'chromium/rts/model/windows-amd64', - 'version': 'B8kh1QglbK234GMQwU67yeTmLmadMAX5JE5kguVtGLQC', + 'version': 'IFbWVghDuUnTG4lT-g6MHRJl-n1k3pA-cGwJh7ddHQ8C', }, ], 'dep_type': 'cipd', @@ -767,7 +767,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '8ehN1uRQQBM3VrBh28TpSvhV4AmGQRMCfN6Fm1L5y9QC', + 'version': 'Vi9jAya198G2rkbBEW-Kf9JBk0eTahqCqqe3mjHm8SgC', }, ], 'condition': 'checkout_android', @@ -998,12 +998,12 @@ # For Linux and Chromium OS. 'src/third_party/cros_system_api': { - 'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + '16d84f9f7555f080e28ae3102524b965c303e4c5', + 'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + '8d57b63f51230ec6b1ed24a467cb7644424856b6', 'condition': 'checkout_linux', }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '9a0189cd7a51102dd70027a4e0793f0c80202e3f', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '9107458ff61fae58c97b0523714dd73211a02758', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1621,7 +1621,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'a03fcf00c1a1c40c1dd9a0dd2c8071333b882a09', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '9d8c3d90100e347a02c913889f5165136a80ac20', + Var('webrtc_git') + '/src.git' + '@' + '124889f6f9a2fcdcf54eebfea3ba2ccb7a352ea5', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1682,7 +1682,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@98b9629a9d15c9146c10a2aa6d84faa65a033f1f', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@aa168d0bfa1740dd9faf01381f340852655e3f18', 'condition': 'checkout_src_internal', },
diff --git a/ash/metrics/user_metrics_recorder_unittest.cc b/ash/metrics/user_metrics_recorder_unittest.cc index 6891025d..cde09c2 100644 --- a/ash/metrics/user_metrics_recorder_unittest.cc +++ b/ash/metrics/user_metrics_recorder_unittest.cc
@@ -8,8 +8,8 @@ #include "ash/login_status.h" #include "ash/metrics/user_metrics_recorder_test_api.h" -#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "ash/session/session_controller_impl.h" #include "ash/session/test_session_controller_client.h" #include "ash/shell.h" @@ -21,17 +21,6 @@ namespace ash { namespace { -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; - const char kAsh_NumberOfVisibleWindowsInPrimaryDisplay[] = "Ash.NumberOfVisibleWindowsInPrimaryDisplay";
diff --git a/ash/public/cpp/BUILD.gn b/ash/public/cpp/BUILD.gn index 1733d5603..a2d6ea9 100644 --- a/ash/public/cpp/BUILD.gn +++ b/ash/public/cpp/BUILD.gn
@@ -418,6 +418,7 @@ deps = [ ":cpp", + ":test_support", "//base", "//base/test:test_support", "//chromeos/ui/vector_icons", @@ -444,6 +445,8 @@ "test/test_nearby_share_delegate.h", "test/test_new_window_delegate.cc", "test/test_new_window_delegate.h", + "test/test_shelf_item_delegate.cc", + "test/test_shelf_item_delegate.h", "test/test_system_tray_client.cc", "test/test_system_tray_client.h", ]
diff --git a/ash/public/cpp/shelf_model_unittest.cc b/ash/public/cpp/shelf_model_unittest.cc index f1619d1..ac46525 100644 --- a/ash/public/cpp/shelf_model_unittest.cc +++ b/ash/public/cpp/shelf_model_unittest.cc
@@ -8,8 +8,8 @@ #include <set> #include <string> -#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model_observer.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "base/strings/stringprintf.h" #include "testing/gtest/include/gtest/gtest.h" @@ -65,23 +65,6 @@ DISALLOW_COPY_AND_ASSIGN(TestShelfModelObserver); }; -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - - void ItemSelected(std::unique_ptr<ui::Event> event, - int64_t display_id, - ash::ShelfLaunchSource source, - ItemSelectedCallback callback, - const ItemFilterPredicate& filter_predicate) override {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; - } // namespace class ShelfModelTest : public testing::Test {
diff --git a/ash/public/cpp/test/test_shelf_item_delegate.cc b/ash/public/cpp/test/test_shelf_item_delegate.cc new file mode 100644 index 0000000..f5c5c7c --- /dev/null +++ b/ash/public/cpp/test/test_shelf_item_delegate.cc
@@ -0,0 +1,21 @@ +// 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 "ash/public/cpp/test/test_shelf_item_delegate.h" + +namespace ash { + +TestShelfItemDelegate::TestShelfItemDelegate(const ShelfID& shelf_id) + : ShelfItemDelegate(shelf_id) {} + +TestShelfItemDelegate::~TestShelfItemDelegate() = default; + +void TestShelfItemDelegate::ExecuteCommand(bool from_context_menu, + int64_t command_id, + int32_t event_flags, + int64_t display_id) {} + +void TestShelfItemDelegate::Close() {} + +} // namespace ash
diff --git a/ash/public/cpp/test/test_shelf_item_delegate.h b/ash/public/cpp/test/test_shelf_item_delegate.h new file mode 100644 index 0000000..a2437524 --- /dev/null +++ b/ash/public/cpp/test/test_shelf_item_delegate.h
@@ -0,0 +1,28 @@ +// Copyright 2021 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 ASH_PUBLIC_CPP_TEST_TEST_SHELF_ITEM_DELEGATE_H_ +#define ASH_PUBLIC_CPP_TEST_TEST_SHELF_ITEM_DELEGATE_H_ + +#include "ash/public/cpp/shelf_item_delegate.h" + +namespace ash { + +// A test version of ShelfItemDelegate that does nothing. +class TestShelfItemDelegate : public ShelfItemDelegate { + public: + explicit TestShelfItemDelegate(const ShelfID& shelf_id); + ~TestShelfItemDelegate() override; + + // ShelfItemDelegate: + void ExecuteCommand(bool from_context_menu, + int64_t command_id, + int32_t event_flags, + int64_t display_id) override; + void Close() override; +}; + +} // namespace ash + +#endif // ASH_PUBLIC_CPP_TEST_TEST_SHELF_ITEM_DELEGATE_H_
diff --git a/ash/shelf/shelf_controller_unittest.cc b/ash/shelf/shelf_controller_unittest.cc index 90c3c44..ffc522db 100644 --- a/ash/shelf/shelf_controller_unittest.cc +++ b/ash/shelf/shelf_controller_unittest.cc
@@ -10,6 +10,7 @@ #include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model.h" #include "ash/public/cpp/shelf_prefs.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "ash/public/cpp/window_properties.h" #include "ash/root_window_controller.h" #include "ash/session/session_controller_impl.h" @@ -32,25 +33,11 @@ #include "ui/message_center/public/cpp/notifier_id.h" namespace ash { -namespace { - -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; Shelf* GetShelfForDisplay(int64_t display_id) { return Shell::GetRootWindowControllerWithDisplayId(display_id)->shelf(); } -} // namespace - using ShelfControllerTest = AshTestBase; TEST_F(ShelfControllerTest, Shutdown) {
diff --git a/ash/shelf/shelf_test_util.cc b/ash/shelf/shelf_test_util.cc index 4987cccf..669b0a6 100644 --- a/ash/shelf/shelf_test_util.cc +++ b/ash/shelf/shelf_test_util.cc
@@ -5,26 +5,13 @@ #include "ash/shelf/shelf_test_util.h" #include "ash/public/cpp/overview_test_api.h" -#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/test/shell_test_api.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "ash/shelf/shelf_controller.h" #include "ash/shell.h" namespace ash { -namespace { -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; -} // namespace - // static ShelfItem ShelfTestUtil::AddAppShortcut(const std::string& id, ShelfItemType type) {
diff --git a/ash/shelf/shelf_tooltip_manager_unittest.cc b/ash/shelf/shelf_tooltip_manager_unittest.cc index f08e233..cce47b9 100644 --- a/ash/shelf/shelf_tooltip_manager_unittest.cc +++ b/ash/shelf/shelf_tooltip_manager_unittest.cc
@@ -6,8 +6,8 @@ #include <memory> -#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "ash/shelf/home_button.h" #include "ash/shelf/shelf.h" #include "ash/shelf/shelf_bubble.h" @@ -24,19 +24,6 @@ namespace ash { -namespace { -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; -} // namespace - class ShelfTooltipManagerTest : public AshTestBase { public: ShelfTooltipManagerTest() = default;
diff --git a/ash/shelf/shelf_unittest.cc b/ash/shelf/shelf_unittest.cc index 878a18e..76a7a55 100644 --- a/ash/shelf/shelf_unittest.cc +++ b/ash/shelf/shelf_unittest.cc
@@ -5,8 +5,8 @@ #include <memory> #include <utility> -#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "ash/root_window_controller.h" #include "ash/session/session_controller_impl.h" #include "ash/session/test_session_controller_client.h" @@ -27,17 +27,6 @@ namespace ash { namespace { -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; - class ShelfTest : public AshTestBase { public: ShelfTest() = default;
diff --git a/ash/shelf/shelf_view_test_api.cc b/ash/shelf/shelf_view_test_api.cc index d22c715..fd30a50 100644 --- a/ash/shelf/shelf_view_test_api.cc +++ b/ash/shelf/shelf_view_test_api.cc
@@ -6,6 +6,7 @@ #include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "ash/shelf/shelf_app_button.h" #include "ash/shelf/shelf_menu_model_adapter.h" #include "ash/shelf/shelf_navigation_widget.h" @@ -39,19 +40,6 @@ namespace ash { -namespace { -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; -} // namespace - ShelfViewTestAPI::ShelfViewTestAPI(ShelfView* shelf_view) : shelf_view_(shelf_view) {}
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc index 957466e..5678151 100644 --- a/ash/shelf/shelf_view_unittest.cc +++ b/ash/shelf/shelf_view_unittest.cc
@@ -19,10 +19,10 @@ #include "ash/focus_cycler.h" #include "ash/ime/ime_controller_impl.h" #include "ash/public/cpp/shelf_config.h" -#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model.h" #include "ash/public/cpp/shelf_prefs.h" #include "ash/public/cpp/shell_window_ids.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "ash/public/cpp/window_properties.h" #include "ash/root_window_controller.h" #include "ash/screen_util.h" @@ -107,17 +107,6 @@ return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); } -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; - int64_t GetPrimaryDisplayId() { return display::Screen::GetScreen()->GetPrimaryDisplay().id(); }
diff --git a/ash/strings/ash_strings_ja.xtb b/ash/strings/ash_strings_ja.xtb index a6a9b66..cb9ddb1 100644 --- a/ash/strings/ash_strings_ja.xtb +++ b/ash/strings/ash_strings_ja.xtb
@@ -93,6 +93,7 @@ <translation id="1615402009686901181">管理者のポリシーによって、機密コンテンツが表示されているときは、スクリーン キャプチャが無効になります</translation> <translation id="1632985212731562677">スイッチ アクセスは [設定] > [ユーザー補助機能] で無効にできます。</translation> <translation id="1654477262762802994">音声検索を開始</translation> +<translation id="1655967159878494613"><ph name="QUERY_TEXT" />; <ph name="RESULT_TEXT" />; アシスタントで結果を確認するには [検索]+Space キーを押してください。</translation> <translation id="1667964833127753507">壁紙から抽出した色の代わりに、ライトまたはダークな色調の中間色を使用します。</translation> <translation id="1677472565718498478">残り <ph name="TIME" /></translation> <translation id="1677507110654891115"><ph name="FEATURE_NAME" /> は接続されていません。</translation> @@ -140,6 +141,7 @@ <translation id="2016340657076538683">メッセージを入力</translation> <translation id="2018630726571919839">面白いこと言って</translation> <translation id="2021864487439853900">クリックしてロックを解除</translation> +<translation id="2023558322300866873">パケット キャプチャはいつでも停止できます</translation> <translation id="2047639699071423250">要点を追加</translation> <translation id="2049240716062114887">デスクの名前を <ph name="DESK_NAME" /> に変更しました</translation> <translation id="2050339315714019657">縦</translation> @@ -542,6 +544,7 @@ <translation id="5083553833479578423">さらに多くのアシスタント機能をぜひご活用ください。</translation> <translation id="5136175204352732067">別のキーボードが接続されています</translation> <translation id="5155897006997040331">読み上げ速度</translation> +<translation id="5166918508782100047">クイック アンサーの設定</translation> <translation id="5168181903108465623">キャスト デバイスを利用できます</translation> <translation id="5170568018924773124">フォルダを開く</translation> <translation id="5176318573511391780">画面の一部を録画</translation> @@ -796,6 +799,7 @@ <translation id="7302889331339392448">自動字幕起こしはオフになっています。</translation> <translation id="7303365578352795231">別のデバイスで応答しています。</translation> <translation id="7305884605064981971">EDGE</translation> +<translation id="7343581795491695942"><ph name="QUERY_TEXT" />; <ph name="RESULT_TEXT" />; Google 検索で結果を確認するには [検索]+Space キーを押してください。</translation> <translation id="7346909386216857016">OK</translation> <translation id="7348093485538360975">画面キーボード</translation> <translation id="735745346212279324">VPN が切断されました</translation>
diff --git a/ash/strings/ash_strings_or.xtb b/ash/strings/ash_strings_or.xtb index bdcbf8d..3f740c17 100644 --- a/ash/strings/ash_strings_or.xtb +++ b/ash/strings/ash_strings_or.xtb
@@ -93,6 +93,7 @@ <translation id="1615402009686901181">ଯେତେବେଳେ ଗୋପନୀୟ ବିଷୟବସ୍ତୁ ଦୃଶ୍ୟମାନ ହୁଏ, ଆଡମିନିଷ୍ଟ୍ରେଟର୍ ନୀତି ସ୍କ୍ରିନ୍ କ୍ୟାପଚରକୁ ଅକ୍ଷମ କରିଦିଏ</translation> <translation id="1632985212731562677">ସେଟିଂସ୍ > ଆକ୍ସେସିବିଲିଟୀରେ 'ସ୍ୱିଚ୍ ଆକ୍ସେସ୍' ସୁବିଧା ଅକ୍ଷମ କରାଯାଇପାରିବ।</translation> <translation id="1654477262762802994">ଏକ ଭିଡିଓ କ୍ବେରୀ ଆରମ୍ଭ କରନ୍ତୁ</translation> +<translation id="1655967159878494613"><ph name="QUERY_TEXT" />; <ph name="RESULT_TEXT" />; Assistantରେ ଫଳାଫଳ ଦେଖିବାକୁ Search ସହିତ Space ଦବାନ୍ତୁ।</translation> <translation id="1667964833127753507">ନ୍ୟୁଟ୍ରାଲ୍ କଲର ମୋଡ୍ ୱାଲପେପରରୁ ବାହାର କରାଯାଇଥିବା ରଙ୍ଗଗୁଡ଼ିକୁ ବ୍ୟବହାର କରେ ନାହିଁ, ତାହା ପରିବର୍ତ୍ତେ ନ୍ୟୁଟ୍ରାଲ୍ ଟୋନ୍ ଥିବା ଫିକା କିମ୍ବା ଗାଢ଼ା ରଙ୍ଗର ଏକ ସେଟ୍ ବ୍ୟବହାର କରେ।</translation> <translation id="1677472565718498478"><ph name="TIME" /> ବାକି ଅଛି</translation> <translation id="1677507110654891115"><ph name="FEATURE_NAME" /> ସଂଯୁକ୍ତ ହୋଇନାହିଁ।</translation> @@ -140,6 +141,7 @@ <translation id="2016340657076538683">ଏକ ମେସେଜ୍ ଟାଇପ୍ କରନ୍ତୁ</translation> <translation id="2018630726571919839">ମୋତେ ଏକ ଜୋକ୍ କୁହନ୍ତୁ</translation> <translation id="2021864487439853900">ଅନଲକ୍ କରିବାକୁ କ୍ଲିକ୍ କରନ୍ତୁ</translation> +<translation id="2023558322300866873">ଆପଣ ଯେ କୌଣସି ସମୟରେ ପ୍ୟାକେଟ୍ କ୍ୟାପଚର୍ କରିବା ବନ୍ଦ କରିପାରିବେ</translation> <translation id="2047639699071423250">ମୁଖ୍ୟ ଆଇଡିଆ ଯୋଗ କରନ୍ତୁ</translation> <translation id="2049240716062114887">ଡେସ୍କ ନାମକୁ <ph name="DESK_NAME" />ରେ ବଦଳା ଯାଇଥିଲା</translation> <translation id="2050339315714019657">ପୋଟ୍ରେଟ୍</translation> @@ -542,6 +544,7 @@ <translation id="5083553833479578423">ଆହୁରି ଆସିଷ୍ଟାଣ୍ଟ ବୈଶିଷ୍ଟ୍ୟଗୁଡ଼ିକ ଅନ୍ଲକ୍ କରନ୍ତୁ</translation> <translation id="5136175204352732067">ଅଲଗା କୀବୋର୍ଡ ସଂଯୁକ୍ତ ହୋଇଛି</translation> <translation id="5155897006997040331">ପଢ଼ିବା ବେଗ</translation> +<translation id="5166918508782100047">କ୍ୱିକ୍ ଉତ୍ତରଗୁଡ଼ିକର ସେଟିଂସ୍</translation> <translation id="5168181903108465623">କାଷ୍ଟ ଡିଭାଇସ୍ ଉପଲବ୍ଧ</translation> <translation id="5170568018924773124">ଫୋଲ୍ଡରରେ ଦେଖାନ୍ତୁ</translation> <translation id="5176318573511391780">ଆଂଶିକ ସ୍କ୍ରିନ୍ ରେକର୍ଡ କରନ୍ତୁ</translation> @@ -796,6 +799,7 @@ <translation id="7302889331339392448">ଲାଇଭ୍ କ୍ୟାପ୍ସନ୍ ବନ୍ଦ ଅଛି।</translation> <translation id="7303365578352795231">ଅନ୍ୟ ଡିଭାଇସ୍ରେ ଉତ୍ତର ଦିଆଯାଉଛି।</translation> <translation id="7305884605064981971">EDGE</translation> +<translation id="7343581795491695942"><ph name="QUERY_TEXT" />; <ph name="RESULT_TEXT" />; Google Searchରେ ଫଳାଫଳ ଦେଖିବାକୁ Search ସହିତ Space ଦବାନ୍ତୁ।</translation> <translation id="7346909386216857016">ଠିକ ଅଛି, ଏହା ବୁଝିଗଲି</translation> <translation id="7348093485538360975">ଅନ୍-ସ୍କ୍ରିନ୍ କୀ'ବୋର୍ଡ</translation> <translation id="735745346212279324">VPN ବିଚ୍ଛିନ୍ନ ହୋଇଛି</translation>
diff --git a/ash/wm/desks/desks_unittests.cc b/ash/wm/desks/desks_unittests.cc index 7f8a92e4..a827cd6 100644 --- a/ash/wm/desks/desks_unittests.cc +++ b/ash/wm/desks/desks_unittests.cc
@@ -21,9 +21,9 @@ #include "ash/public/cpp/event_rewriter_controller.h" #include "ash/public/cpp/multi_user_window_manager.h" #include "ash/public/cpp/multi_user_window_manager_delegate.h" -#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model.h" #include "ash/public/cpp/shelf_types.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "ash/screen_util.h" #include "ash/session/session_controller_impl.h" #include "ash/shelf/hotseat_widget.h" @@ -115,17 +115,6 @@ namespace { -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; - void NewDesk() { // Create a desk through keyboard. Do not use |kButton| to avoid empty name. DesksController::Get()->NewDesk(DesksCreationRemovalSource::kKeyboard);
diff --git a/base/allocator/partition_allocator/address_pool_manager.h b/base/allocator/partition_allocator/address_pool_manager.h index b1103626..298f365a 100644 --- a/base/allocator/partition_allocator/address_pool_manager.h +++ b/base/allocator/partition_allocator/address_pool_manager.h
@@ -124,7 +124,6 @@ return &pools_[handle - 1]; } - static constexpr size_t kNumPools = 2; Pool pools_[kNumPools]; #else // defined(PA_HAS_64_BITS_POINTERS)
diff --git a/base/allocator/partition_allocator/partition_address_space.h b/base/allocator/partition_allocator/partition_address_space.h index 0bc4de0..df49f188 100644 --- a/base/allocator/partition_allocator/partition_address_space.h +++ b/base/allocator/partition_allocator/partition_address_space.h
@@ -84,6 +84,23 @@ return kBRPPoolBaseMask; } + static ALWAYS_INLINE std::pair<pool_handle, uintptr_t> GetPoolAndOffset( + const void* address) { + pool_handle pool = 0; + uintptr_t base = 0; + if (IsInNonBRPPool(address)) { + pool = GetNonBRPPool(); + base = non_brp_pool_base_address_; + } else if (IsInBRPPool(address)) { + pool = GetBRPPool(); + base = brp_pool_base_address_; + } else { + NOTREACHED(); + } + uintptr_t address_as_uintptr = reinterpret_cast<uintptr_t>(address); + return std::make_pair(pool, address_as_uintptr - base); + } + static void Init(); static void UninitForTesting(); @@ -118,12 +135,6 @@ return brp_pool_base_address_ + kBRPPoolSize; } - static ALWAYS_INLINE uintptr_t GigaCageOffset(uintptr_t address) { - PA_DCHECK(address >= reserved_base_address_); - PA_DCHECK(address < reserved_base_address_ + kTotalSize); - return address - reserved_base_address_; - } - // PartitionAddressSpace is static_only class. PartitionAddressSpace() = delete; PartitionAddressSpace(const PartitionAddressSpace&) = delete; @@ -158,13 +169,10 @@ // Pool sizes have to be the power of two. Each pool will be aligned at its // own size boundary. // - // There are a couple reasons why pools ought to be allocated next to each - // other: - // 1. Due to the above restriction, BRP pool has to be preceded by another - // pool. Alternatively it could be any region that guarantess to not have - // allocations extending to its very end, but it's just easier to have - // non-BRP pool there. - // 2. The ReservationOffsetTable covers the entire GigaCage. + // Due to the above restriction, the BRP pool has to be preceded by another + // pool. Alternatively it could be any region that guarantess to not have + // allocations extending to its very end, but it's just easier to have non-BRP + // pool there. // // Care has to be taken when choosing sizes, if more than 2 pools are needed. // For example, with sizes [8GiB,4GiB,8GiB], it'd be impossible to align each @@ -194,8 +202,6 @@ static pool_handle non_brp_pool_; static pool_handle brp_pool_; - - friend class ReservationOffsetTable; }; ALWAYS_INLINE pool_handle GetNonBRPPool() { @@ -206,6 +212,15 @@ return PartitionAddressSpace::GetBRPPool(); } +ALWAYS_INLINE std::pair<pool_handle, uintptr_t> GetPoolAndOffset( + const void* address) { + return PartitionAddressSpace::GetPoolAndOffset(address); +} + +ALWAYS_INLINE pool_handle GetPool(const void* address) { + return std::get<0>(GetPoolAndOffset(address)); +} + #endif // defined(PA_HAS_64_BITS_POINTERS) } // namespace internal
diff --git a/base/allocator/partition_allocator/partition_alloc_constants.h b/base/allocator/partition_allocator/partition_alloc_constants.h index 9ec436c..ca9b912 100644 --- a/base/allocator/partition_allocator/partition_alloc_constants.h +++ b/base/allocator/partition_allocator/partition_alloc_constants.h
@@ -13,6 +13,7 @@ #include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/page_allocator_constants.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" +#include "base/allocator/partition_allocator/partition_alloc_forward.h" #include "build/build_config.h" #if defined(OS_APPLE) && defined(ARCH_CPU_64_BITS) @@ -201,6 +202,8 @@ #endif constexpr size_t kMaxSuperPages = kPoolMaxSize / kSuperPageSize; +constexpr size_t kNumPools = 2; + PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t NumPartitionPagesPerSuperPage() { return kSuperPageSize >> PartitionPageShift(); @@ -241,27 +244,6 @@ return DirectMapAllocationGranularity() - 1; } -// Alignment has two constraints: -// - Alignment requirement for scalar types: alignof(std::max_align_t) -// - Alignment requirement for operator new(). -// -// The two are separate on Windows 64 bits, where the first one is 8 bytes, and -// the second one 16. We could technically return something different for -// malloc() and operator new(), but this would complicate things, and most of -// our allocations are presumably coming from operator new() anyway. -// -// __STDCPP_DEFAULT_NEW_ALIGNMENT__ is C++17. As such, it is not defined on all -// platforms, as Chrome's requirement is C++14 as of 2020. -#if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__) -constexpr size_t kAlignment = - std::max(alignof(max_align_t), __STDCPP_DEFAULT_NEW_ALIGNMENT__); -#else -constexpr size_t kAlignment = alignof(max_align_t); -#endif -static_assert(kAlignment <= 16, - "PartitionAlloc doesn't support a fundamental alignment larger " - "than 16 bytes."); - // The "order" of an allocation is closely related to the power-of-1 size of the // allocation. More precisely, the order is the bit index of the // most-significant-bit in the allocation size, where the bit numbers starts at
diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h index 388c4ef..938ea38 100644 --- a/base/allocator/partition_allocator/partition_alloc_forward.h +++ b/base/allocator/partition_allocator/partition_alloc_forward.h
@@ -5,12 +5,37 @@ #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_FORWARD_H_ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_FORWARD_H_ +#include <algorithm> +#include <cstddef> + #include "base/allocator/buildflags.h" #include "base/base_export.h" #include "base/compiler_specific.h" #include "base/dcheck_is_on.h" namespace base { + +// Alignment has two constraints: +// - Alignment requirement for scalar types: alignof(std::max_align_t) +// - Alignment requirement for operator new(). +// +// The two are separate on Windows 64 bits, where the first one is 8 bytes, and +// the second one 16. We could technically return something different for +// malloc() and operator new(), but this would complicate things, and most of +// our allocations are presumably coming from operator new() anyway. +// +// __STDCPP_DEFAULT_NEW_ALIGNMENT__ is C++17. As such, it is not defined on all +// platforms, as Chrome's requirement is C++14 as of 2020. +#if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__) +constexpr size_t kAlignment = + std::max(alignof(max_align_t), __STDCPP_DEFAULT_NEW_ALIGNMENT__); +#else +constexpr size_t kAlignment = alignof(max_align_t); +#endif +static_assert(kAlignment <= 16, + "PartitionAlloc doesn't support a fundamental alignment larger " + "than 16 bytes."); + namespace internal { template <bool thread_safe> @@ -36,4 +61,36 @@ } // namespace base +// From https://clang.llvm.org/docs/AttributeReference.html#malloc: +// +// The malloc attribute indicates that the function acts like a system memory +// allocation function, returning a pointer to allocated storage disjoint from +// the storage for any other object accessible to the caller. +// +// Note that it doesn't apply to realloc()-type functions, as they can return +// the same pointer as the one passed as a parameter, as noted in e.g. stdlib.h +// on Linux systems. +#if defined(__has_attribute) + +#if __has_attribute(malloc) +#define MALLOC_FN __attribute__((malloc)) +#endif + +// Allows the compiler to assume that the return value is aligned on a +// kAlignment boundary. This is useful for e.g. using aligned vector +// instructions in the constructor for zeroing. +#if __has_attribute(assume_aligned) +#define MALLOC_ALIGNED __attribute__((assume_aligned(base::kAlignment))) +#endif + +#endif // defined(__has_attribute) + +#if !defined(MALLOC_FN) +#define MALLOC_FN +#endif + +#if !defined(MALLOC_ALIGNED) +#define MALLOC_ALIGNED +#endif + #endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_FORWARD_H_
diff --git a/base/allocator/partition_allocator/partition_alloc_unittest.cc b/base/allocator/partition_allocator/partition_alloc_unittest.cc index 5b0018d4..e28bcd0 100644 --- a/base/allocator/partition_allocator/partition_alloc_unittest.cc +++ b/base/allocator/partition_allocator/partition_alloc_unittest.cc
@@ -356,6 +356,12 @@ void RunRefCountReallocSubtest(size_t orig_size, size_t new_size); + NOINLINE MALLOC_FN void* Alloc(size_t size) { + return allocator.root()->Alloc(size, ""); + } + + NOINLINE void Free(void* ptr) { allocator.root()->Free(ptr); } + base::test::ScopedFeatureList scoped_feature_list; PartitionAllocator<base::internal::ThreadSafe> allocator; PartitionAllocator<base::internal::ThreadSafe> aligned_allocator; @@ -3526,6 +3532,22 @@ } } +// Used to check alignment. If the compiler understands the annotations, the +// zeroing in the constructor uses aligned SIMD instructions. +TEST_F(PartitionAllocTest, MallocFunctionAnnotations) { + struct TestStruct { + uint64_t a = 0; + uint64_t b = 0; + }; + + void* buffer = Alloc(sizeof(TestStruct)); + // Should use "mov*a*ps" on x86_64. + auto* x = new (buffer) TestStruct(); + + EXPECT_EQ(x->a, 0u); + Free(buffer); +} + } // namespace internal } // namespace base
diff --git a/base/allocator/partition_allocator/partition_bucket.cc b/base/allocator/partition_allocator/partition_bucket.cc index d269ad3..05dc5ca 100644 --- a/base/allocator/partition_allocator/partition_bucket.cc +++ b/base/allocator/partition_allocator/partition_bucket.cc
@@ -273,7 +273,7 @@ auto* offset_ptr = ReservationOffsetPointer(ptr_start); int offset = 0; while (ptr_start < ptr_end) { - PA_DCHECK(offset_ptr < GetReservationOffsetTableEnd()); + PA_DCHECK(offset_ptr < GetReservationOffsetTableEnd(ptr_start)); PA_DCHECK(offset < kOffsetTagNormalBuckets); *offset_ptr++ = offset++; ptr_start += kSuperPageSize; @@ -489,7 +489,7 @@ root->next_partition_page_end)) { // In this case, we can no longer hand out pages from the current super page // allocation. Get a new super page. - if (!AllocNewSuperPage(root)) { + if (!AllocNewSuperPage(root, flags)) { return nullptr; } // AllocNewSuperPage() updates root->next_partition_page, re-query. @@ -534,7 +534,8 @@ template <bool thread_safe> ALWAYS_INLINE void* PartitionBucket<thread_safe>::AllocNewSuperPage( - PartitionRoot<thread_safe>* root) { + PartitionRoot<thread_safe>* root, + int flags) { // Need a new super page. We want to allocate super pages in a contiguous // address region as much as possible. This is important for not causing // page table bloat and not fragmenting address spaces in 32 bit @@ -545,8 +546,14 @@ pool_handle pool = root->ChooseGigaCagePool(/* is_direct_map= */ false); char* super_page = ReserveMemoryFromGigaCage(pool, requested_address, kSuperPageSize); - if (UNLIKELY(!super_page)) - return nullptr; + if (UNLIKELY(!super_page)) { + if (flags & PartitionAllocReturnNull) + return nullptr; + + // Didn't manage to get a new uncommitted super page -> address space issue. + ScopedUnlockGuard<thread_safe> unlock{root->lock_}; + PartitionOutOfMemoryMappingFailure(root, kSuperPageSize); + } *ReservationOffsetPointer(reinterpret_cast<uintptr_t>(super_page)) = kOffsetTagNormalBuckets;
diff --git a/base/allocator/partition_allocator/partition_bucket.h b/base/allocator/partition_allocator/partition_bucket.h index f4c5681..419d9fd 100644 --- a/base/allocator/partition_allocator/partition_bucket.h +++ b/base/allocator/partition_allocator/partition_bucket.h
@@ -154,7 +154,8 @@ // Allocates a new super page from the current extent. All slot-spans will be // in the decommitted state. Returns nullptr on error. - ALWAYS_INLINE void* AllocNewSuperPage(PartitionRoot<thread_safe>* root) + ALWAYS_INLINE void* AllocNewSuperPage(PartitionRoot<thread_safe>* root, + int flags) EXCLUSIVE_LOCKS_REQUIRED(root->lock_); // Each bucket allocates a slot span when it runs out of slots.
diff --git a/base/allocator/partition_allocator/partition_page.cc b/base/allocator/partition_allocator/partition_page.cc index 898df44..71594111 100644 --- a/base/allocator/partition_allocator/partition_page.cc +++ b/base/allocator/partition_allocator/partition_page.cc
@@ -261,7 +261,7 @@ // condition. uint16_t i = 0; while (ptr_as_uintptr < ptr_end) { - PA_DCHECK(offset_ptr < GetReservationOffsetTableEnd()); + PA_DCHECK(offset_ptr < GetReservationOffsetTableEnd(ptr_as_uintptr)); PA_DCHECK(*offset_ptr == i++); *offset_ptr++ = kOffsetTagNotAllocated; ptr_as_uintptr += kSuperPageSize;
diff --git a/base/allocator/partition_allocator/partition_root.h b/base/allocator/partition_allocator/partition_root.h index 2f756a3..7974b1f 100644 --- a/base/allocator/partition_allocator/partition_root.h +++ b/base/allocator/partition_allocator/partition_root.h
@@ -305,20 +305,23 @@ size_t alignment, size_t requested_size); - ALWAYS_INLINE void* Alloc(size_t requested_size, const char* type_name); - ALWAYS_INLINE void* AllocFlags(int flags, - size_t requested_size, - const char* type_name); + ALWAYS_INLINE MALLOC_FN void* Alloc(size_t requested_size, + const char* type_name) MALLOC_ALIGNED; + ALWAYS_INLINE MALLOC_FN void* AllocFlags(int flags, + size_t requested_size, + const char* type_name) + MALLOC_ALIGNED; // Same as |AllocFlags()|, but allows specifying |slot_span_alignment|. It has // to be a multiple of partition page size, greater than 0 and no greater than // kMaxSupportedAlignment. If it equals exactly 1 partition page, no special // action is taken as PartitoinAlloc naturally guarantees this alignment, // otherwise a sub-optimial allocation strategy is used to guarantee the // higher-order alignment. - ALWAYS_INLINE void* AllocFlagsInternal(int flags, - size_t requested_size, - size_t slot_span_alignment, - const char* type_name); + ALWAYS_INLINE MALLOC_FN void* AllocFlagsInternal(int flags, + size_t requested_size, + size_t slot_span_alignment, + const char* type_name) + MALLOC_ALIGNED; // Same as |AllocFlags()|, but bypasses the allocator hooks. // // This is separate from AllocFlags() because other callers of AllocFlags() @@ -328,20 +331,23 @@ // taking the extra branch in the non-malloc() case doesn't hurt. In addition, // for the malloc() case, the compiler correctly removes the branch, since // this is marked |ALWAYS_INLINE|. - ALWAYS_INLINE void* AllocFlagsNoHooks(int flags, - size_t requested_size, - size_t slot_span_alignment); + ALWAYS_INLINE MALLOC_FN void* AllocFlagsNoHooks(int flags, + size_t requested_size, + size_t slot_span_alignment) + MALLOC_ALIGNED; - ALWAYS_INLINE void* Realloc(void* ptr, size_t newize, const char* type_name); + ALWAYS_INLINE void* Realloc(void* ptr, + size_t newize, + const char* type_name) MALLOC_ALIGNED; // Overload that may return nullptr if reallocation isn't possible. In this // case, |ptr| remains valid. ALWAYS_INLINE void* TryRealloc(void* ptr, size_t new_size, - const char* type_name); + const char* type_name) MALLOC_ALIGNED; NOINLINE void* ReallocFlags(int flags, void* ptr, size_t new_size, - const char* type_name); + const char* type_name) MALLOC_ALIGNED; ALWAYS_INLINE static void Free(void* ptr); // Same as |Free()|, bypasses the allocator hooks. ALWAYS_INLINE static void FreeNoHooks(void* ptr);
diff --git a/base/allocator/partition_allocator/reservation_offset_table.cc b/base/allocator/partition_allocator/reservation_offset_table.cc index a9eede6..9387012 100644 --- a/base/allocator/partition_allocator/reservation_offset_table.cc +++ b/base/allocator/partition_allocator/reservation_offset_table.cc
@@ -7,8 +7,13 @@ namespace base { namespace internal { +#if defined(PA_HAS_64_BITS_POINTERS) +ReservationOffsetTable::_ReservationOffsetTable + ReservationOffsetTable::reservation_offset_tables_[]; +#else ReservationOffsetTable::_ReservationOffsetTable ReservationOffsetTable::reservation_offset_table_; +#endif } // namespace internal } // namespace base
diff --git a/base/allocator/partition_allocator/reservation_offset_table.h b/base/allocator/partition_allocator/reservation_offset_table.h index ff26db5e..3a2b530 100644 --- a/base/allocator/partition_allocator/reservation_offset_table.h +++ b/base/allocator/partition_allocator/reservation_offset_table.h
@@ -26,7 +26,7 @@ // The main purpose of the reservation offset table is to easily locate the // direct map reservation start address for any given address. There is one -// entry if the table for each super page. +// entry in the table for each super page. // // When PartitionAlloc reserves an address region it is always aligned to // super page boundary. However, in 32-bit mode, the size may not be aligned @@ -62,10 +62,8 @@ class BASE_EXPORT ReservationOffsetTable { public: #if defined(PA_HAS_64_BITS_POINTERS) - // The size of the reservation offset table should cover the entire GigaCage - // (kBRPPoolSize + kNonBRPPoolSize), one element per super page. - static constexpr size_t kReservationOffsetTableCoverage = - PartitionAddressSpace::kTotalSize; + // There is one reservation offset table per Pool in 64-bit mode. + static constexpr size_t kReservationOffsetTableCoverage = kPoolMaxSize; static constexpr size_t kReservationOffsetTableLength = kReservationOffsetTableCoverage >> kSuperPageShift; #else @@ -79,38 +77,71 @@ "Offsets should be smaller than kOffsetTagNormalBuckets."); static struct _ReservationOffsetTable { - // Thenumber of table elements is less than MAX_UINT16, so the element type + // The number of table elements is less than MAX_UINT16, so the element type // can be uint16_t. + static_assert( + kReservationOffsetTableLength <= std::numeric_limits<uint16_t>::max(), + "Length of the reservation offset table must be less than MAX_UINT16"); uint16_t offsets[kReservationOffsetTableLength] = {}; constexpr _ReservationOffsetTable() { for (uint16_t& offset : offsets) offset = kOffsetTagNotAllocated; } +#if defined(PA_HAS_64_BITS_POINTERS) + // One table per Pool. + } reservation_offset_tables_[kNumPools]; +#else + // A single table for the entire 32-bit address space. } reservation_offset_table_; +#endif }; -ALWAYS_INLINE uint16_t* GetReservationOffsetTable() { +#if defined(PA_HAS_64_BITS_POINTERS) +ALWAYS_INLINE uint16_t* GetReservationOffsetTable(pool_handle handle) { + PA_DCHECK(0 < handle && handle <= kNumPools); + return ReservationOffsetTable::reservation_offset_tables_[handle - 1].offsets; +} + +ALWAYS_INLINE const uint16_t* GetReservationOffsetTableEnd(pool_handle handle) { + return GetReservationOffsetTable(handle) + + ReservationOffsetTable::kReservationOffsetTableLength; +} +ALWAYS_INLINE uint16_t* GetReservationOffsetTable(uintptr_t address) { + pool_handle handle = GetPool(reinterpret_cast<void*>(address)); + return GetReservationOffsetTable(handle); +} + +ALWAYS_INLINE const uint16_t* GetReservationOffsetTableEnd(uintptr_t address) { + pool_handle handle = GetPool(reinterpret_cast<void*>(address)); + return GetReservationOffsetTableEnd(handle); +} +#else +ALWAYS_INLINE uint16_t* GetReservationOffsetTable(uintptr_t address) { return ReservationOffsetTable::reservation_offset_table_.offsets; } -ALWAYS_INLINE const uint16_t* GetReservationOffsetTableEnd() { +ALWAYS_INLINE const uint16_t* GetReservationOffsetTableEnd(uintptr_t address) { return ReservationOffsetTable::reservation_offset_table_.offsets + ReservationOffsetTable::kReservationOffsetTableLength; } +#endif ALWAYS_INLINE uint16_t* ReservationOffsetPointer(uintptr_t address) { #if defined(PA_HAS_64_BITS_POINTERS) - // In 64-bit mode, use the offset from the beginning of GigaCage, since - // that's what the reservation offset table covers. - size_t table_index = - PartitionAddressSpace::GigaCageOffset(address) >> kSuperPageShift; + // In 64-bit mode, find the owning Pool and compute the offset from its base. + pool_handle handle; + uintptr_t offset; + std::tie(handle, offset) = GetPoolAndOffset(reinterpret_cast<void*>(address)); + size_t table_index = offset >> kSuperPageShift; + uint16_t* table = GetReservationOffsetTable(handle); #else size_t table_index = address >> kSuperPageShift; + uint16_t* table = GetReservationOffsetTable(address); #endif PA_DCHECK(table_index < ReservationOffsetTable::kReservationOffsetTableLength); - return GetReservationOffsetTable() + table_index; + return table + table_index; } // If the given address doesn't point to direct-map allocated memory,
diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc index b424b10b..a390252 100644 --- a/base/metrics/persistent_histogram_allocator.cc +++ b/base/metrics/persistent_histogram_allocator.cc
@@ -680,14 +680,18 @@ #if !defined(OS_NACL) // static -bool GlobalHistogramAllocator::CreateWithFile( - const FilePath& file_path, - size_t size, - uint64_t id, - StringPiece name) { - File file( - file_path, File::FLAG_OPEN_ALWAYS | File::FLAG_SHARE_DELETE | - File::FLAG_READ | File::FLAG_WRITE); +bool GlobalHistogramAllocator::CreateWithFile(const FilePath& file_path, + size_t size, + uint64_t id, + StringPiece name, + bool exclusive_write) { + uint32_t flags = File::FLAG_OPEN_ALWAYS | File::FLAG_SHARE_DELETE | + File::FLAG_READ | File::FLAG_WRITE; + if (exclusive_write) + flags |= File::FLAG_EXCLUSIVE_WRITE; + File file(file_path, flags); + if (!file.IsValid()) + return false; std::unique_ptr<MemoryMappedFile> mmfile(new MemoryMappedFile()); bool success = false;
diff --git a/base/metrics/persistent_histogram_allocator.h b/base/metrics/persistent_histogram_allocator.h index bbf6323..4d0fad1 100644 --- a/base/metrics/persistent_histogram_allocator.h +++ b/base/metrics/persistent_histogram_allocator.h
@@ -356,11 +356,13 @@ // not exist, it will be created with the specified |size|. If the file does // exist, the allocator will use and add to its contents, ignoring the passed // size in favor of the existing size. Returns whether the global allocator - // was set. + // was set. If |exclusive_write| is true, the file will be opened in a mode + // that disallows multiple concurrent writers. static bool CreateWithFile(const FilePath& file_path, size_t size, uint64_t id, - StringPiece name); + StringPiece name, + bool exclusive_write = false); // Creates a new file at |active_path|. If it already exists, it will first be // moved to |base_path|. In all cases, any old file at |base_path| will be
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 087c82a5..0b8a9d9 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -1714,7 +1714,8 @@ # use_libfuzzer: https://crbug.com/1063180 if (!is_nacl && !use_libfuzzer) { # TODO(1066980): Use -Wunreachable-code-aggressive on all platforms. - if ((is_mac && target_cpu != "arm64") || is_win) { + if ((target_os == "android" && target_cpu == "x86") || + (is_mac && target_cpu != "arm64") || is_win) { cflags += [ "-Wunreachable-code-aggressive" ] } else { cflags += [ "-Wunreachable-code" ]
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index 0359041..7582cd6 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -6.20210817.3.1 +6.20210818.1.1
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index 0359041..7582cd6 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -6.20210817.3.1 +6.20210818.1.1
diff --git a/build/install-build-deps-android.sh b/build/install-build-deps-android.sh index 882e7be..686b5f6 100755 --- a/build/install-build-deps-android.sh +++ b/build/install-build-deps-android.sh
@@ -34,7 +34,4 @@ # See https://developer.android.com/sdk/installing/index.html?pkg=tools sudo apt-get -y install libncurses5:i386 libstdc++6:i386 zlib1g:i386 -# Required for apk-patch-size-estimator -sudo apt-get -y install bsdiff - echo "install-build-deps-android.sh complete."
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java index 446d18e..4ab598b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
@@ -34,6 +34,8 @@ import org.chromium.chrome.browser.metrics.UmaUtils; import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; +import org.chromium.chrome.browser.signin.SigninFirstRunFragment; +import org.chromium.chrome.browser.signin.services.FREMobileIdentityConsistencyFieldTrial; import org.chromium.components.browser_ui.modaldialog.AppModalPresenter; import org.chromium.ui.base.LocalizationUtils; import org.chromium.ui.modaldialog.ModalDialogManager; @@ -151,9 +153,14 @@ * Defines a sequence of pages to be shown (depending on parameters etc). */ private void createPageSequence() { - mPages.add(shouldCreateEnterpriseCctTosPage() - ? new TosAndUmaFirstRunFragmentWithEnterpriseSupport.Page() - : new ToSAndUMAFirstRunFragment.Page()); + FREMobileIdentityConsistencyFieldTrial.createFirstRunTrial(); + if (FREMobileIdentityConsistencyFieldTrial.isEnabled()) { + mPages.add(SigninFirstRunFragment::new); + } else { + mPages.add(shouldCreateEnterpriseCctTosPage() + ? new TosAndUmaFirstRunFragmentWithEnterpriseSupport.Page() + : new ToSAndUMAFirstRunFragment.Page()); + } mFreProgressStates.add(FRE_PROGRESS_WELCOME_SHOWN); mPagerAdapter = new FirstRunPagerAdapter(FirstRunActivity.this, mPages); mPager.setAdapter(mPagerAdapter);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncConsentFragmentBase.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncConsentFragmentBase.java index ff4b4a65c..1e271525 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncConsentFragmentBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncConsentFragmentBase.java
@@ -26,10 +26,10 @@ import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.R; import org.chromium.chrome.browser.consent_auditor.ConsentAuditorFeature; -import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.signin.services.DisplayableProfileData; +import org.chromium.chrome.browser.signin.services.FREMobileIdentityConsistencyFieldTrial; import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; import org.chromium.chrome.browser.signin.services.ProfileDataCache; import org.chromium.chrome.browser.signin.services.SigninMetricsUtils; @@ -283,7 +283,7 @@ IdentityServicesProvider.get() .getIdentityManager(Profile.getLastUsedRegularProfile()) .getPrimaryAccountInfo(ConsentLevel.SIGNIN); - if (ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY_M2) + if (FREMobileIdentityConsistencyFieldTrial.isEnabled() && mSigninAccessPoint == SigninAccessPoint.START_PAGE && primaryAccount != null) { mIsSignedInWithoutSync = true; mSelectedAccountName = primaryAccount.getEmail();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SyncConsentFragmentTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SyncConsentFragmentTest.java index 1c5ff689..d662fa0 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SyncConsentFragmentTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SyncConsentFragmentTest.java
@@ -50,16 +50,15 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.firstrun.FirstRunPageDelegate; import org.chromium.chrome.browser.firstrun.SyncConsentFirstRunFragment; -import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.signin.services.FREMobileIdentityConsistencyFieldTrial; import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; import org.chromium.chrome.browser.sync.SyncService; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.ActivityTestUtils; import org.chromium.chrome.test.util.ChromeRenderTestRule; -import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.signin.AccountManagerTestRule; import org.chromium.chrome.test.util.browser.sync.SyncTestUtil; import org.chromium.components.externalauth.ExternalAuthUtils; @@ -80,7 +79,6 @@ */ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) -@Features.EnableFeatures({ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY_M2}) public class SyncConsentFragmentTest { private static final int RENDER_REVISION = 1; private static final String RENDER_DESCRIPTION = "Change button style"; @@ -136,6 +134,7 @@ @Before public void setUp() { + FREMobileIdentityConsistencyFieldTrial.enableForTesting(); when(mExternalAuthUtilsMock.canUseGooglePlayServices(any())).thenReturn(true); ExternalAuthUtils.setInstanceForTesting(mExternalAuthUtilsMock); mActivityTestRule.setFinishActivity(true);
diff --git a/chrome/app/resources/chromium_strings_ja.xtb b/chrome/app/resources/chromium_strings_ja.xtb index 4cf44cb8..1214fcb 100644 --- a/chrome/app/resources/chromium_strings_ja.xtb +++ b/chrome/app/resources/chromium_strings_ja.xtb
@@ -14,6 +14,7 @@ <translation id="1524282610922162960">Chromium タブの共有</translation> <translation id="1553461853655228091">周囲の 3D マップを作成するには、Chromium にカメラの使用を許可する必要があります</translation> <translation id="1607715478322902680">{COUNT,plural, =0{管理者が、アップデートを適用するために Chromium を再起動するよう求めています}=1{管理者が、アップデートを適用するために Chromium を再起動するよう求めています。シークレット ウィンドウは、再起動後は自動的には開きません。}other{管理者が、アップデートを適用するために Chromium を再起動するよう求めています。現在開いている # 個のシークレット ウィンドウは、再起動後は自動的には開きません。}}</translation> +<translation id="1667812772085710766">Chromium を終了するときに、アクセスしたページの Cookie とサイトデータが自動的に削除されます</translation> <translation id="1708666629004767631">Chromium がさらに安全になりました。最新バージョンをぜひお試しください。</translation> <translation id="1774152462503052664">Chromium をバックグラウンドで実行する</translation> <translation id="1779356040007214683">Chromium をより安全にご利用いただくため、<ph name="IDS_EXTENSION_WEB_STORE_TITLE" />で提供していない一部の拡張機能を無効にしました。これらは知らないうちに追加された可能性があります。</translation>
diff --git a/chrome/app/resources/chromium_strings_or.xtb b/chrome/app/resources/chromium_strings_or.xtb index c96313d..f8c7f8e 100644 --- a/chrome/app/resources/chromium_strings_or.xtb +++ b/chrome/app/resources/chromium_strings_or.xtb
@@ -16,6 +16,7 @@ <translation id="1524282610922162960">ଗୋଟିଏ Chromium ଟାବ୍ ସେୟାର୍ କରନ୍ତୁ</translation> <translation id="1553461853655228091">Chromium ଆପଣଙ୍କ ପରିପାର୍ଶ୍ୱର ଏକ 3D ମ୍ୟାପ୍ ତିଆରି କରିବା ପାଇଁ ଆପଣଙ୍କ କ୍ୟାମେରା ଆକ୍ସେସ୍ କରିବାକୁ ଅନୁମତି ଆବଶ୍ୟକ କରେ</translation> <translation id="1607715478322902680">{COUNT,plural, =0{ଆପଣଙ୍କର ଆଡ୍ମିନିଷ୍ଟ୍ରେଟର୍ ଚାହୁଁଛନ୍ତି ଯେ ଆପଣ ଏକ ଅପ୍ଡେଟ୍ ଲାଗୁ କରିବା ପାଇଁ Chromiumକୁ ପୁଣି ଲଞ୍ଚ କରନ୍ତୁ}=1{ଆପଣଙ୍କର ଆଡ୍ମିନିଷ୍ଟ୍ରେଟର୍ ଚାହୁଁଛନ୍ତି ଯେ ଆପଣ ଏକ ଅପ୍ଡେଟ୍ ଲାଗୁ କରିବା ପାଇଁ Chromiumକୁ ପୁଣି ଲଞ୍ଚ କରନ୍ତୁ ଆପଣଙ୍କର ଇନ୍କଗ୍ନିଟୋ ୱିଣ୍ଡୋ ପୁଣି ଖୋଲିବ ନାହିଁ।}other{ଆପଣଙ୍କର ଆଡ୍ମିନିଷ୍ଟ୍ରେଟର୍ ଚାହୁଁଛନ୍ତି ଯେ ଆପଣ ଏକ ଅପ୍ଡେଟ୍ ଲାଗୁ କରିବା ପାଇଁ Chromiumକୁ ପୁଣି ଲଞ୍ଚ କରନ୍ତୁ ଆପଣଙ୍କର #ଟି ଇନ୍କଗ୍ନିଟୋ ୱିଣ୍ଡୋ ପୁଣି ଖୋଲିବ ନାହିଁ।}}</translation> +<translation id="1667812772085710766">ଯେତେବେଳେ ଆପଣ Chromiumକୁ ବନ୍ଦ କରନ୍ତି, ଏହା ସ୍ୱଚାଳିତ ଭାବେ ଆପଣ ଭିଜିଟ୍ କରିଥିବା ପୃଷ୍ଠାଗୁଡ଼ିକରୁ କୁକୀ ଏବଂ ସାଇଟ୍ ଡାଟାକୁ ଖାଲି କରେ</translation> <translation id="1708666629004767631">Chromiumର ଏକ ନୂଆ, ସୁରକ୍ଷିତ ସଂସ୍କରଣ ଉପଲବ୍ଧ ଅଛି।</translation> <translation id="1774152462503052664">ପୃଷ୍ଠପଟରେ Chromium ଚାଲିବାକୁ ଦିଅନ୍ତୁ</translation> <translation id="1779356040007214683">Chromiumକୁ ଆହୁରି ସୁରକ୍ଷିତ କରିବା ପାଇଁ, ଆମେ <ph name="IDS_EXTENSION_WEB_STORE_TITLE" /> ରେ ତାଲିକାଭୁକ୍ତ ହୋଇନଥିବା ଏବଂ ଆପଣଙ୍କର ଅଜାଣତରେ ଯୋଗ କରାଯାଇଥିବା କିଛି ଏକ୍ସଟେନ୍ସନ୍କୁ ଅକ୍ଷମ କରିଦେଇଛୁ।</translation>
diff --git a/chrome/app/resources/generated_resources_ja.xtb b/chrome/app/resources/generated_resources_ja.xtb index 62594dc..2639585 100644 --- a/chrome/app/resources/generated_resources_ja.xtb +++ b/chrome/app/resources/generated_resources_ja.xtb
@@ -2198,6 +2198,7 @@ <translation id="3305661444342691068">PDF をプレビュー</translation> <translation id="3308116878371095290">このページの Cookie は設定されませんでした。</translation> <translation id="3308134619352333507">ボタンを非表示にする</translation> +<translation id="3308681281309926497">Chrome を終了するまでの間は、アクセスしたサイトにお客様の情報が保存されている可能性があります</translation> <translation id="3308738399950580893">広告</translation> <translation id="3308852433423051161">Google アシスタントを読み込んでいます...</translation> <translation id="3309330461362844500">証明書プロファイル ID</translation> @@ -2751,6 +2752,7 @@ <translation id="3873423927483480833">PIN を表示</translation> <translation id="3873915545594852654">ARC++ で問題が発生しました。</translation> <translation id="3874164307099183178">Google アシスタントをオンにする</translation> +<translation id="3875815154304214043"><ph name="APP_NAME" /> は新しいブラウザタブで開くよう設定されています。サポートされているリンクもブラウザで開かれます。<ph name="BEGIN_LINK_LEARN_MORE" />詳細<ph name="END_LINK_LEARN_MORE" /></translation> <translation id="3877075909000773256"><ph name="USER_NAME" /> さんのデバイスのニアバイシェア設定(<ph name="USER_EMAIL" /> アカウントでの共有)</translation> <translation id="3879748587602334249">ダウンロード マネージャ</translation> <translation id="3882165008614329320">カメラやファイルに保存されている動画</translation> @@ -3898,6 +3900,7 @@ <translation id="5157635116769074044">このページを起動画面に固定...</translation> <translation id="5159094275429367735">Crostini のセットアップ</translation> <translation id="5159419673777902220">保護者が拡張機能の許可設定を無効にしました</translation> +<translation id="5159643365935452998">自動データ削除の確認</translation> <translation id="5160634252433617617">物理キーボード</translation> <translation id="5160857336552977725"><ph name="DEVICE_TYPE" /> にログインしてください</translation> <translation id="5161251470972801814"><ph name="VENDOR_NAME" /> の USB デバイス</translation> @@ -4461,6 +4464,7 @@ <translation id="5790651917470750848">ポート転送はすでに設定されています</translation> <translation id="5792728279623964091">電源ボタンをタップしてください</translation> <translation id="5793339252089865437">モバイル ネットワーク経由でアップデートをダウンロードすると、追加料金が発生する可能性があります。</translation> +<translation id="5794034487966529952">デスク「<ph name="DESK_TITLE" />」には <ph name="NUM_BROWSERS" /> 個のブラウザ ウィンドウが開いています</translation> <translation id="5794414402486823030">常にシステム ビューアで開く</translation> <translation id="5794700615121138172">Linux の共有フォルダ</translation> <translation id="5794786537412027208">すべての Chrome アプリを終了</translation>
diff --git a/chrome/app/resources/generated_resources_or.xtb b/chrome/app/resources/generated_resources_or.xtb index 1d5d610f..bc02fe8 100644 --- a/chrome/app/resources/generated_resources_or.xtb +++ b/chrome/app/resources/generated_resources_or.xtb
@@ -2197,6 +2197,7 @@ <translation id="3305661444342691068">ପୂର୍ବାବଲୋକନରେ PDF ଖୋଲନ୍ତୁ</translation> <translation id="3308116878371095290">ଏହି ପୃଷ୍ଠାକୁ କୁକୀ ସେଟ୍ କରିବାରୁ ପ୍ରତିରୋଧ କରାଯାଇଥିଲା।</translation> <translation id="3308134619352333507">ବଟନ୍ ଲୁଚାନ୍ତୁ</translation> +<translation id="3308681281309926497">ଆପଣ Chromeକୁ ବନ୍ଦ ନକରିବା ପର୍ଯ୍ୟନ୍ତ ଆପଣ ଭିଜିଟ୍ କରିଥିବା ସାଇଟଗୁଡ଼ିକ ଆପଣଙ୍କ ସୂଚନାକୁ ଏବେ ବି ମନେ ରଖିପାରେ</translation> <translation id="3308738399950580893">ବିଜ୍ଞାପନ</translation> <translation id="3308852433423051161">Google Assistant ଲୋଡ୍ ହେଉଛି...</translation> <translation id="3309330461362844500">ସାର୍ଟିଫିକେଟ୍ ପ୍ରୋଫାଇଲ୍ ID</translation> @@ -2750,6 +2751,7 @@ <translation id="3873423927483480833">PIN ଦେଖାନ୍ତୁ</translation> <translation id="3873915545594852654">ARC++ ସହିତ ଏକ ସମସ୍ୟା ହୋଇଛି।</translation> <translation id="3874164307099183178">Google Assistant ଚାଲୁ କରନ୍ତୁ</translation> +<translation id="3875815154304214043">ଏକ ନୂଆ ବ୍ରାଉଜର୍ ଟାବରେ ଖୋଲିବା ପାଇଁ <ph name="APP_NAME" />କୁ ସେଟ୍ କରାଯାଇଛି, ସମର୍ଥିତ ଲିଙ୍କଗୁଡ଼ିକ ମଧ୍ୟ ବ୍ରାଉଜରରେ ଖୋଲିବ। <ph name="BEGIN_LINK_LEARN_MORE" />ଅଧିକ ଜାଣନ୍ତୁ<ph name="END_LINK_LEARN_MORE" /></translation> <translation id="3877075909000773256"><ph name="USER_NAME" />ର ଡିଭାଇସ୍ ପାଇଁ Nearby Share ସେଟିଂସ୍ <ph name="USER_EMAIL" /> ଆକାଉଣ୍ଟ ଅଧୀନରେ ସେୟାର୍ କରାଯାଉଛି।</translation> <translation id="3879748587602334249">ଡାଉନ୍ଲୋଡ୍ ପରିଚାଳକ</translation> <translation id="3882165008614329320">କ୍ୟାମେରା କିମ୍ବା ଫାଇଲ୍ରେ ପୂର୍ବରୁ ଥିବା ଭିଡିଓ</translation> @@ -3897,6 +3899,7 @@ <translation id="5157635116769074044">ସ୍କ୍ରିନ୍ ଆରମ୍ଭ କରିବା ପାଇଁ ଏହି ପୃଷ୍ଠାକୁ ପିନ୍ କରନ୍ତୁ...</translation> <translation id="5159094275429367735">Crostini ସେଟ୍ ଅପ୍ କରନ୍ତୁ</translation> <translation id="5159419673777902220">ଆପଣଙ୍କ ବାପାମା ଏକ୍ସଟେନସନ୍ ଅନୁମତିଗୁଡ଼ିକ ଅକ୍ଷମ କରିଛନ୍ତି</translation> +<translation id="5159643365935452998">ସ୍ୱଚାଳିତ ଡାଟା କ୍ଲିୟରିଂର ସମୀକ୍ଷା କରନ୍ତୁ</translation> <translation id="5160634252433617617">ଫିଜିକାଲ୍ କୀବୋର୍ଡ</translation> <translation id="5160857336552977725">ଆପଣଙ୍କ <ph name="DEVICE_TYPE" />ରେ ସାଇନ୍ ଇନ୍ କରନ୍ତୁ</translation> <translation id="5161251470972801814"><ph name="VENDOR_NAME" />ରୁ USB ଡିଭାଇସଗୁଡ଼ିକ</translation> @@ -4460,6 +4463,7 @@ <translation id="5790651917470750848">ପୋର୍ଟ ଫରୱାର୍ଡ ପୂର୍ବରୁ ବିଦ୍ୟମାନ ଅଛି</translation> <translation id="5792728279623964091">ଦୟାକରି ଆପଣଙ୍କର ପାୱର୍ ବଟନ୍କୁ ଟାପ୍ କରନ୍ତୁ</translation> <translation id="5793339252089865437">ଯଦି ଆପଣ ଆପଣଙ୍କ ମୋବାଇଲ୍ ନେଟ୍ୱର୍କରେ ଅପ୍ଡେଟ୍ ଡାଉନ୍ଲୋଡ୍ କରନ୍ତି, ତେବେ ଆପଣଙ୍କୁ ଅତିରିକ୍ତ ଶୁଳ୍କ ଦେବାକୁ ପଡ଼ିପାରେ।</translation> +<translation id="5794034487966529952"><ph name="DESK_TITLE" /> ଡେସ୍କରେ <ph name="NUM_BROWSERS" />ଟି ବ୍ରାଉଜର୍ ୱିଣ୍ଡୋ ଖୋଲା ଅଛି</translation> <translation id="5794414402486823030">ସର୍ବଦା ସିଷ୍ଟମ୍ ଭ୍ୟୁଅର୍ ସାହାଯ୍ୟରେ ଖୋଲନ୍ତୁ</translation> <translation id="5794700615121138172">Linux ଦ୍ୱାରା ସେୟାର୍ କରାଯାଇଥିବା ଫୋଲ୍ଡରଗୁଡ଼ିକ</translation> <translation id="5794786537412027208">ସମସ୍ତ Chrome ଆପ୍ସ ପରିତ୍ୟାଗ କରନ୍ତୁ</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ja.xtb b/chrome/app/resources/google_chrome_strings_ja.xtb index 86982f77..1c82107 100644 --- a/chrome/app/resources/google_chrome_strings_ja.xtb +++ b/chrome/app/resources/google_chrome_strings_ja.xtb
@@ -68,6 +68,7 @@ <translation id="2429317896000329049">お使いのドメインでは同期を利用できないため、Google Chrome はデータを同期できませんでした。</translation> <translation id="2467438592969358367">Google Chrome からパスワードをエクスポートするための許可を求められています。許可するには Windows のパスワードを入力してください。</translation> <translation id="2485422356828889247">アンインストール</translation> +<translation id="2518751521812750372">Chrome を終了するときに、アクセスしたページの Cookie とサイトデータが自動的に削除されます</translation> <translation id="2534507159460261402">Google Pay(Chrome にコピー)</translation> <translation id="2574930892358684005"><ph name="EXISTING_USER" /> さんはこの Chrome プロファイルにすでにログインしています。ブラウジング環境を分ける場合は、Chrome で自分用のプロファイルを作成できます。</translation> <translation id="2580411288591421699">実行中の Google Chrome と同じバージョンをインストールすることはできません。Google Chrome を閉じてからもう一度お試しください。</translation>
diff --git a/chrome/app/resources/google_chrome_strings_or.xtb b/chrome/app/resources/google_chrome_strings_or.xtb index fcd1207..b929308 100644 --- a/chrome/app/resources/google_chrome_strings_or.xtb +++ b/chrome/app/resources/google_chrome_strings_or.xtb
@@ -73,6 +73,7 @@ <translation id="2429317896000329049">ଆପଣଙ୍କର ଡୋମେନ୍ ପାଇଁ ସିଙ୍କ୍ ଉପଲବ୍ଧ ନଥିବାରୁ Google Chrome ଆପଣଙ୍କର ଡାଟା ସିଙ୍କ୍ କରିପାରିଲା ନାହିଁ।</translation> <translation id="2467438592969358367">Google Chrome ଆପଣଙ୍କର ପାସ୍ୱାର୍ଡଗୁଡିକୁ ଏକ୍ସପୋର୍ଟ କରିବାକୁ ଚାହେଁ। ଏହାକୁ ଅନୁମତି ଦେବା ପାଇଁ ନିଜର Windows ପାସ୍ୱାର୍ଡ ଟାଇପ୍ କରନ୍ତୁ।</translation> <translation id="2485422356828889247">ଅନ୍ଇନ୍ଷ୍ଟଲ୍ କରନ୍ତୁ</translation> +<translation id="2518751521812750372">ଯେତେବେଳେ ଆପଣ Chromeକୁ ବନ୍ଦ କରନ୍ତି, ଏହା ସ୍ୱଚାଳିତ ଭାବେ ଆପଣ ଭିଜିଟ୍ କରିଥିବା ପୃଷ୍ଠାଗୁଡ଼ିକରୁ କୁକୀ ଏବଂ ସାଇଟ୍ ଡାଟାକୁ ଖାଲି କରେ</translation> <translation id="2534507159460261402">Google Pay (Chromeକୁ କପି କରାଯାଇଛି)</translation> <translation id="2574930892358684005"><ph name="EXISTING_USER" /> ଏହି Chrome ପ୍ରୋଫାଇଲରେ ପୂର୍ବରୁ ସାଇନ୍ ଇନ୍ କରିସାରିଛନ୍ତି। ଆପଣଙ୍କ ବ୍ରାଉଜିଂକୁ ଅଲଗା ରଖିବାକୁ, Chrome ଆପଣଙ୍କ ପାଇଁ ଆପଣଙ୍କର ନିଜର ପ୍ରୋଫାଇଲ୍ ତିଆରି କରିପାରିବ।</translation> <translation id="2580411288591421699">ବର୍ତ୍ତମାନ ସମୟରେ ଚାଲୁଥିବା Google Chromeର ସମାନ ସଂସ୍କରଣକୁ ଇନ୍ଷ୍ଟଲ୍ କରାଯାଇପାରିବ ନାହିଁ। ଦୟାକରି Google Chromeକୁ ବନ୍ଦ କରନ୍ତୁ ଏବଂ ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ।</translation>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index c261ad7c..4d4b562 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -3610,9 +3610,6 @@ <message name="IDS_SETTINGS_RESET_CLEANUP_LOGS_PERMISSION_PREF" desc="A checkbox label for the 'Report harmful software removal details' preference."> Report details to Google about harmful software, system settings, and processes that were found on your computer during this cleanup </message> - <message name="IDS_SETTINGS_RESET_CLEANUP_EXPLANTION_NOTIFICATION_PERMISSION" desc="A checkbox label for showing a notification dialog to users once the Chrome scan for harmful software completed."> - Notify me when Chrome has finished searching for harmful software - </message> <message name="IDS_SETTINGS_RESET_CLEANUP_TITLE_CLEANUP_UNAVAILABLE" desc="Title of error message that could appear before the cleanup of harmful software because Chrome failed to contact the server. This message will only appear on Windows desktop/laptop computers."> Cleanup is currently unavailable </message>
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_RESET_CLEANUP_EXPLANTION_NOTIFICATION_PERMISSION.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_RESET_CLEANUP_EXPLANTION_NOTIFICATION_PERMISSION.png.sha1 deleted file mode 100644 index 592eb7f5..0000000 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_RESET_CLEANUP_EXPLANTION_NOTIFICATION_PERMISSION.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -c9c880a48b276496bffc4011bb63394b692af628 \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 379bfe83..0be54dab 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -467,8 +467,6 @@ "engagement/history_aware_site_engagement_service.h", "engagement/important_sites_util.cc", "engagement/important_sites_util.h", - "engagement/site_engagement_helper.cc", - "engagement/site_engagement_helper.h", "engagement/site_engagement_service_factory.cc", "engagement/site_engagement_service_factory.h", "enterprise/browser_management/browser_management_service.cc", @@ -2876,6 +2874,8 @@ "android/service_tab_launcher.h", "android/shortcut_helper.cc", "android/shortcut_helper.h", + "android/signin/fre_mobile_identity_consistency_field_trial.cc", + "android/signin/fre_mobile_identity_consistency_field_trial.h", "android/signin/signin_bridge.cc", "android/signin/signin_bridge.h", "android/signin/signin_manager_android.cc",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 89a98ac..accfb7dc 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -6472,21 +6472,6 @@ flag_descriptions::kClientStorageAccessContextAuditingDescription, kOsAll, FEATURE_VALUE_TYPE(features::kClientStorageAccessContextAuditing)}, -#if defined(OS_WIN) - {"safety-check-chrome-cleaner-child", - flag_descriptions::kSafetyCheckChromeCleanerChildName, - flag_descriptions::kSafetyCheckChromeCleanerChildDescription, kOsWin, - FEATURE_VALUE_TYPE(features::kSafetyCheckChromeCleanerChild)}, -#endif // !defined(OS_WIN) - -#if defined(OS_WIN) - {"chrome-cleanup-scan-completed-notification", - flag_descriptions::kChromeCleanupScanCompletedNotificationName, - flag_descriptions::kChromeCleanupScanCompletedNotificationDescription, - kOsWin, - FEATURE_VALUE_TYPE(features::kChromeCleanupScanCompletedNotification)}, -#endif // !defined(OS_WIN) - #if BUILDFLAG(IS_CHROMEOS_ASH) {"productivity-launcher", flag_descriptions::kAppListBubbleName, flag_descriptions::kAppListBubbleDescription, kOsCrOS, @@ -6629,11 +6614,6 @@ flag_descriptions::kConsolidatedSiteStorageControlsDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kConsolidatedSiteStorageControls)}, - {"content-settings-redesign", - flag_descriptions::kContentSettingsRedesignName, - flag_descriptions::kContentSettingsRedesignDescription, kOsDesktop, - FEATURE_VALUE_TYPE(features::kContentSettingsRedesign)}, - #if defined(OS_ANDROID) {"cpu-affinity-restrict-to-little-cores", flag_descriptions::kCpuAffinityRestrictToLittleCoresName,
diff --git a/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.cc b/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.cc new file mode 100644 index 0000000..081e1aa --- /dev/null +++ b/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.cc
@@ -0,0 +1,19 @@ +// Copyright 2021 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 "chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.h" +#include "base/android/jni_android.h" +#include "base/android/jni_string.h" +#include "chrome/browser/signin/services/android/jni_headers/FREMobileIdentityConsistencyFieldTrial_jni.h" + +namespace fre_mobile_identity_consistency_field_trial { + +std::string GetFREFieldTrialGroup() { + JNIEnv* env = base::android::AttachCurrentThread(); + base::android::ScopedJavaLocalRef<jstring> group = + Java_FREMobileIdentityConsistencyFieldTrial_getFirstRunTrialGroup(env); + return base::android::ConvertJavaStringToUTF8(env, group); +} + +} // namespace fre_mobile_identity_consistency_field_trial
diff --git a/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.h b/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.h new file mode 100644 index 0000000..2a6b49a7 --- /dev/null +++ b/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.h
@@ -0,0 +1,18 @@ +// Copyright 2021 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 CHROME_BROWSER_ANDROID_SIGNIN_FRE_MOBILE_IDENTITY_CONSISTENCY_FIELD_TRIAL_H_ +#define CHROME_BROWSER_ANDROID_SIGNIN_FRE_MOBILE_IDENTITY_CONSISTENCY_FIELD_TRIAL_H_ + +#include <string> + +namespace fre_mobile_identity_consistency_field_trial { + +// Returns the field trial group created in Java code. +// The groups are created in FREFieldTrial.java. +std::string GetFREFieldTrialGroup(); + +} // namespace fre_mobile_identity_consistency_field_trial + +#endif // CHROME_BROWSER_ANDROID_SIGNIN_FRE_MOBILE_IDENTITY_CONSISTENCY_FIELD_TRIAL_H_
diff --git a/chrome/browser/ash/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/ash/accessibility/spoken_feedback_browsertest.cc index fce5f66..022f38c 100644 --- a/chrome/browser/ash/accessibility/spoken_feedback_browsertest.cc +++ b/chrome/browser/ash/accessibility/spoken_feedback_browsertest.cc
@@ -14,9 +14,9 @@ #include "ash/public/cpp/accessibility_controller.h" #include "ash/public/cpp/event_rewriter_controller.h" #include "ash/public/cpp/screen_backlight.h" -#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model.h" #include "ash/public/cpp/test/shell_test_api.h" +#include "ash/public/cpp/test/test_shelf_item_delegate.h" #include "ash/root_window_controller.h" #include "ash/shelf/shelf.h" #include "ash/shelf/shelf_view.h" @@ -70,17 +70,6 @@ namespace ash { namespace { -class TestShelfItemDelegate : public ShelfItemDelegate { - public: - explicit TestShelfItemDelegate(const ShelfID& shelf_id) - : ShelfItemDelegate(shelf_id) {} - void ExecuteCommand(bool from_context_menu, - int64_t command_id, - int32_t event_flags, - int64_t display_id) override {} - void Close() override {} -}; - const double kExpectedPhoneticSpeechAndHintDelayMS = 1000; } // namespace
diff --git a/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.cc b/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.cc index ad750e6..75be261 100644 --- a/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.cc +++ b/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.cc
@@ -17,8 +17,12 @@ #include "chrome/browser/ash/login/enrollment/enrollment_uma.h" #include "chrome/browser/ash/login/startup_utils.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" +#include "chrome/browser/ash/policy/core/device_cloud_policy_client_factory_ash.h" +#include "chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h" #include "chrome/browser/ash/policy/core/policy_oauth2_token_fetcher.h" -#include "chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h" +#include "chrome/browser/ash/policy/enrollment/enrollment_handler.h" +#include "chrome/browser/ash/policy/enrollment/enrollment_requisition_manager.h" +#include "chrome/browser/ash/policy/enrollment/tpm_enrollment_key_signing_service.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" @@ -27,6 +31,7 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/tpm_manager/tpm_manager.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" +#include "chromeos/system/statistics_provider.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/dm_auth.h" #include "components/policy/proto/device_management_backend.pb.h" @@ -190,15 +195,37 @@ } connector->ScheduleServiceInitialization(0); - policy::DeviceCloudPolicyInitializer* dcp_initializer = - connector->GetDeviceCloudPolicyInitializer(); - CHECK(dcp_initializer); - dcp_initializer->PrepareEnrollment( - connector->device_management_service(), ad_join_delegate_, - enrollment_config_, auth_data_.Clone(), + + DCHECK(!enrollment_handler_); + policy::DeviceCloudPolicyManagerAsh* policy_manager = + connector->GetDeviceCloudPolicyManager(); + // Obtain attestation_flow from the connector because it can be fake + // attestation flow for testing. + chromeos::attestation::AttestationFlow* attestation_flow = + connector->GetAttestationFlow(); + auto signing_service = + std::make_unique<policy::TpmEnrollmentKeySigningService>(); + // DeviceDMToken callback is empty here because for device policies this + // DMToken is already provided in the policy fetch requests. + auto client = policy::CreateDeviceCloudPolicyClientAsh( + chromeos::system::StatisticsProvider::GetInstance(), + connector->device_management_service(), + g_browser_process->shared_url_loader_factory(), + policy::CloudPolicyClient::DeviceDMTokenCallback()); + + enrollment_handler_ = std::make_unique<policy::EnrollmentHandler>( + policy_manager->device_store(), InstallAttributes::Get(), + connector->GetStateKeysBroker(), attestation_flow, + std::move(signing_service), std::move(client), + policy::BrowserPolicyConnectorAsh::CreateBackgroundTaskRunner(), + ad_join_delegate_, enrollment_config_, auth_data_.Clone(), + InstallAttributes::Get()->GetDeviceId(), + policy::EnrollmentRequisitionManager::GetDeviceRequisition(), + policy::EnrollmentRequisitionManager::GetSubOrganization(), base::BindOnce(&EnterpriseEnrollmentHelperImpl::OnEnrollmentFinished, weak_ptr_factory_.GetWeakPtr())); - dcp_initializer->StartEnrollment(); + + enrollment_handler_->StartEnrollment(); } void EnterpriseEnrollmentHelperImpl::GetDeviceAttributeUpdatePermission() { @@ -265,17 +292,41 @@ void EnterpriseEnrollmentHelperImpl::OnEnrollmentFinished( policy::EnrollmentStatus status) { + // Regardless how enrollment has finished, |enrollment_handler_| is expired. + // |client| might still be needed to connect the manager. + auto client = enrollment_handler_->ReleaseClient(); + // Though enrollment handler calls this method, it's "fine" do delete the + // handler here as it does not do anyhting after that callback in + // |EnrollmentHandler::ReportResult()|. + // TODO(crbug.com/1236167): Enrollment handler calls this method. Deal with + // removing caller from callee. + enrollment_handler_.reset(); + VLOG(1) << "Enrollment finished, status: " << status.status(); ReportEnrollmentStatus(status); if (oauth_status_ != OAUTH_NOT_STARTED) oauth_status_ = OAUTH_FINISHED; - if (status.status() == policy::EnrollmentStatus::SUCCESS) { - success_ = true; - StartupUtils::MarkOobeCompleted(); - status_consumer()->OnDeviceEnrolled(); - } else { + + if (status.status() != policy::EnrollmentStatus::SUCCESS) { status_consumer()->OnEnrollmentError(status); + return; } + + policy::BrowserPolicyConnectorAsh* connector = + g_browser_process->platform_part()->browser_policy_connector_ash(); + policy::DeviceCloudPolicyManagerAsh* policy_manager = + connector->GetDeviceCloudPolicyManager(); + + // Connect policy manager if necessary. If it has already been connected, no + // reconnection needed. + if (!policy_manager->IsConnected()) { + policy_manager->StartConnection(std::move(client), + InstallAttributes::Get()); + } + + success_ = true; + StartupUtils::MarkOobeCompleted(); + status_consumer()->OnDeviceEnrolled(); } void EnterpriseEnrollmentHelperImpl::OnDeviceAttributeUpdatePermission(
diff --git a/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.h b/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.h index b8a2bc29..d75df32 100644 --- a/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.h +++ b/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.h
@@ -19,6 +19,7 @@ #include "google_apis/gaia/google_service_auth_error.h" namespace policy { +class EnrollmentHandler; class PolicyOAuth2TokenFetcher; } // namespace policy @@ -91,6 +92,9 @@ std::unique_ptr<policy::PolicyOAuth2TokenFetcher> oauth_fetcher_; + // Non-nullptr from DoEnroll till OnEnrollmentFinished. + std::unique_ptr<policy::EnrollmentHandler> enrollment_handler_; + base::WeakPtrFactory<EnterpriseEnrollmentHelperImpl> weak_ptr_factory_{this}; DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentHelperImpl);
diff --git a/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc b/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc index 0880497..a31533ed 100644 --- a/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc +++ b/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc
@@ -491,10 +491,6 @@ void BrowserPolicyConnectorAsh::SetAttestationFlowForTesting( std::unique_ptr<chromeos::attestation::AttestationFlow> attestation_flow) { attestation_flow_ = std::move(attestation_flow); - if (device_cloud_policy_initializer_) { - device_cloud_policy_initializer_->SetAttestationFlowForTesting( - attestation_flow_.get()); - } } // static @@ -513,9 +509,6 @@ base::ThreadTaskRunnerHandle::Get()->DeleteSoon( FROM_HERE, std::move(device_cloud_policy_initializer_)); - // TODO(crbug.com/705758): Remove once the crash is resolved. - LOG(WARNING) << "DeviceCloudPolicyInitializer is not available anymore."; - if (!device_cert_provisioning_scheduler_) { // CertProvisioningScheduler depends on the device-wide CloudPolicyClient to // be available so it can only be created when the CloudPolicyManager is @@ -572,10 +565,9 @@ device_cloud_policy_initializer_ = std::make_unique<DeviceCloudPolicyInitializer>( local_state_, device_management_service(), - CreateBackgroundTaskRunner(), chromeos::InstallAttributes::Get(), - state_keys_broker_.get(), + chromeos::InstallAttributes::Get(), state_keys_broker_.get(), device_cloud_policy_manager_->device_store(), - device_cloud_policy_manager_, attestation_flow_.get(), + device_cloud_policy_manager_, chromeos::system::StatisticsProvider::GetInstance()); device_cloud_policy_initializer_->Init(); }
diff --git a/chrome/browser/ash/policy/core/browser_policy_connector_ash.h b/chrome/browser/ash/policy/core/browser_policy_connector_ash.h index 84154df..1a470da4 100644 --- a/chrome/browser/ash/policy/core/browser_policy_connector_ash.h +++ b/chrome/browser/ash/policy/core/browser_policy_connector_ash.h
@@ -161,11 +161,6 @@ } // May be nullptr, e.g. for devices managed by Active Directory. - DeviceCloudPolicyInitializer* GetDeviceCloudPolicyInitializer() const { - return device_cloud_policy_initializer_.get(); - } - - // May be nullptr, e.g. for devices managed by Active Directory. DeviceLocalAccountPolicyService* GetDeviceLocalAccountPolicyService() const { return device_local_account_policy_service_.get(); }
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_browsertest.cc b/chrome/browser/ash/policy/core/device_cloud_policy_browsertest.cc index 717459322..48c4366 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_browsertest.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_browsertest.cc
@@ -17,7 +17,6 @@ #include "base/values.h" #include "chrome/browser/ash/login/test/local_policy_test_server_mixin.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" -#include "chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_store_ash.h" #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h" #include "chrome/browser/ash/settings/device_settings_service.h" @@ -36,7 +35,6 @@ #include "components/policy/core/browser/browser_policy_connector.h" #include "components/policy/core/common/cloud/cloud_policy_client.h" #include "components/policy/core/common/cloud/device_management_service.h" -#include "components/policy/core/common/cloud/mock_cloud_policy_client.h" #include "components/policy/core/common/cloud/test/policy_builder.h" #include "components/policy/core/common/policy_service.h" #include "components/policy/core/common/policy_switches.h" @@ -64,37 +62,6 @@ namespace { -class DeviceCloudPolicyBrowserTest : public InProcessBrowserTest { - protected: - DeviceCloudPolicyBrowserTest() - : mock_client_(std::make_unique<MockCloudPolicyClient>()) {} - - std::unique_ptr<MockCloudPolicyClient> mock_client_; - - private: - DISALLOW_COPY_AND_ASSIGN(DeviceCloudPolicyBrowserTest); -}; - -} // namespace - -IN_PROC_BROWSER_TEST_F(DeviceCloudPolicyBrowserTest, Initializer) { - BrowserPolicyConnectorAsh* connector = - g_browser_process->platform_part()->browser_policy_connector_ash(); - // Initializer exists at first. - EXPECT_TRUE(connector->GetDeviceCloudPolicyInitializer()); - - // Initializer is deleted when the manager connects. - connector->GetDeviceCloudPolicyManager()->StartConnection( - std::move(mock_client_), connector->GetInstallAttributes()); - EXPECT_FALSE(connector->GetDeviceCloudPolicyInitializer()); - - // Initializer is restarted when the manager disconnects. - connector->GetDeviceCloudPolicyManager()->Disconnect(); - EXPECT_TRUE(connector->GetDeviceCloudPolicyInitializer()); -} - -namespace { - // Tests for the rotation of the signing keys used for the device policy. // // The test is performed against a test policy server, which is set up for
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc index 9398d3c..fef4005cf 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc
@@ -22,9 +22,11 @@ #include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/ash/ownership/owner_settings_service_ash.h" #include "chrome/browser/ash/ownership/owner_settings_service_ash_factory.h" +#include "chrome/browser/ash/policy/core/device_cloud_policy_client_factory_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_store_ash.h" #include "chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h" #include "chrome/browser/ash/policy/enrollment/enrollment_config.h" +#include "chrome/browser/ash/policy/enrollment/enrollment_handler.h" #include "chrome/browser/ash/policy/enrollment/enrollment_requisition_manager.h" #include "chrome/browser/ash/settings/device_settings_test_helper.h" #include "chrome/browser/device_identity/device_oauth2_token_service.h" @@ -229,12 +231,9 @@ manager_->Initialize(&local_state_); policy::EnrollmentRequisitionManager::Initialize(); initializer_ = std::make_unique<DeviceCloudPolicyInitializer>( - &local_state_, &device_management_service_, - base::ThreadTaskRunnerHandle::Get(), install_attributes_.get(), - &state_keys_broker_, store_, manager_.get(), &mock_attestation_flow_, + &local_state_, &device_management_service_, install_attributes_.get(), + &state_keys_broker_, store_, manager_.get(), &fake_statistics_provider_); - initializer_->SetSigningServiceForTesting( - std::make_unique<FakeSigningService>()); initializer_->SetSystemURLLoaderFactoryForTesting( test_url_loader_factory_.GetSafeWeakWrapper()); initializer_->Init(); @@ -467,6 +466,8 @@ public testing::WithParamInterface<bool> { public: void Done(EnrollmentStatus status) { + enrollment_handler_.reset(); + ConnectManager(false); status_ = status; done_ = true; } @@ -508,8 +509,6 @@ PolicyBundle bundle; EXPECT_TRUE(manager_->policies().Equals(bundle)); - ConnectManager(false); - if (ShouldRegisterWithCert()) { EXPECT_CALL(mock_attestation_flow_, GetCertificate(_, _, _, _, _, _)) .WillOnce(WithArgs<5>(Invoke(CertCallbackSuccess))); @@ -559,12 +558,25 @@ : EnrollmentConfig::MODE_MANUAL; DMAuth auth = with_cert ? DMAuth::NoAuth() : DMAuth::FromOAuthToken("auth token"); - initializer_->PrepareEnrollment( - &device_management_service_, nullptr, enrollment_config, - std::move(auth), + + auto fake_signing_service = std::make_unique<FakeSigningService>(); + auto client = CreateDeviceCloudPolicyClientAsh( + &fake_statistics_provider_, &device_management_service_, + test_url_loader_factory_.GetSafeWeakWrapper(), + CloudPolicyClient::DeviceDMTokenCallback()); + + enrollment_handler_ = std::make_unique<EnrollmentHandler>( + store_, install_attributes_.get(), &state_keys_broker_, + &mock_attestation_flow_, std::move(fake_signing_service), + std::move(client), base::ThreadTaskRunnerHandle::Get(), + /*ad_join_delegate=*/nullptr, enrollment_config, std::move(auth), + install_attributes_->GetDeviceId(), + EnrollmentRequisitionManager::GetDeviceRequisition(), + EnrollmentRequisitionManager::GetSubOrganization(), + base::BindOnce(&DeviceCloudPolicyManagerAshEnrollmentTest::Done, base::Unretained(this))); - initializer_->StartEnrollment(); + enrollment_handler_->StartEnrollment(); base::RunLoop().RunUntilIdle(); Mock::VerifyAndClearExpectations(&device_management_service_); @@ -750,6 +762,8 @@ DeviceManagementService::JobConfiguration::ParameterMap query_params_; EnrollmentStatus status_; + std::unique_ptr<EnrollmentHandler> enrollment_handler_; + // Set to true if the robot auth fetch is expected to fail. bool expect_robot_auth_fetch_failure_;
diff --git a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc index 76737cd..1841b545 100644 --- a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc +++ b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc
@@ -8,28 +8,20 @@ #include <utility> #include "base/bind.h" -#include "base/callback.h" -#include "base/callback_helpers.h" #include "base/command_line.h" #include "base/logging.h" -#include "base/sequenced_task_runner.h" #include "base/values.h" #include "chrome/browser/ash/login/login_pref_names.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_client_factory_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_store_ash.h" #include "chrome/browser/ash/policy/enrollment/enrollment_config.h" -#include "chrome/browser/ash/policy/enrollment/enrollment_handler.h" -#include "chrome/browser/ash/policy/enrollment/enrollment_requisition_manager.h" -#include "chrome/browser/ash/policy/enrollment/tpm_enrollment_key_signing_service.h" #include "chrome/browser/ash/policy/server_backed_state/server_backed_device_state.h" -#include "chrome/browser/ash/policy/status_collector/device_status_collector.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/policy/enrollment_status.h" #include "chrome/common/chrome_content_client.h" #include "chrome/common/pref_names.h" -#include "chromeos/attestation/attestation_flow.h" #include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/system/statistics_provider.h" #include "chromeos/tpm/install_attributes.h" @@ -42,39 +34,24 @@ DeviceCloudPolicyInitializer::DeviceCloudPolicyInitializer( PrefService* local_state, DeviceManagementService* enterprise_service, - const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, chromeos::InstallAttributes* install_attributes, ServerBackedStateKeysBroker* state_keys_broker, DeviceCloudPolicyStoreAsh* policy_store, DeviceCloudPolicyManagerAsh* policy_manager, - chromeos::attestation::AttestationFlow* attestation_flow, chromeos::system::StatisticsProvider* statistics_provider) : local_state_(local_state), enterprise_service_(enterprise_service), - background_task_runner_(background_task_runner), install_attributes_(install_attributes), state_keys_broker_(state_keys_broker), policy_store_(policy_store), policy_manager_(policy_manager), - attestation_flow_(attestation_flow), - statistics_provider_(statistics_provider), - signing_service_(std::make_unique<TpmEnrollmentKeySigningService>()) {} - -void DeviceCloudPolicyInitializer::SetSigningServiceForTesting( - std::unique_ptr<policy::SigningService> signing_service) { - signing_service_ = std::move(signing_service); -} + statistics_provider_(statistics_provider) {} void DeviceCloudPolicyInitializer::SetSystemURLLoaderFactoryForTesting( scoped_refptr<network::SharedURLLoaderFactory> system_url_loader_factory) { system_url_loader_factory_for_testing_ = system_url_loader_factory; } -void DeviceCloudPolicyInitializer::SetAttestationFlowForTesting( - chromeos::attestation::AttestationFlow* attestation_flow) { - attestation_flow_ = attestation_flow; -} - DeviceCloudPolicyInitializer::~DeviceCloudPolicyInitializer() { DCHECK(!is_initialized_); } @@ -84,51 +61,21 @@ is_initialized_ = true; policy_store_->AddObserver(this); - state_keys_update_subscription_ = - state_keys_broker_->RegisterUpdateCallback(base::BindRepeating( - &DeviceCloudPolicyInitializer::TryToStartConnection, - base::Unretained(this), StartConnectionReason::kStateKeysStored)); + state_keys_update_subscription_ = state_keys_broker_->RegisterUpdateCallback( + base::BindRepeating(&DeviceCloudPolicyInitializer::TryToStartConnection, + base::Unretained(this))); - TryToStartConnection(StartConnectionReason::kInitialCreation); + TryToStartConnection(); } void DeviceCloudPolicyInitializer::Shutdown() { DCHECK(is_initialized_); policy_store_->RemoveObserver(this); - enrollment_handler_.reset(); state_keys_update_subscription_ = {}; is_initialized_ = false; } -void DeviceCloudPolicyInitializer::PrepareEnrollment( - DeviceManagementService* device_management_service, - ActiveDirectoryJoinDelegate* ad_join_delegate, - const EnrollmentConfig& enrollment_config, - DMAuth dm_auth, - EnrollmentCallback enrollment_callback) { - DCHECK(is_initialized_); - DCHECK(!enrollment_handler_); - - policy_manager_->core()->Disconnect(); - - enrollment_handler_ = std::make_unique<EnrollmentHandler>( - policy_store_, install_attributes_, state_keys_broker_, attestation_flow_, - signing_service_.get(), CreateClient(device_management_service), - background_task_runner_, ad_join_delegate, enrollment_config, - std::move(dm_auth), install_attributes_->GetDeviceId(), - EnrollmentRequisitionManager::GetDeviceRequisition(), - EnrollmentRequisitionManager::GetSubOrganization(), - base::BindOnce(&DeviceCloudPolicyInitializer::EnrollmentCompleted, - base::Unretained(this), std::move(enrollment_callback))); -} - -void DeviceCloudPolicyInitializer::StartEnrollment() { - DCHECK(is_initialized_); - DCHECK(enrollment_handler_); - enrollment_handler_->StartEnrollment(); -} - EnrollmentConfig DeviceCloudPolicyInitializer::GetPrescribedEnrollmentConfig() const { EnrollmentConfig config; @@ -277,34 +224,13 @@ } void DeviceCloudPolicyInitializer::OnStoreLoaded(CloudPolicyStore* store) { - TryToStartConnection(StartConnectionReason::kCloudPolicyLoaded); + TryToStartConnection(); } void DeviceCloudPolicyInitializer::OnStoreError(CloudPolicyStore* store) { // Do nothing. } -void DeviceCloudPolicyInitializer::EnrollmentCompleted( - EnrollmentCallback enrollment_callback, - EnrollmentStatus status) { - std::unique_ptr<CloudPolicyClient> client = - enrollment_handler_->ReleaseClient(); - enrollment_handler_.reset(); - - if (status.status() == EnrollmentStatus::SUCCESS && - !install_attributes_->IsActiveDirectoryManaged()) { - StartConnection(StartConnectionReason::kEnrollmentCompleted, - std::move(client)); - } else { - // Some attempts to create a client may be blocked because the enrollment - // was in progress. We give it a try again. - TryToStartConnection(StartConnectionReason::kEnrollmentCompleted); - } - - if (!enrollment_callback.is_null()) - std::move(enrollment_callback).Run(status); -} - std::unique_ptr<CloudPolicyClient> DeviceCloudPolicyInitializer::CreateClient( DeviceManagementService* device_management_service) { // DeviceDMToken callback is empty here because for device policies this @@ -317,12 +243,7 @@ CloudPolicyClient::DeviceDMTokenCallback()); } -void DeviceCloudPolicyInitializer::TryToStartConnection( - DeviceCloudPolicyInitializer::StartConnectionReason reason) { - if (enrollment_handler_) { - // This could happen in case |PrepareEnrollment| was called. - return; - } +void DeviceCloudPolicyInitializer::TryToStartConnection() { if (install_attributes_->IsActiveDirectoryManaged()) { // This will go away once ChromeAd deprecation is completed. return; @@ -332,17 +253,13 @@ // Server we could drop the `state_keys_broker_->available()` requirement. if (policy_store_->is_initialized() && policy_store_->has_policy() && state_keys_broker_->available()) { - StartConnection(reason, CreateClient(enterprise_service_)); + StartConnection(CreateClient(enterprise_service_)); } } void DeviceCloudPolicyInitializer::StartConnection( - DeviceCloudPolicyInitializer::StartConnectionReason reason, std::unique_ptr<CloudPolicyClient> client) { if (!policy_manager_->IsConnected()) { - LOG(WARNING) - << "DeviceCloudPolicyInitializer will be removed soon with reason: " - << static_cast<int>(reason); policy_manager_->StartConnection(std::move(client), install_attributes_); } }
diff --git a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h index 05d44f38..7e3369f8 100644 --- a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h +++ b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h
@@ -9,7 +9,6 @@ #include <string> #include "base/callback_forward.h" -#include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "chrome/browser/ash/policy/server_backed_state/server_backed_state_keys_broker.h" @@ -21,16 +20,9 @@ class PrefService; -namespace base { -class SequencedTaskRunner; -} - namespace chromeos { class InstallAttributes; -namespace attestation { -class AttestationFlow; -} namespace system { class StatisticsProvider; } @@ -38,14 +30,10 @@ } // namespace chromeos namespace policy { -class ActiveDirectoryJoinDelegate; class DeviceCloudPolicyManagerAsh; class DeviceCloudPolicyStoreAsh; class DeviceManagementService; struct EnrollmentConfig; -class EnrollmentHandler; -class EnrollmentStatus; -class SigningService; // The |DeviceCloudPolicyInitializer| is a helper class which calls // `DeviceCloudPolicyManager::StartConnection` with a new `CloudPolicyClient` @@ -54,33 +42,18 @@ // - the `ServerBackedStateKeysBroker` is available, // - `chromeos::InstallAttributes::IsActiveDirectoryManaged() == false` // -// However, this helper is also used by another helper class: -// |EnterpriseEnrollmentHelperImpl|. -// -// If it is used for enrollment, then |StartConnection| is called only after -// enrollment is completed. -// // It is expected that the |DeviceCloudPolicyInitializer| will be // destroyed soon after it called |StartConnection|, but see // crbug.com/705758 for complications. -// -// TODO(https://crbug.com/1219487) Move the enrollment part out the -// |DeviceCloudPolicyInitializer|. class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer { public: - using EnrollmentCallback = base::OnceCallback<void(EnrollmentStatus)>; - - // |background_task_runner| is used to execute long-running background tasks - // that may involve file I/O. DeviceCloudPolicyInitializer( PrefService* local_state, DeviceManagementService* enterprise_service, - const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, chromeos::InstallAttributes* install_attributes, ServerBackedStateKeysBroker* state_keys_broker, DeviceCloudPolicyStoreAsh* policy_store, DeviceCloudPolicyManagerAsh* policy_manager, - chromeos::attestation::AttestationFlow* attestation_flow, chromeos::system::StatisticsProvider* statistics_provider); ~DeviceCloudPolicyInitializer() override; @@ -88,20 +61,6 @@ virtual void Init(); virtual void Shutdown(); - // Prepares enrollment or re-enrollment. Enrollment should be started by - // calling StartEnrollment. Once the enrollment process - // completes, |enrollment_callback| is invoked and gets passed the status of - // the operation. - virtual void PrepareEnrollment( - DeviceManagementService* device_management_service, - ActiveDirectoryJoinDelegate* ad_join_delegate, - const EnrollmentConfig& enrollment_config, - DMAuth dm_auth, - EnrollmentCallback enrollment_callback); - - // Starts enrollment. - virtual void StartEnrollment(); - // Get the enrollment configuration that has been set up via signals such as // device requisition, OEM manifest, pre-existing installation-time attributes // or server-backed state retrieval. The configuration is stored in |config|, @@ -111,51 +70,23 @@ // enrollment recovery, or already-present install attributes. Note that // |config.management_domain| may be non-empty even if |config.mode| is // MODE_NONE. + // TODO(crbug.com/1236174): Remove EnrollmentConfig from initializer. EnrollmentConfig GetPrescribedEnrollmentConfig() const; // CloudPolicyStore::Observer: void OnStoreLoaded(CloudPolicyStore* store) override; void OnStoreError(CloudPolicyStore* store) override; - // Allows testing code to set a signing service tailored to its needs. - void SetSigningServiceForTesting( - std::unique_ptr<policy::SigningService> signing_service); void SetSystemURLLoaderFactoryForTesting( scoped_refptr<network::SharedURLLoaderFactory> system_url_loader_factory); - void SetAttestationFlowForTesting( - chromeos::attestation::AttestationFlow* attestation_flow); private: - - // TODO(crbug.com/705758) When DeviceCloudPolicyInitializer starts connection, - // that means it will be deleted soon by - // |BrowserPolicyConnectorAsh::OnDeviceCloudPolicyManagerConnected|. - // Sometimes this happens before |EnterpriseEnrollmentHelperImpl::DoEnroll| - // initiates |StartConnection| and leads to a crash. Track the reason of - // |StartConnection| call to find who initiates removal. Remove once the crash - // is resolved. - enum class StartConnectionReason { - // |StartConnection| succeeds after call from |Init|. - kInitialCreation = 0, - // |StartConnection| succeeds after notification from |state_keys_broker_|. - kStateKeysStored = 1, - // |StartConnection| succeeds after notification from |policy_store_|. - kCloudPolicyLoaded = 2, - // |StartConnection| succeeds after call from |StartEnrollment|. - kEnrollmentCompleted = 3, - }; - - // Handles completion signaled by |enrollment_handler_|. - void EnrollmentCompleted(EnrollmentCallback enrollment_callback, - EnrollmentStatus status); - // Creates a new CloudPolicyClient. std::unique_ptr<CloudPolicyClient> CreateClient( DeviceManagementService* device_management_service); - void TryToStartConnection(StartConnectionReason reason); - void StartConnection(StartConnectionReason reason, - std::unique_ptr<CloudPolicyClient> client); + void TryToStartConnection(); + void StartConnection(std::unique_ptr<CloudPolicyClient> client); // Get a machine flag from |statistics_provider_|, returning the given // |default_value| if not present. @@ -163,23 +94,15 @@ PrefService* local_state_; DeviceManagementService* enterprise_service_; - scoped_refptr<base::SequencedTaskRunner> background_task_runner_; chromeos::InstallAttributes* install_attributes_; ServerBackedStateKeysBroker* state_keys_broker_; DeviceCloudPolicyStoreAsh* policy_store_; DeviceCloudPolicyManagerAsh* policy_manager_; - chromeos::attestation::AttestationFlow* attestation_flow_; chromeos::system::StatisticsProvider* statistics_provider_; bool is_initialized_ = false; - // Non-NULL if there is an enrollment operation pending. - std::unique_ptr<EnrollmentHandler> enrollment_handler_; - base::CallbackListSubscription state_keys_update_subscription_; - // Our signing service. - std::unique_ptr<SigningService> signing_service_; - // The URLLoaderFactory set in tests. scoped_refptr<network::SharedURLLoaderFactory> system_url_loader_factory_for_testing_;
diff --git a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer_unittest.cc b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer_unittest.cc index 32f5d92..d04ff877 100644 --- a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer_unittest.cc +++ b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer_unittest.cc
@@ -13,7 +13,6 @@ #include "chrome/browser/ash/policy/server_backed_state/server_backed_device_state.h" #include "chrome/browser/prefs/browser_prefs.h" #include "chrome/common/pref_names.h" -#include "chromeos/attestation/mock_attestation_flow.h" #include "chromeos/system/fake_statistics_provider.h" #include "chromeos/system/statistics_provider.h" #include "chromeos/tpm/stub_install_attributes.h" @@ -41,12 +40,10 @@ DeviceCloudPolicyInitializerTest() : device_cloud_policy_initializer_(&local_state_, nullptr, - nullptr, &install_attributes_, nullptr, nullptr, nullptr, - nullptr, &statistics_provider_) { RegisterLocalState(local_state_.registry()); statistics_provider_.SetMachineStatistic(
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_handler.cc b/chrome/browser/ash/policy/enrollment/enrollment_handler.cc index 37814f99..4cca67c 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_handler.cc +++ b/chrome/browser/ash/policy/enrollment/enrollment_handler.cc
@@ -222,7 +222,7 @@ chromeos::InstallAttributes* install_attributes, ServerBackedStateKeysBroker* state_keys_broker, chromeos::attestation::AttestationFlow* attestation_flow, - SigningService* signing_service, + std::unique_ptr<SigningService> signing_service, std::unique_ptr<CloudPolicyClient> client, scoped_refptr<base::SequencedTaskRunner> background_task_runner, ActiveDirectoryJoinDelegate* ad_join_delegate, @@ -236,7 +236,7 @@ install_attributes_(install_attributes), state_keys_broker_(state_keys_broker), attestation_flow_(attestation_flow), - signing_service_(signing_service), + signing_service_(std::move(signing_service)), client_(std::move(client)), background_task_runner_(background_task_runner), ad_join_delegate_(ad_join_delegate), @@ -488,7 +488,7 @@ if (status == chromeos::attestation::ATTESTATION_SUCCESS) { client_->RegisterWithCertificate(*register_params_, client_id_, dm_auth_.Clone(), pem_certificate_chain, - sub_organization_, signing_service_); + sub_organization_, signing_service_.get()); } else { ReportResult(EnrollmentStatus::ForStatus( EnrollmentStatus::REGISTRATION_CERT_FETCH_FAILED));
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_handler.h b/chrome/browser/ash/policy/enrollment/enrollment_handler.h index ed6842d..4819ec9 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_handler.h +++ b/chrome/browser/ash/policy/enrollment/enrollment_handler.h
@@ -71,7 +71,7 @@ chromeos::InstallAttributes* install_attributes, ServerBackedStateKeysBroker* state_keys_broker, chromeos::attestation::AttestationFlow* attestation_flow, - SigningService* signing_service, + std::unique_ptr<SigningService> signing_service, std::unique_ptr<CloudPolicyClient> client, scoped_refptr<base::SequencedTaskRunner> background_task_runner, ActiveDirectoryJoinDelegate* ad_join_delegate, @@ -214,7 +214,8 @@ chromeos::InstallAttributes* install_attributes_; ServerBackedStateKeysBroker* state_keys_broker_; chromeos::attestation::AttestationFlow* attestation_flow_; - SigningService* signing_service_; + // SigningService to be used by |client_| to register with. + std::unique_ptr<SigningService> signing_service_; std::unique_ptr<CloudPolicyClient> client_; scoped_refptr<base::SequencedTaskRunner> background_task_runner_; ActiveDirectoryJoinDelegate* ad_join_delegate_ = nullptr;
diff --git a/chrome/browser/browsing_data/counters/site_settings_counter.cc b/chrome/browser/browsing_data/counters/site_settings_counter.cc index da52f8b9..cbb39f89d 100644 --- a/chrome/browser/browsing_data/counters/site_settings_counter.cc +++ b/chrome/browser/browsing_data/counters/site_settings_counter.cc
@@ -102,10 +102,10 @@ for (const ProtocolHandler& handler : handlers) hosts.insert(handler.url().host()); - std::vector<std::string> blacklisted_sites = + std::vector<std::string> never_prompt_sites = ChromeTranslateClient::CreateTranslatePrefs(pref_service_) ->GetNeverPromptSitesBetween(period_start, period_end); - for (const auto& site : blacklisted_sites) + for (const auto& site : never_prompt_sites) hosts.insert(site); ReportResult(hosts.size() + empty_host_pattern);
diff --git a/chrome/browser/chrome_browser_field_trials.cc b/chrome/browser/chrome_browser_field_trials.cc index 42059591..1e140d9 100644 --- a/chrome/browser/chrome_browser_field_trials.cc +++ b/chrome/browser/chrome_browser_field_trials.cc
@@ -30,6 +30,7 @@ #include "base/android/build_info.h" #include "base/android/bundle_utils.h" #include "base/task/thread_pool/environment_config.h" +#include "chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.h" #include "chrome/browser/chrome_browser_field_trials_mobile.h" #include "chrome/browser/flags/android/cached_feature_flags.h" #include "chrome/browser/flags/android/chrome_feature_list.h" @@ -176,6 +177,16 @@ ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( kBackgroundThreadPoolTrial, group_name); } + + { + // MobileIdentityConsistencyFRESynthetic field trial. + static constexpr char kMobileIdentityConsistencyFRETrial[] = + "MobileIdentityConsistencyFRESynthetic"; + const std::string group = + fre_mobile_identity_consistency_field_trial::GetFREFieldTrialGroup(); + ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( + kMobileIdentityConsistencyFRETrial, group); + } #endif // defined(OS_ANDROID) }
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.cc b/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.cc index bab18b6..a4a4d78 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.cc +++ b/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.cc
@@ -35,12 +35,17 @@ CfmMemoryDetails::~CfmMemoryDetails() = default; void CfmMemoryDetails::OnDetailsAvailable() { + if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { + content::GetUIThreadTaskRunner({})->PostTask( + FROM_HERE, base::BindOnce(&CfmMemoryDetails::OnDetailsAvailable, this)); + return; + } + CollectProcessInformation(); - // Now go do expensive memory lookups in a thread pool. - base::ThreadPool::PostTask( + + // Now Post to UI thread for expensive extensions information lookups. + content::GetUIThreadTaskRunner({})->PostTask( FROM_HERE, - {base::MayBlock(), base::TaskPriority::BEST_EFFORT, - base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, base::BindOnce(&CfmMemoryDetails::CollectExtensionsInformation, this)); }
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/BUILD.gn b/chrome/browser/chromeos/extensions/telemetry/api/BUILD.gn index f78fb3a..1fecc3e 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/BUILD.gn +++ b/chrome/browser/chromeos/extensions/telemetry/api/BUILD.gn
@@ -12,6 +12,8 @@ source_set("api") { sources = [ + "diagnostics_api.cc", + "diagnostics_api.h", "telemetry_api.cc", "telemetry_api.h", ] @@ -44,7 +46,12 @@ source_set("browser_tests") { testonly = true defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] - sources = [ "telemetry_api_browsertest.cc" ] + sources = [ + "base_telemetry_extension_browser_test.cc", + "base_telemetry_extension_browser_test.h", + "diagnostics_api_browsertest.cc", + "telemetry_api_browsertest.cc", + ] deps = [ ":api",
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.cc b/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.cc new file mode 100644 index 0000000..4f75f01 --- /dev/null +++ b/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.cc
@@ -0,0 +1,48 @@ +// Copyright 2021 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 "chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h" + +#include "extensions/test/result_catcher.h" +#include "extensions/test/test_extension_dir.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace chromeos { + +BaseTelemetryExtensionBrowserTest::BaseTelemetryExtensionBrowserTest() = + default; +BaseTelemetryExtensionBrowserTest::~BaseTelemetryExtensionBrowserTest() = + default; + +void BaseTelemetryExtensionBrowserTest::CreateExtensionAndRunServiceWorker( + const std::string& service_worker_content) { + extensions::TestExtensionDir test_dir; + test_dir.WriteManifest(R"( + { + // Sample telemetry extension public key. Currently, this is the only + // allowed extension to declare "chromeos_system_extension" key. + // See //chrome/common/chromeos/extensions/api/_manifest_features.json + "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt2CwI94nqAQzLTBHSIwtkMlkoRyhu27rmkDsBneMprscOzl4524Y0bEA+0RSjNZB+kZgP6M8QAZQJHCpAzULXa49MooDDIdzzmqQswswguAALm2FS7XP2N0p2UYQneQce4Wehq/C5Yr65mxasAgjXgDWlYBwV3mgiISDPXI/5WG94TM2Z3PDQePJ91msDAjN08jdBme3hAN976yH3Q44M7cP1r+OWRkZGwMA6TSQjeESEuBbkimaLgPIyzlJp2k6jwuorG5ujmbAGFiTQoSDFBFCjwPEtywUMLKcZjH4fD76pcIQIdkuuzRQCVyuImsGzm1cmGosJ/Z4iyb80c1ytwIDAQAB", + "name": "Test Telemetry Extension", + "version": "1", + "manifest_version": 3, + "chromeos_system_extension": {}, + "background": { + "service_worker": "sw.js" + } + } + )"); + test_dir.WriteFile(FILE_PATH_LITERAL("sw.js"), service_worker_content); + + // Must be initialised before loading extension. + extensions::ResultCatcher result_catcher; + + const extensions::Extension* extension = + LoadExtension(test_dir.UnpackedPath()); + ASSERT_TRUE(extension); + + EXPECT_TRUE(result_catcher.GetNextResult()) << result_catcher.message(); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h b/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h new file mode 100644 index 0000000..86376ecf --- /dev/null +++ b/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h
@@ -0,0 +1,32 @@ +// Copyright 2021 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 CHROME_BROWSER_CHROMEOS_EXTENSIONS_TELEMETRY_API_BASE_TELEMETRY_EXTENSION_BROWSER_TEST_H_ +#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_TELEMETRY_API_BASE_TELEMETRY_EXTENSION_BROWSER_TEST_H_ + +#include <string> + +#include "chrome/browser/extensions/extension_browsertest.h" + +namespace chromeos { + +class BaseTelemetryExtensionBrowserTest + : public extensions::ExtensionBrowserTest { + public: + BaseTelemetryExtensionBrowserTest(); + ~BaseTelemetryExtensionBrowserTest() override; + + BaseTelemetryExtensionBrowserTest(const BaseTelemetryExtensionBrowserTest&) = + delete; + BaseTelemetryExtensionBrowserTest& operator=( + const BaseTelemetryExtensionBrowserTest&) = delete; + + protected: + void CreateExtensionAndRunServiceWorker( + const std::string& service_worker_content); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_TELEMETRY_API_BASE_TELEMETRY_EXTENSION_BROWSER_TEST_H_
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api.cc b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api.cc new file mode 100644 index 0000000..bc0fa0e --- /dev/null +++ b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api.cc
@@ -0,0 +1,88 @@ +// Copyright 2021 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 "chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api.h" + +#include <memory> +#include <string> +#include <utility> + +#include "base/bind.h" +#include "base/values.h" +#include "chrome/common/chromeos/extensions/api/diagnostics.h" + +namespace chromeos { + +// runBatteryCapacityRoutine --------------------------------------------------- + +namespace { + +api::os_diagnostics::RoutineStatus ConvertRoutineStatus( + health::mojom::DiagnosticRoutineStatusEnum status) { + switch (status) { + case health::mojom::DiagnosticRoutineStatusEnum::kReady: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_READY; + case health::mojom::DiagnosticRoutineStatusEnum::kRunning: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_RUNNING; + case health::mojom::DiagnosticRoutineStatusEnum::kWaiting: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_WAITING; + case health::mojom::DiagnosticRoutineStatusEnum::kPassed: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_PASSED; + case health::mojom::DiagnosticRoutineStatusEnum::kFailed: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_FAILED; + case health::mojom::DiagnosticRoutineStatusEnum::kError: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_ERROR; + case health::mojom::DiagnosticRoutineStatusEnum::kCancelled: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_CANCELLED; + case health::mojom::DiagnosticRoutineStatusEnum::kFailedToStart: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_FAILED_TO_START; + case health::mojom::DiagnosticRoutineStatusEnum::kRemoved: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_REMOVED; + case health::mojom::DiagnosticRoutineStatusEnum::kCancelling: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_CANCELLING; + case health::mojom::DiagnosticRoutineStatusEnum::kUnsupported: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_UNSUPPORTED; + case health::mojom::DiagnosticRoutineStatusEnum::kNotRun: + return api::os_diagnostics::RoutineStatus::ROUTINE_STATUS_NOT_RUN; + } +} + +} // namespace + +OsDiagnosticsRunBatteryCapacityRoutineFunction:: + OsDiagnosticsRunBatteryCapacityRoutineFunction() + : diagnostics_service_( + remote_diagnostics_service_.BindNewPipeAndPassReceiver()) {} +OsDiagnosticsRunBatteryCapacityRoutineFunction:: + ~OsDiagnosticsRunBatteryCapacityRoutineFunction() = default; + +ExtensionFunction::ResponseAction +OsDiagnosticsRunBatteryCapacityRoutineFunction::Run() { + // We don't need Unretained() or WeakPtr because ExtensionFunction is + // ref-counted. + auto cb = base::BindOnce( + &OsDiagnosticsRunBatteryCapacityRoutineFunction::OnResult, this); + + remote_diagnostics_service_->RunBatteryCapacityRoutine(std::move(cb)); + + return RespondLater(); +} + +void OsDiagnosticsRunBatteryCapacityRoutineFunction::OnResult( + health::mojom::RunRoutineResponsePtr ptr) { + if (!ptr) { + // |ptr| should never be null, otherwise Mojo validation will fail. + // However it's safer to handle it in case of API changes. + Respond(Error("API internal error")); + return; + } + + api::os_diagnostics::RunRoutineResponse result; + result.id = ptr->id; + result.status = ConvertRoutineStatus(ptr->status); + Respond(ArgumentList( + api::os_diagnostics::RunBatteryCapacityRoutine::Results::Create(result))); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api.h b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api.h new file mode 100644 index 0000000..118f7a9 --- /dev/null +++ b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api.h
@@ -0,0 +1,43 @@ +// Copyright 2021 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 CHROME_BROWSER_CHROMEOS_EXTENSIONS_TELEMETRY_API_DIAGNOSTICS_API_H_ +#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_TELEMETRY_API_DIAGNOSTICS_API_H_ + +#include "chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom.h" +#include "chromeos/components/telemetry_extension_ui/services/diagnostics_service.h" +#include "extensions/browser/extension_function.h" +#include "extensions/browser/extension_function_histogram_value.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace chromeos { + +class OsDiagnosticsRunBatteryCapacityRoutineFunction + : public ExtensionFunction { + public: + DECLARE_EXTENSION_FUNCTION("os.diagnostics.runBatteryCapacityRoutine", + OS_DIAGNOSTICS_RUNBATTERYCAPACITYROUTINE) + + OsDiagnosticsRunBatteryCapacityRoutineFunction(); + OsDiagnosticsRunBatteryCapacityRoutineFunction( + const OsDiagnosticsRunBatteryCapacityRoutineFunction&) = delete; + OsDiagnosticsRunBatteryCapacityRoutineFunction& operator=( + const OsDiagnosticsRunBatteryCapacityRoutineFunction&) = delete; + + private: + ~OsDiagnosticsRunBatteryCapacityRoutineFunction() override; + + // ExtensionFunction: + ResponseAction Run() override; + + void OnResult(health::mojom::RunRoutineResponsePtr ptr); + + mojo::Remote<health::mojom::DiagnosticsService> remote_diagnostics_service_; + + DiagnosticsService diagnostics_service_; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_TELEMETRY_API_DIAGNOSTICS_API_H_
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api_browsertest.cc b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api_browsertest.cc new file mode 100644 index 0000000..6085c6d --- /dev/null +++ b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api_browsertest.cc
@@ -0,0 +1,29 @@ +// Copyright 2021 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 "chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h" +#include "chromeos/dbus/cros_healthd/fake_cros_healthd_client.h" +#include "content/public/test/browser_test.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace chromeos { + +using TelemetryExtensionDiagnosticsApiBrowserTest = + BaseTelemetryExtensionBrowserTest; + +IN_PROC_BROWSER_TEST_F(TelemetryExtensionDiagnosticsApiBrowserTest, + RunBatteryCapacityRoutineSuccess) { + CreateExtensionAndRunServiceWorker(R"( + chrome.test.runTests([ + async function runCapacityRoutine() { + const response = + await chrome.os.diagnostics.runBatteryCapacityRoutine(); + chrome.test.assertEq({id: 0, status: "ready"}, response); + chrome.test.succeed(); + } + ]); + )"); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/telemetry_api_browsertest.cc b/chrome/browser/chromeos/extensions/telemetry/api/telemetry_api_browsertest.cc index 9ac28a6..50dfeb2 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/telemetry_api_browsertest.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/telemetry_api_browsertest.cc
@@ -2,65 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/extensions/telemetry/api/telemetry_api.h" - #include <string> #include <utility> -#include "chrome/browser/extensions/extension_browsertest.h" +#include "chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h" #include "chromeos/dbus/cros_healthd/fake_cros_healthd_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/debug_daemon/fake_debug_daemon_client.h" #include "chromeos/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" #include "content/public/test/browser_test.h" -#include "extensions/test/result_catcher.h" -#include "extensions/test/test_extension_dir.h" #include "testing/gtest/include/gtest/gtest.h" namespace chromeos { -class TelemetryExtensionBrowserTest : public extensions::ExtensionBrowserTest { - public: - TelemetryExtensionBrowserTest() {} - ~TelemetryExtensionBrowserTest() override {} +using TelemetryExtensionTelemetryApiBrowserTest = + BaseTelemetryExtensionBrowserTest; - TelemetryExtensionBrowserTest(const TelemetryExtensionBrowserTest&) = delete; - TelemetryExtensionBrowserTest& operator=( - const TelemetryExtensionBrowserTest&) = delete; - - protected: - void CreateExtensionAndRunServiceWorker( - const std::string& service_worker_content) { - extensions::TestExtensionDir test_dir; - test_dir.WriteManifest(R"( - { - // Sample telemetry extension public key. Currently, this is the only - // allowed extension to declare "chromeos_system_extension" key. - // See //chrome/common/chromeos/extensions/api/_manifest_features.json - "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt2CwI94nqAQzLTBHSIwtkMlkoRyhu27rmkDsBneMprscOzl4524Y0bEA+0RSjNZB+kZgP6M8QAZQJHCpAzULXa49MooDDIdzzmqQswswguAALm2FS7XP2N0p2UYQneQce4Wehq/C5Yr65mxasAgjXgDWlYBwV3mgiISDPXI/5WG94TM2Z3PDQePJ91msDAjN08jdBme3hAN976yH3Q44M7cP1r+OWRkZGwMA6TSQjeESEuBbkimaLgPIyzlJp2k6jwuorG5ujmbAGFiTQoSDFBFCjwPEtywUMLKcZjH4fD76pcIQIdkuuzRQCVyuImsGzm1cmGosJ/Z4iyb80c1ytwIDAQAB", - "name": "Test Telemetry Extension", - "version": "1", - "manifest_version": 3, - "chromeos_system_extension": {}, - "background": { - "service_worker": "sw.js" - } - } - )"); - test_dir.WriteFile(FILE_PATH_LITERAL("sw.js"), service_worker_content); - - // Must be initialised before loading extension. - extensions::ResultCatcher result_catcher; - - const extensions::Extension* extension = - LoadExtension(test_dir.UnpackedPath()); - ASSERT_TRUE(extension); - - EXPECT_TRUE(result_catcher.GetNextResult()) << result_catcher.message(); - } -}; - -IN_PROC_BROWSER_TEST_F(TelemetryExtensionBrowserTest, GetVpdInfoError) { +IN_PROC_BROWSER_TEST_F(TelemetryExtensionTelemetryApiBrowserTest, + GetVpdInfoError) { CreateExtensionAndRunServiceWorker(R"( chrome.test.runTests([ async function getVpdInfo() { @@ -74,7 +33,8 @@ )"); } -IN_PROC_BROWSER_TEST_F(TelemetryExtensionBrowserTest, GetVpdInfoSuccess) { +IN_PROC_BROWSER_TEST_F(TelemetryExtensionTelemetryApiBrowserTest, + GetVpdInfoSuccess) { // Configure fake cros_healthd response. { auto telemetry_info = cros_healthd::mojom::TelemetryInfo::New(); @@ -130,7 +90,8 @@ } // namespace -IN_PROC_BROWSER_TEST_F(TelemetryExtensionBrowserTest, GetOemDataError) { +IN_PROC_BROWSER_TEST_F(TelemetryExtensionTelemetryApiBrowserTest, + GetOemDataError) { DBusThreadManager::GetSetterForTesting()->SetDebugDaemonClient( std::make_unique<TestDebugDaemonClient>()); @@ -147,7 +108,8 @@ )"); } -IN_PROC_BROWSER_TEST_F(TelemetryExtensionBrowserTest, GetOemDataSuccess) { +IN_PROC_BROWSER_TEST_F(TelemetryExtensionTelemetryApiBrowserTest, + GetOemDataSuccess) { CreateExtensionAndRunServiceWorker(R"( chrome.test.runTests([ async function getOemData() {
diff --git a/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationDialog.java b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationDialog.java index a093c3b..a0947178 100644 --- a/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationDialog.java +++ b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationDialog.java
@@ -239,11 +239,16 @@ // For that, set left padding exactly what is needed to push the first item to the center, but // set a smaller padding for the following items (except the last item which has more padding on // the right). + // + // NOTE: When reading template and padding dimentions don't use |getDimensionPixelSize| as it + // rounds up the pixel size which brings the sum of template width and right/left paddings 1px + // larger than the screensize. Because of this the scrolling doesn't work as expected and the + // selected template doesn't update correctly. See crbug.com/1240537. private void setPadding(boolean isFirst, boolean isLast, View itemView) { int dialogWidth = getActivity().getResources().getDisplayMetrics().widthPixels; - int templateWidth = getActivity().getResources().getDimensionPixelSize(R.dimen.note_width); + int templateWidth = (int) getActivity().getResources().getDimension(R.dimen.note_width); int defaultPadding = - getActivity().getResources().getDimensionPixelSize(R.dimen.note_side_padding); + (int) getActivity().getResources().getDimension(R.dimen.note_side_padding); int paddingLeft = defaultPadding; if (isFirst) { paddingLeft =
diff --git a/chrome/browser/engagement/site_engagement_helper_browsertest.cc b/chrome/browser/engagement/site_engagement_helper_browsertest.cc index 6203536..9a1693a 100644 --- a/chrome/browser/engagement/site_engagement_helper_browsertest.cc +++ b/chrome/browser/engagement/site_engagement_helper_browsertest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/engagement/site_engagement_helper.h" +#include "components/site_engagement/content/site_engagement_helper.h" #include <memory>
diff --git a/chrome/browser/engagement/site_engagement_service_unittest.cc b/chrome/browser/engagement/site_engagement_service_unittest.cc index 181fc22..aad5a01f 100644 --- a/chrome/browser/engagement/site_engagement_service_unittest.cc +++ b/chrome/browser/engagement/site_engagement_service_unittest.cc
@@ -21,7 +21,6 @@ #include "build/build_config.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/engagement/history_aware_site_engagement_service.h" -#include "chrome/browser/engagement/site_engagement_helper.h" #include "chrome/browser/engagement/site_engagement_service_factory.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" @@ -34,6 +33,7 @@ #include "components/history/core/test/test_history_database.h" #include "components/prefs/pref_service.h" #include "components/site_engagement/content/engagement_type.h" +#include "components/site_engagement/content/site_engagement_helper.h" #include "components/site_engagement/content/site_engagement_metrics.h" #include "components/site_engagement/content/site_engagement_observer.h" #include "components/site_engagement/content/site_engagement_score.h"
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/BUILD.gn b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/BUILD.gn index b6afff1..3b8f746 100644 --- a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/BUILD.gn +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/BUILD.gn
@@ -2,10 +2,19 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/chromeos/ui_mode.gni") + source_set("common") { - public = [ "signals_decorator.h" ] + public = [ + "common_signals_decorator.h", + "signals_decorator.h", + ] + + sources = [ "common_signals_decorator.cc" ] public_deps = [ "//chrome/browser/enterprise/connectors/device_trust/attestation/common/proto:attestation_ca_proto" ] + + deps = [ "//components/policy/core/common" ] } source_set("test_support") { @@ -21,3 +30,19 @@ "//testing/gmock", ] } + +source_set("unit_tests") { + testonly = true + sources = [ "common_signals_decorator_unittest.cc" ] + + deps = [ + ":common", + "//build:chromeos_buildflags", + "//chrome/browser/enterprise/connectors/device_trust/attestation/common/proto:attestation_ca_proto", + "//testing/gtest", + ] + + if (is_chromeos_ash) { + deps += [ "//chromeos/system" ] + } +}
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc new file mode 100644 index 0000000..76cb527 --- /dev/null +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc
@@ -0,0 +1,22 @@ +// Copyright 2021 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 "chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.h" + +#include "components/policy/core/common/cloud/cloud_policy_util.h" + +namespace enterprise_connectors { + +CommonSignalsDecorator::CommonSignalsDecorator() = default; +CommonSignalsDecorator::~CommonSignalsDecorator() = default; + +void CommonSignalsDecorator::Decorate(DeviceTrustSignals& signals) { + signals.set_os(policy::GetOSPlatform()); + signals.set_os_version(policy::GetOSVersion()); + signals.set_device_model(policy::GetDeviceModel()); + signals.set_device_manufacturer(policy::GetDeviceManufacturer()); + signals.set_display_name(policy::GetDeviceName()); +} + +} // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.h b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.h new file mode 100644 index 0000000..d71f1364 --- /dev/null +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.h
@@ -0,0 +1,24 @@ +// Copyright 2021 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 CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_SIGNALS_DECORATORS_COMMON_COMMON_SIGNALS_DECORATOR_H_ +#define CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_SIGNALS_DECORATORS_COMMON_COMMON_SIGNALS_DECORATOR_H_ + +#include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/signals_decorator.h" + +namespace enterprise_connectors { + +// Definition of the SignalsDecorator common to all platforms. +class CommonSignalsDecorator : public SignalsDecorator { + public: + CommonSignalsDecorator(); + ~CommonSignalsDecorator() override; + + // SignalsDecorator: + void Decorate(DeviceTrustSignals& signals) override; +}; + +} // namespace enterprise_connectors + +#endif // CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_SIGNALS_DECORATORS_COMMON_COMMON_SIGNALS_DECORATOR_H_
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator_unittest.cc b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator_unittest.cc new file mode 100644 index 0000000..a17147d --- /dev/null +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator_unittest.cc
@@ -0,0 +1,33 @@ +// Copyright 2021 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 "chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.h" + +#include "build/chromeos_buildflags.h" +#include "chrome/browser/enterprise/connectors/device_trust/attestation/common/proto/device_trust_attestation_ca.pb.h" +#include "testing/gtest/include/gtest/gtest.h" + +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "chromeos/system/fake_statistics_provider.h" +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + +namespace enterprise_connectors { + +TEST(CommonSignalsDecoratorTest, Decorate) { +#if BUILDFLAG(IS_CHROMEOS_ASH) + chromeos::system::ScopedFakeStatisticsProvider fake_statistics_provider; +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + CommonSignalsDecorator decorator; + + DeviceTrustSignals signals; + decorator.Decorate(signals); + + EXPECT_TRUE(signals.has_os()); + EXPECT_TRUE(signals.has_os_version()); + EXPECT_TRUE(signals.has_device_model()); + EXPECT_TRUE(signals.has_device_manufacturer()); + EXPECT_TRUE(signals.has_display_name()); +} + +} // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc b/chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc index c1fc3be..04175088 100644 --- a/chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc +++ b/chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.h" +#include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.h" #include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/signals_decorator.h" #include "chrome/browser/enterprise/connectors/device_trust/signals/signals_service.h" #include "chrome/browser/enterprise/connectors/device_trust/signals/signals_service_impl.h" @@ -12,6 +13,9 @@ std::unique_ptr<SignalsService> CreateSignalsService() { std::vector<std::unique_ptr<SignalsDecorator>> decorators; + + decorators.push_back(std::make_unique<CommonSignalsDecorator>()); + return std::make_unique<SignalsServiceImpl>(std::move(decorators)); }
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 431f1b6..b1c1643 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -588,12 +588,6 @@ "expiry_milestone": 93 }, { - "name": "chrome-cleanup-scan-completed-notification", - "owners": ["rainhard", "msramek", - "chrome-friendly-settings@google.com"], - "expiry_milestone": 92 - }, - { "name": "chrome-labs", "owners": ["elainechien", "robliao"], "expiry_milestone": 107 @@ -691,7 +685,7 @@ { "name": "colr-v1-fonts", "owners": [ "drott", "layout-dev@chromium.org" ], - "expiry_milestone": 94 + "expiry_milestone": 102 }, { "name": "commander", @@ -722,15 +716,6 @@ "expiry_milestone": 96 }, { - "name": "content-settings-redesign", - "owners": [ - "harrisonsean", - "msramek", - "chrome-friendly-settings@google.com" - ], - "expiry_milestone": 93 - }, - { "name": "context-menu-google-lens-chip", "owners": [ "yusuyoutube@google.com", "benwgold@google.com", "lens-chrome@google.com" ], "expiry_milestone": 96 @@ -4769,15 +4754,6 @@ "expiry_milestone": 95 }, { - "name": "safety-check-chrome-cleaner-child", - "owners": [ - "rainhard", - "msramek", - "chrome-friendly-settings@google.com" - ], - "expiry_milestone": 94 - }, - { "name": "safety-tips", "owners": [ "jdeblasio", "estark", "meacer" ], "expiry_milestone": 89
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 5d0d9b0..2d92a0a 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2121,10 +2121,6 @@ "permission requests or content will have the notification permission " "revoked."; -const char kContentSettingsRedesignName[] = "Content settings page redesign"; -const char kContentSettingsRedesignDescription[] = - "Enables a new content settings page UI."; - const char kReadLaterNewBadgePromoName[] = "Reading list 'New' badge promo"; const char kReadLaterNewBadgePromoDescription[] = "Causes a 'New' badge to appear on the entry point for adding to the " @@ -3719,12 +3715,6 @@ "Calculate window occlusion on Windows will be used in the future " "to throttle and potentially unload foreground tabs in occluded windows"; -const char kChromeCleanupScanCompletedNotificationName[] = - "Chrome cleanup scan completion notification"; -const char kChromeCleanupScanCompletedNotificationDescription[] = - "Allows you to be notified when a Chrome cleaner scan you started " - "completes."; - const char kD3D11VideoDecoderName[] = "D3D11 Video Decoder"; const char kD3D11VideoDecoderDescription[] = "Enables D3D11VideoDecoder for hardware accelerated video decoding."; @@ -3752,11 +3742,6 @@ const char kRunVideoCaptureServiceInBrowserProcessDescription[] = "Run the video capture service in the browser process."; -const char kSafetyCheckChromeCleanerChildName[] = - "Chrome Cleanup Tool in safety check"; -const char kSafetyCheckChromeCleanerChildDescription[] = - "Enables the Chrome Cleanup Tool child in safety check."; - const char kUseAngleName[] = "Choose ANGLE graphics backend"; const char kUseAngleDescription[] = "Choose the graphics backend for ANGLE. D3D11 is used on most Windows "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 895a20c..cd82848 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1206,9 +1206,6 @@ extern const char kAbusiveNotificationPermissionRevocationName[]; extern const char kAbusiveNotificationPermissionRevocationDescription[]; -extern const char kContentSettingsRedesignName[]; -extern const char kContentSettingsRedesignDescription[]; - extern const char kReadLaterFlagId[]; extern const char kReadLaterName[]; extern const char kReadLaterDescription[]; @@ -2123,9 +2120,6 @@ extern const char kCalculateNativeWinOcclusionName[]; extern const char kCalculateNativeWinOcclusionDescription[]; -extern const char kChromeCleanupScanCompletedNotificationName[]; -extern const char kChromeCleanupScanCompletedNotificationDescription[]; - extern const char kD3D11VideoDecoderName[]; extern const char kD3D11VideoDecoderDescription[]; @@ -2141,9 +2135,6 @@ extern const char kRunVideoCaptureServiceInBrowserProcessName[]; extern const char kRunVideoCaptureServiceInBrowserProcessDescription[]; -extern const char kSafetyCheckChromeCleanerChildName[]; -extern const char kSafetyCheckChromeCleanerChildDescription[]; - extern const char kUseAngleName[]; extern const char kUseAngleDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 7011688..f527bbcc 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -324,7 +324,6 @@ &query_tiles::features::kQueryTilesSegmentation, &reading_list::switches::kReadLater, &send_tab_to_self::kSendTabToSelfV2, - &signin::kMobileIdentityConsistencyFRE, &signin::kMobileIdentityConsistencyPromos, &switches::kDeprecateMenagerieAPI, &switches::kForceStartupSigninPromo,
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java index 9aa3e14..4ad14ff 100644 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -394,7 +394,6 @@ public static final String MESSAGES_FOR_ANDROID_INFRASTRUCTURE = "MessagesForAndroidInfrastructure"; public static final String MESSAGES_FOR_ANDROID_READER_MODE = "MessagesForAndroidReaderMode"; - public static final String MOBILE_IDENTITY_CONSISTENCY_M2 = "MobileIdentityConsistencyFRE"; public static final String MOBILE_IDENTITY_CONSISTENCY_PROMOS = "MobileIdentityConsistencyPromos"; public static final String MODAL_PERMISSION_DIALOG_VIEW = "ModalPermissionDialogView";
diff --git a/chrome/browser/media/webrtc/webrtc_logging_controller.cc b/chrome/browser/media/webrtc/webrtc_logging_controller.cc index 0c76fe2a..26eb33bc 100644 --- a/chrome/browser/media/webrtc/webrtc_logging_controller.cc +++ b/chrome/browser/media/webrtc/webrtc_logging_controller.cc
@@ -187,6 +187,7 @@ base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(std::move(stop_rtp_dump_callback_), true, true)); + stop_rtp_dump_callback_.Reset(); } rtp_dump_handler_->StopOngoingDumps( @@ -216,7 +217,13 @@ void WebRtcLoggingController::StartRtpDump(RtpDumpType type, GenericDoneCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(!stop_rtp_dump_callback_); + + if (stop_rtp_dump_callback_) { + DCHECK(rtp_dump_handler_); + FireGenericDoneCallback(std::move(callback), false, + "RTP dump already started."); + return; + } content::RenderProcessHost* host = content::RenderProcessHost::FromID(render_process_id_); @@ -256,6 +263,7 @@ base::BindOnce(std::move(stop_rtp_dump_callback_), type == RTP_DUMP_INCOMING || type == RTP_DUMP_BOTH, type == RTP_DUMP_OUTGOING || type == RTP_DUMP_BOTH)); + stop_rtp_dump_callback_.Reset(); } rtp_dump_handler_->StopDump(type, std::move(callback)); @@ -418,7 +426,6 @@ UploadDoneCallback callback, const base::FilePath& log_directory) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (rtp_dump_handler_) { if (stop_rtp_dump_callback_) { base::SequencedTaskRunnerHandle::Get()->PostTask(
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java index 1ed0631..2a6fe75b 100644 --- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java +++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
@@ -406,6 +406,13 @@ "Chrome.NTPExploreOfflineCard.HasExploreOfflineContent"; /** + * Indicates whether First run field trial was enabled during FRE. This experiment is configured + * by client side code in {@link + * org.chromium.chrome.browser.signin.services.FREMobileIdentityConsistencyFieldTrial}. + */ + public static final String FIRST_RUN_FIELD_TRIAL_GROUP = "Chrome.FirstRun.FieldTrialEnabled"; + + /** * The Feed articles visibility. This value is used as a pre-native cache and should be kept * consistent with {@link Pref.ARTICLES_LIST_VISIBLE}. */ @@ -1068,6 +1075,7 @@ DEFAULT_BROWSER_PROMO_SESSION_COUNT, EXPLORE_OFFLINE_CONTENT_AVAILABILITY_STATUS, FEED_ARTICLES_LIST_VISIBLE, + FIRST_RUN_FIELD_TRIAL_GROUP, FIRST_RUN_SKIPPED_BY_POLICY, FLAGS_CACHED.pattern(), FLAGS_CACHED_SAFE_VALUES_BOOL.pattern(),
diff --git a/chrome/browser/resources/settings/chrome_cleanup_page/BUILD.gn b/chrome/browser/resources/settings/chrome_cleanup_page/BUILD.gn index 72b6e46..2f0987e 100644 --- a/chrome/browser/resources/settings/chrome_cleanup_page/BUILD.gn +++ b/chrome/browser/resources/settings/chrome_cleanup_page/BUILD.gn
@@ -23,7 +23,6 @@ "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//ui/webui/resources/js:assert.m", "//ui/webui/resources/js:i18n_behavior.m", - "//ui/webui/resources/js:load_time_data.m", "//ui/webui/resources/js:web_ui_listener_behavior.m", ] externs_list = [ "$externs_path/settings_private.js" ]
diff --git a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html index e8a667b..632c1061 100644 --- a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html +++ b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html
@@ -43,14 +43,6 @@ disabled$="[[!cleanupEnabled_]]"> </settings-checkbox> </div> - <div class="cr-row continuation"> - <settings-checkbox hidden="[[!showNotificationPermission_]]" - id="chromeCleanupShowNotificationControl" - pref="{{notificationEnabledPref_}}" - sub-label="$i18n{chromeCleanupExplanationNotificationPermission}" - disabled$="[[!cleanupEnabled_]]"> - </settings-checkbox> - </div> <cr-expand-button aria-label="[[showItemsLinkLabel_]]" class="cr-row"
diff --git a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js index c6f5df4..9798005 100644 --- a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js +++ b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js
@@ -18,7 +18,6 @@ import {assert} from 'chrome://resources/js/assert.m.js'; import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/js/i18n_behavior.m.js'; -import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {WebUIListenerBehavior, WebUIListenerBehaviorInterface} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -69,7 +68,6 @@ SHOW_LOGS_PERMISSIONS: 1 << 0, WAITING_FOR_RESULT: 1 << 1, SHOW_ITEMS_TO_REMOVE: 1 << 2, - SHOW_NOTIFICATION_PERMISSION: 1 << 3, }; /** @@ -210,12 +208,6 @@ }, /** @private */ - showNotificationPermission_: { - type: Boolean, - value: false, - }, - - /** @private */ showItemsToRemove_: { type: Boolean, value: false, @@ -567,12 +559,6 @@ (flags & ChromeCleanupCardFlags.WAITING_FOR_RESULT) !== 0; this.showItemsToRemove_ = (flags & ChromeCleanupCardFlags.SHOW_ITEMS_TO_REMOVE) !== 0; - this.showNotificationPermission_ = - (flags & ChromeCleanupCardFlags.SHOW_NOTIFICATION_PERMISSION) !== 0 && - loadTimeData.valueExists( - 'chromeCleanupScanCompletedNotificationEnabled') && - loadTimeData.getBoolean( - 'chromeCleanupScanCompletedNotificationEnabled'); // Files to remove list should only be expandable if details are being // shown, otherwise it will add extra padding at the bottom of the card. @@ -595,8 +581,7 @@ */ startScanning_() { this.browserProxy_.startScanning( - this.$.chromeCleanupLogsUploadControl.checked, - this.$.chromeCleanupShowNotificationControl.checked); + this.$.chromeCleanupLogsUploadControl.checked); } /** @@ -714,8 +699,7 @@ title: this.i18n('chromeCleanupTitleFindAndRemove'), explanation: this.i18n('chromeCleanupExplanationFindAndRemove'), actionButton: actionButtons.FIND, - flags: ChromeCleanupCardFlags.SHOW_LOGS_PERMISSIONS | - ChromeCleanupCardFlags.SHOW_NOTIFICATION_PERMISSION, + flags: ChromeCleanupCardFlags.SHOW_LOGS_PERMISSIONS, } ], [
diff --git a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_proxy.js b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_proxy.js index 1d02de1..20835e7 100644 --- a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_proxy.js +++ b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_proxy.js
@@ -17,9 +17,8 @@ /** * Starts scanning the user's computer. * @param {boolean} logsUploadEnabled - * @param {boolean} notificationEnabled */ - startScanning(logsUploadEnabled, notificationEnabled) {} + startScanning(logsUploadEnabled) {} /** * Starts a cleanup on the user's computer. @@ -70,9 +69,7 @@ } /** @override */ - startScanning(logsUploadEnabled, notificationEnabled) { - // TODO(1087263): Send the |notificationEnabled| parameter which indicates - // if a completion dialog should be shown once the scan completed. + startScanning(logsUploadEnabled) { chrome.send('startScanning', [logsUploadEnabled]); }
diff --git a/chrome/browser/resources/settings/privacy_page/cookies_page.html b/chrome/browser/resources/settings/privacy_page/cookies_page.html index f57a99d..7dc7cc4 100644 --- a/chrome/browser/resources/settings/privacy_page/cookies_page.html +++ b/chrome/browser/resources/settings/privacy_page/cookies_page.html
@@ -148,7 +148,7 @@ on-click="onSiteDataClick_" label="$i18n{siteSettingsCookieLink}" role-description="$i18n{subpageArrowRoleDescription}"> </cr-link-row> - <div id="exceptionHeader" hidden="[[!enableContentSettingsRedesign_]]"> + <div id="exceptionHeader"> <h2>$i18n{siteSettingsCustomizedBehaviors}</h2> </div> <site-list id="allowExceptionsList"
diff --git a/chrome/browser/resources/settings/privacy_page/cookies_page.js b/chrome/browser/resources/settings/privacy_page/cookies_page.js index 6344282e..7c228eb 100644 --- a/chrome/browser/resources/settings/privacy_page/cookies_page.js +++ b/chrome/browser/resources/settings/privacy_page/cookies_page.js
@@ -105,14 +105,6 @@ value: CookiePrimarySetting, }, - /** @private */ - enableContentSettingsRedesign_: { - type: Boolean, - value() { - return loadTimeData.getBoolean('enableContentSettingsRedesign'); - } - }, - /** * Used for HTML bindings. This is defined as a property rather than * within the ready callback, because the value needs to be available
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html index aec277e4..19e8ebe 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -133,85 +133,53 @@ <settings-subpage page-title="$i18n{siteSettingsAutomaticDownloads}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsAutomaticDownloadsDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.AUTOMATIC_DOWNLOADS]]" - allow-option-label= - "$i18n{siteSettingsAutomaticDownloadsAllowed}" - allow-option-icon="cr:file-download" - block-option-label - ="$i18n{siteSettingsAutomaticDownloadsBlocked}" - block-option-icon="settings:file-download-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.AUTOMATIC_DOWNLOADS]]" - allow-header= - "$i18n{siteSettingsAutomaticDownloadsAllowedExceptions}" - block-header= - "$i18n{siteSettingsAutomaticDownloadsBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsAutoDownloadBlock}" - toggle-on-label= - "$i18n{siteSettingsAutoDownloadAskRecommended}" - category="[[contentSettingsTypesEnum_.AUTOMATIC_DOWNLOADS]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.AUTOMATIC_DOWNLOADS]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsAutomaticDownloadsDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.AUTOMATIC_DOWNLOADS]]" + allow-option-label= + "$i18n{siteSettingsAutomaticDownloadsAllowed}" + allow-option-icon="cr:file-download" + block-option-label + ="$i18n{siteSettingsAutomaticDownloadsBlocked}" + block-option-icon="settings:file-download-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.AUTOMATIC_DOWNLOADS]]" + allow-header= + "$i18n{siteSettingsAutomaticDownloadsAllowedExceptions}" + block-header= + "$i18n{siteSettingsAutomaticDownloadsBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/backgroundSync" no-search> <settings-subpage page-title="$i18n{siteSettingsBackgroundSync}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsBackgroundSyncDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.BACKGROUND_SYNC]]" - allow-option-label= - "$i18n{siteSettingsBackgroundSyncAllowed}" - allow-option-icon="cr:sync" - block-option-label="$i18n{siteSettingsBackgroundSyncBlocked}" - block-option-sub-label= - "$i18n{siteSettingsBackgroundSyncBlockedSubLabel}" - block-option-icon="settings:sync-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.BACKGROUND_SYNC]]" - allow-header= - "$i18n{siteSettingsBackgroundSyncAllowedExceptions}" - block-header= - "$i18n{siteSettingsBackgroundSyncBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsBackgroundSyncBlock}" - toggle-on-label= - "$i18n{siteSettingsAllowRecentlyClosedSitesRecommended}" - category="[[contentSettingsTypesEnum_.BACKGROUND_SYNC]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.BACKGROUND_SYNC]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsBackgroundSyncDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.BACKGROUND_SYNC]]" + allow-option-label= + "$i18n{siteSettingsBackgroundSyncAllowed}" + allow-option-icon="cr:sync" + block-option-label="$i18n{siteSettingsBackgroundSyncBlocked}" + block-option-sub-label= + "$i18n{siteSettingsBackgroundSyncBlockedSubLabel}" + block-option-icon="settings:sync-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.BACKGROUND_SYNC]]" + allow-header= + "$i18n{siteSettingsBackgroundSyncAllowedExceptions}" + block-header= + "$i18n{siteSettingsBackgroundSyncBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/camera" no-search> @@ -220,41 +188,25 @@ search-term="{{searchFilter_}}"> <media-picker label="$i18n{siteSettingsCameraLabel}" type="camera"> </media-picker> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsCameraDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.CAMERA]]" - allow-option-label= - "$i18n{siteSettingsCameraAllowed}" - allow-option-icon="cr:videocam" - block-option-label="$i18n{siteSettingsCameraBlocked}" - block-option-sub-label= - "$i18n{siteSettingsCameraBlockedSubLabel}" - block-option-icon="settings:videocam-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.CAMERA]]" read-only-list - allow-header="$i18n{siteSettingsCameraAllowedExceptions}" - block-header="$i18n{siteSettingsCameraBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - category="[[contentSettingsTypesEnum_.CAMERA]]" - toggle-off-label="$i18n{siteSettingsBlocked}" - toggle-on-label= - "$i18n{siteSettingsAskBeforeAccessingRecommended}"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.CAMERA]]" read-only-list - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsCameraDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.CAMERA]]" + allow-option-label= + "$i18n{siteSettingsCameraAllowed}" + allow-option-icon="cr:videocam" + block-option-label="$i18n{siteSettingsCameraBlocked}" + block-option-sub-label= + "$i18n{siteSettingsCameraBlockedSubLabel}" + block-option-icon="settings:videocam-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.CAMERA]]" read-only-list + allow-header="$i18n{siteSettingsCameraAllowedExceptions}" + block-header="$i18n{siteSettingsCameraBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" if="[[enablePrivacyReview_]]"> @@ -295,39 +247,24 @@ <settings-subpage page-title="$i18n{siteSettingsCategoryImages}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsImagesDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.IMAGES]]" - allow-option-label="$i18n{siteSettingsImagesAllowed}" - allow-option-icon="settings:photo" - block-option-label="$i18n{siteSettingsImagesBlocked}" - block-option-sub-label= - "$i18n{siteSettingsImagesBlockedSubLabel}" - block-option-icon="settings:photo-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.IMAGES]]" - allow-header="$i18n{siteSettingsImagesAllowedExceptions}" - block-header="$i18n{siteSettingsImagedBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - category="[[contentSettingsTypesEnum_.IMAGES]]" - toggle-off-label="$i18n{siteSettingsDontShowImages}" - toggle-on-label="$i18n{siteSettingsShowAllRecommended}"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.IMAGES]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsImagesDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.IMAGES]]" + allow-option-label="$i18n{siteSettingsImagesAllowed}" + allow-option-icon="settings:photo" + block-option-label="$i18n{siteSettingsImagesBlocked}" + block-option-sub-label= + "$i18n{siteSettingsImagesBlockedSubLabel}" + block-option-icon="settings:photo-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.IMAGES]]" + allow-header="$i18n{siteSettingsImagesAllowedExceptions}" + block-header="$i18n{siteSettingsImagedBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/insecureContent" no-search> @@ -341,67 +278,40 @@ <div class="cr-row first secondary"> $i18n{siteSettingsInsecureContentBlock} </div> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.MIXEDSCRIPT]]" - allow-header= - "$i18n{siteSettingsInsecureContentAllowedExceptions}" - block-header= - "$i18n{siteSettingsInsecureContentBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.MIXEDSCRIPT]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.MIXEDSCRIPT]]" + allow-header= + "$i18n{siteSettingsInsecureContentAllowedExceptions}" + block-header= + "$i18n{siteSettingsInsecureContentBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/location" no-search> <settings-subpage page-title="$i18n{siteSettingsCategoryLocation}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsLocationDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.GEOLOCATION]]" - allow-option-label= - "$i18n{siteSettingsLocationAllowed}" - allow-option-icon="settings:location-on" - block-option-label="$i18n{siteSettingsLocationBlocked}" - block-option-sub-label= - "$i18n{siteSettingsLocationBlockedSubLabel}" - block-option-icon="settings:location-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.GEOLOCATION]]" - read-only-list - allow-header="$i18n{siteSettingsLocationAllowedExceptions}" - block-header="$i18n{siteSettingsLocationBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsBlocked}" - toggle-on-label= - "$i18n{siteSettingsAskBeforeAccessingRecommended}" - category="[[contentSettingsTypesEnum_.GEOLOCATION]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.GEOLOCATION]]" - read-only-list - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsLocationDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.GEOLOCATION]]" + allow-option-label= + "$i18n{siteSettingsLocationAllowed}" + allow-option-icon="settings:location-on" + block-option-label="$i18n{siteSettingsLocationBlocked}" + block-option-sub-label= + "$i18n{siteSettingsLocationBlockedSubLabel}" + block-option-icon="settings:location-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.GEOLOCATION]]" + read-only-list + allow-header="$i18n{siteSettingsLocationAllowedExceptions}" + block-header="$i18n{siteSettingsLocationBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/handlers" no-search> @@ -414,109 +324,78 @@ </template> <template is="dom-if" route-path="/content/zoomLevels" no-search> <settings-subpage page-title="$i18n{siteSettingsCategoryZoomLevels}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsZoomLevelsDescription} - </div> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsZoomLevelsDescription} + </div> <zoom-levels></zoom-levels> </settings-subpage> </template> <template is="dom-if" route-path="/content/pdfDocuments" no-search> <settings-subpage page-title="$i18n{siteSettingsPdfDocuments}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="radio-group"> - <div class="secondary">$i18n{siteSettingsPdfsDescription}</div> - <h2>$i18n{siteSettingsDefaultBehavior}</h2> - <div class="secondary radio-sub-heading"> - $i18n{siteSettingsDefaultBehaviorDescription} - </div> - <settings-radio-group - pref="{{prefs.plugins.always_open_pdf_externally}}" - selectable-elements="settings-collapse-radio-button"> - <settings-collapse-radio-button no-collapse - pref="[[prefs.plugins.always_open_pdf_externally]]" - label="$i18n{siteSettingsPdfsAllowed}" - name="true" - disabled$="[[isGuest_]]" - icon="cr:file-download"> - </settings-collapse-radio-button> - <settings-collapse-radio-button no-collapse - pref="[[prefs.plugins.always_open_pdf_externally]]" - label="$i18n{siteSettingsPdfsBlocked}" - name="false" - disabled$="[[isGuest_]]" - icon="settings:open-in-browser"> - </settings-collapse-radio-button> - </settings-radio-group> + <div class="radio-group"> + <div class="secondary">$i18n{siteSettingsPdfsDescription}</div> + <h2>$i18n{siteSettingsDefaultBehavior}</h2> + <div class="secondary radio-sub-heading"> + $i18n{siteSettingsDefaultBehaviorDescription} </div> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <settings-pdf-documents prefs="{{prefs}}"></settings-pdf-documents> - </template> + <settings-radio-group + pref="{{prefs.plugins.always_open_pdf_externally}}" + selectable-elements="settings-collapse-radio-button"> + <settings-collapse-radio-button no-collapse + pref="[[prefs.plugins.always_open_pdf_externally]]" + label="$i18n{siteSettingsPdfsAllowed}" + name="true" + disabled$="[[isGuest_]]" + icon="cr:file-download"> + </settings-collapse-radio-button> + <settings-collapse-radio-button no-collapse + pref="[[prefs.plugins.always_open_pdf_externally]]" + label="$i18n{siteSettingsPdfsBlocked}" + name="false" + disabled$="[[isGuest_]]" + icon="settings:open-in-browser"> + </settings-collapse-radio-button> + </settings-radio-group> + </div> </settings-subpage> </template> <template is="dom-if" route-path="/content/javascript" no-search> <settings-subpage page-title="$i18n{siteSettingsCategoryJavascript}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsJavascriptDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.JAVASCRIPT]]" - allow-option-label="$i18n{siteSettingsJavascriptAllowed}" - allow-option-icon="settings:code" - block-option-label="$i18n{siteSettingsJavascriptBlocked}" - block-option-icon="settings:code-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.JAVASCRIPT]]" - allow-header="$i18n{siteSettingsJavascriptAllowedExceptions}" - block-header="$i18n{siteSettingsJavascriptBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsBlocked}" - toggle-on-label="$i18n{siteSettingsAllowedRecommended}" - category="[[contentSettingsTypesEnum_.JAVASCRIPT]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.JAVASCRIPT]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsJavascriptDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.JAVASCRIPT]]" + allow-option-label="$i18n{siteSettingsJavascriptAllowed}" + allow-option-icon="settings:code" + block-option-label="$i18n{siteSettingsJavascriptBlocked}" + block-option-icon="settings:code-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.JAVASCRIPT]]" + allow-header="$i18n{siteSettingsJavascriptAllowedExceptions}" + block-header="$i18n{siteSettingsJavascriptBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/sound" no-search> <settings-subpage page-title="$i18n{siteSettingsSound}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsSoundDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.SOUND]]" - allow-option-label="$i18n{siteSettingsSoundAllowed}" - allow-option-icon="settings:volume-up" - block-option-label="$i18n{siteSettingsSoundBlocked}" - block-option-sub-label="$i18n{siteSettingsSoundBlockedSubLabel}" - block-option-icon="settings:volume-up-off"> - </settings-category-default-radio-group> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsSoundBlock}" - toggle-on-label="$i18n{siteSettingsSoundAllowRecommended}" - category="[[contentSettingsTypesEnum_.SOUND]]"> - </category-default-setting> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsSoundDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.SOUND]]" + allow-option-label="$i18n{siteSettingsSoundAllowed}" + allow-option-icon="settings:volume-up" + block-option-label="$i18n{siteSettingsSoundBlocked}" + block-option-sub-label="$i18n{siteSettingsSoundBlockedSubLabel}" + block-option-icon="settings:volume-up-off"> + </settings-category-default-radio-group> <settings-toggle-button id="block-autoplay-setting" class="hr" @@ -527,22 +406,12 @@ on-settings-boolean-control-change="onBlockAutoplayToggleChange_" no-set-pref> </settings-toggle-button> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.SOUND]]" - allow-header="$i18n{siteSettingsSoundAllowedExceptions}" - block-header="$i18n{siteSettingsSoundBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.SOUND]]" - block-header="$i18n{siteSettingsBlockSound}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.SOUND]]" + allow-header="$i18n{siteSettingsSoundAllowedExceptions}" + block-header="$i18n{siteSettingsSoundBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/microphone" no-search> @@ -551,199 +420,120 @@ search-term="{{searchFilter_}}"> <media-picker label="$i18n{siteSettingsMicrophoneLabel}" type="mic"> </media-picker> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsMicDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.MIC]]" - allow-option-label= - "$i18n{siteSettingsMicAllowed}" - allow-option-icon="cr:mic" - block-option-label="$i18n{siteSettingsMicBlocked}" - block-option-sub-label="$i18n{siteSettingsMicBlockedSubLabel}" - block-option-icon="settings:mic-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.MIC]]" read-only-list - allow-header="$i18n{siteSettingsMicAllowedExceptions}" - block-header="$i18n{siteSettingsMicBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - category="[[contentSettingsTypesEnum_.MIC]]" - toggle-off-label="$i18n{siteSettingsBlocked}" - toggle-on-label= - "$i18n{siteSettingsAskBeforeAccessingRecommended}"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.MIC]]" read-only-list - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsMicDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.MIC]]" + allow-option-label= + "$i18n{siteSettingsMicAllowed}" + allow-option-icon="cr:mic" + block-option-label="$i18n{siteSettingsMicBlocked}" + block-option-sub-label="$i18n{siteSettingsMicBlockedSubLabel}" + block-option-icon="settings:mic-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.MIC]]" read-only-list + allow-header="$i18n{siteSettingsMicAllowedExceptions}" + block-header="$i18n{siteSettingsMicBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/sensors" no-search> <settings-subpage page-title="$i18n{siteSettingsSensors}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsMotionSensorsDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.SENSORS]]" - allow-option-label="$i18n{siteSettingsMotionSensorsAllowed}" - allow-option-icon="settings:sensors" - block-option-label="$i18n{siteSettingsMotionSensorsBlocked}" - block-option-sub-label= - "$i18n{siteSettingsMotionSensorsBlockedSubLabel}" - block-option-icon="settings:sensors-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.SENSORS]]" read-only-list - allow-header="$i18n{siteSettingsMotionSensorsAllowedExceptions}" - block-header="$i18n{siteSettingsMotionSensorsBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsSensorsBlock}" - toggle-on-label="$i18n{siteSettingsSensorsAllow}" - category="[[contentSettingsTypesEnum_.SENSORS]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.SENSORS]]" read-only-list - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsMotionSensorsDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.SENSORS]]" + allow-option-label="$i18n{siteSettingsMotionSensorsAllowed}" + allow-option-icon="settings:sensors" + block-option-label="$i18n{siteSettingsMotionSensorsBlocked}" + block-option-sub-label= + "$i18n{siteSettingsMotionSensorsBlockedSubLabel}" + block-option-icon="settings:sensors-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.SENSORS]]" read-only-list + allow-header="$i18n{siteSettingsMotionSensorsAllowedExceptions}" + block-header="$i18n{siteSettingsMotionSensorsBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/notifications" no-search> <settings-subpage page-title="$i18n{siteSettingsCategoryNotifications}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div id="notificationRadioGroup" class="radio-group"> - <div class="secondary"> - $i18n{siteSettingsNotificationsDescription} - </div> - <h2>$i18n{siteSettingsDefaultBehavior}</h2> - <div id="notificationSubHeading" - class="secondary radio-sub-heading"> - $i18n{siteSettingsDefaultBehaviorDescription} - </div> - <settings-radio-group - pref="{{prefs.generated.notification}}" - selectable-elements="settings-collapse-radio-button"> - <settings-collapse-radio-button no-collapse - name="[[notificationSettingEnum_.ASK]]" + <div id="notificationRadioGroup" class="radio-group"> + <div class="secondary"> + $i18n{siteSettingsNotificationsDescription} + </div> + <h2>$i18n{siteSettingsDefaultBehavior}</h2> + <div id="notificationSubHeading" + class="secondary radio-sub-heading"> + $i18n{siteSettingsDefaultBehaviorDescription} + </div> + <settings-radio-group + pref="{{prefs.generated.notification}}" + selectable-elements="settings-collapse-radio-button"> + <settings-collapse-radio-button no-collapse + name="[[notificationSettingEnum_.ASK]]" + pref="[[prefs.generated.notification]]" + label="$i18n{siteSettingsNotificationsAllowed}" + icon="settings:notifications"> + </settings-collapse-radio-button> + <template is="dom-if" + if="[[enableQuietNotificationPromptsSetting_]]"> + <settings-collapse-radio-button no-collapse class="two-line" + name="[[notificationSettingEnum_.QUIETER_MESSAGING]]" pref="[[prefs.generated.notification]]" - label="$i18n{siteSettingsNotificationsAllowed}" + label="$i18n{siteSettingsNotificationsPartial}" + sub-label= + "$i18n{siteSettingsNotificationsPartialSubLabel}" icon="settings:notifications"> </settings-collapse-radio-button> - <template is="dom-if" - if="[[enableQuietNotificationPromptsSetting_]]"> - <settings-collapse-radio-button no-collapse class="two-line" - name="[[notificationSettingEnum_.QUIETER_MESSAGING]]" - pref="[[prefs.generated.notification]]" - label="$i18n{siteSettingsNotificationsPartial}" - sub-label= - "$i18n{siteSettingsNotificationsPartialSubLabel}" - icon="settings:notifications"> - </settings-collapse-radio-button> - </template> - <settings-collapse-radio-button no-collapse class="two-line" - name="[[notificationSettingEnum_.BLOCK]]" - pref="[[prefs.generated.notification]]" - label="$i18n{siteSettingsNotificationsBlocked}" - sub-label="$i18n{siteSettingsNotificationsBlockedSubLabel}" - icon="settings:notifications-off"> - </settings-collapse-radio-button> - </settings-radio-group> - </div> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.NOTIFICATIONS]]" - allow-header="$i18n{siteSettingsNotificationsAllowedExceptions}" - block-header="$i18n{siteSettingsNotificationsBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <template is="dom-if" - if="[[enableQuietNotificationPromptsSetting_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsNotificationsAsk}" - toggle-on-label="$i18n{siteSettingsNotificationsAsk}" - category="[[contentSettingsTypesEnum_.NOTIFICATIONS]]" - sub-option-pref="{{prefs.profile.content_settings.enable_quiet_permission_ui.notifications}}" - sub-option-label= - "$i18n{siteSettingsEnableQuietNotificationPrompts}" - sub-option-mode="pref"> - </category-default-setting> - </template> - <template is="dom-if" - if="[[!enableQuietNotificationPromptsSetting_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsCategoryNotifications}" - toggle-on-label="$i18n{siteSettingsCategoryNotifications}" - toggle-off-description="$i18n{siteSettingsNotificationsBlock}" - toggle-on-description="$i18n{siteSettingsNotificationsAsk}" - category="[[contentSettingsTypesEnum_.NOTIFICATIONS]]" - sub-option-mode="none"> - </category-default-setting> - </template> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.NOTIFICATIONS]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + </template> + <settings-collapse-radio-button no-collapse class="two-line" + name="[[notificationSettingEnum_.BLOCK]]" + pref="[[prefs.generated.notification]]" + label="$i18n{siteSettingsNotificationsBlocked}" + sub-label="$i18n{siteSettingsNotificationsBlockedSubLabel}" + icon="settings:notifications-off"> + </settings-collapse-radio-button> + </settings-radio-group> + </div> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.NOTIFICATIONS]]" + allow-header="$i18n{siteSettingsNotificationsAllowedExceptions}" + block-header="$i18n{siteSettingsNotificationsBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/popups" no-search> <settings-subpage page-title="$i18n{siteSettingsCategoryPopups}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsPopupsDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.POPUPS]]" - allow-option-label="$i18n{siteSettingsPopupsAllowed}" - allow-option-icon="cr:open-in-new" - block-option-label="$i18n{siteSettingsPopupsBlocked}" - block-option-icon="settings:open-in-new-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.POPUPS]]" - allow-header="$i18n{siteSettingsPopupsAllowedExceptions}" - block-header="$i18n{siteSettingsPopupsBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - category="[[contentSettingsTypesEnum_.POPUPS]]" - toggle-off-label="$i18n{siteSettingsBlockedRecommended}" - toggle-on-label="$i18n{siteSettingsAllowed}"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.POPUPS]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsPopupsDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.POPUPS]]" + allow-option-label="$i18n{siteSettingsPopupsAllowed}" + allow-option-icon="cr:open-in-new" + block-option-label="$i18n{siteSettingsPopupsBlocked}" + block-option-icon="settings:open-in-new-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.POPUPS]]" + allow-header="$i18n{siteSettingsPopupsAllowedExceptions}" + block-header="$i18n{siteSettingsPopupsBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" if="[[enableSafeBrowsingSubresourceFilter_]]" @@ -752,39 +542,23 @@ <settings-subpage page-title="$i18n{siteSettingsAds}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsAdsDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.ADS]]" - allow-option-label="$i18n{siteSettingsAdsAllowed}" - allow-option-icon="settings:ads" - block-option-label="$i18n{siteSettingsAdsBlocked}" - block-option-icon="settings:ads-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.ADS]]" - read-only-list - allow-header="$i18n{siteSettingsAdsAllowedExceptions}" - block-header="$i18n{siteSettingsAdsBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - category="[[contentSettingsTypesEnum_.ADS]]" - toggle-off-label="$i18n{siteSettingsAdsBlockRecommended}" - toggle-on-label="$i18n{siteSettingsAllowed}"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.ADS]]" - read-only-list - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsAdsDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.ADS]]" + allow-option-label="$i18n{siteSettingsAdsAllowed}" + allow-option-icon="settings:ads" + block-option-label="$i18n{siteSettingsAdsBlocked}" + block-option-icon="settings:ads-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.ADS]]" + read-only-list + allow-header="$i18n{siteSettingsAdsAllowedExceptions}" + block-header="$i18n{siteSettingsAdsBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> </template> @@ -792,65 +566,38 @@ <settings-subpage page-title="$i18n{siteSettingsMidiDevices}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsMidiDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.MIDI_DEVICES]]" - allow-option-label= - "$i18n{siteSettingsMidiAllowed}" - allow-option-icon="settings:midi" - block-option-label="$i18n{siteSettingsMidiBlocked}" - block-option-icon="settings:midi-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.MIDI_DEVICES]]" - read-only-list - allow-header="$i18n{siteSettingsMidiAllowedExceptions}" - block-header="$i18n{siteSettingsMidiBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsMidiDevicesBlock}" - toggle-on-label= - "$i18n{siteSettingsMidiDevicesAskRecommended}" - category="[[contentSettingsTypesEnum_.MIDI_DEVICES]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.MIDI_DEVICES]]" - read-only-list - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsMidiDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.MIDI_DEVICES]]" + allow-option-label= + "$i18n{siteSettingsMidiAllowed}" + allow-option-icon="settings:midi" + block-option-label="$i18n{siteSettingsMidiBlocked}" + block-option-icon="settings:midi-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.MIDI_DEVICES]]" + read-only-list + allow-header="$i18n{siteSettingsMidiAllowedExceptions}" + block-header="$i18n{siteSettingsMidiBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/usbDevices" no-search> <settings-subpage page-title="$i18n{siteSettingsUsbDevices}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsUsbDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.USB_DEVICES]]" - allow-option-label="$i18n{siteSettingsUsbAllowed}" - allow-option-icon="settings:usb" - block-option-label="$i18n{siteSettingsUsbBlocked}" - block-option-icon="settings:usb-off"> - </settings-category-default-radio-group> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsUsbDevicesBlock}" - toggle-on-label= - "$i18n{siteSettingsUsbDevicesAskRecommended}" - category="[[contentSettingsTypesEnum_.USB_DEVICES]]"> - </category-default-setting> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsUsbDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.USB_DEVICES]]" + allow-option-label="$i18n{siteSettingsUsbAllowed}" + allow-option-icon="settings:usb" + block-option-label="$i18n{siteSettingsUsbBlocked}" + block-option-icon="settings:usb-off"> + </settings-category-default-radio-group> <chooser-exception-list category="[[contentSettingsTypesEnum_.USB_DEVICES]]" chooser-type="[[chooserTypeEnum_.USB_DEVICES]]"> @@ -859,27 +606,17 @@ </template> <template is="dom-if" route-path="/content/serialPorts" no-search> <settings-subpage page-title="$i18n{siteSettingsSerialPorts}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsSerialPortsDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.SERIAL_PORTS]]" - allow-option-label= - "$i18n{siteSettingsSerialPortsAllowed}" - allow-option-icon="settings:serial-port" - block-option-label="$i18n{siteSettingsSerialPortsBlocked}" - block-option-icon="settings:serial-port-off"> - </settings-category-default-radio-group> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsSerialPortsBlock}" - toggle-on-label= - "$i18n{siteSettingsSerialPortsAskRecommended}" - category="[[contentSettingsTypesEnum_.SERIAL_PORTS]]"> - </category-default-setting> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsSerialPortsDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.SERIAL_PORTS]]" + allow-option-label= + "$i18n{siteSettingsSerialPortsAllowed}" + allow-option-icon="settings:serial-port" + block-option-label="$i18n{siteSettingsSerialPortsBlocked}" + block-option-icon="settings:serial-port-off"> + </settings-category-default-radio-group> <chooser-exception-list category="[[contentSettingsTypesEnum_.SERIAL_PORTS]]" chooser-type="[[chooserTypeEnum_.SERIAL_PORTS]]"> @@ -889,7 +626,6 @@ <template is="dom-if" if="[[enableWebBluetoothNewPermissionsBackend_]]"> <template is="dom-if" route-path="/content/bluetoothDevices" no-search> <settings-subpage page-title="$i18n{siteSettingsBluetoothDevices}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> <div class="content-settings-header secondary"> $i18n{siteSettingsBluetoothDevicesDescription} </div> @@ -902,15 +638,6 @@ "$i18n{siteSettingsBluetoothDevicesBlocked}" block-option-icon="settings:bluetooth-off"> </settings-category-default-radio-group> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsBluetoothDevicesBlock}" - toggle-on-label= - "$i18n{siteSettingsBluetoothDevicesAskRecommended}" - category="[[contentSettingsTypesEnum_.BLUETOOTH_DEVICES]]"> - </category-default-setting> - </template> <chooser-exception-list category="[[contentSettingsTypesEnum_.BLUETOOTH_DEVICES]]" chooser-type="[[chooserTypeEnum_.BLUETOOTH_DEVICES]]"> @@ -921,68 +648,41 @@ <template is="dom-if" route-path="/content/filesystem" no-search> <settings-subpage page-title="$i18n{siteSettingsFileSystemWrite}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsFileSystemWriteDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.FILE_SYSTEM_WRITE]]" - allow-option-label= - "$i18n{siteSettingsFileSystemWriteAllowed}" - allow-option-icon="settings:save-original" - block-option-label= - "$i18n{siteSettingsFileSystemWriteBlocked}" - block-option-icon="settings:file-editing-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.FILE_SYSTEM_WRITE]]" - read-only-list - block-header= - "$i18n{siteSettingsFileSystemWriteBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsFileSystemWriteBlock}" - toggle-on-label= - "$i18n{siteSettingsFileSystemWriteAskRecommended}" - category="[[contentSettingsTypesEnum_.FILE_SYSTEM_WRITE]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.FILE_SYSTEM_WRITE]]" - read-only-list - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsFileSystemWriteDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.FILE_SYSTEM_WRITE]]" + allow-option-label= + "$i18n{siteSettingsFileSystemWriteAllowed}" + allow-option-icon="settings:save-original" + block-option-label= + "$i18n{siteSettingsFileSystemWriteBlocked}" + block-option-icon="settings:file-editing-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.FILE_SYSTEM_WRITE]]" + read-only-list + block-header= + "$i18n{siteSettingsFileSystemWriteBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/hidDevices" no-search> <settings-subpage page-title="$i18n{siteSettingsHidDevices}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsHidDevicesDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.HID_DEVICES]]" - allow-option-label= - "$i18n{siteSettingsHidDevicesAllowed}" - allow-option-icon="settings:hid-device" - block-option-label= - "$i18n{siteSettingsHidDevicesBlocked}" - block-option-icon="settings:hid-device-off"> - </settings-category-default-radio-group> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsHidDevicesBlock}" - toggle-on-label= - "$i18n{siteSettingsHidDevicesAskRecommended}" - category="[[contentSettingsTypesEnum_.HID_DEVICES]]"> - </category-default-setting> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsHidDevicesDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.HID_DEVICES]]" + allow-option-label= + "$i18n{siteSettingsHidDevicesAllowed}" + allow-option-icon="settings:hid-device" + block-option-label= + "$i18n{siteSettingsHidDevicesBlocked}" + block-option-icon="settings:hid-device-off"> + </settings-category-default-radio-group> <chooser-exception-list category="[[contentSettingsTypesEnum_.HID_DEVICES]]" chooser-type="[[chooserTypeEnum_.HID_DEVICES]]"> @@ -1016,95 +716,61 @@ search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> </if> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="radio-group"> - <div class="secondary"> - $i18n{siteSettingsProtectedContentDescription} - </div> - <h2>$i18n{siteSettingsDefaultBehavior}</h2> - <div class="secondary radio-sub-heading"> - $i18n{siteSettingsDefaultBehaviorDescription} - </div> - <settings-radio-group - pref="{{prefs.webkit.webprefs.encrypted_media_enabled}}" - selectable-elements="settings-collapse-radio-button"> - <settings-collapse-radio-button no-collapse - pref="[[prefs.webkit.webprefs.encrypted_media_enabled]]" - label="$i18n{siteSettingsProtectedContentAllowed}" - name="true" - disabled$="[[isGuest_]]" - icon="settings:protected-content"> - </settings-collapse-radio-button> - <settings-collapse-radio-button no-collapse - pref="[[prefs.webkit.webprefs.encrypted_media_enabled]]" - label="$i18n{siteSettingsProtectedContentBlocked}" - sub-label= - "$i18n{siteSettingsProtectedContentBlockedSubLabel}" - name="false" - disabled$="[[isGuest_]]" - icon="settings:protected-content-off"> - </settings-collapse-radio-button> - </settings-radio-group> + <div class="radio-group"> + <div class="secondary"> + $i18n{siteSettingsProtectedContentDescription} </div> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <settings-toggle-button - pref="{{prefs.webkit.webprefs.encrypted_media_enabled}}" - label="[[getProtectedContentLabel_( - prefs.webkit.webprefs.encrypted_media_enabled.value)]]" - disabled$="[[isGuest_]]"> - </settings-toggle-button> - </template> + <h2>$i18n{siteSettingsDefaultBehavior}</h2> + <div class="secondary radio-sub-heading"> + $i18n{siteSettingsDefaultBehaviorDescription} + </div> + <settings-radio-group + pref="{{prefs.webkit.webprefs.encrypted_media_enabled}}" + selectable-elements="settings-collapse-radio-button"> + <settings-collapse-radio-button no-collapse + pref="[[prefs.webkit.webprefs.encrypted_media_enabled]]" + label="$i18n{siteSettingsProtectedContentAllowed}" + name="true" + disabled$="[[isGuest_]]" + icon="settings:protected-content"> + </settings-collapse-radio-button> + <settings-collapse-radio-button no-collapse + pref="[[prefs.webkit.webprefs.encrypted_media_enabled]]" + label="$i18n{siteSettingsProtectedContentBlocked}" + sub-label= + "$i18n{siteSettingsProtectedContentBlockedSubLabel}" + name="false" + disabled$="[[isGuest_]]" + icon="settings:protected-content-off"> + </settings-collapse-radio-button> + </settings-radio-group> + </div> <if expr="chromeos or is_win"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <settings-category-default-radio-group - header="$i18n{siteSettingsProtectedContentIdentifiers}" + <settings-category-default-radio-group + header="$i18n{siteSettingsProtectedContentIdentifiers}" + description= + "$i18n{siteSettingsProtectedContentIdentifiersExplanation}" + category="[[contentSettingsTypesEnum_.PROTECTED_CONTENT]]" + block-option-label= + "$i18n{siteSettingsProtectedContentIdentifiersBlocked}" + block-option-sub-label= + "$i18n{siteSettingsProtectedContentIdentifiersBlockedSubLabel}" + block-option-icon="settings:protected-content-off" + allow-option-label= + "$i18n{siteSettingsProtectedContentIdentifiersAllowed}" + allow-option-icon="settings:protected-content" + disabled$="[[isGuest_]]"> + </settings-category-default-radio-group> + <category-setting-exceptions description= - "$i18n{siteSettingsProtectedContentIdentifiersExplanation}" + "$i18n{siteSettingsCustomizedBehaviorsDescriptionShort}" category="[[contentSettingsTypesEnum_.PROTECTED_CONTENT]]" - block-option-label= - "$i18n{siteSettingsProtectedContentIdentifiersBlocked}" - block-option-sub-label= - "$i18n{siteSettingsProtectedContentIdentifiersBlockedSubLabel}" - block-option-icon="settings:protected-content-off" - allow-option-label= - "$i18n{siteSettingsProtectedContentIdentifiersAllowed}" - allow-option-icon="settings:protected-content" - disabled$="[[isGuest_]]"> - </settings-category-default-radio-group> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <div class="cr-row first two-line cr-padded-text"> - $i18n{siteSettingsProtectedContentIdentifiersExplanation} - </div> - <category-default-setting - category="[[contentSettingsTypesEnum_.PROTECTED_CONTENT]]" - toggle-off-label="$i18n{siteSettingsBlocked}" - toggle-on-label= - "$i18n{siteSettingsProtectedContentEnableIdentifiers}" - disabled$="[[isGuest_]]"> - </category-default-setting> - </template> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <category-setting-exceptions - description= - "$i18n{siteSettingsCustomizedBehaviorsDescriptionShort}" - category="[[contentSettingsTypesEnum_.PROTECTED_CONTENT]]" - allow-header= - "$i18n{siteSettingsProtectedContentIdentifiersAllowedExceptions}" - block-header= - "$i18n{siteSettingsProtectedContentIdentifiersBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.PROTECTED_CONTENT]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + allow-header= + "$i18n{siteSettingsProtectedContentIdentifiersAllowedExceptions}" + block-header= + "$i18n{siteSettingsProtectedContentIdentifiersBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </if> </settings-subpage> </template> @@ -1112,37 +778,22 @@ <settings-subpage page-title="$i18n{siteSettingsClipboard}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsClipboardDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.CLIPBOARD]]" - allow-option-label="$i18n{siteSettingsClipboardAllowed}" - allow-option-icon="settings:clipboard" - block-option-label="$i18n{siteSettingsClipboardBlocked}" - block-option-icon="settings:clipboard-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.CLIPBOARD]]" - allow-header="$i18n{siteSettingsClipboardAllowedExceptions}" - block-header="$i18n{siteSettingsClipboardBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsClipboardBlock}" - toggle-on-label="$i18n{siteSettingsClipboardAskRecommended}" - category="[[contentSettingsTypesEnum_.CLIPBOARD]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.CLIPBOARD]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsClipboardDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.CLIPBOARD]]" + allow-option-label="$i18n{siteSettingsClipboardAllowed}" + allow-option-icon="settings:clipboard" + block-option-label="$i18n{siteSettingsClipboardBlocked}" + block-option-icon="settings:clipboard-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.CLIPBOARD]]" + allow-header="$i18n{siteSettingsClipboardAllowedExceptions}" + block-header="$i18n{siteSettingsClipboardBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" if="[[enablePaymentHandlerContentSetting_]]"> @@ -1150,41 +801,25 @@ <settings-subpage page-title="$i18n{siteSettingsPaymentHandler}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsPaymentHandlersDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.PAYMENT_HANDLER]]" - allow-option-label= - "$i18n{siteSettingsPaymentHandlersAllowed}" - allow-option-icon="settings:payment-handler" - block-option-label="$i18n{siteSettingsPaymentHandlersBlocked}" - block-option-icon="settings:payment-handler-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.PAYMENT_HANDLER]]" - allow-header= - "$i18n{siteSettingsPaymentHandlersAllowedExceptions}" - block-header= - "$i18n{siteSettingsPaymentHandlersBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsPaymentHandlerBlock}" - toggle-on-label= - "$i18n{siteSettingsPaymentHandlerAllowRecommended}" - category="[[contentSettingsTypesEnum_.PAYMENT_HANDLER]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.PAYMENT_HANDLER]]" - block-header="$i18n{siteSettingsBlocked}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsPaymentHandlersDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.PAYMENT_HANDLER]]" + allow-option-label= + "$i18n{siteSettingsPaymentHandlersAllowed}" + allow-option-icon="settings:payment-handler" + block-option-label="$i18n{siteSettingsPaymentHandlersBlocked}" + block-option-icon="settings:payment-handler-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.PAYMENT_HANDLER]]" + allow-header= + "$i18n{siteSettingsPaymentHandlersAllowedExceptions}" + block-header= + "$i18n{siteSettingsPaymentHandlersBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> </template> @@ -1213,118 +848,69 @@ <settings-subpage page-title="$i18n{siteSettingsVr}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsVrDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.VR]]" - allow-option-label="$i18n{siteSettingsVrAllowed}" - allow-option-icon="settings:vr-headset" - block-option-label="$i18n{siteSettingsVrBlocked}" - block-option-icon="settings:vr-headset-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.VR]]" - read-only-list - allow-header="$i18n{siteSettingsVrAllowedExceptions}" - block-header="$i18n{siteSettingsVrBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsVrBlock}" - toggle-on-label= - "$i18n{siteSettingsVrAskRecommended}" - category="[[contentSettingsTypesEnum_.VR]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.VR]]" - read-only-list - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsVrDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.VR]]" + allow-option-label="$i18n{siteSettingsVrAllowed}" + allow-option-icon="settings:vr-headset" + block-option-label="$i18n{siteSettingsVrBlocked}" + block-option-icon="settings:vr-headset-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.VR]]" + read-only-list + allow-header="$i18n{siteSettingsVrAllowedExceptions}" + block-header="$i18n{siteSettingsVrBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/ar" no-search> <settings-subpage page-title="$i18n{siteSettingsAr}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsArDescription} - </div> - <!-- TODO(crbug.com/1196900): Fix redesign string when available.--> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.AR]]" - allow-option-label="$i18n{siteSettingsArAsk}" - allow-option-icon="settings:vr-headset" - block-option-label="$i18n{siteSettingsArBlock}" - block-option-icon="settings:vr-headset-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.AR]]" - read-only-list - allow-header="$i18n{siteSettingsArAllowedExceptions}" - block-header="$i18n{siteSettingsArBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsArBlock}" - toggle-on-label= - "$i18n{siteSettingsArAskRecommended}" - category="[[contentSettingsTypesEnum_.AR]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.AR]]" - read-only-list - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsArDescription} + </div> + <!-- TODO(crbug.com/1196900): Fix redesign string when available.--> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.AR]]" + allow-option-label="$i18n{siteSettingsArAsk}" + allow-option-icon="settings:vr-headset" + block-option-label="$i18n{siteSettingsArBlock}" + block-option-icon="settings:vr-headset-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.AR]]" + read-only-list + allow-header="$i18n{siteSettingsArAllowedExceptions}" + block-header="$i18n{siteSettingsArBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/idleDetection" no-search> <settings-subpage page-title="$i18n{siteSettingsIdleDetection}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsDeviceUseDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.IDLE_DETECTION]]" - allow-option-label="$i18n{siteSettingsDeviceUseAllowed}" - allow-option-icon="settings:devices" - block-option-label="$i18n{siteSettingsDeviceUseBlocked}" - block-option-icon="settings:devices-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.IDLE_DETECTION]]" - allow-header="$i18n{siteSettingsDeviceUseAllowedExceptions}" - block-header="$i18n{siteSettingsDeviceUseBlockedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsIdleDetectionBlock}" - toggle-on-label="$i18n{siteSettingsIdleDetectionAsk}" - category="[[contentSettingsTypesEnum_.IDLE_DETECTION]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.IDLE_DETECTION]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsDeviceUseDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.IDLE_DETECTION]]" + allow-option-label="$i18n{siteSettingsDeviceUseAllowed}" + allow-option-icon="settings:devices" + block-option-label="$i18n{siteSettingsDeviceUseBlocked}" + block-option-icon="settings:devices-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.IDLE_DETECTION]]" + allow-header="$i18n{siteSettingsDeviceUseAllowedExceptions}" + block-header="$i18n{siteSettingsDeviceUseBlockedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/windowPlacement" no-search> @@ -1349,76 +935,46 @@ <settings-subpage page-title="$i18n{fonts}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsFontsDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.FONT_ACCESS]]" - allow-option-label="$i18n{siteSettingsFontsAllowed}" - allow-option-icon="settings:font-access" - block-option-label="$i18n{siteSettingsFontsBlocked}" - block-option-icon="settings:font-access-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.FONT_ACCESS]]" - block-header="$i18n{siteSettingsFontsBlockedExceptions}" - allow-header="$i18n{siteSettingsFontsAllowedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsFontAccessBlock}" - toggle-on-label="$i18n{siteSettingsFontAccessAsk}" - category="[[contentSettingsTypesEnum_.FONT_ACCESS]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.FONT_ACCESS]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsFontsDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.FONT_ACCESS]]" + allow-option-label="$i18n{siteSettingsFontsAllowed}" + allow-option-icon="settings:font-access" + block-option-label="$i18n{siteSettingsFontsBlocked}" + block-option-icon="settings:font-access-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.FONT_ACCESS]]" + block-header="$i18n{siteSettingsFontsBlockedExceptions}" + allow-header="$i18n{siteSettingsFontsAllowedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> <template is="dom-if" route-path="/content/fileHandlers" no-search> <settings-subpage page-title="$i18n{siteSettingsFileHandling}" search-label="$i18n{siteSettingsAllSitesSearch}" search-term="{{searchFilter_}}"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="content-settings-header secondary"> - $i18n{siteSettingsFileHandlingDescription} - </div> - <settings-category-default-radio-group - category="[[contentSettingsTypesEnum_.FILE_HANDLING]]" - allow-option-label="$i18n{siteSettingsFileHandlingAllowed}" - allow-option-icon="settings:file-handling" - block-option-label="$i18n{siteSettingsFileHandlingBlocked}" - block-option-icon="settings:file-handling-off"> - </settings-category-default-radio-group> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.FILE_HANDLING]]" - block-header= - "$i18n{siteSettingsFileHandlingBlockedExceptions}" - allow-header= - "$i18n{siteSettingsFileHandlingAllowedExceptions}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <category-default-setting - toggle-off-label="$i18n{siteSettingsFileHandlingBlock}" - toggle-on-label="$i18n{siteSettingsFileHandlingAsk}" - category="[[contentSettingsTypesEnum_.FILE_HANDLING]]"> - </category-default-setting> - <category-setting-exceptions - category="[[contentSettingsTypesEnum_.FILE_HANDLING]]" - block-header="$i18n{siteSettingsBlock}" - allow-header="$i18n{siteSettingsAllow}" - search-filter="[[searchFilter_]]"> - </category-setting-exceptions> - </template> + <div class="content-settings-header secondary"> + $i18n{siteSettingsFileHandlingDescription} + </div> + <settings-category-default-radio-group + category="[[contentSettingsTypesEnum_.FILE_HANDLING]]" + allow-option-label="$i18n{siteSettingsFileHandlingAllowed}" + allow-option-icon="settings:file-handling" + block-option-label="$i18n{siteSettingsFileHandlingBlocked}" + block-option-icon="settings:file-handling-off"> + </settings-category-default-radio-group> + <category-setting-exceptions + category="[[contentSettingsTypesEnum_.FILE_HANDLING]]" + block-header= + "$i18n{siteSettingsFileHandlingBlockedExceptions}" + allow-header= + "$i18n{siteSettingsFileHandlingAllowedExceptions}" + search-filter="[[searchFilter_]]"> + </category-setting-exceptions> </settings-subpage> </template> </settings-animated-pages>
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.js b/chrome/browser/resources/settings/privacy_page/privacy_page.js index c64cf43..738f420 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.js +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.js
@@ -116,14 +116,6 @@ }, /** @private */ - enableContentSettingsRedesign_: { - type: Boolean, - value() { - return loadTimeData.getBoolean('enableContentSettingsRedesign'); - } - }, - - /** @private */ enablePaymentHandlerContentSetting_: { type: Boolean, value() {
diff --git a/chrome/browser/resources/settings/safety_check_page/safety_check_chrome_cleaner_child.ts b/chrome/browser/resources/settings/safety_check_page/safety_check_chrome_cleaner_child.ts index f6a961f..71867c1 100644 --- a/chrome/browser/resources/settings/safety_check_page/safety_check_chrome_cleaner_child.ts +++ b/chrome/browser/resources/settings/safety_check_page/safety_check_chrome_cleaner_child.ts
@@ -94,9 +94,7 @@ } private showChild_(): boolean { - return this.status_ !== SafetyCheckChromeCleanerStatus.HIDDEN && - loadTimeData.valueExists('safetyCheckChromeCleanerChildEnabled') && - loadTimeData.getBoolean('safetyCheckChromeCleanerChildEnabled'); + return this.status_ !== SafetyCheckChromeCleanerStatus.HIDDEN; } private getIconStatus_(): SafetyCheckIconStatus {
diff --git a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html index ee5d6b07..b83af25f 100644 --- a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html +++ b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html
@@ -3,7 +3,7 @@ padding: 0 var(--cr-section-padding); } </style> - <div id="exceptionHeader" hidden="[[!enableContentSettingsRedesign_]]"> + <div id="exceptionHeader"> <h2>$i18n{siteSettingsCustomizedBehaviors}</h2> <div id="exceptionHeaderSubLabel" class="secondary"> [[description]]
diff --git a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js index 3cd48fa6..e4066bf7 100644 --- a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js +++ b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js
@@ -79,14 +79,6 @@ */ blockHeader: String, - /** @private */ - enableContentSettingsRedesign_: { - type: Boolean, - value() { - return loadTimeData.getBoolean('enableContentSettingsRedesign'); - } - }, - /** * The heading text for the allowed exception list. */
diff --git a/chrome/browser/resources/settings/site_settings/protocol_handlers.html b/chrome/browser/resources/settings/site_settings/protocol_handlers.html index 5d2ee64..618cd7a 100644 --- a/chrome/browser/resources/settings/site_settings/protocol_handlers.html +++ b/chrome/browser/resources/settings/site_settings/protocol_handlers.html
@@ -24,46 +24,37 @@ --settings-collapse-separator-line: var(--cr-separator-line); } </style> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div id="radioGroup"> - <div class="secondary"> - $i18n{siteSettingsProtocolHandlersDescription} - </div> - <h2>$i18n{siteSettingsDefaultBehavior}</h2> - <div id="radioSubHeading" class="secondary"> - $i18n{siteSettingsDefaultBehaviorDescription} - </div> - <settings-radio-group - id="protcolHandlersRadio" - pref="[[handlersEnabledPref_]]" - on-change="onToggleChange_" - selectable-elements="settings-collapse-radio-button"> - <settings-collapse-radio-button no-collapse - id="protcolHandlersRadioAllow" - pref="[[handlersEnabledPref_]]" - label="$i18n{siteSettingsProtocolHandlersAllowed}" - name="true" - disabled$="[[isGuest_]]" - icon="settings:protocol-handler"> - </settings-collapse-radio-button> - <settings-collapse-radio-button no-collapse - id="protcolHandlersRadioBlock" - pref="[[handlersEnabledPref_]]" - label="$i18n{siteSettingsProtocolHandlersBlocked}" - name="false" - disabled$="[[isGuest_]]" - icon="settings:protocol-handler-off"> - </settings-collapse-radio-button> - </settings-radio-group> + <div id="radioGroup"> + <div class="secondary"> + $i18n{siteSettingsProtocolHandlersDescription} </div> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <settings-toggle-button id="protocolHandlersToggle" - pref="{{handlersEnabledPref_}}" - label="[[computeHandlersDescription_(handlersEnabledPref_.*)]]" - on-change="onToggleChange_"> - </settings-toggle-button> - </template> + <h2>$i18n{siteSettingsDefaultBehavior}</h2> + <div id="radioSubHeading" class="secondary"> + $i18n{siteSettingsDefaultBehaviorDescription} + </div> + <settings-radio-group + id="protcolHandlersRadio" + pref="[[handlersEnabledPref_]]" + on-change="onToggleChange_" + selectable-elements="settings-collapse-radio-button"> + <settings-collapse-radio-button no-collapse + id="protcolHandlersRadioAllow" + pref="[[handlersEnabledPref_]]" + label="$i18n{siteSettingsProtocolHandlersAllowed}" + name="true" + disabled$="[[isGuest_]]" + icon="settings:protocol-handler"> + </settings-collapse-radio-button> + <settings-collapse-radio-button no-collapse + id="protcolHandlersRadioBlock" + pref="[[handlersEnabledPref_]]" + label="$i18n{siteSettingsProtocolHandlersBlocked}" + name="false" + disabled$="[[isGuest_]]" + icon="settings:protocol-handler-off"> + </settings-collapse-radio-button> + </settings-radio-group> + </div> <template is="dom-repeat" items="[[protocols]]" as="protocol"> <div class="column-header">[[protocol.protocol_display_name]]</div> @@ -102,14 +93,9 @@ </cr-action-menu> <template is="dom-if" if="[[ignoredProtocols.length]]"> - <template is="dom-if" if="[[enableContentSettingsRedesign_]]"> - <div class="column-header"> - $i18n{siteSettingsProtocolHandlersBlockedExceptions} - </div> - </template> - <template is="dom-if" if="[[!enableContentSettingsRedesign_]]"> - <div class="column-header">$i18n{siteSettingsBlocked}</div> - </template> + <div class="column-header"> + $i18n{siteSettingsProtocolHandlersBlockedExceptions} + </div> <div class="list-frame menu-content vertical-list"> <template is="dom-repeat" items="[[ignoredProtocols]]"> <div class="list-item">
diff --git a/chrome/browser/resources/settings/site_settings/protocol_handlers.js b/chrome/browser/resources/settings/site_settings/protocol_handlers.js index ebd0e7d..c7e5e38 100644 --- a/chrome/browser/resources/settings/site_settings/protocol_handlers.js +++ b/chrome/browser/resources/settings/site_settings/protocol_handlers.js
@@ -99,14 +99,6 @@ */ ignoredProtocols: Array, - /** @private */ - enableContentSettingsRedesign_: { - type: Boolean, - value() { - return loadTimeData.getBoolean('enableContentSettingsRedesign'); - } - }, - /** @private {chrome.settingsPrivate.PrefObject} */ handlersEnabledPref_: { type: Object,
diff --git a/chrome/browser/resources/settings/site_settings/site_list.html b/chrome/browser/resources/settings/site_settings/site_list.html index 512d33e..3556293 100644 --- a/chrome/browser/resources/settings/site_settings/site_list.html +++ b/chrome/browser/resources/settings/site_settings/site_list.html
@@ -2,7 +2,7 @@ </style> <div id="category"> <div class="cr-row first"> - <h2 class$="flex [[getCssClass_(enableContentSettingsRedesign_)]]"> + <h2 class="flex secondary"> [[categoryHeader]] </h2> <cr-button id="addSite" class="header-aligned-button"
diff --git a/chrome/browser/resources/settings/site_settings/site_list.js b/chrome/browser/resources/settings/site_settings/site_list.js index 232942f..69e73de 100644 --- a/chrome/browser/resources/settings/site_settings/site_list.js +++ b/chrome/browser/resources/settings/site_settings/site_list.js
@@ -73,14 +73,6 @@ categoryHeader: String, - /** @private */ - enableContentSettingsRedesign_: { - type: Boolean, - value() { - return loadTimeData.getBoolean('enableContentSettingsRedesign'); - } - }, - /** * The site serving as the model for the currently open action menu. * @private {?SiteException} @@ -552,14 +544,6 @@ site => propNames.some( propName => site[propName].toLowerCase().includes(searchFilter))); } - - /** - * @return {string} - * @private - */ - getCssClass_() { - return this.enableContentSettingsRedesign_ ? 'secondary' : ''; - } } customElements.define(SiteListElement.is, SiteListElement);
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_list.js b/chrome/browser/resources/settings/site_settings_page/site_settings_list.js index cd69253..eca7d6a0 100644 --- a/chrome/browser/resources/settings/site_settings_page/site_settings_list.js +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_list.js
@@ -245,9 +245,6 @@ * @private */ updateNotificationsLabel_() { - const redesignEnabled = - loadTimeData.getBoolean('enableContentSettingsRedesign'); - const state = this.getPref('generated.notification').value; const index = this.categoryList.map(e => e.id).indexOf( ContentSettingsTypes.NOTIFICATIONS); @@ -256,14 +253,11 @@ // site-settings-list instance which contains notifications. assert(index !== -1); - let label = redesignEnabled ? 'siteSettingsNotificationsBlocked' : - 'siteSettingsBlocked'; + let label = 'siteSettingsNotificationsBlocked'; if (state === NotificationSetting.ASK) { - label = redesignEnabled ? 'siteSettingsNotificationsAllowed' : - 'siteSettingsAskBeforeSending'; + label = 'siteSettingsNotificationsAllowed'; } else if (state === NotificationSetting.QUIETER_MESSAGING) { - label = redesignEnabled ? 'siteSettingsNotificationsPartial' : - 'siteSettingsAskBeforeSending'; + label = 'siteSettingsNotificationsPartial'; } this.set(`categoryList.${index}.subLabel`, this.i18n(label)); }
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.js b/chrome/browser/resources/settings/site_settings_page/site_settings_page.js index f815cfe6..f9e550f 100644 --- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.js +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
@@ -40,9 +40,6 @@ if (categoryItemMap !== null) { return categoryItemMap; } - - const redesignEnabled = - loadTimeData.getBoolean('enableContentSettingsRedesign'); // The following list is ordered alphabetically by |id|. The order in which // these appear in the UI is determined elsewhere in this file. const categoryList = [ @@ -51,10 +48,8 @@ id: Id.ADS, label: 'siteSettingsAds', icon: 'settings:ads', - enabledLabel: redesignEnabled ? 'siteSettingsAdsAllowed' : - 'siteSettingsAllowed', - disabledLabel: redesignEnabled ? 'siteSettingsAdsBlocked' : - 'siteSettingsAdsBlock', + enabledLabel: 'siteSettingsAdsAllowed', + disabledLabel: 'siteSettingsAdsBlocked', shouldShow: () => loadTimeData.getBoolean('enableSafeBrowsingSubresourceFilter'), }, @@ -64,39 +59,32 @@ label: 'siteSettingsAr', icon: 'settings:vr-headset', // TODO(crbug.com/1196900): Fix redesign string when available. - enabledLabel: redesignEnabled ? 'siteSettingsArAsk' : 'siteSettingsArAsk', - disabledLabel: redesignEnabled ? 'siteSettingsArBlock' : - 'siteSettingsArBlock', + enabledLabel: 'siteSettingsArAsk', + disabledLabel: 'siteSettingsArBlock', }, { route: routes.SITE_SETTINGS_AUTOMATIC_DOWNLOADS, id: Id.AUTOMATIC_DOWNLOADS, label: 'siteSettingsAutomaticDownloads', icon: 'cr:file-download', - enabledLabel: redesignEnabled ? 'siteSettingsAutomaticDownloadsAllowed' : - 'siteSettingsAutoDownloadAsk', - disabledLabel: redesignEnabled ? 'siteSettingsAutomaticDownloadsBlocked' : - 'siteSettingsAutoDownloadBlock', + enabledLabel: 'siteSettingsAutomaticDownloadsAllowed', + disabledLabel: 'siteSettingsAutomaticDownloadsBlocked', }, { route: routes.SITE_SETTINGS_BACKGROUND_SYNC, id: Id.BACKGROUND_SYNC, label: 'siteSettingsBackgroundSync', icon: 'cr:sync', - enabledLabel: redesignEnabled ? 'siteSettingsBackgroundSyncAllowed' : - 'siteSettingsAllowRecentlyClosedSites', - disabledLabel: redesignEnabled ? 'siteSettingsBackgroundSyncBlocked' : - 'siteSettingsBackgroundSyncBlocked', + enabledLabel: 'siteSettingsBackgroundSyncAllowed', + disabledLabel: 'siteSettingsBackgroundSyncBlocked', }, { route: routes.SITE_SETTINGS_BLUETOOTH_DEVICES, id: Id.BLUETOOTH_DEVICES, label: 'siteSettingsBluetoothDevices', icon: 'settings:bluetooth', - enabledLabel: redesignEnabled ? 'siteSettingsBluetoothDevicesAllowed' : - 'siteSettingsBluetoothDevicesAsk', - disabledLabel: redesignEnabled ? 'siteSettingsBluetoothDevicesBlocked' : - 'siteSettingsBluetoothDevicesBlock', + enabledLabel: 'siteSettingsBluetoothDevicesAllowed', + disabledLabel: 'siteSettingsBluetoothDevicesBlocked', shouldShow: () => loadTimeData.getBoolean('enableWebBluetoothNewPermissionsBackend'), }, @@ -115,20 +103,16 @@ id: Id.CAMERA, label: 'siteSettingsCamera', icon: 'cr:videocam', - enabledLabel: redesignEnabled ? 'siteSettingsCameraAllowed' : - 'siteSettingsAskBeforeAccessing', - disabledLabel: redesignEnabled ? 'siteSettingsCameraBlocked' : - 'siteSettingsBlocked', + enabledLabel: 'siteSettingsCameraAllowed', + disabledLabel: 'siteSettingsCameraBlocked', }, { route: routes.SITE_SETTINGS_CLIPBOARD, id: Id.CLIPBOARD, label: 'siteSettingsClipboard', icon: 'settings:clipboard', - enabledLabel: redesignEnabled ? 'siteSettingsClipboardAllowed' : - 'siteSettingsAskBeforeAccessing', - disabledLabel: redesignEnabled ? 'siteSettingsClipboardBlocked' : - 'siteSettingsBlocked', + enabledLabel: 'siteSettingsClipboardAllowed', + disabledLabel: 'siteSettingsClipboardBlocked', }, { route: routes.COOKIES, @@ -144,10 +128,8 @@ id: Id.GEOLOCATION, label: 'siteSettingsLocation', icon: 'settings:location-on', - enabledLabel: redesignEnabled ? 'siteSettingsLocationAllowed' : - 'siteSettingsAskBeforeAccessing', - disabledLabel: redesignEnabled ? 'siteSettingsLocationBlocked' : - 'siteSettingsBlocked', + enabledLabel: 'siteSettingsLocationAllowed', + disabledLabel: 'siteSettingsLocationBlocked', }, { route: routes.SITE_SETTINGS_HID_DEVICES, @@ -162,50 +144,40 @@ id: Id.IDLE_DETECTION, label: 'siteSettingsIdleDetection', icon: 'settings:devices', - enabledLabel: redesignEnabled ? 'siteSettingsDeviceUseAllowed' : - 'siteSettingsIdleDetectionAsk', - disabledLabel: redesignEnabled ? 'siteSettingsDeviceUseBlocked' : - 'siteSettingsIdleDetectionBlock', + enabledLabel: 'siteSettingsDeviceUseAllowed', + disabledLabel: 'siteSettingsDeviceUseBlocked', }, { route: routes.SITE_SETTINGS_IMAGES, id: Id.IMAGES, label: 'siteSettingsImages', icon: 'settings:photo', - enabledLabel: redesignEnabled ? 'siteSettingsImagesAllowed' : - 'siteSettingsShowAll', - disabledLabel: redesignEnabled ? 'siteSettingsImagesBlocked' : - 'siteSettingsDontShowImages', + enabledLabel: 'siteSettingsImagesAllowed', + disabledLabel: 'siteSettingsImagesBlocked', }, { route: routes.SITE_SETTINGS_JAVASCRIPT, id: Id.JAVASCRIPT, label: 'siteSettingsJavascript', icon: 'settings:code', - enabledLabel: redesignEnabled ? 'siteSettingsJavascriptAllowed' : - 'siteSettingsAllowed', - disabledLabel: redesignEnabled ? 'siteSettingsJavascriptBlocked' : - 'siteSettingsBlocked', + enabledLabel: 'siteSettingsJavascriptAllowed', + disabledLabel: 'siteSettingsJavascriptBlocked', }, { route: routes.SITE_SETTINGS_MICROPHONE, id: Id.MIC, label: 'siteSettingsMic', icon: 'cr:mic', - enabledLabel: redesignEnabled ? 'siteSettingsMicAllowed' : - 'siteSettingsAskBeforeAccessing', - disabledLabel: redesignEnabled ? 'siteSettingsMicBlocked' : - 'siteSettingsBlocked', + enabledLabel: 'siteSettingsMicAllowed', + disabledLabel: 'siteSettingsMicBlocked', }, { route: routes.SITE_SETTINGS_MIDI_DEVICES, id: Id.MIDI_DEVICES, label: 'siteSettingsMidiDevices', icon: 'settings:midi', - enabledLabel: redesignEnabled ? 'siteSettingsMidiAllowed' : - 'siteSettingsMidiDevicesAsk', - disabledLabel: redesignEnabled ? 'siteSettingsMidiBlocked' : - 'siteSettingsMidiDevicesBlock', + enabledLabel: 'siteSettingsMidiAllowed', + disabledLabel: 'siteSettingsMidiBlocked', }, { route: routes.SITE_SETTINGS_MIXEDSCRIPT, @@ -227,20 +199,16 @@ id: Id.FILE_SYSTEM_WRITE, label: 'siteSettingsFileSystemWrite', icon: 'settings:save-original', - enabledLabel: redesignEnabled ? 'siteSettingsFileSystemWriteAllowed' : - 'siteSettingsFileSystemWriteAsk', - disabledLabel: redesignEnabled ? 'siteSettingsFileSystemWriteBlocked' : - 'siteSettingsFileSystemWriteBlock', + enabledLabel: 'siteSettingsFileSystemWriteAllowed', + disabledLabel: 'siteSettingsFileSystemWriteBlocked', }, { route: routes.SITE_SETTINGS_FONT_ACCESS, id: Id.FONT_ACCESS, label: 'fonts', icon: 'settings:font-access', - enabledLabel: redesignEnabled ? 'siteSettingsFontsAllowed' : - 'siteSettingsFontAccessAsk', - disabledLabel: redesignEnabled ? 'siteSettingsFontsBlocked' : - 'siteSettingsFontAccessBlock', + enabledLabel: 'siteSettingsFontsAllowed', + disabledLabel: 'siteSettingsFontsBlocked', }, { route: routes.SITE_SETTINGS_NOTIFICATIONS, @@ -255,10 +223,8 @@ id: Id.PAYMENT_HANDLER, label: 'siteSettingsPaymentHandler', icon: 'settings:payment-handler', - enabledLabel: redesignEnabled ? 'siteSettingsPaymentHandlersAllowed' : - 'siteSettingsPaymentHandlerAllow', - disabledLabel: redesignEnabled ? 'siteSettingsPaymentHandlersBlocked' : - 'siteSettingsPaymentHandlerBlock', + enabledLabel: 'siteSettingsPaymentHandlersAllowed', + disabledLabel: 'siteSettingsPaymentHandlersBlocked', shouldShow: () => loadTimeData.getBoolean('enablePaymentHandlerContentSetting'), }, @@ -267,38 +233,32 @@ id: 'pdfDocuments', label: 'siteSettingsPdfDocuments', icon: 'settings:pdf', - enabledLabel: redesignEnabled ? 'siteSettingsPdfsAllowed' : '', - disabledLabel: redesignEnabled ? 'siteSettingsPdfsBlocked' : '', + enabledLabel: 'siteSettingsPdfsAllowed', + disabledLabel: 'siteSettingsPdfsBlocked', }, { route: routes.SITE_SETTINGS_POPUPS, id: Id.POPUPS, label: 'siteSettingsPopups', icon: 'cr:open-in-new', - enabledLabel: redesignEnabled ? 'siteSettingsPopupsAllowed' : - 'siteSettingsAllowed', - disabledLabel: redesignEnabled ? 'siteSettingsPopupsBlocked' : - 'siteSettingsBlocked', + enabledLabel: 'siteSettingsPopupsAllowed', + disabledLabel: 'siteSettingsPopupsBlocked', }, { route: routes.SITE_SETTINGS_PROTECTED_CONTENT, id: Id.PROTECTED_CONTENT, label: 'siteSettingsProtectedContent', icon: 'settings:protected-content', - enabledLabel: redesignEnabled ? 'siteSettingsProtectedContentAllowed' : - '', - disabledLabel: redesignEnabled ? 'siteSettingsProtectedContentBlocked' : - '', + enabledLabel: 'siteSettingsProtectedContentAllowed', + disabledLabel: 'siteSettingsProtectedContentBlocked', }, { route: routes.SITE_SETTINGS_HANDLERS, id: Id.PROTOCOL_HANDLERS, label: 'siteSettingsHandlers', icon: 'settings:protocol-handler', - enabledLabel: redesignEnabled ? 'siteSettingsProtocolHandlersAllowed' : - 'siteSettingsHandlersAsk', - disabledLabel: redesignEnabled ? 'siteSettingsProtocolHandlersBlocked' : - 'siteSettingsHandlersBlocked', + enabledLabel: 'siteSettingsProtocolHandlersAllowed', + disabledLabel: 'siteSettingsProtocolHandlersBlocked', shouldShow: () => !loadTimeData.getBoolean('isGuest'), }, { @@ -306,50 +266,40 @@ id: Id.SENSORS, label: 'siteSettingsSensors', icon: 'settings:sensors', - enabledLabel: redesignEnabled ? 'siteSettingsMotionSensorsAllowed' : - 'siteSettingsSensorsAllow', - disabledLabel: redesignEnabled ? 'siteSettingsMotionSensorsBlocked' : - 'siteSettingsSensorsBlock', + enabledLabel: 'siteSettingsMotionSensorsAllowed', + disabledLabel: 'siteSettingsMotionSensorsBlocked', }, { route: routes.SITE_SETTINGS_SERIAL_PORTS, id: Id.SERIAL_PORTS, label: 'siteSettingsSerialPorts', icon: 'settings:serial-port', - enabledLabel: redesignEnabled ? 'siteSettingsSerialPortsAllowed' : - 'siteSettingsSerialPortsAsk', - disabledLabel: redesignEnabled ? 'siteSettingsSerialPortsBlocked' : - 'siteSettingsSerialPortsBlock', + enabledLabel: 'siteSettingsSerialPortsAllowed', + disabledLabel: 'siteSettingsSerialPortsBlocked', }, { route: routes.SITE_SETTINGS_SOUND, id: Id.SOUND, label: 'siteSettingsSound', icon: 'settings:volume-up', - enabledLabel: redesignEnabled ? 'siteSettingsSoundAllowed' : - 'siteSettingsSoundAllow', - disabledLabel: redesignEnabled ? 'siteSettingsSoundBlocked' : - 'siteSettingsSoundBlock', + enabledLabel: 'siteSettingsSoundAllowed', + disabledLabel: 'siteSettingsSoundBlocked', }, { route: routes.SITE_SETTINGS_USB_DEVICES, id: Id.USB_DEVICES, label: 'siteSettingsUsbDevices', icon: 'settings:usb', - enabledLabel: redesignEnabled ? 'siteSettingsUsbAllowed' : - 'siteSettingsUsbDevicesAsk', - disabledLabel: redesignEnabled ? 'siteSettingsUsbBlocked' : - 'siteSettingsUsbDevicesBlock', + enabledLabel: 'siteSettingsUsbAllowed', + disabledLabel: 'siteSettingsUsbBlocked', }, { route: routes.SITE_SETTINGS_VR, id: Id.VR, label: 'siteSettingsVr', icon: 'settings:vr-headset', - enabledLabel: redesignEnabled ? 'siteSettingsVrAllowed' : - 'siteSettingsVrAsk', - disabledLabel: redesignEnabled ? 'siteSettingsVrBlocked' : - 'siteSettingsVrBlock', + enabledLabel: 'siteSettingsVrAllowed', + disabledLabel: 'siteSettingsVrBlocked', }, { route: routes.SITE_SETTINGS_WINDOW_PLACEMENT,
diff --git a/chrome/browser/share/share_ranking.cc b/chrome/browser/share/share_ranking.cc index 36eb517d..7f2df68 100644 --- a/chrome/browser/share/share_ranking.cc +++ b/chrome/browser/share/share_ranking.cc
@@ -340,18 +340,24 @@ DCHECK_GE(old_ranking.size(), fold); DCHECK_GE(available_on_system.size(), fold); + // When using the last slot for More, pretend that the fold is one slot less + // than it normally is - otherwise the logic for ensuring that targets are + // visible may try to move targets into the slot that is about to be + // overwritten with More. + int logical_fold = fix_more ? fold - 1 : fold; + std::vector<std::string> new_ranking = MaybeUpdateRankingFromHistory( - old_ranking, all_share_history, recent_share_history, fold); + old_ranking, all_share_history, recent_share_history, logical_fold); Ranking computed_display_ranking = ReplaceUnavailableEntries(new_ranking, available_on_system); - FillGaps(computed_display_ranking, available_on_system, fold); + FillGaps(computed_display_ranking, available_on_system, logical_fold); computed_display_ranking.resize(fold); if (fix_more) - computed_display_ranking[fold - 1] = kMoreTarget; + computed_display_ranking[logical_fold] = kMoreTarget; *persisted_ranking = new_ranking; *display_ranking = computed_display_ranking; @@ -363,9 +369,10 @@ available.push_back(kMoreTarget); DCHECK(EveryElementInList(*display_ranking, available)); - DCHECK(ElementIndexesAreUnchanged(*display_ranking, old_ranking, fold)); - DCHECK(AtMostOneSlotChanged(old_ranking, *persisted_ranking, fold)); - DCHECK(NoEmptySlots(*display_ranking, fold)); + DCHECK(ElementIndexesAreUnchanged(*display_ranking, old_ranking, + logical_fold)); + DCHECK(AtMostOneSlotChanged(old_ranking, *persisted_ranking, logical_fold)); + DCHECK(NoEmptySlots(*display_ranking, logical_fold)); DCHECK_GE(persisted_ranking->size(), fold); }
diff --git a/chrome/browser/share/share_ranking_unittest.cc b/chrome/browser/share/share_ranking_unittest.cc index 6ee3b13..59502db2 100644 --- a/chrome/browser/share/share_ranking_unittest.cc +++ b/chrome/browser/share/share_ranking_unittest.cc
@@ -166,6 +166,34 @@ EXPECT_EQ(persisted, current); } +TEST_F(ShareRankingStaticTest, PromotedTargetIsVisible) { + // Regression test for <https://crbug.com/1240355>: in "fix more" mode, the + // last slot on the screen is actually unusable for display since it gets + // replaced with the "More" option that invokes the system share hub. The + // logic to promote a target into being visible should therefore not promote + // targets into this slot in the ranking. + std::map<std::string, int> history = { + {"bar", 2}, + {"foo", 3}, + {"baz", 10}, + }; + + ShareRanking::Ranking displayed, persisted; + ShareRanking::Ranking current{"foo", "bar", "baz"}; + + ShareRanking::ComputeRanking(history, history, current, {"foo", "bar", "baz"}, + 3, true, &displayed, &persisted); + + std::vector<std::string> expected_displayed{"foo", "baz", + ShareRanking::kMoreTarget}; + std::vector<std::string> expected_persisted{"foo", "baz", "bar"}; + + ASSERT_EQ(displayed.size(), expected_displayed.size()); + ASSERT_EQ(persisted.size(), current.size()); + EXPECT_EQ(displayed, expected_displayed); + EXPECT_EQ(persisted, expected_persisted); +} + // Regression test for https://crbug.com/1233232 TEST_F(ShareRankingTest, OldRankingContainsItemsWithNoRecentHistory) { std::map<std::string, int> history = {
diff --git a/chrome/browser/signin/services/android/BUILD.gn b/chrome/browser/signin/services/android/BUILD.gn index b0c6304..d35ccbe 100644 --- a/chrome/browser/signin/services/android/BUILD.gn +++ b/chrome/browser/signin/services/android/BUILD.gn
@@ -6,6 +6,7 @@ generate_jni("jni_headers") { sources = [ + "java/src/org/chromium/chrome/browser/signin/services/FREMobileIdentityConsistencyFieldTrial.java", "java/src/org/chromium/chrome/browser/signin/services/IdentityServicesProvider.java", "java/src/org/chromium/chrome/browser/signin/services/SigninMetricsUtils.java", "java/src/org/chromium/chrome/browser/signin/services/UnifiedConsentServiceBridge.java", @@ -16,6 +17,7 @@ android_library("java") { sources = [ "java/src/org/chromium/chrome/browser/signin/services/DisplayableProfileData.java", + "java/src/org/chromium/chrome/browser/signin/services/FREMobileIdentityConsistencyFieldTrial.java", "java/src/org/chromium/chrome/browser/signin/services/IdentityServicesProvider.java", "java/src/org/chromium/chrome/browser/signin/services/ProfileDataCache.java", "java/src/org/chromium/chrome/browser/signin/services/SigninManager.java",
diff --git a/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/FREMobileIdentityConsistencyFieldTrial.java b/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/FREMobileIdentityConsistencyFieldTrial.java new file mode 100644 index 0000000..d6d198f --- /dev/null +++ b/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/FREMobileIdentityConsistencyFieldTrial.java
@@ -0,0 +1,86 @@ +// Copyright 2021 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.services; + +import androidx.annotation.AnyThread; +import androidx.annotation.MainThread; + +import org.chromium.base.annotations.CalledByNative; +import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; +import org.chromium.chrome.browser.preferences.SharedPreferencesManager; + +import java.util.Random; + +/** + * Creates a Field Trial to control the MobileIdentityConsistencyFRE feature. This feature is used + * to show a new First Run page that will let users sign into chrome without syncing. The trial is + * client controlled because this experiment runs on First Run Experience when native code is not + * initialized and variation seed in not available. + * + * After creating a field trial the group information is saved in {@link SharedPreferencesManager} + * so that it's available in subsequent runs of Chrome. + */ +public class FREMobileIdentityConsistencyFieldTrial { + private static final Object LOCK = new Object(); + private static final String ENABLED_GROUP = "enabled"; + private static final String DISABLED_GROUP = "disabled"; + private static final String DEFAULT_GROUP = "default"; + + @AnyThread + public static boolean isEnabled() { + // Disabled by default. + return ENABLED_GROUP.equals(getFirstRunTrialGroup()); + } + + @CalledByNative + @AnyThread + public static String getFirstRunTrialGroup() { + synchronized (LOCK) { + return SharedPreferencesManager.getInstance().readString( + ChromePreferenceKeys.FIRST_RUN_FIELD_TRIAL_GROUP, DEFAULT_GROUP); + } + } + + /** + * This method should be only called once during FRE in + * {@link org.chromium.chrome.browser.firstrun.FirstRunActivity} so that subsequent chrome runs + * don't override FRE experiment group information. + * + * FRE is launched either after first install of chrome or after a power wash. So there is be no + * previous experiment group information available when this method is called. + */ + @MainThread + public static void createFirstRunTrial() { + // Tweak these values for different builds to create the percentage of enabled population. + // For A/B testing enabled and disabled group should have the same percentages. + int enabledPercent = 0; + int disabledPercent = enabledPercent; + assert enabledPercent + disabledPercent <= 100; + + int randomBucket = new Random().nextInt(100); + String group = DEFAULT_GROUP; + if (randomBucket < enabledPercent) { + group = ENABLED_GROUP; + } else if (randomBucket < enabledPercent + disabledPercent) { + group = DISABLED_GROUP; + } + + synchronized (LOCK) { + SharedPreferencesManager.getInstance().writeString( + ChromePreferenceKeys.FIRST_RUN_FIELD_TRIAL_GROUP, group); + } + } + + /** + * Enables MobileIdentityConsistencyFRE experiment for tests. + */ + @AnyThread + public static void enableForTesting() { + synchronized (LOCK) { + SharedPreferencesManager.getInstance().writeString( + ChromePreferenceKeys.FIRST_RUN_FIELD_TRIAL_GROUP, ENABLED_GROUP); + } + } +} \ No newline at end of file
diff --git a/chrome/browser/subresource_filter/ad_tagging_browsertest.cc b/chrome/browser/subresource_filter/ad_tagging_browsertest.cc index 4a62009e..42dfb18 100644 --- a/chrome/browser/subresource_filter/ad_tagging_browsertest.cc +++ b/chrome/browser/subresource_filter/ad_tagging_browsertest.cc
@@ -26,6 +26,7 @@ #include "components/subresource_filter/core/common/test_ruleset_utils.h" #include "components/ukm/content/source_url_recorder.h" #include "components/ukm/test_ukm_recorder.h" +#include "content/public/test/back_forward_cache_util.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_navigation_observer.h" @@ -394,6 +395,14 @@ const char kWindowOpenFromAdStateHistogram[] = "Blink.WindowOpen.FromAdState"; IN_PROC_BROWSER_TEST_F(AdTaggingBrowserTest, VerifySameOriginWithoutNavigate) { + // The test assumes pages gets deleted after navigation, triggering histogram + // recording. Disable back/forward cache to ensure that pages don't get + // preserved in the cache. + // TODO(https://crbug.com/1229122): Investigate if this needs further fix. + content::DisableBackForwardCacheForTesting( + browser()->tab_strip_model()->GetActiveWebContents(), + content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + base::HistogramTester histogram_tester; // Main frame.
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_am.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_am.xtb index 00ccdfd..7d522597 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_am.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_am.xtb
@@ -1228,6 +1228,7 @@ <translation id="8497726226069778601">እዚህ ምንም የሚታይ ነገር የለም... ገና</translation> <translation id="8503559462189395349">የChrome ይለፍ ቃላት</translation> <translation id="8503813439785031346">የተጣቃሚ ስም</translation> +<translation id="8505766168025405649">ለማውረድ ሁኔታ ማሳወቂያዎችን ይመልከቱ</translation> <translation id="8514477925623180633">ከChrome ጋር የተከማቹ የይለፍ ቃሎችን ወደ ውጭ ላክ</translation> <translation id="8516012719330875537">የምስል አርታዒ</translation> <translation id="8523928698583292556">የተከማቸ የይለፍ ቃል ሰርዝ</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_es-419.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_es-419.xtb index 78f63d7..57e30f9 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_es-419.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_es-419.xtb
@@ -1229,6 +1229,7 @@ <translation id="8497726226069778601">Aún no hay elementos para ver</translation> <translation id="8503559462189395349">Contraseñas de Chrome</translation> <translation id="8503813439785031346">Nombre de usuario</translation> +<translation id="8505766168025405649">Consulta la notificación para conocer el estado de la descarga.</translation> <translation id="8514477925623180633">Exportar las contraseñas almacenadas con Chrome</translation> <translation id="8516012719330875537">Editor de imágenes</translation> <translation id="8523928698583292556">Borrar contraseña almacenada</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_ja.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_ja.xtb index 5e95893..711ba4b5 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_ja.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_ja.xtb
@@ -496,6 +496,7 @@ <translation id="4108998448622696017">危険なイベントの発生を検出して警告します。</translation> <translation id="4116038641877404294">ページをダウンロードするとオフラインで使用できるようになります</translation> <translation id="4135200667068010335">タブを共有するデバイスのリストが閉じられました。</translation> +<translation id="4137746084635924146">現在のデバイスの言語</translation> <translation id="4141536112466364990">Chrome について学ぶ</translation> <translation id="4149994727733219643">ウェブページの簡易表示</translation> <translation id="4165986682804962316">サイトの設定</translation> @@ -1228,6 +1229,7 @@ <translation id="8497726226069778601">表示するものがまだありません</translation> <translation id="8503559462189395349">Chrome パスワード</translation> <translation id="8503813439785031346">ユーザー名</translation> +<translation id="8505766168025405649">ダウンロード ステータスの通知を表示</translation> <translation id="8514477925623180633">Chrome に保存されたパスワードをエクスポートします</translation> <translation id="8516012719330875537">画像エディタ</translation> <translation id="8523928698583292556">保存したパスワードを削除</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_ko.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_ko.xtb index ab5690b..bc7905e 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_ko.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_ko.xtb
@@ -1229,6 +1229,7 @@ <translation id="8497726226069778601">아직 표시할 내용 없음</translation> <translation id="8503559462189395349">Chrome 비밀번호</translation> <translation id="8503813439785031346">사용자이름</translation> +<translation id="8505766168025405649">알림에서 다운로드 상태를 확인하세요.</translation> <translation id="8514477925623180633">Chrome으로 저장한 비밀번호 내보내기</translation> <translation id="8516012719330875537">이미지 편집기</translation> <translation id="8523928698583292556">저장된 암호 삭제</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_or.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_or.xtb index 2c3ff7c..bac87bb7 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_or.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_or.xtb
@@ -496,6 +496,7 @@ <translation id="4108998448622696017">ବିପଦଜନକ ଘଟଣାଗୁଡ଼ିକ ଘଟିଲେ ଏଗୁଡ଼ିକୁ ଚିହ୍ନଟ କରି ଆପଣଙ୍କୁ ଚେତାବନୀ ଦିଏ।</translation> <translation id="4116038641877404294">ଅଫ୍ଲାଇନ୍ରେ ବ୍ୟବହାର କରିବାକୁ ପୃଷ୍ଠାଗୁଡ଼ିକ ଡାଉନ୍ଲୋଡ୍ କରନ୍ତୁ</translation> <translation id="4135200667068010335">ଏକ ଟାବ୍ ସେୟାର୍ କରିବା ପାଇଁ ଡିଭାଇସ୍ର ତାଲିକା ବନ୍ଦ କରାଯାଇଛି।</translation> +<translation id="4137746084635924146">ଡିଭାଇସର ବର୍ତ୍ତମାନର ଭାଷା</translation> <translation id="4141536112466364990">Chrome ବିଷୟରେ ଜାଣନ୍ତୁ</translation> <translation id="4149994727733219643">ୱେବ୍ ପୃଷ୍ଠାଗୁଡ଼ିକ ପାଇଁ ସରଳୀକୃତ ଭ୍ୟୁ</translation> <translation id="4165986682804962316">ସାଇଟ୍ ସେଟିଂସ୍</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_ta.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_ta.xtb index d8d0e00..032ab142 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_ta.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_ta.xtb
@@ -1229,6 +1229,7 @@ <translation id="8497726226069778601">இதுவரை இங்கே காண்பதற்கு ஒன்றுமில்லை...</translation> <translation id="8503559462189395349">Chrome கடவுச்சொற்கள்</translation> <translation id="8503813439785031346">பயனர்பெயர்</translation> +<translation id="8505766168025405649">பதிவிறக்க நிலையை அறிய அதற்கான அறிவிப்பைப் பார்க்கவும்</translation> <translation id="8514477925623180633">Chrome இல் சேமித்த கடவுச்சொற்களை ஏற்றும்</translation> <translation id="8516012719330875537">படத் திருத்தி</translation> <translation id="8523928698583292556">சேமித்த கடவுச்சொல்லை நீக்குவதற்கான பட்டன்</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb index 91e9604..debb1eda 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb
@@ -1229,6 +1229,7 @@ <translation id="8497726226069778601">Hozircha bu yerda hech narsa yo‘q</translation> <translation id="8503559462189395349">Chrome parollari</translation> <translation id="8503813439785031346">Foydalanuvchi nomi</translation> +<translation id="8505766168025405649">Yuklab olish holatini bildirishnoma orqali koʻrish mumkin</translation> <translation id="8514477925623180633">Chrome saqlab qolgan parollarni eksport qilish</translation> <translation id="8516012719330875537">Rasmlarni tahrirlash vositasi</translation> <translation id="8523928698583292556">Saqlangan parolni o‘chirish</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_vi.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_vi.xtb index 5b35dc8..aba9b5941 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_vi.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_vi.xtb
@@ -1229,6 +1229,7 @@ <translation id="8497726226069778601">Chưa có gì để xem ở đây...</translation> <translation id="8503559462189395349">Mật khẩu Chrome</translation> <translation id="8503813439785031346">Tên người dùng</translation> +<translation id="8505766168025405649">Xem thông báo để biết trạng thái tải xuống</translation> <translation id="8514477925623180633">Xuất mật khẩu đã lưu trữ với Chrome</translation> <translation id="8516012719330875537">Trình chỉnh sửa ảnh</translation> <translation id="8523928698583292556">Xóa mật khẩu đã lưu trữ</translation>
diff --git a/chrome/browser/ui/app_list/search/ranking/category_ranker.cc b/chrome/browser/ui/app_list/search/ranking/category_ranker.cc index 8fbcfab..3361226ab 100644 --- a/chrome/browser/ui/app_list/search/ranking/category_ranker.cc +++ b/chrome/browser/ui/app_list/search/ranking/category_ranker.cc
@@ -112,8 +112,9 @@ config.mutable_predictor()->mutable_default_predictor(); category_ranker_ = std::make_unique<RecurrenceRanker>( - "CategoryRanker", profile->GetPath().AppendASCII("category_ranker.pb"), - config, chromeos::ProfileHelper::IsEphemeralUserProfile(profile)); + "CategoryRanker", + RankerStateDirectory(profile).AppendASCII("category_ranker.pb"), config, + chromeos::ProfileHelper::IsEphemeralUserProfile(profile)); } void CategoryRanker::InitializeCategoryScores() {
diff --git a/chrome/browser/ui/app_list/search/ranking/util.cc b/chrome/browser/ui/app_list/search/ranking/util.cc index 531865d5..2b928e3 100644 --- a/chrome/browser/ui/app_list/search/ranking/util.cc +++ b/chrome/browser/ui/app_list/search/ranking/util.cc
@@ -7,9 +7,20 @@ #include <string> #include "base/strings/utf_string_conversions.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/search/ranking/constants.h" namespace app_list { +namespace { + +// The directory within the cryptohome to save ranking state into. +constexpr char kRankerStateDirectory[] = "launcher_ranking/"; + +} // namespace + +base::FilePath RankerStateDirectory(Profile* profile) { + return profile->GetPath().AppendASCII(kRankerStateDirectory); +} std::u16string RemoveDebugPrefix(const std::u16string str) { std::string result = base::UTF16ToUTF8(str);
diff --git a/chrome/browser/ui/app_list/search/ranking/util.h b/chrome/browser/ui/app_list/search/ranking/util.h index 2fd73b8..4c51c7ab 100644 --- a/chrome/browser/ui/app_list/search/ranking/util.h +++ b/chrome/browser/ui/app_list/search/ranking/util.h
@@ -7,8 +7,16 @@ #include <string> +#include "base/files/file_path.h" + +class Profile; + namespace app_list { +// Returns the absolute path of the directory rankers should serialize their +// state into. +base::FilePath RankerStateDirectory(Profile* profile); + // TODO(crbug.com/1199206): Once the UI has support for categories this can be // removed.
diff --git a/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker.cc b/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker.cc index 3c82b66..9b14ff0f 100644 --- a/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker.cc +++ b/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker.cc
@@ -41,6 +41,12 @@ void SaveProtoToDisk(const base::FilePath& filepath, const std::string& model_identifier, const RecurrenceRankerProto& proto) { + // CreateDirectory returns true if the directory was created successfully, or + // the path is already a directory. + if (!base::CreateDirectory(filepath.DirName())) { + return; + } + std::string proto_str; if (!proto.SerializeToString(&proto_str)) { return;
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc index 20460ea7..4316a56 100644 --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
@@ -128,11 +128,6 @@ void ManagePasswordsUIController::OnPasswordSubmitted( std::unique_ptr<PasswordFormManagerForUI> form_manager) { - // If the save bubble is already shown (possibly manual fallback for saving) - // then ignore the changes because the user may interact with it right now. - if (bubble_status_ == BubbleStatus::SHOWN && - GetState() == password_manager::ui::PENDING_PASSWORD_STATE) - return; bool show_bubble = !form_manager->IsBlocklisted(); DestroyAccountChooser(); save_fallback_timer_.Stop();
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc index 580eb15..6a6dab2 100644 --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
@@ -1285,16 +1285,16 @@ controller()->OnBubbleShown(); // Automatic form submission detected. + submitted_form().username_value = u"new_username"; + submitted_form().password_value = u"12345"; test_form_manager = CreateFormManagerWithBestMatches(&matches); - EXPECT_CALL(*controller(), OnUpdateBubbleAndIconVisibility()).Times(0); + EXPECT_CALL(*controller(), OnUpdateBubbleAndIconVisibility()); controller()->OnPasswordSubmitted(std::move(test_form_manager)); - // It should have no effect as the bubble was already open. + // It should update the bubble already open. ExpectIconAndControllerStateIs(password_manager::ui::PENDING_PASSWORD_STATE); - EXPECT_EQ(u"manual_username", - controller()->GetPendingPassword().username_value); - EXPECT_EQ(u"manual_pass1234", - controller()->GetPendingPassword().password_value); + EXPECT_EQ(u"new_username", controller()->GetPendingPassword().username_value); + EXPECT_EQ(u"12345", controller()->GetPendingPassword().password_value); } TEST_F(ManagePasswordsUIControllerTest,
diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc index dbb7e28..283b5ede 100644 --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc
@@ -24,7 +24,6 @@ #include "chrome/browser/content_settings/page_specific_content_settings_delegate.h" #include "chrome/browser/content_settings/sound_content_setting_observer.h" #include "chrome/browser/data_reduction_proxy/data_reduction_proxy_tab_helper.h" -#include "chrome/browser/engagement/site_engagement_helper.h" #include "chrome/browser/external_protocol/external_protocol_observer.h" #include "chrome/browser/favicon/favicon_utils.h" #include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h" @@ -114,6 +113,7 @@ #include "components/permissions/features.h" #include "components/permissions/permission_request_manager.h" #include "components/safe_browsing/content/browser/safe_browsing_navigation_observer.h" +#include "components/site_engagement/content/site_engagement_helper.h" #include "components/site_engagement/content/site_engagement_service.h" #include "components/sync/engine/sync_engine_switches.h" #include "components/tracing/common/tracing_switches.h"
diff --git a/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc b/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc index a8c73fda..385cd3f 100644 --- a/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc +++ b/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc
@@ -13,6 +13,15 @@ #include "ui/native_theme/native_theme.h" #include "ui/views/controls/highlight_path_generator.h" +namespace { + +// Padding between chip's icon and label. +constexpr int kChipImagePadding = 4; +// An extra space between chip's label and right edge. +constexpr int kExtraRightPadding = 4; + +} // namespace + OmniboxChipButton::OmniboxChipButton(PressedCallback callback, const gfx::VectorIcon& icon, std::u16string message, @@ -29,8 +38,7 @@ SetElideBehavior(gfx::ElideBehavior::FADE_TAIL); SetFocusBehavior(views::View::FocusBehavior::ALWAYS); // Equalizing padding on the left, right and between icon and label. - SetImageLabelSpacing( - GetLayoutInsets(LOCATION_BAR_ICON_INTERIOR_PADDING).left()); + SetImageLabelSpacing(kChipImagePadding); SetCustomPadding( gfx::Insets(GetLayoutConstant(LOCATION_BAR_CHILD_INTERIOR_PADDING), GetLayoutInsets(LOCATION_BAR_ICON_INTERIOR_PADDING).left())); @@ -67,8 +75,8 @@ gfx::Size OmniboxChipButton::CalculatePreferredSize() const { const int fixed_width = GetIconSize() + GetInsets().width(); - const int collapsable_width = - label()->GetPreferredSize().width() + GetInsets().right(); + const int collapsable_width = label()->GetPreferredSize().width() + + kChipImagePadding + kExtraRightPadding; const double animation_value = force_expanded_for_testing_ ? 1.0 : animation_->GetCurrentValue(); const int width =
diff --git a/chrome/browser/ui/views/menu_view_drag_and_drop_test.cc b/chrome/browser/ui/views/menu_view_drag_and_drop_test.cc index 7623df7..2b95610 100644 --- a/chrome/browser/ui/views/menu_view_drag_and_drop_test.cc +++ b/chrome/browser/ui/views/menu_view_drag_and_drop_test.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/bind.h" #include "base/macros.h" #include "base/scoped_observation.h" #include "base/strings/utf_string_conversions.h" @@ -77,8 +78,13 @@ void OnDragEntered(const ui::DropTargetEvent& event) override; int OnDragUpdated(const ui::DropTargetEvent& event) override; DragOperation OnPerformDrop(const ui::DropTargetEvent& event) override; + DropCallback GetDropCallback(const ui::DropTargetEvent& event) override; void OnDragExited() override; + // Performs the drop operation and updates |output_drag_op| accordingly. + void PerformDrop(const ui::DropTargetEvent& event, + ui::mojom::DragOperation& output_drag_op); + // Whether or not we are currently dragging. bool dragging_ = false; @@ -127,15 +133,28 @@ } DragOperation TestTargetView::OnPerformDrop(const ui::DropTargetEvent& event) { + auto drop_cb = GetDropCallback(event); + ui::mojom::DragOperation output_drag_op = ui::mojom::DragOperation::kNone; + std::move(drop_cb).Run(event, output_drag_op); + return output_drag_op; +} + +views::View::DropCallback TestTargetView::GetDropCallback( + const ui::DropTargetEvent& event) { dragging_ = false; - dropped_ = true; - return DragOperation::kMove; + return base::BindOnce(&TestTargetView::PerformDrop, base::Unretained(this)); } void TestTargetView::OnDragExited() { dragging_ = false; } +void TestTargetView::PerformDrop(const ui::DropTargetEvent& event, + ui::mojom::DragOperation& output_drag_op) { + dropped_ = true; + output_drag_op = DragOperation::kMove; +} + } // namespace class MenuViewDragAndDropTest : public MenuTestBase, @@ -176,12 +195,20 @@ DragOperation OnPerformDrop(views::MenuItemView* menu, DropPosition position, const ui::DropTargetEvent& event) override; + views::View::DropCallback GetDropCallback( + views::MenuItemView* menu, + DropPosition position, + const ui::DropTargetEvent& event) override; bool CanDrag(views::MenuItemView* menu) override; void WriteDragData(views::MenuItemView* sender, ui::OSExchangeData* data) override; int GetDragOperations(views::MenuItemView* sender) override; bool ShouldCloseOnDragComplete() override; + // Performs the drop operation and updates |output_drag_op| accordingly. + void PerformDrop(const ui::DropTargetEvent& event, + ui::mojom::DragOperation& output_drag_op); + // The special view in the menu, which supports its own drag and drop. TestTargetView* target_view_ = nullptr; @@ -272,8 +299,18 @@ views::MenuItemView* menu, DropPosition position, const ui::DropTargetEvent& event) { - performed_in_menu_drop_ = true; - return DragOperation::kMove; + auto drop_cb = GetDropCallback(menu, position, event); + ui::mojom::DragOperation output_drag_op = ui::mojom::DragOperation::kNone; + std::move(drop_cb).Run(event, output_drag_op); + return output_drag_op; +} + +views::View::DropCallback MenuViewDragAndDropTest::GetDropCallback( + views::MenuItemView* menu, + DropPosition position, + const ui::DropTargetEvent& event) { + return base::BindOnce(&MenuViewDragAndDropTest::PerformDrop, + base::Unretained(this)); } bool MenuViewDragAndDropTest::CanDrag(views::MenuItemView* menu) { @@ -294,6 +331,13 @@ return false; } +void MenuViewDragAndDropTest::PerformDrop( + const ui::DropTargetEvent& event, + ui::mojom::DragOperation& output_drag_op) { + performed_in_menu_drop_ = true; + output_drag_op = DragOperation::kMove; +} + class MenuViewDragAndDropTestTestInMenuDrag : public MenuViewDragAndDropTest { public: MenuViewDragAndDropTestTestInMenuDrag() = default;
diff --git a/chrome/browser/ui/views/toolbar/read_later_toolbar_button.cc b/chrome/browser/ui/views/toolbar/read_later_toolbar_button.cc index ee86ef7..abcfb25 100644 --- a/chrome/browser/ui/views/toolbar/read_later_toolbar_button.cc +++ b/chrome/browser/ui/views/toolbar/read_later_toolbar_button.cc
@@ -8,9 +8,11 @@ #include "base/metrics/user_metrics_action.h" #include "base/scoped_observation.h" #include "chrome/app/vector_icons/vector_icons.h" +#include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.h" #include "chrome/browser/ui/bookmarks/bookmark_utils.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" +#include "chrome/browser/ui/ui_features.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/side_panel.h" #include "chrome/common/webui_url_constants.h" @@ -41,6 +43,11 @@ contents_wrapper_->ReloadWebContents(); SetWebContents(contents_wrapper_->web_contents()); + if (base::FeatureList::IsEnabled(features::kSidePanelDragAndDrop)) { + extensions::BookmarkManagerPrivateDragEventRouter::CreateForWebContents( + contents_wrapper_->web_contents()); + } + browser_->tab_strip_model()->AddObserver(this); }
diff --git a/chrome/browser/ui/views/web_apps/web_app_tab_strip_browsertest.cc b/chrome/browser/ui/views/web_apps/web_app_tab_strip_browsertest.cc index ac4755ee..32b5318 100644 --- a/chrome/browser/ui/views/web_apps/web_app_tab_strip_browsertest.cc +++ b/chrome/browser/ui/views/web_apps/web_app_tab_strip_browsertest.cc
@@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/test/scoped_feature_list.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/browser_commands.h" @@ -130,7 +130,7 @@ } // TODO(crbug.com/897314) Enabled tab strip for web apps on non-Chrome OS. -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) IN_PROC_BROWSER_TEST_F(WebAppTabStripBrowserTest, ActiveTabColorIsBackgroundColor) { @@ -184,6 +184,6 @@ } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // defined(OS_CHROMEOS) } // namespace web_app
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc index 3521dc2..faef0900 100644 --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -597,8 +597,6 @@ IDS_SETTINGS_RESET_CLEANUP_TRY_AGAIN_BUTTON_LABEL}, {"chromeCleanupExplanationLogsPermissionPref", IDS_SETTINGS_RESET_CLEANUP_LOGS_PERMISSION_PREF}, - {"chromeCleanupExplanationNotificationPermission", - IDS_SETTINGS_RESET_CLEANUP_EXPLANTION_NOTIFICATION_PERMISSION}, {"chromeCleanupTitleCleanupUnavailable", IDS_SETTINGS_RESET_CLEANUP_TITLE_CLEANUP_UNAVAILABLE}, {"chromeCleanupExplanationCleanupUnavailable",
diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc index 3224ba2d..9c51c81 100644 --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -295,21 +295,6 @@ base::FeatureList::IsEnabled( password_manager::features::kEnableMovingMultiplePasswordsToAccount)); - html_source->AddBoolean( - "enableContentSettingsRedesign", - base::FeatureList::IsEnabled(features::kContentSettingsRedesign)); - -#if defined(OS_WIN) - html_source->AddBoolean( - "safetyCheckChromeCleanerChildEnabled", - base::FeatureList::IsEnabled(features::kSafetyCheckChromeCleanerChild)); - - html_source->AddBoolean( - "chromeCleanupScanCompletedNotificationEnabled", - base::FeatureList::IsEnabled( - features::kChromeCleanupScanCompletedNotification)); -#endif - #if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) html_source->AddBoolean("enableDesktopRestructuredLanguageSettings", base::FeatureList::IsEnabled(
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 3a8632b..32ea262 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -107,21 +107,12 @@ base::FEATURE_DISABLED_BY_DEFAULT}; #endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) -#if defined(OS_WIN) -const base::Feature kChromeCleanupScanCompletedNotification{ - "ChromeCleanupScanCompletedNotification", - base::FEATURE_DISABLED_BY_DEFAULT}; -#endif - const base::Feature kClientStorageAccessContextAuditing{ "ClientStorageAccessContextAuditing", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kConsolidatedSiteStorageControls{ "ConsolidatedSiteStorageControls", base::FEATURE_DISABLED_BY_DEFAULT}; -const base::Feature kContentSettingsRedesign{"ContentSettingsRedesign", - base::FEATURE_ENABLED_BY_DEFAULT}; - #if defined(OS_ANDROID) const base::Feature kContinuousSearch{"ContinuousSearch", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -826,11 +817,6 @@ "RequestDesktopSiteForTablets", base::FEATURE_DISABLED_BY_DEFAULT}; #endif -#if defined(OS_WIN) -const base::Feature kSafetyCheckChromeCleanerChild{ - "SafetyCheckChromeCleanerChild", base::FEATURE_ENABLED_BY_DEFAULT}; -#endif - #if BUILDFLAG(IS_CHROMEOS_ASH) // Enable support for multiple scheduler configurations. const base::Feature kSchedulerConfiguration{"SchedulerConfiguration",
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 0189a96..087d5998 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -84,20 +84,12 @@ extern const base::Feature kChromeAppsDeprecation; #endif -#if defined(OS_WIN) -COMPONENT_EXPORT(CHROME_FEATURES) -extern const base::Feature kChromeCleanupScanCompletedNotification; -#endif - COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kClientStorageAccessContextAuditing; COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kConsolidatedSiteStorageControls; -COMPONENT_EXPORT(CHROME_FEATURES) -extern const base::Feature kContentSettingsRedesign; - #if defined(OS_ANDROID) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kContinuousSearch; @@ -540,11 +532,6 @@ extern const base::Feature kRequestDesktopSiteForTablets; #endif -#if defined(OS_WIN) -COMPONENT_EXPORT(CHROME_FEATURES) -extern const base::Feature kSafetyCheckChromeCleanerChild; -#endif - #if BUILDFLAG(IS_CHROMEOS_ASH) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kSchedulerConfiguration;
diff --git a/chrome/common/chromeos/extensions/api/_api_features.json b/chrome/common/chromeos/extensions/api/_api_features.json index 3eeb3178..50962d7 100644 --- a/chrome/common/chromeos/extensions/api/_api_features.json +++ b/chrome/common/chromeos/extensions/api/_api_features.json
@@ -8,6 +8,15 @@ // See chrome/common/extensions/api/_features.md to understand this file, as // well as feature.h, simple_feature.h, and feature_provider.h. { + "os.diagnostics": { + // TODO(lamzin): introduce a separate permission instead of manifest + // dependency. + "dependencies": [ "manifest:chromeos_system_extension" ], + "contexts": [ + "blessed_extension" + ], + "channel": "dev" + }, "os.telemetry": { // TODO(lamzin): introduce a separate permission instead of manifest // dependency.
diff --git a/chrome/common/chromeos/extensions/api/api_sources.gni b/chrome/common/chromeos/extensions/api/api_sources.gni index a1d7c815..ac91f8a 100644 --- a/chrome/common/chromeos/extensions/api/api_sources.gni +++ b/chrome/common/chromeos/extensions/api/api_sources.gni
@@ -8,7 +8,10 @@ assert(enable_extensions) -schema_sources_ = [ "telemetry.idl" ] +schema_sources_ = [ + "diagnostics.idl", + "telemetry.idl", +] chromeos_system_extensions_api_schema_sources = get_path_info(schema_sources_, "abspath")
diff --git a/chrome/common/chromeos/extensions/api/diagnostics.idl b/chrome/common/chromeos/extensions/api/diagnostics.idl new file mode 100644 index 0000000..8d1553f --- /dev/null +++ b/chrome/common/chromeos/extensions/api/diagnostics.idl
@@ -0,0 +1,38 @@ +// Copyright 2021 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. + +// Use the <code>chrome.os.diagnostics</code> API to get telemetry data. +// +// Many types defined here map with Mojo structs defined in +// chromeos/services/cros_healthd/public/mojom/cros_healthd_diagnostics.mojom. +[implemented_in = "chrome/browser/chromeos/extensions/telemetry/api/diagnostics_api.h"] +namespace os.diagnostics { + enum RoutineStatus { + ready, + running, + waiting, + passed, + failed, + error, + cancelled, + failed_to_start, + removed, + cancelling, + unsupported, + not_run + }; + + dictionary RunRoutineResponse { + long id; + + RoutineStatus status; + }; + + callback RunRoutineCallback = void (RunRoutineResponse response); + + interface Functions { + // Starts battery capacity routine. + [supportsPromises] static void runBatteryCapacityRoutine(RunRoutineCallback callback); + }; +};
diff --git a/chrome/common/extensions/api/_api_features.json b/chrome/common/extensions/api/_api_features.json index acc7049..8237df9c 100644 --- a/chrome/common/extensions/api/_api_features.json +++ b/chrome/common/extensions/api/_api_features.json
@@ -120,7 +120,8 @@ "channel": "stable", "contexts": ["webui"], "matches": [ - "chrome://bookmarks/*" + "chrome://bookmarks/*", + "chrome://read-later.top-chrome/*" ] }], "bookmarks": [{
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index c506774..20679af 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -494,6 +494,7 @@ "//ash:test_support", "//ash/components/account_manager", "//ash/constants", + "//ash/public/cpp:test_support", "//chrome/browser/chromeos", "//chromeos/dbus/session_manager", "//chromeos/dbus/tpm_manager", @@ -4338,7 +4339,6 @@ "../browser/download/offline_item_utils_unittest.cc", "../browser/endpoint_fetcher/endpoint_fetcher_unittest.cc", "../browser/engagement/important_sites_util_unittest.cc", - "../browser/engagement/site_engagement_helper_unittest.cc", "../browser/engagement/site_engagement_service_unittest.cc", "../browser/enterprise/util/managed_browser_utils_unittest.cc", "../browser/external_protocol/external_protocol_handler_unittest.cc", @@ -7041,6 +7041,7 @@ "../browser/enterprise/connectors/device_trust/signals:test_support", "../browser/enterprise/connectors/device_trust/signals/decorators/common", "../browser/enterprise/connectors/device_trust/signals/decorators/common:test_support", + "../browser/enterprise/connectors/device_trust/signals/decorators/common:unit_tests", ] }
diff --git a/chrome/test/data/webui/settings/category_setting_exceptions_tests.js b/chrome/test/data/webui/settings/category_setting_exceptions_tests.js index 16ac937..a4abec98 100644 --- a/chrome/test/data/webui/settings/category_setting_exceptions_tests.js +++ b/chrome/test/data/webui/settings/category_setting_exceptions_tests.js
@@ -25,12 +25,6 @@ */ let browserProxy = null; - suiteSetup(function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: false, - }); - }); - // Initialize a category-setting-exceptions before each test. setup(function() { browserProxy = new TestSiteSettingsPrefsBrowserProxy(); @@ -46,10 +40,6 @@ assertTrue(!!testElement); }); - test('header visibility', function() { - assertFalse(isChildVisible(testElement, '#exceptionHeader')); - }); - test( 'allow site list is hidden when showAllowSiteList_ is false', function() { testElement.showAllowSiteList_ = false; @@ -194,28 +184,3 @@ return Promise.all([initializationTest, updateTest]); }); }); - -suite('ContentSettingsRedesign', function() { - /** - * A site settings exceptions created before each test. - * @type {SiteSettingsExceptionsElement} - */ - let testElement; - - suiteSetup(function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: true, - }); - }); - - // Initialize a category-setting-exceptions before each test. - setup(function() { - PolymerTest.clearBody(); - testElement = document.createElement('category-setting-exceptions'); - document.body.appendChild(testElement); - }); - - test('header visibility', function() { - assertTrue(isChildVisible(testElement, '#exceptionHeader')); - }); -});
diff --git a/chrome/test/data/webui/settings/chrome_cleanup_page_test.js b/chrome/test/data/webui/settings/chrome_cleanup_page_test.js index b26a400..60a44b20 100644 --- a/chrome/test/data/webui/settings/chrome_cleanup_page_test.js +++ b/chrome/test/data/webui/settings/chrome_cleanup_page_test.js
@@ -40,9 +40,8 @@ } /** @override */ - startScanning(logsUploadEnabled, notificationEnabled) { - this.methodCalled( - 'startScanning', [logsUploadEnabled, notificationEnabled]); + startScanning(logsUploadEnabled) { + this.methodCalled('startScanning', logsUploadEnabled); } /** @override */ @@ -367,47 +366,26 @@ assertFalse(!!actionButton); }); - /** - * @param {boolean} clickNotification Whether to test the case - * where the user clicks on the completion notification option. - * @return {!Promise} - */ - async function startScanFromIdle(clickNotification) { + test('startScanFromIdle', function() { updateReportingEnabledPref(false); webUIListenerCallback( 'chrome-cleanup-on-idle', ChromeCleanupIdleReason.INITIAL); flush(); - if (clickNotification) { - const notificationControl = chromeCleanupPage.shadowRoot.querySelector( - '#chromeCleanupShowNotificationControl'); - assertTrue(!!notificationControl); - notificationControl.$.checkbox.click(); - } - const actionButton = chromeCleanupPage.shadowRoot.querySelector('#action-button'); assertTrue(!!actionButton); actionButton.click(); - const [logsUploadEnabled, notificationEnabled] = - await chromeCleanupProxy.whenCalled('startScanning'); - assertFalse(logsUploadEnabled); - // Notification is disabled by default, hence a click enables it. - assertEquals(clickNotification, notificationEnabled); - webUIListenerCallback('chrome-cleanup-on-scanning', false); - flush(); + return chromeCleanupProxy.whenCalled('startScanning') + .then(function(logsUploadEnabled) { + assertFalse(logsUploadEnabled); + webUIListenerCallback('chrome-cleanup-on-scanning', false); + flush(); - const spinner = - chromeCleanupPage.shadowRoot.querySelector('#waiting-spinner'); - assertTrue(spinner.active); - } - - test('startScanFromIdle_NotificationDisabled', function() { - return startScanFromIdle(false); - }); - - test('startScanFromIdle_NotificationEnabled', function() { - return startScanFromIdle(true); + const spinner = + chromeCleanupPage.shadowRoot.querySelector('#waiting-spinner'); + assertTrue(spinner.active); + }); }); test('scanFoundNothing', function() {
diff --git a/chrome/test/data/webui/settings/cookies_page_test.js b/chrome/test/data/webui/settings/cookies_page_test.js index 0c0e86d..70a9f358 100644 --- a/chrome/test/data/webui/settings/cookies_page_test.js +++ b/chrome/test/data/webui/settings/cookies_page_test.js
@@ -27,12 +27,6 @@ /** @type {!SettingsCookiesPageElement} */ let page; - suiteSetup(function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: false, - }); - }); - setup(function() { testMetricsBrowserProxy = new TestMetricsBrowserProxy(); MetricsBrowserProxyImpl.setInstance(testMetricsBrowserProxy); @@ -61,7 +55,7 @@ test('ElementVisibility', async function() { await flushTasks(); - assertFalse(isChildVisible(page, '#exceptionHeader')); + assertTrue(isChildVisible(page, '#exceptionHeader')); assertTrue(isChildVisible(page, '#clearOnExit')); assertTrue(isChildVisible(page, '#doNotTrack')); assertTrue(isChildVisible(page, '#networkPrediction')); @@ -261,32 +255,3 @@ assertFalse(page.shadowRoot.querySelector('#toast').open); }); }); - -suite('ContentSettingsRedesign', function() { - /** @type {!SettingsCookiesPageElement} */ - let page; - - suiteSetup(function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: true, - }); - }); - - setup(function() { - document.body.innerHTML = ''; - page = /** @type {!SettingsCookiesPageElement} */ ( - document.createElement('settings-cookies-page')); - page.prefs = { - generated: { - cookie_session_only: {value: false}, - cookie_primary_setting: - {type: chrome.settingsPrivate.PrefType.NUMBER, value: 0}, - }, - }; - document.body.appendChild(page); - }); - - test('HeaderVisibility', async function() { - assertTrue(isChildVisible(page, '#exceptionHeader')); - }); -});
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js index e37991f..67d5828 100644 --- a/chrome/test/data/webui/settings/cr_settings_browsertest.js +++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -387,15 +387,6 @@ get browsePreload() { return 'chrome://settings/test_loader.html?module=settings/safety_check_chrome_cleaner_test.js'; } - - /** @override */ - get featureListInternal() { - return { - enabled: [ - 'features::kSafetyCheckChromeCleanerChild', - ], - }; - } }; TEST_F('CrSettingsSafetyCheckChromeCleanerTest', 'All', function() { @@ -487,10 +478,6 @@ runMochaSuite('PrivacyPage'); }); -TEST_F('CrSettingsPrivacyPageTest', 'ContentSettingsRedesign', function() { - runMochaSuite('ContentSettingsRedesign'); -}); - TEST_F('CrSettingsPrivacyPageTest', 'PrivacyReviewEnabled', function() { runMochaSuite('PrivacyReviewEnabled'); });
diff --git a/chrome/test/data/webui/settings/privacy_page_test.js b/chrome/test/data/webui/settings/privacy_page_test.js index 08a4360..683d624 100644 --- a/chrome/test/data/webui/settings/privacy_page_test.js +++ b/chrome/test/data/webui/settings/privacy_page_test.js
@@ -28,6 +28,9 @@ routes.SITE_SETTINGS_BACKGROUND_SYNC, routes.SITE_SETTINGS_CAMERA, routes.SITE_SETTINGS_CLIPBOARD, + routes.SITE_SETTINGS_FONT_ACCESS, + routes.SITE_SETTINGS_FILE_HANDLING, + routes.SITE_SETTINGS_FILE_SYSTEM_WRITE, routes.SITE_SETTINGS_HANDLERS, routes.SITE_SETTINGS_HID_DEVICES, routes.SITE_SETTINGS_IDLE_DETECTION, @@ -37,6 +40,7 @@ routes.SITE_SETTINGS_MICROPHONE, routes.SITE_SETTINGS_MIDI_DEVICES, routes.SITE_SETTINGS_NOTIFICATIONS, + routes.SITE_SETTINGS_PAYMENT_HANDLER, routes.SITE_SETTINGS_PDF_DOCUMENTS, routes.SITE_SETTINGS_POPUPS, routes.SITE_SETTINGS_PROTECTED_CONTENT, @@ -48,21 +52,13 @@ // TODO(crbug.com/1128902) After restructure add coverage for elements on // routes which depend on flags being enabled. - // routes.SITE_SETTINGS_FILE_SYSTEM_WRITE, - // routes.SITE_SETTINGS_PAYMENT_HANDLER, - - // Doesn't contain toggle or radio buttons - // routes.SITE_SETTINGS_ZOOM_LEVELS, -]; - -/** @type {!Array<!Route>} */ -const notRedesignedPages = [ - // Content settings that depend on flags being enabled. // routes.SITE_SETTINGS_BLUETOOTH_SCANNING, // routes.SITE_SETTINGS_BLUETOOTH_DEVICES, // routes.SITE_SETTINGS_WINDOW_PLACEMENT, - // routes.SITE_SETTINGS_FONT_ACCESS, - // routes.SITE_SETTINGS_FILE_HANDLING, + + // Doesn't contain toggle or radio buttons + // routes.SITE_SETTINGS_INSECURE_CONTENT, + // routes.SITE_SETTINGS_ZOOM_LEVELS, ]; suite('PrivacyPage', function() { @@ -82,7 +78,6 @@ suiteSetup(function() { loadTimeData.overrideValues({ - enableContentSettingsRedesign: false, privacyReviewEnabled: false, }); }); @@ -152,33 +147,6 @@ testLabels[1]); }); - test('ContentSettingsRedesignVisibility', async function() { - // Ensure pages are visited so that HTML components are stamped. - redesignedPages.forEach(route => Router.getInstance().navigateTo(route)); - notRedesignedPages.forEach(route => Router.getInstance().navigateTo(route)); - await flushTasks(); - - assertFalse(loadTimeData.getBoolean('enableContentSettingsRedesign')); - // protocol handlers, pdf documents and protected content (except chromeos - // and win) do not use category-default-setting, resulting in the -3 (or -2) - // below. - // <if expr="chromeos or is_win"> - assertEquals( - page.root.querySelectorAll('category-default-setting').length, - redesignedPages.length + notRedesignedPages.length - 2); - // </if> - // <if expr="not chromeos and not is_win"> - assertEquals( - page.root.querySelectorAll('category-default-setting').length, - redesignedPages.length + notRedesignedPages.length - 3); - // </if> - assertEquals( - page.root.querySelectorAll('settings-category-default-radio-group') - .length, - 0); - assertFalse(isChildVisible(page, '#notficationRadioGroup')); - }); - test('privacyReviewRowNotVisible', function() { assertFalse(isChildVisible(page, '#privacyReviewLinkRow')); }); @@ -188,6 +156,42 @@ .classList.contains('hr')); }); + test('ContentSettingsVisibility', async function() { + // Ensure pages are visited so that HTML components are stamped. + redesignedPages.forEach(route => Router.getInstance().navigateTo(route)); + await flushTasks(); + + // All redesigned pages, except notifications, protocol handlers, pdf + // documents and protected content (except chromeos and win), will use a + // settings-category-default-radio-group. + // <if expr="chromeos or is_win"> + assertEquals( + page.root.querySelectorAll('settings-category-default-radio-group') + .length, + redesignedPages.length - 3); + // </if> + // <if expr="not chromeos and not is_win"> + assertEquals( + page.root.querySelectorAll('settings-category-default-radio-group') + .length, + redesignedPages.length - 4); + // </if> + }); + + test('NotificationPage', async function() { + Router.getInstance().navigateTo(routes.SITE_SETTINGS_NOTIFICATIONS); + await flushTasks(); + + assertTrue(isChildVisible(page, '#notificationRadioGroup')); + const categorySettingExceptions = + /** @type {!CategorySettingExceptionsElement} */ + (page.shadowRoot.querySelector('category-setting-exceptions')); + assertTrue(isVisible(categorySettingExceptions)); + assertEquals( + ContentSettingsTypes.NOTIFICATIONS, categorySettingExceptions.category); + assertFalse(isChildVisible(page, 'category-default-setting')); + }); + test('privacySandboxRowSublabel', async function() { page.set('prefs.privacy_sandbox.apis_enabled.value', true); await flushTasks(); @@ -239,71 +243,6 @@ }); }); -suite('ContentSettingsRedesign', function() { - /** @type {!SettingsPrivacyPageElement} */ - let page; - - suiteSetup(function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: true, - }); - }); - - setup(async function() { - document.body.innerHTML = ''; - page = /** @type {!SettingsPrivacyPageElement} */ - (document.createElement('settings-privacy-page')); - document.body.appendChild(page); - flush(); - }); - - teardown(function() { - page.remove(); - Router.getInstance().navigateTo(routes.BASIC); - }); - - test('ContentSettingsRedesignVisibility', async function() { - // Ensure pages are visited so that HTML components are stamped. - redesignedPages.forEach(route => Router.getInstance().navigateTo(route)); - notRedesignedPages.forEach(route => Router.getInstance().navigateTo(route)); - await flushTasks(); - - assertTrue(loadTimeData.getBoolean('enableContentSettingsRedesign')); - assertEquals( - page.root.querySelectorAll('category-default-setting').length, - notRedesignedPages.length); - // All redesigned pages, except notifications, protocol handlers, pdf - // documents and protected content (except chromeos and win), will use a - // settings-category-default-radio-group. - // <if expr="chromeos or is_win"> - assertEquals( - page.root.querySelectorAll('settings-category-default-radio-group') - .length, - redesignedPages.length - 3); - // </if> - // <if expr="not chromeos and not is_win"> - assertEquals( - page.root.querySelectorAll('settings-category-default-radio-group') - .length, - redesignedPages.length - 4); - // </if> - }); - - test('NotificationPageRedesign', async function() { - Router.getInstance().navigateTo(routes.SITE_SETTINGS_NOTIFICATIONS); - await flushTasks(); - - assertTrue(isChildVisible(page, '#notificationRadioGroup')); - const categorySettingExceptions = - /** @type {!CategorySettingExceptionsElement} */ - (page.shadowRoot.querySelector('category-setting-exceptions')); - assertTrue(isVisible(categorySettingExceptions)); - assertEquals( - ContentSettingsTypes.NOTIFICATIONS, categorySettingExceptions.category); - assertFalse(isChildVisible(page, 'category-default-setting')); - }); -}); - suite('PrivacyPageSound', function() { /** @type {!TestPrivacyPageBrowserProxy} */ let testBrowserProxy;
diff --git a/chrome/test/data/webui/settings/protocol_handlers_tests.js b/chrome/test/data/webui/settings/protocol_handlers_tests.js index 6cf5f80..6d52ce3 100644 --- a/chrome/test/data/webui/settings/protocol_handlers_tests.js +++ b/chrome/test/data/webui/settings/protocol_handlers_tests.js
@@ -93,75 +93,13 @@ }); } - test('redesign, radio visible', function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: true, - }); - return initPage().then(function() { - assertTrue(isChildVisible(testElement, '#protcolHandlersRadio')); - }); - }); - - test('redesign, set protocol handlers default called', () => { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: true, - }); + test('set protocol handlers default called', () => { return initPage().then(() => { testElement.$$('#protcolHandlersRadioBlock').click(); return browserProxy.whenCalled('setProtocolHandlerDefault'); }); }); - test('no redesign, radio invisible', function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: false, - }); - return initPage().then(function() { - assertFalse(isChildVisible(testElement, '#protcolHandlersRadio')); - }); - }); - - test('no redesign, set protocol handlers default called', () => { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: false, - }); - return initPage().then(() => { - testElement.$$('#protocolHandlersToggle').click(); - return browserProxy.whenCalled('setProtocolHandlerDefault'); - }); - }); - - test('toggle button', async function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: false, - }); - await initPage(); - testElement.toggleOnLabel = 'on'; - testElement.toggleOffLabel = 'off'; - const toggle_button = /** @type {!SettingsToggleButton} */ ( - testElement.$$('#protocolHandlersToggle')); - - webUIListenerCallback('setHandlersEnabled', false); - await flushTasks(); - assertEquals('off', toggle_button.label); - assertFalse(toggle_button.checked); - - toggle_button.click(); - let updatedValue = - await browserProxy.whenCalled('setProtocolHandlerDefault'); - assertTrue(updatedValue); - assertEquals('on', toggle_button.label); - assertTrue(toggle_button.checked); - - browserProxy.reset(); - - toggle_button.click(); - updatedValue = await browserProxy.whenCalled('setProtocolHandlerDefault'); - assertFalse(updatedValue); - assertEquals('off', toggle_button.label); - assertFalse(toggle_button.checked); - }); - test('empty list', function() { return initPage().then(function() { const listFrames = testElement.root.querySelectorAll('.list-frame');
diff --git a/chrome/test/data/webui/settings/safety_check_chrome_cleaner_test.js b/chrome/test/data/webui/settings/safety_check_chrome_cleaner_test.js index 116b76c4..f5c5257 100644 --- a/chrome/test/data/webui/settings/safety_check_chrome_cleaner_test.js +++ b/chrome/test/data/webui/settings/safety_check_chrome_cleaner_test.js
@@ -6,7 +6,7 @@ import {webUIListenerCallback} from 'chrome://resources/js/cr.m.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {ChromeCleanupProxyImpl} from 'chrome://settings/lazy_load.js'; +import {ChromeCleanupProxy, ChromeCleanupProxyImpl} from 'chrome://settings/lazy_load.js'; import {MetricsBrowserProxyImpl, Router, routes, SafetyCheckCallbackConstants, SafetyCheckChromeCleanerStatus, SafetyCheckIconStatus, SafetyCheckInteractions, SettingsSafetyCheckChromeCleanerChildElement} from 'chrome://settings/settings.js'; import {assertEquals, assertFalse, assertTrue} from '../chai_assert.js'; @@ -95,12 +95,6 @@ /** @type {!SettingsSafetyCheckChromeCleanerChildElement} */ let page; - suiteSetup(function() { - loadTimeData.overrideValues({ - safetyCheckChromeCleanerChildEnabled: true, - }); - }); - setup(function() { chromeCleanupBrowserProxy = TestBrowserProxy.fromClass(ChromeCleanupProxy); chromeCleanupBrowserProxy.setResultFor( @@ -310,34 +304,3 @@ assertEquals(routes.CHROME_CLEANUP, Router.getInstance().getCurrentRoute()); }); }); - -suite('SafetyCheckChromeCleanerFlagDisabledTests', function() { - /** @type {!SettingsSafetyCheckChromeCleanerChildElement} */ - let page; - - suiteSetup(function() { - loadTimeData.overrideValues({ - safetyCheckChromeCleanerChildEnabled: false, - }); - }); - - setup(function() { - document.body.innerHTML = ''; - page = /** @type {!SettingsSafetyCheckChromeCleanerChildElement} */ ( - document.createElement('settings-safety-check-chrome-cleaner-child')); - document.body.appendChild(page); - flush(); - }); - - teardown(function() { - page.remove(); - Router.getInstance().navigateTo(routes.BASIC); - }); - - test('testChromeCleanerNotPresent', function() { - fireSafetyCheckChromeCleanerEvent(SafetyCheckChromeCleanerStatus.INFECTED); - flush(); - // The UI is not visible. - assertFalse(!!page.shadowRoot.querySelector('#safetyCheckChild')); - }); -});
diff --git a/chrome/test/data/webui/settings/site_settings_page_test.js b/chrome/test/data/webui/settings/site_settings_page_test.js index 15e4ad0..10d4c9b 100644 --- a/chrome/test/data/webui/settings/site_settings_page_test.js +++ b/chrome/test/data/webui/settings/site_settings_page_test.js
@@ -81,41 +81,7 @@ assertEquals(testLabels[1], cookiesLinkRow.subLabel); }); - test('NotificationsLinkRowSublabel_RedesignDisabled', async function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: false, - }); - - const notificationsLinkRow = /** @type {!CrLinkRowElement} */ ( - page.shadowRoot.querySelector('#basicPermissionsList') - .shadowRoot.querySelector('#notifications')); - - page.set('prefs.generated.notification.value', NotificationSetting.BLOCK); - await flushTasks(); - assertEquals( - loadTimeData.getString('siteSettingsBlocked'), - notificationsLinkRow.subLabel); - - page.set( - 'prefs.generated.notification.value', - NotificationSetting.QUIETER_MESSAGING); - await flushTasks(); - assertEquals( - loadTimeData.getString('siteSettingsAskBeforeSending'), - notificationsLinkRow.subLabel); - - page.set('prefs.generated.notification.value', NotificationSetting.ASK); - await flushTasks(); - assertEquals( - loadTimeData.getString('siteSettingsAskBeforeSending'), - notificationsLinkRow.subLabel); - }); - - test('NotificationsLinkRowSublabel_RedesignEnabled', async function() { - loadTimeData.overrideValues({ - enableContentSettingsRedesign: true, - }); - + test('NotificationsLinkRowSublabel', async function() { const notificationsLinkRow = /** @type {!CrLinkRowElement} */ ( page.shadowRoot.querySelector('#basicPermissionsList') .shadowRoot.querySelector('#notifications'));
diff --git a/chrome/updater/BUILD.gn b/chrome/updater/BUILD.gn index c82d51f..6a7ad00 100644 --- a/chrome/updater/BUILD.gn +++ b/chrome/updater/BUILD.gn
@@ -610,12 +610,15 @@ deps += [ ":base" ] } - data_deps = [ ":updater_integration_tests_helper" ] + data_deps = [ + ":updater_integration_tests_helper", + "//chrome/updater/test/test_app", + ] if (is_mac) { - data_deps += [ - "//chrome/updater/mac:updater_bundle_test", - "//chrome/updater/test/test_app", - ] + data_deps += [ "//chrome/updater/mac:updater_bundle_test" ] + } + if (is_win) { + data_deps += [ ":test_service_files" ] } if (is_win) { data_deps += [ ":test_service_files" ]
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index c658e16a..d9ecc420 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -14160.0.0 \ No newline at end of file +14161.0.0 \ No newline at end of file
diff --git a/chromeos/components/camera_app_ui/resources/strings/camera_strings_ja.xtb b/chromeos/components/camera_app_ui/resources/strings/camera_strings_ja.xtb index 71dc093..a3a115f 100644 --- a/chromeos/components/camera_app_ui/resources/strings/camera_strings_ja.xtb +++ b/chromeos/components/camera_app_ui/resources/strings/camera_strings_ja.xtb
@@ -43,6 +43,7 @@ <translation id="3227137524299004712">マイク</translation> <translation id="3240426699337459095">リンクをコピーしました</translation> <translation id="3259149966178251584">カメラの解像度</translation> +<translation id="3260401663013584785">ドキュメントを検出できませんでした</translation> <translation id="3448774564454087943">短すぎるため動画は保存されません</translation> <translation id="3517926952904427380">縦向きの写真を撮影できません</translation> <translation id="3569311554794739032"><ph name="FILE" /> を削除してもよろしいですか?</translation> @@ -50,6 +51,7 @@ <translation id="3838931309141338733">バーコード スキャン</translation> <translation id="3892148308691398805">テキストをコピー</translation> <translation id="4118525110028899586">録画を一時停止</translation> +<translation id="4121305183798804752">ドキュメントを検出しました</translation> <translation id="4269820728363426813">リンクアドレスをコピー</translation> <translation id="4279490309300973883">ミラーリング</translation> <translation id="4329152592498422850">スクエア写真の撮影に切り替え</translation>
diff --git a/chromeos/components/camera_app_ui/resources/strings/camera_strings_or.xtb b/chromeos/components/camera_app_ui/resources/strings/camera_strings_or.xtb index a2f6241e..e044dcab 100644 --- a/chromeos/components/camera_app_ui/resources/strings/camera_strings_or.xtb +++ b/chromeos/components/camera_app_ui/resources/strings/camera_strings_or.xtb
@@ -43,6 +43,7 @@ <translation id="3227137524299004712">ମାଇକ୍ରୋଫୋନ୍</translation> <translation id="3240426699337459095">ଲିଙ୍କ୍ କପି ହୋଇଛି</translation> <translation id="3259149966178251584">କ୍ୟାମେରା ରିଜୋଲ୍ୟୁଶନ୍</translation> +<translation id="3260401663013584785">କୌଣସି ଡକ୍ୟୁମେଣ୍ଟ ଚିହ୍ନଟ କରାଯାଇପାରିଲା ନାହିଁ</translation> <translation id="3448774564454087943">ଭିଡିଓଟି ବହୁତ ଛୋଟ ହୋଇଥିବା ଯୋଗୁଁ ଏହା ସେଭ୍ ହୋଇନାହିଁ</translation> <translation id="3517926952904427380">ପୋଟ୍ରେଟ୍ ଫଟୋ ଉଠାଇବା ପାଇଁ ଅକ୍ଷମ</translation> <translation id="3569311554794739032">ଆପଣ କ'ଣ ପ୍ରକୃତରେ <ph name="FILE" />କୁ କାଢ଼ି ଦେବାକୁ ଚାହୁଁଛନ୍ତି?</translation> @@ -50,6 +51,7 @@ <translation id="3838931309141338733">ବାରକୋଡ୍ ସ୍କାନ୍ କରନ୍ତୁ</translation> <translation id="3892148308691398805">ଟେକ୍ସଟ୍ କପି କରନ୍ତୁ</translation> <translation id="4118525110028899586">ରେକର୍ଡିଂ ବିରତ କରନ୍ତୁ</translation> +<translation id="4121305183798804752">ଡକ୍ୟୁମେଣ୍ଟ ଚିହ୍ନଟ କରାଯାଇଛି</translation> <translation id="4269820728363426813">ଲିଙ୍କ୍ ଠିକଣା କପି କରନ୍ତୁ</translation> <translation id="4279490309300973883">ପ୍ରତିଫଳନ</translation> <translation id="4329152592498422850">ବର୍ଗାକାର ଫଟୋ ଉଠାଇବା ପାଇଁ ସ୍ୱିଚ୍ କରନ୍ତୁ</translation>
diff --git a/chromeos/profiles/atom.afdo.newest.txt b/chromeos/profiles/atom.afdo.newest.txt index ebc27d4d..64b78be 100644 --- a/chromeos/profiles/atom.afdo.newest.txt +++ b/chromeos/profiles/atom.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-atom-94-4601.0-1629112876-benchmark-94.0.4606.7-r1-redacted.afdo.xz +chromeos-chrome-amd64-atom-94-4601.0-1629112876-benchmark-94.0.4606.8-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/bigcore.afdo.newest.txt b/chromeos/profiles/bigcore.afdo.newest.txt index 2fc09aa0..80cfad85 100644 --- a/chromeos/profiles/bigcore.afdo.newest.txt +++ b/chromeos/profiles/bigcore.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-bigcore-94-4601.0-1629109617-benchmark-94.0.4606.7-r1-redacted.afdo.xz +chromeos-chrome-amd64-bigcore-94-4601.0-1629109617-benchmark-94.0.4606.8-r1-redacted.afdo.xz
diff --git a/chromeos/strings/chromeos_strings_ja.xtb b/chromeos/strings/chromeos_strings_ja.xtb index 71b00f5da..4304d2a 100644 --- a/chromeos/strings/chromeos_strings_ja.xtb +++ b/chromeos/strings/chromeos_strings_ja.xtb
@@ -37,6 +37,7 @@ <translation id="1621067168122174824">充電テストを実行</translation> <translation id="1639239467298939599">読み込み中</translation> <translation id="1641857168437328880">ドキュメント フィーダー(片面)</translation> +<translation id="1643449475550628585">壁紙画像を毎日変更する</translation> <translation id="1644574205037202324">履歴</translation> <translation id="1662989795263954667">停止 - インク切れ</translation> <translation id="1703835215927279855">Letter</translation> @@ -76,6 +77,7 @@ <translation id="2448312741937722512">種類</translation> <translation id="2461822463642141190">電流</translation> <translation id="249323605434939166"><ph name="QUERY_TEXT" /> · <ph name="SOURCE_LANGUAGE_NAME" /></translation> +<translation id="2505327257735685095">現在の壁紙画像を更新する</translation> <translation id="2517472476991765520">スキャン</translation> <translation id="2570743873672969996"><ph name="TEST_NAME" /> のテストを実行しています...</translation> <translation id="2585245331261708204">Chrome OS の最新情報</translation>
diff --git a/chromeos/strings/chromeos_strings_or.xtb b/chromeos/strings/chromeos_strings_or.xtb index a3d6bd23..e27e4a19 100644 --- a/chromeos/strings/chromeos_strings_or.xtb +++ b/chromeos/strings/chromeos_strings_or.xtb
@@ -37,6 +37,7 @@ <translation id="1621067168122174824">ବ୍ୟାଟେରୀ ଚାର୍ଜ ଟେଷ୍ଟ ଚଲାନ୍ତୁ</translation> <translation id="1639239467298939599">ଲୋଡ୍ ହେଉଛି</translation> <translation id="1641857168437328880">ଡକ୍ୟୁମେଣ୍ଟ ଫିଡର୍ (ଗୋଟିଏ-ପାର୍ଶ୍ୱ)</translation> +<translation id="1643449475550628585">ୱାଲପେପର୍ ଛବିକୁ ଦୈନିକ ପରିବର୍ତ୍ତନ କରନ୍ତୁ</translation> <translation id="1644574205037202324">ଇତିବୃତ୍ତି</translation> <translation id="1662989795263954667">ବନ୍ଦ ହୋଇଯାଇଛି - ସ୍ୟାହି ସରିଯାଇଛି</translation> <translation id="1703835215927279855">ଲେଟର୍</translation> @@ -76,6 +77,7 @@ <translation id="2448312741937722512">ପ୍ରକାର</translation> <translation id="2461822463642141190">ବର୍ତ୍ତମାନର</translation> <translation id="249323605434939166"><ph name="QUERY_TEXT" /> · <ph name="SOURCE_LANGUAGE_NAME" /></translation> +<translation id="2505327257735685095">ବର୍ତ୍ତମାନର ୱାଲପେପର୍ ଛବିକୁ ରିଫ୍ରେସ୍ କରନ୍ତୁ</translation> <translation id="2517472476991765520">ସ୍କାନ୍ କରନ୍ତୁ</translation> <translation id="2570743873672969996"><ph name="TEST_NAME" /> ପରୀକ୍ଷା ଚଲାଯାଉଛି...</translation> <translation id="2585245331261708204">Chrome OSରେ ନୂଆ କଣ ଅଛି</translation>
diff --git a/chromeos/tast_control.gni b/chromeos/tast_control.gni index cba88f3..ad658bf 100644 --- a/chromeos/tast_control.gni +++ b/chromeos/tast_control.gni
@@ -24,12 +24,6 @@ # crbug.com/1184931 "health.ProbeBatteryMetrics", - # crbug.com/1185030 - "inputs.VirtualKeyboardJapaneseInputs.stable", - - # crbug.com/1212788 - "apps.LaunchGallery.stable", - # crbug.com/1182538 "policy.URLCheck.allowlist", "policy.URLCheck.blocklist",
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc index 6f6e2d4e..b19f548 100644 --- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc +++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -9,7 +9,6 @@ #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/i18n/rtl.h" -#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/user_action_tester.h" @@ -38,6 +37,7 @@ #include "ui/gfx/geometry/rect_f.h" using testing::_; +using testing::NiceMock; namespace autofill { @@ -52,6 +52,8 @@ class MockAutofillDriver : public TestAutofillDriver { public: MockAutofillDriver() = default; + MockAutofillDriver(const MockAutofillDriver&) = delete; + MockAutofillDriver& operator=(const MockAutofillDriver&) = delete; // Mock methods to enable testability. MOCK_METHOD(void, RendererShouldAcceptDataListSuggestion, @@ -67,14 +69,13 @@ RendererShouldPreviewFieldWithValue, (const FieldGlobalId&, const std::u16string&), (override)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockAutofillDriver); }; class MockAutofillClient : public TestAutofillClient { public: MockAutofillClient() = default; + MockAutofillClient(const MockAutofillClient&) = delete; + MockAutofillClient& operator=(const MockAutofillClient&) = delete; MOCK_METHOD(void, ScanCreditCard, (CreditCardScanCallback callbacK), @@ -94,9 +95,6 @@ // Mock the client query ID check. bool IsQueryIDRelevant(int query_id) { return query_id == kRecentQueryId; } - - private: - DISALLOW_COPY_AND_ASSIGN(MockAutofillClient); }; class MockBrowserAutofillManager : public BrowserAutofillManager { @@ -107,6 +105,9 @@ client, client->GetPersonalDataManager(), client->GetAutocompleteHistoryManager()) {} + MockBrowserAutofillManager(const MockBrowserAutofillManager&) = delete; + MockBrowserAutofillManager& operator=(const MockBrowserAutofillManager&) = + delete; PopupType GetPopupType(const FormData& form, const FormFieldData& field) override { @@ -161,7 +162,6 @@ private: bool should_show_cards_from_account_option_ = false; - DISALLOW_COPY_AND_ASSIGN(MockBrowserAutofillManager); }; } // namespace @@ -169,10 +169,10 @@ class AutofillExternalDelegateUnitTest : public testing::Test { protected: void SetUp() override { - autofill_driver_ = - std::make_unique<testing::NiceMock<MockAutofillDriver>>(); - browser_autofill_manager_ = std::make_unique<MockBrowserAutofillManager>( - autofill_driver_.get(), &autofill_client_); + autofill_driver_ = std::make_unique<NiceMock<MockAutofillDriver>>(); + browser_autofill_manager_ = + std::make_unique<NiceMock<MockBrowserAutofillManager>>( + autofill_driver_.get(), &autofill_client_); external_delegate_ = std::make_unique<AutofillExternalDelegate>( browser_autofill_manager_.get(), autofill_driver_.get()); } @@ -210,8 +210,8 @@ base::test::SingleThreadTaskEnvironment task_environment_; - testing::NiceMock<MockAutofillClient> autofill_client_; - std::unique_ptr<testing::NiceMock<MockAutofillDriver>> autofill_driver_; + NiceMock<MockAutofillClient> autofill_client_; + std::unique_ptr<NiceMock<MockAutofillDriver>> autofill_driver_; std::unique_ptr<MockBrowserAutofillManager> browser_autofill_manager_; std::unique_ptr<AutofillExternalDelegate> external_delegate_;
diff --git a/components/autofill/core/browser/autofill_metrics_unittest.cc b/components/autofill/core/browser/autofill_metrics_unittest.cc index a483a7b2..1a15628 100644 --- a/components/autofill/core/browser/autofill_metrics_unittest.cc +++ b/components/autofill/core/browser/autofill_metrics_unittest.cc
@@ -14,7 +14,6 @@ #include "base/base64.h" #include "base/feature_list.h" #include "base/ios/ios_util.h" -#include "base/macros.h" #include "base/metrics/metrics_hashes.h" #include "base/metrics/statistics_recorder.h" #include "base/strings/strcat.h" @@ -81,6 +80,7 @@ using ::testing::ElementsAre; using ::testing::HasSubstr; using ::testing::Matcher; +using ::testing::NiceMock; using ::testing::UnorderedPointwise; namespace autofill { @@ -408,7 +408,7 @@ personal_data_->SetSyncServiceForTest(&sync_service_); autocomplete_history_manager_ = - std::make_unique<MockAutocompleteHistoryManager>(); + std::make_unique<NiceMock<MockAutocompleteHistoryManager>>(); payments::TestPaymentsClient* payments_client = new payments::TestPaymentsClient(autofill_driver_->GetURLLoaderFactory(),
diff --git a/components/autofill/core/browser/browser_autofill_manager_unittest.cc b/components/autofill/core/browser/browser_autofill_manager_unittest.cc index 9f24f9b..f7e7f38 100644 --- a/components/autofill/core/browser/browser_autofill_manager_unittest.cc +++ b/components/autofill/core/browser/browser_autofill_manager_unittest.cc
@@ -94,6 +94,7 @@ using testing::Each; using testing::ElementsAre; using testing::HasSubstr; +using testing::NiceMock; using testing::Not; using testing::Return; using testing::SaveArg; @@ -356,7 +357,7 @@ personal_data_.SetPrefService(autofill_client_.GetPrefs()); autocomplete_history_manager_ = - std::make_unique<MockAutocompleteHistoryManager>(); + std::make_unique<NiceMock<MockAutocompleteHistoryManager>>(); autocomplete_history_manager_->Init( /*profile_database=*/database_, /*pref_service=*/autofill_client_.GetPrefs(), @@ -673,7 +674,7 @@ protected: base::test::TaskEnvironment task_environment_; - MockAutofillClient autofill_client_; + NiceMock<MockAutofillClient> autofill_client_; std::unique_ptr<MockAutofillDriver> autofill_driver_; std::unique_ptr<TestBrowserAutofillManager> browser_autofill_manager_; TestAutofillExternalDelegate* external_delegate_;
diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn index 2377dca5..fdf4470 100644 --- a/components/cronet/android/BUILD.gn +++ b/components/cronet/android/BUILD.gn
@@ -958,15 +958,6 @@ "//net/android:net_java", "//net/android:net_java_test_support", "//url:url_java", - "//third_party/google-truth:google_truth_java", - "//third_party/junit", - "//third_party/mockito:mockito_java", - - # Transitive Mockito dependencies - "//third_party/byte_buddy:byte_buddy_agent_java", - "//third_party/byte_buddy:byte_buddy_android_java", - "//third_party/byte_buddy:dx_25_0_2_java", - "//third_party/byte_buddy:byte_buddy_java", ] android_library("cronet_javatests") { @@ -1020,7 +1011,10 @@ "//third_party/android_sdk:android_test_base_java", "//third_party/android_support_test_runner:runner_java", "//third_party/androidx:androidx_test_runner_java", + "//third_party/google-truth:google_truth_java", "//third_party/hamcrest:hamcrest_core_java", + "//third_party/junit", + "//third_party/mockito:mockito_java", ] deps += cronet_javatests_deps_to_package data = [ "//components/cronet/testing/test_server/data/" ]
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetInputStreamTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetInputStreamTest.java index b26c3c192..bc558c6 100644 --- a/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetInputStreamTest.java +++ b/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetInputStreamTest.java
@@ -10,17 +10,10 @@ import androidx.test.filters.SmallTest; -import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.ArgumentMatchers; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.chromium.base.StrictModeContext; import org.chromium.base.test.util.Feature; import org.chromium.net.CronetTestRule; @@ -28,138 +21,98 @@ import java.nio.ByteBuffer; import java.util.concurrent.Callable; -/** - * Test for {@link CronetInputStream}. - */ +/** Test for {@link CronetInputStream}. */ @RunWith(AndroidJUnit4.class) public class CronetInputStreamTest { @Rule public final CronetTestRule mTestRule = new CronetTestRule(); - @Mock - private CronetHttpURLConnection mMockConnection; - - @Before - public void setUp() throws Exception { - // Disable StrictMode constraints for mock initialization. - try (StrictModeContext ignored = StrictModeContext.allowAllVmPolicies()) { - mMockConnection = Mockito.mock(CronetHttpURLConnection.class); - } - } + // public to squelch lint warning about naming + public CronetInputStream underTest; @Test @SmallTest @Feature({"Cronet"}) public void testAvailable_closed_withoutException() throws Exception { - runTestCase(underTest -> { - underTest.setResponseDataCompleted(null); + underTest = new CronetInputStream(new MockHttpURLConnection()); - assertThat(underTest.available()).isEqualTo(0); - }); + underTest.setResponseDataCompleted(null); + + assertThat(underTest.available()).isEqualTo(0); } @Test @SmallTest @Feature({"Cronet"}) public void testAvailable_closed_withException() throws Exception { - runTestCase(underTest -> { - IOException expected = new IOException(); - underTest.setResponseDataCompleted(expected); + underTest = new CronetInputStream(new MockHttpURLConnection()); + IOException expected = new IOException(); + underTest.setResponseDataCompleted(expected); - IOException actual = assertThrowsIoException(() -> underTest.available()); + IOException actual = assertThrowsIoException(() -> underTest.available()); - assertThat(actual).isSameInstanceAs(expected); - }); + assertThat(actual).isSameInstanceAs(expected); } @Test @SmallTest @Feature({"Cronet"}) public void testAvailable_noReads() throws Exception { - runTestCase(underTest -> { assertThat(underTest.available()).isEqualTo(0); }); + underTest = new CronetInputStream(new MockHttpURLConnection()); + + assertThat(underTest.available()).isEqualTo(0); } @Test @SmallTest @Feature({"Cronet"}) public void testAvailable_everythingRead() throws Exception { - runTestCase(underTest -> { - int bytesInBuffer = 10; + int bytesInBuffer = 10; - Mockito.doAnswer(addZerosToBuffer(bytesInBuffer)) - .when(mMockConnection) - .getMoreData(ArgumentMatchers.any()); + underTest = new CronetInputStream(new MockHttpURLConnection(bytesInBuffer)); - for (int i = 0; i < bytesInBuffer; i++) { - underTest.read(); - } + for (int i = 0; i < bytesInBuffer; i++) { + underTest.read(); + } - assertThat(underTest.available()).isEqualTo(0); - }); + assertThat(underTest.available()).isEqualTo(0); } @Test @SmallTest @Feature({"Cronet"}) public void testAvailable_partiallyRead() throws Exception { - runTestCase(underTest -> { - int bytesInBuffer = 10; - int consumed = 3; + int bytesInBuffer = 10; + int consumed = 3; - Mockito.doAnswer(addZerosToBuffer(bytesInBuffer)) - .when(mMockConnection) - .getMoreData(ArgumentMatchers.any()); + underTest = new CronetInputStream(new MockHttpURLConnection(bytesInBuffer)); - for (int i = 0; i < consumed; i++) { - underTest.read(); - } + for (int i = 0; i < consumed; i++) { + underTest.read(); + } - assertThat(underTest.available()).isEqualTo(bytesInBuffer - consumed); - }); + assertThat(underTest.available()).isEqualTo(bytesInBuffer - consumed); } @Test @SmallTest @Feature({"Cronet"}) public void testRead_afterDataCompleted() throws Exception { - runTestCase(underTest -> { - int bytesInBuffer = 10; - int consumed = 3; + int bytesInBuffer = 10; + int consumed = 3; - Mockito.doAnswer(addZerosToBuffer(bytesInBuffer)) - .when(mMockConnection) - .getMoreData(ArgumentMatchers.any()); + underTest = new CronetInputStream(new MockHttpURLConnection(bytesInBuffer)); - for (int i = 0; i < consumed; i++) { - underTest.read(); - } - - IOException expected = new IOException(); - underTest.setResponseDataCompleted(expected); - - IOException actual = assertThrowsIoException(() -> underTest.read()); - - assertThat(actual).isSameInstanceAs(expected); - }); - } - - private void runTestCase(CronetInputStreamTestCase testCase) throws Exception { - try (CronetInputStream underTest = new CronetInputStream(mMockConnection)) { - testCase.runTestCase(underTest); + for (int i = 0; i < consumed; i++) { + underTest.read(); } - } - private static Answer<Void> addZerosToBuffer(int count) { - return new Answer<Void>() { - @Override - public Void answer(InvocationOnMock invocation) { - ByteBuffer arg = (ByteBuffer) invocation.getArguments()[0]; - for (int i = 0; i < count; i++) { - arg.put((byte) 0); - } - return null; - } - }; + IOException expected = new IOException(); + underTest.setResponseDataCompleted(expected); + + IOException actual = assertThrowsIoException(() -> underTest.read()); + + assertThat(actual).isSameInstanceAs(expected); } private static IOException assertThrowsIoException(Callable<?> callable) throws Exception { @@ -173,7 +126,31 @@ throw new AssertionError("No exception was thrown!"); } - private static interface CronetInputStreamTestCase { - void runTestCase(CronetInputStream underTest) throws Exception; + private static class MockHttpURLConnection extends CronetHttpURLConnection { + private final int mBytesToFill; + private boolean mGetMoreDataExpected; + + MockHttpURLConnection() { + super(null, null); + this.mBytesToFill = 0; + mGetMoreDataExpected = false; + } + + MockHttpURLConnection(int bytesToFill) { + super(null, null); + this.mBytesToFill = bytesToFill; + mGetMoreDataExpected = true; + } + + @Override + public void getMoreData(ByteBuffer buffer) { + if (!mGetMoreDataExpected) { + throw new IllegalStateException("getMoreData call not expected!"); + } + mGetMoreDataExpected = false; + for (int i = 0; i < mBytesToFill; i++) { + buffer.put((byte) 0); + } + } } }
diff --git a/components/metrics/file_metrics_provider.cc b/components/metrics/file_metrics_provider.cc index acd4f2c..35e068a 100644 --- a/components/metrics/file_metrics_provider.cc +++ b/components/metrics/file_metrics_provider.cc
@@ -61,27 +61,29 @@ }; constexpr SourceOptions kSourceOptions[] = { - // SOURCE_HISTOGRAMS_ATOMIC_FILE - { - // Ensure that no other process reads this at the same time. - STD_OPEN | base::File::FLAG_EXCLUSIVE_READ, - base::MemoryMappedFile::READ_ONLY, - true - }, - // SOURCE_HISTOGRAMS_ATOMIC_DIR - { - // Ensure that no other process reads this at the same time. - STD_OPEN | base::File::FLAG_EXCLUSIVE_READ, - base::MemoryMappedFile::READ_ONLY, - true - }, - // SOURCE_HISTOGRAMS_ACTIVE_FILE - { - // Allow writing (updated "logged" values) to the file. - STD_OPEN | base::File::FLAG_WRITE, - base::MemoryMappedFile::READ_WRITE, - false - } + // SOURCE_HISTOGRAMS_ATOMIC_FILE + { + // Ensure that no other process reads this at the same time. + STD_OPEN | base::File::FLAG_EXCLUSIVE_READ, + base::MemoryMappedFile::READ_ONLY, + true, + }, + // SOURCE_HISTOGRAMS_ATOMIC_DIR + { + // Ensure that no other process reads this at the same time. + STD_OPEN | base::File::FLAG_EXCLUSIVE_READ, + base::MemoryMappedFile::READ_ONLY, + true, + }, + // SOURCE_HISTOGRAMS_ACTIVE_FILE + { + // Allow writing to the file. This is needed so we can keep track of + // deltas that have been uploaded (by modifying the file), while the + // file may still be open by an external process (e.g. Crashpad). + STD_OPEN | base::File::FLAG_WRITE, + base::MemoryMappedFile::READ_WRITE, + false, + }, }; void DeleteFileWhenPossible(const base::FilePath& path) {
diff --git a/components/metrics/persistent_histograms.cc b/components/metrics/persistent_histograms.cc index 312b47d..eb4d61d 100644 --- a/components/metrics/persistent_histograms.cc +++ b/components/metrics/persistent_histograms.cc
@@ -126,14 +126,26 @@ // "active" filename is supposed to be unique so this shouldn't happen. result = kMappedFileExists; } else { +#if defined(OS_WIN) + // Disallow multiple writers on Windows. Needed to ensure multiple instances + // of Chrome aren't writing to the same file, which could happen in some + // rare circumstances observed in the wild (e.g. on FAT FS where the file + // name ends up not being unique due to truncation and two processes racing + // on base::PathExists(active_file) above). + // TODO(crbug.com/1176977): If this resolves the bug, consider making + // consistent on all platforms. + bool exclusive_write = true; +#else + bool exclusive_write = false; +#endif // Move any spare file into the active position. - // TODO(crbug.com/1183166): Don't do this if |kSpareFileRequired| = false. base::ReplaceFile(spare_file, active_file, nullptr); // Create global allocator using the |active_file|. if (kSpareFileRequired && !base::PathExists(active_file)) { result = kNoSpareFile; } else if (base::GlobalHistogramAllocator::CreateWithFile( - active_file, kAllocSize, kAllocId, kBrowserMetricsName)) { + active_file, kAllocSize, kAllocId, kBrowserMetricsName, + exclusive_write)) { // TODO(crbug.com/1176977): Remove this instrumentation when bug is fixed. // Log the drive type on Windows. #if defined(OS_WIN)
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 4f1daaf..95aef75 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -3814,14 +3814,13 @@ 'id': 20, 'caption': '''Disable synchronization of data with Google''', 'tags': ['filtering', 'google-sharing'], - 'desc': '''Disables data synchronization in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> using Google-hosted synchronization services and prevents users from changing this setting. + 'desc': '''"Setting the policy to Enabled turns off data synchronization in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> using Google-hosted synchronization services. + To fully turn off <ph name="CHROME_SYNC_NAME">Chrome Sync</ph> services, we recommend that you turn off the service in the <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph>. - If you enable this setting, users cannot change or override this setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. + If the policy is set to Disabled or not set, users are allowed to choose whether to use <ph name="CHROME_SYNC_NAME">Chrome Sync</ph>. - If this policy is left not set Google Sync will be available for the user to choose whether to use it or not. - - To fully disable Google Sync, it is recommended that you disable the Google Sync service in the Google Admin console.''', - 'arc_support': 'Disabling Google Sync will cause Android Backup and Restore to not function properly.', + Note: Do not turn on this policy when <ph name="ROAMING_PROFILE_SUPPORT_ENABLED_POLICY_NAME">RoamingProfileSupportEnabled</ph> is Enabled, because that feature shares the same client-side functionality. The Google-hosted synchronization is off completely in this case."''', + 'arc_support': 'Disabling <ph name="CHROME_SYNC_NAME">Chrome Sync</ph> will cause Android Backup and Restore to not function properly.', }, { 'name': 'SyncTypesListDisabled', @@ -3841,7 +3840,7 @@ 'id': 649, 'caption': '''List of types that should be excluded from synchronization''', 'tags': ['system-security'], - 'desc': '''If this policy is set all specified data types will be excluded from synchronization both for Google Sync as well as for roaming profile synchronization. This can be beneficial to reduce the size of the roaming profile or limit the type of data uploaded to the Google Sync Servers. + 'desc': '''If this policy is set all specified data types will be excluded from synchronization both for <ph name="CHROME_SYNC_NAME">Chrome Sync</ph> as well as for roaming profile synchronization. This can be beneficial to reduce the size of the roaming profile or limit the type of data uploaded to the <ph name="CHROME_SYNC_NAME">Chrome Sync</ph> Servers. The current data types for this policy are: "bookmarks", "readingList", "preferences", "passwords", "autofill", "themes", "typedUrls", "extensions", "apps", "tabs", "wifiConfigurations". Those names are case sensitive!''', }, @@ -3908,7 +3907,7 @@ Allows the user to sign in to <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. - If you set this policy, you can configure whether a user is allowed to sign in to <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. Setting this policy to 'False' will prevent apps and extensions that use the chrome.identity API from functioning, so you may want to use SyncDisabled instead.''', + If you set this policy, you can configure whether a user is allowed to sign in to <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. Setting this policy to 'False' will prevent apps and extensions that use the chrome.identity API from functioning, so you may want to use <ph name="SYNC_DISABLED_POLICY_NAME">SyncDisabled</ph>t instead.''', }, { 'name': 'EnableDeprecatedWebBasedSignin', @@ -17695,7 +17694,7 @@ If this setting is disabled, users will not be allowed to sync Wi-Fi network configurations. - This feature depends on the <ph name="WIFI_CONFIGURATIONS_DATATYPE_NAME">wifiConfigurations</ph> datatype in Chrome Sync being enabled. If <ph name="WIFI_CONFIGURATIONS_DATATYPE_NAME">wifiConfigurations</ph> is disabled in the <ph name="SYNC_TYPES_LIST_DISABLED_POLICY_NAME">SyncTypesListDisabled</ph> policy, or Chrome Sync is disabled in the <ph name="SYNC_DISABLED_POLICY_NAME">SyncDisabled</ph> policy this feature will not be enabled. + This feature depends on the <ph name="WIFI_CONFIGURATIONS_DATATYPE_NAME">wifiConfigurations</ph> datatype in <ph name="CHROME_SYNC_NAME">Chrome Sync</ph> being enabled. If <ph name="WIFI_CONFIGURATIONS_DATATYPE_NAME">wifiConfigurations</ph> is disabled in the <ph name="SYNC_TYPES_LIST_DISABLED_POLICY_NAME">SyncTypesListDisabled</ph> policy, or <ph name="CHROME_SYNC_NAME">Chrome Sync</ph> is disabled in the <ph name="SYNC_DISABLED_POLICY_NAME">SyncDisabled</ph> policy this feature will not be enabled. If this policy is left not set, the default is not allowed for managed users.''', }, @@ -27224,7 +27223,7 @@ 'owners': ['tsergeant@chromium.org', 'chromeos-apps-foundation-team@google.com'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'future_on': ['chrome_os'], + 'supported_on': ['chrome_os:94-'], 'features': { 'dynamic_refresh': True, 'per_profile': True,
diff --git a/components/policy/resources/policy_templates_es-419.xtb b/components/policy/resources/policy_templates_es-419.xtb index 6511fdc..b704b0f 100644 --- a/components/policy/resources/policy_templates_es-419.xtb +++ b/components/policy/resources/policy_templates_es-419.xtb
@@ -4482,6 +4482,7 @@ Si está configurada en falso o si no está configurada, la creación y el acceso de usuarios supervisados estarán inhabilitados. Todos los usuarios supervisados existentes estarán ocultos. NOTA: El comportamiento predeterminado en dispositivos para consumidores y empresas difiere: en los dispositivos para consumidores, los usuarios supervisados están habilitados de forma predeterminada; en cambio, en los dispositivos para empresas, los usuarios supervisados están inhabilitados de forma predeterminada.</translation> +<translation id="665023848306499203">Permitir que los dispositivos seleccionen una versión específica para realizar la actualización</translation> <translation id="6652197835259177259">Configuración de los usuarios administrados localmente</translation> <translation id="6653897159826215341">Si habilitas la política, <ph name="PRODUCT_NAME" /> abrirá el diálogo de impresión del sistema en lugar de la vista previa de impresión integrada cuando los usuarios soliciten realizar una impresión. @@ -5198,6 +5199,20 @@ <translation id="7477231245051133709">Habilita la función de accesibilidad de audio mono</translation> <translation id="7477239290070847560">Destinos de los protocolos basados en la no configuración (mDNS y DNS-SD)</translation> <translation id="7485481791539008776">Normas de selección de la impresora predeterminada</translation> +<translation id="7493995861907758679">Esta configuración permite que los dispositivos seleccionen una versión de destino específica de <ph name="PRODUCT_OS_NAME" /> para realizar la actualización. + + Si no estableces esta configuración, los dispositivos se actualizarán según otros parámetros de configuración o a la última versión disponible. + + Si la estableces, los dispositivos se actualizarán a la versión seleccionada. + + El formato exacto del valor de esta política es la información de una implementación del servicio de actualización. Este formato puede cambiar. El valor de la política no se procesa en el dispositivo. + + El servicio de actualización verificará primero esta política si la utilizas junto con <ph name="DEVICE_TARGET_VERSION_PREFIX_POLICY_NAME" />. + A diferencia de <ph name="DEVICE_TARGET_VERSION_PREFIX_POLICY_NAME" /> (que es posible que admita actualizaciones menores), los dispositivos seguirán teniendo la versión seleccionada hasta que se cambie el valor de esta política. + + Si la utilizas junto a <ph name="DEVICE_ROLLBACK_TO_TARGET_VERSION_POLICY_NAME" />, podrá revertirse la versión del dispositivo a una versión anterior específica. + + Advertencia: No se recomienda configurar restricciones a una versión, dado que es posible que esta acción impida que los usuarios reciban actualizaciones de software y correcciones críticas de seguridad. Si restringes las actualizaciones a una versión específica, es posible que los usuarios queden expuestos a riesgos.</translation> <translation id="7506745375479451616">Esta política controla el comando que se usará en las URL abiertas en <ph name="PRODUCT_NAME" /> cuando te cambias de <ph name="IE_PRODUCT_NAME" />. Puedes establecer esta política como una ruta de archivos ejecutable o <ph name="PRODUCT_NAME_PLACEHOLDER" /> para que detecte la ubicación de <ph name="PRODUCT_NAME" /> de forma automática. Si no estableces la política, <ph name="IE_PRODUCT_NAME" /> detectará la propia ruta ejecutable de <ph name="PRODUCT_NAME" /> de forma automática cuando se ejecuta <ph name="PRODUCT_NAME" /> desde Internet Explorer.
diff --git a/components/policy/resources/policy_templates_ja.xtb b/components/policy/resources/policy_templates_ja.xtb index 0001450..b440d785 100644 --- a/components/policy/resources/policy_templates_ja.xtb +++ b/components/policy/resources/policy_templates_ja.xtb
@@ -276,6 +276,7 @@ このポリシーが false に設定されている場合、ゲストモードのプロフィールで <ph name="PRODUCT_NAME" /> を使用することはできません。</translation> <translation id="1363275621236827384">ハードウェア プロファイルを Quirks サーバーに問い合わせられるようにする</translation> +<translation id="1372618949173323717">JavaScript を無効にする</translation> <translation id="1376119291123231789">詳細なバッテリー充電モードを有効にする</translation> <translation id="1384459581748403878">参考: <ph name="REFERENCE_URL" /></translation> <translation id="138847842893090358">OS の更新ステータスをレポートします</translation> @@ -310,6 +311,13 @@ 有効な <ph name="URL_LABEL" /> パターンについて詳しくは、https://cloud.google.com/docs/chrome-enterprise/policies/url-patterns をご覧ください。このポリシーの値に「<ph name="WILDCARD_VALUE" />」は使用できません。 このポリシーは以前、Android で誤って有効になっていましたが、Android でこの機能がフルサポートされていたことはありません。</translation> +<translation id="1435493974546396517"><ph name="PRODUCT_NAME" /> で、<ph name="MS_WIN_NAME" /> や <ph name="MAC_OS_NAME" /> での PDF の印刷時に「画像として印刷する」オプションを選択可能にするかどうかを制御します。 + + <ph name="MS_WIN_NAME" /> または <ph name="MAC_OS_NAME" /> で PDF を印刷する際、プリンタによっては、正確に出力するために印刷ジョブで画像へのラスタライズが必要となることがあります。 + + このポリシーを有効に設定した場合、<ph name="PRODUCT_NAME" /> では PDF の印刷時に、印刷プレビューで「画像として印刷する」オプションが選択可能になります。 + + このポリシーを無効に設定するか未設定のままにした場合、ユーザーは <ph name="PRODUCT_NAME" /> の印刷プレビューで「画像として印刷する」オプションを選択できず、PDF は通常どおりに印刷されます。つまり、印刷先に送信される前に画像へのラスタライズは行われません。</translation> <translation id="1435659902881071157">デバイス レベルのネットワーク設定</translation> <translation id="1438739959477268107">デフォルトのキー生成設定</translation> <translation id="1449083855104537880">このポリシーを True に設定した場合、通知領域(システムトレイ)メニューにユーザー補助オプションが表示されます。このポリシーを False に設定した場合、メニューにこのオプションは表示されません。 @@ -545,6 +553,13 @@ このポリシーを設定した場合、デバイスで使用できるディスクの空き容量がポリシーで要求される値未満のときに <ph name="PLUGIN_VM_NAME" /> のインストールが失敗します。</translation> <translation id="1690383938831887552">Signed HTTP Exchange の読み込みを許可しない</translation> <translation id="169467210981344373">グローバル スコープを持つ HTTP 認証キャッシュを無効にする</translation> +<translation id="1698810555265314018"><ph name="PRODUCT_NAME" /> で PDF をラスタライズして印刷する際の、印刷画像の解像度を制御します。 + + 「画像として印刷する」オプションを使って PDF を印刷する際は、デバイスのプリンタ設定や PDF のデフォルト以外の、印刷の解像度を指定することをおすすめします。解像度が高いと処理と印刷にかかる時間が大幅に増える一方、低いと画質が悪くなる可能性があります。 + + このポリシーでは、PDF をラスタライズして印刷する際に使用する解像度を指定できます。 + + このポリシーをゼロに設定するか未設定のままにした場合は、ページの画像をラスタライズする際にシステムのデフォルトの解像度が使用されます。</translation> <translation id="1700458869527146675">このポリシーでは、Chrome と ARC アプリのプロキシ設定を行います。いずれもコマンドラインで指定されたプロキシ関連の設定はすべて無視されます。 このポリシーを未設定のままにした場合、ユーザーはプロキシ設定を選択できます。 @@ -2039,6 +2054,7 @@ <translation id="348495353354674884">仮想キーボードを有効にする</translation> <translation id="3485200437120267231">ログイン インターセプトを無効にする</translation> <translation id="3487651201232258606">ネイティブ メッセージング</translation> +<translation id="3492351353716550742">デフォルトのリファラー ポリシー「no-referrer-when-downgrade」を使用しない</translation> <translation id="3492834335089638487">このポリシーでは、デバイスにおける信頼できない提供元(Google Play ストア以外の提供元)の Android アプリの使用を管理します。 このポリシーの値を設定しない場合は、この機能を許可しないものと見なされます。 @@ -2055,6 +2071,7 @@ <translation id="350443680860256679">ARC を設定する</translation> <translation id="350797926066071931">翻訳を有効にする</translation> <translation id="3508047333410537654">ログイン画面でモノラル音声を有効にする</translation> +<translation id="3513265258454735822">ブラウザの履歴の保存を有効にする</translation> <translation id="3513655665999652754">Quirks サーバーから、ハードウェア固有の設定ファイル(モニターのキャリブレーションを調整する ICC ディスプレイ プロファイルなど)が提供されます。 このポリシーが false の場合、デバイスから Quirks サーバーへの接続と設定ファイルのダウンロードは行われません。 @@ -2366,6 +2383,7 @@ このポリシーが未設定の場合は、SPDY を使用できます。</translation> <translation id="3891357445869647828">JavaScript を有効にする</translation> +<translation id="3891769546914233112">PDF を画像として印刷可能にする</translation> <translation id="3897218615484393758">SAML 経由で認証されたユーザーがロック画面でのログインをオフラインで行える期間を制限する</translation> <translation id="3898345958122666461">NTLMv2 を無効にする</translation> <translation id="3898795800259311780">画面のキャプチャを許可または拒否する</translation> @@ -2659,6 +2677,7 @@ <translation id="4372704773119750918">マルチプロフィール(プライマリまたはセカンダリ)への参加を企業ユーザーに許可しない</translation> <translation id="4377599627073874279">すべてのサイトに対してすべての画像表示を許可する</translation> <translation id="437791893267799639">ポリシー未設定、データ移行と ARC を許可しない</translation> +<translation id="4381227367939912539">恐竜のイースター エッグゲームを無効にする</translation> <translation id="4382413175336720282">リアルタイムの URL チェックが無効。</translation> <translation id="4387741272680827493">このポリシーでは、プリロードされた、HTTP から HTTPS への HSTS アップグレードを回避するホスト名のリストを指定できます。 @@ -2717,6 +2736,7 @@ ポリシー自体は上記のプラットフォームでサポートされますが、このポリシーの対象となる機能を利用できるプラットフォームはそれより少ないことがあります。サポートが終了したすべてのウェブ プラットフォーム機能を再び有効にできるとは限りません。一時的に有効になるのは、下記のリストに指定されている機能のみで、有効になる期間は機能によって異なります。文字列タグの一般的な形式は [DeprecatedFeatureName]_EffectiveUntil[yyyymmdd] です。詳しくは、https://bit.ly/blinkintents でウェブ プラットフォーム機能を変更する意図をご確認ください。 </translation> <translation id="4442582539341804154">デバイスがアイドルまたは停止の状態になったときにロックを有効にする</translation> +<translation id="4443711908766051441">恐竜のイースター エッグゲームを有効にする</translation> <translation id="4447668084338250480">イントラネット リダイレクトの処理</translation> <translation id="4449469846627734399">電力ピークシフトの曜日の設定を指定する</translation> <translation id="4449545651113180484">画面を時計回りに 270 度回転</translation> @@ -3933,6 +3953,7 @@ <translation id="6135398260575578389">セーフ ブラウジングを強化モードで有効にする。このモードではセキュリティが強化されますが、より多くの閲覧情報を Google に提供する必要があります。</translation> <translation id="6138636318340561140">URL のセーフ ブラウジング ステータスをリアルタイムでチェックする</translation> <translation id="6141402445226505817">常に IP のみに基づいてタイムゾーンを検出する</translation> +<translation id="6142501278956229253">ラスタライズした PDF の印刷に使用する DPI</translation> <translation id="6144046700495610112">このポリシーを有効に設定した場合、初回実行時に以前の既定のブラウザから自動入力フォームのデータが読み込まれます。このポリシーを無効に設定するか未設定のままにした場合、初回実行時に自動入力フォームのデータは読み込まれません。 ユーザーはインポート ダイアログを表示できます。このとき、自動入力フォームのデータのチェックボックスは、このポリシーの値に合わせてオンまたはオフになります。</translation> @@ -4118,6 +4139,7 @@ <translation id="6401669939808766804">ユーザーをログアウトする</translation> <translation id="640244877779556713">絵文字の候補を有効にします</translation> <translation id="6407093060083181305">拡張機能インストールの拒否リストを設定する</translation> +<translation id="640827304541402854">リモート アクセス ホストからのファイアウォール トラバーサルを無効にする</translation> <translation id="6417265370957905582">Google アシスタント</translation> <translation id="6422575351619065453">キオスクモードでフローティング ユーザー補助機能メニューを表示するかどうかを管理します。 @@ -4321,6 +4343,7 @@ false に設定されている場合や未設定の場合は、監視対象ユーザーの作成とログインはできません。既存の監視対象ユーザーはすべて非表示になります。 注: デフォルトの動作は、個人向けのデバイスと企業向けのデバイスとで異なります。個人向けデバイスでは、監視対象ユーザーはデフォルトで有効になっていますが、企業向けデバイスではそうではありません。</translation> +<translation id="665023848306499203">どのバージョンに更新するかの選択をデバイスに許可する</translation> <translation id="6652197835259177259">ローカルの管理対象ユーザーの設定</translation> <translation id="6653897159826215341">このポリシーを有効に設定した場合、<ph name="PRODUCT_NAME" /> ではユーザーが印刷をリクエストしたときに組み込みの印刷プレビューではなくシステムの印刷ダイアログが開きます。 @@ -5011,6 +5034,20 @@ <translation id="7477231245051133709">「モノラル音声」のユーザー補助機能を有効にする</translation> <translation id="7477239290070847560">Zeroconf(mDNS+DNS-SD)プロトコルの送信先</translation> <translation id="7485481791539008776">デフォルト プリンタ選択ルール</translation> +<translation id="7493995861907758679">この設定では、<ph name="PRODUCT_OS_NAME" /> をどのバージョンに更新するかをデバイスで選択できるようにします。 + + このポリシーを設定しない場合、デバイスは他の設定で指定されたバージョンまたは利用可能な最新バージョンに更新されます。 + + このポリシーを設定した場合、デバイスは選択したバージョンに更新されます。 + + このポリシーの値の正確な形式は、更新サービスの実装仕様で定められており、変更される可能性があります。このポリシーの値はデバイスで処理されません。 + + <ph name="DEVICE_TARGET_VERSION_PREFIX_POLICY_NAME" /> と併用した場合、このポリシーはまず更新サービスによって確認されます。 + (マイナー アップデートが許可される)<ph name="DEVICE_TARGET_VERSION_PREFIX_POLICY_NAME" /> とは異なり、デバイスはこのポリシーの値が変更されるまで選択されたバージョンのままとなります。 + + <ph name="DEVICE_ROLLBACK_TO_TARGET_VERSION_POLICY_NAME" /> と併用した場合、デバイスのバージョンを以前の特定のバージョンに戻すことができます。 + + 警告: ユーザーがソフトウェア アップデートや重要なセキュリティ修正を取得できなくなる可能性があるため、バージョンの制限を設定することは推奨されません。特定のバージョンに更新を制限すると、ユーザーが危険にさらされる恐れがあります。</translation> <translation id="7506745375479451616">このポリシーでは、<ph name="IE_PRODUCT_NAME" /> から <ph name="PRODUCT_NAME" /> に切り替えて URL を開くときに使用するコマンドを管理します。このポリシーは、実行ファイルのパスに設定するか <ph name="PRODUCT_NAME_PLACEHOLDER" /> に設定することで、<ph name="PRODUCT_NAME" /> の場所を自動検出できます。 このポリシーを未設定のままにした場合、<ph name="PRODUCT_NAME" /> が Internet Explorer から起動する際に <ph name="IE_PRODUCT_NAME" /> が <ph name="PRODUCT_NAME" /> の実行パスを自動検出します。注: <ph name="IE_PRODUCT_NAME" /> の従来のブラウザをサポートするアドインがインストールされていない場合、このポリシーは無視されます。</translation> @@ -5540,6 +5577,7 @@ <translation id="8244171102276095471">TLS の RC4 暗号スイートを有効にする</translation> <translation id="8244525275280476362">ポリシーの失効から取得までの最大時間</translation> <translation id="8245574649143980200">このポリシーを未設定のままにするか有効に設定した場合、コンテキスト メニューに <ph name="GOOGLE_LENS_PRODUCT_NAME" /> の地域検索メニュー項目が表示され、ユーザーはこれを使用することができます。このポリシーを無効に設定した場合は、<ph name="GOOGLE_LENS_PRODUCT_NAME" /> の地域検索がサポートされていても、コンテキスト メニューに <ph name="GOOGLE_LENS_PRODUCT_NAME" /> の地域検索メニュー項目は表示されません。</translation> +<translation id="824818544897669723">ブラウザとダウンロードの履歴の削除を無効にする</translation> <translation id="82530263956734297">拒否リストから除外する拡張機能 ID</translation> <translation id="8256688113167012935">対応するデバイスのローカル アカウントに対し、ログイン画面でアカウント名 <ph name="PRODUCT_OS_NAME" /> を表示するかどうかを指定します。 @@ -5948,6 +5986,7 @@ 拡張機能プリンタは、印刷プロバイダの送信先のことで、<ph name="PRODUCT_NAME" /> の拡張機能で利用できる送信先が該当します。 ローカル プリンタは、ネイティブ印刷の送信先のことで、ローカルマシンや共有ネットワークのプリンタで利用できる送信先が該当します。</translation> +<translation id="8753264624162178499">ユーザーは「画像として印刷する」オプションを選択して、PDF をラスタライズしてから印刷先に印刷ジョブを送信できる。</translation> <translation id="8757552286070680084">Wilco DTC の設定</translation> <translation id="8758831693895931466">クラウド管理への登録を必須にする</translation> <translation id="8759829385824155666">許可されている Kerberos 暗号化タイプ</translation> @@ -5981,6 +6020,7 @@ このポリシーを未設定のままにした場合、ポリシーは無視されます。この場合、このパソコンではリモート アクセス接続での最長セッション継続時間は設定されません。</translation> <translation id="8800453707696044281">バッテリー充電のカスタムの充電停止設定(%)を行う</translation> <translation id="8801680448782904838">ブラウザまたはデバイスの再起動が推奨されるか必要であることをユーザーに通知する</translation> +<translation id="8804685015028424497">シークレット モードを無効にする</translation> <translation id="8807313206348471682">ログアウト確認ダイアログを表示する</translation> <translation id="8817960019535659860">ユーザーに Chrome OS の登録特典の利用を許可しない</translation> <translation id="8818173863808665831">デバイスの地理的位置をレポートします。 @@ -6333,6 +6373,7 @@ <translation id="9207596996305971030">ログイン / ログアウト イベントを報告しない</translation> <translation id="9213751049772256263">すべてのバリエーションを無効にします</translation> <translation id="9217154963008402249">監視ネットワーク パケットの送信間隔</translation> +<translation id="9220314833408124365">デフォルトのリファラー ポリシー「no-referrer-when-downgrade」を使用する</translation> <translation id="922540222991413931">拡張機能、アプリ、ユーザー スクリプトのインストール ソースを設定する</translation> <translation id="924557436754151212">初回実行時にデフォルトのブラウザから保存したパスワードをインポートする</translation> <translation id="927384371566552478">このポリシーを有効に設定するか未設定のままにした場合、ユーザーは書き出しと読み込みの UI を使用できます。このポリシーを無効に設定した場合、ユーザーは書き出しと読み込みの UI を使用できません。</translation> @@ -6362,6 +6403,7 @@ 注: 「chrome://*」の内部 URL をブロックすると、予期しないエラーが発生する可能性があります。</translation> <translation id="957778406002650056"><ph name="PLUGIN_VM_NAME" /> 画像をダウンロードすることのできる URL です。</translation> +<translation id="971677226939413180">ユーザーは「画像として印刷する」オプションを選択できない。</translation> <translation id="974349541138387272">希望の DNS-over-HTTPS リゾルバの URI テンプレートを指定する</translation> <translation id="979467274961593903">リモート デバッグの使用を許可しない</translation> <translation id="980218166381006412">このポリシーを有効に設定した場合、バックグラウンド モードがオンになります。バックグラウンド モードでは、<ph name="PRODUCT_NAME" /> の処理が OS のログイン時に開始され、ブラウザ ウィンドウがすべて閉じられた後も続行されます。これにより、バックグラウンド アプリとブラウジング セッションは有効のままになります。バックグラウンド処理中はシステムトレイにアイコンが表示され、このアイコンからいつでも処理を終了できます。
diff --git a/components/policy/resources/policy_templates_ko.xtb b/components/policy/resources/policy_templates_ko.xtb index e8a42a5..2fcb3977 100644 --- a/components/policy/resources/policy_templates_ko.xtb +++ b/components/policy/resources/policy_templates_ko.xtb
@@ -4485,6 +4485,7 @@ false로 설정하거나 설정하지 않으면 관리 대상 사용자 생성 및 로그인이 사용 중지됩니다. 기존의 모든 관리 대상 사용자는 숨겨집니다. 참고: 일반 소비자용과 기업용 기기는 기본 동작에 차이가 있습니다. 일반 소비자용 기기는 관리 대상 사용자를 기본적으로 사용하도록 설정되어 있으나, 기업용 기기에서는 기본적으로 사용 중지되어 있습니다.</translation> +<translation id="665023848306499203">기기에서 업데이트할 특정 버전을 선택하도록 허용</translation> <translation id="6652197835259177259">로컬 관리 사용자 설정</translation> <translation id="6653897159826215341">정책을 사용 설정하면 사용자가 인쇄를 요청할 때 <ph name="PRODUCT_NAME" />에서 내장 인쇄 미리보기 대신 시스템 인쇄 대화상자가 열립니다. @@ -5206,6 +5207,20 @@ <translation id="7477231245051133709">모노 오디오 접근성 기능 사용</translation> <translation id="7477239290070847560">Zeroconf 기반(mDNS + DNS-SD) 프로토콜 목적지</translation> <translation id="7485481791539008776">기본 프린터 선택 규칙</translation> +<translation id="7493995861907758679">이 설정을 사용하면 기기에서 업데이트할 <ph name="PRODUCT_OS_NAME" />의 특정 대상 버전을 선택하도록 허용할 수 있습니다. + + 정책이 설정되지 않으면 기기가 다른 설정이나 사용 가능한 최신 버전에 따라 제품을 업데이트합니다. + + 설정되면 기기가 선택한 버전으로 제품을 업데이트합니다. + + 정책 값의 정확한 형식은 업데이트 서비스의 구현 세부정보이며 바뀔 수 있습니다. 정책 값은 기기에서 처리되지 않습니다. + + <ph name="DEVICE_TARGET_VERSION_PREFIX_POLICY_NAME" />와 함께 사용되면 업데이트 서비스에서 정책을 먼저 확인합니다. + 소규모 업데이트를 허용할 수 있는 <ph name="DEVICE_TARGET_VERSION_PREFIX_POLICY_NAME" /> 정책과는 달리, 이 정책 값이 변경될 때까지 기기가 선택한 버전으로 유지됩니다. + + <ph name="DEVICE_ROLLBACK_TO_TARGET_VERSION_POLICY_NAME" />과 함께 사용되는 경우 기기 버전이 이전의 특정 버전으로 되돌아갈 수 있습니다. + + 경고: 버전 제한을 구성하는 것은 권장되지 않습니다. 사용자가 소프트웨어 업데이트 및 중요한 보안 수정사항을 받지 못하게 될 수 있기 때문입니다. 업데이트를 특정 버전으로 제한하면 사용자가 위험에 노출될 수 있습니다.</translation> <translation id="7506745375479451616">이 정책은 <ph name="IE_PRODUCT_NAME" />에서 전환할 때 <ph name="PRODUCT_NAME" />에서 URL을 여는 데 사용할 명령을 제어합니다. 정책을 실행 파일 경로로 설정하거나 <ph name="PRODUCT_NAME_PLACEHOLDER" />으로 설정하여 <ph name="PRODUCT_NAME" />의 위치를 자동으로 감지할 수 있습니다. 정책을 설정하지 않으면 Internet Explorer에서 <ph name="PRODUCT_NAME" />을 실행할 때 <ph name="IE_PRODUCT_NAME" />에서 <ph name="PRODUCT_NAME" />의 자체 실행 경로를 자동으로 감지합니다.
diff --git a/components/policy/resources/policy_templates_vi.xtb b/components/policy/resources/policy_templates_vi.xtb index ed9c320..9ac1917a 100644 --- a/components/policy/resources/policy_templates_vi.xtb +++ b/components/policy/resources/policy_templates_vi.xtb
@@ -4495,6 +4495,7 @@ Nếu đặt thành sai hoặc không định cấu hình, tính năng tạo và đăng nhập tài khoản người dùng bị giám sát sẽ bị tắt. Tất cả tài khoản người dùng bị giám sát hiện có sẽ bị ẩn. LƯU Ý: Chế độ mặc định đối với các thiết bị dành cho người tiêu dùng và doanh nghiệp khác nhau: trên thiết bị dành cho người tiêu dùng, tài khoản người dùng bị giám sát được bật theo mặc định nhưng trên thiết bị dành cho doanh nghiệp, các tài khoản này được tắt theo mặc định.</translation> +<translation id="665023848306499203">Cho phép các thiết bị chọn một phiên bản cụ thể để cập nhật</translation> <translation id="6652197835259177259">Cài đặt người dùng được quản lý cục bộ</translation> <translation id="6653897159826215341">Nếu bạn đặt chính sách này thành Bật, <ph name="PRODUCT_NAME" /> sẽ mở hộp thoại in hệ thống thay vì chế độ xem trước bản in tích hợp khi người dùng yêu cầu in. @@ -5216,6 +5217,20 @@ <translation id="7477231245051133709">Bật tính năng hỗ trợ tiếp cận về đơn âm</translation> <translation id="7477239290070847560">Đích giao thức dựa trên máy in tự động định cấu hình (mDNS + DNS-SD)</translation> <translation id="7485481791539008776">Quy tắc chọn máy in mặc định</translation> +<translation id="7493995861907758679">Chế độ cài đặt này cho phép các thiết bị chọn phiên bản đích cụ thể của <ph name="PRODUCT_OS_NAME" /> để cập nhật. + + Nếu bạn không đặt chế độ này, thì các thiết bị sẽ cập nhật theo các chế độ cài đặt khác hoặc cập nhật lên phiên bản mới nhất hiện có. + + Nếu bạn đặt chế độ này, thì thiết bị sẽ cập nhật lên phiên bản đã chọn. + + Giá trị định dạng chính xác của chính sách này là thông tin triển khai chi tiết của dịch vụ cập nhật và có thể thay đổi. Giá trị của chính sách không được xử lý trên thiết bị. + + Nếu chính sách này được đặt cùng với <ph name="DEVICE_TARGET_VERSION_PREFIX_POLICY_NAME" />, thì dịch vụ cập nhật sẽ kiểm tra chính sách này trước. + Không giống như <ph name="DEVICE_TARGET_VERSION_PREFIX_POLICY_NAME" /> (cho phép những bản cập nhật nhỏ), thiết bị sẽ tiếp tục hoạt động trên phiên bản đã chọn cho đến khi giá trị của chính sách này được thay đổi. + + Nếu chính sách này được đặt cùng với <ph name="DEVICE_ROLLBACK_TO_TARGET_VERSION_POLICY_NAME" />, thì phiên bản hiện có trên thiết bị có thể được khôi phục về một phiên bản cụ thể trước đó. + + Cảnh báo: Bạn không nên định cấu hình giới hạn phiên bản vì những giới hạn này có thể khiến người dùng không thể nhận được các bản cập nhật phần mềm và các bản vá bảo mật quan trọng. Giới hạn cập nhật ở một phiên bản cụ thể có thể khiến người dùng gặp rủi ro.</translation> <translation id="7506745375479451616">Chính sách này kiểm soát lệnh sẽ dùng để mở URL trong <ph name="PRODUCT_NAME" /> khi chuyển từ <ph name="IE_PRODUCT_NAME" />. Bạn có thể đặt chính sách này thành một đường dẫn tệp thực thi hoặc <ph name="PRODUCT_NAME_PLACEHOLDER" /> để tự động phát hiện vị trí của <ph name="PRODUCT_NAME" />. Nếu bạn không đặt chính sách này, thì <ph name="IE_PRODUCT_NAME" /> sẽ tự động phát hiện đường dẫn thực thi riêng của <ph name="PRODUCT_NAME" /> khi chạy <ph name="PRODUCT_NAME" /> từ Internet Explorer.
diff --git a/components/services/app_service/public/cpp/intent_util.cc b/components/services/app_service/public/cpp/intent_util.cc index 5fd45c0..20309c8 100644 --- a/components/services/app_service/public/cpp/intent_util.cc +++ b/components/services/app_service/public/cpp/intent_util.cc
@@ -36,27 +36,50 @@ const char kUiBypassedKey[] = "ui_bypassed"; const char kExtrasKey[] = "extras"; -// Get the intent condition value based on the condition type. -absl::optional<std::string> GetIntentConditionValueByType( +// Get the field/s from the |intent| that need to be checked/matched based on +// |condition_type|. Most types return a single string but we return a vector +// for compatibility with types that have multiple fields to be checked. +std::vector<std::string> GetIntentConditionValuesByType( apps::mojom::ConditionType condition_type, const apps::mojom::IntentPtr& intent) { switch (condition_type) { - case apps::mojom::ConditionType::kAction: - return intent->action; - case apps::mojom::ConditionType::kScheme: - return intent->url.has_value() - ? absl::optional<std::string>(intent->url->scheme()) - : absl::nullopt; - case apps::mojom::ConditionType::kHost: - return intent->url.has_value() - ? absl::optional<std::string>(intent->url->host()) - : absl::nullopt; - case apps::mojom::ConditionType::kPattern: - return intent->url.has_value() - ? absl::optional<std::string>(intent->url->path()) - : absl::nullopt; - case apps::mojom::ConditionType::kMimeType: - return intent->mime_type; + case apps::mojom::ConditionType::kAction: { + return {intent->action}; + } + case apps::mojom::ConditionType::kScheme: { + if (intent->url.has_value()) + return {intent->url->scheme()}; + return {}; + } + case apps::mojom::ConditionType::kHost: { + if (intent->url.has_value()) + return {intent->url->host()}; + return {}; + } + case apps::mojom::ConditionType::kPattern: { + if (intent->url.has_value()) + return {intent->url->path()}; + return {}; + } + case apps::mojom::ConditionType::kMimeType: { + if (intent->files.has_value()) { + std::vector<std::string> mime_types; + for (const auto& file : intent->files.value()) { + if (file->mime_type.has_value()) { + mime_types.push_back(file->mime_type.value()); + } + } + if (!mime_types.empty()) { + // All files in the intent should have a MIME type, or none. + DCHECK_EQ(mime_types.size(), intent->files->size()); + return mime_types; + } + } + + if (intent->mime_type.has_value()) + return {intent->mime_type.value()}; + return {}; + } } } @@ -137,14 +160,16 @@ apps::mojom::IntentPtr CreateShareIntentFromFiles( const std::vector<GURL>& filesystem_urls, const std::vector<std::string>& mime_types) { + DCHECK_EQ(filesystem_urls.size(), mime_types.size()); auto intent = apps::mojom::Intent::New(); intent->action = filesystem_urls.size() == 1 ? kIntentActionSend : kIntentActionSendMultiple; intent->mime_type = CalculateCommonMimeType(mime_types); intent->files = std::vector<apps::mojom::IntentFilePtr>{}; - for (const GURL& url : filesystem_urls) { + for (size_t i = 0; i < filesystem_urls.size(); i++) { auto file = apps::mojom::IntentFile::New(); - file->url = url; + file->url = filesystem_urls[i]; + file->mime_type = mime_types.at(i); intent->files->push_back(std::move(file)); } return intent; @@ -226,17 +251,24 @@ bool IntentMatchesCondition(const apps::mojom::IntentPtr& intent, const apps::mojom::ConditionPtr& condition) { - absl::optional<std::string> value_to_match = - GetIntentConditionValueByType(condition->condition_type, intent); - if (!value_to_match.has_value()) { + std::vector<std::string> values_to_match = + GetIntentConditionValuesByType(condition->condition_type, intent); + if (values_to_match.empty()) { return false; } - for (const auto& condition_value : condition->condition_values) { - if (ConditionValueMatches(value_to_match.value(), condition_value)) { - return true; - } + + // If the intent has multiple values to match e.g. a MIME type for each file + // in the intent, then each value must match at least one condition_value. + for (const auto& value_to_match : values_to_match) { + bool matched_any = std::any_of( + condition->condition_values.begin(), condition->condition_values.end(), + [&value_to_match](const auto& condition_value) { + return ConditionValueMatches(value_to_match, condition_value); + }); + if (!matched_any) + return false; } - return false; + return true; } bool IntentMatchesFilter(const apps::mojom::IntentPtr& intent,
diff --git a/components/services/app_service/public/cpp/intent_util_unittest.cc b/components/services/app_service/public/cpp/intent_util_unittest.cc index cfdf8b63..4f6f3a0 100644 --- a/components/services/app_service/public/cpp/intent_util_unittest.cc +++ b/components/services/app_service/public/cpp/intent_util_unittest.cc
@@ -340,17 +340,102 @@ apps_util::CreateIntentFilterForSend(mime_type_sub_wildcard); auto filter_all_wildcard = apps_util::CreateIntentFilterForSend(mime_type_all_wildcard); + auto filter1_and_2 = apps_util::CreateIntentFilterForSend(mime_type1); + filter1_and_2->conditions[1]->condition_values.push_back( + apps_util::MakeConditionValue(mime_type2, + apps::mojom::PatternMatchType::kMimeType)); std::vector<GURL> urls; std::vector<std::string> mime_types; urls.emplace_back("abc"); + // Test match with text/plain type. + mime_types.push_back(mime_type1); + auto intent = apps_util::CreateShareIntentFromFiles(urls, mime_types); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter1)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter2)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter3)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_sub_wildcard)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_all_wildcard)); + + // Test match with image/jpeg type. + mime_types.clear(); + mime_types.push_back(mime_type2); + intent = apps_util::CreateShareIntentFromFiles(urls, mime_types); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter2)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter3)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter_sub_wildcard)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_all_wildcard)); + + // Test match with text/html type. + mime_types.clear(); + mime_types.push_back(mime_type3); + intent = apps_util::CreateShareIntentFromFiles(urls, mime_types); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter2)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter3)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_sub_wildcard)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_all_wildcard)); + + // Test match with text/* types. + mime_types.clear(); + mime_types.push_back(mime_type_sub_wildcard); + intent = apps_util::CreateShareIntentFromFiles(urls, mime_types); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter2)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter3)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_sub_wildcard)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_all_wildcard)); + + // Test match with */* type. + mime_types.clear(); + mime_types.push_back(mime_type_all_wildcard); + intent = apps_util::CreateShareIntentFromFiles(urls, mime_types); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter2)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter3)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter_sub_wildcard)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_all_wildcard)); +} + +TEST_F(IntentUtilTest, CommonMimeTypeMatchMultiple) { + std::string mime_type1 = "text/plain"; + std::string mime_type2 = "image/jpeg"; + std::string mime_type3 = "text/html"; + std::string mime_type_sub_wildcard = "text/*"; + std::string mime_type_all_wildcard = "*/*"; + + auto filter1 = apps_util::CreateIntentFilterForSendMultiple(mime_type1); + auto filter2 = apps_util::CreateIntentFilterForSendMultiple(mime_type2); + auto filter3 = apps_util::CreateIntentFilterForSendMultiple(mime_type3); + auto filter_sub_wildcard = + apps_util::CreateIntentFilterForSendMultiple(mime_type_sub_wildcard); + auto filter_all_wildcard = + apps_util::CreateIntentFilterForSendMultiple(mime_type_all_wildcard); + auto filter1_and_2 = apps_util::CreateIntentFilterForSendMultiple(mime_type1); + filter1_and_2->conditions[1]->condition_values.push_back( + apps_util::MakeConditionValue(mime_type2, + apps::mojom::PatternMatchType::kMimeType)); + + std::vector<GURL> urls; + std::vector<std::string> mime_types; + + urls.emplace_back("abc"); + urls.emplace_back("def"); + // Test match with same mime types. mime_types.push_back(mime_type1); mime_types.push_back(mime_type1); auto intent = apps_util::CreateShareIntentFromFiles(urls, mime_types); EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter1)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter3)); // Test match with same main type and different sub type. @@ -359,6 +444,7 @@ mime_types.push_back(mime_type3); intent = apps_util::CreateShareIntentFromFiles(urls, mime_types); EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter3)); EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_sub_wildcard)); @@ -368,6 +454,7 @@ mime_types.push_back(mime_type_sub_wildcard); intent = apps_util::CreateShareIntentFromFiles(urls, mime_types); EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_sub_wildcard)); // Test match with different mime types. @@ -378,6 +465,7 @@ EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1)); EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter2)); EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter_sub_wildcard)); + EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_all_wildcard)); // Test match with explicit type and general wildcard type. @@ -386,6 +474,7 @@ mime_types.push_back(mime_type_all_wildcard); intent = apps_util::CreateShareIntentFromFiles(urls, mime_types); EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1)); + EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter1_and_2)); EXPECT_FALSE(apps_util::IntentMatchesFilter(intent, filter_sub_wildcard)); EXPECT_TRUE(apps_util::IntentMatchesFilter(intent, filter_all_wildcard)); }
diff --git a/components/site_engagement/content/BUILD.gn b/components/site_engagement/content/BUILD.gn index 6f31619..604648e 100644 --- a/components/site_engagement/content/BUILD.gn +++ b/components/site_engagement/content/BUILD.gn
@@ -5,6 +5,8 @@ source_set("content") { sources = [ "engagement_type.h", + "site_engagement_helper.cc", + "site_engagement_helper.h", "site_engagement_metrics.cc", "site_engagement_metrics.h", "site_engagement_observer.cc", @@ -20,6 +22,8 @@ "//components/browsing_data/core", "//components/content_settings/core/browser", "//components/content_settings/core/common", + "//components/no_state_prefetch/browser", + "//components/no_state_prefetch/common", "//components/permissions", "//components/prefs", "//components/security_state/core", @@ -44,12 +48,19 @@ source_set("unit_tests") { testonly = true - sources = [ "site_engagement_score_unittest.cc" ] + sources = [ + "site_engagement_helper_unittest.cc", + "site_engagement_score_unittest.cc", + ] deps = [ ":content", "//base", "//base/test:test_support", + "//components/permissions:test_support", + "//components/prefs:test_support", "//components/site_engagement/core/mojom:mojo_bindings", + "//components/user_prefs:user_prefs", + "//content/test:test_support", "//testing/gtest", ] }
diff --git a/components/site_engagement/content/DEPS b/components/site_engagement/content/DEPS index 4c2117ef..2ea93d61 100644 --- a/components/site_engagement/content/DEPS +++ b/components/site_engagement/content/DEPS
@@ -2,11 +2,14 @@ "+components/browsing_data", "+components/content_settings/core", "+components/keyed_service", + "+components/no_state_prefetch/browser", "+components/permissions", "+components/prefs", "+components/user_prefs", "+components/variations", "+content/public/browser", + "+content/public/test", + "+third_party/blink/public/common/input", "+third_party/blink/public/mojom", "+ui/base", ]
diff --git a/chrome/browser/engagement/site_engagement_helper.cc b/components/site_engagement/content/site_engagement_helper.cc similarity index 98% rename from chrome/browser/engagement/site_engagement_helper.cc rename to components/site_engagement/content/site_engagement_helper.cc index 89ee5b8b..04e037a 100644 --- a/chrome/browser/engagement/site_engagement_helper.cc +++ b/components/site_engagement/content/site_engagement_helper.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/engagement/site_engagement_helper.h" +#include "components/site_engagement/content/site_engagement_helper.h" #include <utility>
diff --git a/chrome/browser/engagement/site_engagement_helper.h b/components/site_engagement/content/site_engagement_helper.h similarity index 90% rename from chrome/browser/engagement/site_engagement_helper.h rename to components/site_engagement/content/site_engagement_helper.h index 62c33b3..b842fb2 100644 --- a/chrome/browser/engagement/site_engagement_helper.h +++ b/components/site_engagement/content/site_engagement_helper.h
@@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ -#define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ +#ifndef COMPONENTS_SITE_ENGAGEMENT_CONTENT_SITE_ENGAGEMENT_HELPER_H_ +#define COMPONENTS_SITE_ENGAGEMENT_CONTENT_SITE_ENGAGEMENT_HELPER_H_ #include <memory> -#include "base/macros.h" #include "base/timer/timer.h" #include "components/no_state_prefetch/browser/no_state_prefetch_manager.h" #include "components/site_engagement/content/site_engagement_service.h" @@ -50,6 +49,9 @@ explicit PeriodicTracker(SiteEngagementService::Helper* helper); virtual ~PeriodicTracker(); + PeriodicTracker(const PeriodicTracker&) = delete; + PeriodicTracker& operator=(const PeriodicTracker&) = delete; + // Begin tracking after |initial_delay|. void Start(base::TimeDelta initial_delay); @@ -83,8 +85,6 @@ private: SiteEngagementService::Helper* helper_; std::unique_ptr<base::OneShotTimer> pause_timer_; - - DISALLOW_COPY_AND_ASSIGN(PeriodicTracker); }; // Class to encapsulate time-on-site engagement detection. Time-on-site is @@ -100,6 +100,9 @@ InputTracker(SiteEngagementService::Helper* helper, content::WebContents* web_contents); + InputTracker(const InputTracker&) = delete; + InputTracker& operator=(const InputTracker&) = delete; + bool is_tracking() const { return is_tracking_; } private: @@ -114,8 +117,6 @@ // content::WebContentsObserver overrides. void DidGetUserInteraction(const blink::WebInputEvent& event) override; - - DISALLOW_COPY_AND_ASSIGN(InputTracker); }; // Class to encapsulate media detection. Any media playing in a WebContents @@ -135,6 +136,9 @@ content::WebContents* web_contents); ~MediaTracker() override; + MediaTracker(const MediaTracker&) = delete; + MediaTracker& operator=(const MediaTracker&) = delete; + private: friend class SiteEngagementHelperTest; @@ -150,8 +154,6 @@ WebContentsObserver::MediaStoppedReason reason) override; std::vector<content::MediaPlayerId> active_media_players_; - - DISALLOW_COPY_AND_ASSIGN(MediaTracker); }; // Optionally include |NoStatePrefetchManager| if no state prefetches are @@ -159,6 +161,10 @@ explicit Helper( content::WebContents* web_contents, prerender::NoStatePrefetchManager* prefetch_manager = nullptr); + + Helper(const Helper&) = delete; + Helper& operator=(const Helper&) = delete; + friend class content::WebContentsUserData<SiteEngagementService::Helper>; friend class SiteEngagementHelperTest; friend class SiteEngagementHelperBrowserTest; @@ -180,10 +186,9 @@ SiteEngagementService* service_; prerender::NoStatePrefetchManager* prefetch_manager_; - DISALLOW_COPY_AND_ASSIGN(Helper); WEB_CONTENTS_USER_DATA_KEY_DECL(); }; } // namespace site_engagement -#endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ +#endif // COMPONENTS_SITE_ENGAGEMENT_CONTENT_SITE_ENGAGEMENT_HELPER_H_
diff --git a/chrome/browser/engagement/site_engagement_helper_unittest.cc b/components/site_engagement/content/site_engagement_helper_unittest.cc similarity index 92% rename from chrome/browser/engagement/site_engagement_helper_unittest.cc rename to components/site_engagement/content/site_engagement_helper_unittest.cc index 630660d..6a811e23 100644 --- a/chrome/browser/engagement/site_engagement_helper_unittest.cc +++ b/components/site_engagement/content/site_engagement_helper_unittest.cc
@@ -2,23 +2,27 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/engagement/site_engagement_helper.h" +#include "components/site_engagement/content/site_engagement_helper.h" + +#include <memory> #include "base/memory/ptr_util.h" #include "base/test/metrics/histogram_tester.h" #include "base/timer/mock_timer.h" #include "base/values.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/test/base/chrome_render_view_host_test_harness.h" -#include "chrome/test/base/testing_profile.h" +#include "components/permissions/test/test_permissions_client.h" +#include "components/prefs/testing_pref_service.h" #include "components/site_engagement/content/engagement_type.h" #include "components/site_engagement/content/site_engagement_metrics.h" #include "components/site_engagement/content/site_engagement_score.h" #include "components/site_engagement/content/site_engagement_service.h" +#include "components/user_prefs/user_prefs.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/page_navigator.h" #include "content/public/browser/web_contents.h" #include "content/public/test/navigation_simulator.h" +#include "content/public/test/test_renderer_host.h" #include "content/public/test/web_contents_tester.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/input/web_gesture_event.h" @@ -30,11 +34,42 @@ using content::NavigationSimulator; -class SiteEngagementHelperTest : public ChromeRenderViewHostTestHarness { +class TestSiteEngagementServiceProvider + : public SiteEngagementService::ServiceProvider { + public: + explicit TestSiteEngagementServiceProvider( + content::BrowserContext* browser_context) + : site_engagement_service_(browser_context) {} + virtual ~TestSiteEngagementServiceProvider() = default; + + SiteEngagementService* GetSiteEngagementService( + content::BrowserContext* browser_context) override { + return &site_engagement_service_; + } + + private: + SiteEngagementService site_engagement_service_; +}; + +class SiteEngagementHelperTest : public content::RenderViewHostTestHarness { public: void SetUp() override { - ChromeRenderViewHostTestHarness::SetUp(); + content::RenderViewHostTestHarness::SetUp(); SiteEngagementScore::SetParamValuesForTesting(); + + user_prefs::UserPrefs::Set(browser_context(), &pref_service_); + SiteEngagementService::RegisterProfilePrefs(pref_service_.registry()); + + service_provider_ = + std::make_unique<TestSiteEngagementServiceProvider>(browser_context()); + + SiteEngagementService::SetServiceProvider(service_provider_.get()); + } + + void TearDown() override { + SiteEngagementService::ClearServiceProvider(service_provider_.get()); + + content::RenderViewHostTestHarness::TearDown(); } SiteEngagementService::Helper* GetHelper(content::WebContents* web_contents) { @@ -123,7 +158,8 @@ content::WebContents* contents = web_contents(); SiteEngagementService::Helper* helper = GetHelper(contents); - SiteEngagementService* service = SiteEngagementService::Get(profile()); + SiteEngagementService* service = + SiteEngagementService::Get(browser_context()); DCHECK(service); // Check that navigation triggers engagement. @@ -160,6 +196,11 @@ EXPECT_DOUBLE_EQ(0.55, service->GetScore(url2)); EXPECT_DOUBLE_EQ(1.25, service->GetTotalEngagementPoints()); } + + private: + std::unique_ptr<TestSiteEngagementServiceProvider> service_provider_; + TestingPrefServiceSimple pref_service_; + permissions::TestPermissionsClient permissions_client_; }; TEST_F(SiteEngagementHelperTest, KeyPressEngagementAccumulation) { @@ -184,7 +225,8 @@ content::WebContents* contents = web_contents(); SiteEngagementService::Helper* helper = GetHelper(contents); - SiteEngagementService* service = SiteEngagementService::Get(profile()); + SiteEngagementService* service = + SiteEngagementService::Get(browser_context()); DCHECK(service); NavigationSimulator::NavigateAndCommitFromBrowser(web_contents(), url1); @@ -237,7 +279,8 @@ base::MockOneShotTimer* media_tracker_timer = new base::MockOneShotTimer(); SiteEngagementService::Helper* helper = GetHelper(contents); SetMediaTrackerPauseTimer(helper, base::WrapUnique(media_tracker_timer)); - SiteEngagementService* service = SiteEngagementService::Get(profile()); + SiteEngagementService* service = + SiteEngagementService::Get(browser_context()); DCHECK(service); NavigationSimulator::NavigateAndCommitFromBrowser(web_contents(), url1); @@ -307,7 +350,8 @@ content::WebContents* contents = web_contents(); SiteEngagementService::Helper* helper = GetHelper(contents); - SiteEngagementService* service = SiteEngagementService::Get(profile()); + SiteEngagementService* service = + SiteEngagementService::Get(browser_context()); DCHECK(service); base::HistogramTester histograms; @@ -418,7 +462,8 @@ SetInputTrackerPauseTimer(helper, base::WrapUnique(input_tracker_timer)); SetMediaTrackerPauseTimer(helper, base::WrapUnique(media_tracker_timer)); - SiteEngagementService* service = SiteEngagementService::Get(profile()); + SiteEngagementService* service = + SiteEngagementService::Get(browser_context()); DCHECK(service); NavigationSimulator::NavigateAndCommitFromBrowser(web_contents(), url1);
diff --git a/components/strings/components_strings_am.xtb b/components/strings/components_strings_am.xtb index 5ece2bd..f562176 100644 --- a/components/strings/components_strings_am.xtb +++ b/components/strings/components_strings_am.xtb
@@ -985,6 +985,7 @@ <translation id="4358461427845829800">የመክፈያ ዘዴዎችን ያቀናብሩ...</translation> <translation id="4359160567981085931">አሁን የይለፍ ቃልዎን በአንድ አታላይ ጣቢያ ላይ አስገብተዋል። Chrome ሊያግዝ ይችላል። የእርስዎን የይለፍ ቃል ለመለወጥ እና የእርስዎ መለያ ስጋት ውስጥ እንዳለ ለGoogle ለማሳወቅ፣ መለያን ከጥቃት ተከላከል የሚለው ላይ ጠቅ ያድርጉ።</translation> <translation id="4367563149485757821">ቁጥር-12 (የደብዳቤ ፖስታ)</translation> +<translation id="437040971055499437">የደህንነት ክስተት ሲከሰት</translation> <translation id="437058704415269440">የመለያ ቀሪ ሒሳብ</translation> <translation id="4372516964750095882">ፋንፎልድ-አሜሪካ</translation> <translation id="4372948949327679948">የተጠበቀው የ<ph name="VALUE_TYPE" /> ዋጋ ነው።</translation> @@ -1386,6 +1387,7 @@ <translation id="5803412860119678065">የእርስዎን <ph name="CARD_DETAIL" /> መሙላት ይፈልጋሉ?</translation> <translation id="5804241973901381774">ፍቃዶች</translation> <translation id="5810442152076338065">ወደ <ph name="DOMAIN" /> ግንኙነትዎ ፍጹማዊ ስነ መሰውር ጥቅል በመጠቀም የተመሳጠረ ነው።</translation> +<translation id="5812947184178430888">የደህንነት ክስተቶች በChrome በሚጠቆሙ ጊዜ፣ ስለ ክስተቶቹ አግባብነት ያለው ውሂብ ለአስተዳዳሪዎ ይላካል። ይህ እርስዎ በChrome ውስጥ የጎበኟቸውን የገጾች ዩአርኤሎች፣ የፋይል ስሞችን ወይም ዲበ ውሂብን እና ወደ በድር ላይ የሚሰሩ መተግበሪያዎች፣ የእርስዎ መሣሪያ እና Chrome ለመግባት የሚጠቀሙበትን የተጠቃሚ ስም ሊያካትት ይችላል።</translation> <translation id="5813119285467412249">&አክልን ድገም</translation> <translation id="5817918615728894473">አጣምር</translation> <translation id="5824687817967109979">{NUM_CARDS,plural, =1{ይህ ካርድ እርስዎ ሲከፍሉ ይሞላል፣ ሆኖም ትክክለኛ ቁጥሩ ከዚህ ጣቢያ ጋር አይጋራም። ለደህንነት ጥበቃ ሲባል፣ ጊዜያዊ CVC እንዲፈልቅ ይደረጋል።}one{የመረጡት ካርድ እርስዎ ሲከፍሉ ይሞላል ሆኖም ትክክለኛ ቁጥሩ ከዚህ ጣቢያ ጋር አይጋራም። ለደህንነት ጥበቃ ሲባል፣ ጊዜያዊ CVC እንዲፈልቅ ይደረጋል።}other{የመረጡት ካርድ እርስዎ ሲከፍሉ ይሞላል ሆኖም ትክክለኛ ቁጥሩ ከዚህ ጣቢያ ጋር አይጋራም። ለደህንነት ጥበቃ ሲባል፣ ጊዜያዊ CVC እንዲፈልቅ ይደረጋል።}}</translation>
diff --git a/components/strings/components_strings_es-419.xtb b/components/strings/components_strings_es-419.xtb index 9161611..d520fab 100644 --- a/components/strings/components_strings_es-419.xtb +++ b/components/strings/components_strings_es-419.xtb
@@ -986,6 +986,7 @@ <translation id="4358461427845829800">Administrar formas de pago…</translation> <translation id="4359160567981085931">Ingresaste tu contraseña en un sitio engañoso. Chrome puede ayudarte. Para cambiar la contraseña y notificar a Google que tu cuenta podría estar en riesgo, haz clic en Proteger cuenta.</translation> <translation id="4367563149485757821">Number-12 (Envelope)</translation> +<translation id="437040971055499437">Se produjo un evento de seguridad</translation> <translation id="437058704415269440">Saldo de cuenta</translation> <translation id="4372516964750095882">Fanfold-Us</translation> <translation id="4372948949327679948">Valor <ph name="VALUE_TYPE" /> esperado.</translation> @@ -1395,6 +1396,7 @@ <translation id="5803412860119678065">¿Deseas llenar los campos con la información de tu tarjeta <ph name="CARD_DETAIL" />?</translation> <translation id="5804241973901381774">Permisos</translation> <translation id="5810442152076338065">Tu conexión a <ph name="DOMAIN" /> está encriptada con un conjunto de cifrado obsoleto.</translation> +<translation id="5812947184178430888">Cuando Chrome marca eventos de seguridad, se envían datos relacionados con los eventos a tu administrador. Esta información puede incluir URL de las páginas que visitas en Chrome, nombres de archivos o metadatos, y el nombre de usuario con el que accedes a aplicaciones web, tu dispositivo y Chrome.</translation> <translation id="5813119285467412249">&Rehacer Agregar</translation> <translation id="5817918615728894473">Sincronizar</translation> <translation id="5824687817967109979">{NUM_CARDS,plural, =1{Cuando realices un pago, el importe se debitará de esta tarjeta, pero el sitio no tendrá acceso a su número real. Para reforzar la seguridad, se generará un CVC temporal.}other{Cuando realices un pago, el importe se debitará de la tarjeta que selecciones, pero el sitio no tendrá acceso a su número real. Para reforzar la seguridad, se generará un CVC temporal.}}</translation>
diff --git a/components/strings/components_strings_eu.xtb b/components/strings/components_strings_eu.xtb index 2f427d8..3e20041 100644 --- a/components/strings/components_strings_eu.xtb +++ b/components/strings/components_strings_eu.xtb
@@ -1642,7 +1642,7 @@ <translation id="6757797048963528358">Inaktibo geratu da gailua.</translation> <translation id="6767985426384634228">Helbidea eguneratu nahi duzu?</translation> <translation id="6768213884286397650">Hagaki (postala)</translation> -<translation id="6774185088257932239"><ph name="BEGIN_LINK" />Lortu informazio gehiago<ph name="END_LINK" /> ezkutuko moduari buruz.</translation> +<translation id="6774185088257932239"><ph name="BEGIN_LINK" />Lortu informazio gehiago<ph name="END_LINK" /> ezkutuko moduari buruz</translation> <translation id="6775759552199460396">JIS B2</translation> <translation id="67862343314499040">Bioleta</translation> <translation id="6786747875388722282">Luzapenak</translation>
diff --git a/components/strings/components_strings_ja.xtb b/components/strings/components_strings_ja.xtb index eddb5c4..60b8487d 100644 --- a/components/strings/components_strings_ja.xtb +++ b/components/strings/components_strings_ja.xtb
@@ -268,6 +268,7 @@ <translation id="1838374766361614909">検索をクリア</translation> <translation id="1839551713262164453">ポリシーの値を検証できませんでした(エラーが発生しました)</translation> <translation id="1842969606798536927">お支払い</translation> +<translation id="1856713167556118146">シークレット モードで行われないこと</translation> <translation id="1871208020102129563">プロキシは .pac スクリプト URL ではなく固定プロキシ サーバーを使用するように設定されています。</translation> <translation id="1871284979644508959">必須フィールド</translation> <translation id="1875512691959384712">Google フォーム</translation> @@ -984,6 +985,7 @@ <translation id="4358461427845829800">お支払い方法を管理...</translation> <translation id="4359160567981085931">偽のサイトでパスワードを入力しました。Chrome を使って不正利用への対策ができます。パスワードを変更し、Google にアカウントの状況を通知するには、[アカウントを保護] をクリックしてください。</translation> <translation id="4367563149485757821">Number-12(封筒)</translation> +<translation id="437040971055499437">セキュリティ イベントの発生</translation> <translation id="437058704415269440">アカウント残高</translation> <translation id="4372516964750095882">Fanfold-Us</translation> <translation id="4372948949327679948"><ph name="VALUE_TYPE" /> 値が想定されます。</translation> @@ -1010,6 +1012,7 @@ <translation id="4465818729556336129">このドキュメントは機密情報であり、印刷は管理者により推奨されていません。</translation> <translation id="4476953670630786061">このフォームは安全ではないため、自動入力をオフにしました。</translation> <translation id="4477350412780666475">次の曲</translation> +<translation id="4481251927743463293">シークレット モードで行われること</translation> <translation id="4481394504112738036">機密ファイル</translation> <translation id="4482953324121162758">このサイトは翻訳されません。</translation> <translation id="4490717597759821841">A7</translation> @@ -1110,10 +1113,17 @@ <translation id="4819347708020428563">デフォルト表示でメモを編集しますか?</translation> <translation id="4825496307559726072"><ph name="CREATE_GOOGLE_SHEET_FOCUSED_FRIENDLY_MATCH_TEXT" /> です。Tab キー、Enter キーの順に押すと、新しい Google スプレッドシートをすばやく作成します</translation> <translation id="4825507807291741242">パワフル</translation> +<translation id="4827402517081186284">シークレット モードを使用しても、オンライン上にまったく記録が残らないわけではありません。 + <ph name="BEGIN_LIST" /> + <ph name="LIST_ITEM" />サイトにはアクセスしたことが知られます<ph name="END_LIST_ITEM" /> + <ph name="LIST_ITEM" />雇用主や教育機関で閲覧アクティビティを追跡している場合があります<ph name="END_LIST_ITEM" /> + <ph name="LIST_ITEM" />インターネット サービス プロバイダでウェブ トラフィックを監視していることがあります<ph name="END_LIST_ITEM" /> + <ph name="END_LIST" /></translation> <translation id="4838327282952368871">ドリーミー</translation> <translation id="484462545196658690">自動</translation> <translation id="4850886885716139402">表示</translation> <translation id="485316830061041779">ドイツ語</translation> +<translation id="4853901935952445031">このサイトでは、2022 年 2 月以降、U2F API を使用できなくなります。このサイトの所有者の方は、Web Authentication API を使用するように変更を行っていただく必要があります。</translation> <translation id="4854362297993841467">この配達方法はご利用いただけません。別の方法を選択してください。</translation> <translation id="4854853140771946034">Google Keep で新しいメモをすばやく作成します</translation> <translation id="4876188919622883022">簡易表示</translation> @@ -1385,6 +1395,7 @@ <translation id="5803412860119678065"><ph name="CARD_DETAIL" /> を入力しますか?</translation> <translation id="5804241973901381774">権限</translation> <translation id="5810442152076338065"><ph name="DOMAIN" /> への接続は古い暗号スイートにより暗号化されています。</translation> +<translation id="5812947184178430888">セキュリティ イベントが Chrome によって報告されると、そのイベントに関するデータが管理者に送信されます。送信されるデータには、Chrome でアクセスしたページの URL、ファイルの名前やメタデータ、ウェブベースのアプリケーション、デバイス、Chrome へのログインに使用したユーザー名が含まれる可能性があります。</translation> <translation id="5813119285467412249">追加のやり直し(&R)</translation> <translation id="5817918615728894473">ペア設定</translation> <translation id="5824687817967109979">{NUM_CARDS,plural, =1{お支払いの際はこのカードに請求が行われますが、カード番号はこのサイトと共有されません。追加のセキュリティとして、一時 CVC コードが生成されます。}other{お支払いの際は選択したカードに請求が行われますが、カード番号はこのサイトと共有されません。追加のセキュリティとして、一時 CVC コードが生成されます。}}</translation> @@ -1636,6 +1647,7 @@ <translation id="6757797048963528358">デバイスがスリープ状態です。</translation> <translation id="6767985426384634228">住所を更新しますか?</translation> <translation id="6768213884286397650">はがき</translation> +<translation id="6774185088257932239"><ph name="BEGIN_LINK" />シークレット モードについて<ph name="END_LINK" /></translation> <translation id="6775759552199460396">JIS B2</translation> <translation id="67862343314499040">バイオレット</translation> <translation id="6786747875388722282">拡張機能</translation> @@ -1683,6 +1695,7 @@ <translation id="6965382102122355670">OK</translation> <translation id="6965978654500191972">デバイス</translation> <translation id="696703987787944103">知覚的</translation> +<translation id="6968269510885595029">セキュリティ キーを使用する</translation> <translation id="6970216967273061347">地区</translation> <translation id="6971439137020188025">スライドで新しい Google プレゼンテーションをすばやく作成します</translation> <translation id="6972629891077993081">HID デバイス</translation> @@ -1748,6 +1761,7 @@ <translation id="7210863904660874423"><ph name="HOST_NAME" /> ではセキュリティ規格が遵守されていません。</translation> <translation id="7210993021468939304">コンテナ内の Linux アクティビティ、コンテナ内での Linux アプリのインストールと実行</translation> <translation id="721197778055552897">この問題の詳細については、<ph name="BEGIN_LINK" />こちら<ph name="END_LINK" />をご覧ください。</translation> +<translation id="7215025035562547931">正確かどうかを十分に検討してください</translation> <translation id="7217745192097460130">Touch ID を使用して本人確認し、購入手続きを完了しますか?</translation> <translation id="7219179957768738017">この接続には <ph name="SSL_VERSION" /> を使用しています。</translation> <translation id="7220786058474068424">処理しています</translation> @@ -2083,6 +2097,12 @@ <translation id="8307888238279532626">インストールしたアプリと使用頻度</translation> <translation id="831207732689920588">不審なページ(Chrome により判定)</translation> <translation id="831997045666694187">夕方</translation> +<translation id="8328484624016508118">すべてのシークレット タブを閉じると、Chrome で以下のデータが削除されます。 + <ph name="BEGIN_LIST" /> + <ph name="LIST_ITEM" />このデバイスでの閲覧アクティビティ<ph name="END_LIST_ITEM" /> + <ph name="LIST_ITEM" />このデバイスでの検索履歴<ph name="END_LIST_ITEM" /> + <ph name="LIST_ITEM" />フォームに入力した情報<ph name="END_LIST_ITEM" /> + <ph name="END_LIST" /></translation> <translation id="8332188693563227489"><ph name="HOST_NAME" /> へのアクセスが拒否されました</translation> <translation id="833262891116910667">ハイライト表示</translation> <translation id="8339163506404995330"><ph name="LANGUAGE" />のページは翻訳されません</translation>
diff --git a/components/strings/components_strings_ko.xtb b/components/strings/components_strings_ko.xtb index 1dfe8c91..eb2b40c 100644 --- a/components/strings/components_strings_ko.xtb +++ b/components/strings/components_strings_ko.xtb
@@ -985,6 +985,7 @@ <translation id="4358461427845829800">결제 수단 관리...</translation> <translation id="4359160567981085931">사기성 사이트에 비밀번호를 입력했습니다. Chrome이 계정 보호를 도와드립니다. 비밀번호를 변경하고 계정 보안 위험에 관해 Google에 알리려면 계정 보호를 클릭하세요.</translation> <translation id="4367563149485757821">Number-12(봉투)</translation> +<translation id="437040971055499437">보안 관련 활동 발생</translation> <translation id="437058704415269440">계정 잔액</translation> <translation id="4372516964750095882">Fanfold-미국</translation> <translation id="4372948949327679948">예상 <ph name="VALUE_TYPE" /> 값입니다.</translation> @@ -1394,6 +1395,7 @@ <translation id="5803412860119678065"><ph name="CARD_DETAIL" />을(를) 입력하시겠습니까?</translation> <translation id="5804241973901381774">권한</translation> <translation id="5810442152076338065"><ph name="DOMAIN" />에 대한 연결이 더 이상 사용되지 않는 암호화 기술을 사용하여 암호화됩니다.</translation> +<translation id="5812947184178430888">Chrome에서 보안 관련 활동을 신고한 경우 활동에 관한 데이터가 관리자에게 전송됩니다. 여기에는 Chrome에서 방문한 페이지 URL, 파일 이름 또는 메타데이터와 더불어 웹 기반 애플리케이션, 기기, Chrome에 로그인할 때 사용한 사용자 이름이 포함될 수 있습니다.</translation> <translation id="5813119285467412249">추가 다시 실행(&R)</translation> <translation id="5817918615728894473">페어링</translation> <translation id="5824687817967109979">{NUM_CARDS,plural, =1{결제하면 이 카드로 청구되지만 실제 카드 번호는 사이트와 공유되지 않습니다. 보안 강화를 위해 임시 CVC가 생성됩니다.}other{결제하면 선택한 카드로 청구되지만 실제 카드 번호는 사이트와 공유되지 않습니다. 보안 강화를 위해 임시 CVC가 생성됩니다.}}</translation>
diff --git a/components/strings/components_strings_or.xtb b/components/strings/components_strings_or.xtb index ff95f2d4..f58e4fd 100644 --- a/components/strings/components_strings_or.xtb +++ b/components/strings/components_strings_or.xtb
@@ -268,6 +268,7 @@ <translation id="1838374766361614909">ସନ୍ଧାନ ଖାଲି କରନ୍ତୁ</translation> <translation id="1839551713262164453">ତ୍ରୁଟିଗୁଡ଼ିକ ସହିତ ନୀତିଗତ ମୂଲ୍ୟଗୁଡ଼ିକର ବୈଧକରଣ ବିଫଳ ହୋଇଛି</translation> <translation id="1842969606798536927">ପେମେଣ୍ଟ କରନ୍ତୁ</translation> +<translation id="1856713167556118146">ଇନକଗ୍ନିଟୋ କଣ କରେ ନାହିଁ</translation> <translation id="1871208020102129563">ପ୍ରକ୍ସି ନିର୍ଦ୍ଦିଷ୍ଟ କରାଯାଇଥିବା ପ୍ରକ୍ସି ସର୍ଭର୍ଗୁଡ଼ିକୁ ବ୍ୟବହାର କରିବାକୁ ସେଟ୍ କରାଯାଇଛି, ଏକ .pac ସ୍କ୍ରିପ୍ଟ URLକୁ ନୁହେଁ।</translation> <translation id="1871284979644508959">ଆବଶ୍ୟକୀୟ ଫିଲ୍ଡ</translation> <translation id="1875512691959384712">Google Forms</translation> @@ -1007,6 +1008,7 @@ <translation id="4465818729556336129">ଏହି ଡକ୍ୟୁମେଣ୍ଟ ଗୋପନୀୟ ଅଟେ ଏବଂ ଆପଣଙ୍କ ଆଡମିନିଷ୍ଟ୍ରେଟର୍ ଏହାକୁ ପ୍ରିଣ୍ଟ କରିବା ପାଇଁ ପରାମର୍ଶ ଦିଅନ୍ତି ନାହିଁ।</translation> <translation id="4476953670630786061">ଏହି ଫର୍ମ ସୁରକ୍ଷିତ ନୁହେଁ। ସ୍ୱତଃପୂରଣକୁ ବନ୍ଦ କରାଯାଇଛି।</translation> <translation id="4477350412780666475">ପରବର୍ତ୍ତୀ ଟ୍ରାକ୍</translation> +<translation id="4481251927743463293">ଇନକଗ୍ନିଟୋ କଣ କରେ</translation> <translation id="4481394504112738036">ଗୋପନୀୟ ଫାଇଲ୍</translation> <translation id="4482953324121162758">ଏହି ସାଇଟ୍କୁ ଅନୁବାଦ କରାଯିବ ନାହିଁ।</translation> <translation id="4490717597759821841">A7</translation> @@ -1107,10 +1109,17 @@ <translation id="4819347708020428563">ଡିଫଲ୍ଟ ଭ୍ୟୁରେ ଏନୋଟେସନଗୁଡ଼ିକୁ ଏଡିଟ୍ କରିବେ?</translation> <translation id="4825496307559726072"><ph name="CREATE_GOOGLE_SHEET_FOCUSED_FRIENDLY_MATCH_TEXT" />, ଶୀଘ୍ର ଏକ ନୂଆ Google Sheet ତିଆରି କରିବାକୁ Tab କରି Enter ଦବାନ୍ତୁ</translation> <translation id="4825507807291741242">ଶକ୍ତିଶାଳୀ</translation> +<translation id="4827402517081186284">ଇନକଗ୍ନିଟୋ ଆପଣଙ୍କୁ ଅନଲାଇନରେ ଅଦୃଶ୍ୟ କରେ ନାହିଁ: +<ph name="BEGIN_LIST" /> +<ph name="LIST_ITEM" />ଆପଣ ସାଇଟଗୁଡ଼ିକୁ ଭିଜିଟ୍ କଲେ ସେଗୁଡ଼ିକ ଏହା ବିଷୟରେ ଜାଣିପାରେ<ph name="END_LIST_ITEM" /> +<ph name="LIST_ITEM" />ନିଯୁକ୍ତିଦାତା କିମ୍ବା ସ୍କୁଲ୍, ବ୍ରାଉଜିଂ କାର୍ଯ୍ୟକଳାପକୁ ଟ୍ରାକ୍ କରିପାରିବେ<ph name="END_LIST_ITEM" /> +<ph name="LIST_ITEM" />ଇଣ୍ଟରନେଟ୍ ସେବା ପ୍ରଦାନକାରୀଗୁଡ଼ିକ ୱେବ୍ ଟ୍ରାଫିକକୁ ମନିଟର୍ କରିପାରନ୍ତି<ph name="END_LIST_ITEM" /> +<ph name="END_LIST" /></translation> <translation id="4838327282952368871">ଡ୍ରିମି</translation> <translation id="484462545196658690">ସ୍ୱତଃ</translation> <translation id="4850886885716139402">ଦେଖନ୍ତୁ</translation> <translation id="485316830061041779">ଜର୍ମାନ୍</translation> +<translation id="4853901935952445031">ଫେବୃଆରୀ 2022 ପରେ ଏହି ସାଇଟ୍ U2F API ବ୍ୟବହାର କରିବାକୁ ସକ୍ଷମ ହେବ ନାହିଁ। ଯଦି ଏହି ସାଇଟ୍ ଆପଣଙ୍କ ମାଲିକାନାରେ ଅଛି, ତେବେ ୱେବ୍ ପ୍ରମାଣୀକରଣ API ବ୍ୟବହାର କରିବା ପାଇଁ ଆପଣ ଏହାକୁ ପରିବର୍ତ୍ତନ କରିବା ଉଚିତ।</translation> <translation id="4854362297993841467">ଏହି ବିତରଣ ପଦ୍ଧତି ଉପଲବ୍ଧ ନାହିଁ। ଏକ ଭିନ୍ନ ପଦ୍ଧତି ଚେଷ୍ଠା କରନ୍ତୁ।</translation> <translation id="4854853140771946034">Google Keepରେ ଶୀଘ୍ର ଏକ ନୂଆ ନୋଟ୍ ତିଆରି କରନ୍ତୁ</translation> <translation id="4876188919622883022">ସରଳିକୃତ ଭ୍ୟୁ</translation> @@ -1632,6 +1641,7 @@ <translation id="6757797048963528358">ଆପଣଙ୍କର ଡିଭାଇସ୍ ନିଷ୍କ୍ରିୟ ହୋଇଯାଇଛି।</translation> <translation id="6767985426384634228">ଠିକଣା ଅପଡ଼େଟ୍ କରିବେ?</translation> <translation id="6768213884286397650">ହାଗାକି (ପୋଷ୍ଟକାର୍ଡ)</translation> +<translation id="6774185088257932239">ଇନକଗ୍ନିଟୋ ବିଷୟରେ <ph name="BEGIN_LINK" />ଅଧିକ ଜାଣନ୍ତୁ<ph name="END_LINK" /></translation> <translation id="6775759552199460396">JIS B2</translation> <translation id="67862343314499040">ବାଇଗଣୀ</translation> <translation id="6786747875388722282">ପରିବର୍ଦ୍ଧନ</translation> @@ -1679,6 +1689,7 @@ <translation id="6965382102122355670">ଓକେ ବଟନ୍</translation> <translation id="6965978654500191972">ଡିଭାଇସ୍</translation> <translation id="696703987787944103">ପରସେପଚୁଆଲ୍</translation> +<translation id="6968269510885595029">ଆପଣଙ୍କ ସୁରକ୍ଷା କୀ ବ୍ୟବହାର କରନ୍ତୁ</translation> <translation id="6970216967273061347">ଜିଲ୍ଲା</translation> <translation id="6971439137020188025">Slidesରେ ଶୀଘ୍ର ଏକ ନୂଆ Google ପ୍ରେଜେଣ୍ଟେସନ୍ ତିଆରି କରନ୍ତୁ</translation> <translation id="6972629891077993081">HID ଡିଭାଇସଗୁଡ଼ିକ</translation> @@ -1744,6 +1755,7 @@ <translation id="7210863904660874423"><ph name="HOST_NAME" /> ସୁରକ୍ଷା ମାନାଙ୍କର ପାଳନ କରୁନାହିଁ।</translation> <translation id="7210993021468939304">କଣ୍ଟେନର୍ ମଧ୍ୟରେ Linux କାର୍ଯ୍ୟକଳାପ ଏବଂ କଣ୍ଟେନର୍ ମଧ୍ୟରେ Linux ଆପ୍ସ ଇନଷ୍ଟଲ୍ କରି ଚଲାଇପାରେ</translation> <translation id="721197778055552897">ଏହି ଅସୁବିଧା ସମ୍ଵନ୍ଧରେ <ph name="BEGIN_LINK" />ଅଧିକ ଜାଣନ୍ତୁ<ph name="END_LINK" /> ।</translation> +<translation id="7215025035562547931">ସଠିକତାର ବିଚାର କରିବାକୁ କିଛି ସମୟ ନିଅନ୍ତୁ</translation> <translation id="7217745192097460130">ଆପଣଙ୍କର କ୍ରୟକୁ ଯାଞ୍ଚ କରି ସମ୍ପୂର୍ଣ୍ଣ କରିବାକୁ Touch ID ବ୍ୟବହାର କରିବେ?</translation> <translation id="7219179957768738017">ସଂଯୋଗ <ph name="SSL_VERSION" />ର ବ୍ୟବହାର କରିଥାଏ।</translation> <translation id="7220786058474068424">ପ୍ରକ୍ରିୟାକରଣ ହେଉଛି</translation> @@ -2079,6 +2091,12 @@ <translation id="8307888238279532626">ଇନଷ୍ଟଲ୍ କରାଯାଇଥିବା ଆପଗୁଡ଼ିକ ଏବଂ ସେଗୁଡ଼ିକ କେତେ ଥର ବ୍ୟବହାର କରାଯାଇଛି</translation> <translation id="831207732689920588">ଏହି ପୃଷ୍ଠାଟି ସନ୍ଦେହଜନକ ଅଟେ (Chrome ଦ୍ୱାରା ଫ୍ଲାଗ୍ କରାଯାଇଛି)।</translation> <translation id="831997045666694187">ସନ୍ଧ୍ୟା</translation> +<translation id="8328484624016508118">ସମସ୍ତ ଇନକଗ୍ନିଟୋ ଟାବକୁ ବନ୍ଦ କରିବା ପରେ, Chrome ଏସବୁ ଖାଲି କରେ: +<ph name="BEGIN_LIST" /> +<ph name="LIST_ITEM" />ଏହି ଡିଭାଇସରୁ ଆପଣଙ୍କ ବ୍ରାଉଜିଂ କାର୍ଯ୍ୟକଳାପ<ph name="END_LIST_ITEM" /> +<ph name="LIST_ITEM" />ଏହି ଡିଭାଇସରୁ ଆପଣଙ୍କ ସନ୍ଧାନ ଇତିହାସ<ph name="END_LIST_ITEM" /> +<ph name="LIST_ITEM" />ଫର୍ମଗୁଡ଼ିକରେ ଲେଖାଯାଇଥିବା ସୂଚନା<ph name="END_LIST_ITEM" /> +<ph name="END_LIST" /></translation> <translation id="8332188693563227489"><ph name="HOST_NAME" />କୁ ଆକ୍ସେସ୍ ପ୍ରତ୍ୟାଖ୍ୟାନ କରାଯାଇଥିଲା</translation> <translation id="833262891116910667">ହାଇଲାଇଟ୍</translation> <translation id="8339163506404995330"><ph name="LANGUAGE" /> ରେ ପୃଷ୍ଠାଗୁଡ଼ିକ ଅନୁବାଦ କରାଯିବନାହିଁ</translation>
diff --git a/components/strings/components_strings_ta.xtb b/components/strings/components_strings_ta.xtb index fa26b70..d5ac9c17 100644 --- a/components/strings/components_strings_ta.xtb +++ b/components/strings/components_strings_ta.xtb
@@ -990,6 +990,7 @@ <translation id="4358461427845829800">கட்டண முறைகளை நிர்வகி...</translation> <translation id="4359160567981085931">மோசடிசெய்யும் இணையதளத்தில் உங்கள் கடவுச்சொல்லை உள்ளிட்டுள்ளீர்கள். இதில் Chrome உங்களுக்கு உதவலாம். உங்கள் கடவுச்சொல்லை மாற்றுவதற்கும் உங்களின் கணக்கு ஆபத்தில் இருக்கக்கூடும் என்பதை Googleளுக்குத் தெரியப்படுத்துவதற்கும் 'கணக்கைப் பாதுகாத்திடு' என்பதைக் கிளிக் செய்யுங்கள்.</translation> <translation id="4367563149485757821">Number-12 (என்வலப்)</translation> +<translation id="437040971055499437">பாதுகாப்பு தொடர்பான செயல்பாடு மேற்கொள்ளப்படுதல்</translation> <translation id="437058704415269440">அக்கவுண்ட் பேலன்ஸ்</translation> <translation id="4372516964750095882">Fanfold-Us</translation> <translation id="4372948949327679948">எதிர்பார்த்த <ph name="VALUE_TYPE" /> மதிப்பு.</translation> @@ -1399,6 +1400,7 @@ <translation id="5803412860119678065"><ph name="CARD_DETAIL" />ஐ நிரப்ப விரும்புகிறீர்களா?</translation> <translation id="5804241973901381774">அனுமதிகள்</translation> <translation id="5810442152076338065"><ph name="DOMAIN" />க்கான உங்கள் இணைப்பு, நடைமுறையில் இல்லாத சைபர் சூட்டைப் பயன்படுத்தி என்க்ரிப்ட் செய்யப்பட்டது.</translation> +<translation id="5812947184178430888">பாதுகாப்பு தொடர்பான செயல்பாடுகளை Chrome கொடியிடும்போது அவை தொடர்பான தரவு உங்கள் நிர்வாகியுடன் பகிரப்படும். Chromeமில் நீங்கள் பார்க்கும் பக்கங்களின் URLகள், ஃபைலின் பெயர்கள்/தரவுத்தகவல் ஆகியவையும் இணையம் சார்ந்த ஆப்ஸ், சாதனம், Chrome ஆகியவற்றில் உள்நுழைய நீங்கள் பயன்படுத்தும் பயனர்பெயரும் இதில் அடங்கும்.</translation> <translation id="5813119285467412249">&சேர்த்தலை மீண்டும் செய்</translation> <translation id="5817918615728894473">இணை</translation> <translation id="5824687817967109979">{NUM_CARDS,plural, =1{நீங்கள் பணம் செலுத்தும்போது இந்தக் கார்டிலிருந்து கட்டணம் வசூலிக்கப்படும், ஆனால் கார்டின் எண் இந்தத் தளத்துடன் பகிரப்படாது. கூடுதல் பாதுகாப்பிற்காக, தற்காலிக CVC ஒன்று உருவாக்கப்படும்.}other{பணம் செலுத்தும்போது நீங்கள் தேர்ந்தெடுக்கும் கார்டிலிருந்து கட்டணம் வசூலிக்கப்படும், ஆனால் கார்டின் எண் இந்தத் தளத்துடன் பகிரப்படாது. கூடுதல் பாதுகாப்பிற்காக, தற்காலிக CVC ஒன்று உருவாக்கப்படும்.}}</translation>
diff --git a/components/strings/components_strings_uz.xtb b/components/strings/components_strings_uz.xtb index 3b18181..b9c317d 100644 --- a/components/strings/components_strings_uz.xtb +++ b/components/strings/components_strings_uz.xtb
@@ -989,6 +989,7 @@ <translation id="4358461427845829800">To‘lov usullarini boshqarish</translation> <translation id="4359160567981085931">Hozirgina shubhali saytda parol kiritdingiz. Chrome yordamga tayyor. Parolni almashtirish va Googlega bu hisob xavf ostida ekanini xabar qilish uchun Hisobni himoyalash ustiga bosing.</translation> <translation id="4367563149485757821">Number-12 (Envelope)</translation> +<translation id="437040971055499437">Xavfsizlik hodisasi yuz berdi</translation> <translation id="437058704415269440">Hisob balansi</translation> <translation id="4372516964750095882">Fanfold-Us</translation> <translation id="4372948949327679948">Kutilgan <ph name="VALUE_TYPE" /> qiymati.</translation> @@ -1398,6 +1399,7 @@ <translation id="5803412860119678065"><ph name="CARD_DETAIL" /> kartangiz ma’lumotlari to‘ldirilsinmi?</translation> <translation id="5804241973901381774">Ruxsatlar</translation> <translation id="5810442152076338065"><ph name="DOMAIN" /> domeniga ulanish eski shifrlar to‘plami bilan shifrlangan.</translation> +<translation id="5812947184178430888">Xavfsizlikka oid hodisalarni Chrome aniqlasa, bunga aloqador hodisalar haqidagi maʼlumotlar administratorga yuboriladi. Bu ochilgan sahifalarning URL manzillari, fayl nomlari yoki meta-axborotlar, qurilma va Chrome foydalanuvchilari nomlaridan iborat boʻlishi mumkin.</translation> <translation id="5813119285467412249">&Qo‘shish amaliga qaytish</translation> <translation id="5817918615728894473">Ulanish</translation> <translation id="5824687817967109979">{NUM_CARDS,plural, =1{Toʻlov vaqtida bu kartadan haq olinadi, lekin uning haqiqiy raqamlari bu saytga ulashilmaydi. Qoʻshimcha himoya maqsadida vaqtinchalik CVC kod yaratiladi.}other{Toʻlov vaqtida tanlangan kartadan haq olinadi, lekin uning haqiqiy raqamlari bu saytga ulashilmaydi. Qoʻshimcha himoya maqsadida vaqtinchalik CVC kod yaratiladi.}}</translation>
diff --git a/components/strings/components_strings_vi.xtb b/components/strings/components_strings_vi.xtb index cd10bb78..13e31ca 100644 --- a/components/strings/components_strings_vi.xtb +++ b/components/strings/components_strings_vi.xtb
@@ -994,6 +994,7 @@ <translation id="4358461427845829800">Quản lý phương thức thanh toán...</translation> <translation id="4359160567981085931">Bạn vừa nhập mật khẩu vào một trang web lừa đảo. Chrome có thể trợ giúp bạn. Để đổi mật khẩu và thông báo cho Google biết rằng tài khoản của bạn có thể gặp nguy hiểm, hãy nhấp vào Bảo vệ tài khoản.</translation> <translation id="4367563149485757821">Number-12 (Phong bì)</translation> +<translation id="437040971055499437">Xảy ra sự kiện bảo mật</translation> <translation id="437058704415269440">Số dư tài khoản</translation> <translation id="4372516964750095882">Fanfold-Us</translation> <translation id="4372948949327679948">Giá trị <ph name="VALUE_TYPE" /> mong đợi.</translation> @@ -1403,6 +1404,7 @@ <translation id="5803412860119678065">Bạn có muốn điền <ph name="CARD_DETAIL" /> của mình không?</translation> <translation id="5804241973901381774">Quyền</translation> <translation id="5810442152076338065">Kết nối của bạn tới <ph name="DOMAIN" /> được mã hóa bằng bộ số 0 đã lỗi thời.</translation> +<translation id="5812947184178430888">Khi Chrome gắn cờ các sự kiện bảo mật, quản trị viên của bạn sẽ nhận được dữ liệu liên quan đến các sự kiện đó. Dữ liệu này có thể bao gồm URL của những trang bạn truy cập trong Chrome, tên tệp hoặc siêu dữ liệu, cũng như tên người dùng mà bạn sử dụng để đăng nhập vào các ứng dụng dựa trên nền tảng web, thiết bị của bạn và Chrome.</translation> <translation id="5813119285467412249">&Làm lại thêm</translation> <translation id="5817918615728894473">Ghép nối</translation> <translation id="5824687817967109979">{NUM_CARDS,plural, =1{Thẻ này sẽ bị trừ tiền khi bạn thanh toán, nhưng số thẻ thật sẽ không được chia sẻ với trang web này. Để tăng cường tính bảo mật, hệ thống sẽ tạo một Mã xác minh thẻ (CVC) tạm thời.}other{Thẻ bạn chọn sẽ bị trừ tiền khi bạn thanh toán, nhưng số thẻ thật sẽ không được chia sẻ với trang web này. Để tăng cường tính bảo mật, hệ thống sẽ tạo một Mã xác minh thẻ (CVC) tạm thời.}}</translation>
diff --git a/components/sync/trusted_vault/trusted_vault_request.cc b/components/sync/trusted_vault/trusted_vault_request.cc index acf0c23..d5fe5e7 100644 --- a/components/sync/trusted_vault/trusted_vault_request.cc +++ b/components/sync/trusted_vault/trusted_vault_request.cc
@@ -183,9 +183,11 @@ network::SimpleURLLoader::Create(std::move(request), CreateTrafficAnnotationTag()); + // Fetchers are sometimes cancelled because a network change was detected, + // especially at startup and after sign-in on ChromeOS. + url_loader->SetRetryOptions( + 3, network::SimpleURLLoader::RETRY_ON_NETWORK_CHANGE); url_loader->SetAllowHttpErrorResults(true); - // TODO(crbug.com/1113598): do we need to set retry options? (in particular - // RETRY_ON_NETWORK_CHANGE). if (serialized_request_proto_.has_value()) { url_loader->AttachStringForUpload(*serialized_request_proto_,
diff --git a/components/sync/trusted_vault/trusted_vault_request_unittest.cc b/components/sync/trusted_vault/trusted_vault_request_unittest.cc index cea271e..4f9b708 100644 --- a/components/sync/trusted_vault/trusted_vault_request_unittest.cc +++ b/components/sync/trusted_vault/trusted_vault_request_unittest.cc
@@ -35,6 +35,7 @@ using testing::Invoke; using testing::IsEmpty; using testing::Ne; +using testing::NotNull; using testing::Pointee; const char kAccessToken[] = "access_token"; @@ -277,6 +278,29 @@ /*response_body=*/"")); } +TEST_F(TrustedVaultRequestTest, ShouldRetryUponNetworkChange) { + base::MockCallback<TrustedVaultRequest::CompletionCallback> + completion_callback; + std::unique_ptr<TrustedVaultRequest> request = StartNewRequestWithAccessToken( + kAccessToken, TrustedVaultRequest::HttpMethod::kGet, + /*request_body=*/absl::nullopt, completion_callback.Get()); + + // Mimic network change error for the first request. + EXPECT_CALL(completion_callback, Run(_, _)).Times(0); + EXPECT_TRUE(RespondToHttpRequest(net::ERR_NETWORK_CHANGED, net::HTTP_OK, + /*response_body=*/"")); + testing::Mock::VerifyAndClearExpectations(&completion_callback); + + // Second request should be sent, mimic its success. + network::TestURLLoaderFactory::PendingRequest* pending_request = + GetPendingRequest(); + EXPECT_THAT(pending_request, NotNull()); + + EXPECT_CALL(completion_callback, + Run(TrustedVaultRequest::HttpStatus::kSuccess, kResponseBody)); + EXPECT_TRUE(RespondToHttpRequest(net::OK, net::HTTP_OK, kResponseBody)); +} + TEST_F(TrustedVaultRequestTest, ShouldHandleAccessTokenFetchingFailures) { base::MockCallback<TrustedVaultRequest::CompletionCallback> completion_callback;
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index f7d40ef..f4db68a 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -870,6 +870,8 @@ "feature_observer.h", "federated_learning/floc_service_impl.cc", "federated_learning/floc_service_impl.h", + "fenced_frame/fenced_frame.cc", + "fenced_frame/fenced_frame.h", "fenced_frame/fenced_frame_url_mapping.cc", "fenced_frame/fenced_frame_url_mapping.h", "field_trial_recorder.cc",
diff --git a/content/browser/fenced_frame/fenced_frame.cc b/content/browser/fenced_frame/fenced_frame.cc new file mode 100644 index 0000000..51b7bb6 --- /dev/null +++ b/content/browser/fenced_frame/fenced_frame.cc
@@ -0,0 +1,16 @@ +// Copyright 2021 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/fenced_frame/fenced_frame.h" + +#include "base/notreached.h" +#include "url/gurl.h" + +namespace content { + +FencedFrame::FencedFrame() = default; + +FencedFrame::~FencedFrame() = default; + +} // namespace content
diff --git a/content/browser/fenced_frame/fenced_frame.h b/content/browser/fenced_frame/fenced_frame.h new file mode 100644 index 0000000..fee4f36 --- /dev/null +++ b/content/browser/fenced_frame/fenced_frame.h
@@ -0,0 +1,40 @@ +// Copyright 2021 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_FENCED_FRAME_FENCED_FRAME_H_ +#define CONTENT_BROWSER_FENCED_FRAME_FENCED_FRAME_H_ + +#include <memory> +#include <string> + +#include "content/common/content_export.h" +#include "content/common/frame.mojom.h" +#include "mojo/public/cpp/bindings/associated_receiver.h" +#include "mojo/public/cpp/bindings/pending_associated_receiver.h" +#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom.h" + +namespace content { + +// This is the browser-side host object for the <fencedframe> element +// implemented in Blink. This is only used for the MPArch version of fenced +// frames, not the ShadowDOM implementation. It is owned by and stored directly +// on `RenderFrameHostImpl` for now. +class CONTENT_EXPORT FencedFrame : public blink::mojom::FencedFrameOwnerHost { + public: + FencedFrame(); + ~FencedFrame() override; + + void Bind(mojo::PendingAssociatedReceiver<blink::mojom::FencedFrameOwnerHost> + receiver) { + receiver_.Bind(std::move(receiver)); + } + + private: + // Receives messages from the frame owner element in Blink. + mojo::AssociatedReceiver<blink::mojom::FencedFrameOwnerHost> receiver_{this}; +}; + +} // namespace content + +#endif // CONTENT_BROWSER_FENCED_FRAME_FENCED_FRAME_H_
diff --git a/content/browser/fenced_frame/fenced_frame_browsertest.cc b/content/browser/fenced_frame/fenced_frame_browsertest.cc new file mode 100644 index 0000000..43d1ee3 --- /dev/null +++ b/content/browser/fenced_frame/fenced_frame_browsertest.cc
@@ -0,0 +1,59 @@ +// Copyright 2021 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/callback.h" +#include "base/test/bind.h" +#include "base/test/scoped_feature_list.h" +#include "content/browser/fenced_frame/fenced_frame.h" +#include "content/browser/web_contents/web_contents_impl.h" +#include "content/common/frame.mojom-test-utils.h" +#include "content/public/test/browser_test.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/shell/browser/shell.h" +#include "content/shell/browser/shell_browser_context.h" +#include "content/shell/browser/shell_content_browser_client.h" +#include "content/test/content_browser_test_utils_internal.h" +#include "net/dns/mock_host_resolver.h" +#include "net/test/embedded_test_server/embedded_test_server.h" +#include "third_party/blink/public/common/features.h" +#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom.h" +#include "url/gurl.h" + +namespace content { + +class FencedFrameBrowserTest : public ContentBrowserTest { + protected: + FencedFrameBrowserTest() { + scoped_feature_list_.InitAndEnableFeatureWithParameters( + blink::features::kFencedFrames, {{"implementation_type", "mparch"}}); + } + + void SetUpOnMainThread() override { + host_resolver()->AddRule("*", "127.0.0.1"); + ContentBrowserTest::SetUpOnMainThread(); + ASSERT_TRUE(embedded_test_server()->Start()); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +// Tests that the renderer can create a <fencedframe> that results in a +// browser-side content::FencedFrame also being created. +IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, CreateFencedFrame) { + EXPECT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL( + "fencedframe.test", "/title1.html"))); + WebContentsImpl* web_contents_impl = + static_cast<WebContentsImpl*>(shell()->web_contents()); + RenderFrameHostImpl* primary_rfh = web_contents_impl->GetMainFrame(); + + EXPECT_TRUE(ExecJs( + primary_rfh, + "document.body.appendChild(document.createElement('fencedframe'));")); + EXPECT_EQ(1U, primary_rfh->GetFencedFrames().size()); +} + +} // namespace content
diff --git a/content/browser/font_access/font_enumeration_cache_fontconfig.cc b/content/browser/font_access/font_enumeration_cache_fontconfig.cc index 7e92c49d..8fc7115 100644 --- a/content/browser/font_access/font_enumeration_cache_fontconfig.cc +++ b/content/browser/font_access/font_enumeration_cache_fontconfig.cc
@@ -15,7 +15,6 @@ #include "base/task/thread_pool.h" #include "base/threading/sequence_bound.h" #include "base/time/time.h" -#include "base/timer/elapsed_timer.h" #include "base/types/pass_key.h" #include "content/browser/font_access/font_enumeration_cache.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -171,10 +170,6 @@ void FontEnumerationCacheFontconfig::PrepareFontEnumerationCache() { DCHECK(!enumeration_cache_built_->IsSet()); - // Metrics. - const base::ElapsedTimer start_timer; - int incomplete_count = 0; - int duplicate_count = 0; auto font_enumeration_table = std::make_unique<blink::FontEnumerationTable>(); @@ -186,43 +181,48 @@ std::unique_ptr<FcFontSet, decltype(&FcFontSetDestroy)> fontset( ListFonts(object_set.get()), FcFontSetDestroy); - base::UmaHistogramCustomCounts( - "Fonts.AccessAPI.EnumerationCache.Fontconfig.FontCount", fontset->nfont, - 1, 5000, 50); - // Used to filter duplicates. std::set<std::string> fonts_seen; for (int i = 0; i < fontset->nfont; ++i) { - char* postscript_name; - char* full_name; - char* family; - char* style; + char* postscript_name = nullptr; if (FcPatternGetString(fontset->fonts[i], FC_POSTSCRIPT_NAME, 0, reinterpret_cast<FcChar8**>(&postscript_name)) != - FcResultMatch || - FcPatternGetString(fontset->fonts[i], FC_FULLNAME, 0, + FcResultMatch) { + // Skip incomplete or malformed font. + continue; + } + + char* full_name = nullptr; + if (FcPatternGetString(fontset->fonts[i], FC_FULLNAME, 0, reinterpret_cast<FcChar8**>(&full_name)) != - FcResultMatch || - FcPatternGetString(fontset->fonts[i], FC_FAMILY, 0, + FcResultMatch) { + // Skip incomplete or malformed font. + continue; + } + + char* family = nullptr; + if (FcPatternGetString(fontset->fonts[i], FC_FAMILY, 0, reinterpret_cast<FcChar8**>(&family)) != - FcResultMatch || - FcPatternGetString(fontset->fonts[i], FC_STYLE, 0, + FcResultMatch) { + // Skip incomplete or malformed font. + continue; + } + + char* style = nullptr; + if (FcPatternGetString(fontset->fonts[i], FC_STYLE, 0, reinterpret_cast<FcChar8**>(&style)) != - FcResultMatch) { - // Skip incomplete or malformed fonts. - ++incomplete_count; + FcResultMatch) { + // Skip incomplete or malformed font. continue; } - if (fonts_seen.count(postscript_name) != 0) { - ++duplicate_count; - // Skip duplicates. + auto it_and_success = fonts_seen.emplace(postscript_name); + if (!it_and_success.second) { + // Skip duplicate. continue; } - fonts_seen.insert(postscript_name); - // These properties may not be present, so defaults are provided and such // fonts are not skipped. These defaults should map to the default web // values when passed to the FCXXXToWebYYY functions. @@ -247,16 +247,8 @@ metadata->set_stretch(FCWidthToWebStretch(width)); } - base::UmaHistogramCounts100( - "Fonts.AccessAPI.EnumerationCache.Fontconfig.IncompleteFontCount", - incomplete_count); - base::UmaHistogramCounts100( - "Fonts.AccessAPI.EnumerationCache.DuplicateFontCount", duplicate_count); - BuildEnumerationCache(std::move(font_enumeration_table)); - base::UmaHistogramMediumTimes("Fonts.AccessAPI.EnumerationTime", - start_timer.Elapsed()); // Respond to pending and future requests. StartCallbacksTaskQueue(); }
diff --git a/content/browser/font_access/font_enumeration_cache_mac.mm b/content/browser/font_access/font_enumeration_cache_mac.mm index 4fce8f1..de46168b 100644 --- a/content/browser/font_access/font_enumeration_cache_mac.mm +++ b/content/browser/font_access/font_enumeration_cache_mac.mm
@@ -19,7 +19,6 @@ #include "base/task/task_traits.h" #include "base/task/thread_pool.h" #include "base/time/time.h" -#include "base/timer/elapsed_timer.h" #include "base/types/pass_key.h" #include "content/browser/font_access/font_enumeration_cache.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -158,7 +157,6 @@ @autoreleasepool { // Metrics. - const base::ElapsedTimer start_timer; auto font_enumeration_table = std::make_unique<blink::FontEnumerationTable>(); @@ -177,7 +175,6 @@ // Used to filter duplicates. std::set<std::string> fonts_seen; - int duplicate_count = 0; for (CFIndex i = 0; i < CFArrayGetCount(font_descs); ++i) { CTFontDescriptorRef fd = base::mac::CFCast<CTFontDescriptorRef>( @@ -194,12 +191,11 @@ std::string postscript_name = base::SysCFStringRefToUTF8(cf_postscript_name.get()); - if (fonts_seen.count(postscript_name) != 0) { - ++duplicate_count; - // Skip duplicates. + auto it_and_success = fonts_seen.emplace(postscript_name); + if (!it_and_success.second) { + // Skip duplicate. continue; } - fonts_seen.insert(postscript_name); // These defaults should map to the default web values when passed to the // CTXXXToWebYYY functions. @@ -232,10 +228,6 @@ BuildEnumerationCache(std::move(font_enumeration_table)); - base::UmaHistogramCounts100( - "Fonts.AccessAPI.EnumerationCache.DuplicateFontCount", duplicate_count); - base::UmaHistogramMediumTimes("Fonts.AccessAPI.EnumerationTime", - start_timer.Elapsed()); // Respond to pending and future requests. StartCallbacksTaskQueue(); }
diff --git a/content/browser/font_access/font_enumeration_cache_win.cc b/content/browser/font_access/font_enumeration_cache_win.cc index 939e37d..6f9edba 100644 --- a/content/browser/font_access/font_enumeration_cache_win.cc +++ b/content/browser/font_access/font_enumeration_cache_win.cc
@@ -17,7 +17,6 @@ #include "base/task/task_traits.h" #include "base/task/thread_pool.h" #include "base/threading/scoped_blocking_call.h" -#include "base/timer/elapsed_timer.h" #include "content/browser/font_access/font_enumeration_cache.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/common/features.h" @@ -27,14 +26,6 @@ namespace { -// The following HRESULT code is also used in local font src matching. -constexpr HRESULT kErrorNoFullNameOrPostScriptName = - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xD103); -// Additional local custom interface specific HRESULT code to log font -// enumeration errors when reporting them in a UMA metric. -constexpr HRESULT kErrorNoFamilyName = - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xD104); - absl::optional<std::string> GetNativeString( Microsoft::WRL::ComPtr<IDWriteLocalizedStrings> names) { // Retrieve the native name. Try the "en-us" locale and if it's @@ -106,28 +97,22 @@ std::make_unique<content::FontEnumerationCacheWin::FamilyDataResult>(); family_result->fonts = std::vector<blink::FontEnumerationTable_FontMetadata>(); - family_result->exit_hresult = S_OK; Microsoft::WRL::ComPtr<IDWriteFontFamily> family; Microsoft::WRL::ComPtr<IDWriteLocalizedStrings> family_names; HRESULT hr = collection->GetFontFamily(family_index, &family); - if (FAILED(hr)) { - family_result->exit_hresult = hr; + if (FAILED(hr)) return family_result; - } hr = family->GetFamilyNames(&family_names); - if (FAILED(hr)) { - family_result->exit_hresult = hr; + if (FAILED(hr)) return family_result; - } + absl::optional<std::string> native_family_name = GetNativeString(family_names); - if (!native_family_name) { - family_result->exit_hresult = kErrorNoFamilyName; + if (!native_family_name) return family_result; - } UINT32 font_count = family->GetFontCount(); for (UINT32 font_index = 0; font_index < font_count; ++font_index) { @@ -141,10 +126,8 @@ hr = family->GetFont(font_index, &font); } - if (FAILED(hr)) { - family_result->exit_hresult = hr; + if (FAILED(hr)) return family_result; - } // Skip this font if it's a simulation. if (font->GetSimulations() != DWRITE_FONT_SIMULATIONS_NONE) @@ -169,19 +152,15 @@ DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME, &postscript_name, &exists); } - if (FAILED(hr)) { - family_result->exit_hresult = hr; + if (FAILED(hr)) return family_result; - } - if (!exists) { - family_result->exit_hresult = kErrorNoFullNameOrPostScriptName; + + if (!exists) return family_result; - } absl::optional<std::string> native_postscript_name = GetNativeString(postscript_name); if (!native_postscript_name) { - family_result->exit_hresult = kErrorNoFullNameOrPostScriptName; return family_result; } @@ -192,14 +171,11 @@ hr = font->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_FULL_NAME, &full_name, &exists); } - if (FAILED(hr)) { - family_result->exit_hresult = hr; + if (FAILED(hr)) return family_result; - } - if (!exists) { - family_result->exit_hresult = kErrorNoFullNameOrPostScriptName; + + if (!exists) return family_result; - } absl::optional<std::string> localized_full_name = GetLocalizedString(full_name, locale); @@ -216,10 +192,9 @@ DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES, &style_name, &exists); } - if (FAILED(hr)) { - family_result->exit_hresult = hr; + if (FAILED(hr)) return family_result; - } + if (!exists) { { base::ScopedBlockingCall scoped_blocking_call( @@ -228,10 +203,8 @@ DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES, &style_name, &exists); } - if (FAILED(hr)) { - family_result->exit_hresult = hr; + if (FAILED(hr)) return family_result; - } } absl::optional<std::string> native_style_name; if (exists) { @@ -297,9 +270,6 @@ DCHECK(SUCCEEDED(hr)); if (!collection_) { - base::UmaHistogramSparse( - "Fonts.AccessAPI.EnumerationCache.Dwrite.GetSystemFontCollectionResult", - hr); status_ = blink::mojom::FontEnumerationStatus::kUnexpectedError; return; } @@ -314,8 +284,6 @@ InitializeDirectWrite(); } - enumeration_errors_.clear(); - scoped_refptr<base::SequencedTaskRunner> results_task_runner = base::ThreadPool::CreateSequencedTaskRunner( {base::MayBlock(), base::TaskPriority::BEST_EFFORT}); @@ -329,9 +297,6 @@ void FontEnumerationCacheWin::PrepareFontEnumerationCache() { DCHECK(!enumeration_cache_built_->IsSet()); - DCHECK(!enumeration_timer_); - - enumeration_timer_ = std::make_unique<base::ElapsedTimer>(); font_enumeration_table_ = std::make_unique<blink::FontEnumerationTable>(); @@ -340,10 +305,6 @@ FROM_HERE, base::BlockingType::MAY_BLOCK); outstanding_family_results_ = collection_->GetFontFamilyCount(); - - base::UmaHistogramCustomCounts( - "Fonts.AccessAPI.EnumerationCache.Dwrite.FamilyCount", - outstanding_family_results_, 1, 5000, 50); } std::string locale = @@ -376,22 +337,16 @@ if (enumeration_cache_built_->IsSet()) return; - if (FAILED(family_data_result->exit_hresult)) - enumeration_errors_[family_data_result->exit_hresult]++; - // Used to filter duplicates. std::set<std::string> fonts_seen; - int duplicate_count = 0; - for (const auto& font_meta : family_data_result->fonts) { const std::string& postscript_name = font_meta.postscript_name(); - if (fonts_seen.count(postscript_name) != 0) { - ++duplicate_count; + auto it_and_success = fonts_seen.emplace(postscript_name); + if (!it_and_success.second) { // Skip duplicates. continue; } - fonts_seen.insert(postscript_name); blink::FontEnumerationTable_FontMetadata* added_font_meta = font_enumeration_table_->add_fonts(); @@ -401,27 +356,10 @@ if (!outstanding_family_results_) { FinalizeEnumerationCache(); } - - base::UmaHistogramCounts100( - "Fonts.AccessAPI.EnumerationCache.DuplicateFontCount", duplicate_count); } void FontEnumerationCacheWin::FinalizeEnumerationCache() { DCHECK(!enumeration_cache_built_->IsSet()); - DCHECK(enumeration_timer_); - - if (enumeration_errors_.size() > 0) { - auto most_frequent_hresult = std::max_element( - std::begin(enumeration_errors_), std::end(enumeration_errors_), - [](const decltype(enumeration_errors_)::value_type& a, - decltype(enumeration_errors_)::value_type& b) { - return a.second < b.second; - }); - base::UmaHistogramSparse( - "Fonts.AccessAPI.EnumerationCache.Dwrite." - "MostFrequentEnumerationFailure", - most_frequent_hresult->first); - } // Ensures that the FontEnumerationTable gets released when this function goes // out of scope. @@ -429,10 +367,6 @@ std::move(font_enumeration_table_)); BuildEnumerationCache(std::move(enumeration_table)); - base::UmaHistogramMediumTimes("Fonts.AccessAPI.EnumerationTime", - enumeration_timer_->Elapsed()); - enumeration_timer_.reset(); - // Respond to pending and future requests. StartCallbacksTaskQueue(); }
diff --git a/content/browser/font_access/font_enumeration_cache_win.h b/content/browser/font_access/font_enumeration_cache_win.h index 607a969..251a991 100644 --- a/content/browser/font_access/font_enumeration_cache_win.h +++ b/content/browser/font_access/font_enumeration_cache_win.h
@@ -22,10 +22,6 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/common/font_access/font_enumeration_table.pb.h" -namespace base { -class ElapsedTimer; -} - namespace content { // Windows implementation of FontEnumerationCache. @@ -47,7 +43,6 @@ // A data structure to hold font family results from DirectWrite. struct FamilyDataResult { std::vector<blink::FontEnumerationTable_FontMetadata> fonts; - HRESULT exit_hresult{S_OK}; FamilyDataResult(); FamilyDataResult(const FamilyDataResult&) = delete; FamilyDataResult& operator=(const FamilyDataResult&) = delete; @@ -71,9 +66,6 @@ // Protobuf structure temporarily used during cache construction and shared. std::unique_ptr<blink::FontEnumerationTable> font_enumeration_table_; - - std::map<HRESULT, unsigned> enumeration_errors_; - std::unique_ptr<base::ElapsedTimer> enumeration_timer_; }; } // namespace content
diff --git a/content/browser/native_io/native_io_manager_unittest.cc b/content/browser/native_io/native_io_manager_unittest.cc index 041128d6..1058826 100644 --- a/content/browser/native_io/native_io_manager_unittest.cc +++ b/content/browser/native_io/native_io_manager_unittest.cc
@@ -13,6 +13,9 @@ #include "base/test/task_environment.h" #include "base/threading/thread.h" #include "build/build_config.h" +#include "components/services/storage/public/cpp/buckets/bucket_info.h" +#include "components/services/storage/public/cpp/buckets/constants.h" +#include "components/services/storage/public/cpp/quota_error_or.h" #include "content/browser/native_io/native_io_manager.h" #include "content/test/fake_mojo_message_dispatch_context.h" #include "mojo/public/cpp/bindings/pending_receiver.h" @@ -239,6 +242,36 @@ blink::mojom::NativeIOFileHost* const file_host_; }; +class QuotaManagerProxySync { + public: + // `proxy` must outlive the newly created instance. + explicit QuotaManagerProxySync(storage::QuotaManagerProxy* proxy) + : proxy_(proxy) { + DCHECK(proxy); + } + + storage::QuotaErrorOr<storage::BucketInfo> GetBucket( + const StorageKey& storage_key, + const std::string& bucket_name, + blink::mojom::StorageType storage_type) { + storage::QuotaErrorOr<storage::BucketInfo> result; + base::RunLoop run_loop; + proxy_->GetBucket( + storage_key, bucket_name, storage_type, + base::ThreadTaskRunnerHandle::Get().get(), + base::BindLambdaForTesting( + [&](storage::QuotaErrorOr<storage::BucketInfo> bucket_info) { + result = std::move(bucket_info); + run_loop.Quit(); + })); + run_loop.Run(); + return result; + } + + private: + storage::QuotaManagerProxy* const proxy_; +}; + const char kExampleStorageKey[] = "https://example.com"; const char kGoogleStorageKey[] = "https://google.com"; @@ -346,6 +379,31 @@ scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; }; +TEST_P(NativeIOManagerTest, DefaultBucketCreatedOnBindReceiver) { + EXPECT_THAT(google_host_->GetAllFileNames(), testing::SizeIs(0)); + QuotaManagerProxySync proxy(quota_manager_proxy()); + + // Check default bucket exists for https://example.com. + storage::QuotaErrorOr<storage::BucketInfo> result = proxy.GetBucket( + StorageKey::CreateFromStringForTesting(kExampleStorageKey), + storage::kDefaultBucketName, blink::mojom::StorageType::kTemporary); + EXPECT_TRUE(result.ok()); + EXPECT_EQ(result->name, storage::kDefaultBucketName); + EXPECT_EQ(result->storage_key, + StorageKey::CreateFromStringForTesting(kExampleStorageKey)); + EXPECT_GT(result->id.value(), 0); + + // Check default bucket exists for https://google.com. + result = proxy.GetBucket( + StorageKey::CreateFromStringForTesting(kGoogleStorageKey), + storage::kDefaultBucketName, blink::mojom::StorageType::kTemporary); + EXPECT_TRUE(result.ok()); + EXPECT_EQ(result->name, storage::kDefaultBucketName); + EXPECT_EQ(result->storage_key, + StorageKey::CreateFromStringForTesting(kGoogleStorageKey)); + EXPECT_GT(result->id.value(), 0); +} + TEST_P(NativeIOManagerTest, OpenFile_Names) { for (const Filename& filename : filenames_) { mojo::test::BadMessageObserver bad_message_observer;
diff --git a/content/browser/renderer_host/media/media_devices_manager.cc b/content/browser/renderer_host/media/media_devices_manager.cc index e9532581..4d495b9 100644 --- a/content/browser/renderer_host/media/media_devices_manager.cc +++ b/content/browser/renderer_host/media/media_devices_manager.cc
@@ -1116,7 +1116,7 @@ // matching either "default" or "communications". // NOTE: ChromeOS is able to seamlessly redirect streams to the new default // device, hence the event should not be triggered. -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) for (const auto& removed_audio_device : removed_audio_devices) { for (const auto& old_device_info : current_snapshot_[static_cast<size_t>(type)]) {
diff --git a/content/browser/renderer_host/media/media_devices_manager_unittest.cc b/content/browser/renderer_host/media/media_devices_manager_unittest.cc index 48b6fe5..4f42b64 100644 --- a/content/browser/renderer_host/media/media_devices_manager_unittest.cc +++ b/content/browser/renderer_host/media/media_devices_manager_unittest.cc
@@ -969,7 +969,7 @@ TEST_F(MediaDevicesManagerTest, EnumerateDevicesUnplugDefaultDevice) { // This tests does not apply to CrOS, which is to seamlessly switch device. -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) std::string default_device_id("fake_device_id_1"); std::string new_default_device_id("fake_device_id_2"); @@ -1003,7 +1003,7 @@ EXPECT_TRUE(base::Contains(removed_device_ids_, default_device_id)); EXPECT_TRUE(base::Contains(removed_device_ids_, media::AudioDeviceDescription::kDefaultDeviceId)); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) } TEST_F(MediaDevicesManagerTest, EnumerateDevicesUnplugCommunicationsDevice) {
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc index ab2f9033..cd3055c 100644 --- a/content/browser/renderer_host/navigator.cc +++ b/content/browser/renderer_host/navigator.cc
@@ -122,6 +122,12 @@ client->LogWebFeatureForCurrentPage( rfh, blink::mojom::WebFeature::kCrossOriginSubframeWithoutEmbeddingControl); + RenderFrameHostImpl* main_frame = + rfh->frame_tree_node()->frame_tree()->GetMainFrame(); + ukm::builders::CrossOriginSubframeWithoutEmbeddingControl( + main_frame->GetPageUkmSourceId()) + .SetSubframeEmbedded(1) + .Record(ukm::UkmRecorder::Get()); } // Check if the navigation resulted in having same-origin documents in pages
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index d3bc998..e83948a 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -58,6 +58,7 @@ #include "content/browser/dom_storage/dom_storage_context_wrapper.h" #include "content/browser/download/data_url_blob_reader.h" #include "content/browser/feature_observer.h" +#include "content/browser/fenced_frame/fenced_frame.h" #include "content/browser/file_system/file_system_manager_impl.h" #include "content/browser/file_system/file_system_url_loader_factory.h" #include "content/browser/file_system_access/file_system_access_manager_impl.h" @@ -6628,6 +6629,28 @@ proxy_host->GetFrameToken(), portal->GetDevToolsFrameToken()); } +std::vector<FencedFrame*> RenderFrameHostImpl::GetFencedFrames() const { + std::vector<FencedFrame*> result; + for (const std::unique_ptr<FencedFrame>& fenced_frame : fenced_frames_) + result.push_back(fenced_frame.get()); + return result; +} + +void RenderFrameHostImpl::DestroyFencedFrame(FencedFrame& fenced_frame) { + auto it = base::ranges::find_if(fenced_frames_, + base::MatchesUniquePtr(&fenced_frame)); + CHECK(it != fenced_frames_.end()); + fenced_frames_.erase(it); +} + +void RenderFrameHostImpl::CreateFencedFrame( + mojo::PendingAssociatedReceiver<blink::mojom::FencedFrameOwnerHost> + pending_receiver) { + fenced_frames_.push_back(std::make_unique<FencedFrame>()); + FencedFrame* fenced_frame = fenced_frames_.back().get(); + fenced_frame->Bind(std::move(pending_receiver)); +} + void RenderFrameHostImpl::CreateNewPopupWidget( mojo::PendingAssociatedReceiver<blink::mojom::PopupWidgetHost> blink_popup_widget_host,
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h index e0dae50..0e0ed3a 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -190,6 +190,7 @@ class CodeCacheHostImpl; class CrossOriginEmbedderPolicyReporter; class FeatureObserver; +class FencedFrame; class FrameTree; class FrameTreeNode; class GeolocationServiceImpl; @@ -1468,6 +1469,12 @@ // Called when a Portal needs to be destroyed. void DestroyPortal(Portal* portal); + // Return fenced frames owned by |this|. + std::vector<FencedFrame*> GetFencedFrames() const; + + // Called when a fenced frame needs to be destroyed. + void DestroyFencedFrame(FencedFrame& fenced_frame); + // Called on the main frame of a page embedded in a Portal to forward a // message from the host of a portal. void ForwardMessageFromHost(blink::TransferableMessage message, @@ -2480,6 +2487,9 @@ CreatePortalCallback callback) override; void AdoptPortal(const blink::PortalToken& portal_token, AdoptPortalCallback callback) override; + void CreateFencedFrame( + mojo::PendingAssociatedReceiver<blink::mojom::FencedFrameOwnerHost> + pending_receiver) override; void GetKeepAliveHandleFactory( mojo::PendingReceiver<blink::mojom::KeepAliveHandleFactory> receiver) override; @@ -3744,6 +3754,9 @@ // back to |this|. base::flat_set<std::unique_ptr<Portal>, base::UniquePtrComparator> portals_; + // The fenced frames owned by this document. + std::vector<std::unique_ptr<FencedFrame>> fenced_frames_; + // Tracking active features in this frame, for use in figuring out whether // or not it can be frozen. std::unique_ptr<FeatureObserver> feature_observer_;
diff --git a/content/browser/resources/conversions/conversion_internals.html b/content/browser/resources/conversions/conversion_internals.html index 94de3cf1..41191c48 100644 --- a/content/browser/resources/conversions/conversion_internals.html +++ b/content/browser/resources/conversions/conversion_internals.html
@@ -18,10 +18,6 @@ Attribution Reporting API Internals </div> <div id="info"> - <p>Learn more: - <a href="https://web.dev/using-conversion-measurement/" target="_blank"> - Attribution Reporting API - </a> <p>Attribution reporting is currently <span id="feature-status-content"></span>. </div> <hr>
diff --git a/content/browser/web_package/subresource_loading_origin_trial.md b/content/browser/web_package/subresource_loading_origin_trial.md index 07694a0e..2d1165f 100644 --- a/content/browser/web_package/subresource_loading_origin_trial.md +++ b/content/browser/web_package/subresource_loading_origin_trial.md
@@ -10,7 +10,7 @@ ## Origin Trial timeline -Chrome M90-M92. +Chrome M90-M96. ## How to create a bundle
diff --git a/content/browser/webrtc/resources/stats_rates_calculator.js b/content/browser/webrtc/resources/stats_rates_calculator.js index 79149c1..e13fd021 100644 --- a/content/browser/webrtc/resources/stats_rates_calculator.js +++ b/content/browser/webrtc/resources/stats_rates_calculator.js
@@ -45,8 +45,6 @@ if (!calculatedMetrics) { calculatedMetrics = []; this.calculatedMetricsByOriginalName.set(originalName, calculatedMetrics); - // Early return to avoid cases where the first difference is incorrect. - return; } calculatedMetrics.push(metric); }
diff --git a/content/common/frame.mojom b/content/common/frame.mojom index 72fd11b..c1f25746 100644 --- a/content/common/frame.mojom +++ b/content/common/frame.mojom
@@ -29,6 +29,7 @@ import "third_party/blink/public/mojom/commit_result/commit_result.mojom"; import "third_party/blink/public/mojom/conversions/conversions.mojom"; import "third_party/blink/public/mojom/devtools/console_message.mojom"; +import "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom"; import "third_party/blink/public/mojom/frame/frame.mojom"; import "third_party/blink/public/mojom/frame/frame_owner_element_type.mojom"; import "third_party/blink/public/mojom/frame/frame_owner_properties.mojom"; @@ -626,6 +627,14 @@ blink.mojom.RemoteFrameToken frame_token, mojo_base.mojom.UnguessableToken devtools_frame_token); + // Sent by the frame in a renderer process that hosts/owns a <fencedframe> + // element, to the browser process requesting the creation of a new fenced + // frame tree that will host the contents of the <fencedframe> element. + // `fenced_frame` - the receiver that the browser will bind to receive + // messages from the renderer. + CreateFencedFrame( + pending_associated_receiver<blink.mojom.FencedFrameOwnerHost> fenced_frame); + // Asynchronously creates a child frame. A routing ID must be allocated first // by calling RenderMessageFilter::GenerateFrameRoutingID() // Each of these messages will have a corresponding mojom::FrameHost::Detach
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index da75e85..d80be28 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -3624,15 +3624,16 @@ } blink::WebRemoteFrame* RenderFrameImpl::CreateFencedFrame( - const blink::WebElement& fenced_frame) { + const blink::WebElement& fenced_frame, + blink::CrossVariantMojoAssociatedReceiver< + blink::mojom::FencedFrameOwnerHostInterfaceBase> receiver) { int proxy_routing_id = MSG_ROUTING_NONE; blink::mojom::FrameReplicationStatePtr initial_replicated_state = blink::mojom::FrameReplicationState::New(); blink::RemoteFrameToken frame_token; base::UnguessableToken devtools_frame_token; - // TODO(crbug.com/1123606): Call mojom::FrameHost::CreateFencedFrame() once we - // introduce it in a subsequent CL. + GetFrameHost()->CreateFencedFrame(std::move(receiver)); RenderFrameProxy* proxy = RenderFrameProxy::CreateProxyForPortalOrFencedFrame( agent_scheduling_group_, this, proxy_routing_id, frame_token,
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index a2577ae..1e01f13 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -512,7 +512,9 @@ const blink::PortalToken& portal_token, const blink::WebElement& portal_element) override; blink::WebRemoteFrame* CreateFencedFrame( - const blink::WebElement& fenced_frame_element) override; + const blink::WebElement& fenced_frame_element, + blink::CrossVariantMojoAssociatedReceiver< + blink::mojom::FencedFrameOwnerHostInterfaceBase> receiver) override; blink::WebFrame* FindFrame(const blink::WebString& name) override; void WillDetach() override; void FrameDetached() override;
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index b8a9d713..f7dc6bf5 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -1123,6 +1123,7 @@ "../browser/download/drag_download_file_browsertest.cc", "../browser/download/mhtml_generation_browsertest.cc", "../browser/download/save_package_browsertest.cc", + "../browser/fenced_frame/fenced_frame_browsertest.cc", "../browser/file_system/file_system_browsertest.cc", "../browser/file_system/file_system_url_loader_factory_browsertest.cc", "../browser/file_system/fileapi_browsertest.cc",
diff --git a/content/test/test_render_frame.cc b/content/test/test_render_frame.cc index df832ac..76ec3b0 100644 --- a/content/test/test_render_frame.cc +++ b/content/test/test_render_frame.cc
@@ -161,6 +161,13 @@ blink::RemoteFrameToken(), base::UnguessableToken()); } + void CreateFencedFrame( + mojo::PendingAssociatedReceiver<blink::mojom::FencedFrameOwnerHost>) + override { + NOTREACHED() << "At the moment, content::FencedFrame is not used in any " + "unit tests, so this path should not be hit"; + } + void DidCommitSameDocumentNavigation( mojom::DidCommitProvisionalLoadParamsPtr params, mojom::DidCommitSameDocumentNavigationParamsPtr same_doc_params)
diff --git a/docs/enterprise/description_guidelines.md b/docs/enterprise/description_guidelines.md index 7ebb893..ee409ca 100644 --- a/docs/enterprise/description_guidelines.md +++ b/docs/enterprise/description_guidelines.md
@@ -5,6 +5,7 @@ * Chrome OS: `<ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph>` * Chrome Browser Cloud Management: `<ph name="CHROME_BROWSER_CLOUD_MANAGEMENT_NAME">Chrome Browser Cloud Management</ph>` * Chrome Cleanup: `<ph name="CHROME_CLEANUP_NAME">Chrome Cleanup</ph>` +* Chrome Sync: `<ph name="CHROME_SYNC_NAME">Chrome Sync</ph>` * Linux: `<ph name="LINUX_OS_NAME">Linux</ph>` * Internet Explorer: `<ph name="IE_PRODUCT_NAME">Internet® Explorer®</ph>` * Google Admin console: `<ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph>`
diff --git a/docs/speed/binary_size/metrics.md b/docs/speed/binary_size/metrics.md index 6d5f2e5..c410877 100644 --- a/docs/speed/binary_size/metrics.md +++ b/docs/speed/binary_size/metrics.md
@@ -83,12 +83,11 @@ * Deflated apk size: * [Telemetry Graph](https://chromeperf.appspot.com/report?sid=c7dcbe09dee57f6dab19f9307acd97a044a150710357ad25bf217ce004b3b4bb) * Only relevant for non-patch updates of Chrome (new installs, or manual app updates) - * Patch Size: - * Uses [https://github.com/googlesamples/apk-patch-size-estimator](https://github.com/googlesamples/apk-patch-size-estimator) - * No longer runs: - * Is too slow to be running on the Perf Builder - * Was found to be fairly unactionable - * Can be run manually: `build/android/resource_sizes.py --estimate-patch-size out/Release/apks/ChromePublic.apk` + * Patch Size (no longer available): + * Is too slow to be running on the Perf Builder + * Was found to be fairly unactionable + * Used to use [https://github.com/googlesamples/apk-patch-size-estimator](https://github.com/googlesamples/apk-patch-size-estimator) + * Functionality now exists in `//third_party/android_sdk/public/cmdline-tools/latest/bin/apkanalyzer download-size` ### Uncompressed Metrics
diff --git a/extensions/browser/extension_function_histogram_value.h b/extensions/browser/extension_function_histogram_value.h index 14f64ee..88cfbdb 100644 --- a/extensions/browser/extension_function_histogram_value.h +++ b/extensions/browser/extension_function_histogram_value.h
@@ -1632,6 +1632,7 @@ SCRIPTING_UNREGISTERCONTENTSCRIPTS = 1569, FILEMANAGERPRIVATE_GETZIPPROGRESS = 1570, CRYPTOTOKENPRIVATE_CANMAKEU2FAPIREQUEST = 1571, + OS_DIAGNOSTICS_RUNBATTERYCAPACITYROUTINE = 1572, // Last entry: Add new entries above, then run: // python tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg index fd38960..00eacdf9 100644 --- a/infra/config/generated/cr-buildbucket.cfg +++ b/infra/config/generated/cr-buildbucket.cfg
@@ -58054,7 +58054,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -58155,7 +58155,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -58255,7 +58255,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -58356,7 +58356,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -58456,7 +58456,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -58557,7 +58557,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -58657,7 +58657,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -58758,7 +58758,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -58859,7 +58859,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -68216,7 +68216,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -68316,7 +68316,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -70134,7 +70134,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -70234,7 +70234,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -70335,7 +70335,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -70436,7 +70436,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -70541,7 +70541,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -70649,7 +70649,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms" @@ -71654,7 +71654,7 @@ } experiments { key: "chromium.chromium_tests.use_rbe_cas" - value: 0 + value: 5 } experiments { key: "luci.use_realms"
diff --git a/infra/config/lib/try.star b/infra/config/lib/try.star index f6516bda..5074780 100644 --- a/infra/config/lib/try.star +++ b/infra/config/lib/try.star
@@ -301,10 +301,6 @@ name = name, builder_group = "tryserver.chromium.chromiumos", goma_backend = builders.goma.backend.RBE_PROD, - experiments = { - # TODO(crbug.com/1237607): disable rbe cas temporarily. - "chromium.chromium_tests.use_rbe_cas": 0, - }, **kwargs )
diff --git a/ios/chrome/app/BUILD.gn b/ios/chrome/app/BUILD.gn index 6eb60dd..481f7a8 100644 --- a/ios/chrome/app/BUILD.gn +++ b/ios/chrome/app/BUILD.gn
@@ -336,6 +336,7 @@ "//ios/chrome/browser/crash_report:crash_report_internal", "//ios/chrome/browser/crash_report/breadcrumbs", "//ios/chrome/browser/credential_provider:buildflags", + "//ios/chrome/browser/credential_provider:feature_flags", "//ios/chrome/browser/download", "//ios/chrome/browser/external_files", "//ios/chrome/browser/favicon",
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index f941eb6b..a9aa9fa8 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -66,6 +66,7 @@ #include "ios/chrome/browser/crash_report/crash_report_helper.h" #import "ios/chrome/browser/crash_report/crash_restore_helper.h" #include "ios/chrome/browser/credential_provider/credential_provider_buildflags.h" +#import "ios/chrome/browser/credential_provider/feature_flags.h" #include "ios/chrome/browser/download/download_directory_util.h" #import "ios/chrome/browser/external_files/external_file_remover_factory.h" #import "ios/chrome/browser/external_files/external_file_remover_impl.h" @@ -108,6 +109,7 @@ #import "ios/chrome/browser/web/session_state/web_session_state_cache_factory.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" #include "ios/chrome/common/app_group/app_group_constants.h" +#include "ios/chrome/common/app_group/app_group_field_trial_version.h" #include "ios/chrome/common/app_group/app_group_utils.h" #include "ios/net/cookies/cookie_store_ios.h" #import "ios/net/empty_nsurlcache.h" @@ -976,20 +978,27 @@ - (void)saveFieldTrialValuesForExtensions { NSUserDefaults* sharedDefaults = app_group::GetGroupUserDefaults(); - NSString* fieldTrialValueKey = - base::SysUTF8ToNSString(app_group::kChromeExtensionFieldTrialPreference); + NSNumber* passwordCreationValue = [NSNumber + numberWithBool:base::FeatureList::IsEnabled(kPasswordCreationEnabled)]; + NSNumber* passwordCreationVersion = + [NSNumber numberWithInt:kPasswordCreationFeatureVersion]; // Add other field trial values here if they are needed by extensions. // The general format is // { // name: { - // value: bool, - // version: bool + // value: NSNumber bool, + // version: NSNumber int, // } // } NSDictionary* fieldTrialValues = @{ + base::SysUTF8ToNSString(kPasswordCreationEnabled.name) : @{ + kFieldTrialValueKey : passwordCreationValue, + kFieldTrialVersionKey : passwordCreationVersion, + } }; - [sharedDefaults setObject:fieldTrialValues forKey:fieldTrialValueKey]; + [sharedDefaults setObject:fieldTrialValues + forKey:app_group::kChromeExtensionFieldTrialPreference]; } // Schedules a call to |logIfEnterpriseManagedDevice| for deferred
diff --git a/ios/chrome/browser/credential_provider/BUILD.gn b/ios/chrome/browser/credential_provider/BUILD.gn index b7d06da..113afa1 100644 --- a/ios/chrome/browser/credential_provider/BUILD.gn +++ b/ios/chrome/browser/credential_provider/BUILD.gn
@@ -13,6 +13,16 @@ ] } +source_set("feature_flags") { + sources = [ + "feature_flags.h", + "feature_flags.mm", + ] + deps = [ "//base" ] + frameworks = [ "Foundation.framework" ] + configs += [ "//build/config/compiler:enable_arc" ] +} + if (ios_enable_credential_provider_extension) { source_set("credential_provider") { configs += [ "//build/config/compiler:enable_arc" ] @@ -33,6 +43,7 @@ public_deps = [ "//base" ] deps = [ ":buildflags", + ":feature_flags", "//base", "//components/autofill/core/common", "//components/keyed_service/core",
diff --git a/ios/chrome/browser/credential_provider/feature_flags.h b/ios/chrome/browser/credential_provider/feature_flags.h new file mode 100644 index 0000000..2871b3d --- /dev/null +++ b/ios/chrome/browser/credential_provider/feature_flags.h
@@ -0,0 +1,15 @@ +// Copyright 2021 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_CREDENTIAL_PROVIDER_FEATURE_FLAGS_H_ +#define IOS_CHROME_BROWSER_CREDENTIAL_PROVIDER_FEATURE_FLAGS_H_ + +#include "base/feature_list.h" + +// Feature for enabling password creation in the extension. +// This feature is used in extensions. If it is modified significantly, consider +// updating the version in |app_group_field_trial_version|. +extern const base::Feature kPasswordCreationEnabled; + +#endif // IOS_CHROME_BROWSER_CREDENTIAL_PROVIDER_FEATURE_FLAGS_H_
diff --git a/ios/chrome/browser/credential_provider/feature_flags.mm b/ios/chrome/browser/credential_provider/feature_flags.mm new file mode 100644 index 0000000..fb76f7d --- /dev/null +++ b/ios/chrome/browser/credential_provider/feature_flags.mm
@@ -0,0 +1,12 @@ +// Copyright 2021 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/credential_provider/feature_flags.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +const base::Feature kPasswordCreationEnabled{"PasswordCreationEnabled", + base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/ios/chrome/browser/flags/about_flags.h b/ios/chrome/browser/flags/about_flags.h index 48e3c6d7..b021818f 100644 --- a/ios/chrome/browser/flags/about_flags.h +++ b/ios/chrome/browser/flags/about_flags.h
@@ -26,6 +26,9 @@ // Adds all switches from experimental flags to |command_line|. void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line); +// Monitors certain experimental flags for changes. +void MonitorExperimentalSettingsChanges(); + // Reads the state from |flags_storage| and adds the command line flags // belonging to the active feature entries to |command_line| in addition // to the flags from experimental settings.
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index e4d867c..4029d758 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -17,6 +17,7 @@ #include "base/check_op.h" #include "base/command_line.h" #include "base/cxx17_backports.h" +#import "base/mac/foundation_util.h" #include "base/no_destructor.h" #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" @@ -801,26 +802,11 @@ nullptr); return *flags_state; } -} // namespace - -// Add all switches from experimental flags to |command_line|. -void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { +// Creates the experimental test policies map, used by AsyncPolicyLoader and +// PolicyLoaderIOS to locally enable policies. +NSMutableDictionary* CreateExperimentalTestingPolicies() { NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - // Set the UA flag if UseMobileSafariUA is enabled. - if ([defaults boolForKey:@"UseMobileSafariUA"]) { - // Safari uses "Vesion/", followed by the OS version excluding bugfix, where - // Chrome puts its product token. - int32_t major = 0; - int32_t minor = 0; - int32_t bugfix = 0; - base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); - std::string product = base::StringPrintf("Version/%d.%d", major, minor); - - command_line->AppendSwitchASCII(switches::kUserAgent, - web::BuildMobileUserAgent(product)); - } - // Shared variables for all enterprise experimental flags. NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init]; NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init]; @@ -873,11 +859,9 @@ } if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) { - [testing_policies addEntriesFromDictionary:@{ - base::SysUTF8ToNSString(policy::key::kSyncDisabled) : @YES - }]; NSString* sync_policy_key = base::SysUTF8ToNSString(policy::key::kSyncDisabled); + [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}]; [allowed_experimental_policies addObject:sync_policy_key]; } @@ -927,17 +911,6 @@ }]; } - // If a CBCM enrollment token is provided, force Chrome Browser Cloud - // Management to enabled and add the token to the list of policies. - NSString* token_key = - base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken); - NSString* token = [defaults stringForKey:token_key]; - - if ([token length] > 0) { - command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement); - [testing_policies setValue:token forKey:token_key]; - } - NSString* restriction_pattern = [defaults stringForKey:@"RestrictAccountsToPatterns"]; if ([restriction_pattern length] > 0) { @@ -957,6 +930,42 @@ policy::key::kEnableExperimentalPolicies)]; } + return testing_policies; +} +} // namespace + +// Add all switches from experimental flags to |command_line|. +void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; + + // Set the UA flag if UseMobileSafariUA is enabled. + if ([defaults boolForKey:@"UseMobileSafariUA"]) { + // Safari uses "Vesion/", followed by the OS version excluding bugfix, where + // Chrome puts its product token. + int32_t major = 0; + int32_t minor = 0; + int32_t bugfix = 0; + base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); + std::string product = base::StringPrintf("Version/%d.%d", major, minor); + + command_line->AppendSwitchASCII(switches::kUserAgent, + web::BuildMobileUserAgent(product)); + } + + // Shared variables for all enterprise experimental flags. + NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies(); + + // If a CBCM enrollment token is provided, force Chrome Browser Cloud + // Management to enabled and add the token to the list of policies. + NSString* token_key = + base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken); + NSString* token = [defaults stringForKey:token_key]; + + if ([token length] > 0) { + command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement); + [testing_policies setValue:token forKey:token_key]; + } + // If some policies were set, commit them to the app's registration defaults. if ([testing_policies count] > 0) { NSDictionary* registration_defaults = @@ -1011,6 +1020,52 @@ defaults, command_line); } +void MonitorExperimentalSettingsChanges() { + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; + + // Startup values for settings to be observed. + __block bool disabledSync = [defaults boolForKey:@"EnableSyncDisabledPolicy"]; + __block bool samplePolicies = [defaults boolForKey:@"EnableSamplePolicies"]; + __block int incognitoAvailability = + [defaults integerForKey:@"IncognitoModeAvailability"]; + __block NSString* restrictionPattern = + [defaults stringForKey:@"RestrictAccountsToPatterns"]; + + auto monitor = ^(NSNotification* notification) { + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; + + // Check if observed settings have changed. Since source and destination + // are both user defaults, this is required to avoid cycling back here. + bool newDisabledSync = [defaults boolForKey:@"EnableSyncDisabledPolicy"]; + bool newSamplePolicies = [defaults boolForKey:@"EnableSamplePolicies"]; + int newIncognitoAvailability = + [defaults integerForKey:@"IncognitoModeAvailability"]; + NSString* newRestrictionPattern = + [defaults stringForKey:@"RestrictAccountsToPatterns"]; + if (newDisabledSync != disabledSync || + newSamplePolicies != samplePolicies || + newIncognitoAvailability != incognitoAvailability || + newRestrictionPattern != restrictionPattern) { + disabledSync = newDisabledSync; + samplePolicies = newSamplePolicies; + incognitoAvailability = newIncognitoAvailability; + restrictionPattern = newRestrictionPattern; + + // Publish update. + NSMutableDictionary* testing_policies = + CreateExperimentalTestingPolicies(); + [defaults setValue:testing_policies + forKey:kPolicyLoaderIOSConfigurationKey]; + } + }; + + NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; + [center addObserverForName:NSUserDefaultsDidChangeNotification + object:nil + queue:[NSOperationQueue mainQueue] + usingBlock:monitor]; +} + void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, base::CommandLine* command_line) { GetGlobalFlagsState().ConvertFlagsToSwitches(
diff --git a/ios/chrome/browser/ios_chrome_main_parts.mm b/ios/chrome/browser/ios_chrome_main_parts.mm index bfe4ad4..ca25cd9 100644 --- a/ios/chrome/browser/ios_chrome_main_parts.mm +++ b/ios/chrome/browser/ios_chrome_main_parts.mm
@@ -338,6 +338,9 @@ CHECK(base::PathService::Get(ios::DIR_USER_DATA, &user_data_path)); safe_browsing_service->Initialize(last_used_browser_state->GetPrefs(), user_data_path); + + // Set monitoring for some experimental flags. + MonitorExperimentalSettingsChanges(); } void IOSChromeMainParts::PostMainMessageLoopRun() {
diff --git a/ios/chrome/browser/policy/BUILD.gn b/ios/chrome/browser/policy/BUILD.gn index d0639682..ce5560c 100644 --- a/ios/chrome/browser/policy/BUILD.gn +++ b/ios/chrome/browser/policy/BUILD.gn
@@ -241,7 +241,9 @@ "//ios/chrome/browser/translate:eg_test_support+eg2", "//ios/chrome/browser/ui/authentication:eg_test_support+eg2", "//ios/chrome/browser/ui/content_suggestions:constants", + "//ios/chrome/browser/ui/content_suggestions:feature_flags", "//ios/chrome/browser/ui/ntp:constants", + "//ios/chrome/browser/ui/ntp:feature_flags", "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/browser/ui/settings:constants", "//ios/chrome/browser/ui/settings/autofill:constants",
diff --git a/ios/chrome/browser/policy/policy_egtest.mm b/ios/chrome/browser/policy/policy_egtest.mm index 8a8181bc..3e323bea 100644 --- a/ios/chrome/browser/policy/policy_egtest.mm +++ b/ios/chrome/browser/policy/policy_egtest.mm
@@ -21,7 +21,9 @@ #import "ios/chrome/browser/ui/authentication/signin_earl_grey.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_constants.h" +#include "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_constants.h" +#include "ios/chrome/browser/ui/ntp/new_tab_page_feature.h" #import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" #import "ios/chrome/browser/ui/settings/autofill/autofill_constants.h" #import "ios/chrome/browser/ui/settings/elements/elements_constants.h" @@ -408,8 +410,14 @@ // Tests that the feed is disappearing when the policy is set to false while it // is visible. - (void)testDisableContentSuggestions { - NSString* feedTitle = l10n_util::GetNSString(IDS_IOS_DISCOVER_FEED_TITLE); + // Relaunch the app with Discover enabled, as it is required for this test. + AppLaunchConfiguration config = [self appConfigurationForTestCase]; + config.relaunch_policy = ForceRelaunchByCleanShutdown; + config.features_enabled.push_back(kDiscoverFeedInNtp); + config.features_enabled.push_back(kRefactoredNTP); + [[AppLaunchManager sharedManager] ensureAppLaunchedWithConfiguration:config]; + NSString* feedTitle = l10n_util::GetNSString(IDS_IOS_DISCOVER_FEED_TITLE); [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_accessibilityLabel(feedTitle), grey_sufficientlyVisible(), nil)]
diff --git a/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_mediator.mm b/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_mediator.mm index 8c407f6..68279d9 100644 --- a/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_mediator.mm +++ b/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_mediator.mm
@@ -9,7 +9,6 @@ #import "ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_consumer.h" #import "ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/identity_item_configurator.h" #import "ios/public/provider/chrome/browser/signin/chrome_identity.h" -#import "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_default_account/consistency_default_account_coordinator.mm b/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_default_account/consistency_default_account_coordinator.mm index 61bf2bba..4300991 100644 --- a/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_default_account/consistency_default_account_coordinator.mm +++ b/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_default_account/consistency_default_account_coordinator.mm
@@ -11,7 +11,6 @@ #import "ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_default_account/consistency_default_account_view_controller.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/signin/chrome_identity.h" -#import "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/chrome/browser/ui/authentication/signin/signin_utils.mm b/ios/chrome/browser/ui/authentication/signin/signin_utils.mm index a48a3d33..454f2e8 100644 --- a/ios/chrome/browser/ui/authentication/signin/signin_utils.mm +++ b/ios/chrome/browser/ui/authentication/signin/signin_utils.mm
@@ -25,7 +25,6 @@ #import "ios/chrome/browser/ui/authentication/signin/user_signin/user_signin_constants.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/signin/chrome_identity.h" -#import "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" #import "net/base/network_change_notifier.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/chrome/browser/ui/authentication/signin/user_signin/logging/upgrade_signin_logger.mm b/ios/chrome/browser/ui/authentication/signin/user_signin/logging/upgrade_signin_logger.mm index 3719aa6..b2edd85 100644 --- a/ios/chrome/browser/ui/authentication/signin/user_signin/logging/upgrade_signin_logger.mm +++ b/ios/chrome/browser/ui/authentication/signin/user_signin/logging/upgrade_signin_logger.mm
@@ -10,7 +10,6 @@ #include "components/version_info/version_info.h" #import "ios/chrome/browser/ui/authentication/signin/signin_utils.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" -#import "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" #include "net/base/network_change_notifier.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/chrome/browser/ui/authentication/signin/user_signin/user_signin_coordinator.mm b/ios/chrome/browser/ui/authentication/signin/user_signin/user_signin_coordinator.mm index d6c9c360..247e8f23 100644 --- a/ios/chrome/browser/ui/authentication/signin/user_signin/user_signin_coordinator.mm +++ b/ios/chrome/browser/ui/authentication/signin/user_signin/user_signin_coordinator.mm
@@ -30,7 +30,6 @@ #import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/unified_consent/unified_consent_service_factory.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" -#import "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm index 6135aca8..f8e8b9c 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -3909,12 +3909,9 @@ web::features::kWebViewNativeContextMenuPhase2)) { return nil; } - UIViewController* vc = [[UIViewController alloc] init]; - vc.view.backgroundColor = UIColor.blueColor; - return vc; - // if (isLink) - // return [[LinkNoPreviewViewController alloc] init]; - // return nil; + if (isLink) + return [[LinkNoPreviewViewController alloc] init]; + return nil; }; UIContextMenuConfiguration* configuration = [UIContextMenuConfiguration configurationWithIdentifier:nil
diff --git a/ios/chrome/browser/ui/content_suggestions/BUILD.gn b/ios/chrome/browser/ui/content_suggestions/BUILD.gn index ef06edb..4b64c47 100644 --- a/ios/chrome/browser/ui/content_suggestions/BUILD.gn +++ b/ios/chrome/browser/ui/content_suggestions/BUILD.gn
@@ -103,7 +103,6 @@ "//ios/chrome/common/ui/util", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/discover_feed", - "//ios/public/provider/chrome/browser/signin:signin_resources_api", "//ios/public/provider/chrome/browser/ui", "//ui/base", "//ui/strings", @@ -333,6 +332,7 @@ "//ios/chrome/browser:pref_names", "//ios/chrome/browser:utils", "//ios/chrome/browser/ui/ntp:constants", + "//ios/chrome/browser/ui/ntp:feature_flags", "//ios/chrome/browser/ui/settings:constants", "//ios/chrome/browser/ui/start_surface:feature_flags", "//ios/chrome/browser/ui/toolbar/public:constants",
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm index f988e32f..2982606a 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm
@@ -11,9 +11,11 @@ #include "ios/chrome/browser/chrome_switches.h" #import "ios/chrome/browser/pref_names.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_constants.h" +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h" #import "ios/chrome/browser/ui/content_suggestions/new_tab_page_app_interface.h" #import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_constants.h" +#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h" #import "ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h" #import "ios/chrome/browser/ui/start_surface/start_surface_features.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h" @@ -128,6 +130,8 @@ AppLaunchConfiguration config; config.additional_args.push_back(std::string("--") + switches::kEnableDiscoverFeed); + config.features_enabled.push_back(kDiscoverFeedInNtp); + config.features_enabled.push_back(kRefactoredNTP); config.features_disabled.push_back(kStartSurface); return config; }
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm index f0c86c6..2e610f6 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm
@@ -62,7 +62,6 @@ #import "ios/chrome/common/ui/favicon/favicon_attributes.h" #include "ios/chrome/grit/ios_strings.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" -#import "ios/public/provider/chrome/browser/signin/signin_resources_api.h" #import "ios/web/public/navigation/navigation_item.h" #import "ios/web/public/navigation/navigation_manager.h" #include "ios/web/public/navigation/referrer.h"
diff --git a/ios/chrome/browser/ui/first_run/signin/signin_screen_consumer.h b/ios/chrome/browser/ui/first_run/signin/signin_screen_consumer.h index f808cc03..efcba89 100644 --- a/ios/chrome/browser/ui/first_run/signin/signin_screen_consumer.h +++ b/ios/chrome/browser/ui/first_run/signin/signin_screen_consumer.h
@@ -10,16 +10,13 @@ // Handles sign-in screen UI updates. @protocol SigninScreenConsumer <NSObject> -// Sets user image when there is a known account. Pass nil to reset to the -// default image. -- (void)setUserImage:(UIImage*)userImage; - -// Sets the |userName|, |email| and |givenName| of the selected identity. The -// |userName| and |givenName| can be nil. Notifies the UI that an identity is -// available. +// Sets the |userName|, |email|, |givenName| and |avatar| of the selected +// identity. The |userName| and |givenName| can be nil. Notifies the UI that an +// identity is available. - (void)setSelectedIdentityUserName:(NSString*)userName email:(NSString*)email - givenName:(NSString*)givenName; + givenName:(NSString*)givenName + avatar:(UIImage*)avatar; // Notifies the consumer that no identity is available and that the UI should be // updated accordingly.
diff --git a/ios/chrome/browser/ui/first_run/signin/signin_screen_coordinator.mm b/ios/chrome/browser/ui/first_run/signin/signin_screen_coordinator.mm index 207f4f9..4ac994c9 100644 --- a/ios/chrome/browser/ui/first_run/signin/signin_screen_coordinator.mm +++ b/ios/chrome/browser/ui/first_run/signin/signin_screen_coordinator.mm
@@ -30,7 +30,6 @@ #import "ios/chrome/browser/ui/first_run/signin/signin_screen_view_controller.h" #import "ios/chrome/browser/unified_consent/unified_consent_service_factory.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" -#include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/chrome/browser/ui/first_run/signin/signin_screen_mediator.mm b/ios/chrome/browser/ui/first_run/signin/signin_screen_mediator.mm index d5cf2839..267670ab 100644 --- a/ios/chrome/browser/ui/first_run/signin/signin_screen_mediator.mm +++ b/ios/chrome/browser/ui/first_run/signin/signin_screen_mediator.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/ui/first_run/signin/signin_screen_mediator.h" #import "ios/chrome/browser/signin/authentication_service.h" -#import "ios/chrome/browser/signin/chrome_account_manager_service_factory.h" #import "ios/chrome/browser/signin/chrome_account_manager_service_observer_bridge.h" #import "ios/chrome/browser/ui/authentication/signin/user_signin/logging/first_run_signin_logger.h" #import "ios/chrome/browser/ui/authentication/signin/user_signin/logging/user_signin_logger.h" @@ -22,7 +21,6 @@ _accountManagerServiceObserver; } -@property(nonatomic, readonly) ios::ChromeIdentityService* identityService; // Logger used to record sign in metrics. @property(nonatomic, strong) UserSigninLogger* logger; // Account manager service to retrieve Chrome identities. @@ -99,10 +97,6 @@ [self updateConsumer]; } -- (ios::ChromeIdentityService*)identityService { - return ios::GetChromeBrowserProvider().GetChromeIdentityService(); -} - #pragma mark - ChromeAccountManagerServiceObserver - (void)identityListChanged { @@ -125,29 +119,16 @@ #pragma mark - Private - (void)updateConsumer { - if (!self.consumer) - return; - - // Reset the image to the default image. If an avatar icon is found, the image - // will be updated. - [self.consumer setUserImage:nil]; - - if (self.selectedIdentity) { + if (!self.selectedIdentity) { + [self.consumer noIdentityAvailable]; + } else { + UIImage* avatar = self.accountManagerService->GetIdentityAvatarWithIdentity( + self.selectedIdentity, IdentityAvatarSize::DefaultLarge); [self.consumer setSelectedIdentityUserName:self.selectedIdentity.userFullName email:self.selectedIdentity.userEmail - givenName:self.selectedIdentity.userGivenName]; - - ChromeIdentity* selectedIdentity = self.selectedIdentity; - __weak __typeof(self) weakSelf = self; - self.identityService->GetAvatarForIdentity( - selectedIdentity, ^(UIImage* identityAvatar) { - if (weakSelf.selectedIdentity != selectedIdentity) - return; - [weakSelf.consumer setUserImage:identityAvatar]; - }); - } else { - [self.consumer noIdentityAvailable]; + givenName:self.selectedIdentity.userGivenName + avatar:avatar]; } }
diff --git a/ios/chrome/browser/ui/first_run/signin/signin_screen_mediator_unittest.mm b/ios/chrome/browser/ui/first_run/signin/signin_screen_mediator_unittest.mm index c0990d7..9e2c4cab 100644 --- a/ios/chrome/browser/ui/first_run/signin/signin_screen_mediator_unittest.mm +++ b/ios/chrome/browser/ui/first_run/signin/signin_screen_mediator_unittest.mm
@@ -10,6 +10,7 @@ #import "ios/chrome/browser/signin/authentication_service_factory.h" #import "ios/chrome/browser/signin/authentication_service_fake.h" #import "ios/chrome/browser/signin/chrome_account_manager_service_factory.h" +#import "ios/chrome/browser/signin/signin_util.h" #import "ios/chrome/browser/ui/first_run/signin/signin_screen_consumer.h" #include "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" @@ -36,7 +37,7 @@ @property(nonatomic, copy) NSString* userName; @property(nonatomic, copy) NSString* email; @property(nonatomic, copy) NSString* givenName; -@property(nonatomic, strong) UIImage* userImage; +@property(nonatomic, strong) UIImage* avatar; @end @@ -46,16 +47,14 @@ self.hidden = YES; } -- (void)setUserImage:(UIImage*)userImage { - _userImage = userImage; -} - - (void)setSelectedIdentityUserName:(NSString*)userName email:(NSString*)email - givenName:(NSString*)givenName { + givenName:(NSString*)givenName + avatar:(UIImage*)avatar { self.userName = userName; self.email = email; self.givenName = givenName; + self.avatar = avatar; } @end @@ -121,13 +120,11 @@ EXPECT_EQ(identity_.userEmail, consumer_.email); EXPECT_EQ(identity_.userFullName, consumer_.userName); EXPECT_FALSE(consumer_.hidden); - // The image is added asynchronously. - EXPECT_EQ(nil, consumer_.userImage); - - EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForActionTimeout, ^bool { - return identity_service_->GetCachedAvatarForIdentity(identity_) == - consumer_.userImage; - })); + UIImage* avatar = consumer_.avatar; + EXPECT_NE(nil, avatar); + CGSize expected_size = + GetSizeForIdentityAvatarSize(IdentityAvatarSize::DefaultLarge); + EXPECT_TRUE(CGSizeEqualToSize(expected_size, avatar.size)); } // Tests that the consumer is correctly updated when the selected identity is @@ -139,7 +136,7 @@ EXPECT_EQ(nil, consumer_.userName); // True because the selected identity is nil. EXPECT_TRUE(consumer_.hidden); - EXPECT_EQ(nil, consumer_.userImage); + EXPECT_EQ(nil, consumer_.avatar); consumer_.hidden = NO; mediator_.selectedIdentity = identity_; @@ -147,13 +144,11 @@ EXPECT_EQ(identity_.userEmail, consumer_.email); EXPECT_EQ(identity_.userFullName, consumer_.userName); EXPECT_FALSE(consumer_.hidden); - // The image is added asynchronously. - EXPECT_EQ(nil, consumer_.userImage); - - EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForActionTimeout, ^bool { - return identity_service_->GetCachedAvatarForIdentity(identity_) == - consumer_.userImage; - })); + UIImage* avatar = consumer_.avatar; + EXPECT_NE(nil, avatar); + CGSize expected_size = + GetSizeForIdentityAvatarSize(IdentityAvatarSize::DefaultLarge); + EXPECT_TRUE(CGSizeEqualToSize(expected_size, avatar.size)); } // Tests IdentityService observations of the identity list. @@ -164,7 +159,7 @@ EXPECT_EQ(nil, consumer_.userName); // True because the selected identity is nil. EXPECT_TRUE(consumer_.hidden); - EXPECT_EQ(nil, consumer_.userImage); + EXPECT_EQ(nil, consumer_.avatar); consumer_.hidden = NO; @@ -174,13 +169,11 @@ EXPECT_EQ(identity_.userEmail, consumer_.email); EXPECT_EQ(identity_.userFullName, consumer_.userName); EXPECT_FALSE(consumer_.hidden); - // The image is added asynchronously. - EXPECT_EQ(nil, consumer_.userImage); - - EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForActionTimeout, ^bool { - return identity_service_->GetCachedAvatarForIdentity(identity_) == - consumer_.userImage; - })); + UIImage* avatar = consumer_.avatar; + EXPECT_NE(nil, avatar); + CGSize expected_size = + GetSizeForIdentityAvatarSize(IdentityAvatarSize::DefaultLarge); + EXPECT_TRUE(CGSizeEqualToSize(expected_size, avatar.size)); // Removing all the identity is resetting the selected identity. __block bool callback_done = false; @@ -192,7 +185,6 @@ })); EXPECT_TRUE(consumer_.hidden); - EXPECT_EQ(nil, consumer_.userImage); } // Tests BrowserProvider observation of the identity service. @@ -218,6 +210,12 @@ EXPECT_EQ(email, consumer_.email); EXPECT_EQ(name, consumer_.userName); + // Get the avatar before the fetch (the default avatar). + UIImage* default_avatar = consumer_.avatar; + EXPECT_NE(nil, default_avatar); + + // Wait for the avatar to be fetched. + second_service->WaitForServiceCallbacksToComplete(); NSString* updated_email = @"updated@email.com"; NSString* updated_name = @"Second - Updated"; @@ -234,6 +232,10 @@ EXPECT_EQ(updated_email, consumer_.email); EXPECT_EQ(updated_name, consumer_.userName); + // With the notification the real avatar is expected instead of the default + // avatar. + UIImage* real_avatar = consumer_.avatar; + EXPECT_NE(default_avatar, real_avatar); } // Tests Signing In the selected identity.
diff --git a/ios/chrome/browser/ui/first_run/signin/signin_screen_view_controller.mm b/ios/chrome/browser/ui/first_run/signin/signin_screen_view_controller.mm index 2eef5c7b..e98d414 100644 --- a/ios/chrome/browser/ui/first_run/signin/signin_screen_view_controller.mm +++ b/ios/chrome/browser/ui/first_run/signin/signin_screen_view_controller.mm
@@ -103,16 +103,16 @@ #pragma mark - SignInScreenConsumer -- (void)setUserImage:(UIImage*)userImage { - [self.identityControl setIdentityAvatar:userImage]; -} - - (void)setSelectedIdentityUserName:(NSString*)userName email:(NSString*)email - givenName:(NSString*)givenName { + givenName:(NSString*)givenName + avatar:(UIImage*)avatar { + DCHECK(email); + DCHECK(avatar); self.personalizedButtonPrompt = givenName ? givenName : email; [self updateUIForIdentityAvailable:YES]; [self.identityControl setIdentityName:userName email:email]; + [self.identityControl setIdentityAvatar:avatar]; } - (void)noIdentityAvailable {
diff --git a/ios/chrome/browser/ui/settings/password/passwords_settings_egtest.mm b/ios/chrome/browser/ui/settings/password/passwords_settings_egtest.mm index b415912..9329580 100644 --- a/ios/chrome/browser/ui/settings/password/passwords_settings_egtest.mm +++ b/ios/chrome/browser/ui/settings/password/passwords_settings_egtest.mm
@@ -248,6 +248,11 @@ } } +// Returns matcher for the "Add Password" button located at the bottom of the +// screen. +id<GREYMatcher> AddPasswordButton() { + return grey_accessibilityID(kPasswordsAddPasswordButtonId); +} // Saves an example form in the store. void SaveExamplePasswordForm() { @@ -313,10 +318,7 @@ } // namespace // Various tests for the Save Passwords section of the settings. -@interface PasswordsSettingsTestCase : ChromeTestCase { - base::test::ScopedFeatureList _featureList; -} - +@interface PasswordsSettingsTestCase : ChromeTestCase @end @implementation PasswordsSettingsTestCase @@ -344,6 +346,12 @@ password_manager::features::kEditPasswordsInSettings); } + if ([self isRunningTest:@selector(testToolbarAddPasswordButton)] || + [self isRunningTest:@selector(testNoAddButtonInEditMode)]) { + config.features_enabled.push_back( + password_manager::features::kSupportForAddPasswordsInSettings); + } + return config; } @@ -1661,6 +1669,55 @@ performAction:grey_tap()]; } +// Checks the 'Add Password' button is disabled when the enable password toggle +// is turned off. +- (void)testToolbarAddPasswordButton { + SaveExamplePasswordForm(); + OpenPasswordSettings(); + + // Toggle the "Save Passwords" control off and back on and check that add + // password button is disabled and enabled respectively. + BOOL isSwitchEnabled = + [PasswordSettingsAppInterface isCredentialsServiceEnabled]; + BOOL kExpectedState[] = {isSwitchEnabled, !isSwitchEnabled}; + for (BOOL expectedState : kExpectedState) { + // Toggle the switch. It is located near the top, so if not interactable, + // try scrolling up. + [GetInteractionForListItem( + chrome_test_util::SettingsSwitchCell(kSavePasswordSwitchTableViewId, + expectedState), + kGREYDirectionUp) performAction:TurnSettingsSwitchOn(!expectedState)]; + + // Check that the switch has been modified. + [GetInteractionForListItem( + chrome_test_util::SettingsSwitchCell(kSavePasswordSwitchTableViewId, + !expectedState), + kGREYDirectionUp) assertWithMatcher:grey_sufficientlyVisible()]; + + if (!expectedState) { + // Expect the button to be enabled. + [[EarlGrey selectElementWithMatcher:AddPasswordButton()] + assertWithMatcher:grey_sufficientlyVisible()]; + } else { + // Expect the button to be disabled. + [[EarlGrey selectElementWithMatcher:AddPasswordButton()] + assertWithMatcher:grey_not(grey_enabled())]; + } + } +} + +// Checks that the "Add" button is not shown on Edit. +- (void)testNoAddButtonInEditMode { + SaveExamplePasswordForm(); + OpenPasswordSettings(); + + TapEdit(); + + // Expect Add Password button to be removed. + [[EarlGrey selectElementWithMatcher:AddPasswordButton()] + assertWithMatcher:grey_nil()]; +} + // Checks that deleting a compromised password from password issues goes back // to the list-of-issues which doesn't display that password anymore. - (void)testDeletePasswordIssue {
diff --git a/ios/chrome/browser/ui/settings/password/passwords_table_view_constants.h b/ios/chrome/browser/ui/settings/password/passwords_table_view_constants.h index f554029..c9b0472 100644 --- a/ios/chrome/browser/ui/settings/password/passwords_table_view_constants.h +++ b/ios/chrome/browser/ui/settings/password/passwords_table_view_constants.h
@@ -12,6 +12,7 @@ extern NSString* const kPasswordsExportConfirmViewId; extern NSString* const kPasswordsSearchBarId; extern NSString* const kPasswordsScrimViewId; +extern NSString* const kPasswordsAddPasswordButtonId; // The accessibility identifier of the password details table view. extern NSString* const kPasswordDetailsTableViewId;
diff --git a/ios/chrome/browser/ui/settings/password/passwords_table_view_constants.mm b/ios/chrome/browser/ui/settings/password/passwords_table_view_constants.mm index 83d2952..d9dc10a 100644 --- a/ios/chrome/browser/ui/settings/password/passwords_table_view_constants.mm +++ b/ios/chrome/browser/ui/settings/password/passwords_table_view_constants.mm
@@ -12,6 +12,7 @@ NSString* const kPasswordsExportConfirmViewId = @"PasswordsExportConfirmViewId"; NSString* const kPasswordsSearchBarId = @"PasswordsSearchBar"; NSString* const kPasswordsScrimViewId = @"PasswordsScrimViewId"; +NSString* const kPasswordsAddPasswordButtonId = @"PasswordsAddPasswordButtonId"; NSString* const kPasswordDetailsTableViewId = @"PasswordDetailsTableViewId"; NSString* const kPasswordDetailsDeletionAlertViewId =
diff --git a/ios/chrome/browser/ui/settings/password/passwords_table_view_controller.mm b/ios/chrome/browser/ui/settings/password/passwords_table_view_controller.mm index 8d9b870..fd3e8a2 100644 --- a/ios/chrome/browser/ui/settings/password/passwords_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/password/passwords_table_view_controller.mm
@@ -233,6 +233,9 @@ // Number of compromised passwords. @property(assign) NSInteger compromisedPasswordsCount; +// Button to add new password profile in the toolbar. +@property(nonatomic, strong) UIBarButtonItem* addPasswordButton; + @end @implementation PasswordsTableViewController @@ -253,7 +256,12 @@ self.exampleHeaders = [[NSMutableDictionary alloc] init]; self.title = l10n_util::GetNSString(IDS_IOS_PASSWORDS); - self.shouldHideDoneButton = YES; + if (base::FeatureList::IsEnabled( + password_manager::features::kSupportForAddPasswordsInSettings)) { + self.shouldDisableDoneButtonOnEdit = YES; + } else { + self.shouldHideDoneButton = YES; + } self.searchTerm = @""; _passwordManagerEnabled = [[PrefBackedBoolean alloc] initWithPrefService:_browserState->GetPrefs() @@ -337,9 +345,13 @@ UIOffset offset = UIOffsetMake(0.0f, kTableViewNavigationVerticalOffsetForSearchHeader); UIBarButtonItem* cancelButton = [UIBarButtonItem - appearanceWhenContainedInInstancesOfClasses:@ [[UISearchBar class]]]; + appearanceWhenContainedInInstancesOfClasses:@[ [UISearchBar class] ]]; [cancelButton setTitlePositionAdjustment:offset forBarMetrics:UIBarMetricsDefault]; + if (base::FeatureList::IsEnabled( + password_manager::features::kSupportForAddPasswordsInSettings)) { + self.navigationController.toolbarHidden = NO; + } } - (void)viewWillDisappear:(BOOL)animated { @@ -347,7 +359,7 @@ // Restore to default origin offset for cancel button proxy style. UIBarButtonItem* cancelButton = [UIBarButtonItem - appearanceWhenContainedInInstancesOfClasses:@ [[UISearchBar class]]]; + appearanceWhenContainedInInstancesOfClasses:@[ [UISearchBar class] ]]; [cancelButton setTitlePositionAdjustment:UIOffsetZero forBarMetrics:UIBarMetricsDefault]; } @@ -481,14 +493,48 @@ } - (BOOL)shouldShowEditButton { + if (base::FeatureList::IsEnabled( + password_manager::features::kSupportForAddPasswordsInSettings)) { + // The edit button is put in the toolbar instead of the navigation bar. + return NO; + } return YES; } - (BOOL)editButtonEnabled { - DCHECK([self shouldShowEditButton]); return !_savedForms.empty() || !_blockedForms.empty(); } +- (BOOL)shouldHideToolbar { + if (base::FeatureList::IsEnabled( + password_manager::features::kSupportForAddPasswordsInSettings)) { + // There is a bug from apple that this method might be called in this view + // controller even if it is not the top view controller. + if (self.navigationController.topViewController == self) { + return NO; + } + } + + return [super shouldHideToolbar]; +} + +- (BOOL)shouldShowEditDoneButton { + if (base::FeatureList::IsEnabled( + password_manager::features::kSupportForAddPasswordsInSettings)) { + // The "Done" button in the navigation bar closes the sheet. + return NO; + } + return YES; +} + +- (void)updateUIForEditState { + [super updateUIForEditState]; + if (base::FeatureList::IsEnabled( + password_manager::features::kSupportForAddPasswordsInSettings)) { + [self setToolbarItemsWithEditing:self.tableView.editing]; + } +} + #pragma mark - SettingsControllerProtocol - (void)reportDismissalUserAction { @@ -650,6 +696,12 @@ // Update the item. _savePasswordsItem.on = [_passwordManagerEnabled value]; + + if (base::FeatureList::IsEnabled( + password_manager::features::kSupportForAddPasswordsInSettings)) { + // Disable the "Add" button if the password manager is not enabled. + self.addPasswordButton.enabled = [_passwordManagerEnabled value]; + } } // Called when the user clicks on the information button of the managed @@ -693,6 +745,15 @@ [self presentViewController:errorInfoPopover animated:YES completion:nil]; } +- (void)handleAddPassword:(id)sender { + // TODO(crbug.com/1226006): Implement functionality to save the newly created + // password profile. +} + +- (void)editOrDoneButtonPressed { + [self setEditing:!self.tableView.editing animated:YES]; +} + #pragma mark - PasswordsConsumer - (void)setPasswordCheckUIState:(PasswordCheckUIState)state @@ -832,6 +893,13 @@ [self clearSectionWithIdentifier:SectionIdentifierSavePasswordsSwitch withRowAnimation:UITableViewRowAnimationTop]; + + if (base::FeatureList::IsEnabled( + password_manager::features:: + kSupportForAddPasswordsInSettings)) { + // Hide the toolbar when the search controller is presented. + self.navigationController.toolbarHidden = YES; + } } completion:nil]; } @@ -880,6 +948,12 @@ [self.tableView insertRowsAtIndexPaths:rowsIndexPaths withRowAnimation:UITableViewRowAnimationTop]; + + if (base::FeatureList::IsEnabled( + password_manager::features:: + kSupportForAddPasswordsInSettings)) { + self.navigationController.toolbarHidden = NO; + } } completion:nil]; } @@ -896,6 +970,41 @@ [self searchForTerm:searchText]; } +#pragma mark - Toolbar Buttons + +// Returns "Add Password" button, to be added to the toolbar. +- (UIBarButtonItem*)addPasswordButton { + if (!_addPasswordButton) { + // TODO(crbug.com/1226006): Use i18n string for the add password button. + _addPasswordButton = + [[UIBarButtonItem alloc] initWithTitle:@"Add" + style:UIBarButtonItemStylePlain + target:self + action:@selector(handleAddPassword:)]; + _addPasswordButton.accessibilityIdentifier = kPasswordsAddPasswordButtonId; + } + _addPasswordButton.enabled = [_passwordManagerEnabled value]; + return _addPasswordButton; +} + +// Creates and returns "Edit" or "Done" button based on |editing|, to be added +// to the toolbar. +- (UIBarButtonItem*)editOrDoneButtonWithEditing:(BOOL)editing { + // TODO(crbug.com/1226006): Create separate accessibility identifiers for the + // toolbar "Edit" and "Done" buttons. + NSString* title = + l10n_util::GetNSString(editing ? IDS_IOS_NAVIGATION_BAR_DONE_BUTTON + : IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON); + UIBarButtonItem* button = [[UIBarButtonItem alloc] + initWithTitle:title + style:(editing ? UIBarButtonItemStyleDone + : UIBarButtonItemStylePlain) + target:self + action:@selector(editOrDoneButtonPressed)]; + button.enabled = editing || [self editButtonEnabled]; + return button; +} + #pragma mark - Private methods // Shows loading spinner background view. @@ -1288,6 +1397,23 @@ password_manager::PasswordCheckReferrer::kPasswordSettings); } +// Sets toolbar items based on |editing|. +- (void)setToolbarItemsWithEditing:(BOOL)editing { + UIBarButtonItem* flexibleSpace = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace + target:nil + action:nil]; + UIBarButtonItem* toolbarLeftButton = + editing ? self.deleteButton : self.addPasswordButton; + [self setToolbarItems:@[ + toolbarLeftButton, flexibleSpace, [self editOrDoneButtonWithEditing:editing] + ] + animated:YES]; + if (editing) { + self.deleteButton.enabled = NO; + } +} + #pragma mark UITableViewDelegate - (void)tableView:(UITableView*)tableView @@ -1296,6 +1422,7 @@ // Actions should only take effect when not in editing mode. if (self.editing) { + self.deleteButton.enabled = YES; return; } @@ -1348,6 +1475,18 @@ [tableView deselectRowAtIndexPath:indexPath animated:YES]; } +- (void)tableView:(UITableView*)tableView + didDeselectRowAtIndexPath:(NSIndexPath*)indexPath { + [super tableView:tableView didDeselectRowAtIndexPath:indexPath]; + if (!self.editing) { + return; + } + + if (self.tableView.indexPathsForSelectedRows.count == 0) { + self.deleteButton.enabled = NO; + } +} + - (BOOL)tableView:(UITableView*)tableView shouldHighlightRowAtIndexPath:(NSIndexPath*)indexPath { NSInteger itemType = [self.tableViewModel itemTypeForIndexPath:indexPath];
diff --git a/ios/chrome/browser/ui/settings/settings_root_table_view_controller.h b/ios/chrome/browser/ui/settings/settings_root_table_view_controller.h index 001394c7..414ab56 100644 --- a/ios/chrome/browser/ui/settings/settings_root_table_view_controller.h +++ b/ios/chrome/browser/ui/settings/settings_root_table_view_controller.h
@@ -26,6 +26,10 @@ // navigation bar button). Default is NO. @property(nonatomic, assign) BOOL shouldHideDoneButton; +// Whether this table view controller should hide the "Done" button (the right +// navigation bar button) on edit. Default is NO. +@property(nonatomic, assign) BOOL shouldDisableDoneButtonOnEdit; + // Updates the edit or done button to reflect editing state. If the // tableView is not in edit mode (and thus showing the 'Done' button) it is // using shouldHideDoneButton to know if it should display the edit button. @@ -53,6 +57,10 @@ // enabled. - (BOOL)editButtonEnabled; +// Returns YES by default. Subclasses should overload this if the edit done +// button should be shown. +- (BOOL)shouldShowEditDoneButton; + // Notifies the view controller that the edit button has been tapped. If you // override this method, you must call -[super editButtonPressed] at some point // in your implementation.
diff --git a/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm b/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm index 551dc2b..3216461 100644 --- a/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm
@@ -78,7 +78,7 @@ animated:YES]; // Update edit button. - if (self.tableView.editing) { + if ([self shouldShowEditDoneButton] && self.tableView.editing) { self.navigationItem.rightBarButtonItem = [self createEditModeDoneButton]; } else if (self.shouldShowEditButton) { self.navigationItem.rightBarButtonItem = [self createEditButton]; @@ -231,7 +231,11 @@ SettingsNavigationController* navigationController = base::mac::ObjCCast<SettingsNavigationController>( self.navigationController); - return [navigationController doneButton]; + UIBarButtonItem* doneButton = [navigationController doneButton]; + if (_shouldDisableDoneButtonOnEdit) { + doneButton.enabled = !self.tableView.editing; + } + return doneButton; } - (UIBarButtonItem*)createEditButton { @@ -289,6 +293,10 @@ return NO; } +- (BOOL)shouldShowEditDoneButton { + return YES; +} + - (void)editButtonPressed { [self setEditing:!self.tableView.editing animated:YES]; [self updateUIForEditState];
diff --git a/ios/chrome/browser/ui/start_surface/start_surface_egtest.mm b/ios/chrome/browser/ui/start_surface/start_surface_egtest.mm index 07584568..f2de125 100644 --- a/ios/chrome/browser/ui/start_surface/start_surface_egtest.mm +++ b/ios/chrome/browser/ui/start_surface/start_surface_egtest.mm
@@ -26,6 +26,10 @@ AppLaunchConfiguration config; config.relaunch_policy = ForceRelaunchByCleanShutdown; config.additional_args.push_back( + std::string("--enable-features=StartSurface<StartSurface")); + config.additional_args.push_back( + std::string("--force-fieldtrials=StartSurface/ShrinkLogo")); + config.additional_args.push_back( std::string("--force-fieldtrial-params=StartSurface.ShrinkLogo:" "ReturnToStartSurfaceInactiveDurationInSeconds/0")); return config; @@ -45,7 +49,7 @@ [ChromeEarlGrey loadURL:destinationUrl]; [[AppLaunchManager sharedManager] - ensureAppLaunchedWithConfiguration:self.appConfigurationForTestCase]; + ensureAppLaunchedWithConfiguration:[self appConfigurationForTestCase]]; [ChromeTestCase removeAnyOpenMenusAndInfoBars]; // Assert NTP is visible by checking that the fake omnibox is here.
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_egtest.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_egtest.mm index 6074c9e2..7f4693c 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_egtest.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_egtest.mm
@@ -111,7 +111,9 @@ (testTabGridItemContextMenuAddToReadingList)] || [self isRunningTest:@selector(testTabGridItemContextCloseTab)] || [self - isRunningTest:@selector(testTabGridItemContextMenuAddToBookmarks)]) { + isRunningTest:@selector(testTabGridItemContextMenuAddToBookmarks)] || + [self isRunningTest:@selector + (testTabGridItemContextMenuAddToBookmarkGreyed)]) { config.features_enabled.push_back(kTabGridContextMenu); }
diff --git a/ios/chrome/common/app_group/app_group_constants.h b/ios/chrome/common/app_group/app_group_constants.h index ce757ad..38bdd32 100644 --- a/ios/chrome/common/app_group/app_group_constants.h +++ b/ios/chrome/common/app_group/app_group_constants.h
@@ -33,7 +33,7 @@ // The key of a preference containing a dictionary of field trial values needed // in extensions. -extern const char kChromeExtensionFieldTrialPreference[]; +extern NSString* const kChromeExtensionFieldTrialPreference; // The key of a preference containing a dictionary containing app group command // parameters.
diff --git a/ios/chrome/common/app_group/app_group_constants.mm b/ios/chrome/common/app_group/app_group_constants.mm index f63f108e..2a586e2d 100644 --- a/ios/chrome/common/app_group/app_group_constants.mm +++ b/ios/chrome/common/app_group/app_group_constants.mm
@@ -17,7 +17,7 @@ const char kChromeAppGroupXCallbackCommand[] = "app-group-command"; -const char kChromeExtensionFieldTrialPreference[] = "Extension.FieldTrial"; +NSString* const kChromeExtensionFieldTrialPreference = @"Extension.FieldTrial"; const char kChromeAppGroupCommandPreference[] = "GroupApp.ChromeAppGroupCommand";
diff --git a/ios/chrome/common/app_group/app_group_field_trial_version.h b/ios/chrome/common/app_group/app_group_field_trial_version.h index 4c47935..d856e125 100644 --- a/ios/chrome/common/app_group/app_group_field_trial_version.h +++ b/ios/chrome/common/app_group/app_group_field_trial_version.h
@@ -17,4 +17,8 @@ // The dictionary key for the trial version. extern NSString* const kFieldTrialVersionKey; +// The current version of the credential provider extension's password creation +// feature. +extern const int kPasswordCreationFeatureVersion; + #endif // IOS_CHROME_COMMON_APP_GROUP_APP_GROUP_FIELD_TRIAL_VERSION_H_
diff --git a/ios/chrome/common/app_group/app_group_field_trial_version.mm b/ios/chrome/common/app_group/app_group_field_trial_version.mm index 2082eb8..70a0d2d 100644 --- a/ios/chrome/common/app_group/app_group_field_trial_version.mm +++ b/ios/chrome/common/app_group/app_group_field_trial_version.mm
@@ -10,3 +10,5 @@ NSString* const kFieldTrialValueKey = @"FieldTrialValue"; NSString* const kFieldTrialVersionKey = @"FieldTrialVersion"; + +const int kPasswordCreationFeatureVersion = 0;
diff --git a/ios/chrome/credential_provider_extension/ui/BUILD.gn b/ios/chrome/credential_provider_extension/ui/BUILD.gn index fdd95d6..52af47cd 100644 --- a/ios/chrome/credential_provider_extension/ui/BUILD.gn +++ b/ios/chrome/credential_provider_extension/ui/BUILD.gn
@@ -68,6 +68,7 @@ "feature_flags.h", "feature_flags.mm", ] + deps = [ "//ios/chrome/common/app_group:app_group" ] frameworks = [ "Foundation.framework" ] configs += [ "//build/config/compiler:enable_arc" ] }
diff --git a/ios/chrome/credential_provider_extension/ui/feature_flags.mm b/ios/chrome/credential_provider_extension/ui/feature_flags.mm index 4d95789..5680af24 100644 --- a/ios/chrome/credential_provider_extension/ui/feature_flags.mm +++ b/ios/chrome/credential_provider_extension/ui/feature_flags.mm
@@ -4,10 +4,20 @@ #import "ios/chrome/credential_provider_extension/ui/feature_flags.h" +#include "ios/chrome/common/app_group/app_group_constants.h" +#include "ios/chrome/common/app_group/app_group_field_trial_version.h" + #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif BOOL IsPasswordCreationEnabled() { - return NO; + NSDictionary* allFeatures = [app_group::GetGroupUserDefaults() + objectForKey:app_group::kChromeExtensionFieldTrialPreference]; + NSDictionary* featureData = allFeatures[@"PasswordCreationEnabled"]; + if (!featureData || kPasswordCreationFeatureVersion != + [featureData[kFieldTrialVersionKey] intValue]) { + return NO; + } + return [featureData[kFieldTrialValueKey] boolValue]; }
diff --git a/ios/chrome/search_widget_extension/search_widget_view_controller.mm b/ios/chrome/search_widget_extension/search_widget_view_controller.mm index c88a049..3043463 100644 --- a/ios/chrome/search_widget_extension/search_widget_view_controller.mm +++ b/ios/chrome/search_widget_extension/search_widget_view_controller.mm
@@ -124,8 +124,7 @@ // handler with whether any updates occured.. - (void)updateWidgetWithCompletionHandler:(void (^)(BOOL))completionHandler { NSUserDefaults* sharedDefaults = app_group::GetGroupUserDefaults(); - NSString* fieldTrialKey = - base::SysUTF8ToNSString(app_group::kChromeExtensionFieldTrialPreference); + NSString* fieldTrialKey = app_group::kChromeExtensionFieldTrialPreference; self.fieldTrialValues = [sharedDefaults dictionaryForKey:fieldTrialKey]; NSString* supportsSearchByImageKey =
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.arm64.zip.sha1 index 3d7bc66..e7354b1e 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.arm64.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@ -52b687ef100f21c41807713e8133b16903558777 \ No newline at end of file +170744c1f11964742db733949e702bd5b4baa4c8 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.x64.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.x64.zip.sha1 index 5b2d6df..9008f09 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.x64.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.x64.zip.sha1
@@ -1 +1 @@ -e8bae5d235356fc5eeadbaf352bd2f46f4af8369 \ No newline at end of file +0564d4eeb73adc08736aef8eb6cec191c967299b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.arm64.zip.sha1 index a911e05..bb3a0da 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.arm64.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@ -4cc15f77d10b724be046b35e43affacfa1b6608b \ No newline at end of file +754b125a13cbb941e1a273ddf07aa95a6fcffac8 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.x64.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.x64.zip.sha1 index c18140d..c25307e1 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.x64.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.x64.zip.sha1
@@ -1 +1 @@ -b29ad2e0f61de2a361434e060b5e8423269fb72e \ No newline at end of file +1d993091ee125ce83c35e9e1f924161de40d28c2 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.arm64.zip.sha1 index 1688607..cb8b5a4 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.arm64.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@ -ccc1618362bed9c4a834085ad0815a74aecf8896 \ No newline at end of file +c3b5af92dd4ef8a50d8e9f5e3f6b1ca2a0c936fa \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.x64.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.x64.zip.sha1 index 0316030..9eda69d 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.x64.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.x64.zip.sha1
@@ -1 +1 @@ -60c1ab87c3f9e4f34db25f2db092c6be7e69e263 \ No newline at end of file +3503512fb7c3ffa8e5a923ad6cb166eb3b866d63 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.arm64.zip.sha1 index 6d63d39..fbd0ff1 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.arm64.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@ -fcdc5f94770a150c07e4f5e3156edfd98d370796 \ No newline at end of file +96a366fdbe7b97142f9ff695eb919783652db0a6 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.x64.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.x64.zip.sha1 index 3583287..1b4e8ab1 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.x64.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.x64.zip.sha1
@@ -1 +1 @@ -3aaa5ee1a4e808741c9163fbd5642946149b9dec \ No newline at end of file +a25c9809a6fc83b0f986e31e26a8fa737cb90d5b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.arm64.zip.sha1 index c9cd375..9307e84 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.arm64.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@ -8ae66dd2fb5892ef0eac69318063e90645099fd5 \ No newline at end of file +26a8a7049a36e3cee21195274d52f924a1065aed \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.x64.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.x64.zip.sha1 index e27b181..faacb76 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.x64.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.x64.zip.sha1
@@ -1 +1 @@ -da28df32f1ae6068154fd9fdebb634c59b2f528c \ No newline at end of file +d8422582a5a3dcbcf29642813b54c8e635d0ad8c \ No newline at end of file
diff --git a/ios/web/web_state/ui/crw_context_menu_controller.mm b/ios/web/web_state/ui/crw_context_menu_controller.mm index 79e5b4c..15adf939 100644 --- a/ios/web/web_state/ui/crw_context_menu_controller.mm +++ b/ios/web/web_state/ui/crw_context_menu_controller.mm
@@ -71,9 +71,9 @@ - (UIView*)highlightView { if (!_highlightView) { // If the views have a CGRectZero size, it is not taken into account. - CGRect rectSizedOne = CGRectMake(0, 0, 300, 300); + CGRect rectSizedOne = CGRectMake(0, 0, 1, 1); _highlightView = [[UIView alloc] initWithFrame:rectSizedOne]; - _highlightView.backgroundColor = UIColor.greenColor; + _highlightView.backgroundColor = UIColor.clearColor; } return _highlightView; }
diff --git a/media/capture/video/file_video_capture_device.cc b/media/capture/video/file_video_capture_device.cc index a1cfd142..539247e 100644 --- a/media/capture/video/file_video_capture_device.cc +++ b/media/capture/video/file_video_capture_device.cc
@@ -327,9 +327,12 @@ std::unique_ptr<uint8_t[]> FileVideoCaptureDevice::CropPTZRegion( const uint8_t* frame, - size_t frame_buffer_size) { + size_t frame_buffer_size, + VideoPixelFormat* final_pixel_format) { CHECK(frame); + *final_pixel_format = capture_format_.pixel_format; + const gfx::Size& frame_size = capture_format_.frame_size; uint32_t fourcc; std::unique_ptr<uint8_t[]> jpeg_to_i420_buffer_; @@ -368,6 +371,7 @@ frame = jpeg_to_i420_buffer_.get(); frame_buffer_size = VideoFrame::AllocationSize(PIXEL_FORMAT_I420, frame_size); + *final_pixel_format = PIXEL_FORMAT_I420; ABSL_FALLTHROUGH_INTENDED; case PIXEL_FORMAT_I420: fourcc = libyuv::FOURCC_I420; @@ -641,7 +645,12 @@ const uint8_t* frame_ptr = file_parser_->GetNextFrame(&frame_size); CHECK(frame_ptr); - auto ptz_frame = CropPTZRegion(frame_ptr, frame_size); + VideoPixelFormat ptz_pixel_format; + auto ptz_frame = CropPTZRegion(frame_ptr, frame_size, &ptz_pixel_format); + + VideoCaptureFormat ptz_format = capture_format_; + ptz_format.pixel_format = ptz_pixel_format; + CHECK(ptz_frame); const base::TimeTicks current_time = base::TimeTicks::Now(); @@ -675,19 +684,19 @@ src_v_plane, buffer_size.width() / 2, scoped_mapping.y_plane(), scoped_mapping.y_stride(), scoped_mapping.uv_plane(), scoped_mapping.uv_stride(), buffer_size.width(), buffer_size.height()); - VideoCaptureFormat modified_format = capture_format_; // When GpuMemoryBuffer is used, the frame data is opaque to the CPU for // most of the time. Currently the only supported underlying format is // NV12. - modified_format.pixel_format = PIXEL_FORMAT_NV12; - client_->OnIncomingCapturedBuffer(std::move(capture_buffer), - modified_format, current_time, + VideoCaptureFormat gmb_format = ptz_format; + gmb_format.pixel_format = PIXEL_FORMAT_NV12; + client_->OnIncomingCapturedBuffer(std::move(capture_buffer), gmb_format, + current_time, current_time - first_ref_time_); } else { // Leave the color space unset for compatibility purposes but this // information should be retrieved from the container when possible. client_->OnIncomingCapturedData( - ptz_frame.get(), frame_size, capture_format_, gfx::ColorSpace(), + ptz_frame.get(), frame_size, ptz_format, gfx::ColorSpace(), 0 /* clockwise_rotation */, false /* flip_y */, current_time, current_time - first_ref_time_); } @@ -698,7 +707,7 @@ take_photo_callbacks_.pop(); mojom::BlobPtr blob = - RotateAndBlobify(ptz_frame.get(), frame_size, capture_format_, 0); + RotateAndBlobify(ptz_frame.get(), frame_size, ptz_format, 0); if (!blob) continue;
diff --git a/media/capture/video/file_video_capture_device.h b/media/capture/video/file_video_capture_device.h index 7862676..63bdaaa 100644 --- a/media/capture/video/file_video_capture_device.h +++ b/media/capture/video/file_video_capture_device.h
@@ -68,8 +68,10 @@ VideoCaptureFormat* video_format); // Crops frame with respect to PTZ settings. - std::unique_ptr<uint8_t[]> CropPTZRegion(const uint8_t* frame, - size_t frame_buffer_size); + std::unique_ptr<uint8_t[]> CropPTZRegion( + const uint8_t* frame, + size_t frame_buffer_size, + VideoPixelFormat* final_pixel_format); // Called on the |capture_thread_|. void OnAllocateAndStart(const VideoCaptureParams& params,
diff --git a/services/device/generic_sensor/platform_sensor_and_provider_unittest_linux.cc b/services/device/generic_sensor/platform_sensor_and_provider_unittest_linux.cc index 5899924..ad1e6c7 100644 --- a/services/device/generic_sensor/platform_sensor_and_provider_unittest_linux.cc +++ b/services/device/generic_sensor/platform_sensor_and_provider_unittest_linux.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <algorithm> #include <memory> #include "base/bind.h" @@ -40,6 +41,8 @@ using mojom::SensorType; +constexpr size_t kSensorValuesSize = 3; + // Zero value can mean whether value is not being not used or zero value. constexpr double kZero = 0.0; @@ -225,7 +228,7 @@ double frequency, double offset, double scaling, - double values[3]) { + double values[kSensorValuesSize]) { SensorPathsLinux data; EXPECT_TRUE(InitSensorData(type, &data)); @@ -252,18 +255,22 @@ WriteValueToFile(sensor_frequency_file, frequency); } - uint32_t i = 0; - for (const auto& file_names : data.sensor_file_names) { - // TODO(thakis): Figure out if it's intentional that the lop below - // runs just once. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunreachable-code" - for (const auto& name : file_names) { - base::FilePath sensor_file = base::FilePath(sensor_dir).Append(name); - WriteValueToFile(sensor_file, values[i++]); - break; - } -#pragma GCC diagnostic pop + // |data.sensor_file_names| is a vector of std::vector<std::string>s. It + // is expected to hold at most kSensorValuesSize entries, and each value + // at position N in |values| will be written to the first entry of the + // inner vector at position N in |sensor_file_names|. + EXPECT_LE(data.sensor_file_names.size(), kSensorValuesSize); + for (size_t i = 0; + i < std::min(kSensorValuesSize, data.sensor_file_names.size()); + i++) { + const auto& paths = data.sensor_file_names[i]; + if (paths.empty()) + continue; + // We write to paths[0] simply because we do not need to write to the + // other entries in any of the existing tests. This could be changed and + // parameterized in the future if necessary. + const auto sensor_file = base::FilePath(sensor_dir).Append(paths[0]); + WriteValueToFile(sensor_file, values[i]); } } } @@ -337,7 +344,7 @@ // Tests sensor is not returned if not implemented. TEST_F(PlatformSensorAndProviderLinuxTest, SensorIsNotImplemented) { - double sensor_value[3] = {5}; + double sensor_value[kSensorValuesSize] = {5}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); SetServiceStart(); @@ -346,7 +353,7 @@ // Tests sensor is not returned if not supported by hardware. TEST_F(PlatformSensorAndProviderLinuxTest, SensorIsNotSupported) { - double sensor_value[3] = {5}; + double sensor_value[kSensorValuesSize] = {5}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); SetServiceStart(); @@ -355,7 +362,7 @@ // Tests sensor is returned if supported. TEST_F(PlatformSensorAndProviderLinuxTest, SensorIsSupported) { - double sensor_value[3] = {5}; + double sensor_value[kSensorValuesSize] = {5}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); SetServiceStart(); @@ -368,7 +375,7 @@ // Tests that PlatformSensor::StartListening fails when provided reporting // frequency is above hardware capabilities. TEST_F(PlatformSensorAndProviderLinuxTest, StartFails) { - double sensor_value[3] = {5}; + double sensor_value[kSensorValuesSize] = {5}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); SetServiceStart(); @@ -385,7 +392,7 @@ // Tests that PlatformSensor::StartListening succeeds and notification about // modified sensor reading is sent to the PlatformSensor::Client interface. TEST_F(PlatformSensorAndProviderLinuxTest, SensorStarted) { - double sensor_value[3] = {5}; + double sensor_value[kSensorValuesSize] = {5}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); SetServiceStart(); @@ -403,7 +410,7 @@ // Tests that OnSensorError is called when sensor is disconnected. TEST_F(PlatformSensorAndProviderLinuxTest, SensorRemoved) { - double sensor_value[3] = {1}; + double sensor_value[kSensorValuesSize] = {1}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); SetServiceStart(); @@ -423,7 +430,7 @@ // Tests that sensor is not returned if not connected and // is created after it has been added. TEST_F(PlatformSensorAndProviderLinuxTest, SensorAddedAndRemoved) { - double sensor_value[3] = {1, 2, 4}; + double sensor_value[kSensorValuesSize] = {1, 2, 4}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); SetServiceStart(); @@ -444,7 +451,7 @@ // Checks the main fields of all sensors and initialized right. TEST_F(PlatformSensorAndProviderLinuxTest, CheckAllSupportedSensors) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); InitializeSupportedSensor( @@ -485,7 +492,7 @@ // Tests that GetMaximumSupportedFrequency provides correct value. TEST_F(PlatformSensorAndProviderLinuxTest, GetMaximumSupportedFrequency) { - double sensor_value[3] = {5}; + double sensor_value[kSensorValuesSize] = {5}; InitializeSupportedSensor( SensorType::ACCELEROMETER, kAccelerometerFrequencyValue, kAccelerometerOffsetValue, kAccelerometerScalingValue, sensor_value); @@ -501,7 +508,7 @@ // OS does not provide any information about frequency. TEST_F(PlatformSensorAndProviderLinuxTest, GetMaximumSupportedFrequencyDefault) { - double sensor_value[3] = {5}; + double sensor_value[kSensorValuesSize] = {5}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); SetServiceStart(); @@ -520,7 +527,7 @@ sizeof(SensorReadingSharedBuffer), SensorReadingSharedBuffer::GetOffset(SensorType::AMBIENT_LIGHT)); - double sensor_value[3] = {22}; + double sensor_value[kSensorValuesSize] = {22}; InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, kZero, kZero, kZero, sensor_value); @@ -560,7 +567,7 @@ // This will allow the LinuxMockPlatformSensorClient to // receive a notification and test if reading values are right. Otherwise // the test will not know when data is ready. - double sensor_values[3] = {4.5, -2.45, -3.29}; + double sensor_values[kSensorValuesSize] = {4.5, -2.45, -3.29}; InitializeSupportedSensor(SensorType::ACCELEROMETER, kZero, kAccelerometerOffsetValue, kAccelerometerScalingValue, sensor_values); @@ -610,7 +617,7 @@ mojo::ScopedSharedBufferMapping mapping = handle->MapAtOffset( sizeof(SensorReadingSharedBuffer), SensorReadingSharedBuffer::GetOffset(SensorType::LINEAR_ACCELERATION)); - double sensor_values[3] = {0, 0, -base::kMeanGravityDouble}; + double sensor_values[kSensorValuesSize] = {0, 0, -base::kMeanGravityDouble}; InitializeSupportedSensor(SensorType::ACCELEROMETER, kAccelerometerFrequencyValue, kZero, kZero, sensor_values); @@ -656,7 +663,7 @@ // This will allow the LinuxMockPlatformSensorClient to // receive a notification and test if reading values are right. Otherwise // the test will not know when data is ready. - double sensor_values[3] = {2.2, -3.8, -108.7}; + double sensor_values[kSensorValuesSize] = {2.2, -3.8, -108.7}; InitializeSupportedSensor(SensorType::GYROSCOPE, kZero, kGyroscopeOffsetValue, kGyroscopeScalingValue, sensor_values); @@ -704,7 +711,7 @@ // This will allow the LinuxMockPlatformSensorClient to // receive a notification and test if reading values are right. Otherwise // the test will not know when data is ready. - double sensor_values[3] = {2.2, -3.8, -108.7}; + double sensor_values[kSensorValuesSize] = {2.2, -3.8, -108.7}; InitializeSupportedSensor(SensorType::MAGNETOMETER, kZero, kMagnetometerOffsetValue, kMagnetometerScalingValue, sensor_values); @@ -745,7 +752,7 @@ sizeof(SensorReadingSharedBuffer), SensorReadingSharedBuffer::GetOffset(SensorType::AMBIENT_LIGHT)); - double sensor_value[3] = {22}; + double sensor_value[kSensorValuesSize] = {22}; // Set a non-zero frequency here and sensor's reporting mode will be // mojom::ReportingMode::CONTINUOUS. InitializeSupportedSensor(SensorType::AMBIENT_LIGHT, @@ -796,7 +803,7 @@ // sensor is not created if accelerometer is not available. TEST_F(PlatformSensorAndProviderLinuxTest, CheckAbsoluteOrientationSensorNotCreatedIfNoAccelerometer) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor( SensorType::MAGNETOMETER, kMagnetometerFrequencyValue, kMagnetometerOffsetValue, kMagnetometerScalingValue, sensor_value); @@ -817,7 +824,7 @@ // sensor is not created if magnetometer is not available. TEST_F(PlatformSensorAndProviderLinuxTest, CheckAbsoluteOrientationSensorNotCreatedIfNoMagnetometer) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor( SensorType::ACCELEROMETER, kAccelerometerFrequencyValue, kAccelerometerOffsetValue, kAccelerometerScalingValue, sensor_value); @@ -837,7 +844,7 @@ // Tests that ABSOLUTE_ORIENTATION_EULER_ANGLES sensor is successfully created. TEST_F(PlatformSensorAndProviderLinuxTest, CheckAbsoluteOrientationEulerAnglesSensor) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor( SensorType::ACCELEROMETER, kAccelerometerFrequencyValue, kAccelerometerOffsetValue, kAccelerometerScalingValue, sensor_value); @@ -853,7 +860,7 @@ // Tests that ABSOLUTE_ORIENTATION_QUATERNION sensor is successfully created. TEST_F(PlatformSensorAndProviderLinuxTest, CheckAbsoluteOrientationQuaternionSensor) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor( SensorType::ACCELEROMETER, kAccelerometerFrequencyValue, kAccelerometerOffsetValue, kAccelerometerScalingValue, sensor_value); @@ -888,7 +895,7 @@ // sensor is not created if accelerometer is not available. TEST_F(PlatformSensorAndProviderLinuxTest, CheckRelativeOrientationSensorNotCreatedIfNoAccelerometer) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor(SensorType::GYROSCOPE, kGyroscopeFrequencyValue, kGyroscopeOffsetValue, kGyroscopeScalingValue, sensor_value); @@ -910,7 +917,7 @@ TEST_F( PlatformSensorAndProviderLinuxTest, CheckRelativeOrientationEulerAnglesSensorUsingAccelerometerAndGyroscope) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor(SensorType::GYROSCOPE, kGyroscopeFrequencyValue, kGyroscopeOffsetValue, kGyroscopeScalingValue, sensor_value); @@ -927,7 +934,7 @@ // if only accelerometer is available. TEST_F(PlatformSensorAndProviderLinuxTest, CheckRelativeOrientationEulerAnglesSensorUsingAccelerometer) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor( SensorType::ACCELEROMETER, kAccelerometerFrequencyValue, kAccelerometerOffsetValue, kAccelerometerScalingValue, sensor_value); @@ -941,7 +948,7 @@ // both accelerometer and gyroscope are available. TEST_F(PlatformSensorAndProviderLinuxTest, CheckRelativeOrientationQuaternionSensorUsingAccelerometerAndGyroscope) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor(SensorType::GYROSCOPE, kGyroscopeFrequencyValue, kGyroscopeOffsetValue, kGyroscopeScalingValue, sensor_value); @@ -958,7 +965,7 @@ // only accelerometer is available. TEST_F(PlatformSensorAndProviderLinuxTest, CheckRelativeOrientationQuaternionSensorUsingAccelerometer) { - double sensor_value[3] = {1, 2, 3}; + double sensor_value[kSensorValuesSize] = {1, 2, 3}; InitializeSupportedSensor( SensorType::ACCELEROMETER, kAccelerometerFrequencyValue, kAccelerometerOffsetValue, kAccelerometerScalingValue, sensor_value);
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index b9774cd..010ca16 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5886,21 +5886,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "dimension_sets": [ @@ -5973,21 +5973,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "dimension_sets": [
diff --git a/testing/buildbot/chromium.clang.json b/testing/buildbot/chromium.clang.json index 4fa5198..31900497 100644 --- a/testing/buildbot/chromium.clang.json +++ b/testing/buildbot/chromium.clang.json
@@ -3197,6 +3197,30 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "integrity": "high", + "os": "Windows-10-19042" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4913,6 +4937,30 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "integrity": "high", + "os": "Windows-10-19042" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -28963,6 +29011,28 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -30238,6 +30308,28 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -31481,6 +31573,28 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -33272,6 +33386,30 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "integrity": "high", + "os": "Windows-10-19042" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -35143,6 +35281,30 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "integrity": "high", + "os": "Windows-10-19042" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -37014,6 +37176,30 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "integrity": "high", + "os": "Windows-10-19042" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -38906,6 +39092,28 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -40166,6 +40374,28 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -41942,6 +42172,30 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high", + "os": "Windows-10", + "pool": "chrome.tests" + } + ], + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -43813,6 +44067,30 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high", + "os": "Windows-10", + "pool": "chrome.tests" + } + ], + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -47337,6 +47615,29 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high", + "os": "Windows-10-19042" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py"
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 0e2c213e..952bdfd 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -1668,6 +1668,22 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": false + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3584,6 +3600,31 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "isolate_profile_data": true, + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "integrity": "high", + "os": "Windows-10-19042" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "isolate_profile_data": true, "merge": { "args": [], @@ -83443,7 +83484,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83451,14 +83492,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -83518,7 +83559,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83526,14 +83567,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -84893,21 +84934,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "dimension_sets": [ @@ -84983,21 +85024,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "dimension_sets": [ @@ -86534,21 +86575,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "dimension_sets": [ @@ -86624,21 +86665,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "dimension_sets": [ @@ -87399,21 +87440,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -87495,21 +87536,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4611.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4612.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v95.0.4611.0", - "revision": "version:95.0.4611.0" + "location": "lacros_version_skew_tests_v95.0.4612.0", + "revision": "version:95.0.4612.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -94866,6 +94907,30 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "integrity": "high", + "os": "Windows-10-18363" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -96440,6 +96505,29 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "isolate_profile_data": true, + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "isolate_profile_data": true, "merge": { "args": [],
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index 6c7fd1d..570d14b 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -19092,6 +19092,29 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high", + "os": "Windows-10-15063" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py"
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index 64e32195..7cd92fbc 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -1110,6 +1110,28 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3287,6 +3309,31 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "isolate_profile_data": true, + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "integrity": "high", + "os": "Windows-10-18363" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "isolate_profile_data": true, "merge": { "args": [], @@ -5478,6 +5525,30 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "integrity": "high", + "os": "Windows-10-19042" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -7094,6 +7165,28 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -8591,6 +8684,28 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "args": [ + "--test-launcher-timeout=90000", + "--ui-test-action-max-timeout=45000", + "--ui-test-action-timeout=40000" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "integrity": "high" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "updater_tests_system", + "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" + }, + { "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py"
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 5662d7dc..8be7360 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -5579,6 +5579,21 @@ '--ui-test-action-timeout=40000', ], }, + 'updater_tests_system': { + 'args': [ + # Timeouts based on empirical observations of test runtimes, 2021-07. + '--test-launcher-timeout=90000', + '--ui-test-action-max-timeout=45000', + '--ui-test-action-timeout=40000', + ], + 'swarming': { + 'dimension_sets': [ + { + 'integrity': 'high', + } + ], + }, + }, 'zucchini_unittests': {}, },
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index bd71bd2a..860cdf1 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -46,16 +46,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4611.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4612.0/test_ash_chrome', '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter', ], - 'identifier': 'Lacros version skew testing ash 95.0.4611.0', + 'identifier': 'Lacros version skew testing ash 95.0.4612.0', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v95.0.4611.0', - 'revision': 'version:95.0.4611.0', + 'location': 'lacros_version_skew_tests_v95.0.4612.0', + 'revision': 'version:95.0.4612.0', }, ], }, @@ -658,4 +658,4 @@ ], }, }, -} +} \ No newline at end of file
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 782e5e2..dd3b5a9 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1659,7 +1659,8 @@ "CanvasOutOfProcessRasterization": [ { "platforms": [ - "mac" + "mac", + "android" ], "experiments": [ {
diff --git a/third_party/abseil-cpp/BUILD.gn b/third_party/abseil-cpp/BUILD.gn index c0b47158..9b45e3f 100644 --- a/third_party/abseil-cpp/BUILD.gn +++ b/third_party/abseil-cpp/BUILD.gn
@@ -186,6 +186,7 @@ "absl/base:config_test", "absl/cleanup:cleanup_test", "absl/container:inlined_vector_test", + "absl/hash:low_level_hash_test", "absl/memory:memory_test", "absl/meta:type_traits_test", "absl/status:statusor_test",
diff --git a/third_party/abseil-cpp/CMake/AbseilDll.cmake b/third_party/abseil-cpp/CMake/AbseilDll.cmake index 8bdf5a5..ea45c8a2 100644 --- a/third_party/abseil-cpp/CMake/AbseilDll.cmake +++ b/third_party/abseil-cpp/CMake/AbseilDll.cmake
@@ -124,8 +124,8 @@ "hash/internal/hash.h" "hash/internal/hash.cc" "hash/internal/spy_hash_state.h" - "hash/internal/wyhash.h" - "hash/internal/wyhash.cc" + "hash/internal/low_level_hash.h" + "hash/internal/low_level_hash.cc" "memory/memory.h" "meta/type_traits.h" "numeric/bits.h"
diff --git a/third_party/abseil-cpp/README.chromium b/third_party/abseil-cpp/README.chromium index 74d1e95..829c002c 100644 --- a/third_party/abseil-cpp/README.chromium +++ b/third_party/abseil-cpp/README.chromium
@@ -4,7 +4,7 @@ License: Apache 2.0 License File: LICENSE Version: 0 -Revision: 8e088c5f3c290c5ac53dd5010fd501d80b483115 +Revision: c1aa431c071af43d7935bc0d44d560ea851a7696 Security Critical: yes Description:
diff --git a/third_party/abseil-cpp/WORKSPACE b/third_party/abseil-cpp/WORKSPACE index f4a5c47..af30787 100644 --- a/third_party/abseil-cpp/WORKSPACE +++ b/third_party/abseil-cpp/WORKSPACE
@@ -42,3 +42,11 @@ strip_prefix = "rules_cc-daf6ace7cfeacd6a83e9ff2ed659f416537b6c74", urls = ["https://github.com/bazelbuild/rules_cc/archive/daf6ace7cfeacd6a83e9ff2ed659f416537b6c74.zip"], ) + +# Bazel platform rules. +http_archive( + name = "platforms", + sha256 = "b601beaf841244de5c5a50d2b2eddd34839788000fa1be4260ce6603ca0d8eb7", + strip_prefix = "platforms-98939346da932eef0b54cf808622f5bb0928f00b", + urls = ["https://github.com/bazelbuild/platforms/archive/98939346da932eef0b54cf808622f5bb0928f00b.zip"], +)
diff --git a/third_party/abseil-cpp/absl/BUILD.bazel b/third_party/abseil-cpp/absl/BUILD.bazel index c9d4a2d..7239b5bf 100644 --- a/third_party/abseil-cpp/absl/BUILD.bazel +++ b/third_party/abseil-cpp/absl/BUILD.bazel
@@ -44,14 +44,14 @@ config_setting( name = "osx", constraint_values = [ - "@bazel_tools//platforms:osx", + "@platforms//os:osx", ], ) config_setting( name = "ios", constraint_values = [ - "@bazel_tools//platforms:ios", + "@platforms//os:ios", ], )
diff --git a/third_party/abseil-cpp/absl/container/BUILD.bazel b/third_party/abseil-cpp/absl/container/BUILD.bazel index f22fdc606..cf55f4b 100644 --- a/third_party/abseil-cpp/absl/container/BUILD.bazel +++ b/third_party/abseil-cpp/absl/container/BUILD.bazel
@@ -598,7 +598,6 @@ ":hashtable_debug_hooks", ":hashtablez_sampler", ":have_sse", - ":layout", "//absl/base:config", "//absl/base:core_headers", "//absl/base:endian",
diff --git a/third_party/abseil-cpp/absl/container/BUILD.gn b/third_party/abseil-cpp/absl/container/BUILD.gn index 3e4c68d..ba939ae 100644 --- a/third_party/abseil-cpp/absl/container/BUILD.gn +++ b/third_party/abseil-cpp/absl/container/BUILD.gn
@@ -218,7 +218,6 @@ ":hashtable_debug_hooks", ":hashtablez_sampler", ":have_sse", - ":layout", "//third_party/abseil-cpp/absl/base:config", "//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/base:endian",
diff --git a/third_party/abseil-cpp/absl/container/CMakeLists.txt b/third_party/abseil-cpp/absl/container/CMakeLists.txt index 91c4015..691a05c0a 100644 --- a/third_party/abseil-cpp/absl/container/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/container/CMakeLists.txt
@@ -666,7 +666,6 @@ absl::hash_policy_traits absl::hashtable_debug_hooks absl::have_sse - absl::layout absl::memory absl::meta absl::optional
diff --git a/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h b/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h index bafafd4..ade2f58 100644 --- a/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +++ b/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
@@ -112,7 +112,6 @@ #include "absl/container/internal/hashtable_debug_hooks.h" #include "absl/container/internal/hashtablez_sampler.h" #include "absl/container/internal/have_sse.h" -#include "absl/container/internal/layout.h" #include "absl/memory/memory.h" #include "absl/meta/type_traits.h" #include "absl/numeric/bits.h" @@ -625,6 +624,20 @@ SetCtrl(i, static_cast<ctrl_t>(h), capacity, ctrl, slot, slot_size); } +// The allocated block consists of `capacity + 1 + NumClonedBytes()` control +// bytes followed by `capacity` slots, which must be aligned to `slot_align`. +// SlotOffset returns the offset of the slots into the allocated block. +inline size_t SlotOffset(size_t capacity, size_t slot_align) { + assert(IsValidCapacity(capacity)); + const size_t num_control_bytes = capacity + 1 + NumClonedBytes(); + return (num_control_bytes + slot_align - 1) & (~slot_align + 1); +} + +// Returns the size of the allocated block. See also above comment. +inline size_t AllocSize(size_t capacity, size_t slot_size, size_t slot_align) { + return SlotOffset(capacity, slot_align) + capacity * slot_size; +} + // Policy: a policy defines how to perform different operations on // the slots of the hashtable (see hash_policy_traits.h for the full interface // of policy). @@ -681,15 +694,6 @@ auto KeyTypeCanBeHashed(const Hash& h, const key_type& k) -> decltype(h(k)); auto KeyTypeCanBeEq(const Eq& eq, const key_type& k) -> decltype(eq(k, k)); - using Layout = absl::container_internal::Layout<ctrl_t, slot_type>; - - static Layout MakeLayout(size_t capacity) { - assert(IsValidCapacity(capacity)); - // The extra control bytes are for 1 sentinel byte followed by - // NumClonedBytes() bytes that are cloned from the beginning. - return Layout(capacity + 1 + NumClonedBytes(), capacity); - } - using AllocTraits = absl::allocator_traits<allocator_type>; using SlotAlloc = typename absl::allocator_traits< allocator_type>::template rebind_alloc<slot_type>; @@ -1610,11 +1614,12 @@ infoz() = Sample(); } - auto layout = MakeLayout(capacity_); - char* mem = static_cast<char*>( - Allocate<Layout::Alignment()>(&alloc_ref(), layout.AllocSize())); - ctrl_ = layout.template Pointer<0>(mem); - slots_ = layout.template Pointer<1>(mem); + char* mem = static_cast<char*>(Allocate<alignof(slot_type)>( + &alloc_ref(), + AllocSize(capacity_, sizeof(slot_type), alignof(slot_type)))); + ctrl_ = reinterpret_cast<ctrl_t*>(mem); + slots_ = reinterpret_cast<slot_type*>( + mem + SlotOffset(capacity_, alignof(slot_type))); ResetCtrl(capacity_, ctrl_, slots_, sizeof(slot_type)); reset_growth_left(); infoz().RecordStorageChanged(size_, capacity_); @@ -1627,10 +1632,11 @@ PolicyTraits::destroy(&alloc_ref(), slots_ + i); } } - auto layout = MakeLayout(capacity_); // Unpoison before returning the memory to the allocator. SanitizerUnpoisonMemoryRegion(slots_, sizeof(slot_type) * capacity_); - Deallocate<Layout::Alignment()>(&alloc_ref(), ctrl_, layout.AllocSize()); + Deallocate<alignof(slot_type)>( + &alloc_ref(), ctrl_, + AllocSize(capacity_, sizeof(slot_type), alignof(slot_type))); ctrl_ = EmptyGroup(); slots_ = nullptr; size_ = 0; @@ -1661,9 +1667,9 @@ if (old_capacity) { SanitizerUnpoisonMemoryRegion(old_slots, sizeof(slot_type) * old_capacity); - auto layout = MakeLayout(old_capacity); - Deallocate<Layout::Alignment()>(&alloc_ref(), old_ctrl, - layout.AllocSize()); + Deallocate<alignof(slot_type)>( + &alloc_ref(), old_ctrl, + AllocSize(old_capacity, sizeof(slot_type), alignof(slot_type))); } infoz().RecordRehash(total_probe_length); } @@ -1948,8 +1954,7 @@ static size_t AllocatedByteSize(const Set& c) { size_t capacity = c.capacity_; if (capacity == 0) return 0; - auto layout = Set::MakeLayout(capacity); - size_t m = layout.AllocSize(); + size_t m = AllocSize(capacity, sizeof(Slot), alignof(Slot)); size_t per_slot = Traits::space_used(static_cast<const Slot*>(nullptr)); if (per_slot != ~size_t{}) { @@ -1967,8 +1972,8 @@ static size_t LowerBoundAllocatedByteSize(size_t size) { size_t capacity = GrowthToLowerboundCapacity(size); if (capacity == 0) return 0; - auto layout = Set::MakeLayout(NormalizeCapacity(capacity)); - size_t m = layout.AllocSize(); + size_t m = + AllocSize(NormalizeCapacity(capacity), sizeof(Slot), alignof(Slot)); size_t per_slot = Traits::space_used(static_cast<const Slot*>(nullptr)); if (per_slot != ~size_t{}) { m += per_slot * size;
diff --git a/third_party/abseil-cpp/absl/debugging/internal/demangle.cc b/third_party/abseil-cpp/absl/debugging/internal/demangle.cc index 5cd56320..93ae3279 100644 --- a/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +++ b/third_party/abseil-cpp/absl/debugging/internal/demangle.cc
@@ -1617,6 +1617,7 @@ // ::= <2-ary operator-name> <expression> <expression> // ::= <3-ary operator-name> <expression> <expression> <expression> // ::= cl <expression>+ E +// ::= cp <simple-id> <expression>* E # Clang-specific. // ::= cv <type> <expression> # type (expression) // ::= cv <type> _ <expression>* E # type (expr-list) // ::= st <type> @@ -1639,14 +1640,23 @@ return true; } - // Object/function call expression. ParseState copy = state->parse_state; + + // Object/function call expression. if (ParseTwoCharToken(state, "cl") && OneOrMore(ParseExpression, state) && ParseOneCharToken(state, 'E')) { return true; } state->parse_state = copy; + // Clang-specific "cp <simple-id> <expression>* E" + // https://clang.llvm.org/doxygen/ItaniumMangle_8cpp_source.html#l04338 + if (ParseTwoCharToken(state, "cp") && ParseSimpleId(state) && + ZeroOrMore(ParseExpression, state) && ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + // Function-param expression (level 0). if (ParseTwoCharToken(state, "fp") && Optional(ParseCVQualifiers(state)) && Optional(ParseNumber(state, nullptr)) && ParseOneCharToken(state, '_')) {
diff --git a/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.cc b/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.cc index e3dd51c..51348649 100644 --- a/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.cc +++ b/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.cc
@@ -43,7 +43,7 @@ // unspecified. Therefore, instead we hardcode the direction of the // stack on platforms we know about. #if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || \ - defined(__aarch64__) + defined(__aarch64__) || defined(__riscv) constexpr bool kStackGrowsDown = true; #else #error Need to define kStackGrowsDown
diff --git a/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h b/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h index 2b5e715..f41b64c39d 100644 --- a/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h +++ b/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h
@@ -26,7 +26,7 @@ #error ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION cannot be set directly #elif !defined(__APPLE__) && !defined(_WIN32) && \ (defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || \ - defined(__aarch64__)) + defined(__aarch64__) || defined(__riscv)) #define ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION 1 namespace absl {
diff --git a/third_party/abseil-cpp/absl/debugging/internal/symbolize.h b/third_party/abseil-cpp/absl/debugging/internal/symbolize.h index 8c296f8..27d5e65 100644 --- a/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +++ b/third_party/abseil-cpp/absl/debugging/internal/symbolize.h
@@ -28,8 +28,8 @@ #ifdef ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE #error ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE cannot be directly set -#elif defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) && \ - !defined(__asmjs__) && !defined(__wasm__) +#elif defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) \ + && !defined(__asmjs__) && !defined(__wasm__) #define ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE 1 #include <elf.h>
diff --git a/third_party/abseil-cpp/absl/flags/internal/usage.cc b/third_party/abseil-cpp/absl/flags/internal/usage.cc index a883567..949709e 100644 --- a/third_party/abseil-cpp/absl/flags/internal/usage.cc +++ b/third_party/abseil-cpp/absl/flags/internal/usage.cc
@@ -17,7 +17,6 @@ #include <stdint.h> -#include <algorithm> #include <functional> #include <map> #include <ostream> @@ -256,6 +255,9 @@ matching_flags; flags_internal::ForEachFlag([&](absl::CommandLineFlag& flag) { + // Ignore retired flags. + if (flag.IsRetired()) return; + // If the flag has been stripped, pretend that it doesn't exist. if (flag.Help() == flags_internal::kStrippedFlagHelp) return; @@ -273,14 +275,6 @@ absl::string_view file_separator; // controls blank lines between files for (auto& package : matching_flags) { if (format == HelpFormat::kHumanReadable) { - // Hide packages with only retired flags - bool all_package_flags_are_retired = true; - for (const auto& flags_in_file : package.second) { - for (const auto* flag : flags_in_file.second) { - all_package_flags_are_retired &= flag->IsRetired(); - } - } - if (all_package_flags_are_retired) continue; out << package_separator; package_separator = "\n\n"; } @@ -340,11 +334,8 @@ // Produces the help message describing specific flag. void FlagHelp(std::ostream& out, const CommandLineFlag& flag, HelpFormat format) { - if (format == HelpFormat::kHumanReadable) { - // Ignore retired flags - if (flag.IsRetired()) return; + if (format == HelpFormat::kHumanReadable) flags_internal::FlagHelpHumanReadable(flag, out); - } } // --------------------------------------------------------------------
diff --git a/third_party/abseil-cpp/absl/flags/internal/usage_test.cc b/third_party/abseil-cpp/absl/flags/internal/usage_test.cc index 5055640a..044d71c8 100644 --- a/third_party/abseil-cpp/absl/flags/internal/usage_test.cc +++ b/third_party/abseil-cpp/absl/flags/internal/usage_test.cc
@@ -61,9 +61,6 @@ "Even more long long long long long long long long long long long long " "help message."); -ABSL_RETIRED_FLAG(int64_t, usage_reporting_test_flag_07, 1, - "usage_reporting_test_flag_07 help message"); - namespace { namespace flags = absl::flags_internal;
diff --git a/third_party/abseil-cpp/absl/hash/BUILD.bazel b/third_party/abseil-cpp/absl/hash/BUILD.bazel index 4b2c220f..21915cc 100644 --- a/third_party/abseil-cpp/absl/hash/BUILD.bazel +++ b/third_party/abseil-cpp/absl/hash/BUILD.bazel
@@ -37,7 +37,7 @@ linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":city", - ":wyhash", + ":low_level_hash", "//absl/base:config", "//absl/base:core_headers", "//absl/base:endian", @@ -143,9 +143,9 @@ ) cc_library( - name = "wyhash", - srcs = ["internal/wyhash.cc"], - hdrs = ["internal/wyhash.h"], + name = "low_level_hash", + srcs = ["internal/low_level_hash.cc"], + hdrs = ["internal/low_level_hash.h"], copts = ABSL_DEFAULT_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, visibility = ["//visibility:private"], @@ -157,13 +157,13 @@ ) cc_test( - name = "wyhash_test", - srcs = ["internal/wyhash_test.cc"], + name = "low_level_hash_test", + srcs = ["internal/low_level_hash_test.cc"], copts = ABSL_TEST_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, visibility = ["//visibility:private"], deps = [ - ":wyhash", + ":low_level_hash", "//absl/strings", "@com_google_googletest//:gtest_main", ],
diff --git a/third_party/abseil-cpp/absl/hash/BUILD.gn b/third_party/abseil-cpp/absl/hash/BUILD.gn index 3e239b4c..0962de61 100644 --- a/third_party/abseil-cpp/absl/hash/BUILD.gn +++ b/third_party/abseil-cpp/absl/hash/BUILD.gn
@@ -13,7 +13,7 @@ public = [ "hash.h" ] deps = [ ":city", - ":wyhash", + ":low_level_hash", "//third_party/abseil-cpp/absl/base:config", "//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/base:endian", @@ -60,9 +60,9 @@ ] } -absl_source_set("wyhash") { - public = [ "internal/wyhash.h" ] - sources = [ "internal/wyhash.cc" ] +absl_source_set("low_level_hash") { + public = [ "internal/low_level_hash.h" ] + sources = [ "internal/low_level_hash.cc" ] deps = [ "//third_party/abseil-cpp/absl/base:config", "//third_party/abseil-cpp/absl/base:endian", @@ -70,3 +70,14 @@ ] visibility = [ ":*" ] } + +absl_source_set("low_level_hash_test") { + testonly = true + sources = [ "internal/low_level_hash_test.cc" ] + deps = [ + ":low_level_hash", + "//third_party/abseil-cpp/absl/strings", + "//third_party/googletest:gtest", + "//third_party/googletest:gmock", + ] +}
diff --git a/third_party/abseil-cpp/absl/hash/CMakeLists.txt b/third_party/abseil-cpp/absl/hash/CMakeLists.txt index c82f66f..6c79c93 100644 --- a/third_party/abseil-cpp/absl/hash/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/hash/CMakeLists.txt
@@ -36,7 +36,7 @@ absl::optional absl::variant absl::utility - absl::wyhash + absl::low_level_hash PUBLIC ) @@ -118,11 +118,11 @@ absl_cc_library( NAME - wyhash + low_level_hash HDRS - "internal/wyhash.h" + "internal/low_level_hash.h" SRCS - "internal/wyhash.cc" + "internal/low_level_hash.cc" COPTS ${ABSL_DEFAULT_COPTS} DEPS @@ -133,13 +133,13 @@ absl_cc_test( NAME - wyhash_test + low_level_hash_test SRCS - "internal/wyhash_test.cc" + "internal/low_level_hash_test.cc" COPTS ${ABSL_TEST_COPTS} DEPS - absl::wyhash + absl::low_level_hash absl::strings GTest::gmock_main )
diff --git a/third_party/abseil-cpp/absl/hash/internal/hash.cc b/third_party/abseil-cpp/absl/hash/internal/hash.cc index 06f53a5..4b81891 100644 --- a/third_party/abseil-cpp/absl/hash/internal/hash.cc +++ b/third_party/abseil-cpp/absl/hash/internal/hash.cc
@@ -46,21 +46,22 @@ ABSL_CONST_INIT const void* const MixingHashState::kSeed = &kSeed; -// The salt array used by Wyhash. This array is NOT the mechanism used to make -// absl::Hash non-deterministic between program invocations. See `Seed()` for -// that mechanism. +// The salt array used by LowLevelHash. This array is NOT the mechanism used to +// make absl::Hash non-deterministic between program invocations. See `Seed()` +// for that mechanism. // // Any random values are fine. These values are just digits from the decimal // part of pi. // https://en.wikipedia.org/wiki/Nothing-up-my-sleeve_number -constexpr uint64_t kWyhashSalt[5] = { +constexpr uint64_t kHashSalt[5] = { uint64_t{0x243F6A8885A308D3}, uint64_t{0x13198A2E03707344}, uint64_t{0xA4093822299F31D0}, uint64_t{0x082EFA98EC4E6C89}, uint64_t{0x452821E638D01377}, }; -uint64_t MixingHashState::WyhashImpl(const unsigned char* data, size_t len) { - return Wyhash(data, len, Seed(), kWyhashSalt); +uint64_t MixingHashState::LowLevelHashImpl(const unsigned char* data, + size_t len) { + return LowLevelHash(data, len, Seed(), kHashSalt); } } // namespace hash_internal
diff --git a/third_party/abseil-cpp/absl/hash/internal/hash.h b/third_party/abseil-cpp/absl/hash/internal/hash.h index 90627e0..f517409 100644 --- a/third_party/abseil-cpp/absl/hash/internal/hash.h +++ b/third_party/abseil-cpp/absl/hash/internal/hash.h
@@ -42,7 +42,7 @@ #include "absl/base/internal/unaligned_access.h" #include "absl/base/port.h" #include "absl/container/fixed_array.h" -#include "absl/hash/internal/wyhash.h" +#include "absl/hash/internal/low_level_hash.h" #include "absl/meta/type_traits.h" #include "absl/numeric/int128.h" #include "absl/strings/string_view.h" @@ -874,14 +874,14 @@ return static_cast<uint64_t>(m ^ (m >> (sizeof(m) * 8 / 2))); } - // An extern to avoid bloat on a direct call to Wyhash() with fixed values for - // both the seed and salt parameters. - static uint64_t WyhashImpl(const unsigned char* data, size_t len); + // An extern to avoid bloat on a direct call to LowLevelHash() with fixed + // values for both the seed and salt parameters. + static uint64_t LowLevelHashImpl(const unsigned char* data, size_t len); ABSL_ATTRIBUTE_ALWAYS_INLINE static uint64_t Hash64(const unsigned char* data, size_t len) { #ifdef ABSL_HAVE_INTRINSIC_INT128 - return WyhashImpl(data, len); + return LowLevelHashImpl(data, len); #else return absl::hash_internal::CityHash64(reinterpret_cast<const char*>(data), len); #endif @@ -945,8 +945,8 @@ inline uint64_t MixingHashState::CombineContiguousImpl( uint64_t state, const unsigned char* first, size_t len, std::integral_constant<int, 8> /* sizeof_size_t */) { - // For large values we use Wyhash or CityHash depending on the platform, for - // small ones we just use a multiplicative hash. + // For large values we use LowLevelHash or CityHash depending on the platform, + // for small ones we just use a multiplicative hash. uint64_t v; if (len > 16) { if (ABSL_PREDICT_FALSE(len > PiecewiseChunkSize())) {
diff --git a/third_party/abseil-cpp/absl/hash/internal/wyhash.cc b/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc similarity index 84% rename from third_party/abseil-cpp/absl/hash/internal/wyhash.cc rename to third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc index 642bde43..856bbd9b 100644 --- a/third_party/abseil-cpp/absl/hash/internal/wyhash.cc +++ b/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc
@@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "absl/hash/internal/wyhash.h" +#include "absl/hash/internal/low_level_hash.h" #include "absl/base/internal/unaligned_access.h" #include "absl/numeric/int128.h" @@ -21,14 +21,14 @@ ABSL_NAMESPACE_BEGIN namespace hash_internal { -static uint64_t WyhashMix(uint64_t v0, uint64_t v1) { +static uint64_t Mix(uint64_t v0, uint64_t v1) { absl::uint128 p = v0; p *= v1; return absl::Uint128Low64(p) ^ absl::Uint128High64(p); } -uint64_t Wyhash(const void* data, size_t len, uint64_t seed, - const uint64_t salt[]) { +uint64_t LowLevelHash(const void* data, size_t len, uint64_t seed, + const uint64_t salt[]) { const uint8_t* ptr = static_cast<const uint8_t*>(data); uint64_t starting_length = static_cast<uint64_t>(len); uint64_t current_state = seed ^ salt[0]; @@ -49,12 +49,12 @@ uint64_t g = absl::base_internal::UnalignedLoad64(ptr + 48); uint64_t h = absl::base_internal::UnalignedLoad64(ptr + 56); - uint64_t cs0 = WyhashMix(a ^ salt[1], b ^ current_state); - uint64_t cs1 = WyhashMix(c ^ salt[2], d ^ current_state); + uint64_t cs0 = Mix(a ^ salt[1], b ^ current_state); + uint64_t cs1 = Mix(c ^ salt[2], d ^ current_state); current_state = (cs0 ^ cs1); - uint64_t ds0 = WyhashMix(e ^ salt[3], f ^ duplicated_state); - uint64_t ds1 = WyhashMix(g ^ salt[4], h ^ duplicated_state); + uint64_t ds0 = Mix(e ^ salt[3], f ^ duplicated_state); + uint64_t ds1 = Mix(g ^ salt[4], h ^ duplicated_state); duplicated_state = (ds0 ^ ds1); ptr += 64; @@ -70,7 +70,7 @@ uint64_t a = absl::base_internal::UnalignedLoad64(ptr); uint64_t b = absl::base_internal::UnalignedLoad64(ptr + 8); - current_state = WyhashMix(a ^ salt[1], b ^ current_state); + current_state = Mix(a ^ salt[1], b ^ current_state); ptr += 16; len -= 16; @@ -101,9 +101,9 @@ b = 0; } - uint64_t w = WyhashMix(a ^ salt[1], b ^ current_state); + uint64_t w = Mix(a ^ salt[1], b ^ current_state); uint64_t z = salt[1] ^ starting_length; - return WyhashMix(w, z); + return Mix(w, z); } } // namespace hash_internal
diff --git a/third_party/abseil-cpp/absl/hash/internal/wyhash.h b/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h similarity index 61% rename from third_party/abseil-cpp/absl/hash/internal/wyhash.h rename to third_party/abseil-cpp/absl/hash/internal/low_level_hash.h index 2b534b47..439968aa 100644 --- a/third_party/abseil-cpp/absl/hash/internal/wyhash.h +++ b/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h
@@ -12,16 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// This file provides the Google-internal implementation of the Wyhash -// algorithm. +// This file provides the Google-internal implementation of LowLevelHash. // -// Wyhash is a fast hash function for hash tables, the fastest we've currently -// (late 2020) found that passes the SMHasher tests. The algorithm relies on -// intrinsic 128-bit multiplication for speed. This is not meant to be secure - -// just fast. +// LowLevelHash is a fast hash function for hash tables, the fastest we've +// currently (late 2020) found that passes the SMHasher tests. The algorithm +// relies on intrinsic 128-bit multiplication for speed. This is not meant to be +// secure - just fast. +// +// It is closely based on a version of wyhash, but does not maintain or +// guarantee future compatibility with it. -#ifndef ABSL_HASH_INTERNAL_WYHASH_H_ -#define ABSL_HASH_INTERNAL_WYHASH_H_ +#ifndef ABSL_HASH_INTERNAL_LOW_LEVEL_HASH_H_ +#define ABSL_HASH_INTERNAL_LOW_LEVEL_HASH_H_ #include <stdint.h> #include <stdlib.h> @@ -38,11 +40,11 @@ // To allow all hashable types (including string_view and Span) to depend on // this algorithm, we keep the API low-level, with as few dependencies as // possible. -uint64_t Wyhash(const void* data, size_t len, uint64_t seed, - const uint64_t salt[5]); +uint64_t LowLevelHash(const void* data, size_t len, uint64_t seed, + const uint64_t salt[5]); } // namespace hash_internal ABSL_NAMESPACE_END } // namespace absl -#endif // ABSL_HASH_INTERNAL_WYHASH_H_ +#endif // ABSL_HASH_INTERNAL_LOW_LEVEL_HASH_H_
diff --git a/third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc b/third_party/abseil-cpp/absl/hash/internal/low_level_hash_test.cc similarity index 93% rename from third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc rename to third_party/abseil-cpp/absl/hash/internal/low_level_hash_test.cc index 9fb06d2..0ef5023 100644 --- a/third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc +++ b/third_party/abseil-cpp/absl/hash/internal/low_level_hash_test.cc
@@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "absl/hash/internal/wyhash.h" +#include "absl/hash/internal/low_level_hash.h" #include "absl/strings/escaping.h" #include "gmock/gmock.h" @@ -28,47 +28,47 @@ // Note: We don't account for endianness, so the values here are only correct if // you're also running on a little endian platform. -TEST(WyhashTest, EmptyString) { +TEST(LowLevelHashTest, EmptyString) { const std::string s = ""; - EXPECT_EQ( - absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt), - 4808886099364463827); + EXPECT_EQ(absl::hash_internal::LowLevelHash(s.c_str(), s.length(), + kCurrentSeed, kSalt), + 4808886099364463827); } -TEST(WyhashTest, Spaces) { +TEST(LowLevelHashTest, Spaces) { const std::string s = " "; - EXPECT_EQ( - absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt), - 1686201463024549249); + EXPECT_EQ(absl::hash_internal::LowLevelHash(s.c_str(), s.length(), + kCurrentSeed, kSalt), + 1686201463024549249); } -TEST(WyhashTest, RepeatingString) { +TEST(LowLevelHashTest, RepeatingString) { const std::string s = "aaaa"; - EXPECT_EQ( - absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt), - 6646112255271966632); + EXPECT_EQ(absl::hash_internal::LowLevelHash(s.c_str(), s.length(), + kCurrentSeed, kSalt), + 6646112255271966632); } -TEST(WyhashTest, HexString) { +TEST(LowLevelHashTest, HexString) { const std::string small = "\x01\x02\x03"; const std::string med = "\x01\x02\x03\x04"; - EXPECT_EQ(absl::hash_internal::Wyhash(small.c_str(), small.length(), - kCurrentSeed, kSalt), + EXPECT_EQ(absl::hash_internal::LowLevelHash(small.c_str(), small.length(), + kCurrentSeed, kSalt), 11989428023081740911ULL); - EXPECT_EQ(absl::hash_internal::Wyhash(med.c_str(), med.length(), kCurrentSeed, - kSalt), + EXPECT_EQ(absl::hash_internal::LowLevelHash(med.c_str(), med.length(), + kCurrentSeed, kSalt), 9765997711188871556ULL); } -TEST(WyhashTest, Words) { +TEST(LowLevelHashTest, Words) { const std::string s = "third_party|wyhash|64"; - EXPECT_EQ( - absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt), - 3702018632387611330); + EXPECT_EQ(absl::hash_internal::LowLevelHash(s.c_str(), s.length(), + kCurrentSeed, kSalt), + 3702018632387611330); } -TEST(WyhashTest, LongString) { +TEST(LowLevelHashTest, LongString) { const std::string s = "AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOpQrStUvWxYz" "0123456789AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOp" @@ -76,12 +76,12 @@ "GhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOpQrStUvWxYz012345" "6789AbCdEfGhIjKlMnOpQrStUvWxYz0123456789"; - EXPECT_EQ( - absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt), - 9245411362605796064ULL); + EXPECT_EQ(absl::hash_internal::LowLevelHash(s.c_str(), s.length(), + kCurrentSeed, kSalt), + 9245411362605796064ULL); } -TEST(WyhashTest, BigReference) { +TEST(LowLevelHashTest, BigReference) { struct ExpectedResult { absl::string_view base64_data; uint64_t seed; @@ -477,8 +477,8 @@ for (const auto& expected_result : expected_results) { std::string str; ASSERT_TRUE(absl::Base64Unescape(expected_result.base64_data, &str)); - EXPECT_EQ(absl::hash_internal::Wyhash(str.data(), str.size(), - expected_result.seed, kSalt), + EXPECT_EQ(absl::hash_internal::LowLevelHash(str.data(), str.size(), + expected_result.seed, kSalt), expected_result.hash); } }
diff --git a/third_party/abseil-cpp/absl/strings/substitute.h b/third_party/abseil-cpp/absl/strings/substitute.h index c6da4dc..151c56f 100644 --- a/third_party/abseil-cpp/absl/strings/substitute.h +++ b/third_party/abseil-cpp/absl/strings/substitute.h
@@ -361,43 +361,49 @@ // This body of functions catches cases where the number of placeholders // doesn't match the number of data arguments. void SubstituteAndAppend(std::string* output, const char* format) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 0, - "There were no substitution arguments " - "but this format string has a $[0-9] in it"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 0, + "There were no substitution arguments " + "but this format string either has a $[0-9] in it or contains " + "an unescaped $ character (use $$ instead)"); void SubstituteAndAppend(std::string* output, const char* format, const substitute_internal::Arg& a0) ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1, "There was 1 substitution argument given, but " - "this format string is either missing its $0, or " - "contains one of $1-$9"); + "this format string is missing its $0, contains " + "one of $1-$9, or contains an unescaped $ character (use " + "$$ instead)"); void SubstituteAndAppend(std::string* output, const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 3, - "There were 2 substitution arguments given, but " - "this format string is either missing its $0/$1, or " - "contains one of $2-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 3, + "There were 2 substitution arguments given, but this format string is " + "missing its $0/$1, contains one of $2-$9, or contains an " + "unescaped $ character (use $$ instead)"); void SubstituteAndAppend(std::string* output, const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1, const substitute_internal::Arg& a2) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 7, - "There were 3 substitution arguments given, but " - "this format string is either missing its $0/$1/$2, or " - "contains one of $3-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 7, + "There were 3 substitution arguments given, but " + "this format string is missing its $0/$1/$2, contains one of " + "$3-$9, or contains an unescaped $ character (use $$ instead)"); void SubstituteAndAppend(std::string* output, const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1, const substitute_internal::Arg& a2, const substitute_internal::Arg& a3) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 15, - "There were 4 substitution arguments given, but " - "this format string is either missing its $0-$3, or " - "contains one of $4-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 15, + "There were 4 substitution arguments given, but " + "this format string is missing its $0-$3, contains one of " + "$4-$9, or contains an unescaped $ character (use $$ instead)"); void SubstituteAndAppend(std::string* output, const char* format, const substitute_internal::Arg& a0, @@ -405,10 +411,11 @@ const substitute_internal::Arg& a2, const substitute_internal::Arg& a3, const substitute_internal::Arg& a4) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 31, - "There were 5 substitution arguments given, but " - "this format string is either missing its $0-$4, or " - "contains one of $5-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 31, + "There were 5 substitution arguments given, but " + "this format string is missing its $0-$4, contains one of " + "$5-$9, or contains an unescaped $ character (use $$ instead)"); void SubstituteAndAppend(std::string* output, const char* format, const substitute_internal::Arg& a0, @@ -417,20 +424,22 @@ const substitute_internal::Arg& a3, const substitute_internal::Arg& a4, const substitute_internal::Arg& a5) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 63, - "There were 6 substitution arguments given, but " - "this format string is either missing its $0-$5, or " - "contains one of $6-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 63, + "There were 6 substitution arguments given, but " + "this format string is missing its $0-$5, contains one of " + "$6-$9, or contains an unescaped $ character (use $$ instead)"); void SubstituteAndAppend( std::string* output, const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1, const substitute_internal::Arg& a2, const substitute_internal::Arg& a3, const substitute_internal::Arg& a4, const substitute_internal::Arg& a5, const substitute_internal::Arg& a6) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 127, - "There were 7 substitution arguments given, but " - "this format string is either missing its $0-$6, or " - "contains one of $7-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 127, + "There were 7 substitution arguments given, but " + "this format string is missing its $0-$6, contains one of " + "$7-$9, or contains an unescaped $ character (use $$ instead)"); void SubstituteAndAppend( std::string* output, const char* format, const substitute_internal::Arg& a0, @@ -438,10 +447,11 @@ const substitute_internal::Arg& a3, const substitute_internal::Arg& a4, const substitute_internal::Arg& a5, const substitute_internal::Arg& a6, const substitute_internal::Arg& a7) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 255, - "There were 8 substitution arguments given, but " - "this format string is either missing its $0-$7, or " - "contains one of $8-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 255, + "There were 8 substitution arguments given, but " + "this format string is missing its $0-$7, contains one of " + "$8-$9, or contains an unescaped $ character (use $$ instead)"); void SubstituteAndAppend( std::string* output, const char* format, const substitute_internal::Arg& a0, @@ -452,7 +462,8 @@ ABSL_BAD_CALL_IF( substitute_internal::PlaceholderBitmask(format) != 511, "There were 9 substitution arguments given, but " - "this format string is either missing its $0-$8, or contains a $9"); + "this format string is missing its $0-$8, contains a $9, or " + "contains an unescaped $ character (use $$ instead)"); void SubstituteAndAppend( std::string* output, const char* format, const substitute_internal::Arg& a0, @@ -461,9 +472,11 @@ const substitute_internal::Arg& a5, const substitute_internal::Arg& a6, const substitute_internal::Arg& a7, const substitute_internal::Arg& a8, const substitute_internal::Arg& a9) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1023, - "There were 10 substitution arguments given, but this " - "format string doesn't contain all of $0 through $9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 1023, + "There were 10 substitution arguments given, but this " + "format string either doesn't contain all of $0 through $9 or " + "contains an unescaped $ character (use $$ instead)"); #endif // ABSL_BAD_CALL_IF // Substitute() @@ -589,47 +602,53 @@ std::string Substitute(const char* format) ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 0, "There were no substitution arguments " - "but this format string has a $[0-9] in it"); + "but this format string either has a $[0-9] in it or " + "contains an unescaped $ character (use $$ instead)"); std::string Substitute(const char* format, const substitute_internal::Arg& a0) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1, - "There was 1 substitution argument given, but " - "this format string is either missing its $0, or " - "contains one of $1-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 1, + "There was 1 substitution argument given, but " + "this format string is missing its $0, contains one of $1-$9, " + "or contains an unescaped $ character (use $$ instead)"); std::string Substitute(const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 3, - "There were 2 substitution arguments given, but " - "this format string is either missing its $0/$1, or " - "contains one of $2-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 3, + "There were 2 substitution arguments given, but " + "this format string is missing its $0/$1, contains one of " + "$2-$9, or contains an unescaped $ character (use $$ instead)"); std::string Substitute(const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1, const substitute_internal::Arg& a2) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 7, - "There were 3 substitution arguments given, but " - "this format string is either missing its $0/$1/$2, or " - "contains one of $3-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 7, + "There were 3 substitution arguments given, but " + "this format string is missing its $0/$1/$2, contains one of " + "$3-$9, or contains an unescaped $ character (use $$ instead)"); std::string Substitute(const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1, const substitute_internal::Arg& a2, const substitute_internal::Arg& a3) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 15, - "There were 4 substitution arguments given, but " - "this format string is either missing its $0-$3, or " - "contains one of $4-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 15, + "There were 4 substitution arguments given, but " + "this format string is missing its $0-$3, contains one of " + "$4-$9, or contains an unescaped $ character (use $$ instead)"); std::string Substitute(const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1, const substitute_internal::Arg& a2, const substitute_internal::Arg& a3, const substitute_internal::Arg& a4) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 31, - "There were 5 substitution arguments given, but " - "this format string is either missing its $0-$4, or " - "contains one of $5-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 31, + "There were 5 substitution arguments given, but " + "this format string is missing its $0-$4, contains one of " + "$5-$9, or contains an unescaped $ character (use $$ instead)"); std::string Substitute(const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1, @@ -637,10 +656,11 @@ const substitute_internal::Arg& a3, const substitute_internal::Arg& a4, const substitute_internal::Arg& a5) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 63, - "There were 6 substitution arguments given, but " - "this format string is either missing its $0-$5, or " - "contains one of $6-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 63, + "There were 6 substitution arguments given, but " + "this format string is missing its $0-$5, contains one of " + "$6-$9, or contains an unescaped $ character (use $$ instead)"); std::string Substitute(const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1, @@ -649,10 +669,11 @@ const substitute_internal::Arg& a4, const substitute_internal::Arg& a5, const substitute_internal::Arg& a6) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 127, - "There were 7 substitution arguments given, but " - "this format string is either missing its $0-$6, or " - "contains one of $7-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 127, + "There were 7 substitution arguments given, but " + "this format string is missing its $0-$6, contains one of " + "$7-$9, or contains an unescaped $ character (use $$ instead)"); std::string Substitute(const char* format, const substitute_internal::Arg& a0, const substitute_internal::Arg& a1, @@ -662,10 +683,11 @@ const substitute_internal::Arg& a5, const substitute_internal::Arg& a6, const substitute_internal::Arg& a7) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 255, - "There were 8 substitution arguments given, but " - "this format string is either missing its $0-$7, or " - "contains one of $8-$9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 255, + "There were 8 substitution arguments given, but " + "this format string is missing its $0-$7, contains one of " + "$8-$9, or contains an unescaped $ character (use $$ instead)"); std::string Substitute( const char* format, const substitute_internal::Arg& a0, @@ -676,7 +698,8 @@ ABSL_BAD_CALL_IF( substitute_internal::PlaceholderBitmask(format) != 511, "There were 9 substitution arguments given, but " - "this format string is either missing its $0-$8, or contains a $9"); + "this format string is missing its $0-$8, contains a $9, or " + "contains an unescaped $ character (use $$ instead)"); std::string Substitute( const char* format, const substitute_internal::Arg& a0, @@ -685,9 +708,11 @@ const substitute_internal::Arg& a5, const substitute_internal::Arg& a6, const substitute_internal::Arg& a7, const substitute_internal::Arg& a8, const substitute_internal::Arg& a9) - ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1023, - "There were 10 substitution arguments given, but this " - "format string doesn't contain all of $0 through $9"); + ABSL_BAD_CALL_IF( + substitute_internal::PlaceholderBitmask(format) != 1023, + "There were 10 substitution arguments given, but this " + "format string either doesn't contain all of $0 through $9 or " + "contains an unescaped $ character (use $$ instead)"); #endif // ABSL_BAD_CALL_IF ABSL_NAMESPACE_END
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel b/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel index 45a9529..f549af6 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel +++ b/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel
@@ -26,14 +26,14 @@ config_setting( name = "osx", constraint_values = [ - "@bazel_tools//platforms:osx", + "@platforms//os:osx", ], ) config_setting( name = "ios", constraint_values = [ - "@bazel_tools//platforms:ios", + "@platforms//os:ios", ], )
diff --git a/third_party/abseil-cpp/absl/types/bad_optional_access.h b/third_party/abseil-cpp/absl/types/bad_optional_access.h index a500286..049e72a 100644 --- a/third_party/abseil-cpp/absl/types/bad_optional_access.h +++ b/third_party/abseil-cpp/absl/types/bad_optional_access.h
@@ -67,7 +67,7 @@ namespace optional_internal { // throw delegator -[[noreturn]] void throw_bad_optional_access(); +[[noreturn]] ABSL_DLL void throw_bad_optional_access(); } // namespace optional_internal ABSL_NAMESPACE_END
diff --git a/third_party/abseil-cpp/absl/types/bad_variant_access.h b/third_party/abseil-cpp/absl/types/bad_variant_access.h index 095969f9..8ab215e 100644 --- a/third_party/abseil-cpp/absl/types/bad_variant_access.h +++ b/third_party/abseil-cpp/absl/types/bad_variant_access.h
@@ -70,8 +70,8 @@ namespace variant_internal { -[[noreturn]] void ThrowBadVariantAccess(); -[[noreturn]] void Rethrow(); +[[noreturn]] ABSL_DLL void ThrowBadVariantAccess(); +[[noreturn]] ABSL_DLL void Rethrow(); } // namespace variant_internal ABSL_NAMESPACE_END
diff --git a/third_party/abseil-cpp/absl/types/span.h b/third_party/abseil-cpp/absl/types/span.h index 41db342..6272bb7a 100644 --- a/third_party/abseil-cpp/absl/types/span.h +++ b/third_party/abseil-cpp/absl/types/span.h
@@ -40,7 +40,6 @@ // * `absl::Span` has compiler-provided move and copy constructors and // assignment. This is due to them being specified as `constexpr`, but that // implies const in C++11. -// * `absl::Span` has no `element_type` typedef // * A read-only `absl::Span<const T>` can be implicitly constructed from an // initializer list. // * `absl::Span` has no `bytes()`, `size_bytes()`, `as_bytes()`, or @@ -170,6 +169,7 @@ typename std::enable_if<!std::is_const<T>::value, U>::type; public: + using element_type = T; using value_type = absl::remove_cv_t<T>; using pointer = T*; using const_pointer = const T*;
diff --git a/third_party/abseil-cpp/absl/types/span_test.cc b/third_party/abseil-cpp/absl/types/span_test.cc index 2584339..13264aae 100644 --- a/third_party/abseil-cpp/absl/types/span_test.cc +++ b/third_party/abseil-cpp/absl/types/span_test.cc
@@ -661,6 +661,8 @@ CheckType<absl::Span<int>::const_reverse_iterator>(slice.crend()); testing::StaticAssertTypeEq<int, absl::Span<int>::value_type>(); testing::StaticAssertTypeEq<int, absl::Span<const int>::value_type>(); + testing::StaticAssertTypeEq<int, absl::Span<int>::element_type>(); + testing::StaticAssertTypeEq<const int, absl::Span<const int>::element_type>(); testing::StaticAssertTypeEq<int*, absl::Span<int>::pointer>(); testing::StaticAssertTypeEq<const int*, absl::Span<const int>::pointer>(); testing::StaticAssertTypeEq<int&, absl::Span<int>::reference>();
diff --git a/third_party/abseil-cpp/symbols_arm64_dbg.def b/third_party/abseil-cpp/symbols_arm64_dbg.def index 6755815b..16ef24d 100644 --- a/third_party/abseil-cpp/symbols_arm64_dbg.def +++ b/third_party/abseil-cpp/symbols_arm64_dbg.def
@@ -2144,6 +2144,8 @@ ?LogSeverityName@absl@@YAPEBDW4LogSeverity@1@@Z ?LossyAdd@CordzUpdateTracker@cord_internal@absl@@QEAAXAEBV123@@Z ?LossyAdd@CordzUpdateTracker@cord_internal@absl@@QEAAXW4MethodIdentifier@123@_J@Z + ?LowLevelHash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z + ?LowLevelHashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?MakeConcat@CordForest@absl@@AEAAPEAUCordRep@cord_internal@2@PEAU342@0@Z ?MakeDuration@time_internal@absl@@YA?AVDuration@2@_J0@Z ?MakeDuration@time_internal@absl@@YA?AVDuration@2@_JI@Z @@ -2600,8 +2602,6 @@ ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z ?Write@FormatRawSinkImpl@str_format_internal@absl@@QEAAXVstring_view@3@@Z - ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z - ?WyhashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?ZeroDuration@absl@@YA?AVDuration@1@XZ ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ ?__addr@?$__temp_value@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@QEAAPEAUTransition@cctz@time_internal@absl@@XZ
diff --git a/third_party/abseil-cpp/symbols_arm64_rel.def b/third_party/abseil-cpp/symbols_arm64_rel.def index e0b68df..b225999 100644 --- a/third_party/abseil-cpp/symbols_arm64_rel.def +++ b/third_party/abseil-cpp/symbols_arm64_rel.def
@@ -528,6 +528,8 @@ ?LockWhen@Mutex@absl@@QEAAXAEBVCondition@2@@Z ?LockWhenWithDeadline@Mutex@absl@@QEAA_NAEBVCondition@2@VTime@2@@Z ?LockWhenWithTimeout@Mutex@absl@@QEAA_NAEBVCondition@2@VDuration@2@@Z + ?LowLevelHash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z + ?LowLevelHashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?MakeConcat@CordForest@absl@@AEAAPEAUCordRep@cord_internal@2@PEAU342@0@Z ?MakeTime@TimeZoneInfo@cctz@time_internal@absl@@UEBA?AUcivil_lookup@time_zone@234@AEBV?$civil_time@Usecond_tag@detail@cctz@time_internal@absl@@@detail@234@@Z ?MakeTime@TimeZoneLibC@cctz@time_internal@absl@@UEBA?AUcivil_lookup@time_zone@234@AEBV?$civil_time@Usecond_tag@detail@cctz@time_internal@absl@@@detail@234@@Z @@ -810,8 +812,6 @@ ?WebSafeBase64Unescape@absl@@YA_NVstring_view@1@PEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z - ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z - ?WyhashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ ?__append@?$vector@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAX_K@Z ?__append@?$vector@UTransitionType@cctz@time_internal@absl@@V?$allocator@UTransitionType@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAX_K@Z
diff --git a/third_party/abseil-cpp/symbols_x64_dbg.def b/third_party/abseil-cpp/symbols_x64_dbg.def index fa8d8f0..1342821 100644 --- a/third_party/abseil-cpp/symbols_x64_dbg.def +++ b/third_party/abseil-cpp/symbols_x64_dbg.def
@@ -2145,6 +2145,8 @@ ?LogSeverityName@absl@@YAPEBDW4LogSeverity@1@@Z ?LossyAdd@CordzUpdateTracker@cord_internal@absl@@QEAAXAEBV123@@Z ?LossyAdd@CordzUpdateTracker@cord_internal@absl@@QEAAXW4MethodIdentifier@123@_J@Z + ?LowLevelHash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z + ?LowLevelHashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?MakeConcat@CordForest@absl@@AEAAPEAUCordRep@cord_internal@2@PEAU342@0@Z ?MakeDuration@time_internal@absl@@YA?AVDuration@2@_J0@Z ?MakeDuration@time_internal@absl@@YA?AVDuration@2@_JI@Z @@ -2598,8 +2600,6 @@ ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z ?Write@FormatRawSinkImpl@str_format_internal@absl@@QEAAXVstring_view@3@@Z - ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z - ?WyhashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?ZeroDuration@absl@@YA?AVDuration@1@XZ ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ ?__addr@?$__temp_value@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@QEAAPEAUTransition@cctz@time_internal@absl@@XZ
diff --git a/third_party/abseil-cpp/symbols_x64_rel.def b/third_party/abseil-cpp/symbols_x64_rel.def index 35bcb17f..52adc37 100644 --- a/third_party/abseil-cpp/symbols_x64_rel.def +++ b/third_party/abseil-cpp/symbols_x64_rel.def
@@ -532,6 +532,8 @@ ?LockWhen@Mutex@absl@@QEAAXAEBVCondition@2@@Z ?LockWhenWithDeadline@Mutex@absl@@QEAA_NAEBVCondition@2@VTime@2@@Z ?LockWhenWithTimeout@Mutex@absl@@QEAA_NAEBVCondition@2@VDuration@2@@Z + ?LowLevelHash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z + ?LowLevelHashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?MakeConcat@CordForest@absl@@AEAAPEAUCordRep@cord_internal@2@PEAU342@0@Z ?MakeNs@KernelTimeout@synchronization_internal@absl@@CA_JVTime@3@@Z ?MakeTime@TimeZoneInfo@cctz@time_internal@absl@@UEBA?AUcivil_lookup@time_zone@234@AEBV?$civil_time@Usecond_tag@detail@cctz@time_internal@absl@@@detail@234@@Z @@ -815,8 +817,6 @@ ?WebSafeBase64Unescape@absl@@YA_NVstring_view@1@PEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z - ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z - ?WyhashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ ?__append@?$vector@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAX_K@Z ?__append@?$vector@UTransitionType@cctz@time_internal@absl@@V?$allocator@UTransitionType@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAX_K@Z
diff --git a/third_party/abseil-cpp/symbols_x64_rel_asan.def b/third_party/abseil-cpp/symbols_x64_rel_asan.def index 44d4b15b..a0a34b2 100644 --- a/third_party/abseil-cpp/symbols_x64_rel_asan.def +++ b/third_party/abseil-cpp/symbols_x64_rel_asan.def
@@ -545,6 +545,8 @@ ?LockWhen@Mutex@absl@@QEAAXAEBVCondition@2@@Z ?LockWhenWithDeadline@Mutex@absl@@QEAA_NAEBVCondition@2@VTime@2@@Z ?LockWhenWithTimeout@Mutex@absl@@QEAA_NAEBVCondition@2@VDuration@2@@Z + ?LowLevelHash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z + ?LowLevelHashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?MakeConcat@CordForest@absl@@AEAAPEAUCordRep@cord_internal@2@PEAU342@0@Z ?MakeNs@KernelTimeout@synchronization_internal@absl@@CA_JVTime@3@@Z ?MakeTime@TimeZoneInfo@cctz@time_internal@absl@@UEBA?AUcivil_lookup@time_zone@234@AEBV?$civil_time@Usecond_tag@detail@cctz@time_internal@absl@@@detail@234@@Z @@ -828,8 +830,6 @@ ?WebSafeBase64Unescape@absl@@YA_NVstring_view@1@PEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z - ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z - ?WyhashImpl@MixingHashState@hash_internal@absl@@CA_KPEBE_K@Z ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ ?__annotate_delete@?$vector@PEAUCordRep@cord_internal@absl@@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@__1@std@@AEBAXXZ ?__annotate_delete@?$vector@PEAVCordzHandle@cord_internal@absl@@V?$allocator@PEAVCordzHandle@cord_internal@absl@@@__1@std@@@__1@std@@AEBAXXZ
diff --git a/third_party/abseil-cpp/symbols_x86_dbg.def b/third_party/abseil-cpp/symbols_x86_dbg.def index a01d397..f778175 100644 --- a/third_party/abseil-cpp/symbols_x86_dbg.def +++ b/third_party/abseil-cpp/symbols_x86_dbg.def
@@ -2139,6 +2139,8 @@ ?LogSeverityName@absl@@YAPBDW4LogSeverity@1@@Z ?LossyAdd@CordzUpdateTracker@cord_internal@absl@@QAEXABV123@@Z ?LossyAdd@CordzUpdateTracker@cord_internal@absl@@QAEXW4MethodIdentifier@123@_J@Z + ?LowLevelHash@hash_internal@absl@@YA_KPBXI_KQB_K@Z + ?LowLevelHashImpl@MixingHashState@hash_internal@absl@@CA_KPBEI@Z ?MakeConcat@CordForest@absl@@AAEPAUCordRep@cord_internal@2@PAU342@0@Z ?MakeDuration@time_internal@absl@@YA?AVDuration@2@_J0@Z ?MakeDuration@time_internal@absl@@YA?AVDuration@2@_JI@Z @@ -2592,8 +2594,6 @@ ?Write@BufferRawSink@str_format_internal@absl@@QAEXVstring_view@3@@Z ?Write@FILERawSink@str_format_internal@absl@@QAEXVstring_view@3@@Z ?Write@FormatRawSinkImpl@str_format_internal@absl@@QAEXVstring_view@3@@Z - ?Wyhash@hash_internal@absl@@YA_KPBXI_KQB_K@Z - ?WyhashImpl@MixingHashState@hash_internal@absl@@CA_KPBEI@Z ?ZeroDuration@absl@@YA?AVDuration@1@XZ ?__add_back_capacity@?$deque@PBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AAEXXZ ?__addr@?$__temp_value@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@QAEPAUTransition@cctz@time_internal@absl@@XZ
diff --git a/third_party/abseil-cpp/symbols_x86_rel.def b/third_party/abseil-cpp/symbols_x86_rel.def index 4cadd32..c3d765b 100644 --- a/third_party/abseil-cpp/symbols_x86_rel.def +++ b/third_party/abseil-cpp/symbols_x86_rel.def
@@ -530,6 +530,8 @@ ?LockWhen@Mutex@absl@@QAEXABVCondition@2@@Z ?LockWhenWithDeadline@Mutex@absl@@QAE_NABVCondition@2@VTime@2@@Z ?LockWhenWithTimeout@Mutex@absl@@QAE_NABVCondition@2@VDuration@2@@Z + ?LowLevelHash@hash_internal@absl@@YA_KPBXI_KQB_K@Z + ?LowLevelHashImpl@MixingHashState@hash_internal@absl@@CA_KPBEI@Z ?MakeConcat@CordForest@absl@@AAEPAUCordRep@cord_internal@2@PAU342@0@Z ?MakeTime@TimeZoneInfo@cctz@time_internal@absl@@UBE?AUcivil_lookup@time_zone@234@ABV?$civil_time@Usecond_tag@detail@cctz@time_internal@absl@@@detail@234@@Z ?MakeTime@TimeZoneLibC@cctz@time_internal@absl@@UBE?AUcivil_lookup@time_zone@234@ABV?$civil_time@Usecond_tag@detail@cctz@time_internal@absl@@@detail@234@@Z @@ -812,8 +814,6 @@ ?WebSafeBase64Unescape@absl@@YA_NVstring_view@1@PAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z ?Write@BufferRawSink@str_format_internal@absl@@QAEXVstring_view@3@@Z ?Write@FILERawSink@str_format_internal@absl@@QAEXVstring_view@3@@Z - ?Wyhash@hash_internal@absl@@YA_KPBXI_KQB_K@Z - ?WyhashImpl@MixingHashState@hash_internal@absl@@CA_KPBEI@Z ?__add_back_capacity@?$deque@PBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AAEXXZ ?__append@?$vector@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@AAEXI@Z ?__append@?$vector@UTransitionType@cctz@time_internal@absl@@V?$allocator@UTransitionType@cctz@time_internal@absl@@@__1@std@@@__1@std@@AAEXI@Z
diff --git a/third_party/blink/public/devtools_protocol/browser_protocol.pdl b/third_party/blink/public/devtools_protocol/browser_protocol.pdl index b8dca6d8..9d1edbe 100644 --- a/third_party/blink/public/devtools_protocol/browser_protocol.pdl +++ b/third_party/blink/public/devtools_protocol/browser_protocol.pdl
@@ -208,7 +208,9 @@ parameters # The maximum depth at which descendants of the root node should be retrieved. # If omitted, the full tree is returned. - optional integer max_depth + optional integer depth + # Deprecated. This parameter has been renamed to `depth`. If depth is not provided, max_depth will be used. + deprecated optional integer max_depth # The frame for whose document the AX tree should be retrieved. # If omited, the root frame is used. optional Page.FrameId frameId
diff --git a/third_party/blink/public/mojom/BUILD.gn b/third_party/blink/public/mojom/BUILD.gn index 930e6eea7..6fb5282 100644 --- a/third_party/blink/public/mojom/BUILD.gn +++ b/third_party/blink/public/mojom/BUILD.gn
@@ -61,6 +61,7 @@ "favicon/favicon_url.mojom", "feature_observer/feature_observer.mojom", "federated_learning/floc.mojom", + "fenced_frame/fenced_frame.mojom", "fetch/fetch_api_request.mojom", "fetch/fetch_api_response.mojom", "file/file_utilities.mojom",
diff --git a/third_party/blink/public/mojom/fenced_frame/OWNERS b/third_party/blink/public/mojom/fenced_frame/OWNERS new file mode 100644 index 0000000..08850f4 --- /dev/null +++ b/third_party/blink/public/mojom/fenced_frame/OWNERS
@@ -0,0 +1,2 @@ +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom b/third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom new file mode 100644 index 0000000..6f11a0a --- /dev/null +++ b/third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom
@@ -0,0 +1,15 @@ +// Copyright 2021 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. + +module blink.mojom; + +import "url/mojom/origin.mojom"; +import "url/mojom/url.mojom"; + +// The `FencedFrameOwnerHost` interface is used by the HTMLFencedFrameElement in +// the renderer process that hosts the "outer" frame tree. It is used to +// interact with the backing `content::FencedFrame` in the browser process which +// hosts an "inner" frame tree via Multiple Page Architecture. +interface FencedFrameOwnerHost { +};
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h index 99ddb8f..990847b 100644 --- a/third_party/blink/public/web/web_local_frame_client.h +++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -46,6 +46,7 @@ #include "third_party/blink/public/common/use_counter/use_counter_feature.h" #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" #include "third_party/blink/public/mojom/devtools/console_message.mojom-forward.h" +#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom-shared.h" #include "third_party/blink/public/mojom/frame/blocked_navigation_types.mojom-shared.h" #include "third_party/blink/public/mojom/frame/frame_owner_element_type.mojom-shared.h" #include "third_party/blink/public/mojom/frame/lifecycle.mojom-shared.h" @@ -266,7 +267,9 @@ // Request the creation of a new fenced frame, and return the WebRemoteFrame* // associated with it. virtual WebRemoteFrame* CreateFencedFrame( - const WebElement& fenced_frame_element) { + const WebElement& fenced_frame_element, + CrossVariantMojoAssociatedReceiver< + mojom::FencedFrameOwnerHostInterfaceBase> receiver) { return nullptr; }
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn index 2270695b..7b2aa290 100644 --- a/third_party/blink/renderer/core/BUILD.gn +++ b/third_party/blink/renderer/core/BUILD.gn
@@ -1415,6 +1415,7 @@ "layout/svg/layout_svg_foreign_object_test.cc", "layout/svg/layout_svg_root_test.cc", "layout/svg/layout_svg_text_test.cc", + "layout/svg/svg_layout_support_test.cc", "layout/text_autosizer_test.cc", "layout/visual_rect_mapping_test.cc", "loader/alternate_signed_exchange_resource_info_test.cc",
diff --git a/third_party/blink/renderer/core/css/cssom/css_style_value.cc b/third_party/blink/renderer/core/css/cssom/css_style_value.cc index ad1b2c7..c8b1f00b 100644 --- a/third_party/blink/renderer/core/css/cssom/css_style_value.cc +++ b/third_party/blink/renderer/core/css/cssom/css_style_value.cc
@@ -70,8 +70,7 @@ String CSSStyleValue::toString() const { const CSSValue* result = ToCSSValue(); - DCHECK(result); - return result->CssText(); + return result ? result->CssText() : ""; } } // namespace blink
diff --git a/third_party/blink/renderer/core/dom/range_test.cc b/third_party/blink/renderer/core/dom/range_test.cc index 3709501..a7ff3f42 100644 --- a/third_party/blink/renderer/core/dom/range_test.cc +++ b/third_party/blink/renderer/core/dom/range_test.cc
@@ -5,6 +5,7 @@ #include "third_party/blink/renderer/core/dom/range.h" #include "base/memory/scoped_refptr.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h" #include "third_party/blink/renderer/bindings/core/v8/v8_font_face_descriptors.h" @@ -33,6 +34,8 @@ namespace blink { +using ::testing::ElementsAre; + class RangeTest : public EditingTestBase {}; TEST_F(RangeTest, extractContentsWithDOMMutationEvent) { @@ -346,6 +349,44 @@ return sizes; } +// http://crbug.com/1240510 +TEST_F(RangeTest, GetBorderAndTextQuadsWithCombinedText) { + ScopedLayoutNGTextCombineForTest enable_layout_ng_text_combine(true); + + LoadAhem(); + InsertStyleElement( + "body { font: 20px/25px Ahem; margin: 0px; }" + "#sample { writing-mode: vertical-rl; }" + "c { text-combine-upright: all; }"); + SetBodyInnerHTML( + "<div id=sample>" + "<c id=c1>M</c><c id=c2>MM</c><c id=c3>MMM</c><c id=c4>MMMM</c>" + "</div>"); + const Text& text1 = *To<Text>(GetElementById("c1")->firstChild()); + const Text& text2 = *To<Text>(GetElementById("c2")->firstChild()); + const Text& text3 = *To<Text>(GetElementById("c3")->firstChild()); + const Text& text4 = *To<Text>(GetElementById("c4")->firstChild()); + + EXPECT_THAT(GetBorderAndTextQuads(Position(text1, 0), Position(text1, 1)), + ElementsAre(FloatRect(3, 0, 20, 20))); + + if (RuntimeEnabledFeatures::LayoutNGTextCombineEnabled()) { + EXPECT_THAT(GetBorderAndTextQuads(Position(text2, 0), Position(text2, 2)), + ElementsAre(FloatRect(2, 20, 22, 20))); + EXPECT_THAT(GetBorderAndTextQuads(Position(text3, 0), Position(text3, 3)), + ElementsAre(FloatRect(2, 40, 22, 20))); + EXPECT_THAT(GetBorderAndTextQuads(Position(text4, 0), Position(text4, 4)), + ElementsAre(FloatRect(2, 60, 22, 20))); + } else { + EXPECT_THAT(GetBorderAndTextQuads(Position(text2, 0), Position(text2, 2)), + ElementsAre(FloatRect(3, 20, 20, 20))); + EXPECT_THAT(GetBorderAndTextQuads(Position(text3, 0), Position(text3, 3)), + ElementsAre(FloatRect(3, 40, 20, 20))); + EXPECT_THAT(GetBorderAndTextQuads(Position(text4, 0), Position(text4, 4)), + ElementsAre(FloatRect(3, 60, 20, 20))); + } +} + TEST_F(RangeTest, GetBorderAndTextQuadsWithFirstLetterOne) { GetDocument().body()->setInnerHTML(R"HTML( <style>
diff --git a/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc b/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc index 1f8e05d..772ea26 100644 --- a/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc +++ b/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc
@@ -862,7 +862,9 @@ return ReplaceTextInNode(text_node, start, end - start, string); } - Vector<InlineTextBox*> sorted_text_boxes; + HeapVector<Member<InlineTextBox>> sorted_text_boxes; + ClearCollectionScope<HeapVector<Member<InlineTextBox>>> scope( + &sorted_text_boxes); wtf_size_t sorted_text_boxes_position = 0; for (InlineTextBox* text_box : text_layout_object->TextBoxes()) @@ -874,7 +876,7 @@ std::sort(sorted_text_boxes.begin(), sorted_text_boxes.end(), InlineTextBox::CompareByStart); InlineTextBox* box = sorted_text_boxes.IsEmpty() - ? 0 + ? nullptr : sorted_text_boxes[sorted_text_boxes_position]; unsigned removed = 0;
diff --git a/third_party/blink/renderer/core/editing/iterators/text_iterator_text_node_handler.cc b/third_party/blink/renderer/core/editing/iterators/text_iterator_text_node_handler.cc index 3004b87..6cc792b9 100644 --- a/third_party/blink/renderer/core/editing/iterators/text_iterator_text_node_handler.cc +++ b/third_party/blink/renderer/core/editing/iterators/text_iterator_text_node_handler.cc
@@ -317,7 +317,7 @@ std::sort(sorted_text_boxes_.begin(), sorted_text_boxes_.end(), InlineTextBox::CompareByStart); sorted_text_boxes_position_ = 0; - text_box_ = sorted_text_boxes_.IsEmpty() ? 0 : sorted_text_boxes_[0]; + text_box_ = sorted_text_boxes_.IsEmpty() ? nullptr : sorted_text_boxes_[0]; } HandleTextBox(); @@ -392,7 +392,8 @@ // Check for collapsed space at the start of this run. InlineTextBox* first_text_box = layout_object->ContainsReversedText() - ? (sorted_text_boxes_.IsEmpty() ? 0 : sorted_text_boxes_[0]) + ? (sorted_text_boxes_.IsEmpty() ? nullptr + : sorted_text_boxes_[0].Get()) : layout_object->FirstTextBox(); const bool need_space = last_text_node_ended_with_collapsed_space_ || (text_box_ == first_text_box &&
diff --git a/third_party/blink/renderer/core/editing/iterators/text_iterator_text_node_handler.h b/third_party/blink/renderer/core/editing/iterators/text_iterator_text_node_handler.h index 3faf137..8416895 100644 --- a/third_party/blink/renderer/core/editing/iterators/text_iterator_text_node_handler.h +++ b/third_party/blink/renderer/core/editing/iterators/text_iterator_text_node_handler.h
@@ -107,7 +107,7 @@ bool last_text_node_ended_with_collapsed_space_ = false; // Used when text boxes are out of order (Hebrew/Arabic w/ embedded LTR text) - Vector<InlineTextBox*> sorted_text_boxes_; + HeapVector<Member<InlineTextBox>> sorted_text_boxes_; wtf_size_t sorted_text_boxes_position_ = 0; const TextIteratorBehavior behavior_;
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h index 8d7a0e9..52a8854 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client.h +++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -47,6 +47,7 @@ #include "third_party/blink/public/common/use_counter/use_counter_feature.h" #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" #include "third_party/blink/public/mojom/devtools/devtools_agent.mojom-blink-forward.h" +#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom-blink-forward.h" #include "third_party/blink/public/mojom/frame/triggering_event_info.mojom-blink-forward.h" #include "third_party/blink/public/mojom/portal/portal.mojom-blink-forward.h" #include "third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h" @@ -269,7 +270,9 @@ // Creates a remote fenced frame hosted by an MPArch frame tree for the // |HTMLFencedFrameElement|. - virtual RemoteFrame* CreateFencedFrame(HTMLFencedFrameElement*) = 0; + virtual RemoteFrame* CreateFencedFrame( + HTMLFencedFrameElement*, + mojo::PendingAssociatedReceiver<mojom::blink::FencedFrameOwnerHost>) = 0; // Whether or not plugin creation should fail if the HTMLPlugInElement isn't // in the DOM after plugin initialization.
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc index 94e332a..5f109d31 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
@@ -846,8 +846,10 @@ } RemoteFrame* LocalFrameClientImpl::CreateFencedFrame( - HTMLFencedFrameElement* fenced_frame) { - return web_frame_->CreateFencedFrame(fenced_frame); + HTMLFencedFrameElement* fenced_frame, + mojo::PendingAssociatedReceiver<mojom::blink::FencedFrameOwnerHost> + receiver) { + return web_frame_->CreateFencedFrame(fenced_frame, std::move(receiver)); } WebPluginContainerImpl* LocalFrameClientImpl::CreatePlugin(
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h index 0d7ecf0..c0f6553 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
@@ -183,7 +183,10 @@ mojo::PendingAssociatedRemote<mojom::blink::PortalClient>) override; RemoteFrame* AdoptPortal(HTMLPortalElement*) override; - RemoteFrame* CreateFencedFrame(HTMLFencedFrameElement*) override; + RemoteFrame* CreateFencedFrame( + HTMLFencedFrameElement*, + mojo::PendingAssociatedReceiver<mojom::blink::FencedFrameOwnerHost>) + override; WebPluginContainerImpl* CreatePlugin(HTMLPlugInElement&, const KURL&,
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc index 13d8f88..64500ef 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -99,6 +99,7 @@ #include "third_party/blink/public/common/context_menu_data/context_menu_params_builder.h" #include "third_party/blink/public/common/page_state/page_state.h" #include "third_party/blink/public/mojom/devtools/inspector_issue.mojom-blink.h" +#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom-blink.h" #include "third_party/blink/public/mojom/frame/frame_owner_element_type.mojom-blink.h" #include "third_party/blink/public/mojom/frame/media_player_action.mojom-blink.h" #include "third_party/blink/public/mojom/frame/tree_scope_type.mojom-blink.h" @@ -2140,8 +2141,11 @@ } RemoteFrame* WebLocalFrameImpl::CreateFencedFrame( - HTMLFencedFrameElement* fenced_frame) { - WebRemoteFrame* frame = client_->CreateFencedFrame(fenced_frame); + HTMLFencedFrameElement* fenced_frame, + mojo::PendingAssociatedReceiver<mojom::blink::FencedFrameOwnerHost> + receiver) { + WebRemoteFrame* frame = + client_->CreateFencedFrame(fenced_frame, std::move(receiver)); return To<WebRemoteFrameImpl>(frame)->GetFrame(); }
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h index 3136ab7..d3f584bd 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
@@ -46,6 +46,7 @@ #include "third_party/blink/public/common/tokens/tokens.h" #include "third_party/blink/public/mojom/blob/blob_url_store.mojom-blink-forward.h" #include "third_party/blink/public/mojom/devtools/devtools_agent.mojom-blink-forward.h" +#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom-blink-forward.h" #include "third_party/blink/public/mojom/frame/find_in_page.mojom-blink-forward.h" #include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink-forward.h" #include "third_party/blink/public/mojom/frame/tree_scope_type.mojom-blink.h" @@ -417,7 +418,9 @@ mojo::PendingAssociatedRemote<mojom::blink::PortalClient>); RemoteFrame* AdoptPortal(HTMLPortalElement*); - RemoteFrame* CreateFencedFrame(HTMLFencedFrameElement*); + RemoteFrame* CreateFencedFrame( + HTMLFencedFrameElement*, + mojo::PendingAssociatedReceiver<mojom::blink::FencedFrameOwnerHost>); void DidChangeContentsSize(const IntSize&);
diff --git a/third_party/blink/renderer/core/html/build.gni b/third_party/blink/renderer/core/html/build.gni index aa71a70..c2eaea6 100644 --- a/third_party/blink/renderer/core/html/build.gni +++ b/third_party/blink/renderer/core/html/build.gni
@@ -660,6 +660,7 @@ "forms/form_controller_test.cc", "forms/form_data_test.cc", "forms/html_data_list_element_test.cc", + "forms/html_field_set_element_test.cc", "forms/html_form_control_element_test.cc", "forms/html_form_element_test.cc", "forms/html_input_element_test.cc",
diff --git a/third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.cc b/third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.cc index 4070f1e..7f243a1 100644 --- a/third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.cc +++ b/third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.cc
@@ -4,7 +4,9 @@ #include "third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.h" +#include "mojo/public/cpp/bindings/associated_remote.h" #include "third_party/blink/public/common/features.h" +#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom-blink.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h" #include "third_party/blink/renderer/core/frame/remote_frame.h" @@ -20,9 +22,14 @@ } void FencedFrameMPArchDelegate::DidGetInserted() { + mojo::PendingAssociatedRemote<mojom::blink::FencedFrameOwnerHost> remote; + mojo::PendingAssociatedReceiver<mojom::blink::FencedFrameOwnerHost> receiver = + remote.InitWithNewEndpointAndPassReceiver(); + remote_.Bind(std::move(remote)); + RemoteFrame* remote_frame = GetElement().GetDocument().GetFrame()->Client()->CreateFencedFrame( - &GetElement()); + &GetElement(), std::move(receiver)); DCHECK_EQ(remote_frame, GetElement().ContentFrame()); }
diff --git a/third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.h b/third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.h index 210a74e..c42520df 100644 --- a/third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.h +++ b/third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.h
@@ -5,6 +5,8 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_FENCED_FRAME_FENCED_FRAME_MPARCH_DELEGATE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_FENCED_FRAME_FENCED_FRAME_MPARCH_DELEGATE_H_ +#include "mojo/public/cpp/bindings/associated_remote.h" +#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom-blink.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.h" @@ -24,6 +26,9 @@ void DidGetInserted() override; void Navigate(const KURL&) override; + + private: + mojo::AssociatedRemote<mojom::blink::FencedFrameOwnerHost> remote_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/html/forms/html_field_set_element.cc b/third_party/blink/renderer/core/html/forms/html_field_set_element.cc index d731563..479a423 100644 --- a/third_party/blink/renderer/core/html/forms/html_field_set_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_field_set_element.cc
@@ -26,6 +26,8 @@ #include "third_party/blink/renderer/core/dom/element_traversal.h" #include "third_party/blink/renderer/core/dom/events/event_dispatch_forbidden_scope.h" +#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h" +#include "third_party/blink/renderer/core/dom/node_computed_style.h" #include "third_party/blink/renderer/core/dom/node_lists_node_data.h" #include "third_party/blink/renderer/core/html/custom/element_internals.h" #include "third_party/blink/renderer/core/html/forms/html_legend_element.h" @@ -38,6 +40,22 @@ namespace blink { +namespace { + +bool WillReattachChildLayoutObject(const Node& parent) { + for (const Node& child : FlatTreeTraversal::ChildrenOf(parent)) { + if (child.NeedsReattachLayoutTree()) + return true; + if (child.ChildNeedsReattachLayoutTree() && child.GetComputedStyle() && + child.GetComputedStyle()->Display() == EDisplay::kContents && + WillReattachChildLayoutObject(child)) + return true; + } + return false; +} + +} // namespace + HTMLFieldSetElement::HTMLFieldSetElement(Document& document) : HTMLFormControlElement(html_names::kFieldsetTag, document) { // This class has DidRecalcStyle(). @@ -137,7 +155,7 @@ } void HTMLFieldSetElement::DidRecalcStyle(const StyleRecalcChange change) { - if (ChildNeedsReattachLayoutTree()) + if (ChildNeedsReattachLayoutTree() && WillReattachChildLayoutObject(*this)) SetNeedsReattachLayoutTree(); }
diff --git a/third_party/blink/renderer/core/html/forms/html_field_set_element_test.cc b/third_party/blink/renderer/core/html/forms/html_field_set_element_test.cc new file mode 100644 index 0000000..2f015f7 --- /dev/null +++ b/third_party/blink/renderer/core/html/forms/html_field_set_element_test.cc
@@ -0,0 +1,30 @@ +// Copyright 2021 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 "third_party/blink/renderer/core/html/forms/html_field_set_element.h" + +#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" + +namespace blink { + +class HTMLFieldSetElementTest : public RenderingTest {}; + +// crbug.com/1240414 +TEST_F(HTMLFieldSetElementTest, DidRecalcStyleWithDescendantReattach) { + SetBodyInnerHTML(R"HTML( +<fieldset id="fieldset"> + <legend>legend</legend> + <div><span id="span" style="display:none">span</span></div> +</fieldset>)HTML"); + UpdateAllLifecyclePhasesForTest(); + + // Reattach of a fieldset descendant should not reattach the fieldset. + auto* previous_layout_box = GetLayoutBoxByElementId("fieldset"); + auto* descendant = GetElementById("span"); + descendant->removeAttribute(html_names::kStyleAttr); + GetDocument().UpdateStyleAndLayoutTree(); + EXPECT_EQ(previous_layout_box, GetLayoutBoxByElementId("fieldset")); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/layout/bidi_run.h b/third_party/blink/renderer/core/layout/bidi_run.h index 1bd5a1b8..9398c135 100644 --- a/third_party/blink/renderer/core/layout/bidi_run.h +++ b/third_party/blink/renderer/core/layout/bidi_run.h
@@ -61,7 +61,11 @@ public: LineLayoutItem line_layout_item_; - InlineBox* box_; + + // This doesn't create reference cycle as BidiRunList/BidiResolver, which own + // BidiRun, is allocated only on stack and BidiRun deleted manually in + // BidiRunList::DeleteRuns(). + Persistent<InlineBox> box_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/floating_objects.cc b/third_party/blink/renderer/core/layout/floating_objects.cc index d799369f..5b2c9f9 100644 --- a/third_party/blink/renderer/core/layout/floating_objects.cc +++ b/third_party/blink/renderer/core/layout/floating_objects.cc
@@ -40,8 +40,7 @@ namespace blink { struct SameSizeAsFloatingObject { - void* pointers[1]; - UntracedMember<void*> members[1]; + Member<void*> members[2]; LayoutRect rect; uint32_t bitfields : 8; }; @@ -88,10 +87,14 @@ { } -std::unique_ptr<FloatingObject> FloatingObject::Create(LayoutBox* layout_object, - Type type) { - std::unique_ptr<FloatingObject> new_obj = - base::WrapUnique(new FloatingObject(PassKey(), layout_object, type)); +void FloatingObject::Trace(Visitor* visitor) const { + visitor->Trace(layout_object_); + visitor->Trace(originating_line_); +} + +FloatingObject* FloatingObject::Create(LayoutBox* layout_object, Type type) { + FloatingObject* new_obj = + MakeGarbageCollected<FloatingObject>(PassKey(), layout_object, type); // If a layer exists, the float will paint itself. Otherwise someone else // will. @@ -111,20 +114,19 @@ return new_obj; } -std::unique_ptr<FloatingObject> FloatingObject::CopyToNewContainer( - LayoutSize offset, - bool should_paint, - bool is_descendant) const { - return base::WrapUnique(new FloatingObject( +FloatingObject* FloatingObject::CopyToNewContainer(LayoutSize offset, + bool should_paint, + bool is_descendant) const { + return MakeGarbageCollected<FloatingObject>( PassKey(), GetLayoutObject(), GetType(), LayoutRect(FrameRect().Location() - offset, FrameRect().Size()), - should_paint, is_descendant, IsLowestNonOverhangingFloatInChild())); + should_paint, is_descendant, IsLowestNonOverhangingFloatInChild()); } -std::unique_ptr<FloatingObject> FloatingObject::UnsafeClone() const { - std::unique_ptr<FloatingObject> clone_object = base::WrapUnique( - new FloatingObject(PassKey(), GetLayoutObject(), GetType(), frame_rect_, - should_paint_, is_descendant_, false)); +FloatingObject* FloatingObject::UnsafeClone() const { + FloatingObject* clone_object = MakeGarbageCollected<FloatingObject>( + PassKey(), GetLayoutObject(), GetType(), frame_rect_, should_paint_, + is_descendant_, false); clone_object->is_placed_ = is_placed_; #if DCHECK_IS_ON() clone_object->has_geometry_ = has_geometry_; @@ -146,8 +148,7 @@ : layout_object_(layout_object), line_top_(line_top), line_bottom_(line_bottom), - offset_(offset), - outermost_float_(nullptr) {} + offset_(offset) {} virtual ~ComputeFloatOffsetAdapter() = default; @@ -164,7 +165,7 @@ LayoutUnit line_top_; LayoutUnit line_bottom_; LayoutUnit offset_; - const FloatingObject* outermost_float_; + const FloatingObject* outermost_float_ = nullptr; }; template <FloatingObject::Type FloatTypeValue> @@ -336,6 +337,13 @@ layout_object_(layout_object), cached_horizontal_writing_mode_(false) {} +void FloatingObjects::Trace(Visitor* visitor) const { + visitor->Trace(set_); + visitor->Trace(layout_object_); + visitor->Trace(lowest_float_bottom_cache_[0]); + visitor->Trace(lowest_float_bottom_cache_[1]); +} + void FloatingObjects::Clear() { set_.clear(); placed_floats_tree_.Clear(); @@ -372,7 +380,7 @@ LayoutUnit lowest_float_bottom_right; for (FloatingObjectSetIterator it = floating_object_set.begin(); it != end; ++it) { - FloatingObject& floating_object = *it->get(); + FloatingObject& floating_object = *it->Get(); if (floating_object.IsPlaced()) { FloatingObject::Type cur_type = floating_object.GetType(); LayoutUnit cur_float_logical_bottom = @@ -401,7 +409,7 @@ FloatingObject* lowest_floating_object = nullptr; for (FloatingObjectSetIterator it = floating_object_set.begin(); it != end; ++it) { - FloatingObject& floating_object = *it->get(); + FloatingObject& floating_object = *it->Get(); if (floating_object.IsPlaced() && floating_object.GetType() == float_type) { if (layout_object_->LogicalBottomForFloat(floating_object) > @@ -492,7 +500,8 @@ void FloatingObjects::MoveAllToFloatInfoMap(LayoutBoxToFloatInfoMap& map) { while (!set_.IsEmpty()) { - std::unique_ptr<FloatingObject> floating_object = set_.TakeFirst(); + FloatingObject* floating_object = set_.front(); + set_.RemoveFirst(); LayoutBox* layout_object = floating_object->GetLayoutObject(); map.insert(layout_object, std::move(floating_object)); } @@ -556,20 +565,22 @@ MarkLowestFloatLogicalBottomCacheAsDirty(); } -FloatingObject* FloatingObjects::Add( - std::unique_ptr<FloatingObject> floating_object) { - FloatingObject* new_object = floating_object.release(); - IncreaseObjectsCount(new_object->GetType()); - set_.insert(base::WrapUnique(new_object)); - if (new_object->IsPlaced()) - AddPlacedObject(*new_object); +FloatingObject* FloatingObjects::Add(FloatingObject* floating_object) { + IncreaseObjectsCount(floating_object->GetType()); + set_.insert(floating_object); + if (floating_object->IsPlaced()) + AddPlacedObject(*floating_object); MarkLowestFloatLogicalBottomCacheAsDirty(); - return new_object; + return floating_object; } void FloatingObjects::Remove(FloatingObject* to_be_removed) { DecreaseObjectsCount(to_be_removed->GetType()); - std::unique_ptr<FloatingObject> floating_object = set_.Take(to_be_removed); + auto it = set_.find(to_be_removed); + FloatingObject* floating_object = *it; + if (it != set_.end()) { + set_.erase(it); + } DCHECK(floating_object->IsPlaced() || !floating_object->IsInPlacedTree()); if (floating_object->IsPlaced()) RemovePlacedObject(*floating_object); @@ -585,7 +596,7 @@ FloatingObjectSetIterator it = set_.begin(); FloatingObjectSetIterator end = set_.end(); for (; it != end; ++it) { - FloatingObject& floating_object = *it->get(); + FloatingObject& floating_object = *it->Get(); if (floating_object.IsPlaced()) placed_floats_tree_.Add(IntervalForFloatingObject(floating_object)); } @@ -661,8 +672,7 @@ return std::min(fixed_offset, adapter.Offset()); } -FloatingObjects::FloatBottomCachedValue::FloatBottomCachedValue() - : floating_object(nullptr), dirty(true) {} +FloatingObjects::FloatBottomCachedValue::FloatBottomCachedValue() = default; template <> inline bool ComputeFloatOffsetForFloatLayoutAdapter< @@ -677,6 +687,10 @@ return false; } +void FloatingObjects::FloatBottomCachedValue::Trace(Visitor* visitor) const { + visitor->Trace(floating_object); +} + template <> inline bool ComputeFloatOffsetForFloatLayoutAdapter< FloatingObject::kFloatRight>::UpdateOffsetIfNeeded(const FloatingObject&
diff --git a/third_party/blink/renderer/core/layout/floating_objects.h b/third_party/blink/renderer/core/layout/floating_objects.h index b56847db..f4c16e3 100644 --- a/third_party/blink/renderer/core/layout/floating_objects.h +++ b/third_party/blink/renderer/core/layout/floating_objects.h
@@ -28,6 +28,7 @@ #include "base/dcheck_is_on.h" #include "base/types/pass_key.h" #include "third_party/blink/renderer/platform/geometry/layout_rect.h" +#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" #include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h" #include "third_party/blink/renderer/platform/wtf/list_hash_set.h" @@ -40,9 +41,7 @@ class LayoutBox; class RootInlineBox; -class FloatingObject { - USING_FAST_MALLOC(FloatingObject); - +class FloatingObject : public GarbageCollected<FloatingObject> { public: #ifndef NDEBUG // Used by the PODIntervalTree for debugging the FloatingObject. @@ -54,14 +53,13 @@ // for both left and right. enum Type { kFloatLeft = 1, kFloatRight = 2, kFloatLeftRight = 3 }; - static std::unique_ptr<FloatingObject> Create(LayoutBox*, Type); + static FloatingObject* Create(LayoutBox*, Type); - std::unique_ptr<FloatingObject> CopyToNewContainer( - LayoutSize, - bool should_paint = false, - bool is_descendant = false) const; + FloatingObject* CopyToNewContainer(LayoutSize, + bool should_paint = false, + bool is_descendant = false) const; - std::unique_ptr<FloatingObject> UnsafeClone() const; + FloatingObject* UnsafeClone() const; Type GetType() const { return static_cast<Type>(type_); } LayoutBox* GetLayoutObject() const { return layout_object_; } @@ -158,10 +156,11 @@ bool is_lowest_non_overhanging_float_in_child); FloatingObject(const FloatingObject&) = delete; FloatingObject& operator=(const FloatingObject&) = delete; + void Trace(Visitor*) const; private: - UntracedMember<LayoutBox> layout_object_; - RootInlineBox* originating_line_; + Member<LayoutBox> layout_object_; + Member<RootInlineBox> originating_line_; LayoutRect frame_rect_; unsigned type_ : 2; // Type (left or right aligned) @@ -184,15 +183,15 @@ static unsigned GetHash(FloatingObject* key) { return DefaultHash<LayoutBox*>::Hash::GetHash(key->GetLayoutObject()); } - static unsigned GetHash(const std::unique_ptr<FloatingObject>& key) { - return GetHash(key.get()); + static unsigned GetHash(const Member<FloatingObject>& key) { + return GetHash(key.Get()); } - static bool Equal(std::unique_ptr<FloatingObject>& a, FloatingObject* b) { + static bool Equal(const Member<FloatingObject>& a, FloatingObject* b) { return a->GetLayoutObject() == b->GetLayoutObject(); } - static bool Equal(std::unique_ptr<FloatingObject>& a, - const std::unique_ptr<FloatingObject>& b) { - return Equal(a, b.get()); + static bool Equal(const Member<FloatingObject>& a, + const Member<FloatingObject>& b) { + return Equal(a, b.Get()); } static const bool safe_to_compare_to_empty_or_deleted = true; @@ -205,13 +204,13 @@ static bool Equal(FloatingObject* a, LayoutBox* b) { return a->GetLayoutObject() == b; } - static bool Equal(const std::unique_ptr<FloatingObject>& a, LayoutBox* b) { + static bool Equal(const Member<FloatingObject>& a, LayoutBox* b) { return a->GetLayoutObject() == b; } }; -typedef ListHashSet<std::unique_ptr<FloatingObject>, - 4, - FloatingObjectHashFunctions> + +// TODO(yukiy): Use HeapLinkedHashSet here once it supports HashTranslator +typedef HeapListHashSet<Member<FloatingObject>, 4, FloatingObjectHashFunctions> FloatingObjectSet; typedef FloatingObjectSet::const_iterator FloatingObjectSetIterator; typedef WTF::PODInterval<LayoutUnit, FloatingObject*> FloatingObjectInterval; @@ -219,21 +218,20 @@ typedef WTF::PODFreeListArena< WTF::PODRedBlackTree<FloatingObjectInterval>::Node> IntervalArena; -typedef HeapHashMap<Member<LayoutBox>, std::unique_ptr<FloatingObject>> +typedef HeapHashMap<Member<LayoutBox>, Member<FloatingObject>> LayoutBoxToFloatInfoMap; -class FloatingObjects { - USING_FAST_MALLOC(FloatingObjects); - +class FloatingObjects final : public GarbageCollected<FloatingObjects> { public: FloatingObjects(const LayoutBlockFlow*, bool horizontal_writing_mode); FloatingObjects(const FloatingObjects&) = delete; FloatingObjects& operator=(const FloatingObjects&) = delete; ~FloatingObjects(); + void Trace(Visitor*) const; void Clear(); void MoveAllToFloatInfoMap(LayoutBoxToFloatInfoMap&); - FloatingObject* Add(std::unique_ptr<FloatingObject>); + FloatingObject* Add(FloatingObject*); void Remove(FloatingObject*); void AddPlacedObject(FloatingObject&); void RemovePlacedObject(FloatingObject&); @@ -298,11 +296,13 @@ unsigned left_objects_count_; unsigned right_objects_count_; bool horizontal_writing_mode_; - UntracedMember<const LayoutBlockFlow> layout_object_; + Member<const LayoutBlockFlow> layout_object_; struct FloatBottomCachedValue { + DISALLOW_NEW(); FloatBottomCachedValue(); - FloatingObject* floating_object = nullptr; + void Trace(Visitor*) const; + Member<FloatingObject> floating_object; bool dirty = true; }; FloatBottomCachedValue lowest_float_bottom_cache_[2];
diff --git a/third_party/blink/renderer/core/layout/layout_block_flow.cc b/third_party/blink/renderer/core/layout/layout_block_flow.cc index b110333..480fca6 100644 --- a/third_party/blink/renderer/core/layout/layout_block_flow.cc +++ b/third_party/blink/renderer/core/layout/layout_block_flow.cc
@@ -79,8 +79,7 @@ struct SameSizeAsLayoutBlockFlow : public LayoutBlock { LineBoxList line_boxes; - void* pointers[1]; - Member<void*> members[1]; + Member<void*> members[2]; }; ASSERT_SIZE(LayoutBlockFlow, SameSizeAsLayoutBlockFlow); @@ -273,7 +272,9 @@ #endif void LayoutBlockFlow::Trace(Visitor* visitor) const { + visitor->Trace(line_boxes_); visitor->Trace(rare_data_); + visitor->Trace(floating_objects_); LayoutBlock::Trace(visitor); } @@ -1422,7 +1423,7 @@ FloatingObjectSetIterator end = floating_object_set.end(); for (FloatingObjectSetIterator it = floating_object_set.begin(); it != end; ++it) { - const FloatingObject& floating_object = *it->get(); + const FloatingObject& floating_object = *it->Get(); if (!floating_object.IsDescendant()) old_intruding_float_set.insert(floating_object.GetLayoutObject()); } @@ -1506,7 +1507,7 @@ FloatingObjectSetIterator end = floating_object_set.end(); for (FloatingObjectSetIterator it = floating_object_set.begin(); it != end; ++it) { - const FloatingObject& floating_object = *it->get(); + const FloatingObject& floating_object = *it->Get(); auto it_map = float_map.find(floating_object.GetLayoutObject()); FloatingObject* old_floating_object = it_map != float_map.end() ? &*it_map->value : nullptr; @@ -1562,7 +1563,7 @@ LayoutBoxToFloatInfoMap::iterator end = float_map.end(); for (LayoutBoxToFloatInfoMap::iterator it = float_map.begin(); it != end; ++it) { - std::unique_ptr<FloatingObject>& floating_object = it->value; + Member<FloatingObject>& floating_object = it->value; if (!floating_object->IsDescendant()) { change_logical_top = LayoutUnit(); change_logical_bottom = std::max( @@ -2803,7 +2804,7 @@ void LayoutBlockFlow::CreateFloatingObjects() { NOT_DESTROYED(); floating_objects_ = - std::make_unique<FloatingObjects>(this, IsHorizontalWritingMode()); + MakeGarbageCollected<FloatingObjects>(this, IsHorizontalWritingMode()); } void LayoutBlockFlow::WillBeDestroyed() { @@ -3196,7 +3197,7 @@ for (FloatingObjectSetIterator it = from_floating_object_set.begin(); it != end; ++it) { - const FloatingObject& floating_object = *it->get(); + const FloatingObject& floating_object = *it->Get(); // Don't insert the object again if it's already in the list if (to_block_flow->ContainsFloat(floating_object.GetLayoutObject())) @@ -3658,7 +3659,7 @@ FloatingObjectSetIterator it = floating_object_set.Find<FloatingObjectHashTranslator>(&float_box); if (it != floating_object_set.end()) - return it->get(); + return it->Get(); } // Create the special object entry & append it to the list @@ -3666,8 +3667,7 @@ DCHECK(f == EFloat::kLeft || f == EFloat::kRight); FloatingObject::Type type = f == EFloat::kLeft ? FloatingObject::kFloatLeft : FloatingObject::kFloatRight; - std::unique_ptr<FloatingObject> new_obj = - FloatingObject::Create(&float_box, type); + FloatingObject* new_obj = FloatingObject::Create(&float_box, type); return floating_objects_->Add(std::move(new_obj)); } @@ -3678,7 +3678,7 @@ FloatingObjectSetIterator it = floating_object_set.Find<FloatingObjectHashTranslator>(float_box); if (it != floating_object_set.end()) { - FloatingObject& floating_object = *it->get(); + FloatingObject& floating_object = *it->Get(); if (ChildrenInline()) { LayoutUnit logical_top = LogicalTopForFloat(floating_object); LayoutUnit logical_bottom = LogicalBottomForFloat(floating_object); @@ -3718,13 +3718,13 @@ return; const FloatingObjectSet& floating_object_set = floating_objects_->Set(); - FloatingObject* curr = floating_object_set.back().get(); + FloatingObject* curr = floating_object_set.back().Get(); while (curr != last_float && (!curr->IsPlaced() || LogicalTopForFloat(*curr) >= logical_offset)) { floating_objects_->Remove(curr); if (floating_object_set.IsEmpty()) break; - curr = floating_object_set.back().get(); + curr = floating_object_set.back().Get(); } } @@ -3739,7 +3739,7 @@ while (it != begin) { --it; if ((*it)->IsPlaced()) { - last_placed_floating_object = it->get(); + last_placed_floating_object = it->Get(); ++it; break; } @@ -3767,7 +3767,6 @@ // has already been positioned. Then we'll be able to move forward, // positioning all of the new floats that need it. FloatingObjectSetIterator it = floating_object_set.begin(); - ; FloatingObject* last_placed_floating_object = LastPlacedFloat(&it); // The float cannot start above the top position of the last positioned float. @@ -3780,7 +3779,7 @@ FloatingObjectSetIterator end = floating_object_set.end(); // Now walk through the set of unpositioned floats and place them. for (; it != end; ++it) { - FloatingObject& floating_object = *it->get(); + FloatingObject& floating_object = *it->Get(); // The containing block is responsible for positioning floats, so if we have // unplaced floats in our list that come from somewhere else, we have a bug. DCHECK_EQ(floating_object.GetLayoutObject()->ContainingBlock(), this); @@ -3964,7 +3963,7 @@ FloatingObjectSetIterator prev_end = prev_set.end(); for (FloatingObjectSetIterator prev_it = prev_set.begin(); prev_it != prev_end; ++prev_it) { - FloatingObject& floating_object = *prev_it->get(); + FloatingObject& floating_object = *prev_it->Get(); if (LogicalBottomForFloat(floating_object) > logical_top_offset) { if (!floating_objects_ || !floating_objects_->Set().Contains(&floating_object)) { @@ -4012,7 +4011,7 @@ for (FloatingObjectSetIterator child_it = child->floating_objects_->Set().begin(); child_it != child_end; ++child_it) { - FloatingObject& floating_object = *child_it->get(); + FloatingObject& floating_object = *child_it->Get(); LayoutUnit logical_bottom_for_float = std::min(LogicalBottomForFloat(floating_object), LayoutUnit::Max() - child_logical_top); @@ -4169,7 +4168,7 @@ FloatingObjectSetIterator begin = floating_object_set.begin(); for (FloatingObjectSetIterator it = floating_object_set.end(); it != begin;) { --it; - const FloatingObject& floating_object = *it->get(); + const FloatingObject& floating_object = *it->Get(); if (floating_object.ShouldPaint() && // TODO(wangxianzhu): Should this be a DCHECK? !floating_object.GetLayoutObject()->HasSelfPaintingLayer()) { @@ -4275,7 +4274,7 @@ auto* ancestor_block = To<LayoutBlockFlow>(ancestor); FloatingObjects* ancestor_floating_objects = - ancestor_block->floating_objects_.get(); + ancestor_block->floating_objects_; if (!ancestor_floating_objects) break; FloatingObjectSet::iterator it = @@ -4483,7 +4482,7 @@ RootInlineBox* LayoutBlockFlow::CreateRootInlineBox() { NOT_DESTROYED(); - return new RootInlineBox(LineLayoutItem(this)); + return MakeGarbageCollected<RootInlineBox>(LineLayoutItem(this)); } void LayoutBlockFlow::CreateOrDestroyMultiColumnFlowThreadIfNeeded( @@ -4574,7 +4573,9 @@ void LayoutBlockFlow::SimplifiedNormalFlowInlineLayout() { NOT_DESTROYED(); DCHECK(ChildrenInline()); - LinkedHashSet<RootInlineBox*> line_boxes; + HeapLinkedHashSet<Member<RootInlineBox>> line_boxes; + ClearCollectionScope<HeapLinkedHashSet<Member<RootInlineBox>>> scope( + &line_boxes); for (InlineWalker walker(LineLayoutBlockFlow(this)); !walker.AtEnd(); walker.Advance()) { LayoutObject* o = walker.Current().GetLayoutObject(); @@ -4594,7 +4595,7 @@ // FIXME: Glyph overflow will get lost in this case, but not really a big // deal. GlyphOverflowAndFallbackFontsMap text_box_data_map; - for (auto* box : line_boxes) { + for (auto box : line_boxes) { box->ComputeOverflow(box->LineTop(), box->LineBottom(), text_box_data_map); } } @@ -4604,7 +4605,8 @@ NOT_DESTROYED(); DCHECK(ChildrenInline()); RecalcLayoutOverflowResult result; - HashSet<RootInlineBox*> line_boxes; + HeapHashSet<Member<RootInlineBox>> line_boxes; + ClearCollectionScope<HeapHashSet<Member<RootInlineBox>>> scope(&line_boxes); for (InlineWalker walker(LineLayoutBlockFlow(this)); !walker.AtEnd(); walker.Advance()) { LayoutObject* layout_object = walker.Current().GetLayoutObject(); @@ -4625,7 +4627,7 @@ // FIXME: Glyph overflow will get lost in this case, but not really a big // deal. GlyphOverflowAndFallbackFontsMap text_box_data_map; - for (auto* box : line_boxes) { + for (auto box : line_boxes) { box->ClearKnownToHaveNoOverflow(); box->ComputeOverflow(box->LineTop(), box->LineBottom(), text_box_data_map); }
diff --git a/third_party/blink/renderer/core/layout/layout_block_flow.h b/third_party/blink/renderer/core/layout/layout_block_flow.h index 78b125b4..3b26d70 100644 --- a/third_party/blink/renderer/core/layout/layout_block_flow.h +++ b/third_party/blink/renderer/core/layout/layout_block_flow.h
@@ -472,7 +472,7 @@ FloatingObject* LastFloatFromPreviousLine() const { NOT_DESTROYED(); - return ContainsFloats() ? floating_objects_->Set().back().get() : nullptr; + return ContainsFloats() ? floating_objects_->Set().back().Get() : nullptr; } void SetShouldDoFullPaintInvalidationForFirstLine(); @@ -871,7 +871,7 @@ const FloatingObjects* GetFloatingObjects() const { NOT_DESTROYED(); - return floating_objects_.get(); + return floating_objects_; } static void UpdateAncestorShouldPaintFloatingObject( @@ -1005,7 +1005,7 @@ protected: Member<LayoutBlockFlowRareData> rare_data_; - std::unique_ptr<FloatingObjects> floating_objects_; + Member<FloatingObjects> floating_objects_; friend class MarginInfo; friend class LineWidth; // needs to know FloatingObject
diff --git a/third_party/blink/renderer/core/layout/layout_block_flow_line.cc b/third_party/blink/renderer/core/layout/layout_block_flow_line.cc index 8f3b464..c932fb40 100644 --- a/third_party/blink/renderer/core/layout/layout_block_flow_line.cc +++ b/third_party/blink/renderer/core/layout/layout_block_flow_line.cc
@@ -106,7 +106,7 @@ // Don't justify for white-space: pre. if (r->line_layout_item_.StyleRef().WhiteSpace() != EWhiteSpace::kPre) { - auto* text_box = To<InlineTextBox>(r->box_); + auto* text_box = To<InlineTextBox>(r->box_.Get()); CHECK(total_opportunities_); int expansion = ((available_logical_width - total_logical_width) * opportunities_in_run / total_opportunities_) @@ -548,7 +548,7 @@ const Font& font = layout_text.Style(line_info.IsFirstLine())->GetFont(); LayoutUnit hyphen_width; - if (To<InlineTextBox>(run->box_)->HasHyphen()) + if (To<InlineTextBox>(run->box_.Get())->HasHyphen()) hyphen_width = LayoutUnit(layout_text.HyphenWidth(font, run->Direction())); float measured_width = 0; @@ -636,7 +636,7 @@ DCHECK(run->box_->IsText()); GlyphOverflowAndFallbackFontsMap::ValueType* it = text_box_data_map - .insert(To<InlineTextBox>(run->box_), + .insert(To<InlineTextBox>(run->box_.Get()), std::make_pair(Vector<const SimpleFontData*>(), GlyphOverflow())) .stored_value; @@ -648,7 +648,7 @@ DCHECK(run->box_->IsText()); GlyphOverflowAndFallbackFontsMap::ValueType* it = text_box_data_map - .insert(To<InlineTextBox>(run->box_), + .insert(To<InlineTextBox>(run->box_.Get()), std::make_pair(Vector<const SimpleFontData*>(), GlyphOverflow())) .stored_value; @@ -834,7 +834,7 @@ if (text_align == ETextAlign::kJustify && r != trailing_space_run && text_justify != TextJustify::kNone) { if (!is_after_expansion) - To<InlineTextBox>(r->box_)->SetCanHaveLeadingExpansion(true); + To<InlineTextBox>(r->box_.Get())->SetCanHaveLeadingExpansion(true); expansions.AddRunWithExpansions(*r, is_after_expansion, text_justify); } @@ -1003,7 +1003,7 @@ RootInlineBox* start_line = DetermineStartPosition(layout_state, resolver); if (ContainsFloats()) - layout_state.SetLastFloat(floating_objects_->Set().back().get()); + layout_state.SetLastFloat(floating_objects_->Set().back().Get()); // We also find the first clean line and extract these lines. We will add // them back if we determine that we're able to synchronize after handling all @@ -1055,7 +1055,7 @@ it = last_float_iterator; } for (; it != end; ++it) { - FloatingObject& floating_object = *it->get(); + FloatingObject& floating_object = *it->Get(); // If we've reached the start of clean lines any remaining floating children // belong to them. if (clean_line_start.GetLineLayoutItem().IsEqual( @@ -1083,7 +1083,7 @@ layout_state.SetFloatIndex(layout_state.FloatIndex() + 1); } layout_state.SetLastFloat(!floating_object_set.IsEmpty() - ? floating_object_set.back().get() + ? floating_object_set.back().Get() : nullptr); } @@ -1137,7 +1137,7 @@ bool is_new_uba_paragraph = layout_state.GetLineInfo().PreviousLineBrokeCleanly(); FloatingObject* last_float_from_previous_line = - (ContainsFloats()) ? floating_objects_->Set().back().get() : nullptr; + (ContainsFloats()) ? floating_objects_->Set().back().Get() : nullptr; WordMeasurements word_measurements; end_of_line = @@ -2358,7 +2358,7 @@ FloatingObjectSetIterator end = floating_object_set.end(); for (FloatingObjectSetIterator it = floating_object_set.begin(); it != end; ++it) { - const FloatingObject& floating_object = *it->get(); + const FloatingObject& floating_object = *it->Get(); if (LogicalBottomForFloat(floating_object) >= logical_top && LogicalBottomForFloat(floating_object) < logical_bottom) return false;
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index cdaea578..d3abf167 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -133,8 +133,10 @@ LayoutRectOutsets margin_box_outsets; MinMaxSizes intrinsic_logical_widths; LayoutUnit intrinsic_logical_widths_initial_block_size; - void* pointers[4]; + void* pointers[3]; Vector<scoped_refptr<const NGLayoutResult>, 1> layout_results; + Member<void*> inline_box_wrapper; + wtf_size_t first_fragment_item_index_; Member<void*> rare_data; }; @@ -442,6 +444,7 @@ } void LayoutBox::Trace(Visitor* visitor) const { + visitor->Trace(inline_box_wrapper_); visitor->Trace(rare_data_); LayoutBoxModelObject::Trace(visitor); } @@ -3186,7 +3189,7 @@ InlineBox* LayoutBox::CreateInlineBox() { NOT_DESTROYED(); - return new InlineBox(LineLayoutItem(this)); + return MakeGarbageCollected<InlineBox>(LineLayoutItem(this)); } void LayoutBox::DirtyLineBoxes(bool full_layout) {
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h index 9a0d711..c69e8d9e 100644 --- a/third_party/blink/renderer/core/layout/layout_box.h +++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -2371,15 +2371,14 @@ // laid out. const BoxLayoutExtraInput* extra_input_ = nullptr; - union { - // The inline box containing this LayoutBox, for atomic inline elements. - // Valid only when !IsInLayoutNGInlineFormattingContext(). - InlineBox* inline_box_wrapper_; - // The index of the first fragment item associated with this object in - // |NGFragmentItems::Items()|. Zero means there are no such item. - // Valid only when IsInLayoutNGInlineFormattingContext(). - wtf_size_t first_fragment_item_index_; - }; + // The inline box containing this LayoutBox, for atomic inline elements. + // Valid only when !IsInLayoutNGInlineFormattingContext(). + Member<InlineBox> inline_box_wrapper_; + + // The index of the first fragment item associated with this object in + // |NGFragmentItems::Items()|. Zero means there are no such item. + // Valid only when IsInLayoutNGInlineFormattingContext(). + wtf_size_t first_fragment_item_index_ = 0u; Member<LayoutBoxRareData> rare_data_; };
diff --git a/third_party/blink/renderer/core/layout/layout_inline.cc b/third_party/blink/renderer/core/layout/layout_inline.cc index 64d5c890..96afe6a 100644 --- a/third_party/blink/renderer/core/layout/layout_inline.cc +++ b/third_party/blink/renderer/core/layout/layout_inline.cc
@@ -75,6 +75,7 @@ ~SameSizeAsLayoutInline() override = default; LayoutObjectChildList children_; LineBoxList line_boxes_; + wtf_size_t first_fragment_item_index_; }; ASSERT_SIZE(LayoutInline, SameSizeAsLayoutInline); @@ -86,6 +87,7 @@ void LayoutInline::Trace(Visitor* visitor) const { visitor->Trace(children_); + visitor->Trace(line_boxes_); LayoutBoxModelObject::Trace(visitor); } @@ -1697,7 +1699,7 @@ InlineFlowBox* LayoutInline::CreateInlineFlowBox() { NOT_DESTROYED(); - return new InlineFlowBox(LineLayoutItem(this)); + return MakeGarbageCollected<InlineFlowBox>(LineLayoutItem(this)); } InlineFlowBox* LayoutInline::CreateAndAppendInlineFlowBox() {
diff --git a/third_party/blink/renderer/core/layout/layout_inline.h b/third_party/blink/renderer/core/layout/layout_inline.h index 5fe5593..e4c1ea1 100644 --- a/third_party/blink/renderer/core/layout/layout_inline.h +++ b/third_party/blink/renderer/core/layout/layout_inline.h
@@ -453,17 +453,16 @@ LayoutObjectChildList children_; - union { - // All of the line boxes created for this inline flow. For example, - // <i>Hello<br>world.</i> will have two <i> line boxes. - // Valid only when !IsInLayoutNGInlineFormattingContext(). - LineBoxList line_boxes_; - // The index of the first fragment item associated with this object in - // |NGFragmentItems::Items()|. Zero means there are no such item. - // Valid only when IsInLayoutNGInlineFormattingContext(). - wtf_size_t first_fragment_item_index_; + // All of the line boxes created for this inline flow. For example, + // <i>Hello<br>world.</i> will have two <i> line boxes. + // Valid only when !IsInLayoutNGInlineFormattingContext(). + LineBoxList line_boxes_; + + // The index of the first fragment item associated with this object in + // |NGFragmentItems::Items()|. Zero means there are no such item. + // Valid only when IsInLayoutNGInlineFormattingContext(). + wtf_size_t first_fragment_item_index_ = 0u; }; -}; inline LineBoxList* LayoutInline::MutableLineBoxes() { CHECK(!IsInLayoutNGInlineFormattingContext());
diff --git a/third_party/blink/renderer/core/layout/layout_text.cc b/third_party/blink/renderer/core/layout/layout_text.cc index 9235e68..2a976a7 100644 --- a/third_party/blink/renderer/core/layout/layout_text.cc +++ b/third_party/blink/renderer/core/layout/layout_text.cc
@@ -92,8 +92,9 @@ DOMNodeId node_id; float widths[4]; String text; - void* pointers[2]; + Member<void*> members[2]; PhysicalOffset previous_starting_point; + wtf_size_t first_fragment_item_index_; }; ASSERT_SIZE(LayoutText, SameSizeAsLayoutText); @@ -187,6 +188,11 @@ GetSelectionDisplayItemClientMap(); } +void LayoutText::Trace(Visitor* visitor) const { + visitor->Trace(text_boxes_); + LayoutObject::Trace(visitor); +} + LayoutText* LayoutText::CreateEmptyAnonymous( Document& doc, scoped_refptr<const ComputedStyle> style, @@ -662,6 +668,8 @@ if (!MapDOMOffsetToTextContentOffset(*mapping, &start, &end)) return; + const auto* const text_combine = DynamicTo<LayoutNGTextCombine>(Parent()); + // We don't want to add collapsed (i.e., start == end) quads from text // fragments that intersect [start, end] only at the boundary, unless they // are the only quads found. For example, when we have @@ -702,6 +710,8 @@ continue; rect = item.LocalRect(); } + if (UNLIKELY(text_combine)) + rect = text_combine->AdjustRectForBoundingBox(rect); rect.Move(cursor.CurrentOffsetInBlockFlow()); const FloatQuad quad = LocalRectToAbsoluteQuad(rect); if (!is_collapsed) { @@ -2250,7 +2260,8 @@ InlineTextBox* LayoutText::CreateTextBox(int start, uint16_t length) { NOT_DESTROYED(); - return new InlineTextBox(LineLayoutItem(this), start, length); + return MakeGarbageCollected<InlineTextBox>(LineLayoutItem(this), start, + length); } InlineTextBox* LayoutText::CreateInlineTextBox(int start, uint16_t length) {
diff --git a/third_party/blink/renderer/core/layout/layout_text.h b/third_party/blink/renderer/core/layout/layout_text.h index 55c56bbdf..129607e0 100644 --- a/third_party/blink/renderer/core/layout/layout_text.h +++ b/third_party/blink/renderer/core/layout/layout_text.h
@@ -83,6 +83,8 @@ // doesn't re-transform the string. LayoutText(Node*, scoped_refptr<StringImpl>); + void Trace(Visitor*) const override; + static LayoutText* CreateEmptyAnonymous(Document&, scoped_refptr<const ComputedStyle>, LegacyLayout); @@ -592,16 +594,15 @@ mutable LogicalOffset previous_logical_starting_point_ = UninitializedLogicalStartingPoint(); - union { - // The line boxes associated with this object. - // Read the LINE BOXES OWNERSHIP section in the class header comment. - // Valid only when !IsInLayoutNGInlineFormattingContext(). - InlineTextBoxList text_boxes_; - // The index of the first fragment item associated with this object in - // |NGFragmentItems::Items()|. Zero means there are no such item. - // Valid only when IsInLayoutNGInlineFormattingContext(). - wtf_size_t first_fragment_item_index_; - }; + // The line boxes associated with this object. + // Read the LINE BOXES OWNERSHIP section in the class header comment. + // Valid only when !IsInLayoutNGInlineFormattingContext(). + InlineTextBoxList text_boxes_; + + // The index of the first fragment item associated with this object in + // |NGFragmentItems::Items()|. Zero means there are no such item. + // Valid only when IsInLayoutNGInlineFormattingContext(). + wtf_size_t first_fragment_item_index_ = 0u; }; inline InlineTextBoxList& LayoutText::MutableTextBoxes() {
diff --git a/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.cc b/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.cc index 25645ebb..00bf6c8 100644 --- a/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.cc +++ b/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.cc
@@ -40,6 +40,17 @@ namespace blink { +typedef HeapHashMap<Member<InlineTextBox>, scoped_refptr<AbstractInlineTextBox>> + InlineToLegacyAbstractInlineTextBoxHashMap; + +InlineToLegacyAbstractInlineTextBoxHashMap& GetAbstractInlineTextBoxMap() { + DEFINE_STATIC_LOCAL( + Persistent<InlineToLegacyAbstractInlineTextBoxHashMap>, + abstract_inline_text_box_map, + (MakeGarbageCollected<InlineToLegacyAbstractInlineTextBoxHashMap>())); + return *abstract_inline_text_box_map; +} + AbstractInlineTextBox::AbstractInlineTextBox(LineLayoutText line_layout_item) : line_layout_item_(line_layout_item) {} @@ -63,40 +74,29 @@ // ---- -LegacyAbstractInlineTextBox::InlineToLegacyAbstractInlineTextBoxHashMap* - LegacyAbstractInlineTextBox::g_abstract_inline_text_box_map_ = nullptr; - scoped_refptr<AbstractInlineTextBox> LegacyAbstractInlineTextBox::GetOrCreate( LineLayoutText line_layout_text, InlineTextBox* inline_text_box) { if (!inline_text_box) return nullptr; - if (!g_abstract_inline_text_box_map_) { - g_abstract_inline_text_box_map_ = - new InlineToLegacyAbstractInlineTextBoxHashMap(); - } - InlineToLegacyAbstractInlineTextBoxHashMap::const_iterator it = - g_abstract_inline_text_box_map_->find(inline_text_box); - if (it != g_abstract_inline_text_box_map_->end()) + GetAbstractInlineTextBoxMap().find(inline_text_box); + if (it != GetAbstractInlineTextBoxMap().end()) return it->value; scoped_refptr<AbstractInlineTextBox> obj = base::AdoptRef( new LegacyAbstractInlineTextBox(line_layout_text, inline_text_box)); - g_abstract_inline_text_box_map_->Set(inline_text_box, obj); + GetAbstractInlineTextBoxMap().Set(inline_text_box, obj); return obj; } void LegacyAbstractInlineTextBox::WillDestroy(InlineTextBox* inline_text_box) { - if (!g_abstract_inline_text_box_map_) - return; - InlineToLegacyAbstractInlineTextBoxHashMap::const_iterator it = - g_abstract_inline_text_box_map_->find(inline_text_box); - if (it != g_abstract_inline_text_box_map_->end()) { + GetAbstractInlineTextBoxMap().find(inline_text_box); + if (it != GetAbstractInlineTextBoxMap().end()) { it->value->Detach(); - g_abstract_inline_text_box_map_->erase(inline_text_box); + GetAbstractInlineTextBoxMap().erase(inline_text_box); } }
diff --git a/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.h b/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.h index a77dd37c..26c3f98 100644 --- a/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.h +++ b/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.h
@@ -132,12 +132,7 @@ bool IsLineBreak() const final; bool NeedsTrailingSpace() const final; - InlineTextBox* inline_text_box_; - - typedef HashMap<InlineTextBox*, scoped_refptr<AbstractInlineTextBox>> - InlineToLegacyAbstractInlineTextBoxHashMap; - static InlineToLegacyAbstractInlineTextBoxHashMap* - g_abstract_inline_text_box_map_; + Persistent<InlineTextBox> inline_text_box_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/line/inline_box.cc b/third_party/blink/renderer/core/layout/line/inline_box.cc index b70dbf0..bebfa59 100644 --- a/third_party/blink/renderer/core/layout/line/inline_box.cc +++ b/third_party/blink/renderer/core/layout/line/inline_box.cc
@@ -39,37 +39,31 @@ struct SameSizeAsInlineBox : DisplayItemClient { ~SameSizeAsInlineBox() override = default; - void* a[3]; - WeakPersistent<void*> members[1]; + Member<void*> members[4]; LayoutPoint b; LayoutUnit c; uint32_t bitfields; -#if DCHECK_IS_ON() - bool f; -#endif }; ASSERT_SIZE(InlineBox, SameSizeAsInlineBox); -#if DCHECK_IS_ON() -InlineBox::~InlineBox() { - if (!has_bad_parent_ && parent_) - parent_->SetHasBadChildList(); +void InlineBox::Trace(Visitor* visitor) const { + visitor->Trace(next_); + visitor->Trace(prev_); + visitor->Trace(parent_); + visitor->Trace(line_layout_item_); } -#endif DISABLE_CFI_PERF void InlineBox::Destroy() { // We do not need to issue invalidations if the page is being destroyed // since these objects will never be repainted. - if (!line_layout_item_.DocumentBeingDestroyed()) { + if (!GetLineLayoutItem().DocumentBeingDestroyed()) { SetLineLayoutItemShouldDoFullPaintInvalidationIfNeeded(); // TODO(crbug.com/619630): Make this fast. - line_layout_item_.SlowSetPaintingLayerNeedsRepaint(); + GetLineLayoutItem().SlowSetPaintingLayerNeedsRepaint(); } - - delete this; } void InlineBox::Remove(MarkLineBoxes mark_line_boxes) { @@ -77,15 +71,6 @@ Parent()->RemoveChild(this, mark_line_boxes); } -void* InlineBox::operator new(size_t sz) { - return WTF::Partitions::LayoutPartition()->Alloc( - sz, WTF_HEAP_PROFILER_TYPE_NAME(InlineBox)); -} - -void InlineBox::operator delete(void* ptr) { - WTF::Partitions::LayoutPartition()->Free(ptr); -} - const char* InlineBox::BoxName() const { return "InlineBox"; } @@ -368,7 +353,7 @@ // For RootInlineBox, we only need to invalidate if it's using the first line // style. Otherwise it paints nothing so we don't need to invalidate it. if (!IsRootInlineBox() || IsFirstLineStyle()) - line_layout_item_.SetShouldDoFullPaintInvalidation(); + GetLineLayoutItem().SetShouldDoFullPaintInvalidation(); } bool CanUseInlineBox(const LayoutObject& node) {
diff --git a/third_party/blink/renderer/core/layout/line/inline_box.h b/third_party/blink/renderer/core/layout/line/inline_box.h index 4bec348..62a2fe37 100644 --- a/third_party/blink/renderer/core/layout/line/inline_box.h +++ b/third_party/blink/renderer/core/layout/line/inline_box.h
@@ -42,9 +42,27 @@ // InlineBox represents a rectangle that occurs on a line. It corresponds to // some LayoutObject (i.e., it represents a portion of that LayoutObject). -class CORE_EXPORT InlineBox : public DisplayItemClient { +class CORE_EXPORT InlineBox : public GarbageCollected<InlineBox>, + public DisplayItemClient { public: - InlineBox(LineLayoutItem obj) : line_layout_item_(obj), logical_width_() {} +#if !BUILDFLAG(USE_V8_OILPAN) + // Use a type specific arena + template <typename T> + static void* AllocateObject(size_t size) { + ThreadState* state = + ThreadStateFor<ThreadingTrait<InlineBox>::kAffinity>::GetState(); + const char* type_name = "blink::InlineBox"; + return state->Heap().AllocateOnArenaIndex( + state, size, BlinkGC::kLayoutObjectArenaIndex, + GCInfoTrait<GCInfoFoldedType<InlineBox>>::Index(), type_name); + } +#endif // !BUILDFLAG(USE_V8_OILPAN) + + explicit InlineBox(LineLayoutItem obj) + : next_(nullptr), + prev_(nullptr), + parent_(nullptr), + line_layout_item_(obj.GetLayoutObject()) {} InlineBox(LineLayoutItem item, LayoutPoint top_left, @@ -60,14 +78,14 @@ : next_(next), prev_(prev), parent_(parent), - line_layout_item_(item), + line_layout_item_(item.GetLayoutObject()), location_(top_left), logical_width_(logical_width), bitfields_(first_line, constructed, dirty, extracted, is_horizontal) {} InlineBox(const InlineBox&) = delete; InlineBox& operator=(const InlineBox&) = delete; - ~InlineBox() override; + virtual void Trace(Visitor*) const; virtual void Destroy(); @@ -104,10 +122,6 @@ LayoutUnit line_top, LayoutUnit line_bottom); - // InlineBoxes are allocated out of the rendering partition. - void* operator new(size_t); - void operator delete(void*); - #if DCHECK_IS_ON() void ShowTreeForThis() const; void ShowLineTreeForThis() const; @@ -192,12 +206,11 @@ InlineBox* NextLeafChildIgnoringLineBreak() const; InlineBox* PrevLeafChildIgnoringLineBreak() const; - LineLayoutItem GetLineLayoutItem() const { return line_layout_item_; } + LineLayoutItem GetLineLayoutItem() const { + return LineLayoutItem(line_layout_item_); + } InlineFlowBox* Parent() const { -#if DCHECK_IS_ON() - DCHECK(!has_bad_parent_); -#endif return parent_; } @@ -343,7 +356,7 @@ // Use with caution! The type is not checked! LineLayoutBoxModel BoxModelObject() const { if (!GetLineLayoutItem().IsText()) - return LineLayoutBoxModel(line_layout_item_); + return LineLayoutBoxModel(GetLineLayoutItem()); return LineLayoutBoxModel(nullptr); } @@ -458,11 +471,14 @@ private: void SetLineLayoutItemShouldDoFullPaintInvalidationIfNeeded(); - InlineBox* next_ = nullptr; // The next element on the same line as us. - InlineBox* prev_ = nullptr; // The previous element on the same line as us. + Member<InlineBox> next_; // The next element on the same line as us. + Member<InlineBox> prev_; // The previous element on the same line as us. - InlineFlowBox* parent_ = nullptr; // The box that contains us. - LineLayoutItem line_layout_item_; + Member<InlineFlowBox> parent_; // The box that contains us. + + // InlineBox cannot have LineLayoutBox itself bacuse it consists of + // WeakPersistent. Use GetLineLayoutItem() to create LineLayoutBox. + Member<LayoutObject> line_layout_item_; protected: // For RootInlineBox @@ -497,22 +513,8 @@ private: InlineBoxBitfields bitfields_; - -#if DCHECK_IS_ON() - bool has_bad_parent_ = false; -#endif }; -#if !DCHECK_IS_ON() -inline InlineBox::~InlineBox() {} -#endif - -#if DCHECK_IS_ON() -inline void InlineBox::SetHasBadParent() { - has_bad_parent_ = true; -} -#endif - // Allow equality comparisons of InlineBox's by reference or pointer, // interchangeably. DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(InlineBox) @@ -529,4 +531,16 @@ void showLineTree(const blink::InlineBox*); #endif +#if BUILDFLAG(USE_V8_OILPAN) +namespace cppgc { +// Assign InlineBox to be allocated on custom LayoutObjectSpace. +template <typename T> +struct SpaceTrait< + T, + std::enable_if_t<std::is_base_of<blink::InlineBox, T>::value>> { + using Space = blink::LayoutObjectSpace; +}; +} // namespace cppgc +#endif // USE_V8_OILPAN + #endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LINE_INLINE_BOX_H_
diff --git a/third_party/blink/renderer/core/layout/line/inline_flow_box.cc b/third_party/blink/renderer/core/layout/line/inline_flow_box.cc index 0ce63a8..5bfa1bd3 100644 --- a/third_party/blink/renderer/core/layout/line/inline_flow_box.cc +++ b/third_party/blink/renderer/core/layout/line/inline_flow_box.cc
@@ -47,17 +47,24 @@ namespace blink { struct SameSizeAsInlineFlowBox : public InlineBox { - void* pointers[5]; + void* pointers[1]; + Member<void*> members[4]; uint32_t bitfields : 23; }; ASSERT_SIZE(InlineFlowBox, SameSizeAsInlineFlowBox); +void InlineFlowBox::Trace(Visitor* visitor) const { + visitor->Trace(first_child_); + visitor->Trace(last_child_); + visitor->Trace(prev_line_box_); + visitor->Trace(next_line_box_); + InlineBox::Trace(visitor); +} + #if DCHECK_IS_ON() -InlineFlowBox::~InlineFlowBox() { - if (!has_bad_child_list_) - for (InlineBox* child = FirstChild(); child; child = child->NextOnLine()) - child->SetHasBadParent(); +void InlineFlowBox::Destroy() { + InlineBox::Destroy(); } #endif
diff --git a/third_party/blink/renderer/core/layout/line/inline_flow_box.h b/third_party/blink/renderer/core/layout/line/inline_flow_box.h index 655d0a2..fa368d9 100644 --- a/third_party/blink/renderer/core/layout/line/inline_flow_box.h +++ b/third_party/blink/renderer/core/layout/line/inline_flow_box.h
@@ -39,8 +39,8 @@ struct GlyphOverflow; -typedef HashMap<const InlineTextBox*, - std::pair<Vector<const SimpleFontData*>, GlyphOverflow>> +typedef HeapHashMap<Member<const InlineTextBox>, + std::pair<Vector<const SimpleFontData*>, GlyphOverflow>> GlyphOverflowAndFallbackFontsMap; class InlineFlowBox : public InlineBox { @@ -61,10 +61,6 @@ line_break_bidi_status_last_strong_(WTF::unicode::kLeftToRight), line_break_bidi_status_last_(WTF::unicode::kLeftToRight), is_first_after_page_break_(false) -#if DCHECK_IS_ON() - , - has_bad_child_list_(false) -#endif { // Internet Explorer and Firefox always create a marker for list items, even // when the list-style-type is none. We do not make a marker in the @@ -80,8 +76,10 @@ has_text_descendants_ = has_text_children_; } + void Trace(Visitor*) const override; + #if DCHECK_IS_ON() - ~InlineFlowBox() override; + void Destroy() override; void DumpLineTreeAndMark(StringBuilder&, const InlineBox* = nullptr, @@ -469,14 +467,14 @@ bool IsInlineFlowBox() const final { return true; } - InlineBox* first_child_; - InlineBox* last_child_; + Member<InlineBox> first_child_; + Member<InlineBox> last_child_; // The next/previous box that also uses our LayoutObject. // RootInlineBox, a subclass of this class, uses these fields for // next/previous RootInlineBox. - InlineFlowBox* prev_line_box_; - InlineFlowBox* next_line_box_; + Member<InlineFlowBox> prev_line_box_; + Member<InlineFlowBox> next_line_box_; private: unsigned include_logical_left_edge_ : 1; @@ -504,11 +502,6 @@ unsigned is_first_after_page_break_ : 1; // End of RootInlineBox-specific members. - -#if DCHECK_IS_ON() - private: - unsigned has_bad_child_list_ : 1; -#endif }; template <> @@ -516,12 +509,6 @@ static bool AllowFrom(const InlineBox& box) { return box.IsInlineFlowBox(); } }; -inline void InlineFlowBox::SetHasBadChildList() { -#if DCHECK_IS_ON() - has_bad_child_list_ = true; -#endif -} - } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LINE_INLINE_FLOW_BOX_H_
diff --git a/third_party/blink/renderer/core/layout/line/inline_text_box.cc b/third_party/blink/renderer/core/layout/line/inline_text_box.cc index 21ea87e..9f0f3c2e 100644 --- a/third_party/blink/renderer/core/layout/line/inline_text_box.cc +++ b/third_party/blink/renderer/core/layout/line/inline_text_box.cc
@@ -49,19 +49,31 @@ struct SameSizeAsInlineTextBox : public InlineBox { unsigned variables[1]; uint16_t variables2[2]; - void* pointers[2]; + Member<void*> members[2]; }; ASSERT_SIZE(InlineTextBox, SameSizeAsInlineTextBox); -typedef WTF::HashMap<const InlineTextBox*, LayoutRect> InlineTextBoxOverflowMap; -static InlineTextBoxOverflowMap* g_text_boxes_with_overflow; +typedef HeapHashMap<Member<const InlineTextBox>, LayoutRect> + InlineTextBoxOverflowMap; +InlineTextBoxOverflowMap& GetTextBoxesWithOverflow() { + DEFINE_STATIC_LOCAL(Persistent<InlineTextBoxOverflowMap>, + text_boxes_with_overflow, + (MakeGarbageCollected<InlineTextBoxOverflowMap>())); + return *text_boxes_with_overflow; +} + +void InlineTextBox::Trace(Visitor* visitor) const { + visitor->Trace(prev_text_box_); + visitor->Trace(next_text_box_); + InlineBox::Trace(visitor); +} void InlineTextBox::Destroy() { LegacyAbstractInlineTextBox::WillDestroy(this); - if (!KnownToHaveNoOverflow() && g_text_boxes_with_overflow) - g_text_boxes_with_overflow->erase(this); + if (!KnownToHaveNoOverflow()) + GetTextBoxesWithOverflow().erase(this); InlineBox::Destroy(); } @@ -77,11 +89,11 @@ } LayoutRect InlineTextBox::LogicalOverflowRect() const { - if (KnownToHaveNoOverflow() || !g_text_boxes_with_overflow) + if (KnownToHaveNoOverflow()) return LogicalFrameRect(); - const auto& it = g_text_boxes_with_overflow->find(this); - if (it != g_text_boxes_with_overflow->end()) + const auto& it = GetTextBoxesWithOverflow().find(this); + if (it != GetTextBoxesWithOverflow().end()) return it->value; return LogicalFrameRect(); @@ -90,9 +102,7 @@ void InlineTextBox::SetLogicalOverflowRect(const LayoutRect& rect) { DCHECK(!KnownToHaveNoOverflow()); DCHECK(rect != LogicalFrameRect()); - if (!g_text_boxes_with_overflow) - g_text_boxes_with_overflow = new InlineTextBoxOverflowMap; - g_text_boxes_with_overflow->Set(this, rect); + GetTextBoxesWithOverflow().Set(this, rect); } PhysicalRect InlineTextBox::PhysicalOverflowRect() const { @@ -106,9 +116,9 @@ void InlineTextBox::Move(const LayoutSize& delta) { InlineBox::Move(delta); - if (!KnownToHaveNoOverflow() && g_text_boxes_with_overflow) { - const auto& it = g_text_boxes_with_overflow->find(this); - if (it != g_text_boxes_with_overflow->end()) + if (!KnownToHaveNoOverflow()) { + const auto& it = GetTextBoxesWithOverflow().find(this); + if (it != GetTextBoxesWithOverflow().end()) it->value.Move(IsHorizontal() ? delta : delta.TransposedSize()); } } @@ -735,8 +745,8 @@ SetLogicalWidth(logical_width); - if (!KnownToHaveNoOverflow() && g_text_boxes_with_overflow) - g_text_boxes_with_overflow->erase(this); + if (!KnownToHaveNoOverflow()) + GetTextBoxesWithOverflow().erase(this); } } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/line/inline_text_box.h b/third_party/blink/renderer/core/layout/line/inline_text_box.h index e3353cf..e511701 100644 --- a/third_party/blink/renderer/core/layout/line/inline_text_box.h +++ b/third_party/blink/renderer/core/layout/line/inline_text_box.h
@@ -49,11 +49,13 @@ SetIsText(true); } + void Trace(Visitor*) const override; + LineLayoutText GetLineLayoutItem() const { return LineLayoutText(InlineBox::GetLineLayoutItem()); } - void Destroy() final; + void Destroy() override; InlineTextBox* PrevForSameLayoutObject() const { return prev_text_box_; } InlineTextBox* NextForSameLayoutObject() const { return next_text_box_; } @@ -221,8 +223,8 @@ private: // The next/previous box that also uses our LayoutObject. - InlineTextBox* prev_text_box_ = nullptr; - InlineTextBox* next_text_box_ = nullptr; + Member<InlineTextBox> prev_text_box_; + Member<InlineTextBox> next_text_box_; int start_; uint16_t len_;
diff --git a/third_party/blink/renderer/core/layout/line/inline_text_box_test.cc b/third_party/blink/renderer/core/layout/line/inline_text_box_test.cc index b5e3753a..027acfa 100644 --- a/third_party/blink/renderer/core/layout/line/inline_text_box_test.cc +++ b/third_party/blink/renderer/core/layout/line/inline_text_box_test.cc
@@ -17,7 +17,8 @@ TestInlineTextBox(LineLayoutItem item) : InlineTextBox(item, 0, 0) { SetHasVirtualLogicalHeight(); } - ~TestInlineTextBox() override { + void Destroy() override { + InlineTextBox::Destroy(); GetLineLayoutItem().GetLayoutObject()->Destroy(); } @@ -25,7 +26,7 @@ Text* node = document.createTextNode(string); LayoutText* text = MakeGarbageCollected<LayoutText>(node, string.Impl()); text->SetStyle(document.GetStyleResolver().CreateComputedStyle()); - return new TestInlineTextBox(LineLayoutItem(text)); + return MakeGarbageCollected<TestInlineTextBox>(LineLayoutItem(text)); } LayoutUnit VirtualLogicalHeight() const override { return logical_height_; }
diff --git a/third_party/blink/renderer/core/layout/line/line_box_list.cc b/third_party/blink/renderer/core/layout/line/line_box_list.cc index ed92984..c333ac1c 100644 --- a/third_party/blink/renderer/core/layout/line/line_box_list.cc +++ b/third_party/blink/renderer/core/layout/line/line_box_list.cc
@@ -40,6 +40,12 @@ namespace blink { +template <typename InlineBoxType> +void InlineBoxList<InlineBoxType>::Trace(Visitor* visitor) const { + visitor->Trace(first_); + visitor->Trace(last_); +} + #if DCHECK_IS_ON() template <typename InlineBoxType> void InlineBoxList<InlineBoxType>::AssertIsEmpty() {
diff --git a/third_party/blink/renderer/core/layout/line/line_box_list.h b/third_party/blink/renderer/core/layout/line/line_box_list.h index a91eb99..a65d74dc 100644 --- a/third_party/blink/renderer/core/layout/line/line_box_list.h +++ b/third_party/blink/renderer/core/layout/line/line_box_list.h
@@ -32,6 +32,7 @@ #include "base/dcheck_is_on.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/api/hit_test_action.h" +#include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" namespace blink { @@ -52,6 +53,7 @@ public: InlineBoxList() : first_(nullptr), last_(nullptr) {} + void Trace(Visitor*) const; #if DCHECK_IS_ON() // Owners should check this on destructor. This class does not implement @@ -134,8 +136,8 @@ // For block flows, each box represents the root inline box for a line in the // paragraph. // For inline flows, each box represents a portion of that inline. - InlineBoxType* first_ = nullptr; - InlineBoxType* last_ = nullptr; + Member<InlineBoxType> first_; + Member<InlineBoxType> last_; }; extern template class CORE_EXTERN_TEMPLATE_EXPORT InlineBoxList<InlineFlowBox>;
diff --git a/third_party/blink/renderer/core/layout/line/root_inline_box.cc b/third_party/blink/renderer/core/layout/line/root_inline_box.cc index 4ad1698f..ba6105f 100644 --- a/third_party/blink/renderer/core/layout/line/root_inline_box.cc +++ b/third_party/blink/renderer/core/layout/line/root_inline_box.cc
@@ -40,15 +40,21 @@ struct SameSizeAsRootInlineBox : public InlineFlowBox { unsigned unsigned_variable; - void* pointers[2]; - WeakPersistent<void*> members[1]; + void* pointers[1]; + Member<void*> members[2]; LayoutUnit layout_variables[6]; }; ASSERT_SIZE(RootInlineBox, SameSizeAsRootInlineBox); -typedef WTF::HashMap<const RootInlineBox*, EllipsisBox*> EllipsisBoxMap; -static EllipsisBoxMap* g_ellipsis_box_map = nullptr; +typedef HeapHashMap<Member<const RootInlineBox>, Member<EllipsisBox>> + EllipsisBoxMap; + +EllipsisBoxMap& GetEllipsisBoxMap() { + DEFINE_STATIC_LOCAL(Persistent<EllipsisBoxMap>, ellipsis_box_map, + (MakeGarbageCollected<EllipsisBoxMap>())); + return *ellipsis_box_map; +} RootInlineBox::RootInlineBox(LineLayoutItem block) : InlineFlowBox(block), line_break_pos_(0), line_break_obj_(nullptr) { @@ -62,7 +68,7 @@ void RootInlineBox::DetachEllipsisBox() { if (HasEllipsisBox()) { - EllipsisBox* box = g_ellipsis_box_map->Take(this); + EllipsisBox* box = GetEllipsisBoxMap().Take(this); box->SetParent(nullptr); box->Destroy(); SetHasEllipsisBox(false); @@ -121,13 +127,11 @@ // Create an ellipsis box if we don't already have one. If we already have one // we're just here to blank out (truncate) the text boxes. if (!*found_box) { - EllipsisBox* ellipsis_box = new EllipsisBox( + EllipsisBox* ellipsis_box = MakeGarbageCollected<EllipsisBox>( GetLineLayoutItem(), ellipsis_str, this, ellipsis_width, LogicalHeight(), Location(), !PrevRootBox(), IsHorizontal()); - if (!g_ellipsis_box_map) - g_ellipsis_box_map = new EllipsisBoxMap(); - g_ellipsis_box_map->insert(this, ellipsis_box); + GetEllipsisBoxMap().insert(this, ellipsis_box); SetHasEllipsisBox(true); } @@ -213,7 +217,7 @@ } void RootInlineBox::ChildRemoved(InlineBox* box) { - if (box->GetLineLayoutItem() == line_break_obj_) + if (box->GetLineLayoutItem() == LineBreakObj()) SetLineBreakInfo(nullptr, 0, BidiStatus()); for (RootInlineBox* prev = PrevRootBox(); @@ -476,6 +480,16 @@ return closest_leaf ? closest_leaf : last_leaf; } +void RootInlineBox::AppendFloat(LayoutBox* floating_box) { + DCHECK(!IsDirty()); + if (floats_) { + floats_->push_back(floating_box); + } else { + floats_ = + MakeGarbageCollected<HeapVector<Member<LayoutBox>>>(1, floating_box); + } +} + BidiStatus RootInlineBox::LineBreakBidiStatus() const { return BidiStatus( static_cast<WTF::unicode::CharDirection>(line_break_bidi_status_eor_), @@ -497,7 +511,7 @@ !(obj.IsLayoutInline() && obj.IsBox() && !LineLayoutBox(obj).InlineBoxWrapper())); - line_break_obj_ = obj; + line_break_obj_ = obj.GetLayoutObject(); line_break_pos_ = break_pos; line_break_bidi_status_eor_ = status.eor; line_break_bidi_status_last_strong_ = status.last_strong; @@ -508,7 +522,7 @@ EllipsisBox* RootInlineBox::GetEllipsisBox() const { if (!HasEllipsisBox()) return nullptr; - return g_ellipsis_box_map->at(this); + return GetEllipsisBoxMap().at(this); } void RootInlineBox::RemoveLineBoxFromLayoutObject() { @@ -749,7 +763,7 @@ } void RootInlineBox::CollectLeafBoxesInLogicalOrder( - Vector<InlineBox*>& leaf_boxes_in_logical_order, + HeapVector<Member<InlineBox>>& leaf_boxes_in_logical_order, CustomInlineBoxRangeReverse custom_reverse_implementation) const { InlineBox* leaf = FirstLeafChild(); @@ -780,22 +794,24 @@ if (!(min_level % 2)) ++min_level; - Vector<InlineBox*>::iterator end = leaf_boxes_in_logical_order.end(); + HeapVector<Member<InlineBox>>::iterator end = + leaf_boxes_in_logical_order.end(); while (min_level <= max_level) { - Vector<InlineBox*>::iterator it = leaf_boxes_in_logical_order.begin(); + HeapVector<Member<InlineBox>>::iterator it = + leaf_boxes_in_logical_order.begin(); while (it != end) { while (it != end) { if ((*it)->BidiLevel() >= min_level) break; ++it; } - Vector<InlineBox*>::iterator first = it; + HeapVector<Member<InlineBox>>::iterator first = it; while (it != end) { if ((*it)->BidiLevel() < min_level) break; ++it; } - Vector<InlineBox*>::iterator last = it; + HeapVector<Member<InlineBox>>::iterator last = it; if (custom_reverse_implementation) (*custom_reverse_implementation)(first, last); else @@ -806,7 +822,7 @@ } const InlineBox* RootInlineBox::GetLogicalStartNonPseudoBox() const { - Vector<InlineBox*> leaf_boxes_in_logical_order; + HeapVector<Member<InlineBox>> leaf_boxes_in_logical_order; CollectLeafBoxesInLogicalOrder(leaf_boxes_in_logical_order); for (InlineBox* box : leaf_boxes_in_logical_order) { if (box->GetLineLayoutItem().NonPseudoNode()) @@ -816,7 +832,7 @@ } const InlineBox* RootInlineBox::GetLogicalEndNonPseudoBox() const { - Vector<InlineBox*> leaf_boxes_in_logical_order; + HeapVector<Member<InlineBox>> leaf_boxes_in_logical_order; CollectLeafBoxesInLogicalOrder(leaf_boxes_in_logical_order); for (wtf_size_t i = leaf_boxes_in_logical_order.size(); i > 0; --i) { if (leaf_boxes_in_logical_order[i - 1] @@ -832,4 +848,10 @@ return "RootInlineBox"; } +void RootInlineBox::Trace(Visitor* visitor) const { + visitor->Trace(line_break_obj_); + visitor->Trace(floats_); + InlineFlowBox::Trace(visitor); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/line/root_inline_box.h b/third_party/blink/renderer/core/layout/line/root_inline_box.h index d72c130..6faa56d 100644 --- a/third_party/blink/renderer/core/layout/line/root_inline_box.h +++ b/third_party/blink/renderer/core/layout/line/root_inline_box.h
@@ -21,8 +21,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LINE_ROOT_INLINE_BOX_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LINE_ROOT_INLINE_BOX_H_ -#include <memory> - #include "third_party/blink/renderer/core/layout/api/line_layout_item.h" #include "third_party/blink/renderer/core/layout/line/inline_flow_box.h" #include "third_party/blink/renderer/platform/text/bidi_context.h" @@ -48,10 +46,10 @@ void DetachEllipsisBox(); RootInlineBox* NextRootBox() const { - return static_cast<RootInlineBox*>(next_line_box_); + return static_cast<RootInlineBox*>(next_line_box_.Get()); } RootInlineBox* PrevRootBox() const { - return static_cast<RootInlineBox*>(prev_line_box_); + return static_cast<RootInlineBox*>(prev_line_box_.Get()); } void Move(const LayoutSize&) final; @@ -92,7 +90,9 @@ LineBoxList* LineBoxes() const final; - LineLayoutItem LineBreakObj() const { return line_break_obj_; } + LineLayoutItem LineBreakObj() const { + return LineLayoutItem(line_break_obj_); + } BidiStatus LineBreakBidiStatus() const; void SetLineBreakInfo(LineLayoutItem, unsigned break_pos, const BidiStatus&); @@ -156,19 +156,11 @@ LayoutUnit, bool only_editable_leaves = false) const; - void AppendFloat(LayoutBox* floating_box) { - DCHECK(!IsDirty()); - if (floats_) { - floats_->push_back(floating_box); - } else { - floats_ = - std::make_unique<Vector<UntracedMember<LayoutBox>>>(1, floating_box); - } - } + void AppendFloat(LayoutBox* floating_box); - Vector<UntracedMember<LayoutBox>>* FloatsPtr() { + HeapVector<Member<LayoutBox>>* FloatsPtr() { DCHECK(!IsDirty()); - return floats_.get(); + return floats_; } void ExtractLineBoxFromLayoutObject() final; @@ -207,10 +199,10 @@ } typedef void (*CustomInlineBoxRangeReverse)( - Vector<InlineBox*>::iterator first, - Vector<InlineBox*>::iterator last); + HeapVector<Member<InlineBox>>::iterator first, + HeapVector<Member<InlineBox>>::iterator last); void CollectLeafBoxesInLogicalOrder( - Vector<InlineBox*>&, + HeapVector<Member<InlineBox>>&, CustomInlineBoxRangeReverse custom_reverse_implementation = nullptr) const; @@ -219,21 +211,25 @@ const char* BoxName() const override; + void Trace(Visitor* visitor) const override; + private: LayoutUnit BeforeAnnotationsAdjustment() const; // This folds into the padding at the end of InlineFlowBox on 64-bit. unsigned line_break_pos_; - // Where this line ended. The exact object and the position within that + // Where this line ended. The exact object and the position within that // object are stored so that we can create an InlineIterator beginning just // after the end of this line. - LineLayoutItem line_break_obj_; + // RootInlineBox cannot have LineLayoutBox itself bacuse it consists of + // WeakPersistent. Use LineBreakObj() to create LineLayoutBox. + Member<LayoutObject> line_break_obj_; scoped_refptr<BidiContext> line_break_context_; // Floats hanging off the line are pushed into this vector during layout. It // is only good for as long as the line has not been marked dirty. - std::unique_ptr<Vector<UntracedMember<LayoutBox>>> floats_; + Member<HeapVector<Member<LayoutBox>>> floats_; LayoutUnit line_top_; LayoutUnit line_bottom_;
diff --git a/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h b/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h index 51f3ed7b..4a914a25 100644 --- a/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h +++ b/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h
@@ -136,17 +136,6 @@ CORE_EXPORT std::ostream& operator<<(std::ostream&, const NGLineBoxStrut&); -// Struct to store pixel snapped physical dimensions. -struct CORE_EXPORT NGPixelSnappedPhysicalBoxStrut { - NGPixelSnappedPhysicalBoxStrut() = default; - NGPixelSnappedPhysicalBoxStrut(int top, int right, int bottom, int left) - : top(top), right(right), bottom(bottom), left(left) {} - int top; - int right; - int bottom; - int left; -}; - // Struct to store physical dimensions, independent of writing mode and // direction. // See https://drafts.csswg.org/css-writing-modes-3/#abstract-box @@ -190,11 +179,6 @@ writing_direction.IsFlippedLines()); } - NGPixelSnappedPhysicalBoxStrut SnapToDevicePixels() const { - return NGPixelSnappedPhysicalBoxStrut(top.Round(), right.Round(), - bottom.Round(), left.Round()); - } - LayoutUnit HorizontalSum() const { return left + right; } LayoutUnit VerticalSum() const { return top + bottom; }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc index 83bfe27..2721b9cc 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc
@@ -1563,20 +1563,6 @@ return self_item->BidiLevel(); } -NGPixelSnappedPhysicalBoxStrut NGPhysicalBoxFragment::BorderWidths() const { - PhysicalBoxSides sides = SidesToInclude(); - NGPhysicalBoxStrut borders = Borders(); - if (!sides.top) - borders.top = LayoutUnit(); - if (!sides.right) - borders.right = LayoutUnit(); - if (!sides.bottom) - borders.bottom = LayoutUnit(); - if (!sides.left) - borders.left = LayoutUnit(); - return borders.SnapToDevicePixels(); -} - #if DCHECK_IS_ON() NGPhysicalBoxFragment::AllowPostLayoutScope::AllowPostLayoutScope() { ++allow_count_;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h index c334de5..b9bf8fe 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h
@@ -237,12 +237,6 @@ ComputeRareDataAddress()->multicols_with_pending_oofs); } - NGPixelSnappedPhysicalBoxStrut PixelSnappedPadding() const { - if (!has_padding_) - return NGPixelSnappedPhysicalBoxStrut(); - return ComputePaddingAddress()->SnapToDevicePixels(); - } - // Return true if this is either a container that establishes an inline // formatting context, or if it's non-atomic inline content participating in // one. Empty blocks don't establish an inline formatting context. @@ -370,7 +364,6 @@ return PhysicalBoxSides(include_border_top_, include_border_right_, include_border_bottom_, include_border_left_); } - NGPixelSnappedPhysicalBoxStrut BorderWidths() const; // Return true if this is the first fragment generated from a node. bool IsFirstForNode() const { return is_first_for_node_; }
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_inline.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_inline.cc index 5ce9a31..2c140ea 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_inline.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_inline.cc
@@ -59,7 +59,8 @@ InlineFlowBox* LayoutSVGInline::CreateInlineFlowBox() { NOT_DESTROYED(); - InlineFlowBox* box = new SVGInlineFlowBox(LineLayoutItem(this)); + InlineFlowBox* box = + MakeGarbageCollected<SVGInlineFlowBox>(LineLayoutItem(this)); box->SetHasVirtualLogicalHeight(); return box; }
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.cc index 4fa62afb..9b63263 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.cc
@@ -114,8 +114,8 @@ InlineTextBox* LayoutSVGInlineText::CreateTextBox(int start, uint16_t length) { NOT_DESTROYED(); - InlineTextBox* box = - new SVGInlineTextBox(LineLayoutItem(this), start, length); + InlineTextBox* box = MakeGarbageCollected<SVGInlineTextBox>( + LineLayoutItem(this), start, length); box->SetHasVirtualLogicalHeight(); return box; }
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_text.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_text.cc index ed20804..26ca65b 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_text.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_text.cc
@@ -328,7 +328,8 @@ RootInlineBox* LayoutSVGText::CreateRootInlineBox() { NOT_DESTROYED(); - RootInlineBox* box = new SVGRootInlineBox(LineLayoutItem(this)); + RootInlineBox* box = + MakeGarbageCollected<SVGRootInlineBox>(LineLayoutItem(this)); box->SetHasVirtualLogicalHeight(); return box; }
diff --git a/third_party/blink/renderer/core/layout/svg/line/svg_root_inline_box.cc b/third_party/blink/renderer/core/layout/svg/line/svg_root_inline_box.cc index 5cc34ef..e006624a 100644 --- a/third_party/blink/renderer/core/layout/svg/line/svg_root_inline_box.cc +++ b/third_party/blink/renderer/core/layout/svg/line/svg_root_inline_box.cc
@@ -161,8 +161,8 @@ } static inline void ReverseInlineBoxRangeAndValueListsIfNeeded( - Vector<InlineBox*>::iterator first, - Vector<InlineBox*>::iterator last) { + HeapVector<Member<InlineBox>>::iterator first, + HeapVector<Member<InlineBox>>::iterator last) { // This is a copy of std::reverse(first, last). It additionally assures // that the metrics map within the layoutObjects belonging to the // InlineBoxes are reordered as well. @@ -170,8 +170,8 @@ if (first == last || first == --last) return; - auto* first_text_box = DynamicTo<SVGInlineTextBox>(*first); - auto* last_text_box = DynamicTo<SVGInlineTextBox>(*last); + auto* first_text_box = DynamicTo<SVGInlineTextBox>(first->Get()); + auto* last_text_box = DynamicTo<SVGInlineTextBox>(last->Get()); if (last_text_box && first_text_box) { // Reordering is only necessary for BiDi text that is _absolutely_ // positioned. @@ -188,7 +188,9 @@ } void SVGRootInlineBox::ReorderValueLists() { - Vector<InlineBox*> leaf_boxes_in_logical_order; + HeapVector<Member<InlineBox>> leaf_boxes_in_logical_order; + ClearCollectionScope<HeapVector<Member<InlineBox>>> scope( + &leaf_boxes_in_logical_order); CollectLeafBoxesInLogicalOrder(leaf_boxes_in_logical_order, ReverseInlineBoxRangeAndValueListsIfNeeded); }
diff --git a/third_party/blink/renderer/core/layout/svg/svg_layout_support.cc b/third_party/blink/renderer/core/layout/svg/svg_layout_support.cc index 4ed6704d..f4cf07a1 100644 --- a/third_party/blink/renderer/core/layout/svg/svg_layout_support.cc +++ b/third_party/blink/renderer/core/layout/svg/svg_layout_support.cc
@@ -459,7 +459,6 @@ float distance = DistanceToChildLayoutObject(child, point); if (distance >= closest_text.distance) continue; - candidates.clear(); closest_text.layout_object = child; closest_text.distance = distance; continue;
diff --git a/third_party/blink/renderer/core/layout/svg/svg_layout_support_test.cc b/third_party/blink/renderer/core/layout/svg/svg_layout_support_test.cc new file mode 100644 index 0000000..fdebee0 --- /dev/null +++ b/third_party/blink/renderer/core/layout/svg/svg_layout_support_test.cc
@@ -0,0 +1,34 @@ +// Copyright 2021 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 "third_party/blink/renderer/core/layout/svg/svg_layout_support.h" + +#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" + +namespace blink { + +class SVGLayoutSupportTest : public RenderingTest {}; + +TEST_F(SVGLayoutSupportTest, FindClosestLayoutSVGText) { + SetBodyInnerHTML(R"HTML( +<svg xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 450 500" id="svg"> + <g id="testContent" stroke-width="0.01" font-size="15"> + <text x="50%" y="10%" text-anchor="middle" id="t1"> + Heading</text> + <g text-anchor="start" id="innerContent"> + <text x="10%" y="20%" id="t2">Paragraph 1</text> + <text x="10%" y="24%" id="t3">Paragraph 2</text> + </g> + </g> +</svg>)HTML"); + UpdateAllLifecyclePhasesForTest(); + + constexpr FloatPoint kBelowT3(220, 250); + LayoutObject* hit_text = SVGLayoutSupport::FindClosestLayoutSVGText( + GetLayoutBoxByElementId("svg"), kBelowT3); + EXPECT_EQ("t3", To<Element>(hit_text->GetNode())->GetIdAttribute()); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/layout/svg/svg_text_chunk_builder.cc b/third_party/blink/renderer/core/layout/svg/svg_text_chunk_builder.cc index 56e7fcd..6da25717 100644 --- a/third_party/blink/renderer/core/layout/svg/svg_text_chunk_builder.cc +++ b/third_party/blink/renderer/core/layout/svg/svg_text_chunk_builder.cc
@@ -64,7 +64,8 @@ ChunkLengthAccumulator(bool is_vertical) : num_characters_(0), length_(0), is_vertical_(is_vertical) {} - typedef Vector<SVGInlineTextBox*>::const_iterator BoxListConstIterator; + typedef HeapVector<Member<SVGInlineTextBox>>::const_iterator + BoxListConstIterator; void ProcessRange(BoxListConstIterator box_start, BoxListConstIterator box_end); @@ -85,7 +86,7 @@ void ChunkLengthAccumulator::ProcessRange(BoxListConstIterator box_start, BoxListConstIterator box_end) { SVGTextFragment* last_fragment = nullptr; - for (auto* const* box_iter = box_start; box_iter != box_end; ++box_iter) { + for (auto* box_iter = box_start; box_iter != box_end; ++box_iter) { for (SVGTextFragment& fragment : (*box_iter)->TextFragments()) { num_characters_ += fragment.length; @@ -115,14 +116,14 @@ SVGTextChunkBuilder::SVGTextChunkBuilder() = default; void SVGTextChunkBuilder::ProcessTextChunks( - const Vector<SVGInlineTextBox*>& line_layout_boxes) { + const HeapVector<Member<SVGInlineTextBox>>& line_layout_boxes) { if (line_layout_boxes.IsEmpty()) return; bool found_start = false; - auto* const* box_iter = line_layout_boxes.begin(); - auto* const* end_box = line_layout_boxes.end(); - auto* const* chunk_start_box = box_iter; + auto const* box_iter = line_layout_boxes.begin(); + auto const* end_box = line_layout_boxes.end(); + auto const* chunk_start_box = box_iter; for (; box_iter != end_box; ++box_iter) { if (!(*box_iter)->StartsNewTextChunk()) continue; @@ -209,7 +210,7 @@ text_length_shift /= length_accumulator.NumCharacters() - 1; } unsigned at_character = 0; - for (auto* const* box_iter = box_start; box_iter != box_end; ++box_iter) { + for (auto* box_iter = box_start; box_iter != box_end; ++box_iter) { Vector<SVGTextFragment>& fragments = (*box_iter)->TextFragments(); if (fragments.IsEmpty()) continue; @@ -229,7 +230,7 @@ float text_length_bias = 0; bool found_first_fragment = false; - for (auto* const* box_iter = box_start; box_iter != box_end; ++box_iter) { + for (auto* box_iter = box_start; box_iter != box_end; ++box_iter) { SVGInlineTextBox* text_box = *box_iter; Vector<SVGTextFragment>& fragments = text_box->TextFragments(); if (fragments.IsEmpty()) @@ -252,7 +253,7 @@ float text_anchor_shift = CalculateTextAnchorShift(style, length_accumulator.length()); - for (auto* const* box_iter = box_start; box_iter != box_end; ++box_iter) { + for (auto* box_iter = box_start; box_iter != box_end; ++box_iter) { Vector<SVGTextFragment>& fragments = (*box_iter)->TextFragments(); if (fragments.IsEmpty()) continue;
diff --git a/third_party/blink/renderer/core/layout/svg/svg_text_chunk_builder.h b/third_party/blink/renderer/core/layout/svg/svg_text_chunk_builder.h index b2e59d9..bff56d8b 100644 --- a/third_party/blink/renderer/core/layout/svg/svg_text_chunk_builder.h +++ b/third_party/blink/renderer/core/layout/svg/svg_text_chunk_builder.h
@@ -20,6 +20,8 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SVG_SVG_TEXT_CHUNK_BUILDER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SVG_SVG_TEXT_CHUNK_BUILDER_H_ +#include "base/macros.h" +#include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/vector.h" @@ -47,10 +49,11 @@ SVGTextChunkBuilder(const SVGTextChunkBuilder&) = delete; SVGTextChunkBuilder& operator=(const SVGTextChunkBuilder&) = delete; - void ProcessTextChunks(const Vector<SVGInlineTextBox*>&); + void ProcessTextChunks(const HeapVector<Member<SVGInlineTextBox>>&); protected: - typedef Vector<SVGInlineTextBox*>::const_iterator BoxListConstIterator; + typedef HeapVector<Member<SVGInlineTextBox>>::const_iterator + BoxListConstIterator; virtual void HandleTextChunk(BoxListConstIterator box_start, BoxListConstIterator box_end);
diff --git a/third_party/blink/renderer/core/layout/svg/svg_text_layout_engine.h b/third_party/blink/renderer/core/layout/svg/svg_text_layout_engine.h index 734c71e9..b8ed8a7 100644 --- a/third_party/blink/renderer/core/layout/svg/svg_text_layout_engine.h +++ b/third_party/blink/renderer/core/layout/svg/svg_text_layout_engine.h
@@ -83,7 +83,7 @@ unsigned logical_character_offset_; unsigned logical_metrics_list_offset_; - Vector<SVGInlineTextBox*> line_layout_boxes_; + HeapVector<Member<SVGInlineTextBox>> line_layout_boxes_; SVGTextFragment current_text_fragment_; SVGInlineTextMetricsIterator visual_metrics_iterator_;
diff --git a/third_party/blink/renderer/core/layout/svg/svg_text_query.cc b/third_party/blink/renderer/core/layout/svg/svg_text_query.cc index ba2633497..a77870a 100644 --- a/third_party/blink/renderer/core/layout/svg/svg_text_query.cc +++ b/third_party/blink/renderer/core/layout/svg/svg_text_query.cc
@@ -80,8 +80,9 @@ return nullptr; } -static void CollectTextBoxesInFlowBox(InlineFlowBox* flow_box, - Vector<SVGInlineTextBox*>& text_boxes) { +static void CollectTextBoxesInFlowBox( + InlineFlowBox* flow_box, + HeapVector<Member<SVGInlineTextBox>>& text_boxes) { if (!flow_box) return; @@ -126,7 +127,7 @@ static void SpatialQuery(LayoutObject* query_root, QueryData* query_data, ProcessTextFragmentCallback fragment_callback) { - Vector<SVGInlineTextBox*> text_boxes; + HeapVector<Member<SVGInlineTextBox>> text_boxes; CollectTextBoxesInFlowBox(FlowBoxForLayoutObject(query_root), text_boxes); // Loop over all text boxes @@ -138,7 +139,7 @@ static void CollectTextBoxesInLogicalOrder( LineLayoutSVGInlineText text_line_layout, - Vector<SVGInlineTextBox*>& text_boxes) { + HeapVector<Member<SVGInlineTextBox>>& text_boxes) { text_boxes.Shrink(0); for (InlineTextBox* text_box = text_line_layout.FirstTextBox(); text_box; text_box = text_box->NextForSameLayoutObject()) @@ -157,7 +158,7 @@ // Walk the layout tree in pre-order, starting at the specified root, and // run the query for each text node. - Vector<SVGInlineTextBox*> text_boxes; + HeapVector<Member<SVGInlineTextBox>> text_boxes; for (LayoutObject* layout_object = query_root->SlowFirstChild(); layout_object; layout_object = layout_object->NextInPreOrder(query_root)) { @@ -555,7 +556,7 @@ LineLayoutSVGInlineText text_line_layout, const SVGInlineTextBox* start_text_box, unsigned fragment_offset) { - Vector<SVGInlineTextBox*> text_boxes; + HeapVector<Member<SVGInlineTextBox>> text_boxes; CollectTextBoxesInLogicalOrder(text_line_layout, text_boxes); DCHECK(start_text_box);
diff --git a/third_party/blink/renderer/core/loader/empty_clients.cc b/third_party/blink/renderer/core/loader/empty_clients.cc index 4d371442..674a5d6 100644 --- a/third_party/blink/renderer/core/loader/empty_clients.cc +++ b/third_party/blink/renderer/core/loader/empty_clients.cc
@@ -146,7 +146,9 @@ return nullptr; } -RemoteFrame* EmptyLocalFrameClient::CreateFencedFrame(HTMLFencedFrameElement*) { +RemoteFrame* EmptyLocalFrameClient::CreateFencedFrame( + HTMLFencedFrameElement*, + mojo::PendingAssociatedReceiver<mojom::blink::FencedFrameOwnerHost>) { return nullptr; }
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h index ec4dfeb..b3e7a33 100644 --- a/third_party/blink/renderer/core/loader/empty_clients.h +++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -332,7 +332,10 @@ mojo::PendingAssociatedRemote<mojom::blink::PortalClient>) override; RemoteFrame* AdoptPortal(HTMLPortalElement*) override; - RemoteFrame* CreateFencedFrame(HTMLFencedFrameElement*) override; + RemoteFrame* CreateFencedFrame( + HTMLFencedFrameElement*, + mojo::PendingAssociatedReceiver<mojom::blink::FencedFrameOwnerHost>) + override; WebPluginContainerImpl* CreatePlugin(HTMLPlugInElement&, const KURL&,
diff --git a/third_party/blink/renderer/core/paint/box_painter_base.cc b/third_party/blink/renderer/core/paint/box_painter_base.cc index 2f5093bf..06a19676 100644 --- a/third_party/blink/renderer/core/paint/box_painter_base.cc +++ b/third_party/blink/renderer/core/paint/box_painter_base.cc
@@ -882,9 +882,16 @@ } // anonymous namespace +LayoutRectOutsets BoxPainterBase::ComputeSnappedBorders() const { + const LayoutRectOutsets border_widths = ComputeBorders(); + return LayoutRectOutsets( + border_widths.Top().ToInt(), border_widths.Right().ToInt(), + border_widths.Bottom().ToInt(), border_widths.Left().ToInt()); +} + LayoutRectOutsets BoxPainterBase::AdjustedBorderOutsets( const FillLayerInfo& info) const { - return AdjustOutsetsForEdgeInclusion(ComputeBorders(), info); + return AdjustOutsetsForEdgeInclusion(ComputeSnappedBorders(), info); } void BoxPainterBase::PaintFillLayer(const PaintInfo& paint_info, @@ -931,7 +938,7 @@ } } - LayoutRectOutsets border = ComputeBorders(); + LayoutRectOutsets border = ComputeSnappedBorders(); LayoutRectOutsets padding = ComputePadding(); LayoutRectOutsets border_padding_insets = -(border + padding); FloatRoundedRect border_rect = RoundedBorderRectForClip(
diff --git a/third_party/blink/renderer/core/paint/box_painter_base.h b/third_party/blink/renderer/core/paint/box_painter_base.h index f0cf368e..ac43f64 100644 --- a/third_party/blink/renderer/core/paint/box_painter_base.h +++ b/third_party/blink/renderer/core/paint/box_painter_base.h
@@ -173,6 +173,8 @@ PhysicalBoxSides sides_to_include = PhysicalBoxSides()); private: + LayoutRectOutsets ComputeSnappedBorders() const; + const Document* document_; const ComputedStyle& style_; Node* node_;
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 1642dea..f140c90 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
@@ -60,13 +60,6 @@ namespace { -LayoutRectOutsets BoxStrutToLayoutRectOutsets( - const NGPixelSnappedPhysicalBoxStrut& box_strut) { - return LayoutRectOutsets( - LayoutUnit(box_strut.top), LayoutUnit(box_strut.right), - LayoutUnit(box_strut.bottom), LayoutUnit(box_strut.left)); -} - inline bool HasSelection(const LayoutObject* layout_object) { return layout_object->GetSelectionState() != SelectionState::kNone; } @@ -1217,13 +1210,17 @@ NGInlineCursor* children, const PaintInfo& paint_info, const PhysicalOffset& paint_offset) { - for (; *children; children->MoveToNext()) { + while (*children) { const NGFragmentItem* item = children->Current().Item(); - if (item->Type() != NGFragmentItem::kBox) - continue; - const NGPhysicalBoxFragment* fragment = item->BoxFragment(); - if (fragment && fragment->IsBlockInInline()) - PaintBoxItem(*item, *fragment, *children, paint_info, paint_offset); + if (const NGPhysicalBoxFragment* fragment = item->BoxFragment()) { + if (fragment->HasSelfPaintingLayer()) { + children->MoveToNextSkippingChildren(); + continue; + } + if (fragment->IsBlockInInline()) + PaintBoxItem(*item, *fragment, *children, paint_info, paint_offset); + } + children->MoveToNext(); } } @@ -1797,11 +1794,11 @@ LayoutRectOutsets NGBoxFragmentPainter::ComputeBorders() const { if (box_fragment_.GetLayoutObject()->IsTableCellLegacy()) return To<LayoutBox>(box_fragment_.GetLayoutObject())->BorderBoxOutsets(); - return BoxStrutToLayoutRectOutsets(PhysicalFragment().BorderWidths()); + return PhysicalFragment().Borders().ToLayoutRectOutsets(); } LayoutRectOutsets NGBoxFragmentPainter::ComputePadding() const { - return BoxStrutToLayoutRectOutsets(PhysicalFragment().PixelSnappedPadding()); + return PhysicalFragment().Padding().ToLayoutRectOutsets(); } BoxPainterBase::FillLayerInfo NGBoxFragmentPainter::GetFillLayerInfo( @@ -2167,15 +2164,19 @@ const NGInlineBackwardCursor& cursor) { DCHECK_EQ(&item, cursor.Current().Item()); - if (const NGPhysicalBoxFragment* child_fragment = item.BoxFragment()) { - const PhysicalOffset child_offset = - hit_test.inline_root_offset + item.OffsetInContainerFragment(); - return HitTestChildBoxFragment(hit_test, *child_fragment, cursor, - child_offset); + // Box fragments for SVG's inline boxes don't have correct geometries. + if (!item.GetLayoutObject()->IsSVGInline()) { + if (const NGPhysicalBoxFragment* child_fragment = item.BoxFragment()) { + const PhysicalOffset child_offset = + hit_test.inline_root_offset + item.OffsetInContainerFragment(); + return HitTestChildBoxFragment(hit_test, *child_fragment, cursor, + child_offset); + } + DCHECK( + !To<LayoutInline>(item.GetLayoutObject())->ShouldCreateBoxFragment()); } DCHECK(item.GetLayoutObject()->IsLayoutInline()); - DCHECK(!To<LayoutInline>(item.GetLayoutObject())->ShouldCreateBoxFragment()); if (NGInlineCursor descendants = cursor.CursorForDescendants()) { if (HitTestItemsChildren(hit_test, container, descendants)) return true;
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc index 9d9bfd8..cc215294 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc
@@ -222,4 +222,25 @@ EXPECT_EQ(num_all_display_items - 3, ContentDisplayItems().size()); } +TEST_P(NGBoxFragmentPainterTest, NodeAtPointWithSvgInline) { + ScopedSVGTextNGForTest enable_svg_text_ng(true); + SetBodyInnerHTML(R"HTML( +<svg xmlns="http://www.w3.org/2000/svg" width="900" height="900" + viewBox="0 0 100 100" id="svg"> + <g font-size="13"> + <text x="10%" y="25%" id="pass">Expected paragraph.</text> + <text x="10%" y="54%"> + <tspan id="fail">Should not be selected.</tspan> + </text> + </g> +</svg>)HTML"); + UpdateAllLifecyclePhasesForTest(); + + auto* root = GetDocument().getElementById("svg")->GetLayoutBox(); + HitTestResult result; + root->NodeAtPoint(result, HitTestLocation(FloatPoint(256, 192)), + PhysicalOffset(0, 0), kHitTestForeground); + EXPECT_EQ(GetDocument().getElementById("pass"), result.InnerElement()); +} + } // namespace blink
diff --git a/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.cc b/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.cc index ee82ead..ad97b85 100644 --- a/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.cc +++ b/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.cc
@@ -751,6 +751,7 @@ } Response InspectorAccessibilityAgent::getFullAXTree( + protocol::Maybe<int> depth, protocol::Maybe<int> max_depth, Maybe<String> frame_id, std::unique_ptr<protocol::Array<AXNode>>* nodes) { @@ -766,7 +767,9 @@ if (document->View()->NeedsLayout() || document->NeedsLayoutTreeUpdate()) document->UpdateStyleAndLayout(DocumentUpdateReason::kInspector); - *nodes = WalkAXNodesToDepth(document, max_depth.fromMaybe(-1)); + // Once max_depth has been removed, we should just use depth.fromMaybe(-1). + int depth_or_default(depth.fromMaybe(max_depth.fromMaybe(-1))); + *nodes = WalkAXNodesToDepth(document, depth_or_default); return Response::Success(); }
diff --git a/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.h b/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.h index 7ead61a..d57e9c70 100644 --- a/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.h +++ b/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.h
@@ -44,6 +44,7 @@ std::unique_ptr<protocol::Array<protocol::Accessibility::AXNode>>*) override; protocol::Response getFullAXTree( + protocol::Maybe<int> depth, protocol::Maybe<int> max_depth, protocol::Maybe<String> frame_id, std::unique_ptr<protocol::Array<protocol::Accessibility::AXNode>>*)
diff --git a/third_party/blink/renderer/platform/wtf/allocator/allocator.h b/third_party/blink/renderer/platform/wtf/allocator/allocator.h index 55f73c3..a777f55b 100644 --- a/third_party/blink/renderer/platform/wtf/allocator/allocator.h +++ b/third_party/blink/renderer/platform/wtf/allocator/allocator.h
@@ -7,11 +7,21 @@ #include <atomic> +#include "base/allocator/buildflags.h" #include "base/check_op.h" #include "build/build_config.h" #include "third_party/blink/renderer/platform/wtf/allocator/partitions.h" #include "third_party/blink/renderer/platform/wtf/type_traits.h" +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) +// FastMalloc() defers to malloc() in this case, and including its header +// ensures that the compiler knows that malloc() is "special", e.g. that it +// returns properly-aligned, distinct memory locations. +#include <malloc.h> +#else +#include "base/allocator/partition_allocator/partition_alloc.h" +#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + namespace WTF { namespace internal {
diff --git a/third_party/blink/renderer/platform/wtf/allocator/partitions.h b/third_party/blink/renderer/platform/wtf/allocator/partitions.h index 30345cd..a241c634 100644 --- a/third_party/blink/renderer/platform/wtf/allocator/partitions.h +++ b/third_party/blink/renderer/platform/wtf/allocator/partitions.h
@@ -77,13 +77,18 @@ static void DumpMemoryStats(bool is_light_dump, base::PartitionStatsDumper*); - static void* BufferMalloc(size_t n, const char* type_name); - static void* BufferTryRealloc(void* p, size_t n, const char* type_name); + static void* MALLOC_FN BufferMalloc(size_t n, + const char* type_name) MALLOC_ALIGNED; + static void* BufferTryRealloc(void* p, + size_t n, + const char* type_name) MALLOC_ALIGNED; static void BufferFree(void* p); static size_t BufferPotentialCapacity(size_t n); - static void* FastMalloc(size_t n, const char* type_name); - static void* FastZeroedMalloc(size_t n, const char* type_name); + static void* MALLOC_FN FastMalloc(size_t n, + const char* type_name) MALLOC_ALIGNED; + static void* MALLOC_FN FastZeroedMalloc(size_t n, + const char* type_name) MALLOC_ALIGNED; static void FastFree(void* p); static void HandleOutOfMemory(size_t size);
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 687aed7..31b908d6 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -4797,10 +4797,6 @@ crbug.com/1207342 http/tests/devtools/sources/debugger-frameworks/frameworks-steppings.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/sources/debugger-frameworks/frameworks-skip-break-program.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/sources/debugger-frameworks/frameworks-step-into-skips-setTimeout.js [ Failure Pass ] -crbug.com/1207342 http/tests/devtools/console/console-api-on-call-frame.js [ Failure Pass ] -crbug.com/1207342 http/tests/devtools/console/worker-eval-contains-stack.js [ Failure Pass ] -crbug.com/1207342 http/tests/devtools/console/nested-worker-eval-contains-stack.js [ Failure Pass ] -crbug.com/1207342 http/tests/devtools/console/console-error-on-call-frame.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/indexeddb/live-update-indexeddb-content.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/compiler-source-mapping-debug.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/network/parse-form-data.js [ Failure Pass ] @@ -5431,8 +5427,6 @@ crbug.com/1207342 http/tests/devtools/inspect-element.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/sourcemap-section-warning.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/a11y-axe-core/console/console-error-a11y-test.js [ Failure Pass ] -crbug.com/1207342 http/tests/devtools/console/console-viewport-control.js [ Failure Pass Timeout ] -crbug.com/1207342 http/tests/devtools/console/console-viewport-indices.js [ Failure Pass Timeout ] crbug.com/1207342 http/tests/devtools/console-sidebar/console-filter-sidebar.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/csp/csp-inline-warning-contains-stacktrace.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/csp/csp-setInterval-warning-contains-stacktrace.js [ Failure Pass ] @@ -5461,7 +5455,6 @@ crbug.com/1207342 http/tests/devtools/webaudio/audio-context-selector-test.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/isolated-code-cache/cross-origin-test.js [ Failure Pass ] crbug.com/1207342 http/tests/devtools/console/console-search-reveals-messages.js [ Failure Pass Timeout ] -crbug.com/1207342 http/tests/devtools/console/console-viewport-stick-to-bottom.js [ Failure Pass Timeout ] crbug.com/1207342 http/tests/devtools/elements/shadow/elements-panel-shadow-selection-on-refresh-2.js [ Failure Pass Timeout ] crbug.com/1207342 http/tests/devtools/elements/shadow/elements-panel-shadow-selection-on-refresh-3.js [ Failure Pass Timeout ] crbug.com/1207342 http/tests/devtools/elements/styles-3/styles-add-new-rule-colon.js [ Failure Pass Timeout ] @@ -7159,11 +7152,8 @@ crbug.com/1208173 [ Mac10.14 ] wpt_internal/bluetooth/requestDevice/filter-does-not-match.https.html [ Timeout ] # Fix to unblock wpt-importer -crbug.com/1209223 external/wpt/url/failure.html [ Failure ] -crbug.com/1209223 external/wpt/url/a-element-xhtml.xhtml [ Failure ] -crbug.com/1209223 [ Mac ] external/wpt/url/a-element.html [ Failure Timeout ] -crbug.com/1209223 external/wpt/url/url-constructor.any.html [ Failure ] -crbug.com/1209223 external/wpt/url/url-constructor.any.worker.html [ Failure Pass Timeout ] +crbug.com/1209223 [ Mac ] external/wpt/url/a-element.html [ Pass Timeout ] +crbug.com/1209223 external/wpt/url/url-constructor.any.worker.html [ Pass Timeout ] # Sheriff 2021-05-17 crbug.com/1193920 virtual/scroll-unification/fast/scrolling/events/overscroll-event-fired-to-scrolled-element.html [ Pass Timeout ]
diff --git a/third_party/blink/web_tests/WebDriverExpectations b/third_party/blink/web_tests/WebDriverExpectations index 3b5e5093..1e704f2d 100644 --- a/third_party/blink/web_tests/WebDriverExpectations +++ b/third_party/blink/web_tests/WebDriverExpectations
@@ -84,6 +84,25 @@ crbug.com/1167321 [ Linux ] external/wpt/webdriver/tests/find_element_from_shadow_root/find.py>>test_find_element[tag-name-a] [ Failure ] crbug.com/1167321 [ Linux ] external/wpt/webdriver/tests/find_element_from_shadow_root/find.py>>test_find_element[xpath-//a] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_accept_and_notify[capabilities0-alert-None] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_accept_and_notify[capabilities0-confirm-True] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_accept_and_notify[capabilities0-prompt-] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_accept[capabilities0-alert-None] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_accept[capabilities0-confirm-True] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_accept[capabilities0-prompt-] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_default[alert-None] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_default[confirm-False] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_default[prompt-None] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_dismiss_and_notify[capabilities0-alert-None] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_dismiss_and_notify[capabilities0-confirm-False] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_dismiss_and_notify[capabilities0-prompt-None] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_dismiss[capabilities0-alert-None] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_dismiss[capabilities0-confirm-False] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_dismiss[capabilities0-prompt-None] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_ignore[capabilities0-alert] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_ignore[capabilities0-confirm] [ Failure ] +crbug.com/1240985 [ Linux ] external/wpt/webdriver/tests/find_elements_from_shadow_root/user_prompts.py>>test_ignore[capabilities0-prompt] [ Failure ] + # ====== New tests from wpt-importer added here ====== crbug.com/626703 [ Linux ] external/wpt/webdriver/tests/print/printcmd.py>>test_large_html_document [ Failure ] crbug.com/626703 [ Linux ] external/wpt/webdriver/tests/bidi/new_session/connect.py>>test_bidi_session_with_different_capability[capabilities0] [ Failure ]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background-clip-padding-box-001.html b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background-clip-padding-box-001.html new file mode 100644 index 0000000..ed2b21b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background-clip-padding-box-001.html
@@ -0,0 +1,23 @@ +<!doctype html> +<title>background-clip: padding-box with fractional border-width</title> +<link rel="help" href="https://www.w3.org/TR/css-backgrounds-3/#the-background-clip"> +<link rel="match" href="../reference/ref-filled-green-100px-square-only.html"> +<style> +#back { + width: 100px; + background-color: red; +} +#target { + box-sizing: border-box; + width: 100px; + height: 100px; + border-top: 49.75px solid green; + border-bottom: 49.75px solid green; + background-color: green; + background-clip: padding-box; +} +</style> +<p>Test passes if there is a filled green square.</p> +<div id="back"> + <div id="target"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-typed-om/stylevalue-serialization/crashtests/cssInvertValue-zero.html b/third_party/blink/web_tests/external/wpt/css/css-typed-om/stylevalue-serialization/crashtests/cssInvertValue-zero.html new file mode 100644 index 0000000..b767cf6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-typed-om/stylevalue-serialization/crashtests/cssInvertValue-zero.html
@@ -0,0 +1,11 @@ +<!DOCTYPE html> +<link rel="help" href="https://crbug.com/1232775"> +<title>Do not crash when serializing inverted zero via CSSTransformValue</title> +<script> + const inverted = new CSSMathInvert(new CSSUnitValue(0, 'number')); + const rotate = new CSSRotate(inverted, 0, 0, CSS.deg(0)); + const transform = new CSSTransformValue([rotate]); + inverted.toString(); + rotate.toString(); + transform.toString(); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html index b10a7bf..0d1b640 100644 --- a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html +++ b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html
@@ -1,4 +1,5 @@ <!doctype html> +<meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/common/get-host-info.sub.js"></script> @@ -52,7 +53,7 @@ // anonymous iframe and work for normal iframe. promise_test(async t => { const control_token = token(); - const control_src = REMOTE_ORIGIN + executor_path + `&uuid=${control_token}`; + const control_src = ORIGIN + executor_path + `&uuid=${control_token}`; const control_popup = control_iframe.contentWindow.open(control_src); add_completion_callback(() => send(control_token, "close();")); assert_equals( @@ -61,7 +62,7 @@ const anonymous_token = token(); const anonymous_src = - REMOTE_ORIGIN + executor_path + `&uuid=${anonymous_token}`; + ORIGIN + executor_path + `&uuid=${anonymous_token}`; const anonymous_popup = anonymous_iframe.contentWindow.open(anonymous_src); add_completion_callback(() => send(anonymous_token, "close();")); assert_equals(
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-stick-to-bottom.js b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-stick-to-bottom.js index 402cea9b..901b8e0 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-stick-to-bottom.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-stick-to-bottom.js
@@ -47,12 +47,12 @@ viewport.setStickToBottom(false); viewport.element.scrollTop -= 10; var keyEvent = TestRunner.createKeyEvent('Escape'); - viewport.contentElement.dispatchEvent(keyEvent); + viewport.contentElement().dispatchEvent(keyEvent); dumpAndContinue(next); }, function testChangingPromptTextShouldRestickAtBottom(next) { - TestRunner.addSniffer(Console.ConsoleView.prototype, '_promptTextChangedForTest', onContentChanged); + TestRunner.addSniffer(Console.ConsoleView.prototype, 'promptTextChangedForTest', onContentChanged); // Since eventSender.keyDown() does not scroll prompt into view, simulate // behavior by setting a large scrollTop. consoleView.viewport.element.scrollTop = 1000000; @@ -64,12 +64,12 @@ }, function testViewportMutationsShouldPreserveStickToBottom(next) { - viewport.contentElement.lastChild.innerText = 'More than 2 lines: foo\n\nbar'; + viewport.contentElement().lastChild.innerText = 'More than 2 lines: foo\n\nbar'; dumpAndContinue(onMessagesDumped); function onMessagesDumped() { viewport.setStickToBottom(false); - viewport.contentElement.lastChild.innerText = 'More than 3 lines: foo\n\n\nbar'; + viewport.contentElement().lastChild.innerText = 'More than 3 lines: foo\n\n\nbar'; dumpAndContinue(next); } }, @@ -78,7 +78,7 @@ consoleView.updateStickToBottomOnPointerDown(); viewport.element.scrollTop -= 10; - TestRunner.addSniffer(Console.ConsoleView.prototype, '_scheduleViewportRefreshForTest', onMessageAdded); + TestRunner.addSniffer(Console.ConsoleView.prototype, 'scheduleViewportRefreshForTest', onMessageAdded); ConsoleTestRunner.evaluateInConsole('1 + 1'); /** @@ -87,8 +87,8 @@ function onMessageAdded(muted) { TestRunner.addResult('New messages were muted: ' + muted); TestRunner.addSniffer( - Console.ConsoleView.prototype, '_scheduleViewportRefreshForTest', onMouseUpScheduledRefresh); - TestRunner.addSniffer(Console.ConsoleView.prototype, '_updateViewportStickinessForTest', onUpdateStickiness); + Console.ConsoleView.prototype, 'scheduleViewportRefreshForTest', onMouseUpScheduledRefresh); + TestRunner.addSniffer(Console.ConsoleView.prototype, 'updateViewportStickinessForTest', onUpdateStickiness); consoleView.updateStickToBottomOnPointerUp(); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/nested-worker-eval-contains-stack.js b/third_party/blink/web_tests/http/tests/devtools/console/nested-worker-eval-contains-stack.js index 594c922..6d6f9ff07 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/nested-worker-eval-contains-stack.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/nested-worker-eval-contains-stack.js
@@ -9,14 +9,14 @@ } `); - TestRunner.addSniffer(SDK.RuntimeModel.prototype, '_executionContextCreated', contextCreated); + TestRunner.addSniffer(SDK.RuntimeModel.prototype, 'executionContextCreated', contextCreated); TestRunner.evaluateInPage('startWorker()'); var contexts_still_loading = 2; function contextCreated() { contexts_still_loading--; if (contexts_still_loading > 0) { - TestRunner.addSniffer(SDK.RuntimeModel.prototype, '_executionContextCreated', contextCreated); + TestRunner.addSniffer(SDK.RuntimeModel.prototype, 'executionContextCreated', contextCreated); return; }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/worker-eval-contains-stack.js b/third_party/blink/web_tests/http/tests/devtools/console/worker-eval-contains-stack.js index ec5efcf..4839edf 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/worker-eval-contains-stack.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/worker-eval-contains-stack.js
@@ -13,7 +13,7 @@ } `); - TestRunner.addSniffer(SDK.RuntimeModel.prototype, '_executionContextCreated', contextCreated); + TestRunner.addSniffer(SDK.RuntimeModel.prototype, 'executionContextCreated', contextCreated); TestRunner.evaluateInPage('startWorker()'); function contextCreated() {
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-getChildAXNodes.js b/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-getChildAXNodes.js index 04a1503..caa9e39 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-getChildAXNodes.js +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-getChildAXNodes.js
@@ -32,7 +32,7 @@ `, 'Tests Accessibility.getChildAXNodes'); await dp.Accessibility.enable(); - let {result} = await dp.Accessibility.getFullAXTree({max_depth: 2}); + let {result} = await dp.Accessibility.getFullAXTree({depth: 2}); let iframeNode; for (const node of result.nodes) { if (node.role?.value === 'Iframe') {
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-maxdepth-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-depth-expected.txt similarity index 100% rename from third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-maxdepth-expected.txt rename to third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-depth-expected.txt
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-maxdepth.js b/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-depth.js similarity index 95% rename from third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-maxdepth.js rename to third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-depth.js index c5c0dba..be0c5eb 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-maxdepth.js +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/getFullAXTree-depth.js
@@ -25,7 +25,7 @@ <div>Some text in a div, also a <a href='https://www.example.com'>link</a></div> <button>Hello Button</button> `, 'Tests Accessibility.getRootAXNode'); - const {result} = await dp.Accessibility.getFullAXTree({max_depth: 2}); + const {result} = await dp.Accessibility.getFullAXTree({depth: 2}); const nodeMap = new Map(); for (const node of result.nodes)
diff --git a/third_party/blink/web_tests/platform/linux/external/wpt/url/a-element-xhtml-expected.txt b/third_party/blink/web_tests/platform/linux/external/wpt/url/a-element-xhtml-expected.txt index 00d227d..0672b27 100644 --- a/third_party/blink/web_tests/platform/linux/external/wpt/url/a-element-xhtml-expected.txt +++ b/third_party/blink/web_tests/platform/linux/external/wpt/url/a-element-xhtml-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 659 tests; 377 PASS, 282 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 664 tests; 378 PASS, 286 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -670,5 +670,10 @@ FAIL Parsing: <http://foo.09.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code FAIL Parsing: <http://foo.0x4> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +PASS Parsing: <http://foo.09..> against <about:blank> +FAIL Parsing: <http://0999999999999999999/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +FAIL Parsing: <http://foo.0x> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +FAIL Parsing: <http://foo.0XFfFfFfFfFfFfFfFfFfAcE123> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +FAIL Parsing: <http://💩.123/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/linux/external/wpt/url/failure-expected.txt b/third_party/blink/web_tests/platform/linux/external/wpt/url/failure-expected.txt index e5fd1f4..97b370c 100644 --- a/third_party/blink/web_tests/platform/linux/external/wpt/url/failure-expected.txt +++ b/third_party/blink/web_tests/platform/linux/external/wpt/url/failure-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 611 tests; 275 PASS, 336 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 635 tests; 275 PASS, 360 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS URL's constructor's base argument: file://example:1/ should throw PASS URL's href: file://example:1/ should throw @@ -611,5 +611,29 @@ FAIL sendBeacon(): http://foo.0x4. should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw FAIL Location's href: http://foo.0x4. should throw assert_throws_js: function "() => self[0].location = test.input" did not throw FAIL window.open(): http://foo.0x4. should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://0999999999999999999/ should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://0999999999999999999/ should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://0999999999999999999/ should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://0999999999999999999/ should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://0999999999999999999/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://0999999999999999999/ should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://foo.0x should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://foo.0x should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://foo.0x should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://foo.0x should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://foo.0x should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://foo.0x should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://💩.123/ should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://💩.123/ should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://💩.123/ should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://💩.123/ should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://💩.123/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://💩.123/ should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/linux/external/wpt/url/url-constructor.any-expected.txt b/third_party/blink/web_tests/platform/linux/external/wpt/url/url-constructor.any-expected.txt index e931b952..bbe67c8 100644 --- a/third_party/blink/web_tests/platform/linux/external/wpt/url/url-constructor.any-expected.txt +++ b/third_party/blink/web_tests/platform/linux/external/wpt/url/url-constructor.any-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 661 tests; 455 PASS, 206 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 666 tests; 456 PASS, 210 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -804,5 +804,18 @@ FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_throws_js: function "function() { bURL(expected.input, expected.base) }" did not throw +PASS Parsing: <http://foo.09..> against <about:blank> +FAIL Parsing: <http://0999999999999999999/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0x> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0XFfFfFfFfFfFfFfFfFfAcE123> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://💩.123/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/linux/external/wpt/url/url-constructor.any.worker-expected.txt b/third_party/blink/web_tests/platform/linux/external/wpt/url/url-constructor.any.worker-expected.txt index e931b952..bbe67c8 100644 --- a/third_party/blink/web_tests/platform/linux/external/wpt/url/url-constructor.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/linux/external/wpt/url/url-constructor.any.worker-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 661 tests; 455 PASS, 206 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 666 tests; 456 PASS, 210 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -804,5 +804,18 @@ FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_throws_js: function "function() { bURL(expected.input, expected.base) }" did not throw +PASS Parsing: <http://foo.09..> against <about:blank> +FAIL Parsing: <http://0999999999999999999/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0x> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0XFfFfFfFfFfFfFfFfFfAcE123> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://💩.123/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac-arm11.0/external/wpt/url/a-element-expected.txt b/third_party/blink/web_tests/platform/mac-mac-arm11.0/external/wpt/url/a-element-expected.txt deleted file mode 100644 index 00d227d..0000000 --- a/third_party/blink/web_tests/platform/mac-mac-arm11.0/external/wpt/url/a-element-expected.txt +++ /dev/null
@@ -1,674 +0,0 @@ -This is a testharness.js-based test. -Found 659 tests; 377 PASS, 282 FAIL, 0 TIMEOUT, 0 NOTRUN. -PASS Loading data… -PASS Parsing: <http://example . -org> against <http://example.org/foo/bar> -PASS Parsing: <http://user:pass@foo:21/bar;par?b#c> against <http://example.org/foo/bar> -PASS Parsing: <https://test:@test> against <about:blank> -PASS Parsing: <https://:@test> against <about:blank> -FAIL Parsing: <non-special://test:@test/x> against <about:blank> assert_equals: href expected "non-special://test@test/x" but got "non-special://test:@test/x" -FAIL Parsing: <non-special://:@test/x> against <about:blank> assert_equals: href expected "non-special://test/x" but got "non-special://:@test/x" -PASS Parsing: <http:foo.com> against <http://example.org/foo/bar> -PASS Parsing: < :foo.com -> against <http://example.org/foo/bar> -PASS Parsing: < foo.com > against <http://example.org/foo/bar> -PASS Parsing: <a: foo.com> against <http://example.org/foo/bar> -PASS Parsing: <http://f:21/ b ? d # e > against <http://example.org/foo/bar> -PASS Parsing: <lolscheme:x x#x x> against <about:blank> -PASS Parsing: <http://f:/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:0/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:00000000000000/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:00000000000000000000080/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:b/c> against <http://example.org/foo/bar> -FAIL Parsing: <http://f: /c> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://f: /c" but got "http://f:%20/c" -PASS Parsing: <http://f: -/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:fifty-two/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:999999/c> against <http://example.org/foo/bar> -FAIL Parsing: <non-special://f:999999/c> against <http://example.org/foo/bar> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://f: 21 / b ? d # e > against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://f: 21 / b ? d # e " but got "http://f:%2021%20/%20b%20?%20d%20#%20e" -PASS Parsing: <> against <http://example.org/foo/bar> -PASS Parsing: < > against <http://example.org/foo/bar> -PASS Parsing: <:foo.com/> against <http://example.org/foo/bar> -PASS Parsing: <:foo.com\> against <http://example.org/foo/bar> -PASS Parsing: <:> against <http://example.org/foo/bar> -PASS Parsing: <:a> against <http://example.org/foo/bar> -PASS Parsing: <:/> against <http://example.org/foo/bar> -PASS Parsing: <:\> against <http://example.org/foo/bar> -PASS Parsing: <:#> against <http://example.org/foo/bar> -PASS Parsing: <#> against <http://example.org/foo/bar> -PASS Parsing: <#/> against <http://example.org/foo/bar> -PASS Parsing: <#\> against <http://example.org/foo/bar> -PASS Parsing: <#;?> against <http://example.org/foo/bar> -PASS Parsing: <?> against <http://example.org/foo/bar> -PASS Parsing: </> against <http://example.org/foo/bar> -PASS Parsing: <:23> against <http://example.org/foo/bar> -PASS Parsing: </:23> against <http://example.org/foo/bar> -PASS Parsing: <\x> against <http://example.org/foo/bar> -PASS Parsing: <\\x\hello> against <http://example.org/foo/bar> -PASS Parsing: <::> against <http://example.org/foo/bar> -PASS Parsing: <::23> against <http://example.org/foo/bar> -FAIL Parsing: <foo://> against <http://example.org/foo/bar> assert_equals: pathname expected "" but got "//" -PASS Parsing: <http://a:b@c:29/d> against <http://example.org/foo/bar> -PASS Parsing: <http::@c:29> against <http://example.org/foo/bar> -PASS Parsing: <http://&a:foo(b]c@d:2/> against <http://example.org/foo/bar> -PASS Parsing: <http://::@c@d:2> against <http://example.org/foo/bar> -PASS Parsing: <http://foo.com:b@d/> against <http://example.org/foo/bar> -PASS Parsing: <http://foo.com/\@> against <http://example.org/foo/bar> -PASS Parsing: <http:\\foo.com\> against <http://example.org/foo/bar> -PASS Parsing: <http:\\a\b:c\d@foo.com\> against <http://example.org/foo/bar> -PASS Parsing: <foo:/> against <http://example.org/foo/bar> -PASS Parsing: <foo:/bar.com/> against <http://example.org/foo/bar> -FAIL Parsing: <foo://///////> against <http://example.org/foo/bar> assert_equals: pathname expected "///////" but got "/////////" -FAIL Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar> assert_equals: pathname expected "///////bar.com/" but got "/////////bar.com/" -FAIL Parsing: <foo:////://///> against <http://example.org/foo/bar> assert_equals: pathname expected "//://///" but got "////://///" -PASS Parsing: <c:/foo> against <http://example.org/foo/bar> -PASS Parsing: <//foo/bar> against <http://example.org/foo/bar> -PASS Parsing: <http://foo/path;a??e#f#g> against <http://example.org/foo/bar> -PASS Parsing: <http://foo/abcd?efgh?ijkl> against <http://example.org/foo/bar> -PASS Parsing: <http://foo/abcd#foo?bar> against <http://example.org/foo/bar> -PASS Parsing: <[61:24:74]:98> against <http://example.org/foo/bar> -PASS Parsing: <http:[61:27]/:foo> against <http://example.org/foo/bar> -FAIL Parsing: <http://[1::2]:3:4> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://[1::2]:3:4" but got "http://[1::2]:3:4/" -FAIL Parsing: <http://2001::1> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://2001::1" but got "http://2001::1/" -FAIL Parsing: <http://2001::1]> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://2001::1]" but got "http://2001::1]/" -FAIL Parsing: <http://2001::1]:80> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://2001::1]:80" but got "http://2001::1]/" -PASS Parsing: <http://[2001::1]> against <http://example.org/foo/bar> -PASS Parsing: <http://[::127.0.0.1]> against <http://example.org/foo/bar> -PASS Parsing: <http://[0:0:0:0:0:0:13.1.68.3]> against <http://example.org/foo/bar> -PASS Parsing: <http://[2001::1]:80> against <http://example.org/foo/bar> -PASS Parsing: <http:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ftp:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <https:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <madeupscheme:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <file:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <file://example:1/> against <about:blank> -PASS Parsing: <file://example:test/> against <about:blank> -FAIL Parsing: <file://example%/> against <about:blank> assert_equals: failure should set href to input expected "file://example%/" but got "file://example%25/" -PASS Parsing: <file://[example]/> against <about:blank> -PASS Parsing: <ftps:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <gopher:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ws:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <wss:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <data:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <javascript:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <mailto:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <http:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ftp:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <https:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <madeupscheme:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ftps:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <gopher:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ws:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <wss:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <data:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <javascript:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <mailto:example.com/> against <http://example.org/foo/bar> -PASS Parsing: </a/b/c> against <http://example.org/foo/bar> -PASS Parsing: </a/ /c> against <http://example.org/foo/bar> -PASS Parsing: </a%2fc> against <http://example.org/foo/bar> -PASS Parsing: </a/%2f/c> against <http://example.org/foo/bar> -PASS Parsing: <#β> against <http://example.org/foo/bar> -PASS Parsing: <data:text/html,test#test> against <http://example.org/foo/bar> -PASS Parsing: <tel:1234567890> against <http://example.org/foo/bar> -FAIL Parsing: <ssh://example.com/foo/bar.git> against <http://example.org/> assert_equals: host expected "example.com" but got "" -FAIL Parsing: <file:c:\foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:/foo/bar.html" but got "file:///tmp/mock/c:/foo/bar.html" -FAIL Parsing: < File:c|////foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:////foo/bar.html" but got "file:///tmp/mock/c%7C////foo/bar.html" -FAIL Parsing: <C|/foo/bar> against <file:///tmp/mock/path> assert_equals: href expected "file:///C:/foo/bar" but got "file:///tmp/mock/C%7C/foo/bar" -FAIL Parsing: </C|\foo\bar> against <file:///tmp/mock/path> assert_equals: href expected "file:///C:/foo/bar" but got "file:///C%7C/foo/bar" -FAIL Parsing: <//C|/foo/bar> against <file:///tmp/mock/path> assert_equals: href expected "file:///C:/foo/bar" but got "file://c%7C/foo/bar" -PASS Parsing: <//server/file> against <file:///tmp/mock/path> -PASS Parsing: <\\server\file> against <file:///tmp/mock/path> -PASS Parsing: </\server/file> against <file:///tmp/mock/path> -PASS Parsing: <file:///foo/bar.txt> against <file:///tmp/mock/path> -PASS Parsing: <file:///home/me> against <file:///tmp/mock/path> -PASS Parsing: <//> against <file:///tmp/mock/path> -PASS Parsing: <///> against <file:///tmp/mock/path> -PASS Parsing: <///test> against <file:///tmp/mock/path> -PASS Parsing: <file://test> against <file:///tmp/mock/path> -FAIL Parsing: <file://localhost> against <file:///tmp/mock/path> assert_equals: href expected "file:///" but got "file://localhost/" -FAIL Parsing: <file://localhost/> against <file:///tmp/mock/path> assert_equals: href expected "file:///" but got "file://localhost/" -FAIL Parsing: <file://localhost/test> against <file:///tmp/mock/path> assert_equals: href expected "file:///test" but got "file://localhost/test" -PASS Parsing: <test> against <file:///tmp/mock/path> -PASS Parsing: <file:test> against <file:///tmp/mock/path> -PASS Parsing: <http://example.com/././foo> against <about:blank> -PASS Parsing: <http://example.com/./.foo> against <about:blank> -PASS Parsing: <http://example.com/foo/.> against <about:blank> -PASS Parsing: <http://example.com/foo/./> against <about:blank> -PASS Parsing: <http://example.com/foo/bar/..> against <about:blank> -PASS Parsing: <http://example.com/foo/bar/../> against <about:blank> -PASS Parsing: <http://example.com/foo/..bar> against <about:blank> -PASS Parsing: <http://example.com/foo/bar/../ton> against <about:blank> -PASS Parsing: <http://example.com/foo/bar/../ton/../../a> against <about:blank> -PASS Parsing: <http://example.com/foo/../../..> against <about:blank> -PASS Parsing: <http://example.com/foo/../../../ton> against <about:blank> -PASS Parsing: <http://example.com/foo/%2e> against <about:blank> -FAIL Parsing: <http://example.com/foo/%2e%2> against <about:blank> assert_equals: href expected "http://example.com/foo/%2e%2" but got "http://example.com/foo/.%2" -FAIL Parsing: <http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar> against <about:blank> assert_equals: href expected "http://example.com/%2e.bar" but got "http://example.com/..bar" -PASS Parsing: <http://example.com////../..> against <about:blank> -PASS Parsing: <http://example.com/foo/bar//../..> against <about:blank> -PASS Parsing: <http://example.com/foo/bar//..> against <about:blank> -PASS Parsing: <http://example.com/foo> against <about:blank> -PASS Parsing: <http://example.com/%20foo> against <about:blank> -PASS Parsing: <http://example.com/foo%> against <about:blank> -PASS Parsing: <http://example.com/foo%2> against <about:blank> -PASS Parsing: <http://example.com/foo%2zbar> against <about:blank> -PASS Parsing: <http://example.com/foo%2©zbar> against <about:blank> -FAIL Parsing: <http://example.com/foo%41%7a> against <about:blank> assert_equals: href expected "http://example.com/foo%41%7a" but got "http://example.com/fooAz" -PASS Parsing: <http://example.com/foo %91> against <about:blank> -FAIL Parsing: <http://example.com/foo%00%51> against <about:blank> assert_equals: href expected "http://example.com/foo%00%51" but got "http://example.com/foo%00Q" -PASS Parsing: <http://example.com/(%28:%3A%29)> against <about:blank> -PASS Parsing: <http://example.com/%3A%3a%3C%3c> against <about:blank> -PASS Parsing: <http://example.com/foo bar> against <about:blank> -PASS Parsing: <http://example.com\\foo\\bar> against <about:blank> -PASS Parsing: <http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd> against <about:blank> -PASS Parsing: <http://example.com/@asdf%40> against <about:blank> -PASS Parsing: <http://example.com/你好你好> against <about:blank> -PASS Parsing: <http://example.com/‥/foo> against <about:blank> -PASS Parsing: <http://example.com//foo> against <about:blank> -PASS Parsing: <http://example.com//foo//bar> against <about:blank> -PASS Parsing: <http://www.google.com/foo?bar=baz#> against <about:blank> -PASS Parsing: <http://www.google.com/foo?bar=baz# »> against <about:blank> -PASS Parsing: <data:test# »> against <about:blank> -PASS Parsing: <http://www.google.com> against <about:blank> -PASS Parsing: <http://192.0x00A80001> against <about:blank> -FAIL Parsing: <http://www/foo%2Ehtml> against <about:blank> assert_equals: href expected "http://www/foo%2Ehtml" but got "http://www/foo.html" -PASS Parsing: <http://www/foo/%2E/html> against <about:blank> -PASS Parsing: <http://user:pass@/> against <about:blank> -PASS Parsing: <http://%25DOMAIN:foobar@foodomain.com/> against <about:blank> -PASS Parsing: <http:\\www.google.com\foo> against <about:blank> -PASS Parsing: <http://foo:80/> against <about:blank> -PASS Parsing: <http://foo:81/> against <about:blank> -FAIL Parsing: <httpa://foo:80/> against <about:blank> assert_equals: host expected "foo:80" but got "" -PASS Parsing: <http://foo:-80/> against <about:blank> -PASS Parsing: <https://foo:443/> against <about:blank> -PASS Parsing: <https://foo:80/> against <about:blank> -PASS Parsing: <ftp://foo:21/> against <about:blank> -PASS Parsing: <ftp://foo:80/> against <about:blank> -FAIL Parsing: <gopher://foo:70/> against <about:blank> assert_equals: host expected "foo:70" but got "" -FAIL Parsing: <gopher://foo:443/> against <about:blank> assert_equals: host expected "foo:443" but got "" -PASS Parsing: <ws://foo:80/> against <about:blank> -PASS Parsing: <ws://foo:81/> against <about:blank> -PASS Parsing: <ws://foo:443/> against <about:blank> -PASS Parsing: <ws://foo:815/> against <about:blank> -PASS Parsing: <wss://foo:80/> against <about:blank> -PASS Parsing: <wss://foo:81/> against <about:blank> -PASS Parsing: <wss://foo:443/> against <about:blank> -PASS Parsing: <wss://foo:815/> against <about:blank> -PASS Parsing: <http:/example.com/> against <about:blank> -PASS Parsing: <ftp:/example.com/> against <about:blank> -PASS Parsing: <https:/example.com/> against <about:blank> -PASS Parsing: <madeupscheme:/example.com/> against <about:blank> -PASS Parsing: <file:/example.com/> against <about:blank> -PASS Parsing: <ftps:/example.com/> against <about:blank> -PASS Parsing: <gopher:/example.com/> against <about:blank> -PASS Parsing: <ws:/example.com/> against <about:blank> -PASS Parsing: <wss:/example.com/> against <about:blank> -PASS Parsing: <data:/example.com/> against <about:blank> -PASS Parsing: <javascript:/example.com/> against <about:blank> -PASS Parsing: <mailto:/example.com/> against <about:blank> -PASS Parsing: <http:example.com/> against <about:blank> -PASS Parsing: <ftp:example.com/> against <about:blank> -PASS Parsing: <https:example.com/> against <about:blank> -PASS Parsing: <madeupscheme:example.com/> against <about:blank> -PASS Parsing: <ftps:example.com/> against <about:blank> -PASS Parsing: <gopher:example.com/> against <about:blank> -PASS Parsing: <ws:example.com/> against <about:blank> -PASS Parsing: <wss:example.com/> against <about:blank> -PASS Parsing: <data:example.com/> against <about:blank> -PASS Parsing: <javascript:example.com/> against <about:blank> -PASS Parsing: <mailto:example.com/> against <about:blank> -PASS Parsing: <http:@www.example.com> against <about:blank> -PASS Parsing: <http:/@www.example.com> against <about:blank> -PASS Parsing: <http://@www.example.com> against <about:blank> -PASS Parsing: <http:a:b@www.example.com> against <about:blank> -PASS Parsing: <http:/a:b@www.example.com> against <about:blank> -PASS Parsing: <http://a:b@www.example.com> against <about:blank> -PASS Parsing: <http://@pple.com> against <about:blank> -PASS Parsing: <http::b@www.example.com> against <about:blank> -PASS Parsing: <http:/:b@www.example.com> against <about:blank> -PASS Parsing: <http://:b@www.example.com> against <about:blank> -FAIL Parsing: <http:/:@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:/:@/www.example.com" but got "http:///www.example.com" -PASS Parsing: <http://user@/www.example.com> against <about:blank> -FAIL Parsing: <http:@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:@/www.example.com" but got "http:///www.example.com" -FAIL Parsing: <http:/@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:/@/www.example.com" but got "http:///www.example.com" -FAIL Parsing: <http://@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http://@/www.example.com" but got "http:///www.example.com" -FAIL Parsing: <https:@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "https:@/www.example.com" but got "https:///www.example.com" -FAIL Parsing: <http:a:b@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:a:b@/www.example.com" but got "http://a:b@/www.example.com" -FAIL Parsing: <http:/a:b@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:/a:b@/www.example.com" but got "http://a:b@/www.example.com" -PASS Parsing: <http://a:b@/www.example.com> against <about:blank> -FAIL Parsing: <http::@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http::@/www.example.com" but got "http:///www.example.com" -PASS Parsing: <http:a:@www.example.com> against <about:blank> -PASS Parsing: <http:/a:@www.example.com> against <about:blank> -PASS Parsing: <http://a:@www.example.com> against <about:blank> -PASS Parsing: <http://www.@pple.com> against <about:blank> -FAIL Parsing: <http:@:www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:@:www.example.com" but got "http://:www.example.com/" -FAIL Parsing: <http:/@:www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:/@:www.example.com" but got "http://:www.example.com/" -FAIL Parsing: <http://@:www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http://@:www.example.com" but got "http://:www.example.com/" -PASS Parsing: <http://:@www.example.com> against <about:blank> -PASS Parsing: </> against <http://www.example.com/test> -PASS Parsing: </test.txt> against <http://www.example.com/test> -PASS Parsing: <.> against <http://www.example.com/test> -PASS Parsing: <..> against <http://www.example.com/test> -PASS Parsing: <test.txt> against <http://www.example.com/test> -PASS Parsing: <./test.txt> against <http://www.example.com/test> -PASS Parsing: <../test.txt> against <http://www.example.com/test> -PASS Parsing: <../aaa/test.txt> against <http://www.example.com/test> -PASS Parsing: <../../test.txt> against <http://www.example.com/test> -PASS Parsing: <中/test.txt> against <http://www.example.com/test> -PASS Parsing: <http://www.example2.com> against <http://www.example.com/test> -PASS Parsing: <//www.example2.com> against <http://www.example.com/test> -PASS Parsing: <file:...> against <http://www.example.com/test> -PASS Parsing: <file:..> against <http://www.example.com/test> -PASS Parsing: <file:a> against <http://www.example.com/test> -PASS Parsing: <http://ExAmPlE.CoM> against <http://other.com/> -FAIL Parsing: <http://example example.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://Goo%20 goo%7C|.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://[]> against <http://other.com/> assert_equals: failure should set href to input expected "http://[]" but got "http://[]/" -FAIL Parsing: <http://[:]> against <http://other.com/> assert_equals: failure should set href to input expected "http://[:]" but got "http://[:]/" -FAIL Parsing: <http://GOO goo.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <http://GOOgoo.com> against <http://other.com/> -PASS Parsing: <\0 http://example.com/ \r > against <about:blank> -PASS Parsing: <http://www.foo。bar.com> against <http://other.com/> -FAIL Parsing: <http://zyx.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://zyx.com" but got "http://%EF%BF%BDzyx.com/" -FAIL Parsing: <http://%ef%b7%90zyx.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://%ef%b7%90zyx.com" but got "http://%EF%BF%BDzyx.com/" -FAIL Parsing: <https://�> against <about:blank> assert_equals: failure should set href to input expected "https://\ufffd" but got "https://%EF%BF%BD/" -FAIL Parsing: <https://%EF%BF%BD> against <about:blank> assert_equals: failure should set href to input expected "https://%EF%BF%BD" but got "https://%EF%BF%BD/" -PASS Parsing: <https://x/�?�#�> against <about:blank> -FAIL Parsing: <http://a.b.c.xn--pokxncvks> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://10.0.0.xn--pokxncvks> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <http://Go.com> against <http://other.com/> -FAIL Parsing: <http://%41.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://%ef%bc%85%ef%bc%94%ef%bc%91.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://%00.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://%00.com" but got "http://%00.com/" -FAIL Parsing: <http://%ef%bc%85%ef%bc%90%ef%bc%90.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://%ef%bc%85%ef%bc%90%ef%bc%90.com" but got "http://%00.com/" -PASS Parsing: <http://你好你好> against <http://other.com/> -FAIL Parsing: <https://faß.ExAmPlE/> against <about:blank> assert_equals: href expected "https://xn--fa-hia.example/" but got "https://fass.example/" -FAIL Parsing: <sc://faß.ExAmPlE/> against <about:blank> assert_equals: host expected "fa%C3%9F.ExAmPlE" but got "" -FAIL Parsing: <http://%zz%66%a.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://%zz%66%a.com" but got "http://%25zzf%25a.com/" -FAIL Parsing: <http://%25> against <http://other.com/> assert_equals: failure should set href to input expected "http://%25" but got "http://%25/" -FAIL Parsing: <http://hello%00> against <http://other.com/> assert_equals: failure should set href to input expected "http://hello%00" but got "http://hello%00/" -PASS Parsing: <http://%30%78%63%30%2e%30%32%35%30.01> against <http://other.com/> -PASS Parsing: <http://%30%78%63%30%2e%30%32%35%30.01%2e> against <http://other.com/> -FAIL Parsing: <http://192.168.0.257> against <http://other.com/> assert_equals: failure should set href to input expected "http://192.168.0.257" but got "http://192.168.0.257/" -FAIL Parsing: <http://%3g%78%63%30%2e%30%32%35%30%2E.01> against <http://other.com/> assert_equals: failure should set href to input expected "http://%3g%78%63%30%2e%30%32%35%30%2E.01" but got "http://%253gxc0.0250..01/" -FAIL Parsing: <http://192.168.0.1 hello> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <https://x x:12> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <http://0Xc0.0250.01> against <http://other.com/> -PASS Parsing: <http://./> against <about:blank> -PASS Parsing: <http://../> against <about:blank> -PASS Parsing: <http://[www.google.com]/> against <about:blank> -FAIL Parsing: <http://[google.com]> against <http://other.com/> assert_equals: failure should set href to input expected "http://[google.com]" but got "http://[google.com]/" -FAIL Parsing: <http://[::1.2.3.4x]> against <http://other.com/> assert_equals: failure should set href to input expected "http://[::1.2.3.4x]" but got "http://[::1.2.3.4x]/" -FAIL Parsing: <http://[::1.2.3.]> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://[::1.2.]> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://[::1.]> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <http://foo:💩@example.com/bar> against <http://other.com/> -PASS Parsing: <#> against <test:test> -PASS Parsing: <#x> against <mailto:x@x.com> -FAIL Parsing: <#x> against <data:,> assert_equals: href expected "data:,#x" but got "mailto:x@x.com#x" -PASS Parsing: <#x> against <about:blank> -PASS Parsing: <#> against <test:test?test> -PASS Parsing: <https://@test@test@example:800/> against <http://doesnotmatter/> -PASS Parsing: <https://@@@example> against <http://doesnotmatter/> -PASS Parsing: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> -PASS Parsing: <http://host/?'> against <about:blank> -FAIL Parsing: <notspecial://host/?'> against <about:blank> assert_equals: href expected "notspecial://host/?'" but got "notspecial://host/?%27" -PASS Parsing: </some/path> against <http://user@example.org/smth> -PASS Parsing: <> against <http://user:pass@example.org:21/smth> -PASS Parsing: </some/path> against <http://user:pass@example.org:21/smth> -FAIL Parsing: <i> against <sc:sd> assert_equals: failure should set href to input expected "i" but got "" -FAIL Parsing: <i> against <sc:sd/sd> assert_equals: failure should set href to input expected "i" but got "" -PASS Parsing: <i> against <sc:/pa/pa> -FAIL Parsing: <i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/i" but got "///pa/i" -FAIL Parsing: <../i> against <sc:sd> assert_equals: failure should set href to input expected "../i" but got "" -FAIL Parsing: <../i> against <sc:sd/sd> assert_equals: failure should set href to input expected "../i" but got "" -PASS Parsing: <../i> against <sc:/pa/pa> -FAIL Parsing: <../i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:///pa/i" -FAIL Parsing: </i> against <sc:sd> assert_equals: failure should set href to input expected "/i" but got "" -FAIL Parsing: </i> against <sc:sd/sd> assert_equals: failure should set href to input expected "/i" but got "" -PASS Parsing: </i> against <sc:/pa/pa> -FAIL Parsing: </i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: </i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:///pa/i" -FAIL Parsing: <?i> against <sc:sd> assert_equals: failure should set href to input expected "?i" but got "" -FAIL Parsing: <?i> against <sc:sd/sd> assert_equals: failure should set href to input expected "?i" but got "" -PASS Parsing: <?i> against <sc:/pa/pa> -FAIL Parsing: <?i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa" -PASS Parsing: <#i> against <sc:sd> -PASS Parsing: <#i> against <sc:sd/sd> -PASS Parsing: <#i> against <sc:/pa/pa> -FAIL Parsing: <#i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa" -FAIL Parsing: <about:/../> against <about:blank> assert_equals: href expected "about:/" but got "about:/../" -FAIL Parsing: <data:/../> against <about:blank> assert_equals: href expected "data:/" but got "data:/../" -FAIL Parsing: <javascript:/../> against <about:blank> assert_equals: href expected "javascript:/" but got "javascript:/../" -FAIL Parsing: <mailto:/../> against <about:blank> assert_equals: href expected "mailto:/" but got "mailto:/../" -FAIL Parsing: <sc://ñ.test/> against <about:blank> assert_equals: host expected "%C3%B1.test" but got "" -FAIL Parsing: <sc://\0/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc:// /> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://%/> against <about:blank> assert_equals: host expected "%" but got "" -FAIL Parsing: <sc://@/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://te@s:t@/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://:/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://:12/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://[/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://\/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://]/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <x> against <sc://ñ> assert_equals: href expected "sc://%C3%B1/x" but got "sc://%C3%B1" -PASS Parsing: <sc:\../> against <about:blank> -PASS Parsing: <sc::a@example.net> against <about:blank> -PASS Parsing: <wow:%NBD> against <about:blank> -PASS Parsing: <wow:%1G> against <about:blank> -FAIL Parsing: <wow:> against <about:blank> assert_equals: href expected "wow:%EF%BF%BF" but got "wow:%EF%BF%BD" -FAIL Parsing: <http://example.com/U+d800U+dfff﷏ﷰ?U+d800U+dfff﷏ﷰ> against <about:blank> assert_equals: href expected "http://example.com/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF" but got "http://example.com/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%BF%BD%EF%B7%8F%EF%BF%BD%EF%B7%B0%EF%BF%BD%EF%BF%BD?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%BF%BD%EF%B7%8F%EF%BF%BD%EF%B7%B0%EF%BF%BD%EF%BF%BD" -FAIL Parsing: <http://a<b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://a>b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://a^b> against <about:blank> assert_equals: failure should set href to input expected "http://a^b" but got "http://a%5Eb/" -FAIL Parsing: <non-special://a<b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <non-special://a>b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <non-special://a^b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <foo://ho\0st/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <foo://ho|st/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <foo://ho st/> against <about:blank> assert_equals: host expected "host" but got "" -FAIL Parsing: <foo://ho -st/> against <about:blank> assert_equals: host expected "host" but got "" -FAIL Parsing: <foo://ho\rst/> against <about:blank> assert_equals: host expected "host" but got "" -PASS Parsing: <http://ho%00st/> against <about:blank> -PASS Parsing: <http://ho%09st/> against <about:blank> -PASS Parsing: <http://ho%0Ast/> against <about:blank> -PASS Parsing: <http://ho%0Dst/> against <about:blank> -FAIL Parsing: <http://ho%20st/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://ho%23st/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <http://ho%2Fst/> against <about:blank> -FAIL Parsing: <http://ho%3Ast/> against <about:blank> assert_equals: failure should set href to input expected "http://ho%3Ast/" but got "http://ho:st/" -FAIL Parsing: <http://ho%3Cst/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://ho%3Est/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <http://ho%3Fst/> against <about:blank> -FAIL Parsing: <http://ho%40st/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://ho%5Bst/> against <about:blank> assert_equals: failure should set href to input expected "http://ho%5Bst/" but got "http://ho[st/" -PASS Parsing: <http://ho%5Cst/> against <about:blank> -FAIL Parsing: <http://ho%5Dst/> against <about:blank> assert_equals: failure should set href to input expected "http://ho%5Dst/" but got "http://ho]st/" -FAIL Parsing: <http://ho%7Cst/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://!"$&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: href expected "http://\x1f!\"$&'()*+,-.;=_`{}~/" but got "http://%1F%21%22%24%26%27%28%29%2A+%2C-.%3B%3D_%60%7B%7D%7E/" -FAIL Parsing: <sc://!"$&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: host expected "%1F!\"$&'()*+,-.;=_`{}~" but got "" -FAIL Parsing: <ftp://example.com%80/> against <about:blank> assert_equals: failure should set href to input expected "ftp://example.com%80/" but got "ftp://example.com%EF%BF%BD/" -FAIL Parsing: <ftp://example.com%A0/> against <about:blank> assert_equals: failure should set href to input expected "ftp://example.com%A0/" but got "ftp://example.com%EF%BF%BD/" -FAIL Parsing: <https://example.com%80/> against <about:blank> assert_equals: failure should set href to input expected "https://example.com%80/" but got "https://example.com%EF%BF%BD/" -FAIL Parsing: <https://example.com%A0/> against <about:blank> assert_equals: failure should set href to input expected "https://example.com%A0/" but got "https://example.com%EF%BF%BD/" -PASS Parsing: <ftp://%e2%98%83> against <about:blank> -PASS Parsing: <https://%e2%98%83> against <about:blank> -PASS Parsing: <http://127.0.0.1:10100/relative_import.html> against <about:blank> -PASS Parsing: <http://facebook.com/?foo=%7B%22abc%22> against <about:blank> -PASS Parsing: <https://localhost:3000/jqueryui@1.2.3> against <about:blank> -PASS Parsing: <h t -t\rp://h o -s\rt:9 0 -0\r0/p a -t\rh?q u -e\rry#f r -a\rg> against <about:blank> -PASS Parsing: <?a=b&c=d> against <http://example.org/foo/bar> -PASS Parsing: <??a=b&c=d> against <http://example.org/foo/bar> -PASS Parsing: <http:> against <http://example.org/foo/bar> -PASS Parsing: <http:> against <https://example.org/foo/bar> -PASS Parsing: <sc:> against <https://example.org/foo/bar> -PASS Parsing: <http://foo.bar/baz?qux#foobar> against <about:blank> -PASS Parsing: <http://foo.bar/baz?qux#foo"bar> against <about:blank> -PASS Parsing: <http://foo.bar/baz?qux#foo<bar> against <about:blank> -PASS Parsing: <http://foo.bar/baz?qux#foo>bar> against <about:blank> -PASS Parsing: <http://foo.bar/baz?qux#foo`bar> against <about:blank> -PASS Parsing: <http://1.2.3.4/> against <http://other.com/> -PASS Parsing: <http://1.2.3.4./> against <http://other.com/> -PASS Parsing: <http://192.168.257> against <http://other.com/> -PASS Parsing: <http://192.168.257.> against <http://other.com/> -PASS Parsing: <http://192.168.257.com> against <http://other.com/> -PASS Parsing: <http://256> against <http://other.com/> -PASS Parsing: <http://256.com> against <http://other.com/> -PASS Parsing: <http://999999999> against <http://other.com/> -PASS Parsing: <http://999999999.> against <http://other.com/> -PASS Parsing: <http://999999999.com> against <http://other.com/> -FAIL Parsing: <http://10000000000> against <http://other.com/> assert_equals: failure should set href to input expected "http://10000000000" but got "http://10000000000/" -PASS Parsing: <http://10000000000.com> against <http://other.com/> -PASS Parsing: <http://4294967295> against <http://other.com/> -FAIL Parsing: <http://4294967296> against <http://other.com/> assert_equals: failure should set href to input expected "http://4294967296" but got "http://4294967296/" -PASS Parsing: <http://0xffffffff> against <http://other.com/> -FAIL Parsing: <http://0xffffffff1> against <http://other.com/> assert_equals: failure should set href to input expected "http://0xffffffff1" but got "http://0xffffffff1/" -FAIL Parsing: <http://256.256.256.256> against <http://other.com/> assert_equals: failure should set href to input expected "http://256.256.256.256" but got "http://256.256.256.256/" -PASS Parsing: <https://0x.0x.0> against <about:blank> -PASS Parsing: <https://0x100000000/test> against <about:blank> -PASS Parsing: <https://256.0.0.1/test> against <about:blank> -PASS Parsing: <file:///C%3A/> against <about:blank> -PASS Parsing: <file:///C%7C/> against <about:blank> -FAIL Parsing: <file://%43%3A> against <about:blank> assert_equals: failure should set href to input expected "file://%43%3A" but got "file://c:/" -FAIL Parsing: <file://%43%7C> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <file://%43|> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <file://C%7C> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <file://%43%7C/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <https://%43%7C/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <asdf://%43|/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <asdf://%43%7C/> against <about:blank> assert_equals: host expected "%43%7C" but got "" -PASS Parsing: <pix/submit.gif> against <file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html> -FAIL Parsing: <..> against <file:///C:/> assert_equals: href expected "file:///C:/" but got "file:///" -PASS Parsing: <..> against <file:///> -FAIL Parsing: </> against <file:///C:/a/b> assert_equals: href expected "file:///C:/" but got "file:///" -FAIL Parsing: </> against <file://h/C:/a/b> assert_equals: href expected "file://h/C:/" but got "file:///" -FAIL Parsing: </> against <file://h/a/b> assert_equals: href expected "file://h/" but got "file:///" -FAIL Parsing: <//d:> against <file:///C:/a/b> assert_equals: href expected "file:///d:" but got "file://d:/" -FAIL Parsing: <//d:/..> against <file:///C:/a/b> assert_equals: href expected "file:///d:/" but got "file://d:/" -PASS Parsing: <..> against <file:///ab:/> -PASS Parsing: <..> against <file:///1:/> -PASS Parsing: <> against <file:///test?test#test> -PASS Parsing: <file:> against <file:///test?test#test> -PASS Parsing: <?x> against <file:///test?test#test> -PASS Parsing: <file:?x> against <file:///test?test#test> -PASS Parsing: <#x> against <file:///test?test#test> -PASS Parsing: <file:#x> against <file:///test?test#test> -FAIL Parsing: <file:\\//> against <about:blank> assert_equals: href expected "file:////" but got "file:///" -FAIL Parsing: <file:\\\\> against <about:blank> assert_equals: href expected "file:////" but got "file:///" -FAIL Parsing: <file:\\\\?fox> against <about:blank> assert_equals: href expected "file:////?fox" but got "file:///?fox" -FAIL Parsing: <file:\\\\#guppy> against <about:blank> assert_equals: href expected "file:////#guppy" but got "file:///#guppy" -PASS Parsing: <file://spider///> against <about:blank> -FAIL Parsing: <file:\\localhost//> against <about:blank> assert_equals: href expected "file:////" but got "file://localhost//" -PASS Parsing: <file:///localhost//cat> against <about:blank> -FAIL Parsing: <file://\/localhost//cat> against <about:blank> assert_equals: href expected "file:////localhost//cat" but got "file:///localhost//cat" -FAIL Parsing: <file://localhost//a//../..//> against <about:blank> assert_equals: href expected "file://///" but got "file://localhost///" -FAIL Parsing: </////mouse> against <file:///elephant> assert_equals: href expected "file://///mouse" but got "file:///mouse" -PASS Parsing: <\//pig> against <file://lion/> -FAIL Parsing: <\/localhost//pig> against <file://lion/> assert_equals: href expected "file:////pig" but got "file://localhost//pig" -FAIL Parsing: <//localhost//pig> against <file://lion/> assert_equals: href expected "file:////pig" but got "file://localhost//pig" -PASS Parsing: </..//localhost//pig> against <file://lion/> -PASS Parsing: <file://> against <file://ape/> -PASS Parsing: </rooibos> against <file://tea/> -PASS Parsing: </?chai> against <file://tea/> -FAIL Parsing: <C|> against <file://host/dir/file> assert_equals: href expected "file://host/C:" but got "file://host/dir/C%7C" -FAIL Parsing: <C|> against <file://host/D:/dir1/dir2/file> assert_equals: href expected "file://host/C:" but got "file://host/D:/dir1/dir2/C%7C" -FAIL Parsing: <C|#> against <file://host/dir/file> assert_equals: href expected "file://host/C:#" but got "file://host/dir/C%7C#" -FAIL Parsing: <C|?> against <file://host/dir/file> assert_equals: href expected "file://host/C:?" but got "file://host/dir/C%7C?" -FAIL Parsing: <C|/> against <file://host/dir/file> assert_equals: href expected "file://host/C:/" but got "file://host/dir/C%7C/" -FAIL Parsing: <C| -/> against <file://host/dir/file> assert_equals: href expected "file://host/C:/" but got "file://host/dir/C%7C/" -FAIL Parsing: <C|\> against <file://host/dir/file> assert_equals: href expected "file://host/C:/" but got "file://host/dir/C%7C/" -PASS Parsing: <C> against <file://host/dir/file> -FAIL Parsing: <C|a> against <file://host/dir/file> assert_equals: href expected "file://host/dir/C|a" but got "file://host/dir/C%7Ca" -PASS Parsing: </c:/foo/bar> against <file:///c:/baz/qux> -FAIL Parsing: </c|/foo/bar> against <file:///c:/baz/qux> assert_equals: href expected "file:///c:/foo/bar" but got "file:///c%7C/foo/bar" -PASS Parsing: <file:\c:\foo\bar> against <file:///c:/baz/qux> -PASS Parsing: </c:/foo/bar> against <file://host/path> -PASS Parsing: <file://example.net/C:/> against <about:blank> -PASS Parsing: <file://1.2.3.4/C:/> against <about:blank> -PASS Parsing: <file://[1::8]/C:/> against <about:blank> -FAIL Parsing: <C|/> against <file://host/> assert_equals: href expected "file://host/C:/" but got "file://host/C%7C/" -PASS Parsing: </C:/> against <file://host/> -PASS Parsing: <file:C:/> against <file://host/> -PASS Parsing: <file:/C:/> against <file://host/> -FAIL Parsing: <//C:/> against <file://host/> assert_equals: href expected "file:///C:/" but got "file://c:/" -FAIL Parsing: <file://C:/> against <file://host/> assert_equals: href expected "file:///C:/" but got "file://c:/" -PASS Parsing: <///C:/> against <file://host/> -PASS Parsing: <file:///C:/> against <file://host/> -FAIL Parsing: <file:/C|/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file:///C%7C/" -FAIL Parsing: <file://C|/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://c%7C/" -PASS Parsing: <file:> against <about:blank> -PASS Parsing: <file:?q=v> against <about:blank> -PASS Parsing: <file:#frag> against <about:blank> -PASS Parsing: <file:///Y:> against <about:blank> -PASS Parsing: <file:///Y:/> against <about:blank> -PASS Parsing: <file:///./Y> against <about:blank> -PASS Parsing: <file:///./Y:> against <about:blank> -FAIL Parsing: <\\\.\Y:> against <about:blank> assert_equals: failure should set href to input expected "\\\\\\.\\Y:" but got "" -PASS Parsing: <file:///y:> against <about:blank> -PASS Parsing: <file:///y:/> against <about:blank> -PASS Parsing: <file:///./y> against <about:blank> -PASS Parsing: <file:///./y:> against <about:blank> -FAIL Parsing: <\\\.\y:> against <about:blank> assert_equals: failure should set href to input expected "\\\\\\.\\y:" but got "" -FAIL Parsing: <file://localhost//a//../..//foo> against <about:blank> assert_equals: href expected "file://///foo" but got "file://localhost///foo" -FAIL Parsing: <file://localhost////foo> against <about:blank> assert_equals: href expected "file://////foo" but got "file://localhost////foo" -FAIL Parsing: <file:////foo> against <about:blank> assert_equals: href expected "file:////foo" but got "file:///foo" -PASS Parsing: <file:///one/two> against <file:///> -FAIL Parsing: <file:////one/two> against <file:///> assert_equals: href expected "file:////one/two" but got "file:///one/two" -PASS Parsing: <//one/two> against <file:///> -PASS Parsing: <///one/two> against <file:///> -FAIL Parsing: <////one/two> against <file:///> assert_equals: href expected "file:////one/two" but got "file:///one/two" -PASS Parsing: <file:///.//> against <file:////> -PASS Parsing: <file:.//p> against <about:blank> -PASS Parsing: <file:/.//p> against <about:blank> -PASS Parsing: <http://[1:0::]> against <http://example.net/> -FAIL Parsing: <http://[0:1:2:3:4:5:6:7:8]> against <http://example.net/> assert_equals: failure should set href to input expected "http://[0:1:2:3:4:5:6:7:8]" but got "http://[0:1:2:3:4:5:6:7:8]/" -FAIL Parsing: <https://[0::0::0]> against <about:blank> assert_equals: failure should set href to input expected "https://[0::0::0]" but got "https://[0::0::0]/" -FAIL Parsing: <https://[0:.0]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:.0]" but got "https://[0:.0]/" -FAIL Parsing: <https://[0:0:]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:0:]" but got "https://[0:0:]/" -FAIL Parsing: <https://[0:1:2:3:4:5:6:7.0.0.0.1]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:1:2:3:4:5:6:7.0.0.0.1]" but got "https://[0:1:2:3:4:5:6:7.0.0.0.1]/" -FAIL Parsing: <https://[0:1.00.0.0.0]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:1.00.0.0.0]" but got "https://[0:1.00.0.0.0]/" -FAIL Parsing: <https://[0:1.290.0.0.0]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:1.290.0.0.0]" but got "https://[0:1.290.0.0.0]/" -FAIL Parsing: <https://[0:1.23.23]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:1.23.23]" but got "https://[0:1.23.23]/" -FAIL Parsing: <http://?> against <about:blank> assert_equals: failure should set href to input expected "http://?" but got "http:/?" -FAIL Parsing: <http://#> against <about:blank> assert_equals: failure should set href to input expected "http://#" but got "http:/#" -PASS Parsing: <http://f:4294967377/c> against <http://example.org/> -PASS Parsing: <http://f:18446744073709551697/c> against <http://example.org/> -PASS Parsing: <http://f:340282366920938463463374607431768211537/c> against <http://example.org/> -FAIL Parsing: <sc://ñ> against <about:blank> assert_equals: host expected "%C3%B1" but got "" -FAIL Parsing: <sc://ñ?x> against <about:blank> assert_equals: host expected "%C3%B1" but got "" -FAIL Parsing: <sc://ñ#x> against <about:blank> assert_equals: host expected "%C3%B1" but got "" -FAIL Parsing: <#x> against <sc://ñ> assert_equals: href expected "sc://%C3%B1#x" but got "sc://%C3%B1" -FAIL Parsing: <?x> against <sc://ñ> assert_equals: href expected "sc://%C3%B1?x" but got "sc://%C3%B1" -FAIL Parsing: <sc://?> against <about:blank> assert_equals: pathname expected "" but got "//" -FAIL Parsing: <sc://#> against <about:blank> assert_equals: pathname expected "" but got "//" -FAIL Parsing: <///> against <sc://x/> assert_equals: href expected "sc:///" but got "sc:" -FAIL Parsing: <////> against <sc://x/> assert_equals: href expected "sc:////" but got "sc:" -FAIL Parsing: <////x/> against <sc://x/> assert_equals: href expected "sc:////x/" but got "sc://x/" -FAIL Parsing: <tftp://foobar.com/someconfig;mode=netascii> against <about:blank> assert_equals: host expected "foobar.com" but got "" -FAIL Parsing: <telnet://user:pass@foobar.com:23/> against <about:blank> assert_equals: username expected "user" but got "" -FAIL Parsing: <ut2004://10.10.10.10:7777/Index.ut2> against <about:blank> assert_equals: host expected "10.10.10.10:7777" but got "" -FAIL Parsing: <redis://foo:bar@somehost:6379/0?baz=bam&qux=baz> against <about:blank> assert_equals: username expected "foo" but got "" -FAIL Parsing: <rsync://foo@host:911/sup> against <about:blank> assert_equals: username expected "foo" but got "" -FAIL Parsing: <git://github.com/foo/bar.git> against <about:blank> assert_equals: host expected "github.com" but got "" -FAIL Parsing: <irc://myserver.com:6999/channel?passwd> against <about:blank> assert_equals: host expected "myserver.com:6999" but got "" -FAIL Parsing: <dns://fw.example.org:9999/foo.bar.org?type=TXT> against <about:blank> assert_equals: host expected "fw.example.org:9999" but got "" -FAIL Parsing: <ldap://localhost:389/ou=People,o=JNDITutorial> against <about:blank> assert_equals: host expected "localhost:389" but got "" -FAIL Parsing: <git+https://github.com/foo/bar> against <about:blank> assert_equals: host expected "github.com" but got "" -PASS Parsing: <urn:ietf:rfc:2648> against <about:blank> -PASS Parsing: <tag:joe@example.org,2001:foo/bar> against <about:blank> -FAIL Parsing: <non-spec:/.//> against <about:blank> assert_equals: pathname expected "//" but got "/.//" -FAIL Parsing: <non-spec:/..//> against <about:blank> assert_equals: href expected "non-spec:/.//" but got "non-spec:/..//" -FAIL Parsing: <non-spec:/a/..//> against <about:blank> assert_equals: href expected "non-spec:/.//" but got "non-spec:/a/..//" -FAIL Parsing: <non-spec:/.//path> against <about:blank> assert_equals: pathname expected "//path" but got "/.//path" -FAIL Parsing: <non-spec:/..//path> against <about:blank> assert_equals: href expected "non-spec:/.//path" but got "non-spec:/..//path" -FAIL Parsing: <non-spec:/a/..//path> against <about:blank> assert_equals: href expected "non-spec:/.//path" but got "non-spec:/a/..//path" -FAIL Parsing: </.//path> against <non-spec:/p> assert_equals: href expected "non-spec:/.//path" but got "non-spec://path" -FAIL Parsing: </..//path> against <non-spec:/p> assert_equals: href expected "non-spec:/.//path" but got "non-spec://path" -FAIL Parsing: <..//path> against <non-spec:/p> assert_equals: href expected "non-spec:/.//path" but got "non-spec://path" -FAIL Parsing: <a/..//path> against <non-spec:/p> assert_equals: href expected "non-spec:/.//path" but got "non-spec://path" -FAIL Parsing: <> against <non-spec:/..//p> assert_equals: href expected "non-spec:/.//p" but got "non-spec:/..//p" -FAIL Parsing: <path> against <non-spec:/..//p> assert_equals: href expected "non-spec:/.//path" but got "non-spec:/..//path" -FAIL Parsing: <../path> against <non-spec:/.//p> assert_equals: href expected "non-spec:/path" but got "non-spec:/./path" -FAIL Parsing: <non-special://%E2%80%A0/> against <about:blank> assert_equals: host expected "%E2%80%A0" but got "" -FAIL Parsing: <non-special://H%4fSt/path> against <about:blank> assert_equals: host expected "H%4fSt" but got "" -FAIL Parsing: <non-special://[1:2:0:0:5:0:0:0]/> against <about:blank> assert_equals: href expected "non-special://[1:2:0:0:5::]/" but got "non-special://[1:2:0:0:5:0:0:0]/" -FAIL Parsing: <non-special://[1:2:0:0:0:0:0:3]/> against <about:blank> assert_equals: href expected "non-special://[1:2::3]/" but got "non-special://[1:2:0:0:0:0:0:3]/" -FAIL Parsing: <non-special://[1:2::3]:80/> against <about:blank> assert_equals: host expected "[1:2::3]:80" but got "" -FAIL Parsing: <non-special://[:80/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <blob:https://example.com:443/> against <about:blank> -PASS Parsing: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank> -PASS Parsing: <http://0x7f.0.0.0x7g> against <about:blank> -PASS Parsing: <http://0X7F.0.0.0X7G> against <about:blank> -FAIL Parsing: <http://[::127.0.0.0.1]> against <about:blank> assert_equals: failure should set href to input expected "http://[::127.0.0.0.1]" but got "http://[::127.0.0.0.1]/" -PASS Parsing: <http://[0:1:0:1:0:1:0:1]> against <about:blank> -PASS Parsing: <http://[1:0:1:0:1:0:1:0]> against <about:blank> -PASS Parsing: <http://example.org/test?"> against <about:blank> -PASS Parsing: <http://example.org/test?#> against <about:blank> -PASS Parsing: <http://example.org/test?<> against <about:blank> -PASS Parsing: <http://example.org/test?>> against <about:blank> -PASS Parsing: <http://example.org/test?⌣> against <about:blank> -PASS Parsing: <http://example.org/test?%23%23> against <about:blank> -PASS Parsing: <http://example.org/test?%GH> against <about:blank> -PASS Parsing: <http://example.org/test?a#%EF> against <about:blank> -PASS Parsing: <http://example.org/test?a#%GH> against <about:blank> -FAIL Parsing: <a> against <about:blank> assert_equals: failure should set href to input expected "a" but got "" -FAIL Parsing: <a/> against <about:blank> assert_equals: failure should set href to input expected "a/" but got "" -FAIL Parsing: <a//> against <about:blank> assert_equals: failure should set href to input expected "a//" but got "" -FAIL Parsing: <test-a-colon.html> against <a:> assert_equals: failure should set href to input expected "test-a-colon.html" but got "" -FAIL Parsing: <test-a-colon-b.html> against <a:b> assert_equals: failure should set href to input expected "test-a-colon-b.html" but got "" -PASS Parsing: <test-a-colon-slash.html> against <a:/> -FAIL Parsing: <test-a-colon-slash-slash.html> against <a://> assert_equals: href expected "a:///test-a-colon-slash-slash.html" but got "" -PASS Parsing: <test-a-colon-slash-b.html> against <a:/b> -FAIL Parsing: <test-a-colon-slash-slash-b.html> against <a://b> assert_equals: href expected "a://b/test-a-colon-slash-slash-b.html" but got "a://b" -PASS Parsing: <http://example.org/test?a#b\0c> against <about:blank> -FAIL Parsing: <non-spec://example.org/test?a#b\0c> against <about:blank> assert_equals: host expected "example.org" but got "" -PASS Parsing: <non-spec:/test?a#b\0c> against <about:blank> -PASS Parsing: <10.0.0.7:8080/foo.html> against <file:///some/dir/bar.html> -PASS Parsing: <a!@$*=/foo.html> against <file:///some/dir/bar.html> -PASS Parsing: <a1234567890-+.:foo/bar> against <http://example.com/dir/file> -PASS Parsing: <file://ab/p> against <about:blank> -PASS Parsing: <file://a%C2%ADb/p> against <about:blank> -FAIL Parsing: <file:///p> against <about:blank> assert_equals: failure should set href to input expected "file:///p" but got "file://%C2%AD/p" -PASS Parsing: <file://%C2%AD/p> against <about:blank> -FAIL Parsing: <file://xn--/p> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <#link> against <https://example.org/##link> -PASS Parsing: <non-special:cannot-be-a-base-url-\0~> against <about:blank> -PASS Parsing: <https://www.example.com/path{path.html?query'=query#fragment<fragment> against <about:blank> -PASS Parsing: <https://user:pass[@foo/bar> against <http://example.org> -FAIL Parsing: <foo:// !"$%&'()*+,-.;<=>@[\]^_`{|}~@host/> against <about:blank> assert_equals: href expected "foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/" but got "foo:// !\"$%&'()*+,-.;<=>@[\\]^_`{|}~@host/" -FAIL Parsing: <wss:// !"$%&'()*+,-.;<=>@[]^_`{|}~@host/> against <about:blank> assert_equals: href expected "wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/" but got "wss://%20!%22$%&%27()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/" -FAIL Parsing: <foo://joe: !"$%&'()*+,-.:;<=>@[\]^_`{|}~@host/> against <about:blank> assert_equals: href expected "foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/" but got "foo://joe: !\"$%&'()*+,-.:;<=>@[\\]^_`{|}~@host/" -FAIL Parsing: <wss://joe: !"$%&'()*+,-.:;<=>@[]^_`{|}~@host/> against <about:blank> assert_equals: href expected "wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/" but got "wss://joe:%20!%22$%&%27()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/" -FAIL Parsing: <foo://!"$%&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: host expected "!\"$%&'()*+,-.;=_`{}~" but got "" -FAIL Parsing: <wss://!"$&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: href expected "wss://!\"$&'()*+,-.;=_`{}~/" but got "wss://%21%22%24%26%27%28%29%2A+%2C-.%3B%3D_%60%7B%7D%7E/" -FAIL Parsing: <foo://host/ !"$%&'()*+,-./:;<=>@[\]^_`{|}~> against <about:blank> assert_equals: href expected "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~" but got "foo://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~" -FAIL Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\]^_`{|}~> against <about:blank> assert_equals: href expected "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~" but got "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B%7C%7D~" -FAIL Parsing: <foo://host/dir/? !"$%&'()*+,-./:;<=>?@[\]^_`{|}~> against <about:blank> assert_equals: href expected "foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~" but got "foo://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~" -PASS Parsing: <wss://host/dir/? !"$%&'()*+,-./:;<=>?@[\]^_`{|}~> against <about:blank> -FAIL Parsing: <foo://host/dir/# !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~> against <about:blank> assert_equals: host expected "host" but got "" -PASS Parsing: <wss://host/dir/# !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~> against <about:blank> -FAIL Parsing: <abc:rootless> against <abc://host/path> assert_equals: href expected "abc:rootless" but got "abc://host/rootless" -FAIL Parsing: <abc:rootless> against <abc:/path> assert_equals: href expected "abc:rootless" but got "abc:/rootless" -PASS Parsing: <abc:rootless> against <abc:path> -FAIL Parsing: <abc:/rooted> against <abc://host/path> assert_equals: href expected "abc:/rooted" but got "abc://host/rooted" -FAIL Parsing: <http://1.2.3.4.5> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://1.2.3.4.5.> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://0..0x300/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://0..0x300./> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://256.256.256.256.256> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://256.256.256.256.256.> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://1.2.3.08> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://1.2.3.08.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://1.2.3.09> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://09.2.3.4> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://09.2.3.4.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://01.2.3.4.5> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://01.2.3.4.5.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://0x100.2.3.4> against <about:blank> assert_equals: failure should set href to input expected "http://0x100.2.3.4" but got "http://0x100.2.3.4/" -FAIL Parsing: <http://0x100.2.3.4.> against <about:blank> assert_equals: failure should set href to input expected "http://0x100.2.3.4." but got "http://0x100.2.3.4./" -FAIL Parsing: <http://0x1.2.3.4.5> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://0x1.2.3.4.5.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://foo.1.2.3.4> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://foo.1.2.3.4.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://foo.2.3.4> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://foo.2.3.4.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://foo.09> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://foo.09.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://foo.0x4> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/url/a-element-xhtml-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/url/a-element-xhtml-expected.txt index 00d227d..0672b27 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/url/a-element-xhtml-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/url/a-element-xhtml-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 659 tests; 377 PASS, 282 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 664 tests; 378 PASS, 286 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -670,5 +670,10 @@ FAIL Parsing: <http://foo.09.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code FAIL Parsing: <http://foo.0x4> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +PASS Parsing: <http://foo.09..> against <about:blank> +FAIL Parsing: <http://0999999999999999999/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +FAIL Parsing: <http://foo.0x> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +FAIL Parsing: <http://foo.0XFfFfFfFfFfFfFfFfFfAcE123> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +FAIL Parsing: <http://💩.123/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/url/failure-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/url/failure-expected.txt index e5fd1f4..97b370c 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/url/failure-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/url/failure-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 611 tests; 275 PASS, 336 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 635 tests; 275 PASS, 360 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS URL's constructor's base argument: file://example:1/ should throw PASS URL's href: file://example:1/ should throw @@ -611,5 +611,29 @@ FAIL sendBeacon(): http://foo.0x4. should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw FAIL Location's href: http://foo.0x4. should throw assert_throws_js: function "() => self[0].location = test.input" did not throw FAIL window.open(): http://foo.0x4. should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://0999999999999999999/ should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://0999999999999999999/ should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://0999999999999999999/ should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://0999999999999999999/ should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://0999999999999999999/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://0999999999999999999/ should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://foo.0x should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://foo.0x should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://foo.0x should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://foo.0x should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://foo.0x should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://foo.0x should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://💩.123/ should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://💩.123/ should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://💩.123/ should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://💩.123/ should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://💩.123/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://💩.123/ should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/url/url-constructor.any-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/url/url-constructor.any-expected.txt index e931b952..bbe67c8 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/url/url-constructor.any-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/url/url-constructor.any-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 661 tests; 455 PASS, 206 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 666 tests; 456 PASS, 210 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -804,5 +804,18 @@ FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_throws_js: function "function() { bURL(expected.input, expected.base) }" did not throw +PASS Parsing: <http://foo.09..> against <about:blank> +FAIL Parsing: <http://0999999999999999999/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0x> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0XFfFfFfFfFfFfFfFfFfAcE123> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://💩.123/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/url/url-constructor.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/url/url-constructor.any.worker-expected.txt index e931b952..bbe67c8 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/url/url-constructor.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/url/url-constructor.any.worker-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 661 tests; 455 PASS, 206 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 666 tests; 456 PASS, 210 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -804,5 +804,18 @@ FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_throws_js: function "function() { bURL(expected.input, expected.base) }" did not throw +PASS Parsing: <http://foo.09..> against <about:blank> +FAIL Parsing: <http://0999999999999999999/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0x> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0XFfFfFfFfFfFfFfFfFfAcE123> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://💩.123/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-xhtml-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-xhtml-expected.txt index ac8155bb..3598b17 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-xhtml-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-xhtml-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 659 tests; 361 PASS, 298 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 664 tests; 362 PASS, 302 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -670,5 +670,10 @@ FAIL Parsing: <http://foo.09.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code FAIL Parsing: <http://foo.0x4> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +PASS Parsing: <http://foo.09..> against <about:blank> +FAIL Parsing: <http://0999999999999999999/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +FAIL Parsing: <http://foo.0x> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +FAIL Parsing: <http://foo.0XFfFfFfFfFfFfFfFfFfAcE123> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code +FAIL Parsing: <http://💩.123/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/url/failure-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/url/failure-expected.txt index f6f037b2..9e5f3af 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/url/failure-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/url/failure-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 611 tests; 271 PASS, 340 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 635 tests; 271 PASS, 364 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS URL's constructor's base argument: file://example:1/ should throw PASS URL's href: file://example:1/ should throw @@ -611,5 +611,29 @@ FAIL sendBeacon(): http://foo.0x4. should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw FAIL Location's href: http://foo.0x4. should throw assert_throws_js: function "() => self[0].location = test.input" did not throw FAIL window.open(): http://foo.0x4. should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://0999999999999999999/ should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://0999999999999999999/ should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://0999999999999999999/ should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://0999999999999999999/ should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://0999999999999999999/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://0999999999999999999/ should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://foo.0x should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://foo.0x should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://foo.0x should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://foo.0x should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://foo.0x should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://foo.0x should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://foo.0XFfFfFfFfFfFfFfFfFfAcE123 should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw +FAIL URL's constructor's base argument: http://💩.123/ should throw assert_throws_js: function "() => new URL("about:blank", test.input)" did not throw +FAIL URL's href: http://💩.123/ should throw assert_throws_js: function "() => url.href = test.input" did not throw +FAIL XHR: http://💩.123/ should throw assert_throws_dom: function "() => client.open("GET", test.input)" did not throw +FAIL sendBeacon(): http://💩.123/ should throw assert_throws_js: function "() => self.navigator.sendBeacon(test.input)" did not throw +FAIL Location's href: http://💩.123/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw +FAIL window.open(): http://💩.123/ should throw assert_throws_dom: function "() => self.open(test.input).close()" did not throw Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any-expected.txt index be7edeca..2ebecaa8 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 661 tests; 435 PASS, 226 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 666 tests; 436 PASS, 230 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -812,5 +812,18 @@ FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_throws_js: function "function() { bURL(expected.input, expected.base) }" did not throw +PASS Parsing: <http://foo.09..> against <about:blank> +FAIL Parsing: <http://0999999999999999999/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0x> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0XFfFfFfFfFfFfFfFfFfAcE123> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://💩.123/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any.worker-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any.worker-expected.txt index be7edeca..2ebecaa8 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any.worker-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 661 tests; 435 PASS, 226 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 666 tests; 436 PASS, 230 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -812,5 +812,18 @@ FAIL Parsing: <http://foo.0x4.> against <about:blank> assert_throws_js: function "function() { bURL(expected.input, expected.base) }" did not throw +PASS Parsing: <http://foo.09..> against <about:blank> +FAIL Parsing: <http://0999999999999999999/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0x> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://foo.0XFfFfFfFfFfFfFfFfFfAcE123> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw +FAIL Parsing: <http://💩.123/> against <about:blank> assert_throws_js: function "function() { + bURL(expected.input, expected.base) + }" did not throw Harness: the test ran to completion.
diff --git a/third_party/breakpad/BUILD.gn b/third_party/breakpad/BUILD.gn index 5fa90fb8..e94f6e7 100644 --- a/third_party/breakpad/BUILD.gn +++ b/third_party/breakpad/BUILD.gn
@@ -486,6 +486,14 @@ } } +# TODO(thakis): Remove this once we roll breakpad. +# Upstream fixes we need: +# https://chromium.googlesource.com/breakpad/breakpad/+/0d9416d3bfa659 +# https://chromium.googlesource.com/breakpad/breakpad/+/32096a2dc8f8a7 +config("temp_wunreach_config") { + cflags = [ "-Wno-unreachable-code-break" ] +} + if (is_linux || is_chromeos || is_android) { if (current_toolchain == host_toolchain) { executable("symupload") { @@ -509,6 +517,7 @@ "breakpad/src/third_party", ] + configs += [ ":temp_wunreach_config" ] configs += [ ":tools_config" ] libs = [ "dl" ] @@ -811,6 +820,8 @@ include_dirs = [ "breakpad/src" ] + configs += [ ":temp_wunreach_config" ] + deps = [ ":client" ] }
diff --git a/third_party/freetype/README.chromium b/third_party/freetype/README.chromium index c134b33..2eb00391 100644 --- a/third_party/freetype/README.chromium +++ b/third_party/freetype/README.chromium
@@ -1,7 +1,7 @@ Name: FreeType URL: http://www.freetype.org/ -Version: VER-2-11-0-22-gfed552101 -Revision: fed5521016227bf8cc4475f66450a9963568d162 +Version: VER-2-11-0-26-gf44c2d586 +Revision: f44c2d586064bcccdb504bf098b9dc78e660269e CPEPrefix: cpe:/a:freetype:freetype:2.10.4 License: Custom license "inspired by the BSD, Artistic, and IJG (Independent JPEG Group) licenses"
diff --git a/third_party/grpc/BUILD.gn b/third_party/grpc/BUILD.gn index 0c194f8..b844ef65 100644 --- a/third_party/grpc/BUILD.gn +++ b/third_party/grpc/BUILD.gn
@@ -80,7 +80,7 @@ "-Wno-sign-compare", "-Wno-sometimes-uninitialized", "-Wno-string-concatenation", - "-Wno-unreachable-code", + "-Wno-unreachable-code-aggressive", "-Wno-unused-variable", ] }
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index fb27055e..ab21932 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -28957,6 +28957,7 @@ <int value="1569" label="SCRIPTING_UNREGISTERCONTENTSCRIPTS"/> <int value="1570" label="FILEMANAGERPRIVATE_GETZIPPROGRESS"/> <int value="1571" label="CRYPTOTOKENPRIVATE_CANMAKEU2FAPIREQUEST"/> + <int value="1572" label="OS_DIAGNOSTICS_RUNBATTERYCAPACITYROUTINE"/> </enum> <enum name="ExtensionIconState">
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index dd734a9..44457f6 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -6621,6 +6621,9 @@ <histogram name="Fonts.AccessAPI.EnumerationCache.DuplicateFontCount" units="count" expires_after="M90"> + <obsolete> + Removed in M95 + </obsolete> <owner>oyiptong@chromium.org</owner> <owner>storage-dev@chromium.org</owner> <summary> @@ -6632,6 +6635,9 @@ <histogram name="Fonts.AccessAPI.EnumerationCache.Dwrite.FamilyCount" units="families" expires_after="M90"> + <obsolete> + Removed in M95 + </obsolete> <owner>oyiptong@chromium.org</owner> <owner>storage-dev@chromium.org</owner> <summary> @@ -6643,6 +6649,9 @@ <histogram name="Fonts.AccessAPI.EnumerationCache.Dwrite.GetSystemFontCollectionResult" enum="Hresult" expires_after="M90"> + <obsolete> + Removed in M95 + </obsolete> <owner>oyiptong@chromium.org</owner> <owner>storage-dev@chromium.org</owner> <summary> @@ -6654,6 +6663,9 @@ <histogram name="Fonts.AccessAPI.EnumerationCache.Dwrite.MostFrequentEnumerationFailure" enum="Hresult" expires_after="M90"> + <obsolete> + Removed in M95 + </obsolete> <owner>oyiptong@chromium.org</owner> <owner>storage-dev@chromium.org</owner> <summary> @@ -6679,6 +6691,9 @@ <histogram name="Fonts.AccessAPI.EnumerationCache.Fontconfig.FontCount" units="count" expires_after="M90"> + <obsolete> + Removed in M95 + </obsolete> <owner>oyiptong@chromium.org</owner> <owner>storage-dev@chromium.org</owner> <summary>The number of fonts returned by fontconfig.</summary> @@ -6687,6 +6702,9 @@ <histogram name="Fonts.AccessAPI.EnumerationCache.Fontconfig.IncompleteFontCount" units="count" expires_after="M90"> + <obsolete> + Removed in M95 + </obsolete> <owner>oyiptong@chromium.org</owner> <owner>storage-dev@chromium.org</owner> <summary> @@ -6696,6 +6714,9 @@ <histogram name="Fonts.AccessAPI.EnumerationTime" units="ms" expires_after="2021-06-20"> + <obsolete> + Removed in M95 + </obsolete> <owner>oyiptong@chromium.org</owner> <owner>storage-dev@chromium.org</owner> <summary>Time spent enumerating fonts.</summary>
diff --git a/tools/metrics/histograms/metadata/sync/histograms.xml b/tools/metrics/histograms/metadata/sync/histograms.xml index 0eb67335..f6dcb42 100644 --- a/tools/metrics/histograms/metadata/sync/histograms.xml +++ b/tools/metrics/histograms/metadata/sync/histograms.xml
@@ -554,7 +554,7 @@ expires_after="never"> <!-- expires-never: For monitoring FCM based invalidations. --> - <owner>mmoskvitin@chromium.org</owner> + <owner>mmoskvitin@google.com</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> <summary> @@ -1186,8 +1186,8 @@ </histogram> <histogram name="Sync.RecordedUserEventType" enum="SyncUserEventType" - expires_after="2021-09-30"> - <owner>mmoskvitin@chromium.org</owner> + expires_after="2022-03-01"> + <owner>mmoskvitin@google.com</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> <summary> @@ -1215,7 +1215,7 @@ <histogram name="Sync.RedundantInvalidationPerModelType2" enum="SyncModelTypes" expires_after="2021-12-16"> - <owner>mmoskvitin@chromium.org</owner> + <owner>mmoskvitin@google.com</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> <summary>
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index 575a222..f3c510a 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -4713,6 +4713,20 @@ </metric> </event> +<event name="CrossOriginSubframeWithoutEmbeddingControl"> + <owner>clamy@chromium.org</owner> + <summary> + Recorded when a subframe is embedded in a cross-origin context without + having a CSP frame-ancestor header or an XFO header. + </summary> + <metric name="SubframeEmbedded"> + <summary> + Mesaures the number of pages with subframes embedded in cross-origin + contexts without having a CSP frame-ancestor header or an XFO header. + </summary> + </metric> +</event> + <event name="DataReductionProxy" singular="True"> <owner>robertogden@chromium.org</owner> <summary>
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config index 22b1d98..084dea22 100644 --- a/tools/perf/expectations.config +++ b/tools/perf/expectations.config
@@ -88,6 +88,13 @@ # Benchmark: desktop_ui crbug.com/1234011 [ win-laptop ] desktop_ui/tab_search:top50:2020 [ Skip ] +crbug.com/1239010 [ win ] desktop_ui/download_shelf_webui:top10:loading [ Skip ] +crbug.com/1239010 [ win ] desktop_ui/download_shelf:1file [ Skip ] +crbug.com/1239010 [ win ] desktop_ui/download_shelf:5file [ Skip ] +crbug.com/1239010 [ win-laptop ] desktop_ui/download_shelf:measure_memory [ Skip ] +crbug.com/1239010 [ win ] desktop_ui/download_shelf:top10:loading [ Skip ] +crbug.com/1239010 [ win ] desktop_ui/download_shelf_webui:1file [ Skip ] +crbug.com/1239010 [ win ] desktop_ui/download_shelf_webui:5file [ Skip ] # Benchmark: dromaeo crbug.com/1050065 [ android-pixel-2 ] dromaeo/http://dromaeo.com?dom-modify [ Skip ]
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc index e0d4481..ce41893 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc
@@ -1103,6 +1103,15 @@ ui::mojom::DragOperation MenuController::OnPerformDrop( SubmenuView* source, const ui::DropTargetEvent& event) { + auto drop_cb = GetDropCallback(source, event); + ui::mojom::DragOperation output_drag_op = ui::mojom::DragOperation::kNone; + std::move(drop_cb).Run(event, output_drag_op); + return output_drag_op; +} + +views::View::DropCallback MenuController::GetDropCallback( + SubmenuView* source, + const ui::DropTargetEvent& event) { DCHECK(drop_target_); // NOTE: the delegate may delete us after invoking OnPerformDrop, as such // we don't call cancel here. @@ -1133,8 +1142,8 @@ // WARNING: the call to MenuClosed deletes us. - return drop_target->GetDelegate()->OnPerformDrop(drop_target, drop_position, - event); + return drop_target->GetDelegate()->GetDropCallback(drop_target, drop_position, + event); } void MenuController::OnDragEnteredScrollButton(SubmenuView* source,
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h index 6d2c89e..a9d4625b7 100644 --- a/ui/views/controls/menu/menu_controller.h +++ b/ui/views/controls/menu/menu_controller.h
@@ -193,6 +193,8 @@ void OnDragExited(SubmenuView* source); ui::mojom::DragOperation OnPerformDrop(SubmenuView* source, const ui::DropTargetEvent& event); + views::View::DropCallback GetDropCallback(SubmenuView* source, + const ui::DropTargetEvent& event); // Invoked from the scroll buttons of the MenuScrollViewContainer. void OnDragEnteredScrollButton(SubmenuView* source, bool is_up);
diff --git a/ui/views/controls/menu/menu_controller_unittest.cc b/ui/views/controls/menu/menu_controller_unittest.cc index 6765ef8..da9867c7 100644 --- a/ui/views/controls/menu/menu_controller_unittest.cc +++ b/ui/views/controls/menu/menu_controller_unittest.cc
@@ -1678,7 +1678,7 @@ TestMenuDelegate* menu_delegate = static_cast<TestMenuDelegate*>(target->GetDelegate()); TestMenuControllerDelegate* controller_delegate = menu_controller_delegate(); - EXPECT_TRUE(menu_delegate->on_perform_drop_called()); + EXPECT_TRUE(menu_delegate->is_drop_performed()); EXPECT_FALSE(IsShowing()); EXPECT_EQ(0, controller_delegate->on_menu_closed_called()); } @@ -1732,6 +1732,33 @@ MenuHostOnDragComplete(host); } +// Tests that getting the drop callback stops the menu from showing and +// does not notify the controller. +TEST_F(MenuControllerTest, AsycDropCallback) { + MenuController* controller = menu_controller(); + SubmenuView* source = menu_item()->GetSubmenu(); + MenuItemView* target = source->GetMenuItemAt(0); + + SetDropMenuItem(target, MenuDelegate::DropPosition::kAfter); + + ui::OSExchangeData drop_data; + gfx::PointF location(target->origin()); + ui::DropTargetEvent target_event(drop_data, location, location, + ui::DragDropTypes::DRAG_MOVE); + auto drop_cb = controller->GetDropCallback(source, target_event); + + TestMenuDelegate* menu_delegate = + static_cast<TestMenuDelegate*>(target->GetDelegate()); + TestMenuControllerDelegate* controller_delegate = menu_controller_delegate(); + EXPECT_FALSE(menu_delegate->is_drop_performed()); + EXPECT_FALSE(IsShowing()); + EXPECT_EQ(0, controller_delegate->on_menu_closed_called()); + + ui::mojom::DragOperation output_drag_op; + std::move(drop_cb).Run(target_event, output_drag_op); + EXPECT_TRUE(menu_delegate->is_drop_performed()); +} + // Widget destruction and cleanup occurs on the MessageLoop after the // MenuController has been destroyed. A MenuHostRootView should not attempt to // access a destroyed MenuController. This test should not cause a crash.
diff --git a/ui/views/controls/menu/submenu_view.cc b/ui/views/controls/menu/submenu_view.cc index 801def8..693090e 100644 --- a/ui/views/controls/menu/submenu_view.cc +++ b/ui/views/controls/menu/submenu_view.cc
@@ -276,6 +276,12 @@ return parent_menu_item_->GetMenuController()->OnPerformDrop(this, event); } +views::View::DropCallback SubmenuView::GetDropCallback( + const ui::DropTargetEvent& event) { + DCHECK(parent_menu_item_->GetMenuController()); + return parent_menu_item_->GetMenuController()->GetDropCallback(this, event); +} + bool SubmenuView::OnMouseWheel(const ui::MouseWheelEvent& e) { gfx::Rect vis_bounds = GetVisibleBounds(); const auto menu_items = GetMenuItems();
diff --git a/ui/views/controls/menu/submenu_view.h b/ui/views/controls/menu/submenu_view.h index 627c4d4..2f1efd1 100644 --- a/ui/views/controls/menu/submenu_view.h +++ b/ui/views/controls/menu/submenu_view.h
@@ -94,6 +94,8 @@ void OnDragExited() override; ui::mojom::DragOperation OnPerformDrop( const ui::DropTargetEvent& event) override; + views::View::DropCallback GetDropCallback( + const ui::DropTargetEvent& event) override; // Scrolls on menu item boundaries. bool OnMouseWheel(const ui::MouseWheelEvent& e) override;
diff --git a/ui/views/test/menu_test_utils.cc b/ui/views/test/menu_test_utils.cc index cd75fd54..9e5c0fa6 100644 --- a/ui/views/test/menu_test_utils.cc +++ b/ui/views/test/menu_test_utils.cc
@@ -45,8 +45,17 @@ MenuItemView* menu, DropPosition position, const ui::DropTargetEvent& event) { - on_perform_drop_called_ = true; - return ui::mojom::DragOperation::kCopy; + auto drop_cb = GetDropCallback(menu, position, event); + ui::mojom::DragOperation output_drag_op = ui::mojom::DragOperation::kNone; + std::move(drop_cb).Run(event, output_drag_op); + return output_drag_op; +} + +views::View::DropCallback TestMenuDelegate::GetDropCallback( + MenuItemView* menu, + DropPosition position, + const ui::DropTargetEvent& event) { + return base::BindOnce(&TestMenuDelegate::PerformDrop, base::Unretained(this)); } int TestMenuDelegate::GetDragOperations(MenuItemView* sender) { @@ -61,6 +70,12 @@ will_hide_menu_ = menu; } +void TestMenuDelegate::PerformDrop(const ui::DropTargetEvent& event, + ui::mojom::DragOperation& output_drag_op) { + is_drop_performed_ = true; + output_drag_op = ui::mojom::DragOperation::kCopy; +} + // MenuControllerTestApi ------------------------------------------------------ MenuControllerTestApi::MenuControllerTestApi()
diff --git a/ui/views/test/menu_test_utils.h b/ui/views/test/menu_test_utils.h index ecaaf2f..b6e8ee6a 100644 --- a/ui/views/test/menu_test_utils.h +++ b/ui/views/test/menu_test_utils.h
@@ -12,6 +12,7 @@ #include "base/memory/weak_ptr.h" #include "ui/views/controls/menu/menu_delegate.h" #include "ui/views/test/test_views_delegate.h" +#include "ui/views/view.h" namespace views { @@ -31,7 +32,7 @@ int execute_command_id() const { return execute_command_id_; } int on_menu_closed_called() const { return on_menu_closed_called_count_; } MenuItemView* on_menu_closed_menu() const { return on_menu_closed_menu_; } - bool on_perform_drop_called() { return on_perform_drop_called_; } + bool is_drop_performed() { return is_drop_performed_; } int will_hide_menu_count() { return will_hide_menu_count_; } MenuItemView* will_hide_menu() { return will_hide_menu_; } @@ -46,11 +47,19 @@ MenuItemView* menu, DropPosition position, const ui::DropTargetEvent& event) override; + views::View::DropCallback GetDropCallback( + MenuItemView* menu, + DropPosition position, + const ui::DropTargetEvent& event) override; int GetDragOperations(MenuItemView* sender) override; void WriteDragData(MenuItemView* sender, OSExchangeData* data) override; void WillHideMenu(MenuItemView* menu) override; private: + // Performs the drop operation and updates |output_drag_op| accordingly. + void PerformDrop(const ui::DropTargetEvent& event, + ui::mojom::DragOperation& output_drag_op); + // The number of times ShowContextMenu was called. int show_context_menu_count_ = 0; @@ -72,7 +81,7 @@ // The value of the last call to WillHideMenu. MenuItemView* will_hide_menu_ = nullptr; - bool on_perform_drop_called_ = false; + bool is_drop_performed_ = false; DISALLOW_COPY_AND_ASSIGN(TestMenuDelegate); };